...
ResidentIDText := '';
CorreInvoiceText := '';
...
...
ResidentIDText := '';
CorreInvoiceText := '';
DocumentDate := VATEntry."Document Date";
...
...
OperationDateText := FormatDate(VATEntryRec."Posting Date");
IF Counter = 1 THEN BEGIN
VATBuffer2."EC %" := 0;
// Delete the following line.
CreateTempDeclarationLines(PADSTR(VendVATNumber,9,' '),Vendor."No.",Vendor.Name,VATEntryRec."Document Date",
VendorDocumentNo,FORMAT(VATEntryRec."Document Type"),PADSTR(VATEntryRec."Document No.",18,' '),
'00000001',PADSTR(CorreInvoiceText,40,' '));
END ELSE BEGIN
// Delete the following line.
CreateTempDeclarationLines(PADSTR(VendVATNumber,9,' '),Vendor."No.",Vendor.Name,VATEntryRec."Document Date",
VendorDocumentNo,FORMAT(VATEntryRec."Document Type"),PADSTR(VATEntryRec."Document No.",18,' '),
'000000000000000001',FormatTextAmt(VATDeductAmt,FALSE) + PADSTR('',16,' '));
...
...
OperationDateText := FormatDate(VATEntryRec."Posting Date");
// Add the following lines.
IF VATEntryRec."Document Type" = VATEntryRec."Document Type"::Payment THEN
DocumentDate := VATEntry."Posting Date";
// End of the lines.
IF Counter = 1 THEN BEGIN
VATBuffer2."EC %" := 0;
// Add the following line.
CreateTempDeclarationLines(PADSTR(VendVATNumber,9,' '),Vendor."No.",Vendor.Name,DocumentDate,
VendorDocumentNo,FORMAT(VATEntryRec."Document Type"),PADSTR(VATEntryRec."Document No.",18,' '),
'00000001',PADSTR(CorreInvoiceText,40,' '));
END ELSE BEGIN
// Add the following line.
CreateTempDeclarationLines(PADSTR(VendVATNumber,9,' '),Vendor."No.",Vendor.Name,DocumentDate,
VendorDocumentNo,FORMAT(VATEntryRec."Document Type"),PADSTR(VATEntryRec."Document No.",18,' '),
'000000000000000001',FormatTextAmt(VATDeductAmt,FALSE) + PADSTR('',16,' '));
...