From de241eced3dbf36dc7f8bec1b03835dcf85a7a98 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 28 Feb 2021 22:22:20 +0100 Subject: [PATCH 1/3] FIX: Total_ht not show in contract link element --- htdocs/core/class/html.form.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 7f8831bec96..30225e45baa 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -7133,7 +7133,7 @@ class Form 'invoice'=>array('enabled'=>$conf->facture->enabled, 'perms'=>1, 'label'=>'LinkToInvoice', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total as total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('invoice').')'), 'invoice_template'=>array('enabled'=>$conf->facture->enabled, 'perms'=>1, 'label'=>'LinkToTemplateInvoice', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.titre as ref, t.total as total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture_rec as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('invoice').')'), 'contrat'=>array('enabled'=>$conf->contrat->enabled, 'perms'=>1, 'label'=>'LinkToContract', - 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_customer as ref_client, t.ref_supplier, '' as total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."contrat as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('contract').')'), + 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_customer as ref_client, t.ref_supplier, SUM(td.total_ht) as total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."contrat as t, ".MAIN_DB_PREFIX."contratdet as td WHERE t.fk_soc = s.rowid AND td.fk_contrat = t.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('contract').')'), 'fichinter'=>array('enabled'=>$conf->ficheinter->enabled, 'perms'=>1, 'label'=>'LinkToIntervention', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."fichinter as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('intervention').')'), 'supplier_proposal'=>array('enabled'=>$conf->supplier_proposal->enabled, 'perms'=>1, 'label'=>'LinkToSupplierProposal', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, '' as ref_supplier, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."supplier_proposal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('supplier_proposal').')'), 'order_supplier'=>array('enabled'=>$conf->supplier_order->enabled, 'perms'=>1, 'label'=>'LinkToSupplierOrder', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande_fournisseur as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('commande_fournisseur').')'), From 0d954cb1c7b995c4886d714a5ad122775ba6b6a5 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 1 Mar 2021 03:09:36 +0100 Subject: [PATCH 2/3] FIX: Total_ht not show in contract link element --- htdocs/core/class/html.form.class.php | 7 ++++++- htdocs/langs/en_US/main.lang | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 30225e45baa..b7912e93dc4 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -7206,7 +7206,12 @@ class Form print ''; print ''.$objp->ref.''; print ''.$objp->ref_client.''; - print ''.price($objp->total_ht).''; + print ''; + if ($possiblelink[label] == 'LinkToContract') { + $form = new Form($db); + print $form->textwithpicto('', $langs->trans("InformationOnLinkToContract")).' '; + } + print price($objp->total_ht).''; print ''.$objp->name.''; print ''; $i++; diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 453651f1708..3b519458cbc 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -1115,3 +1115,4 @@ EventReminder=Event Reminder UpdateForAllLines=Update for all lines OnHold=On hold Civility=Civility +InformationOnLinkToContract=This amount is only the total of all the lines of the contract. No notion of time is taken into account. From 3b1a9cd668d76f9ee4758b23b97a205f59975af5 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 1 Mar 2021 03:18:14 +0100 Subject: [PATCH 3/3] FIX: Total_ht not show in contract link element --- htdocs/langs/en_US/main.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 3b519458cbc..7a666acc146 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -1115,4 +1115,4 @@ EventReminder=Event Reminder UpdateForAllLines=Update for all lines OnHold=On hold Civility=Civility -InformationOnLinkToContract=This amount is only the total of all the lines of the contract. No notion of time is taken into account. +InformationOnLinkToContract=This amount is only the total of all the lines of the contract. No notion of time is taken into consideration.