dolibarr/htdocs/reception
Alexandre Janniaux 9fe9eee18a
FIX|Fix some minor issues on Reception and add a new test for it (#26310)
* reception: reOpen: mirror $this->statut in $this->status

$this->statut is the deprecated variable, $this->status should also get
the correct value.

* reception: setDraft: mirror $this->statut in $this->status

$this->statut is the deprecated variable, $this->status should also get
the correct value.

* reception: add missing $weight field

Fix warning:

    Undefined property: Reception::$weight

* societe: add country_id field

* reception: use getDolGlobalInt when suitable

Using empty() implies that the value actually exists on the stdClass at
$conf->global, but it's not always the case. getDolGlobalInt will handle
this smoothly by checking first, which solves warnings like those:

    Undefined property: stdClass::$STOCK_CALCULATE_ON_RECEPTION

* ReceptionTest: add new test

The test checks the usual workflow of the Reception class, with, on the
one hand, the common CRUD operations:
 - create
 - fetch
 - update
 - delete

And on the other hand, the status handling for Reception:
 - valid: STATUS_DRAFT -> STATUS_VALID
 - setClosed: STATUS_VALID -> STATUS_CLOSED
 - reOpen: STATUS_CLOSED -> STATUS_VALID
 - setDraft: STATUS_VALID -> STATUS_DRAFT

The stocks lines are not tested yet, and the error cases, like any other
transition not described above, are not tested either. The permissions
for some of the operations are hardcoded for the test and there is no
failure check when the permission is not set yet.
2023-10-21 16:28:30 +02:00
..
class FIX|Fix some minor issues on Reception and add a new test for it (#26310) 2023-10-21 16:28:30 +02:00
stats Fix inline css 2023-02-18 14:00:25 +01:00
tpl Fix css 2022-12-30 03:10:37 +01:00
card.php QUAL: Use dol_clone with parameter 2 for ->oldcopy 2023-10-11 19:10:24 +02:00
contact.php Debug dispatch tab 2023-09-13 03:01:18 +02:00
dispatch.php Clean code (standardize reception with shipment) 2023-10-14 15:25:52 +02:00
document.php use isModEnabled 2023-06-09 13:47:07 +02:00
index.php add comment 2022-09-07 20:08:59 +02:00
list.php QUAL: Removed deprecated field remise, remise_percent, remise_absolute 2023-10-20 10:47:08 +02:00
note.php Debug dispatch tab 2023-09-13 03:01:18 +02:00