Strict Next Sales invoice

fahdfahd Member Posts: 226
Dear Experts,

We are also dealing with whole sale business and we are generating invoices to customers from Sales & Marketing Module of Navision.

I have a scenario like

If the customer has not paid the payment for the last invoice we should not be able to generate new invoice.

can we strict it that way while generating invoice.

for example we generated an invoice to the customer ABC worth of 400 Dirhams with invoice number PSI-0001.

Now the user is going to generate a new invoice which would be invoice number PSI-0002. or any other number.

If the customer has not payed for PSI-0001, system should stop and give message that "LAST INVOICE HAS NOT YET PAYED FOR THIS CUSTOMER"

Kindly advice if that is possible, IF possible then where and how can i restrict this.

I know by default the system gives warning of the overdue balance, but in this case system should not let us make a new invoice unless the payment for last invoice is payed.

Thanks!

Comments

  • vijay_gvijay_g Member Posts: 884
    Check that the customer should not have any open invoice while creating every new invoice. Put this code when you release invoice.
    Make sure that you have been applying each payment to corresponding invoice while doing payment entry.
    CustLedgerEntry.SETCURRENTKEY("Customer No.",Open);
    CustLedgerEntry.SETRANGE("Customer No.","Customer No.");
    CustLedgerEntry.SETRANGE(Open,TRUE);
    CustLedgerEntry.SETRANGE("Document Type",CustLedgerEntry."Document Type"::INVOICE);
    IF CustLedgerEntry.FINDFIRST THEN
       ERROR('LAST INVOICE HAS NOT YET PAYED FOR THIS CUSTOMER');
    
Sign In or Register to comment.