This question has been flagged
1 Reply
6149 Views

I found this line inside __compute, mapping{ in account.py

'debit': "COALESCE(SUM(l.debit), 0) as debit",

but I don't understand what is l.debit or l.credit also the parent_right parent_left mechanics

Avatar
Discard
Author

Thx thats good information

Best Answer

Debit and Credit are basic accounting concepts, used in the double-entry bookkeeping system.

COALESCE is this case works like Oracle's NVL and SQLServer's IsNull: COALESCE(a, b) returns a if a is not null, and returns b if a is null.

It safely defaults to a zero value if no data is found.

Avatar
Discard
Author

well I already knew all of that. What im asking is how the mapping to l.debit or other l. variables works, and how the parent_right and parent_left are generated and what is their role in the calculation.