PostInvtPostBuf() [ ... IF (GlobalInvtPostBuf."FA No." <> '') AND (GlobalInvtPostBuf."FA Entry No." <> 0 ) AND (GlobalInvtPostBuf."Account Type" = GlobalInvtPostBuf."Account Type"::"Inventory Adjmt.") THEN BEGIN IF FADepreciationBook.GET(GlobalInvtPostBuf."FA No.",GlobalInvtPostBuf."Depreciation Book Code") THEN BEGIN FAPostingGroup.GET(FADepreciationBook."FA Posting Group"); GenJnlLine."Account No." := FAPostingGroup."Acquisition Cost Account"; END; FALedgerEntry.RESET; FALedgerEntry.SETRANGE("Entry No.", GlobalInvtPostBuf."FA Entry No."); IF FALedgerEntry.FIND('-') THEN BEGIN FALedgerEntry.Amount := FALedgerEntry.Amount + GenJnlLine.Amount; FALedgerEntry."Debit Amount" := FALedgerEntry.Amount; FALedgerEntry."Credit Amount" := 0; FALedgerEntry."Original Currency Code" := GenJnlLine."Currency Code"; FALedgerEntry."Original Amount" := FALedgerEntry.Amount; FALedgerEntry."Original Debit Amount" := FALedgerEntry.Amount; FALedgerEntry."Original Credit Amount" := 0; FALedgerEntry."Amount (LCY)" := FALedgerEntry.Amount; FALedgerEntry."Need Cost Posted to G/L" := FALSE; FALedgerEntry.MODIFY; FALedgerEntry2.RESET; FALedgerEntry2.SETRANGE("FA No.",GlobalInvtPostBuf."FA No."); FALedgerEntry2.SETRANGE("Need Cost Posted to G/L",TRUE); IF NOT FALedgerEntry2.FIND('-') THEN BEGIN FA.GET(FALedgerEntry."FA No."); FA.Blocked := FALSE; FA.MODIFY; END; END; END; ... ]
Comments
The code is trying to keep the cost of Item Ledger and FA Ledger in sync.
I'm guessing there must be a periodic activity that would update the Disposal entries, and make the necessary gl transactions, but is a wild guess.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Thanks for your guess, ara3n, but I can't find any.