...
IF "Partial Revaluation" THEN
EXIT(TRUE);
// Delete the following lines.
IF "Item Ledger Entry Type" = "Item Ledger Entry Type"::Transfer THEN
EXIT(TRUE);
IF ItemApplnEntry.AppliedInbndEntryExists("Item Ledger Entry No.",TRUE) THEN
EXIT(TRUE);
// End of the lines.
EXIT(FALSE);
...
...
IF "Partial Revaluation" THEN
EXIT(TRUE);
// Add the following lines.
IF "Item Ledger Entry Type" = "Item Ledger Entry Type"::Consumption THEN
GoThroughChain := ItemApplnEntry.AppliedFromEntryExists("Item Ledger Entry No.")
ELSE
GoThroughChain := ItemApplnEntry.AppliedInbndEntryExists("Item Ledger Entry No.",TRUE);
IF GoThroughChain THEN
REPEAT
IF "Item Ledger Entry Type" = "Item Ledger Entry Type"::Transfer THEN
ItemLedgEntry.GET(ItemApplnEntry."Inbound Item Entry No.")
ELSE
ItemLedgEntry.GET(ItemApplnEntry."Outbound Item Entry No.");
IF ItemLedgEntry."Entry No." <> xItemLedgEntry."Entry No." THEN BEGIN
xItemLedgEntry := ItemLedgEntry;
ItemApplnEntry.GetVisitedEntries(ItemLedgEntry,TempItemLedgEntry);
TempItemLedgEntry.SETCURRENTKEY("Item No.",Positive,"Location Code","Variant Code");
TempItemLedgEntry.SETRANGE("Item No.","Item No.");
TempItemLedgEntry.SETRANGE(Positive,TRUE);
TempItemLedgEntry.SETRANGE("Location Code","Location Code");
TempItemLedgEntry.SETRANGE("Variant Code","Variant Code");
IF NOT TempItemLedgEntry.ISEMPTY THEN
EXIT(TRUE);
END;
UNTIL ItemApplnEntry.NEXT = 0;
// End of the lines.
EXIT(FALSE);
...