...
field | type | comment | |||||
HistoryBusinessModel fields | |||||||
code | str | reference (editable) | |||||
line_type |
| ||||||
line_id | |||||||
invoiceId | UUID | reference to invoice (hidden) | |||||
description | str | (editable) | |||||
details | json | depend of the type, TBD (editable as text) if not json wrap it in {'text':DATA} ← quote must be escaped | |||||
ledger_account | str | from specific payment module (editable) | |||||
quantity | float | (editable) | |||||
unit_price | type | (editable) | |||||
discount | float | to document difference between the std price and the price to be paid, useful for relative pricing (editable) | |||||
tax_rate | Calculation uuid | Calculation to calculate the tax (picker, rule type: tax, subtype *) | |||||
tax_analysis | json |
| |||||
amount_total | float | net +tax (calculated be, updated fe after saving line) :calculated from service, based on invoiceitem | |||||
amount_net | qty * unitprice - discount (calculated be/, updated fe after saving line) |
...
invoicePaymentRefRecieved (payment_reference)
invoiceEventPaymentRejected (msg) msg to event
invoicePaymentRecieved(msg, InvoicePayments) → can update the status to payed (also include rejected payment), only last amendment can be payed
invoicePaymentRefunded(InvoicePayments)→ can update the status to suspended (warning the busienss service to be update via signal)
invoicePaymentCanceled(InvoicePayments)
invoiceCreate (called on save)
invoiceUpdate (called on save)
invoiceDelete
invoiceTaxCalculation() calculate tax details by merging the result of invoiceItemTaxCalculation
invoiceItemCreate
invoiceItemUpdate
invoiceItemDelete
invoiceItemTaxCalculation calculate tax details base on the tax_rate rule
nice-to-have invoiceAmend → create new empty invoice and put current idea in “related_invoice“ and set status to amended
invoiceValidateItems → check that we have a business item attached to the invoice are in the right status/ right price: just send a signal, handle by calculation rule, add event if issues
invoiceMatchItems → check that we have a business item attached to the invoice (check if the subject_type / id is not empty and point to a valid database object, check line_id/type if no subject_id)
(not attached to the object)invoiceCreationFromCalculation (will send a signal)
invoice Payment specific modules (Calculation rules)
...
No add new button , All invoice MUST be generated using specific payment module
3 dots menu to generate invoice: show date from/date To
...
other module like “contract.createInvoice“ or BatchRun …
card page
general information
...