abivia / ledger

General Ledger and Journal Accounting Package and API for Laravel
MIT License
102 stars 23 forks source link

Error in the example?? #3

Closed c-myers1 closed 2 years ago

c-myers1 commented 2 years ago

As I understand it with Abivia Ledger, a credit is always a positive ve amount whilst a debit is always a negative.

Consistent with this, In your example here, Inventory was debited (-150) when stock was bought.

Therefore, if I’m not muddling things up, when moving the sold value to COGS, it should be a credit (I.e. +10 not -10) to reduce Inventory. Given it’s a debit balance account, the Inventory account should show -140 not -160 after the transaction. COGS should normally carry a debit balance (an expense account) therefore it should be debited (-10 not +10) to increase expense.

Please confirm.

abivia commented 2 years ago

@c-myers1 You are correct. The example code and documentation have been corrected.

Good catch, thanks for bringing it to my attention!