Fix force payment mode to create withdrawal

This commit is contained in:
jcp 2020-11-04 11:15:41 +01:00
parent 2cdbfa2048
commit 1f483d7c28

View File

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