...
VATEntry@1100001 : Record 254;
Amount@1100000 : ARRAY [3] OF Decimal;
AccPrevDeclAmount@1100005 : ARRAY [3] OF Decimal;
AccOrigDeclAmount@1100004 : ARRAY [3] OF Decimal;
i@1100002 : Integer;
BEGIN
// es0014.begin
WHILE (Customer."VAT Registration No." = PreVATRegNo) OR (Customer."VAT Registration No." = '') DO // ES0032
IF Customer.NEXT = 0 THEN
EXIT;
...
...
VATEntry@1100001 : Record 254;
Amount@1100000 : ARRAY [3] OF Decimal;
AccPrevDeclAmount@1100005 : ARRAY [3] OF Decimal;
AccOrigDeclAmount@1100004 : ARRAY [3] OF Decimal;
i@1100002 : Integer;
// Add the following lines.
CreditMemoOrgDeclaredAmt@1100003 : Decimal;
CreditMemoAmt@1100006 : Decimal;
AppliedAmt@1100008 : Decimal;
IsCreditMomoPrinted@1100007 : Boolean;
// End of the added lines.
BEGIN
// es0014.begin
WHILE (Customer."VAT Registration No." = PreVATRegNo) OR (Customer."VAT Registration No." = '') DO // ES0032
IF Customer.NEXT = 0 THEN
EXIT;
...
...
IF CustVendWarning349."EU 3-Party Trade" THEN BEGIN
AmountOpTri := AmountOpTri + CustVendWarning349."Original Declared Amount";
CorrIncludedForOpTriAmount := TRUE;
END ELSE BEGIN
VATEntry.GET(CustVendWarning349."VAT Entry No.");
// Delete the following line.
SummarizeBaseAmount(VATEntry,CustVendWarning349."Original Declared Amount",Amount);
// End of the deleted line.
CorrIncludedForNormalAmount := TRUE;
END;
END;
// es0033.end
END;
...
...
IF CustVendWarning349."EU 3-Party Trade" THEN BEGIN
AmountOpTri := AmountOpTri + CustVendWarning349."Original Declared Amount";
CorrIncludedForOpTriAmount := TRUE;
END ELSE BEGIN
VATEntry.GET(CustVendWarning349."VAT Entry No.");
// Add the following lines.
IF ABS(Amount[1]) >= GetTotalCreditMemoAmt - AppliedAmt THEN BEGIN
AppliedAmt += ABS(Amount[1]);
SummarizeBaseAmount(VATEntry,CustVendWarning349."Original Declared Amount",Amount);
AppliedAmt -= ABS(Amount[1]);
END ELSE BEGIN
CreditMemoOrgDeclaredAmt += CustVendWarning349."Original Declared Amount";
CreditMemoAmt += VATEntry.Base;
NoOfCorrections += 1;
IsCreditMomoPrinted := TRUE;
END;
// End of the added lines.
CorrIncludedForNormalAmount := TRUE;
END;
END;
// es0033.end
END;
...
...
'S' + CONVERTSTR(TextAmount,' ','0') + PADSTR('',354,' ');
NoOperations := NoOperations + 1;
TotalAmtShip := TotalAmtShip + AmountEUService;
OutFile.WRITE(Txt);
END;
// es0033.end
END;
END;
// es0014.end
END;
...
...
'S' + CONVERTSTR(TextAmount,' ','0') + PADSTR('',354,' ');
NoOperations := NoOperations + 1;
TotalAmtShip := TotalAmtShip + AmountEUService;
OutFile.WRITE(Txt);
END;
// Add the following lines.
IF IsCreditMomoPrinted THEN BEGIN
TextAmount2 := COPYSTR(FormatTextAmt(ABS(CreditMemoOrgDeclaredAmt)),3,13);
TextAmount := COPYSTR(FormatTextAmt(ABS(CreditMemoAmt)),3,13);
CustVendCountry.GET(Customer2."Country/Region Code");
Txt :=
'2' + '349' + FiscalYear + PADSTR(VatRegNo,9,' ') + PADSTR('',58,' ') +
FORMAT(CustVendCountry."EU Country/Region Code",2) + FORMAT(CustVendVatRegNo,15) +
PADSTR(CONVERTSTR(UPPERCASE(Customer2.Name),'µ·ÔÖÞàãé륚€()"&ï','AAEEIIOOUUÑUÇ '),40,' ') +
'E' + PADSTR('',13,' ') + CustVendWarning349."Original Declaration FY" +
CustVendWarning349."Original Declaration Period" + TextAmount2 + TextAmount +
PADSTR('',322,' ');
NoOperations += 1;
TotalAmtShip += AmountEUService;
OutFile.WRITE(Txt);
END;
// End of the added lines.
// es0033.end
END;
END;
// es0014.end
END;
...