Merge pull request #15291 from prietojc/12.0_patch-1

FIX force payment mode to withdraw
This commit is contained in:
Laurent Destailleur 2020-11-04 20:36:29 +01:00 committed by GitHub
commit 4b7c8a0d1d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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);