Fix phpunit

This commit is contained in:
Laurent Destailleur 2024-12-09 00:24:28 +01:00
parent 352d156dd7
commit 0b3c15b7fa
3 changed files with 7 additions and 5 deletions

View File

@ -134,7 +134,7 @@ class Facture extends CommonInvoice
public $ref_client;
/**
* @var string customer ref
* @var ?string customer ref
*/
public $ref_customer;

View File

@ -501,9 +501,11 @@ for ($mois = 1 + $nb_mois_decalage; $mois <= 12 + $nb_mois_decalage; $mois++) {
if ($modecompta=='CREANCES-DETTES') {
$cumulative_previous_year = (!empty($cumulative_ht[$caseprev])?$cumulative_ht[$caseprev]:0);
$cumulative_year = (!empty($cumulative_ht[$case])?$cumulative_ht[$case]:0);
$isset_cumulative_previous_year = isset($cumulative_ht[$caseprev]);
} else {
$cumulative_previous_year = (!empty($cumulative[$caseprev])?$cumulative[$caseprev]:0);
$cumulative_year = (!empty($cumulative[$case])?$cumulative[$case]:0);
$isset_cumulative_previous_year = isset($cumulative_ht[$caseprev]);
}
if (!empty($cumulative_previous_year) && !empty($cumulative_year)) {
$percent = (round(($cumulative_year - $cumulative_previous_year) / $cumulative_previous_year, 4) * 100);
@ -517,10 +519,10 @@ for ($mois = 1 + $nb_mois_decalage; $mois <= 12 + $nb_mois_decalage; $mois++) {
//print '<td class="right">+Inf%</td>';
print '-';
}
if (isset($cumulative_previous_year) && empty($cumulative_previous_year) && empty($cumulative_year)) {
if ($isset_cumulative_previous_year && empty($cumulative_previous_year) && empty($cumulative_year)) {
print '+0%';
}
if (!isset($cumulative_previous_year) && empty($cumulative_year)) {
if (!$isset_cumulative_previous_year && empty($cumulative_year)) {
print '-';
}
} else {

View File

@ -1217,7 +1217,7 @@ if ($action == 'create' || $action == 'adduserldap') {
}
// Other form for user password
$parameters = array('valuetoshow' => $valuetoshow, 'password' => $password, 'caneditpasswordandsee' => $caneditpasswordandsee, 'caneditpasswordandsend' => $caneditpasswordandsend);
$parameters = array('valuetoshow' => $valuetoshow, 'password' => $password, 'caneditpasswordandsee' => $permissiontoeditpasswordandsee, 'caneditpasswordandsend' => $permissiontoeditpasswordandsend);
$reshook = $hookmanager->executeHooks('printUserPasswordField', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
if ($reshook > 0) {
$valuetoshow = $hookmanager->resPrint; // to replace
@ -2041,7 +2041,7 @@ if ($action == 'create' || $action == 'adduserldap') {
*/
// Other form for user password
$parameters = array('valuetoshow' => $valuetoshow, 'caneditpasswordandsee' => $caneditpasswordandsee, 'caneditpasswordandsend' => $caneditpasswordandsend);
$parameters = array('valuetoshow' => $valuetoshow, 'caneditpasswordandsee' => $permissiontoeditpasswordandsee, 'caneditpasswordandsend' => $permissiontoeditpasswordandsend);
$reshook = $hookmanager->executeHooks('printUserPasswordField', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
if ($reshook > 0) {
$valuetoshow = $hookmanager->resPrint; // to replace