From 8ab53012b71b2dd149ea743abfd4063f5faf489c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 3 Nov 2018 18:20:36 +0100 Subject: [PATCH 01/15] mode is only customer in stats fichinter --- htdocs/fichinter/stats/index.php | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/htdocs/fichinter/stats/index.php b/htdocs/fichinter/stats/index.php index 1c0ba5764ed..0dacf19c600 100644 --- a/htdocs/fichinter/stats/index.php +++ b/htdocs/fichinter/stats/index.php @@ -30,7 +30,7 @@ $WIDTH=DolGraph::getDefaultGraphSizeForStats('width'); $HEIGHT=DolGraph::getDefaultGraphSizeForStats('height'); $mode='customer'; -if ($mode == 'customer' && ! $user->rights->ficheinter->lire) accessforbidden(); +if (! $user->rights->ficheinter->lire) accessforbidden(); $userid=GETPOST('userid','int'); $socid=GETPOST('socid','int'); @@ -129,14 +129,12 @@ $data = $stats->getAmountByMonthWithPrevYear($endyear,$startyear); if (!$user->rights->societe->client->voir || $user->societe_id) { $filenameamount = $dir.'/interventionsamountinyear-'.$user->id.'-'.$year.'.png'; - if ($mode == 'customer') $fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=interventionstats&file=interventionsamountinyear-'.$user->id.'-'.$year.'.png'; - if ($mode == 'supplier') $fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=interventionstatssupplier&file=interventionsamountinyear-'.$user->id.'-'.$year.'.png'; + $fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=interventionstats&file=interventionsamountinyear-'.$user->id.'-'.$year.'.png'; } else { $filenameamount = $dir.'/interventionsamountinyear-'.$year.'.png'; - if ($mode == 'customer') $fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=interventionstats&file=interventionsamountinyear-'.$year.'.png'; - if ($mode == 'supplier') $fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=interventionstatssupplier&file=interventionsamountinyear-'.$year.'.png'; + $fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=interventionstats&file=interventionsamountinyear-'.$year.'.png'; } $px2 = new DolGraph(); @@ -171,14 +169,12 @@ $data = $stats->getAverageByMonthWithPrevYear($endyear, $startyear); if (!$user->rights->societe->client->voir || $user->societe_id) { $filename_avg = $dir.'/interventionsaverage-'.$user->id.'-'.$year.'.png'; - if ($mode == 'customer') $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=interventionstats&file=interventionsaverage-'.$user->id.'-'.$year.'.png'; - if ($mode == 'supplier') $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=interventionstatssupplier&file=interventionsaverage-'.$user->id.'-'.$year.'.png'; + $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=interventionstats&file=interventionsaverage-'.$user->id.'-'.$year.'.png'; } else { $filename_avg = $dir.'/interventionsaverage-'.$year.'.png'; - if ($mode == 'customer') $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=interventionstats&file=interventionsaverage-'.$year.'.png'; - if ($mode == 'supplier') $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=interventionstatssupplier&file=interventionsaverage-'.$year.'.png'; + $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=interventionstats&file=interventionsaverage-'.$year.'.png'; } $px3 = new DolGraph(); @@ -221,13 +217,12 @@ if (! count($arrayyears)) $arrayyears[$nowyear]=$nowyear; $h=0; $head = array(); -$head[$h][0] = DOL_URL_ROOT . '/commande/stats/index.php?mode='.$mode; +$head[$h][0] = DOL_URL_ROOT . '/fichinter/stats/index.php?mode='.$mode; $head[$h][1] = $langs->trans("ByMonthYear"); $head[$h][2] = 'byyear'; $h++; -if ($mode == 'customer') $type='order_stats'; -if ($mode == 'supplier') $type='supplier_order_stats'; +$type='fichinter_stats'; complete_head_from_modules($conf,$langs,null,$head,$h,$type); @@ -247,7 +242,6 @@ print '
'; // Company print ''.$langs->trans("ThirdParty").''; if ($mode == 'customer') $filter='s.client in (1,2,3)'; - if ($mode == 'supplier') $filter='s.fournisseur = 1'; print $form->select_company($socid,'socid',$filter,1,0,0,array(),0,'','style="width: 95%"'); print ''; // User From d6b909a28063712acfed8ba2e6b4a9d7ade4d1fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 3 Nov 2018 18:26:11 +0100 Subject: [PATCH 02/15] Update index.php --- htdocs/fichinter/stats/index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/fichinter/stats/index.php b/htdocs/fichinter/stats/index.php index 0dacf19c600..39cad7ca4f1 100644 --- a/htdocs/fichinter/stats/index.php +++ b/htdocs/fichinter/stats/index.php @@ -217,12 +217,12 @@ if (! count($arrayyears)) $arrayyears[$nowyear]=$nowyear; $h=0; $head = array(); -$head[$h][0] = DOL_URL_ROOT . '/fichinter/stats/index.php?mode='.$mode; +$head[$h][0] = DOL_URL_ROOT . '/fichinter/stats/index.php'; $head[$h][1] = $langs->trans("ByMonthYear"); $head[$h][2] = 'byyear'; $h++; -$type='fichinter_stats'; +$type = 'fichinter_stats'; complete_head_from_modules($conf,$langs,null,$head,$h,$type); From d32fd9fda54a62a901ca330f2173d42de4647370 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 6 Nov 2018 18:08:29 +0100 Subject: [PATCH 03/15] FIX export only prices of the current entity ! --- htdocs/core/modules/modProduct.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/modProduct.class.php b/htdocs/core/modules/modProduct.class.php index 6ad67ac089c..c0eee3d2061 100644 --- a/htdocs/core/modules/modProduct.class.php +++ b/htdocs/core/modules/modProduct.class.php @@ -229,7 +229,7 @@ class modProduct extends DolibarrModules 'pr.date_price'=>"product"); $this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'product as p'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product_price as pr ON p.rowid = pr.fk_product'; + $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product_price as pr ON p.rowid = pr.fk_product AND pr.entity = '.$conf->entity; // export prices only for the current entity $this->export_sql_end[$r] .=' WHERE p.fk_product_type = 0 AND p.entity IN ('.getEntity('product').')'; } From 9d780a172272eb834b53c1c326595300d29327f3 Mon Sep 17 00:00:00 2001 From: John BOTELLA Date: Wed, 7 Nov 2018 10:11:29 +0100 Subject: [PATCH 04/15] Fix sign --- htdocs/margin/tabs/thirdpartyMargins.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/htdocs/margin/tabs/thirdpartyMargins.php b/htdocs/margin/tabs/thirdpartyMargins.php index 5d80814099d..2f5ba9cc7b2 100644 --- a/htdocs/margin/tabs/thirdpartyMargins.php +++ b/htdocs/margin/tabs/thirdpartyMargins.php @@ -207,7 +207,10 @@ if ($socid > 0) $marginRate = ($objp->buying_price != 0)?(100 * $objp->marge / $objp->buying_price):'' ; $markRate = ($objp->selling_price != 0)?(100 * $objp->marge / $objp->selling_price):'' ; - + $sign = ''; + if($objp->type == Facture::TYPE_CREDIT_NOTE){ + $sign = '-'; + } print ''; print ''; @@ -219,11 +222,11 @@ if ($socid > 0) print dol_print_date($db->jdate($objp->datef),'day').""; print "".price($objp->selling_price, null, null, null, null, $rounding)."\n"; print "".price(($objp->type == 2 ? -1 : 1) * $objp->buying_price, null, null, null, null, $rounding)."\n"; - print "".price($objp->marge, null, null, null, null, $rounding)."\n"; + print "".$sign.price($objp->marge, null, null, null, null, $rounding)."\n"; if (! empty($conf->global->DISPLAY_MARGIN_RATES)) - print "".(($marginRate === '')?'n/a':price($marginRate, null, null, null, null, $rounding)."%")."\n"; + print "".(($marginRate === '')?'n/a':$sign.price($marginRate, null, null, null, null, $rounding)."%")."\n"; if (! empty($conf->global->DISPLAY_MARK_RATES)) - print "".(($markRate === '')?'n/a':price($markRate, null, null, null, null, $rounding)."%")."\n"; + print "".(($markRate === '')?'n/a':price($markRate, null, null, null, null, $rounding)."%")."\n"; print ''.$invoicestatic->LibStatut($objp->paye,$objp->statut,5).''; print "\n"; $i++; From 05a679a10c3a9957ac053aabede07ffa974abc01 Mon Sep 17 00:00:00 2001 From: gauthier Date: Wed, 7 Nov 2018 16:26:25 +0100 Subject: [PATCH 05/15] FIX : OppStatusShort doesn't exists --- htdocs/projet/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index 6b3613a7b0a..5f683a251a2 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -533,7 +533,7 @@ if (! empty($arrayfields['p.public']['checked'])) if (! empty($arrayfields['p.fk_opp_status']['checked'])) { print ''; - print $formproject->selectOpportunityStatus('search_opp_status', $search_opp_status, 1, 1, 1, 0, 'maxwidth100'); + print $formproject->selectOpportunityStatus('search_opp_status', $search_opp_status, 1, 0, 1, 0, 'maxwidth100'); print ''; } if (! empty($arrayfields['p.opp_amount']['checked'])) From 70826c31912808e6ddce76783f416b245f41c3f8 Mon Sep 17 00:00:00 2001 From: gauthier Date: Wed, 7 Nov 2018 16:32:23 +0100 Subject: [PATCH 06/15] FIX : same on lines --- htdocs/projet/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index 5f683a251a2..86f1c2ffcad 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -742,7 +742,7 @@ while ($i < min($num,$limit)) if (! empty($arrayfields['p.fk_opp_status']['checked'])) { print ''; - if ($obj->opp_status_code) print $langs->trans("OppStatusShort".$obj->opp_status_code); + if ($obj->opp_status_code) print $langs->trans("OppStatus".$obj->opp_status_code); print ''; if (! $i) $totalarray['nbfield']++; } From c55f83b0b7ee4661d24fb401c4bd68564f60180a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 8 Nov 2018 11:25:29 +0100 Subject: [PATCH 07/15] Fix multicompany filter missing --- htdocs/core/lib/company.lib.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 758c0803a10..3bc519e028a 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -740,11 +740,12 @@ function show_projects($conf, $langs, $db, $object, $backtopage='', $nocreatelin print '
'; print "\n".''; - $sql = "SELECT p.rowid as id, p.title, p.ref, p.public, p.dateo as do, p.datee as de, p.fk_statut as status, p.fk_opp_status, p.opp_amount, p.opp_percent, p.tms as date_update, p.budget_amount"; + $sql = "SELECT p.rowid as id, p.entity, p.title, p.ref, p.public, p.dateo as do, p.datee as de, p.fk_statut as status, p.fk_opp_status, p.opp_amount, p.opp_percent, p.tms as date_update, p.budget_amount"; $sql .= ", cls.code as opp_status_code"; $sql .= " FROM ".MAIN_DB_PREFIX."projet as p"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_lead_status as cls on p.fk_opp_status = cls.rowid"; $sql .= " WHERE p.fk_soc = ".$object->id; + $sql .= " AND p.entity IN (".getEntity('project').")"; $sql .= " ORDER BY p.dateo DESC"; $result=$db->query($sql); From 7c4dad27280fa0d07914c1a76a18ac58a818ccfe Mon Sep 17 00:00:00 2001 From: John BOTELLA Date: Thu, 8 Nov 2018 12:12:45 +0100 Subject: [PATCH 08/15] FIX Warning: count() --- htdocs/projet/tasks.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index 94a51ef3d01..09e067a57fe 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -468,7 +468,7 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third print ''; From 8bb1545ed012e38c3f7a2c664c2a2d8f05651fc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 8 Nov 2018 12:16:05 +0100 Subject: [PATCH 10/15] Update index.php --- htdocs/fichinter/stats/index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/fichinter/stats/index.php b/htdocs/fichinter/stats/index.php index 9bbbea09141..3551d8baab3 100644 --- a/htdocs/fichinter/stats/index.php +++ b/htdocs/fichinter/stats/index.php @@ -233,8 +233,8 @@ print '
'; print '
'; // Company print ''; // User print ''; // Opp status print ''; // Opp percent print ''; if (! $i) $totalarray['nbfield']++; }
'.$langs->trans("AffectedTo").''; $contactsofproject=(! empty($object->id)?$object->getListContactId('internal'):''); - if (count($contactsofproject)) + if (is_array($contactsofproject) && count($contactsofproject)) { print $form->select_dolusers($user->id, 'userid', 0, '', 0, '', $contactsofproject, 0, 0, 0, '', 0, '', 'maxwidth300'); } From 670eed1e688dce5464d43bd031137a525fc1a399 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 8 Nov 2018 12:13:07 +0100 Subject: [PATCH 09/15] Update index.php --- htdocs/fichinter/stats/index.php | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/htdocs/fichinter/stats/index.php b/htdocs/fichinter/stats/index.php index 39cad7ca4f1..9bbbea09141 100644 --- a/htdocs/fichinter/stats/index.php +++ b/htdocs/fichinter/stats/index.php @@ -49,10 +49,7 @@ $endyear=$year; $object_status=GETPOST('object_status'); -$langs->load('interventions'); -$langs->load('companies'); -$langs->load('other'); -$langs->load('suppliers'); +$langs->loadLangs(array('interventions', 'companies', 'other', 'suppliers')); /* @@ -62,11 +59,8 @@ $langs->load('suppliers'); $form=new Form($db); $objectstatic=new FichInter($db); -if ($mode == 'customer') -{ - $title=$langs->trans("InterventionStatistics"); - $dir=$conf->ficheinter->dir_temp; -} +$title=$langs->trans("InterventionStatistics"); +$dir=$conf->ficheinter->dir_temp; llxHeader('', $title); @@ -79,19 +73,18 @@ if ($object_status != '' && $object_status > -1) $stats->where .= ' AND c.fk_sta // Build graphic number of object $data = $stats->getNbByMonthWithPrevYear($endyear,$startyear); -//var_dump($data); // $data = array(array('Lib',val1,val2,val3),...) if (!$user->rights->societe->client->voir || $user->societe_id) { $filenamenb = $dir.'/interventionsnbinyear-'.$user->id.'-'.$year.'.png'; - if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=interventionstats&file=interventionsnbinyear-'.$user->id.'-'.$year.'.png'; + $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=interventionstats&file=interventionsnbinyear-'.$user->id.'-'.$year.'.png'; } else { $filenamenb = $dir.'/interventionsnbinyear-'.$year.'.png'; - if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=interventionstats&file=interventionsnbinyear-'.$year.'.png'; + $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=interventionstats&file=interventionsnbinyear-'.$year.'.png'; } $px1 = new DolGraph(); @@ -123,7 +116,6 @@ if (! $mesg) // Build graphic amount of object $data = $stats->getAmountByMonthWithPrevYear($endyear,$startyear); -//var_dump($data); // $data = array(array('Lib',val1,val2,val3),...) if (!$user->rights->societe->client->voir || $user->societe_id) @@ -283,7 +275,8 @@ foreach ($data as $val) { $year = $val['year']; while (! empty($year) && $oldyear > $year+1) - { // If we have empty year + { + // If we have empty year $oldyear--; print '
'.$langs->trans("Filter").'
'.$langs->trans("ThirdParty").''; - if ($mode == 'customer') $filter='s.client in (1,2,3)'; - print $form->select_company($socid,'socid',$filter,1,0,0,array(),0,'','style="width: 95%"'); + $filter = 's.client in (1,2,3)'; + print $form->select_company($socid, 'socid', $filter, 1, 0, 0, array(), 0, '', 'style="width: 95%"'); print '
'.$langs->trans("CreatedBy").''; From 98548337ae465849d316a01e20594586d0d882a0 Mon Sep 17 00:00:00 2001 From: John BOTELLA Date: Thu, 8 Nov 2018 15:38:25 +0100 Subject: [PATCH 11/15] FIX supplier order list keep socid --- htdocs/commande/list.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index a9da48fd626..4841e9be410 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -467,7 +467,9 @@ if ($resql) print ''; print ''; print ''; - + print ''; + + print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_commercial.png', 0, $newcardbutton, '', $limit); $topicmail="SendOrderRef"; From e92a63ba734d8debd0bb797c88d88b7d217357c2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 8 Nov 2018 17:15:35 +0100 Subject: [PATCH 12/15] FIX If we change customer/supplier rule we can't edit old thirdparty. --- htdocs/societe/class/societe.class.php | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 0a49bb80f1b..eaf62bc89ca 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -872,6 +872,24 @@ class Societe extends CommonObject // We don't check when update called during a create because verify was already done. // For a merge, we suppose source data is clean and a customer code of a deleted thirdparty must be accepted into a target thirdparty with empty code without duplicate error $result = $this->verify(); + + // If there is only one error and error is ErrorBadCustomerCodeSyntax and we don't change customer code, we allow the update + // So we can update record that were using and old numbering rule. + if (is_array($this->errors)) + { + if (in_array('ErrorBadCustomerCodeSyntax', $this->errors) && is_object($this->oldcopy) && $this->oldcopy->code_client == $this->code_client) + { + if (($key = array_search('ErrorBadCustomerCodeSyntax', $this->errors)) !== false) unset($this->errors[$key]); // Remove error message + } + if (in_array('ErrorBadSupplierCodeSyntax', $this->errors) && is_object($this->oldcopy) && $this->oldcopy->code_fournisseur == $this->code_fournisseur) + { + if (($key = array_search('ErrorBadSupplierCodeSyntax', $this->errors)) !== false) unset($this->errors[$key]); // Remove error message + } + if (empty($this->errors)) // If there is no more error, we can make like if there is no error at all + { + $result = 0; + } + } } if ($result >= 0) @@ -1518,7 +1536,7 @@ class Societe extends CommonObject dol_syslog(get_class($this)."::delete error -3 ".$this->error, LOG_ERR); } } - + // Remove links to subsidiaries companies if (! $error) { From 588de2cc860e6e587a8315a9689650d651e127a6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 8 Nov 2018 18:45:02 +0100 Subject: [PATCH 13/15] Fix filter on entity on project --- htdocs/core/lib/company.lib.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 3bc519e028a..c504a01c63d 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -120,6 +120,7 @@ function societe_prepare_head(Societe $object) $sql = "SELECT COUNT(n.rowid) as nb"; $sql.= " FROM ".MAIN_DB_PREFIX."projet as n"; $sql.= " WHERE fk_soc = ".$object->id; + $sql.= " AND entity IN (".getEntity('project').")"; $resql=$db->query($sql); if ($resql) { From be788e6167bfc9862c3b521c557974c335217354 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 8 Nov 2018 19:57:31 +0100 Subject: [PATCH 14/15] FIX responsive --- htdocs/comm/remx.php | 80 ++++++++++++++++++++++++-------------------- 1 file changed, 44 insertions(+), 36 deletions(-) diff --git a/htdocs/comm/remx.php b/htdocs/comm/remx.php index 3eec109e6b3..a66e8e66500 100644 --- a/htdocs/comm/remx.php +++ b/htdocs/comm/remx.php @@ -254,7 +254,7 @@ if ($socid > 0) print '
'; print '
'; - + if(! $isCustomer && ! $isSupplier) { print '

