fix account code binding for supplier invoice (#26333)

This commit is contained in:
gdsoftdev 2023-10-23 18:30:27 +02:00 committed by GitHub
parent f46482a72a
commit 2d303b7c95
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -841,7 +841,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 && (($type == 'customer' && !empty($product->accountancy_code_sell_intra)) || ($type == 'supplier' && !empty($product->accountancy_code_buy_intra)))) {
// European intravat sale
if ($type == 'customer' && !empty($product->accountancy_code_sell_intra)) {
$code_p = $product->accountancy_code_sell_intra;