...
END;
END;
// Delete the following line.
PROCEDURE FindCustVATSetup@1110001(VAR VATSetup@1110000 : Record 325;CustLedgEntry4@1110011 : Record 21) : Boolean;
VAR
SalesLine2@1110010 : Record 113;
ExistsVATNoReal@1110004 : Boolean;
...
...
END;
END;
// Add the following line.
PROCEDURE FindCustVATSetup@1110001(VAR VATSetup@1110000 : Record 325;CustLedgEntry4@1110011 : Record 21;IsFromJournal@1110002 : Boolean) : Boolean;
VAR
SalesLine2@1110010 : Record 113;
ExistsVATNoReal@1110004 : Boolean;
...
...
SalesLine2@1110010 : Record 113;
ExistsVATNoReal@1110004 : Boolean;
ServiceLine2@1110001 : Record 5993;
// Delete the following lines.
BEGIN
SalesLine2.SETRANGE("Document No.",CustLedgEntry4."Document No.");
IF SalesLine2.FIND('-') THEN
REPEAT
CheckPctUnrealVATType(VATSetup, SalesLine2."VAT Bus. Posting Group",SalesLine2."VAT Prod. Posting Group",ExistsVATNoReal);
UNTIL SalesLine2.NEXT = 0
ELSE BEGIN
ServiceLine2.SETRANGE("Document No.",CustLedgEntry4."Document No.");
ServiceLine2.FIND('-');
REPEAT
CheckPctUnrealVATType(VATSetup, ServiceLine2."VAT Bus. Posting Group",ServiceLine2."VAT Prod. Posting Group",ExistsVATNoReal);
UNTIL ServiceLine2.NEXT = 0;
// End of the lines.
END;
EXIT(ExistsVATNoReal);
END;
...
...
SalesLine2@1110010 : Record 113;
ExistsVATNoReal@1110004 : Boolean;
ServiceLine2@1110001 : Record 5993;
// Add the following lines.
GLEntry@1110003 : Record 17;
BEGIN
IF IsFromJournal THEN BEGIN
GLEntry.SETCURRENTKEY("Document No.","Posting Date");
GLEntry.SETRANGE("Document No.",CustLedgEntry4."Document No.");
IF GLEntry.FINDFIRST THEN
CheckPctUnrealVATType(VATSetup,GLEntry."VAT Bus. Posting Group",GLEntry."VAT Prod. Posting Group",ExistsVATNoReal);
END ELSE BEGIN
SalesLine2.SETRANGE("Document No.",CustLedgEntry4."Document No.");
IF SalesLine2.FINDSET THEN
REPEAT
CheckPctUnrealVATType(VATSetup,SalesLine2."VAT Bus. Posting Group",SalesLine2."VAT Prod. Posting Group",ExistsVATNoReal);
UNTIL SalesLine2.NEXT = 0
ELSE BEGIN
ServiceLine2.SETRANGE("Document No.",CustLedgEntry4."Document No.");
IF ServiceLine2.FINDSET THEN
REPEAT
CheckPctUnrealVATType(
VATSetup,
ServiceLine2."VAT Bus. Posting Group",
ServiceLine2."VAT Prod. Posting Group",
ExistsVATNoReal);
UNTIL ServiceLine2.NEXT = 0;
END;
// End of the lines.
END;
EXIT(ExistsVATNoReal);
END;
...