'.$langs->trans('ThirdpartyIsNeitherCustomerNorClientSoCannotHaveDiscounts').'

'; @@ -266,8 +266,8 @@ if ($socid > 0) $db->close(); exit; } - - + + print ''; if($isCustomer) { // Calcul avoirs client en cours @@ -293,7 +293,7 @@ if ($socid > 0) print ''; print ''; - + if (! empty($user->fk_soc)) // No need to show this for external users { print ''; @@ -322,10 +322,10 @@ if ($socid > 0) { dol_print_error($db); } - + print ''; print ''; - + if (! empty($user->fk_soc)) // No need to show this for external users { print ''; @@ -344,11 +344,11 @@ if ($socid > 0) print load_fiche_titre($langs->trans("NewGlobalDiscount"),'',''); print '
'; - + if($isCustomer && ! $isSupplier) { print ''; } - + if(! $isCustomer && $isSupplier) { print ''; } @@ -356,8 +356,8 @@ if ($socid > 0) print '
'.$langs->trans("CustomerAbsoluteDiscountAllUsers").''.$remise_all.' '.$langs->trans("Currency".$conf->currency).' '.$langs->trans("HT").'
'.$langs->trans("CustomerAbsoluteDiscountMy").'
'.$langs->trans("SupplierAbsoluteDiscountAllUsers").''.$remise_all.' '.$langs->trans("Currency".$conf->currency).' '.$langs->trans("HT").'
'.$langs->trans("SupplierAbsoluteDiscountMy").'
'; if($isCustomer && $isSupplier) { print ''; - print ''; } print ''; @@ -401,7 +401,7 @@ if ($socid > 0) /* * Liste remises fixes client restant en cours (= liees a aucune facture ni ligne de facture) */ - + print load_fiche_titre($langs->trans("DiscountStillRemaining")); if($isCustomer) { @@ -424,10 +424,11 @@ if ($socid > 0) $sql.= " AND rc.discount_type = 0"; // Eliminate supplier discounts $sql.= " AND (rc.fk_facture_line IS NULL AND rc.fk_facture IS NULL)"; $sql.= " ORDER BY rc.datec DESC"; - + $resql=$db->query($sql); if ($resql) { + print '
'; print '
'.$langs->trans('DiscountType').' '; - print ' '; + print ' '; + print '   '; print '
'.$langs->trans("AmountHT").'
'; print ''; print ''; // Need 120+ for format with AM/PM @@ -439,9 +440,9 @@ if ($socid > 0) print ''; print ''; print ''; - + $showconfirminfo=array(); - + $i = 0; $num = $db->num_rows($resql); if ($num > 0) @@ -449,7 +450,7 @@ if ($socid > 0) while ($i < $num) { $obj = $db->fetch_object($resql); - + print ''; print ''; if (preg_match('/\(CREDIT_NOTE\)/',$obj->description)) @@ -502,7 +503,7 @@ if ($socid > 0) } else print ''; print ''; - + if ($_GET["action"]=='split' && GETPOST('remid') == $obj->rowid) { $showconfirminfo['rowid']=$obj->rowid; @@ -517,7 +518,8 @@ if ($socid > 0) } $db->free($resql); print "
'.$langs->trans("Date").''.$langs->trans("DiscountOfferedBy").' 
'.dol_print_date($db->jdate($obj->dc),'dayhour').' 
"; - + print '
'; + if (count($showconfirminfo)) { $amount1=price2num($showconfirminfo['amount_ttc']/2,'MT'); @@ -561,10 +563,11 @@ if ($socid > 0) $sql.= " AND rc.discount_type = 1"; // Eliminate customer discounts $sql.= " AND (rc.fk_invoice_supplier IS NULL AND rc.fk_invoice_supplier_line IS NULL)"; $sql.= " ORDER BY rc.datec DESC"; - + $resql=$db->query($sql); if ($resql) { + print '
'; print ''; print ''; print ''; // Need 120+ for format with AM/PM @@ -576,9 +579,9 @@ if ($socid > 0) print ''; print ''; print ''; - + $showconfirminfo=array(); - + $i = 0; $num = $db->num_rows($resql); if ($num > 0) @@ -586,7 +589,7 @@ if ($socid > 0) while ($i < $num) { $obj = $db->fetch_object($resql); - + print ''; print ''; if (preg_match('/\(CREDIT_NOTE\)/',$obj->description)) @@ -639,7 +642,7 @@ if ($socid > 0) } else print ''; print ''; - + if ($_GET["action"]=='split' && GETPOST('remid') == $obj->rowid) { $showconfirminfo['rowid']=$obj->rowid; @@ -654,7 +657,8 @@ if ($socid > 0) } $db->free($resql); print "
'.$langs->trans("Date").''.$langs->trans("DiscountOfferedBy").' 
'.dol_print_date($db->jdate($obj->dc),'dayhour').' 
"; - + print '
'; + if (count($showconfirminfo)) { $amount1=price2num($showconfirminfo['amount_ttc']/2,'MT'); @@ -673,19 +677,19 @@ if ($socid > 0) dol_print_error($db); } - if($isCustomer) { + if ($isCustomer) { print ''; // class="ficheaddleft" print ''; // class="fichehalfright" print ''; // class="fichecenter" } } - print '
'; + print '

