From b798535af9ddf8c02049eef1267d23e9de78d33a Mon Sep 17 00:00:00 2001 From: atm-lena Date: Wed, 10 Mar 2021 14:15:03 +0100 Subject: [PATCH 1/5] FIX create sociales : keep values error form --- htdocs/compta/paiement_charge.php | 5 +++-- htdocs/compta/sociales/card.php | 12 ++++++------ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/htdocs/compta/paiement_charge.php b/htdocs/compta/paiement_charge.php index 715a0851c65..7ed5baafcab 100644 --- a/htdocs/compta/paiement_charge.php +++ b/htdocs/compta/paiement_charge.php @@ -248,7 +248,7 @@ if ($action == 'create') print ''; print ''.$langs->trans("Comments").''; - print ''; + print ''; print ''; print ''; @@ -296,6 +296,7 @@ if ($action == 'create') print ''.price($objp->amount - $sumpaid).""; print ''; + if ($sumpaid < $objp->amount) { $namef = "amount_".$objp->id; @@ -304,7 +305,7 @@ if ($action == 'create') print img_picto("Auto fill", 'rightarrow', "class='AutoFillAmount' data-rowid='".$namef."' data-value='".($objp->amount - $sumpaid)."'"); $remaintopay = $objp->amount - $sumpaid; print ''; - print ''; + print ''; } else { diff --git a/htdocs/compta/sociales/card.php b/htdocs/compta/sociales/card.php index d2609fd4ff5..1b5bf72727f 100644 --- a/htdocs/compta/sociales/card.php +++ b/htdocs/compta/sociales/card.php @@ -45,7 +45,7 @@ $langs->loadLangs(array('compta', 'bills', 'banks')); $id = GETPOST('id', 'int'); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm'); -$projectid = (GETPOST('projectid') ? GETPOST('projectid', 'int') : 0); +$fk_project = (GETPOST('fk_project') ? GETPOST('fk_project', 'int') : 0); $dateech = dol_mktime(GETPOST('echhour'), GETPOST('echmin'), GETPOST('echsec'), GETPOST('echmonth'), GETPOST('echday'), GETPOST('echyear')); $dateperiod = dol_mktime(GETPOST('periodhour'), GETPOST('periodmin'), GETPOST('periodsec'), GETPOST('periodmonth'), GETPOST('periodday'), GETPOST('periodyear')); @@ -91,7 +91,7 @@ if ($action == 'reopen' && $user->rights->tax->charges->creer) { if ($action == 'classin' && $user->rights->tax->charges->creer) { $object->fetch($id); - $object->setProject(GETPOST('projectid')); + $object->setProject(GETPOST('fk_project')); } if ($action == 'setlib' && $user->rights->tax->charges->creer) @@ -375,21 +375,21 @@ if ($action == 'create') print ''.$langs->trans("Project").''; - $numproject = $formproject->select_projects(-1, $projectid, 'fk_project', 0, 0, 1, 1); + $numproject = $formproject->select_projects(-1, $fk_project, 'fk_project', 0, 0, 1, 1); print ''; } // Payment Mode print ''.$langs->trans('PaymentMode').''; - $form->select_types_paiements($mode_reglement_id, 'mode_reglement_id'); + $form->select_types_paiements(GETPOST('mode_reglement_id', 'int'), 'mode_reglement_id'); print ''; // Bank Account if (!empty($conf->banque->enabled)) { print ''.$langs->trans('BankAccount').''; - $form->select_comptes($fk_account, 'fk_account', 0, '', 1); + $form->select_comptes(GETPOST('fk_account', 'int'), 'fk_account', 0, '', 1); print ''; } @@ -482,7 +482,7 @@ if ($id > 0) $morehtmlref .= '
'; $morehtmlref .= ''; $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects(0, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); + $morehtmlref .= $formproject->select_projects(0, $object->fk_project, 'fk_project', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); $morehtmlref .= ''; $morehtmlref .= '
'; } else { From c209d9b45ef3b9f0b8f13c570a54c9e777935aa1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 10 Mar 2021 15:29:05 +0100 Subject: [PATCH 2/5] Update paiement_charge.php --- htdocs/compta/paiement_charge.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/paiement_charge.php b/htdocs/compta/paiement_charge.php index 7ed5baafcab..aed2708e56c 100644 --- a/htdocs/compta/paiement_charge.php +++ b/htdocs/compta/paiement_charge.php @@ -305,7 +305,7 @@ if ($action == 'create') print img_picto("Auto fill", 'rightarrow', "class='AutoFillAmount' data-rowid='".$namef."' data-value='".($objp->amount - $sumpaid)."'"); $remaintopay = $objp->amount - $sumpaid; print ''; - print ''; + print ''; } else { From 7a2e28497d3ff5010592ffb96885b76c43d528c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 12 Mar 2021 13:14:53 +0100 Subject: [PATCH 3/5] fix number is already used doesn't propose new code with elephant --- htdocs/core/modules/societe/mod_codeclient_elephant.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/htdocs/core/modules/societe/mod_codeclient_elephant.php b/htdocs/core/modules/societe/mod_codeclient_elephant.php index c7a2d600ede..b6113558822 100644 --- a/htdocs/core/modules/societe/mod_codeclient_elephant.php +++ b/htdocs/core/modules/societe/mod_codeclient_elephant.php @@ -303,6 +303,11 @@ class mod_codeclient_elephant extends ModeleThirdPartyCode { $this->error = $result; return -6; + } else { + $is_dispo = $this->verif_dispo($db, $code, $soc, $type); + if ($is_dispo <> 0) { + $result = -3; + } } } From 815a7683a252740629c5202868c40ee88525d492 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 12 Mar 2021 16:48:43 +0100 Subject: [PATCH 4/5] force getnextref if project create fail --- htdocs/projet/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 711d1b02935..db710e2715d 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -223,7 +223,7 @@ if (empty($reshook)) else { $db->rollback(); - + unset($_POST["ref"]); $action = 'create'; } } From 631aad94e78bdf5e996e5b97a2d2c628aa9b3192 Mon Sep 17 00:00:00 2001 From: Florian Mortgat Date: Mon, 15 Mar 2021 15:05:01 +0100 Subject: [PATCH 5/5] FIX PHP version requirement in composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index d26bbb05ad9..833bd2a633b 100644 --- a/composer.json +++ b/composer.json @@ -24,7 +24,7 @@ "vendor-dir" : "htdocs/includes" }, "require" : { - "php" : ">=5.5.0", + "php" : ">=5.6.0", "ext-curl" : "*", "ckeditor/ckeditor" : "4.12.1", "mike42/escpos-php" : "2.2",