...
field | type | comment | |||||
HistoryBusinessModel fields | |||||||
subject | json |
| |||||
sender | json |
| |||||
code | str | or reference for the insurance | |||||
code_rcpsdr | str | or reference for the recipient | |||||
code_ext | str | if required for external system integration such as payment systems | |||||
date_due | date | date on which the payment is due | |||||
date_invoice | date | Date of the “invoice“ | |||||
validFrom* | date | invoice covering service/item from | |||||
validTo* | date | invoice covering service/item to | |||||
date_payed | date | Date on which the payment was actually documented as Done | |||||
amount_discount | float | total of the detail discount | |||||
amount_net | float | Total without tax | |||||
tax_analysis | json |
| |||||
amount_total | float | total net + tax total | |||||
status | int | ENUM (module configuration): draft, validated, payed, cancelled, deleted | |||||
currency_rcpsdr_code | str | currency of the recipient (if different) | |||||
currency_code | str | currency of insurance | |||||
exchange_rate | decimal | ||||||
note | bigttext | ||||||
terms | bigttext | conditions |
...
field | type | comment | |||||
code | str | reference | |||||
HistoryModel fields | |||||||
billId | UUID | reference to bill | |||||
description | str | ||||||
details | json | depend of the type, TBD | |||||
ledger_account | int | from config | |||||
quantity | float | ||||||
unit_price | type | ||||||
discount | float | to document difference between the std price and the price to be paid, useful for relative pricing | |||||
tax_rate | Calculation uuid | Calculation to calculate the tax | |||||
tax_analysis | json |
| |||||
amount_total | float | net +tax | |||||
amount_net | qty * unitprice - discount |
Note: Do we need unit of measurement ? or should it be in the description.
billPayments
To document the payment done on the invoice. out of scope: a payment done for 2 invoice, to support such scenario an “generalPayment“ table need to be created, this table will have sub table with relationships to billPayments, once the reconciliation between the different invoice will be done.
...
field | type | comment |
HistoryModel fields |
| |
Status | int | Accepted / Rejected |
code | ||
code_ext | str | payment reference |
label | str | label of the payment |
code_rcpsdr | str | Reference from the payment system / bank |
billId | UUID | reference to bills |
code_receipt | str | receipt number |
amount_payed | float | Amount that need to be matched against business items (fees might be added if there were removed before reaching the system) |
fees | float | |
amount_recieved | float | Amount that is received (may include or not the fees) |
date_payment | date |
...