-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: separate invoice-transaction relation to support debit and credit invoices #253
Conversation
123e1ff
to
a9666df
Compare
It is very tricky for a subTransactionRow to be both connected to a credit and debit invoice. The reason for this is that an Invoice inherently means that the payment or payout of a certain transaction will be done outside of SudoSOS. A debit Invoice means that a User will pay for the Transactions outside of SudoSOS. This does make things complicated when you try and Invoice transactions which have been paid out in the form of a credit Invoice. Take the following example:
The credit invoice is a form paying out the balance. The invoice is a form of saying "hey this transaction will be settled outside of SudoSOS". So I.V.V having a balance of negative -10 makes sense, they received that money twice. Edit: SolutionThe solution is that SudoSOS should not allow credit invoices to contain transactions from an Invoice account (Duhhhh). If you want to create an Invoice for a user still after this. You should delete the credit invoice, invoice the user, and create the credit invoice again. Because the order where the Invoice is created before the Credit Invoice does work since then the correct amounts are paid out in the correct order. :D |
Description
Changes the relation between invoices and subtransactionrows, such that every subtransactionrow can have both a debit invoice and a credit invoice. This was not possible before, but fortunately we have not yet encountered this issue in production (yet).
Related issues/external references
Step one of #197.
Types of changes