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
|
while ($i < min($num_lines, 10000)) { // No more than 10000 at once
|
||||||
$objp = $db->fetch_object($result);
|
$objp = $db->fetch_object($result);
|
||||||
|
|
||||||
|
$isBuyerInEEC = isInEEC($objp);
|
||||||
|
|
||||||
// Search suggested account for product/service
|
// Search suggested account for product/service
|
||||||
$suggestedaccountingaccountfor = '';
|
$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)
|
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');
|
setEventMessages($db->lasterror(), null, 'errors');
|
||||||
} else {
|
} else {
|
||||||
$num_lines = $db->num_rows($result);
|
$num_lines = $db->num_rows($result);
|
||||||
|
|
||||||
$isSellerInEEC = isInEEC($mysoc);
|
$isSellerInEEC = isInEEC($mysoc);
|
||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
while ($i < min($num_lines, 10000)) { // No more than 10000 at once
|
while ($i < min($num_lines, 10000)) { // No more than 10000 at once
|
||||||
$objp = $db->fetch_object($result);
|
$objp = $db->fetch_object($result);
|
||||||
|
|
||||||
|
$isBuyerInEEC = isInEEC($objp);
|
||||||
|
|
||||||
// Search suggested account for product/service
|
// Search suggested account for product/service
|
||||||
$suggestedaccountingaccountfor = '';
|
$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)
|
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';
|
$suggestedaccountingaccountfor = 'export';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($objp->aarowid_suggest > 0)
|
if ($objp->aarowid_suggest > 0)
|
||||||
{
|
{
|
||||||
$sqlupdate = "UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det";
|
$sqlupdate = "UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det";
|
||||||
$sqlupdate.= " SET fk_code_ventilation = ".$objp->aarowid_suggest;
|
$sqlupdate.= " SET fk_code_ventilation = ".$objp->aarowid_suggest;
|
||||||
$sqlupdate.= " WHERE fk_code_ventilation <= 0 AND product_type <= 2 AND rowid = ".$objp->rowid;
|
$sqlupdate.= " WHERE fk_code_ventilation <= 0 AND product_type <= 2 AND rowid = ".$objp->rowid;
|
||||||
|
|
||||||
$resqlupdate = $db->query($sqlupdate);
|
$resqlupdate = $db->query($sqlupdate);
|
||||||
if (! $resqlupdate)
|
if (! $resqlupdate)
|
||||||
{
|
{
|
||||||
@ -184,11 +186,11 @@ if ($action == 'validatehistory') {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($error)
|
if ($error)
|
||||||
{
|
{
|
||||||
$db->rollback();
|
$db->rollback();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user