FIX The "automatic bind" was linked EEC to export accountancy code
Conflicts: htdocs/accountancy/supplier/index.php
This commit is contained in:
parent
751247d3f3
commit
bffdc63ec6
@ -153,6 +153,8 @@ if ($action == 'validatehistory') {
|
||||
while ($i < min($num_lines, 10000)) { // No more than 10000 at once
|
||||
$objp = $db->fetch_object($result);
|
||||
|
||||
$isBuyerInEEC = isInEEC($objp);
|
||||
|
||||
// Search suggested account for product/service
|
||||
$suggestedaccountingaccountfor = '';
|
||||
if (($objp->country_code == $mysoc->country_code) || empty($objp->country_code)) { // If buyer in same country than seller (if not defined, we assume it is same country)
|
||||
|
||||
@ -141,13 +141,15 @@ if ($action == 'validatehistory') {
|
||||
setEventMessages($db->lasterror(), null, 'errors');
|
||||
} else {
|
||||
$num_lines = $db->num_rows($result);
|
||||
|
||||
|
||||
$isSellerInEEC = isInEEC($mysoc);
|
||||
|
||||
|
||||
$i = 0;
|
||||
while ($i < min($num_lines, 10000)) { // No more than 10000 at once
|
||||
$objp = $db->fetch_object($result);
|
||||
|
||||
|
||||
$isBuyerInEEC = isInEEC($objp);
|
||||
|
||||
// Search suggested account for product/service
|
||||
$suggestedaccountingaccountfor = '';
|
||||
if (($objp->country_code == $mysoc->country_code) || empty($objp->country_code)) { // If buyer in same country than seller (if not defined, we assume it is same country)
|
||||
@ -169,13 +171,13 @@ if ($action == 'validatehistory') {
|
||||
$suggestedaccountingaccountfor = 'export';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($objp->aarowid_suggest > 0)
|
||||
{
|
||||
$sqlupdate = "UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det";
|
||||
$sqlupdate.= " SET fk_code_ventilation = ".$objp->aarowid_suggest;
|
||||
$sqlupdate.= " WHERE fk_code_ventilation <= 0 AND product_type <= 2 AND rowid = ".$objp->rowid;
|
||||
|
||||
|
||||
$resqlupdate = $db->query($sqlupdate);
|
||||
if (! $resqlupdate)
|
||||
{
|
||||
@ -184,11 +186,11 @@ if ($action == 'validatehistory') {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($error)
|
||||
{
|
||||
$db->rollback();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user