16
If a payment needs to be applied to a invoice that is created on a later date, it cannot be applied to the related invoice.
The prepayment functionality creates an additional document that, in this case, is not relevant as the total invoice is paid upfront.
For that reason, we changed the code in PAG232 Apply Customer Entries (and likewise for Vendor), in order to make this possible: (see //TFS)
OnQueryClosePage(CloseAction : Action None) : Boolean
IF CloseAction = ACTION::LookupOK THEN
LookupOKOnPush;
IF ApplnType = ApplnType::"Applies-to Doc. No." THEN BEGIN
SalesSetup.GET; //TFS
IF NOT SalesSetup."Apply Payment On a Later Date" THEN BEGIN //TFS
IF OK AND (ApplyingCustLedgEntry."Posting Date" < "Posting Date") THEN BEGIN
OK := FALSE;
ERROR(
EarlierPostingDateErr,ApplyingCustLedgEntry."Document Type",ApplyingCustLedgEntry."Document No.",
"Document Type","Document No.");
END;
END; //TFS
IF OK THEN BEGIN
IF "Amount to Apply" = 0 THEN
"Amount to Apply" := "Remaining Amount";
CODEUNIT.RUN(CODEUNIT::"Cust. Entry-Edit",Rec);
END;
END;
IF (CalcType = CalcType::Direct) AND NOT OK AND NOT PostingDone THEN BEGIN
Rec := ApplyingCustLedgEntry;
"Applying Entry" := FALSE;
"Applies-to ID" := '';
"Amount to Apply" := 0;
CODEUNIT.RUN(CODEUNIT::"Cust. Entry-Edit",Rec);
END;
Could Microsoft take a look into this?
The prepayment functionality creates an additional document that, in this case, is not relevant as the total invoice is paid upfront.
For that reason, we changed the code in PAG232 Apply Customer Entries (and likewise for Vendor), in order to make this possible: (see //TFS)
OnQueryClosePage(CloseAction : Action None) : Boolean
IF CloseAction = ACTION::LookupOK THEN
LookupOKOnPush;
IF ApplnType = ApplnType::"Applies-to Doc. No." THEN BEGIN
SalesSetup.GET; //TFS
IF NOT SalesSetup."Apply Payment On a Later Date" THEN BEGIN //TFS
IF OK AND (ApplyingCustLedgEntry."Posting Date" < "Posting Date") THEN BEGIN
OK := FALSE;
ERROR(
EarlierPostingDateErr,ApplyingCustLedgEntry."Document Type",ApplyingCustLedgEntry."Document No.",
"Document Type","Document No.");
END;
END; //TFS
IF OK THEN BEGIN
IF "Amount to Apply" = 0 THEN
"Amount to Apply" := "Remaining Amount";
CODEUNIT.RUN(CODEUNIT::"Cust. Entry-Edit",Rec);
END;
END;
IF (CalcType = CalcType::Direct) AND NOT OK AND NOT PostingDone THEN BEGIN
Rec := ApplyingCustLedgEntry;
"Applying Entry" := FALSE;
"Applies-to ID" := '';
"Amount to Apply" := 0;
CODEUNIT.RUN(CODEUNIT::"Cust. Entry-Edit",Rec);
END;
Could Microsoft take a look into this?
STATUS DETAILS
Needs Votes
Business Central Team (administrator)
Thank you for this suggestion! Currently this is not on our roadmap. We are tracking this idea and if it gathers more votes and comments we will consider it in the future.
Best regards,
Business Central Team