'; /* * List discount consumed (=liees a une ligne de facture ou facture) */ - + print load_fiche_titre($langs->trans("DiscountAlreadyCounted")); if($isCustomer) { @@ -730,12 +734,13 @@ if ($socid > 0) $sql2.= " AND rc.fk_user = u.rowid"; $sql2.= " AND rc.discount_type = 0"; // Eliminate supplier discounts $sql2.= " ORDER BY dc DESC"; - + $resql=$db->query($sql); $resql2=null; if ($resql) $resql2=$db->query($sql2); if ($resql2) { + print '
'; print ''; print ''; print ''; // Need 120+ for format with AM/PM @@ -747,7 +752,7 @@ if ($socid > 0) print ''; print ''; print ''; - + $tab_sqlobj=array(); $tab_sqlobjOrder=array(); $num = $db->num_rows($resql); @@ -761,7 +766,7 @@ if ($socid > 0) } } $db->free($resql); - + $num = $db->num_rows($resql2); for ($i = 0;$i < $num;$i++) { @@ -771,7 +776,7 @@ if ($socid > 0) } $db->free($resql2); array_multisort($tab_sqlobjOrder,SORT_DESC,$tab_sqlobj); - + $num = count($tab_sqlobj); if ($num > 0) { @@ -830,8 +835,9 @@ if ($socid > 0) { print ''; } - + print "
'.$langs->trans("Date").''.$langs->trans("Author").' 
'.$langs->trans("None").'
"; + print '
'; } else { @@ -882,12 +888,13 @@ if ($socid > 0) $sql2.= " AND rc.fk_user = u.rowid"; $sql2.= " AND rc.discount_type = 1"; // Eliminate customer discounts $sql2.= " ORDER BY dc DESC"; - + $resql=$db->query($sql); $resql2=null; if ($resql) $resql2=$db->query($sql2); if ($resql2) { + print '
'; print ''; print ''; print ''; // Need 120+ for format with AM/PM @@ -899,7 +906,7 @@ if ($socid > 0) print ''; print ''; print ''; - + $tab_sqlobj=array(); $tab_sqlobjOrder=array(); $num = $db->num_rows($resql); @@ -913,7 +920,7 @@ if ($socid > 0) } } $db->free($resql); - + $num = $db->num_rows($resql2); for ($i = 0;$i < $num;$i++) { @@ -923,7 +930,7 @@ if ($socid > 0) } $db->free($resql2); array_multisort($tab_sqlobjOrder,SORT_DESC,$tab_sqlobj); - + $num = count($tab_sqlobj); if ($num > 0) { @@ -982,8 +989,9 @@ if ($socid > 0) { print ''; } - + print "
'.$langs->trans("Date").''.$langs->trans("Author").' 
'.$langs->trans("None").'
"; + print '
'; } else { From 9a31a61c9d22f61fce1f3fafcf444e1e2d8c8883 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 8 Nov 2018 20:05:01 +0100 Subject: [PATCH 15/15] FIX #9971 --- htdocs/core/class/html.formprojet.class.php | 2 +- htdocs/core/class/translate.class.php | 4 ---- htdocs/core/lib/company.lib.php | 2 +- htdocs/projet/list.php | 2 +- 4 files changed, 3 insertions(+), 7 deletions(-) diff --git a/htdocs/core/class/html.formprojet.class.php b/htdocs/core/class/html.formprojet.class.php index 7d74ac308b9..42ea2d216aa 100644 --- a/htdocs/core/class/html.formprojet.class.php +++ b/htdocs/core/class/html.formprojet.class.php @@ -631,7 +631,7 @@ class FormProjets $sellist .= '>'; if ($useshortlabel) { - $finallabel = ($langs->transnoentitiesnoconv("OppStatusShort".$obj->code) != "OppStatusShort".$obj->code ? $langs->transnoentitiesnoconv("OppStatusShort".$obj->code) : $obj->label); + $finallabel = ($langs->transnoentitiesnoconv("OppStatus".$obj->code) != "OppStatus".$obj->code ? $langs->transnoentitiesnoconv("OppStatus".$obj->code) : $obj->label); } else { diff --git a/htdocs/core/class/translate.class.php b/htdocs/core/class/translate.class.php index bdcae2e33ea..04867db0e7a 100644 --- a/htdocs/core/class/translate.class.php +++ b/htdocs/core/class/translate.class.php @@ -562,10 +562,6 @@ class Translate elseif (preg_match('/^PaymentTypeShort([0-9A-Z]+)$/i',$key,$reg)) { $newstr=$this->getLabelFromKey($db,$reg[1],'c_paiement','code','libelle','',1); - } - elseif (preg_match('/^OppStatusShort([0-9A-Z]+)$/i',$key,$reg)) - { - $newstr=$this->getLabelFromKey($db,$reg[1],'c_lead_status','code','label'); } elseif (preg_match('/^OppStatus([0-9A-Z]+)$/i',$key,$reg)) { diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index c504a01c63d..c00d4469b05 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -802,7 +802,7 @@ function show_projects($conf, $langs, $db, $object, $backtopage='', $nocreatelin print '
'; - if ($obj->opp_status_code) print $langs->trans("OppStatusShort".$obj->opp_status_code); + if ($obj->opp_status_code) print $langs->trans("OppStatus".$obj->opp_status_code); print ''; diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index aa0c4b0d8fe..bc29cd26f45 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -804,7 +804,7 @@ while ($i < min($num,$limit)) if (! empty($arrayfields['p.fk_opp_status']['checked'])) { print ''; - if ($obj->opp_status_code) print $langs->trans("OppStatusShort".$obj->opp_status_code); + if ($obj->opp_status_code) print $langs->trans("OppStatus".$obj->opp_status_code); print '