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
NEW : Add new structure for invoice situation - GIF Situation #23994
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,8 +65,14 @@ create table llx_facturedet | |
|
||
situation_percent real DEFAULT 100, -- % progression of lines invoicing | ||
fk_prev_id integer, -- id of the line in the previous situation | ||
situation_percent_cumulated real DEFAULT 100, -- Invoice situation percent cumulated | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same remark than for invoice. I am not sure the field is used today, but this is the one to use to retreive the cumulated amount. |
||
situation_total_ht_cumulated double(24,8), -- Invoice situation total without taxes cumulated | ||
situation_total_tva_cumulated double(24,8), -- Invoice situation total vat cumulated | ||
situation_total_ttc_cumulated double(24,8), -- Invoice situation total with taxes cumulated | ||
situation_retained_warranty double(24,8), -- Invoice situation amount retained warranty not cumulated | ||
|
||
fk_user_author integer, -- user making creation | ||
|
||
fk_user_author integer, -- user making creation | ||
fk_user_modif integer, -- user making last change | ||
|
||
fk_multicurrency integer, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need this information : We already have a chain between each situation invoice. The chain is build with existing fields
situation_cycle_ref and situation_counter
And the "cumulated amount" is the sum of each invoice into the same chain (with situation_counter lower). Adding a field to store is a duplication of info and will generate troubles.
To make usage easy to use in code, we may have to introduce a method
getCumulatedAmountForPreviousSituation() on invoice
Note: Having to go back on other invoice (with a loop) make coding more difficult, but this is the only way to guarantee that data will be correct.
In a future, in a second step, adding a "denormalized field" situation_percent_cumulated may be done in a future for performance purpose but this must be done only once the code without duplication of data is working.
I think the only thing we miss for situation invoice management is in llx_facture, we miss
final_total_ht
final_situation_total_ttc
final_situation_total_vat
final_situation_total_localtax1
final_situation_total_localtax2
To store on the first situation invoice, the final amount we plan to have.