...
// Delete the following lines.
GenJnlPostLine.InitVATDate;
IF SalesHeader.WRITEPERMISSION THEN
SalesPost.InitVATDate;
IF PurchHeader.WRITEPERMISSION THEN
PurchPost.InitVATDate;
IF SalesArchiveHeader.WRITEPERMISSION AND PurchArchiveHeader.WRITEPERMISSION THEN
ArchiveMgt.InitVATDate;
IF ServiceHeader.WRITEPERMISSION THEN
ServicePost.InitVATDate;
// End of the lines.
...
...
// Add the following lines.
WITH GLEntry DO BEGIN
RESET;
IF FINDSET(TRUE) THEN
REPEAT
IF "VAT Date" = 0D THEN BEGIN
"VAT Date" := "Posting Date";
MODIFY;
END;
UNTIL NEXT = 0;
END;
WITH GenJnlLine DO BEGIN
RESET;
IF FINDSET(TRUE) THEN REPEAT
IF "VAT Date" = 0D THEN BEGIN
"VAT Date" := "Posting Date";
MODIFY;
END;
UNTIL NEXT = 0;
END;
WITH VATEntry DO BEGIN
RESET;
IF FINDSET(TRUE) THEN
REPEAT
IF "VAT Date" = 0D THEN BEGIN
"VAT Date" := "Posting Date";
MODIFY;
END;
UNTIL NEXT = 0;
END;
WITH SalesHeader DO BEGIN
RESET;
IF FINDSET(TRUE) THEN
REPEAT
IF "VAT Date" = 0D THEN BEGIN
"VAT Date" := "Posting Date";
MODIFY;
END;
SalesLine.SETRANGE("Document Type","Document Type");
SalesLine.SETRANGE("Document No.","No.");
IF SalesLine.FINDSET(TRUE) THEN
REPEAT
IF "VAT Date" = 0D THEN BEGIN
SalesLine."VAT Date" := "Posting Date";
SalesLine.MODIFY;
END;
UNTIL SalesLine.NEXT = 0;
UNTIL NEXT = 0;
END;
WITH SalesInvHeader DO BEGIN
RESET;
IF FINDSET(TRUE) THEN
REPEAT
IF "VAT Date" = 0D THEN BEGIN
"VAT Date" := "Posting Date";
MODIFY;
END;
SalesInvLine.SETRANGE("Document No.","No.");
IF SalesInvLine.FINDSET(TRUE) THEN
REPEAT
IF "VAT Date" = 0D THEN BEGIN
SalesInvLine."VAT Date" := "Posting Date";
SalesInvLine.MODIFY;
END;
UNTIL SalesInvLine.NEXT = 0;
UNTIL NEXT = 0;
END;
WITH SalesCrMemoHeader DO BEGIN
RESET;
IF FINDSET(TRUE) THEN
REPEAT
IF "VAT Date" = 0D THEN BEGIN
"VAT Date" := "Posting Date";
MODIFY;
END;
SalesCrMemoLine.SETRANGE("Document No.","No.");
IF SalesCrMemoLine.FINDSET(TRUE) THEN
REPEAT
IF "VAT Date" = 0D THEN BEGIN
SalesCrMemoLine."VAT Date" := "Posting Date";
SalesCrMemoLine.MODIFY;
END;
UNTIL SalesCrMemoLine.NEXT = 0;
UNTIL NEXT = 0;
END;
WITH SalesArchiveHeader DO BEGIN
RESET;
IF FINDSET(TRUE) THEN
REPEAT
IF "VAT Date" = 0D THEN BEGIN
"VAT Date" := "Posting Date";
MODIFY;
END;
SalesArchiveLine.SETRANGE("Document Type","Document Type");
SalesArchiveLine.SETRANGE("Document No.","No.");
IF SalesArchiveLine.FINDSET(TRUE) THEN
REPEAT
IF "VAT Date" = 0D THEN BEGIN
SalesArchiveLine."VAT Date" := "Posting Date";
SalesArchiveLine.MODIFY;
END;
UNTIL SalesArchiveLine.NEXT = 0;
UNTIL NEXT = 0;
END;
WITH PurchHeader DO BEGIN
RESET;
IF FINDSET(TRUE) THEN
REPEAT
IF "VAT Date" = 0D THEN BEGIN
"VAT Date" := "Posting Date";
MODIFY;
END;
PurchLine.SETRANGE("Document Type","Document Type");
PurchLine.SETRANGE("Document No.","No.");
IF PurchLine.FINDSET(TRUE) THEN
REPEAT
IF "VAT Date" = 0D THEN BEGIN
PurchLine."VAT Date" := "Posting Date";
PurchLine.MODIFY;
END;
UNTIL PurchLine.NEXT = 0;
UNTIL NEXT = 0;
END;
WITH PurchInvHeader DO BEGIN
RESET;
IF FINDSET(TRUE) THEN
REPEAT
IF "VAT Date" = 0D THEN BEGIN
"VAT Date" := "Posting Date";
MODIFY;
END;
PurchInvLine.SETRANGE("Document No.","No.");
IF PurchInvLine.FINDSET(TRUE) THEN
REPEAT
IF "VAT Date" = 0D THEN BEGIN
PurchInvLine."VAT Date" := "Posting Date";
PurchInvLine.MODIFY;
END;
UNTIL PurchInvLine.NEXT = 0;
UNTIL NEXT = 0;
END;
WITH PurchCrMemoHeader DO BEGIN
RESET;
IF FINDSET(TRUE) THEN
REPEAT
IF "VAT Date" = 0D THEN BEGIN
"VAT Date" := "Posting Date";
MODIFY;
END;
PurchCrMemoLine.SETRANGE("Document No.","No.");
IF PurchCrMemoLine.FINDSET(TRUE) THEN
REPEAT
IF "VAT Date" = 0D THEN BEGIN
PurchCrMemoLine."VAT Date" := "Posting Date";
PurchCrMemoLine.MODIFY;
END;
UNTIL PurchCrMemoLine.NEXT = 0;
UNTIL NEXT = 0;
END;
WITH PurchArchiveHeader DO BEGIN
RESET;
IF FINDSET(TRUE) THEN
REPEAT
IF "VAT Date" = 0D THEN BEGIN
"VAT Date" := "Posting Date";
MODIFY;
END;
PurchArchiveLine.SETRANGE("Document Type","Document Type");
PurchArchiveLine.SETRANGE("Document No.","No.");
IF PurchArchiveLine.FINDSET(TRUE) THEN
REPEAT
IF "VAT Date" = 0D THEN BEGIN
PurchArchiveLine."VAT Date" := "Posting Date";
PurchArchiveLine.MODIFY;
END;
UNTIL PurchArchiveLine.NEXT = 0;
UNTIL NEXT = 0;
END;
WITH ServiceHeader DO BEGIN
RESET;
IF FINDSET(TRUE) THEN
REPEAT
IF "VAT Date" = 0D THEN BEGIN
"VAT Date" := "Posting Date";
MODIFY;
END;
ServiceLine.SETRANGE("Document Type","Document Type");
ServiceLine.SETRANGE("Document No.","No.");
IF ServiceLine.FINDSET(TRUE) THEN
REPEAT
IF "VAT Date" = 0D THEN BEGIN
ServiceLine."VAT Date" := "Posting Date";
ServiceLine.MODIFY;
END;
UNTIL ServiceLine.NEXT = 0;
UNTIL NEXT = 0;
END;
WITH ServiceInvHeader DO BEGIN
RESET;
IF FINDSET(TRUE) THEN
REPEAT
IF "VAT Date" = 0D THEN BEGIN
"VAT Date" := "Posting Date";
MODIFY;
END;
ServiceInvLine.SETRANGE("Document No.","No.");
IF ServiceInvLine.FINDSET(TRUE) THEN
REPEAT
IF "VAT Date" = 0D THEN BEGIN
ServiceInvLine."VAT Date" := "Posting Date";
ServiceInvLine.MODIFY;
END;
UNTIL ServiceInvLine.NEXT = 0;
UNTIL NEXT = 0;
END;
WITH ServiceCrMemoHeader DO BEGIN
RESET;
IF FINDSET(TRUE) THEN
REPEAT
IF "VAT Date" = 0D THEN BEGIN
"VAT Date" := "Posting Date";
MODIFY;
END;
ServiceCrMemoLine.SETRANGE("Document No.","No.");
IF ServiceCrMemoLine.FINDSET(TRUE) THEN
REPEAT
IF "VAT Date" = 0D THEN BEGIN
ServiceCrMemoLine."VAT Date" := "Posting Date";
ServiceCrMemoLine.MODIFY;
END;
UNTIL ServiceCrMemoLine.NEXT = 0;
UNTIL NEXT = 0;
END;
// End of the lines.
...