diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index cedb7cdc0de..3203332b137 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -2898,6 +2898,9 @@ if ($action == 'create') { if (empty($mode_reglement_id)) { $mode_reglement_id = $soc->mode_reglement_id; } + if (empty($fk_account)) { + $fk_account = $soc->fk_account; + } if (!$remise_percent) { $remise_percent = $soc->remise_percent; } @@ -3005,6 +3008,9 @@ if ($action == 'create') { $mode_reglement_id = GETPOST("mode_reglement_id", 'int'); } + // 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($soc->id)) { $absolute_discount = $soc->getAvailableDiscounts(); } @@ -3607,8 +3613,8 @@ if ($action == 'create') { // Bank Account if (!empty($conf->banque->enabled)) { print '