Skip to content

Commit

Permalink
Merge pull request #294 from Easya-Solutions/2022.5.3_fix_fk_account
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-Ngr authored Feb 14, 2023
2 parents e3bebfe + 558ea54 commit b76e1ee
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion htdocs/compta/facture/card.php
Original file line number Diff line number Diff line change
Expand Up @@ -3031,7 +3031,11 @@
}

// 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 ($socid > 0 && $fk_account) { // A company has already been set and it has a default fk_account
$fk_account = GETPOSTISSET('fk_account') ? GETPOST("fk_account", 'int') : $fk_account; // The GETPOST is used only if form was posted to avoid to take default value, because in such case, the default must be the one of the company
} else { // No company forced
$fk_account = GETPOST("fk_account", 'int');
}

if (!empty($soc->id)) {
$absolute_discount = $soc->getAvailableDiscounts();
Expand Down

0 comments on commit b76e1ee

Please sign in to comment.