Merge pull request #27229 from FHenry/17.0_fix_autoselectaccount

FIX: bad accountancy code autoselection for supplier ventilation
This commit is contained in:
Laurent Destailleur 2023-12-28 12:40:53 +01:00 committed by GitHub
commit 66d89cc480
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -839,7 +839,7 @@ class AccountingAccount extends CommonObject
}
$suggestedid = $accountingAccount['dom']; // There is a doubt for this case. Is it an error on vat or we just forgot to fill vat number ?
$suggestedaccountingaccountfor = 'eecwithoutvatnumber';
} elseif ($isSellerInEEC && $isBuyerInEEC && !empty($product->accountancy_code_sell_intra)) {
} elseif ($isSellerInEEC && $isBuyerInEEC) {
// European intravat sale
if ($type == 'customer' && !empty($product->accountancy_code_sell_intra)) {
$code_p = $product->accountancy_code_sell_intra;