Nama ERP DocsNama ERP Docs
Home
Namasoft.com
Data Model
GitHub
Home
Namasoft.com
Data Model
GitHub
  • Home

    • Search
    • Guides

      • Entity Flows
      • الفواتير والضرائب والخصومات
      • Supply Chain
      • e-commerce integration (Magento)
      • .
    • Examples
    • Reprocessing Transactions
    • Frequently Asked Questions
    • AI Generated Entity Flows Documentation

      • Core
      • Accounting Module

        • EAAddAccountingEffect
        • EAClearLedgerLines
        • EAGenInvestmentDocClaimingDoc
        • EAGenJournalEntry
        • EAGenTreasuryBillCloseDoc
        • EARVPVControlJournal
        • EAReverseLedgerTrans
        • EAShortenLedger
        • EAShortenLedgerChangeToAccountCurrency
        • EASortLedger
        • .
      • AI Module
      • Contracting Module
      • CRM Module
      • EGTax Reader Module
      • Freight Management System Module
      • Hospital Management System Module
      • HR Module
      • e-commerce Integration Module
      • Manufacturing Module
      • POS Module
      • Real Estate Module
      • Service Center Module
      • Supply Chain Module
      • .
    • Release Notes

      • 2016
      • 2017
      • 2018
      • 2019
      • 2020
      • 2021
      • 2022
      • 2025
      • .
    • Video Tutorials

      • Supply Chain Videos
      • Report Wizard Videos
      • Human Resources Videos
      • .

EASortLedger

This document was generated using Claude.ai

Overview

Automatically sorts ledger transaction lines in a specific order before they are sent to the accounting system. Ensures debit and credit entries follow accounting best practices.

When This Action Runs

  • Trigger: Automatic during PreSendRequest event
  • Target: Documents with ledger transactions (LedgerTransReq)
  • Purpose: Organize transaction lines in logical sequence
  • Timing: Before ledger transaction processing

How It Works

Sorting Logic

Lines are sorted based on net amount (Credit - Debit):

  • Negative amounts first: Debit > Credit (debit entries)
  • Positive amounts last: Credit > Debit (credit entries)
  • Grouping: All debits grouped together, all credits grouped together

Sorting Calculation

Net Amount = Credit Local Amount - Debit Local Amount

Negative net (debits) → Appear first
Positive net (credits) → Appear last
Same sign → Order preserved

Database Impact

Fields Used

  • credit_local_amount - Local currency credit amount
  • debit_local_amount - Local currency debit amount

Tables Affected

  • LedgerTrans - Final sorted transactions
  • LedgerTransLine - Individual sorted lines

Important Warnings

⚠️ Processing Notes

  • Memory Sorting: Only sorts lines in memory before processing
  • Automatic Execution: Cannot be manually controlled or disabled
  • Order Dependency: Reports may depend on this sorting order

⚠️ Performance Impact

  • Minimal impact for typical volumes
  • Large transaction sets (1000+ lines) may experience delays

Related Actions

  • EAShortenLedger - Often runs after sorting to consolidate lines
  • EAGenJournalEntry - Generates lines that get sorted
  • EAClearLedgerLines - Clears lines before sorting

Module: accounting

Full Class Name: com.namasoft.modules.accounting.domain.utils.actions.EASortLedger

Edit On github
Last Updated:: 7/27/25, 7:19 PM
Prev
EAShortenLedgerChangeToAccountCurrency
Next
.