FIX Accountancy - If deposit invoice is used, force binding in deposit accounting account to solve transaction

This commit is contained in:
Alexandre SPANGARO 2021-10-13 21:21:16 +02:00
parent fe3e11a104
commit 5d7587259d

View File

@ -637,12 +637,16 @@ if ($result) {
} }
// Manage Deposit // Manage Deposit
if ($objp->description == "(DEPOSIT)") { if (!empty($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT)) {
if ($objp->description == "(DEPOSIT)" || $objp->ftype == $facture_static::TYPE_DEPOSIT) {
$accountdeposittoventilated = new AccountingAccount($db); $accountdeposittoventilated = new AccountingAccount($db);
$accountdeposittoventilated->fetch('', $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT, 1); $accountdeposittoventilated->fetch('', $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT, 1);
$objp->code_sell_l = $accountdeposittoventilated->ref; $objp->code_sell_l = $accountdeposittoventilated->ref;
$objp->code_sell_p = '';
$objp->code_sell_t = '';
$objp->aarowid_suggest = $accountdeposittoventilated->rowid; $objp->aarowid_suggest = $accountdeposittoventilated->rowid;
} }
}
if (!empty($objp->code_sell_p)) { if (!empty($objp->code_sell_p)) {
// Value was defined previously // Value was defined previously