...
VATEntry3@1100000 : Record 254;
BEGIN
VATEntry3.SETCURRENTKEY(Type,"Country/Region Code","VAT Registration No.");
// Delete the following line.
VATEntry3.SETRANGE(Type,VATEntry3.Type::Sale);
// End of the line.
VATEntry3.SETRANGE("Country/Region Code",CountryCode);
IF IsCustomer THEN BEGIN
...
...
VATEntry3@1100000 : Record 254;
BEGIN
VATEntry3.SETCURRENTKEY(Type,"Country/Region Code","VAT Registration No.");
VATEntry3.SETRANGE("Country/Region Code",CountryCode);
IF IsCustomer THEN BEGIN
...
...
VATEntry3.SETRANGE("Country/Region Code",CountryCode);
IF IsCustomer THEN BEGIN
VATEntry3.SETRANGE("VAT Registration No.",Customer."VAT Registration No.");
VATEntry3.SETFILTER("Bill-to/Pay-to No.",'<>%1',Customer."No.");
END ELSE BEGIN
...
...
VATEntry3.SETRANGE("Country/Region Code",CountryCode);
IF IsCustomer THEN BEGIN
// Add the following line.
VATEntry3.SETRANGE(Type,VATEntry3.Type::Sale); // ES0001
// End of the line.
VATEntry3.SETRANGE("VAT Registration No.",Customer."VAT Registration No.");
VATEntry3.SETFILTER("Bill-to/Pay-to No.",'<>%1',Customer."No.");
END ELSE BEGIN
...
...
VATEntry3.SETRANGE("VAT Registration No.",Customer."VAT Registration No.");
VATEntry3.SETFILTER("Bill-to/Pay-to No.",'<>%1',Customer."No.");
END ELSE BEGIN
VATEntry3.SETRANGE("VAT Registration No.",Vendor."VAT Registration No.");
VATEntry3.SETFILTER("Bill-to/Pay-to No.",'<>%1',Vendor."No.");
END;
...
...
VATEntry3.SETRANGE("VAT Registration No.",Customer."VAT Registration No.");
VATEntry3.SETFILTER("Bill-to/Pay-to No.",'<>%1',Customer."No.");
END ELSE BEGIN
// Add the following line.
VATEntry3.SETRANGE(Type,VATEntry3.Type::Purchase); // ES0001
// End of the line.
VATEntry3.SETRANGE("VAT Registration No.",Vendor."VAT Registration No.");
VATEntry3.SETFILTER("Bill-to/Pay-to No.",'<>%1',Vendor."No.");
END;
...
...
VATEntry3.SETRANGE("VAT Registration No.",Vendor."VAT Registration No.");
VATEntry3.SETFILTER("Bill-to/Pay-to No.",'<>%1',Vendor."No.");
END;
// Delete the following line.
VATEntry3.SETRANGE("Posting Date",FromDate,ToDate);
// End of the line.
IF VATEntry3.FINDFIRST THEN
REPEAT
...
...
VATEntry3.SETRANGE("VAT Registration No.",Vendor."VAT Registration No.");
VATEntry3.SETFILTER("Bill-to/Pay-to No.",'<>%1',Vendor."No.");
END;
// Add the following line.
VATEntry3.SETRANGE("Document Date",FromDate,ToDate); // ES0001
// End of the line.
IF VATEntry3.FINDFIRST THEN
REPEAT
...
...
IF VATEntry3.FINDFIRST THEN
REPEAT
// Delete the following line.
Amt := ABS(Amt + VATEntry3.Base + VATEntry3.Amount);
// End of the line.
UNTIL VATEntry3.NEXT = 0;
EXIT(Amt);
END;
...
...
IF VATEntry3.FINDFIRST THEN
REPEAT
// Add the following lines.
// ES0001.begin
IF IsCustomer THEN
Amt := Amt - VATEntry3.Base - VATEntry3.Amount
ELSE
Amt := Amt + VATEntry3.Base + VATEntry3.Amount;
// ES0001.end
// End of the lines.
UNTIL VATEntry3.NEXT = 0;
EXIT(Amt);
END;
...