Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

Error message when you print the Salary Payment Order report in the Swiss version of Microsoft Dynamics NAV 2009 SP1: "Payment on bank 1 of staff 'ABC' is with -XXX less than 0"


View products that this article applies to.

Symptoms

When you print the Salary Payment Order report (3010606) in the Swiss version of Microsoft Dynamics NAV 2009 SP1 you receive the following error:

Payment on bank 1 of staff 'ABC' is with -xxx less than 0. Check allocated salaries on bank 1 and 2 and rerun the payday if necessary.

↑ Back to the top


Cause

This problem occurs if you have a negative gross salary, for example due to a correction, but a positive net salary.

↑ Back to the top


Resolution

Code changes

Note Always test code fixes in a controlled environment before you apply the fixes to your production computers.
To resolve this problem, follow these steps:

1.  Change the code in the OnAfterGetRecord of DataItem 2 in the Salary Payment Order report (3010606) as follows:

Existing code
 

  DirectPay1 := DirectPay1 + Amount
ELSE
  DirectPay2 := DirectPay2 + Amount;
IF DirectPay2 <> 0 THEN BEGIN
  NetPayment1 := DirectPay1;
  NetPayment2 := DirectPay2;

Replacement code

  DirectPay1 := DirectPay1 + Amount
ELSE
  DirectPay2 := DirectPay2 + Amount;
RecordCount := RecordCount + 1; 
IF RecordCount <> "Salary Entry".COUNT THEN
  CurrReport.SKIP;
IF DirectPay2 <> 0 THEN BEGIN
  NetPayment1 := DirectPay1;
  NetPayment2 := DirectPay2;

Existing code 
… 
    BenAdr := Staff."Beneficiary Address 2";
    BenCity := '';
  END;
  RecordCount := RecordCount + 1;
  IF RecordCount <> "Salary Entry".COUNT THEN
    CurrReport.SKIP;
END;

Replacement code

    BenAdr := Staff."Beneficiary Address 2";
    BenCity := '';
  END;
END;

↑ Back to the top


Keywords: kbmbspartner, kbmbsmigrate, vkball, kb

↑ Back to the top

Article Info
Article ID : 2018739
Revision : 2
Created on : 1/27/2017
Published on : 1/27/2017
Exists online : False
Views : 304