From ed5b8df385082b5a8d2e6eb32c1c079ff7dfea9f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 2 Jun 2022 19:34:16 +0200 Subject: [PATCH] FIX Bank account not set when creating invoice from order --- htdocs/compta/facture/card.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 5ef3079ae03..049ea5c3f88 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -2843,7 +2843,8 @@ if ($action == 'create') { } $currency_code = $conf->currency; - + $fk_account = 0; + // Load objectsrc $remise_absolue = 0; if (!empty($origin) && !empty($originid)) { @@ -3580,7 +3581,7 @@ if ($action == 'create') { if (!empty($conf->banque->enabled)) { print ''.$langs->trans('BankAccount').''; print img_picto('', 'bank_account', 'class="pictofixedwidth"'); - print $form->select_comptes($fk_account, 'fk_account', 0, '', 1, '', 0, 'maxwidth200 widthcentpercentminusx', 1); + print $form->select_comptes(($fk_account < 0 ? '' : $fk_account), 'fk_account', 0, '', 1, '', 0, 'maxwidth200 widthcentpercentminusx', 1); print ''; }