...
ItemLedgEntry2.SETRANGE("Document No.","Document No.");
ItemLedgEntry2.SETRANGE("Item No.","Item No.");
ItemLedgEntry2.SETRANGE(Correction,TRUE);
// Delete the following lines.
ItemLedgEntry2.SETRANGE("Document Type","Document Type"::"Sales Shipment");
IF NOT ItemLedgEntry2.ISEMPTY THEN
CurrReport.SKIP;
ItemLedgEntry2.SETRANGE("Document Type","Document Type"::"Sales Return Receipt");
IF NOT ItemLedgEntry2.ISEMPTY THEN
CurrReport.SKIP;
ItemLedgEntry2.SETRANGE("Document Type","Document Type"::"Purchase Receipt");
IF NOT ItemLedgEntry2.ISEMPTY THEN
CurrReport.SKIP;
ItemLedgEntry2.SETRANGE("Document Type","Document Type"::"Purchase Return Shipment");
IF NOT ItemLedgEntry2.ISEMPTY THEN
CurrReport.SKIP;
END;
// End of the deleted lines.
ItemLedgEntry2.RESET;
CASE TRUE OF
"Drop Shipment":
...
...
ItemLedgEntry2.SETRANGE("Document No.","Document No.");
ItemLedgEntry2.SETRANGE("Item No.","Item No.");
ItemLedgEntry2.SETRANGE(Correction,TRUE);
// Add the following lines.
IF "Document Type" IN ["Document Type"::"Sales Shipment",
"Document Type"::"Sales Return Receipt",
"Document Type"::"Purchase Receipt",
"Document Type"::"Purchase Return Shipment"]
THEN BEGIN
ItemLedgEntry2.SETRANGE("Document Type","Document Type");
IF ItemLedgEntry2.FINDSET THEN
REPEAT
IF IsItemLedgerEntryCorrected(ItemLedgEntry2,"Entry No.") THEN
CurrReport.SKIP;
UNTIL ItemLedgEntry2.NEXT = 0;
END;
END;
// End of the added lines.
ItemLedgEntry2.RESET;
CASE TRUE OF
"Drop Shipment":
...