ledgersmb/LedgerSMB

Negative COGS for assemblies

Closed this issue · 1 comments

Version

1.11.15

What browsers are you seeing the problem on?

This problem isn't browser related

What happened?

When I perform the following steps:

  1. Create a customer and vendor
  2. Create a part and an assembly, the latter being composed of 2 items of the part
  3. Purchase 600 parts @ 1$ each
  4. Check balance sheet (shows correct: inventory 600$)
  5. Stock 10 assemblies
  6. Check balance sheet (shows no change -- which is expected: 20 parts taken out, but 10 assembly at the same cost added back)
  7. Sell 1 item of the assembly @ 6$
  8. Check the balance sheet

In the last step, the balance sheet shows $8 Current earnings and it shows inventory $602.

What should have happened?

In the last step, the Current earnings should have been $4 and inventory should have shown $598.

The branch currently assumes:

  • Negative sell price is never intentional and always an indication of this problem (I can't imagine the sum of cost of parts into the assembly being negative, but...)
  • Once a negative sell price has been detected, it's assumed all invoice rows have been posted incorrectly into acc_trans. (Does this require additional checks? Which ones??)