Add Phase 15 customer and sales ledger intelligence

This commit is contained in:
A R R R Associates
2026-08-22 22:43:44 +05:30
parent efc12e20d3
commit 230fe7ffc5
12 changed files with 879 additions and 6 deletions
@@ -1,2 +1,2 @@
__version__ = "1.14.0"
__version__ = "1.15.0"
AGENT_NAME = "ERP Local Agent"
@@ -1091,8 +1091,15 @@ class LocalAccountingStore:
mapping = self.get_active_mapping_by_guid(client_id, guid)
params: list = [guid]
where = ["v.tally_guid=?", "TRIM(COALESCE(v.party_ledger_name,''))<>''", "LOWER(TRIM(COALESCE(v.is_cancelled,''))) NOT IN ('yes','true','1')", "LOWER(TRIM(e.ledger_name))<>LOWER(TRIM(v.party_ledger_name))"]
if str(voucher_scope or "purchase").strip().lower() == "purchase":
scope = str(voucher_scope or "purchase").strip().lower()
if scope == "purchase":
where.append("LOWER(v.voucher_type_name) LIKE '%purchase%'")
elif scope == "sales":
where.append("LOWER(v.voucher_type_name) LIKE '%sales%'")
elif scope in {"all", "any"}:
pass
else:
raise ValueError("Historical evidence voucher_scope must be purchase, sales or all.")
if date_from:
where.append("v.voucher_date>=?"); params.append(str(date_from))
if date_to: