...
// Delete the following line.i := 0;
// End of the deleted line.
IsFileExportInitialized := FALSE;
...
...
// Add the following lines.
VATEntryBuffer2.RESET
VATEntryBuffer2.SETCURRENTKEY(Type,"Bill-to/Pay-to No.");
IF VATEntryBuffer2.FINDSET THEN
REPEAT
LineExported := FALSE;
SetVATEntryBufferFilters;
IF VATEntryBuffer.FINDSET THEN
REPEAT
IF IsValidForExport(VATEntryBuffer,EndDateReq) THEN BEGIN
VATRegNoToExport += 1;
LineExported := TRUE;
END;
UNTIL (VATEntryBuffer.NEXT = 0) OR LineExported;
UNTIL VATEntryBuffer2.NEXT = 0;
i := 1;
// End of the added lines.
IsFileExportInitialized := FALSE;
...
...
RecordCText[1] := GetFixedPartRecordC(i) + GetVarPartRecordC;
// Delete the following lines.
VATEntryBuffer.RESET;
VATEntryBuffer.SETCURRENTKEY(Type,"Bill-to/Pay-to No.");
VATEntryBuffer.SETRANGE(Type,VATEntryBuffer2.Type);
VATEntryBuffer.SETRANGE("Bill-to/Pay-to No.",VATEntryBuffer2."Bill-to/Pay-to No.");
VATEntryBuffer.SETFILTER(Amount,'<>%1',0);
// End of the deleted lines.
IF VATEntryBuffer.FINDSET THEN
REPEAT
...
...
RecordCText[1] := GetFixedPartRecordC(i) + GetVarPartRecordC;
SetVATEntryBufferFilters;//new line
IF VATEntryBuffer.FINDSET THEN
REPEAT
...
...
IsFileExportInitialized := TRUE;
END;
// Delete the following line.
VATRegNoToExport += 1;
// End of the deleted line.
ExportRecordTypeC(RecordCText);
...
...
IsFileExportInitialized := TRUE;
END;
ExportRecordTypeC(RecordCText);
...