Sales Credit Memo posting error (version 5)

NoelineNoeline Member Posts: 54
Hi there

When I post a sales credit memo it gives the following error:-

[i]Amount -64,314.681755982 needs to be rounded in Gen. Journal Line Journal Template Name=",Journal Batch Name=",Line No.='0'[/i]

It appears to have to do with the additional reporting currency and it crashes in
Code(CheckLine)

WITH GenJnlLine DO BEGIN
  IF EmptyLine THEN BEGIN
    LastDocType := "Document Type";
    LastDocNo := "Document No.";
    LastLineNo := "Line No.";
    LastDate := "Posting Date";
    EXIT;
  END;

  IF CheckLine THEN BEGIN
    IF OverrideDimErr THEN
      GenJnlCheckLine.SetOverDimErr;
    GenJnlCheckLine.RunCheck(GenJnlLine,TempJnlLineDim);
  END;
  IF "Currency Code" = '' THEN BEGIN
    Currency.InitRoundingPrecision;
    "Amount (LCY)" := Amount;
    "VAT Amount (LCY)" := "VAT Amount";
    "VAT Base Amount (LCY)" := "VAT Base Amount";
  END ELSE BEGIN
    Currency.GET("Currency Code");
    Currency.TESTFIELD("Amount Rounding Precision");
    IF NOT "System-Created Entry" THEN BEGIN
      "Source Currency Code" := "Currency Code";
      "Source Currency Amount" := Amount;
      "Source Curr. VAT Base Amount" := "VAT Base Amount";
      "Source Curr. VAT Amount" := "VAT Amount";
    END;
  END;
  IF "Additional-Currency Posting" = "Additional-Currency Posting"::None THEN BEGIN
    [u][b]IF Amount <> ROUND(Amount,Currency."Amount Rounding Precision") THEN
      FIELDERROR(
        Amount,
        STRSUBSTNO(Text000,Amount));[/b][/u]    IF "Amount (LCY)" <> ROUND("Amount (LCY)") THEN
      FIELDERROR(
        "Amount (LCY)",
        STRSUBSTNO(Text000,"Amount (LCY)"));
  END;

The customer has the same foreign currency as the ACY which is EUR, which may or may not be relevant. It does not happen every time with this customer. Just with this one credit note so far. My concern is that it will happen again and I have no idea why, or how to prevent it.

Any ideas will be greatly appreciated.

Comments

  • jannestigjannestig Member Posts: 1,000
    This is one that had me hammering my head for a while

    You are obviousbly trying to apply the credit not against a certain document. In your case you need to see how many decimal point the application currecny are set to as you will probably find that it will only apply to .00001 etc depending how you have it setup.

    You can go to the GL entry to see what level of decimals it goes down to.
  • NoelineNoeline Member Posts: 54
    I found a meantime workaround - If I simply 'ctrl-x' and the 'ctrl-v' on 'line amount excl VAT' it seems to solve the problem and the document posts.

    This obviously forces some kind of validate which the 'get posted document lines' did not do automatically as they are loaded.

    Regards - Noeline
Sign In or Register to comment.