Customer Ledger Entry - Open Field

matttraxmatttrax Member Posts: 2,309
Does anyone know where the code is that marks the original entry as closed (Open = false)?

I've run Code Coverage and don't see anything for := or validate on the field. I've also done a where used with the developers toolkit and the only place it returns is Codeunit 80 - ApplyCustLedgEntryByReversal function. This code was not executed during Code Coverage, but the original ledger entry is no longer open.

I would expect it to be somewhere in Codeunit 80, or on Table 21 (CLE) somewhere, but I don't think it is. I must be missing something.

Thanks for the help.

Comments

  • SavatageSavatage Member Posts: 7,142
    how about CU12 - look at Funct CalcApplication
    and/or TransferVendLedgEntry , etc

    I think it's as simple as if Remaining Amount <> 0 then it's open
    Code
        VendLedgEntry.Open := CVLedgEntryBuf.Open;
    
    Code
      OldCVLedgEntryBuf.Open := OldCVLedgEntryBuf."Remaining Amount" <> 0;
      IF NOT OldCVLedgEntryBuf.Open THEN BEGIN
        OldCVLedgEntryBuf."Closed by Entry No." := NewCVLedgEntryBuf."Entry No.";
        OldCVLedgEntryBuf."Closed at Date" := GenJnlLine."Posting Date";
        OldCVLedgEntryBuf."Closed by Amount" := -OldAppliedAmount;
        OldCVLedgEntryBuf."Closed by Amount ($)" := -AppliedAmountLCY;
        OldCVLedgEntryBuf."Closed by Currency Code" := NewCVLedgEntryBuf."Currency Code";
        OldCVLedgEntryBuf."Closed by Currency Amount" := -AppliedAmount;
      END;
    
Sign In or Register to comment.