FIX Invoice - When you create an invoice and defined a thirdparty, fk_account is not retrieved from company card
This commit is contained in:
parent
73b04deb19
commit
0510d84263
@ -2898,6 +2898,9 @@ if ($action == 'create') {
|
|||||||
if (empty($mode_reglement_id)) {
|
if (empty($mode_reglement_id)) {
|
||||||
$mode_reglement_id = $soc->mode_reglement_id;
|
$mode_reglement_id = $soc->mode_reglement_id;
|
||||||
}
|
}
|
||||||
|
if (empty($fk_account)) {
|
||||||
|
$fk_account = $soc->fk_account;
|
||||||
|
}
|
||||||
if (!$remise_percent) {
|
if (!$remise_percent) {
|
||||||
$remise_percent = $soc->remise_percent;
|
$remise_percent = $soc->remise_percent;
|
||||||
}
|
}
|
||||||
@ -3005,6 +3008,11 @@ if ($action == 'create') {
|
|||||||
$mode_reglement_id = GETPOST("mode_reglement_id", 'int');
|
$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
|
||||||
|
if (empty($fk_account)) {
|
||||||
|
$fk_account = GETPOST("fk_account", 'int');
|
||||||
|
}
|
||||||
|
|
||||||
if (!empty($soc->id)) {
|
if (!empty($soc->id)) {
|
||||||
$absolute_discount = $soc->getAvailableDiscounts();
|
$absolute_discount = $soc->getAvailableDiscounts();
|
||||||
}
|
}
|
||||||
@ -3607,8 +3615,8 @@ if ($action == 'create') {
|
|||||||
// Bank Account
|
// Bank Account
|
||||||
if (!empty($conf->banque->enabled)) {
|
if (!empty($conf->banque->enabled)) {
|
||||||
print '<tr><td>'.$langs->trans('BankAccount').'</td><td colspan="2">';
|
print '<tr><td>'.$langs->trans('BankAccount').'</td><td colspan="2">';
|
||||||
$fk_account = GETPOST('fk_account', 'int');
|
print img_picto('', 'bank_account', 'class="pictofixedwidth"');
|
||||||
print img_picto('', 'bank_account', 'class="pictofixedwidth"').$form->select_comptes(($fk_account < 0 ? '' : $fk_account), 'fk_account', 0, '', 1, '', 0, 'maxwidth200 widthcentpercentminusx', 1);
|
print $form->select_comptes(GETPOSTISSET('fk_account') ? GETPOST('fk_account') : $fk_account, 'fk_account', 0, '', 1, '', 0, 'maxwidth200 widthcentpercentminusx', 1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user