FIX The payment mode for salary on credit transfer must be credit

transfer
This commit is contained in:
ldestailleur 2025-04-01 18:50:12 +02:00
parent 17dfec8ee4
commit 16c76a6505
2 changed files with 3 additions and 2 deletions

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

@ -186,7 +186,8 @@ if ($action == "add" && $permissiontoadd) {
$sourcetype = 'salaire';
$newtype = 'salaire';
$paymentservice = GETPOST('paymentservice');
$paymentservice = GETPOST('paymentservice'); // value can be 'stripesepa'. not used yet.
$result = $object->demande_prelevement($user, price2num(GETPOST('request_transfer', 'alpha')), $newtype, $sourcetype);
if ($result > 0) {