From e0c8fce229cb7a4bd5561dc8ead2e1e870317503 Mon Sep 17 00:00:00 2001 From: Pierre Ardoin <32256817+mapiolca@users.noreply.github.com> Date: Mon, 27 Jan 2020 09:39:38 +0100 Subject: [PATCH 1/4] Fix link direction for late supplier invoices Before : $response->url_late always == $response->url After : if $response->nbtodolate >= 1 : $response->url_late redirects to list with only late unpaid supplier invoices. --- htdocs/fourn/class/fournisseur.facture.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 91310ef9138..b62190686b3 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -2231,6 +2231,7 @@ class FactureFournisseur extends CommonInvoice if ($facturestatic->hasDelay()) { $response->nbtodolate++; + $response->url_late=DOL_URL_ROOT.'/fourn/facture/list.php?option=late&mainmenu=billing&leftmenu=suppliers_bills'; } } $this->db->free($resql); From 4cb423e5c7bb40e787b0af2b8e2cde139bc5ca00 Mon Sep 17 00:00:00 2001 From: Pierre Ardoin <32256817+mapiolca@users.noreply.github.com> Date: Mon, 27 Jan 2020 09:49:49 +0100 Subject: [PATCH 2/4] Add un specific link to late invoices Before : $response->url_late always == $response->url After : if $response->nbtodolate >= 1 : $response->url_late redirects to list with only late unpaid customer invoices. --- htdocs/compta/facture/class/facture.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 3bbf150d72f..b397ff7939f 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -3902,6 +3902,7 @@ class Facture extends CommonInvoice if ($generic_facture->hasDelay()) { $response->nbtodolate++; + $response->url_late=DOL_URL_ROOT.'/compta/facture/list.php?search_option=late&mainmenu=billing&leftmenu=customers_bills'; } } From bffdc63ec65065f24bd0914f5de8084ed15a37e3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 28 Jan 2020 17:44:05 +0100 Subject: [PATCH 3/4] FIX The "automatic bind" was linked EEC to export accountancy code Conflicts: htdocs/accountancy/supplier/index.php --- htdocs/accountancy/customer/index.php | 2 ++ htdocs/accountancy/supplier/index.php | 16 +++++++++------- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/htdocs/accountancy/customer/index.php b/htdocs/accountancy/customer/index.php index aa3a8d691dd..ab2c00d13b0 100644 --- a/htdocs/accountancy/customer/index.php +++ b/htdocs/accountancy/customer/index.php @@ -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) diff --git a/htdocs/accountancy/supplier/index.php b/htdocs/accountancy/supplier/index.php index f1bf4377f42..8cb752aef4c 100644 --- a/htdocs/accountancy/supplier/index.php +++ b/htdocs/accountancy/supplier/index.php @@ -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(); From 782be2ac3797c3f5d5fb4d7f00d5f3e82f93690b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 28 Jan 2020 17:50:08 +0100 Subject: [PATCH 4/4] FIX Invert isSellerInEEC and isBuyerInEEC --- htdocs/accountancy/supplier/index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/accountancy/supplier/index.php b/htdocs/accountancy/supplier/index.php index 8cb752aef4c..eb81e4909d9 100644 --- a/htdocs/accountancy/supplier/index.php +++ b/htdocs/accountancy/supplier/index.php @@ -142,13 +142,13 @@ if ($action == 'validatehistory') { } else { $num_lines = $db->num_rows($result); - $isSellerInEEC = isInEEC($mysoc); + $isBuyerInEEC = isInEEC($mysoc); $i = 0; while ($i < min($num_lines, 10000)) { // No more than 10000 at once $objp = $db->fetch_object($result); - $isBuyerInEEC = isInEEC($objp); + $isSellerInEEC = isInEEC($objp); // Search suggested account for product/service $suggestedaccountingaccountfor = '';