Merge branch '21.0' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
ldestailleur 2025-04-01 19:26:49 +02:00
commit f5a61d9dc4
3 changed files with 25 additions and 4 deletions

View file

@ -689,6 +689,7 @@ class Translate
try {
// @phan-suppress-next-line PhanPluginPrintfVariableFormatString
$str = sprintf($str, $param1, $param2, $param3, $param4); // Replace %s and %d except for FormatXXX strings.
// Note: the catch ValueError is possible only when php min will be 8.1
} catch (Exception $e) {
// No exception managed
}
@ -804,8 +805,9 @@ class Translate
try {
// @phan-suppress-next-line PhanPluginPrintfVariableFormatString
$str = sprintf($str, $param1, $param2, $param3, $param4, $param5); // Replace %s and %d except for FormatXXX strings.
// Note: the catch ValueError is possible only when php min will be 8.1
} catch (Exception $e) {
// No exception managed
// No exception managed.
}
}

View file

@ -997,7 +997,7 @@ class Salary extends CommonObject
if (!$error) {
// Force payment mode of invoice to withdraw
$payment_mode_id = dol_getIdFromCode($this->db, ($type == 'bank-transfer' ? 'VIR' : 'PRE'), 'c_paiement', 'code', 'id', 1);
$payment_mode_id = dol_getIdFromCode($this->db, (($type == 'bank-transfer' || $type == 'salaire') ? 'VIR' : 'PRE'), 'c_paiement', 'code', 'id', 1);
if ($payment_mode_id > 0) {
$result = $this->setPaymentMethods($payment_mode_id);
}

View file

@ -162,6 +162,23 @@ if ($reshook < 0) {
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
}
// payment mode
if ($action == 'setmode' && $permissiontoadd) {
$object->fetch($id);
$result = $object->setPaymentMethods(GETPOSTINT('mode_reglement_id'));
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
}
}
// bank account
if ($action == 'setbankaccount' && $permissiontoadd) {
$object->fetch($id);
$result = $object->setBankAccount(GETPOSTINT('fk_account'));
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
}
}
if ($action == "add" && $permissiontoadd) {
//var_dump($object);exit;
@ -170,8 +187,10 @@ if ($action == "add" && $permissiontoadd) {
$sourcetype = 'salaire';
$newtype = 'salaire';
$paymentservice = GETPOST('paymentservice');
$result = $object->demande_prelevement($user, (float) price2num(GETPOST('request_transfer', 'alpha')), $newtype, $sourcetype);
$paymentservice = GETPOST('paymentservice'); // value can be 'stripesepa'. not used yet.
$result = $object->demande_prelevement($user, GETPOSTFLOAT('request_transfer'), $newtype, $sourcetype);
if ($result > 0) {
$db->commit();