From 272594214b64437f54f3c31edffa4c863731e11b Mon Sep 17 00:00:00 2001 From: tnegre Date: Thu, 9 Feb 2023 17:41:15 +0100 Subject: [PATCH] Fix: default values would not work for fk_account. --- htdocs/compta/facture/card.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 90f45018489c1..5d6e6eba743a8 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -2981,7 +2981,9 @@ } // when bank account is empty (means not override by payment mode form a other object, like third-party), try to use default value - $fk_account = GETPOSTISSET("fk_account") ? GETPOST("fk_account", 'int') : $fk_account; + if (empty($fk_account) && !empty($socid)) { + $fk_account = GETPOST("fk_account", 'int'); + } if (!empty($soc->id)) { $absolute_discount = $soc->getAvailableDiscounts();