// Stage 2 for erp_project, third process: invoice_to_cash. Run from the Manager root, one instruction per line.
// Lines starting with // are notes for the reader. Ask the 🔴 decisions in requirements.md (R2, R8, R21) when implementing.
// The project erp_project/ exists (order_to_credit, invoice_to_credit). This process takes over c_invoice.totalpaid, which
// invoice_to_credit only read; payments reach so_creditused only through it (invoice_to_credit R27, decision a).
// sys_config exists in the project; schema_changes.sql adds auto_distribute_amt to it.

add the tables of invoice_to_cash to erp_project (python erp_project_modernization/build_dev_db.py invoice_to_cash --into erp_project/database/db.sqlite)

apply erp_project_modernization/invoice_to_cash/schema_changes.sql to erp_project, and rebuild its models (keep the relationships declared for the earlier processes; declare c_invoice.fin_paymentmethod_id and c_bpartner.fin_paymentmethod_id to fin_paymentmethod; name the two relationships from fin_payment_scheduledetail to fin_payment_schedule, the invoice one used by R3 and R18)

implement requirements erp_project_modernization/invoice_to_cash

create logic diagram for each requirement

create tests from rules, using default names

run the tests (ALL processes: order_to_credit, invoice_to_credit and invoice_to_cash; the regression check)

run the requirements traceability report
