Hi guys, this question has a bit of details.
Our client are buying from foreign Supplier. And the time when they received the Goods and the time of Invoice are different. This leads to the fact that the exchange rates will be different.
So at the PR submitted, rate is X$, this credit into the Stock Received but not Billed Account (SRBNB) an amount of SV1$. When PI submitted, rate is Y$, this debit into the Stock Received but not Billed Account an amount of SV2$
Currently the SRBNB is left unbalanced after that. Our accountant suggest that when PI submitted the debit amt should stay as SV1$, and the difference goes into Realised Exchange Difference (RED).
And I think it makes sense, so I added a hook to Purchase Invoice’s on_submit and add 2 GL Entries:
- Debit (or Credit, depends) to SRBNB an amount of SV2$ - SV1$
- Credit (or Debit, depends) to RED an amount of SV2$ - SV1$
It seems to work but in the end there are 2 records in SRBNB, which should be just one.
Should I just override the purchase_invoice calculation and split the entries from there, before any GL entries are committed ?