dolibarr/htdocs/commande/class
Frédéric FRANCE b7413ee622
NEW: Improve phpunit test coverage for Commande, Propal and Facture (#39517)
* NEW: Improve phpunit test coverage for Commande, Propal and Facture

Add line CRUD (addline/updateline/deleteLine) and total-consistency
assertions, reuse the specimen-invariant regression check (previously
only in FactureTest) across all three, and add a new integration test
covering the full Propal -> Commande -> Facture conversion chain
(thirdparty, notes, totals and object_linked propagation).

Two shared assertions were added to CommonClassTest for this:
assertLineTotalsMatchHeader() and assertMatchesFreshSpecimen().

* Update commande.class.php

* FIX PropalCommandeFactureWorkflowTest reads wrong invoice after createFromOrder

Facture::createFromOrder() returns a status flag (1/-1), not the new
invoice id, unlike Commande::createFromProposal(). The test was doing
fetch($result) with $result==1, which happened to no-op locally (no
invoice with rowid=1) but fetched an unrelated invoice in CI, causing
a spurious thirdparty mismatch. Use $facture->id, already set by
create() inside createFromOrder(), like every other caller of this
method does.
2026-08-19 02:35:04 +02:00
..
api_orders.class.php Fix missing object-level control on api to reopen or billed an order - 2026-07-20 12:03:14 +02:00
commande.class.php NEW: Improve phpunit test coverage for Commande, Propal and Facture (#39517) 2026-08-19 02:35:04 +02:00
commandestats.class.php Qual: Fix PHPStan notices (#37977) 2026-04-23 15:26:53 +02:00
orderline.class.php FIX #37658 - Add unit tests for TTC unit price rounding and add fixes for others objects (proposals, orders, invoices and contracts) (#39055) 2026-08-11 19:48:40 +02:00