This commit is contained in:
yumoqing 2026-02-12 14:31:24 +08:00
parent 0d8440390c
commit 0ed1678a0f

View File

@ -65,16 +65,20 @@ class Accounting:
self.reseller_salemode = None
self.variable = caller.variable
await self.setup_accounting_legs(i)
legs = sorted(
self.accounting_legs,
key=lambda x: (
x.get('accounting_orgid','0'),
x.get('orgid', ''),
x.get('subjectid', ''),
0 if x.get('acc_dir', '0') == x.get('balance_at', '0') else 1
try:
legs = sorted(
self.accounting_legs,
key=lambda x: (
x.get('accounting_orgid','0'),
x.get('orgid', ''),
x.get('subjectid', ''),
0 if x.get('acc_dir', '0') == x.get('balance_at', '0') else 1
)
)
)
self.accounting_legs = legs
self.accounting_legs = legs
except Exception as e:
exception(f'{self.accounting_legs=}, {e=}\n{format_exec()}')
await self.get_legs_account()
async def setup_accounting_legs(self, pos):