Hi All,
I have a requirement to do automatic payments while posting the invoice.
I used the based functionality 'Payment Methods' with Balance account type as Bank account and then choosing the Bank account and then assigning the payment method in the Vendors also made sure that the purchase invoice is with the Balance account no. It is working fine by posting the Purchase invoice and also posting the Payment entry against it at once.
Now, the requirement is to make the payment entry picking a different 'No Series' than the same purchase invoice no. itself.
I did a customization in Codeunit 90 where it starts to check whether it has the Balance Account No. (It starts with 'IF "Bal. Account No." <> '' THEN BEGIN' ) to pick a 'Payment' no. series from No. Series Line and assign it to Document No. (After this: GenJnlLine."Document Type" := GenJnlLine."Document Type"::Payment;).
The Problem is that it is getting Inconsistency error while posting the Purchase invoice. Please find the attached image to look into the error message.
Kindly guide whether there is anyway to achieve a payment no. series for the applied payment entry instead of the same invoice no. itself.
Thanks in advance.
*This post is locked for comments