From ece6d1bf02c0aed93dc30365288703c6d924acce Mon Sep 17 00:00:00 2001 From: philippe grand Date: Sat, 15 Aug 2015 11:21:50 +0200 Subject: [PATCH 01/23] the form should be outside table to avoid errors --- htdocs/admin/tools/listevents.php | 7 +++---- htdocs/expedition/card.php | 8 ++++---- htdocs/expedition/class/expedition.class.php | 12 ++++++------ 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/htdocs/admin/tools/listevents.php b/htdocs/admin/tools/listevents.php index 6d553f1b236..204ac36ea03 100644 --- a/htdocs/admin/tools/listevents.php +++ b/htdocs/admin/tools/listevents.php @@ -182,7 +182,8 @@ if ($result) $formquestion=array(); print $form->formconfirm($_SERVER["PHP_SELF"].'?noparam=noparam', $langs->trans('PurgeAuditEvents'), $langs->trans('ConfirmPurgeAuditEvents'),'confirm_purge',$formquestion,'no',1); } - + + print '
'; print ''; print ''; print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"e.dateevent","","",'align="left"',$sortfield,$sortorder); @@ -195,7 +196,6 @@ if ($result) // Lignes des champs de filtres - print ''; print ''; print ''; @@ -222,7 +222,6 @@ if ($result) print ''; print "\n"; - print ''; $var=True; @@ -283,7 +282,7 @@ if ($result) if ($usefilter) print ''; else print ''; } - print "
'.$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).$form->select_date($date_end,'date_end',0,0,0,'',1,0,1).'
'.$langs->trans("NoEventFoundWithCriteria").'
'.$langs->trans("NoEventOrNoAuditSetup").'
"; + print ""; $db->free($result); if ($num) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index ffc453d395c..e72af4de601 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -888,11 +888,11 @@ if ($action == 'create') } else { - print ''; + print ''; print ' '; - print ''; - - print ''; + print ''; + + print ''; print img_warning().' '.$langs->trans("NoProductToShipFoundIntoStock", $staticwarehouse->libelle); } } diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 5863161a995..b6ba93fe91e 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -654,11 +654,11 @@ class Expedition extends CommonObject { // line without batch detail - // We decrement stock of product (and sub-products) -> update table llx_product_stock (key of this table is fk_product+fk_entrepot) and add a movement record - $result=$mouvS->livraison($user, $obj->fk_product, $obj->fk_entrepot, $obj->qty, $obj->subprice, $langs->trans("ShipmentValidatedInDolibarr",$numref)); - if ($result < 0) { - $error++; break; - } + // We decrement stock of product (and sub-products) -> update table llx_product_stock (key of this table is fk_product+fk_entrepot) and add a movement record + $result=$mouvS->livraison($user, $obj->fk_product, $obj->fk_entrepot, $obj->qty, $obj->subprice, $langs->trans("ShipmentValidatedInDolibarr",$numref)); + if ($result < 0) { + $error++; break; + } } else { @@ -859,7 +859,7 @@ class Expedition extends CommonObject { // $value['q']=qty to move // $value['id_batch']=id into llx_product_batch of record to move - //var_dump($value); + //var_dump($value); $linebatch = new ExpeditionLineBatch($this->db); $ret=$linebatch->fetchFromStock($value['id_batch']); // load serial, sellby, eatby From d596f5222b5edc1c7317cb1226c7e685af9484f6 Mon Sep 17 00:00:00 2001 From: philippe grand Date: Sat, 15 Aug 2015 15:08:11 +0200 Subject: [PATCH 02/23] the form should be outside table to avoid errors --- htdocs/comm/askpricesupplier/index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/askpricesupplier/index.php b/htdocs/comm/askpricesupplier/index.php index 4eddadf3803..681a889ed25 100644 --- a/htdocs/comm/askpricesupplier/index.php +++ b/htdocs/comm/askpricesupplier/index.php @@ -61,15 +61,15 @@ print '
'; * Search form */ $var=false; -print ''; print ''; print ''; +print '
'; print ''; print ''; print ''; print ''; -print "
'.$langs->trans("SearchRequest").'
'; print $langs->trans("Ref").':
'.$langs->trans("Other").':

\n"; +print "
\n"; /* From 39c2c6b61b58e8a167f18634a17ad62adabb5a6e Mon Sep 17 00:00:00 2001 From: philippe grand Date: Sat, 15 Aug 2015 15:30:12 +0200 Subject: [PATCH 03/23] the form should be outside table to avoid errors --- htdocs/comm/mailing/list.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/htdocs/comm/mailing/list.php b/htdocs/comm/mailing/list.php index ef2e2c48bf8..43441306e34 100644 --- a/htdocs/comm/mailing/list.php +++ b/htdocs/comm/mailing/list.php @@ -96,7 +96,8 @@ if ($result) $param = "&sall=".$sall; if ($filteremail) $param.='&filteremail='.urlencode($filteremail); - + + print '
'; print ''; print ''; print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"m.rowid",$param,"","",$sortfield,$sortorder); @@ -108,7 +109,6 @@ if ($result) print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],($filteremail?"mc.statut":"m.statut"),$param,"",'align="right"',$sortfield,$sortorder); print "\n"; - print ''; print ''; print '"; print "\n"; - print ''; $var=True; @@ -177,7 +176,7 @@ if ($result) print "\n"; $i++; } - print "
'; print ''; @@ -123,7 +123,6 @@ if ($result) print ''; print "
"; + print ''; $db->free($result); } else From a2b39721ce1b0821de6030ec824d186394afc10d Mon Sep 17 00:00:00 2001 From: philippe grand Date: Sat, 15 Aug 2015 15:35:31 +0200 Subject: [PATCH 04/23] the form should be outside table to avoid errors --- htdocs/comm/propal/index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/propal/index.php b/htdocs/comm/propal/index.php index 428e561f4fe..8fc50f853c6 100644 --- a/htdocs/comm/propal/index.php +++ b/htdocs/comm/propal/index.php @@ -63,15 +63,15 @@ print '
'; * Search form */ $var=false; -print ''; print ''; print ''; +print '
'; print ''; print ''; print ''; print ''; -print "
'.$langs->trans("SearchPropal").'
'; print $langs->trans("Ref").':
'.$langs->trans("Other").':

\n"; +print "
\n"; /* From d51912687b9dad289570986a3dde4be4b1539eff Mon Sep 17 00:00:00 2001 From: philippe grand Date: Sat, 15 Aug 2015 15:37:54 +0200 Subject: [PATCH 05/23] the form should be outside table to avoid errors --- htdocs/comm/prospect/index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/prospect/index.php b/htdocs/comm/prospect/index.php index 0d72eac46e3..f5f600ddd08 100644 --- a/htdocs/comm/prospect/index.php +++ b/htdocs/comm/prospect/index.php @@ -54,15 +54,15 @@ print '
'; if (! empty($conf->propal->enabled)) { $var=false; - print ''; print ''; print ''; + print '
'; print ''; print ''; print ''; print ''; - print "
'.$langs->trans("SearchAProposal").'
'; print $langs->trans("Ref").':
'.$langs->trans("Other").':

\n"; + print "
\n"; } /* From 676004e2e408e61a7576143e9eb68fee3a6d79ed Mon Sep 17 00:00:00 2001 From: philippe grand Date: Sat, 15 Aug 2015 15:42:54 +0200 Subject: [PATCH 06/23] the form should be outside table to avoid errors --- htdocs/commande/index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/commande/index.php b/htdocs/commande/index.php index 7957803a5d5..5baa7b7c30f 100644 --- a/htdocs/commande/index.php +++ b/htdocs/commande/index.php @@ -62,15 +62,15 @@ print '
'; // Search customer orders $var=false; -print ''; print ''; print ''; +print '
'; print ''; print ''; print ''; print ''; -print "
'.$langs->trans("SearchOrder").'
'; print $langs->trans("Ref").':
'.$langs->trans("Other").':

\n"; +print "
\n"; /* From b619aa080d1266e82082a8d873fdb6e2d02b0763 Mon Sep 17 00:00:00 2001 From: philippe grand Date: Sat, 15 Aug 2015 15:47:17 +0200 Subject: [PATCH 07/23] the form should be outside table to avoid errors --- htdocs/compta/bank/categ.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/htdocs/compta/bank/categ.php b/htdocs/compta/bank/categ.php index b854503f084..00755959ab9 100644 --- a/htdocs/compta/bank/categ.php +++ b/htdocs/compta/bank/categ.php @@ -158,7 +158,6 @@ if ($result) $db->free($result); } -print ""; /* * Line to add category @@ -172,9 +171,7 @@ if ($action != 'edit') print ''; } -print ""; - -print ""; +print ''; llxFooter(); From 04322544126b8f5d9a8e660cb92c28124ca6c375 Mon Sep 17 00:00:00 2001 From: philippe grand Date: Sat, 15 Aug 2015 15:53:07 +0200 Subject: [PATCH 08/23] the form should be outside table to avoid errors --- htdocs/compta/bank/ligne.php | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/htdocs/compta/bank/ligne.php b/htdocs/compta/bank/ligne.php index e69e2dce2e7..4186dae5561 100644 --- a/htdocs/compta/bank/ligne.php +++ b/htdocs/compta/bank/ligne.php @@ -596,8 +596,7 @@ if ($result) } print ''; - print ""; - print ''; + print ''; } } @@ -610,22 +609,21 @@ print '
'; // List of bank categories - print '
'; -print ''; print ''; print ''; print ''; print ''; + +print '
'; print ''; } -print ""; -print ""; +print ''; $sql = "SELECT c.label, c.rowid"; $sql.= " FROM ".MAIN_DB_PREFIX."bank_class as a, ".MAIN_DB_PREFIX."bank_categ as c"; @@ -650,13 +648,13 @@ if ($result) { print ''; } - print ""; + print ''; $i++; } $db->free($result); } -print "
'.$langs->trans("Rubriques").''; if ($user->rights->banque->modifier) { print ' '; print '
'.img_delete($langs->trans("Remove")).'
"; +print ''; llxFooter(); From 670f0ae867fd4e90fac6668807ca1edc5abf69d4 Mon Sep 17 00:00:00 2001 From: philippe grand Date: Sat, 15 Aug 2015 16:03:09 +0200 Subject: [PATCH 09/23] the form should be outside table to avoid errors --- htdocs/contrat/services.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/htdocs/contrat/services.php b/htdocs/contrat/services.php index eedb0183759..cd07db385aa 100644 --- a/htdocs/contrat/services.php +++ b/htdocs/contrat/services.php @@ -153,7 +153,9 @@ if ($resql) if ($mode == "4" && $filter == "expired") $title=$langs->trans("ListOfExpiredServices"); if ($mode == "5") $title=$langs->trans("ListOfClosedServices"); print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder,'',$num,$totalnboflines,'title_commercial.png'); - + + print '
'; + print ''; print ''; print ''; @@ -169,9 +171,6 @@ if ($resql) print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"], "cd.statut,c.statut",$param,"","align=\"right\"",$sortfield,$sortorder); print "\n"; - print ''; - print ''; - print ''; print '\n"; - print ''; $contractstatic=new Contrat($db); $productstatic=new Product($db); @@ -278,7 +276,7 @@ if ($resql) } $db->free($resql); - print "
'; print ''; @@ -203,7 +202,6 @@ if ($resql) print ''; print ''; print "
"; + print ''; } else From 61f6da0210031bfec9d7de8e68918225ffe5a49e Mon Sep 17 00:00:00 2001 From: philippe grand Date: Sat, 15 Aug 2015 16:07:59 +0200 Subject: [PATCH 10/23] the form should be outside table to avoid errors --- htdocs/core/lib/project.lib.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index f924922cb87..89d658fa01a 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -1023,14 +1023,13 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks= if (!empty($conf->global->PROJECT_LIMIT_YEAR_RANGE)) { //Add the year filter input + print '
'; print ''; print ''; print ''; - print ''; print '\n"; - print '
'.$langs->trans("Year").''; - print ''; print "
'; + print ''; } } From 20a43041882a9ccc01ef07e8a06712786ddc6d15 Mon Sep 17 00:00:00 2001 From: philippe grand Date: Sat, 15 Aug 2015 16:10:24 +0200 Subject: [PATCH 11/23] the form should be outside table to avoid errors --- htdocs/expedition/index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/expedition/index.php b/htdocs/expedition/index.php index 2d5d0e207c6..dbfece18381 100644 --- a/htdocs/expedition/index.php +++ b/htdocs/expedition/index.php @@ -48,13 +48,13 @@ print '
'; $var=false; -print ''; print ''; print ''; +print '
'; print ''; print ''; -print "
'.$langs->trans("SearchASending").'
'; print $langs->trans("Ref").':

\n"; +print "
\n"; /* * Shipments to validate From 924ff21268c54a95cb23cfb9f38590abf08e9e7e Mon Sep 17 00:00:00 2001 From: philippe grand Date: Sat, 15 Aug 2015 16:12:33 +0200 Subject: [PATCH 12/23] the form should be outside table to avoid errors --- htdocs/fourn/commande/index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/commande/index.php b/htdocs/fourn/commande/index.php index 60b9b65e8e8..c877589851d 100644 --- a/htdocs/fourn/commande/index.php +++ b/htdocs/fourn/commande/index.php @@ -58,15 +58,15 @@ print ''; * Search form */ $var=false; -print ''; print ''; print ''; +print '
'; print ''; print ''; print ''; print ''; -print "
'.$langs->trans("SearchOrder").'
'; print $langs->trans("Ref").':
'.$langs->trans("Other").':

\n"; +print "
\n"; /* From 53a21019fd8d23e1562be018b791cacd67975da5 Mon Sep 17 00:00:00 2001 From: philippe grand Date: Sat, 15 Aug 2015 16:15:54 +0200 Subject: [PATCH 13/23] the form should be outside table to avoid errors --- htdocs/fourn/commande/orderstoinvoice.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/htdocs/fourn/commande/orderstoinvoice.php b/htdocs/fourn/commande/orderstoinvoice.php index 49c16d38bc8..a1fa57f97f4 100644 --- a/htdocs/fourn/commande/orderstoinvoice.php +++ b/htdocs/fourn/commande/orderstoinvoice.php @@ -453,7 +453,9 @@ if (($action != 'create' && $action != 'add') && !$error) { $companystatic->nom = $soc->nom; print '

' . $companystatic->getNomUrl(1, 'customer') . '

'; } - + + print '
'; + print ''; print ''; print ''; print_liste_field_titre($langs->trans('Ref'), 'orderstoinvoice.php', 'c.ref', '', '&socid=' . $socid, '', $sortfield, $sortorder); @@ -465,8 +467,6 @@ if (($action != 'create' && $action != 'add') && !$error) { print "\n"; // Lignes des champs de filtre - print ''; - print ''; print ''; print ''; print ''; - print ''; print ''; $var = True; From 7ff149e8764ea1e7d02d8448b8e6c2596caffbc6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 17 Aug 2015 15:13:40 +0200 Subject: [PATCH 14/23] Fix missing param mode --- htdocs/projet/activity/perday.php | 1 + htdocs/projet/activity/perweek.php | 1 + 2 files changed, 2 insertions(+) diff --git a/htdocs/projet/activity/perday.php b/htdocs/projet/activity/perday.php index e018bc47446..f8e106a7e7e 100644 --- a/htdocs/projet/activity/perday.php +++ b/htdocs/projet/activity/perday.php @@ -258,6 +258,7 @@ llxHeader("",$title,""); print_barre_liste($title, $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, "", $num, '', 'title_project'); +$param=($mode?'&mode='.$mode:''); // Show navigation bar $nav ="".img_previous($langs->trans("Previous"))."\n"; diff --git a/htdocs/projet/activity/perweek.php b/htdocs/projet/activity/perweek.php index 6ffc38cfbe9..619803ecbc3 100644 --- a/htdocs/projet/activity/perweek.php +++ b/htdocs/projet/activity/perweek.php @@ -236,6 +236,7 @@ llxHeader("",$title,"",'','','',array('/core/js/timesheet.js')); print_barre_liste($title, $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, "", $num, '', 'title_project'); +$param=($mode?'&mode='.$mode:''); // Show navigation bar $nav ="".img_previous($langs->trans("Previous"))."\n"; From 76ce98630f1e18631e809030cebc04bd7c15017b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 17 Aug 2015 19:42:19 +0200 Subject: [PATCH 15/23] Fix translation --- .../project/doc/pdf_beluga.modules.php | 439 +++++++++--------- htdocs/langs/en_US/projects.lang | 3 +- 2 files changed, 213 insertions(+), 229 deletions(-) diff --git a/htdocs/core/modules/project/doc/pdf_beluga.modules.php b/htdocs/core/modules/project/doc/pdf_beluga.modules.php index 7bca394d161..4a8839ef865 100644 --- a/htdocs/core/modules/project/doc/pdf_beluga.modules.php +++ b/htdocs/core/modules/project/doc/pdf_beluga.modules.php @@ -111,7 +111,7 @@ class pdf_beluga extends ModelePDFProjects { global $user,$langs,$conf; -$formproject=new FormProjets($this->db); + $formproject=new FormProjets($this->db); if (! is_object($outputlangs)) $outputlangs=$langs; // For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO @@ -223,233 +223,216 @@ $formproject=new FormProjets($this->db); $iniY = $tab_top + 7; $curY = $tab_top + 7; $nexY = $tab_top + 7; - -$listofreferent=array( -'propal'=>array( - 'name'=>"Proposals", - 'title'=>"ListProposalsAssociatedProject", - 'class'=>'Propal', - 'table'=>'propal', - 'datefieldname'=>'datep', - 'test'=>$conf->propal->enabled && $user->rights->propale->lire), -'order'=>array( - 'name'=>"CustomersOrders", - 'title'=>"ListOrdersAssociatedProject", - 'class'=>'Commande', - 'table'=>'commande', - 'datefieldname'=>'date_commande', - 'test'=>$conf->commande->enabled && $user->rights->commande->lire), -'invoice'=>array( - 'name'=>"CustomersInvoices", - 'title'=>"ListInvoicesAssociatedProject", - 'class'=>'Facture', - 'margin'=>'add', - 'table'=>'facture', - 'datefieldname'=>'datef', - 'test'=>$conf->facture->enabled && $user->rights->facture->lire), -'invoice_predefined'=>array( - 'name'=>"PredefinedInvoices", - 'title'=>"ListPredefinedInvoicesAssociatedProject", - 'class'=>'FactureRec', - 'table'=>'facture_rec', - 'datefieldname'=>'datec', - 'test'=>$conf->facture->enabled && $user->rights->facture->lire), -'order_supplier'=>array( - 'name'=>"SuppliersOrders", - 'title'=>"ListSupplierOrdersAssociatedProject", - 'class'=>'CommandeFournisseur', - 'table'=>'commande_fournisseur', - 'datefieldname'=>'date_commande', - 'test'=>$conf->fournisseur->enabled && $user->rights->fournisseur->commande->lire), -'invoice_supplier'=>array( - 'name'=>"BillsSuppliers", - 'title'=>"ListSupplierInvoicesAssociatedProject", - 'class'=>'FactureFournisseur', - 'margin'=>'minus', - 'table'=>'facture_fourn', - 'datefieldname'=>'datef', - 'test'=>$conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire), -'contract'=>array( - 'name'=>"Contracts", - 'title'=>"ListContractAssociatedProject", - 'class'=>'Contrat', - 'table'=>'contrat', - 'datefieldname'=>'date_contrat', - 'test'=>$conf->contrat->enabled && $user->rights->contrat->lire), -'intervention'=>array( - 'name'=>"Interventions", - 'title'=>"ListFichinterAssociatedProject", - 'class'=>'Fichinter', - 'table'=>'fichinter', - 'datefieldname'=>'date_valid', - 'disableamount'=>1, - 'test'=>$conf->ficheinter->enabled && $user->rights->ficheinter->lire), -'trip'=>array( - 'name'=>"TripsAndExpenses", - 'title'=>"ListTripAssociatedProject", - 'class'=>'Deplacement', - 'table'=>'deplacement', - 'datefieldname'=>'dated', - 'margin'=>'minus', - 'disableamount'=>1, - 'test'=>$conf->deplacement->enabled && $user->rights->deplacement->lire), -'agenda'=>array( - 'name'=>"Agenda", - 'title'=>"ListActionsAssociatedProject", - 'class'=>'ActionComm', - 'table'=>'actioncomm', - 'datefieldname'=>'datep', - 'disableamount'=>1, - 'test'=>$conf->agenda->enabled && $user->rights->agenda->allactions->lire) -); - - -foreach ($listofreferent as $key => $value) -{ - $title=$value['title']; - $classname=$value['class']; - $tablename=$value['table']; - $datefieldname=$value['datefieldname']; - $qualified=$value['test']; - - if ($qualified) - { - $elementarray = $object->get_element_list($key, $tablename, $datefieldname, $dates, $datee); - $num=count($elementarray); -if ($num> 0) -{ - $nexY = $pdf->GetY()+5; - $curY = $nexY; - $pdf->SetXY($this->posxref, $curY); - $pdf->MultiCell($this->posxstatut-$this->posxref, 3, $outputlangs->transnoentities($title), 0, 'L'); - - - $selectList=$formproject->select_element($tablename,$project->thirdparty->id); - $nexY = $pdf->GetY()+1; - $curY = $nexY; - $pdf->SetXY($this->posxref, $curY); - $pdf->MultiCell($this->posxdate-$this->posxref, 3, $outputlangs->transnoentities("Ref"), 1, 'L'); - $pdf->SetXY($this->posxdate, $curY); - $pdf->MultiCell($this->posxsociety-$this->posxdate, 3, $outputlangs->transnoentities("Date"), 1, 'C'); - $pdf->SetXY($this->posxsociety, $curY); - $pdf->MultiCell($this->posxamountht-$this->posxsociety, 3, $outputlangs->transnoentities("ThirdParty"), 1, 'L'); - if (empty($value['disableamount'])) - { - $pdf->SetXY($this->posxamountht, $curY); - $pdf->MultiCell($this->posxamountttc-$this->posxamountht, 3, $outputlangs->transnoentities("AmountHT"), 1, 'R'); - $pdf->SetXY($this->posxamountttc, $curY); - $pdf->MultiCell($this->posxstatut-$this->posxamountttc, 3, $outputlangs->transnoentities("AmountTTC"), 1, 'R'); - } - else - { - $pdf->SetXY($this->posxamountht, $curY); - $pdf->MultiCell($this->posxstatut-$this->posxamountht, 3, "", 1, 'R'); - } - $pdf->SetXY($this->posxstatut, $curY); - $pdf->MultiCell($this->page_largeur-$this->marge_droite-$this->posxstatut, 3, $outputlangs->transnoentities("Statut"), 1, 'R'); - - - if (is_array($elementarray) && count($elementarray)>0) - { - $nexY = $pdf->GetY(); - $curY = $nexY; - - $total_ht = 0; - $total_ttc = 0; - $num=count($elementarray); - for ($i = 0; $i < $num; $i++) - { - $element = new $classname($this->db); - $element->fetch($elementarray[$i]); - $element->fetch_thirdparty(); - //print $classname; - - $qualifiedfortotal=true; - if ($key == 'invoice') - { - if ($element->close_code == 'replaced') $qualifiedfortotal=false; // Replacement invoice - } - - $pdf->SetXY($this->posxref, $curY); - $pdf->MultiCell($this->posxdate-$this->posxref, 3, $element->ref, 1, 'L'); - - - // Date - if ($tablename == 'commande_fournisseur' || $tablename == 'supplier_order') $date=$element->date_commande; - else - { - $date=$element->date; - if (empty($date)) $date=$element->datep; - if (empty($date)) $date=$element->date_contrat; - if (empty($date)) $date=$element->datev; //Fiche inter - } - - $pdf->SetXY($this->posxdate, $curY); - $pdf->MultiCell($this->posxsociety-$this->posxdate, 3, dol_print_date($date,'day'), 1, 'C'); - - $pdf->SetXY($this->posxsociety, $curY); - if (is_object($element->thirdparty)) - $pdf->MultiCell($this->posxamountht-$this->posxsociety, 3, $element->thirdparty->name, 1, 'L'); - - - // Amount without tax - if (empty($value['disableamount'])) - { - $pdf->SetXY($this->posxamountht, $curY); - $pdf->MultiCell($this->posxamountttc-$this->posxamountht, 3, - (isset($element->total_ht)?price($element->total_ht):' '), 1, 'R'); - $pdf->SetXY($this->posxamountttc, $curY); - $pdf->MultiCell($this->posxstatut-$this->posxamountttc, 3, - (isset($element->total_ttc)?price($element->total_ttc):' '), 1, 'R'); - } - else - { - $pdf->SetXY($this->posxamountht, $curY); - $pdf->MultiCell($this->posxstatut-$this->posxamountht, 3, "", 1, 'R'); - } - - // Status - if ($element instanceof CommonInvoice) { - //This applies for Facture and FactureFournisseur - $outputstatut= $element->getLibStatut(1, $element->getSommePaiement()); - } else { - $outputstatut = $element->getLibStatut(1); - } - $pdf->SetXY($this->posxstatut, $curY); - $pdf->MultiCell($this->page_largeur-$this->marge_droite-$this->posxstatut, 3, - $outputstatut, 1, 'R',false, 1, '', '', true, 0, true); - - if ($qualifiedfortotal) - { - $total_ht = $total_ht + $element->total_ht; - $total_ttc = $total_ttc + $element->total_ttc; - } -$nexY = $pdf->GetY(); - $curY = $nexY; - } - - - if (empty($value['disableamount'])) - { - $curY = $nexY; - $pdf->SetXY($this->posxref, $curY); - $pdf->MultiCell($this->posxamountttc-$this->posxref, 3, "TOTAL", 1, 'L'); - $pdf->SetXY($this->posxamountht, $curY); - $pdf->MultiCell($this->posxamountttc-$this->posxamountht, 3, - (isset($element->total_ht)?price($total_ht):' '), 1, 'R'); - $pdf->SetXY($this->posxamountttc, $curY); - $pdf->MultiCell($this->posxstatut-$this->posxamountttc, 3, - (isset($element->total_ttc)?price($total_ttc):' '), 1, 'R'); - $pdf->SetXY($this->posxstatut, $curY); - $pdf->MultiCell($this->page_largeur-$this->marge_droite-$this->posxstatut, 3, - $outputlangs->transnoentities("Nb")." ".$num, 1, 'L'); - } - $nexY = $pdf->GetY()+5; - $curY = $nexY; - } - } -} -} + + $listofreferent=array( + 'propal'=>array( + 'name'=>"Proposals", + 'title'=>"ListProposalsAssociatedProject", + 'class'=>'Propal', + 'table'=>'propal', + 'datefieldname'=>'datep', + 'test'=>$conf->propal->enabled && $user->rights->propale->lire), + 'order'=>array( + 'name'=>"CustomersOrders", + 'title'=>"ListOrdersAssociatedProject", + 'class'=>'Commande', + 'table'=>'commande', + 'datefieldname'=>'date_commande', + 'test'=>$conf->commande->enabled && $user->rights->commande->lire), + 'invoice'=>array( + 'name'=>"CustomersInvoices", + 'title'=>"ListInvoicesAssociatedProject", + 'class'=>'Facture', + 'margin'=>'add', + 'table'=>'facture', + 'datefieldname'=>'datef', + 'test'=>$conf->facture->enabled && $user->rights->facture->lire), + 'invoice_predefined'=>array( + 'name'=>"PredefinedInvoices", + 'title'=>"ListPredefinedInvoicesAssociatedProject", + 'class'=>'FactureRec', + 'table'=>'facture_rec', + 'datefieldname'=>'datec', + 'test'=>$conf->facture->enabled && $user->rights->facture->lire), + 'order_supplier'=>array( + 'name'=>"SuppliersOrders", + 'title'=>"ListSupplierOrdersAssociatedProject", + 'class'=>'CommandeFournisseur', + 'table'=>'commande_fournisseur', + 'datefieldname'=>'date_commande', + 'test'=>$conf->fournisseur->enabled && $user->rights->fournisseur->commande->lire), + 'invoice_supplier'=>array( + 'name'=>"BillsSuppliers", + 'title'=>"ListSupplierInvoicesAssociatedProject", + 'class'=>'FactureFournisseur', + 'margin'=>'minus', + 'table'=>'facture_fourn', + 'datefieldname'=>'datef', + 'test'=>$conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire), + 'contract'=>array( + 'name'=>"Contracts", + 'title'=>"ListContractAssociatedProject", + 'class'=>'Contrat', + 'table'=>'contrat', + 'datefieldname'=>'date_contrat', + 'test'=>$conf->contrat->enabled && $user->rights->contrat->lire), + 'intervention'=>array( + 'name'=>"Interventions", + 'title'=>"ListFichinterAssociatedProject", + 'class'=>'Fichinter', + 'table'=>'fichinter', + 'datefieldname'=>'date_valid', + 'disableamount'=>1, + 'test'=>$conf->ficheinter->enabled && $user->rights->ficheinter->lire), + 'trip'=>array( + 'name'=>"TripsAndExpenses", + 'title'=>"ListTripAssociatedProject", + 'class'=>'Deplacement', + 'table'=>'deplacement', + 'datefieldname'=>'dated', + 'margin'=>'minus', + 'disableamount'=>1, + 'test'=>$conf->deplacement->enabled && $user->rights->deplacement->lire), + 'agenda'=>array( + 'name'=>"Agenda", + 'title'=>"ListActionsAssociatedProject", + 'class'=>'ActionComm', + 'table'=>'actioncomm', + 'datefieldname'=>'datep', + 'disableamount'=>1, + 'test'=>$conf->agenda->enabled && $user->rights->agenda->allactions->lire) + ); + + + foreach ($listofreferent as $key => $value) + { + $title=$value['title']; + $classname=$value['class']; + $tablename=$value['table']; + $datefieldname=$value['datefieldname']; + $qualified=$value['test']; + + if ($qualified) + { + $elementarray = $object->get_element_list($key, $tablename, $datefieldname, $dates, $datee); + $num = count($elementarray); + if ($num > 0) + { + $nexY = $pdf->GetY() + 5; + $curY = $nexY; + $pdf->SetXY($this->posxref, $curY); + $pdf->MultiCell($this->posxstatut - $this->posxref, 3, $outputlangs->transnoentities($title), 0, 'L'); + + $selectList = $formproject->select_element($tablename, $project->thirdparty->id); + $nexY = $pdf->GetY() + 1; + $curY = $nexY; + $pdf->SetXY($this->posxref, $curY); + $pdf->MultiCell($this->posxdate - $this->posxref, 3, $outputlangs->transnoentities("Ref"), 1, 'L'); + $pdf->SetXY($this->posxdate, $curY); + $pdf->MultiCell($this->posxsociety - $this->posxdate, 3, $outputlangs->transnoentities("Date"), 1, 'C'); + $pdf->SetXY($this->posxsociety, $curY); + $pdf->MultiCell($this->posxamountht - $this->posxsociety, 3, $outputlangs->transnoentities("ThirdParty"), 1, 'L'); + if (empty($value['disableamount'])) { + $pdf->SetXY($this->posxamountht, $curY); + $pdf->MultiCell($this->posxamountttc - $this->posxamountht, 3, $outputlangs->transnoentities("AmountHT"), 1, 'R'); + $pdf->SetXY($this->posxamountttc, $curY); + $pdf->MultiCell($this->posxstatut - $this->posxamountttc, 3, $outputlangs->transnoentities("AmountTTC"), 1, 'R'); + } else { + $pdf->SetXY($this->posxamountht, $curY); + $pdf->MultiCell($this->posxstatut - $this->posxamountht, 3, "", 1, 'R'); + } + $pdf->SetXY($this->posxstatut, $curY); + $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxstatut, 3, $outputlangs->transnoentities("Statut"), 1, 'R'); + + if (is_array($elementarray) && count($elementarray) > 0) + { + $nexY = $pdf->GetY(); + $curY = $nexY; + + $total_ht = 0; + $total_ttc = 0; + $num = count($elementarray); + for ($i = 0; $i < $num; $i ++) { + $element = new $classname($this->db); + $element->fetch($elementarray[$i]); + $element->fetch_thirdparty(); + // print $classname; + + $qualifiedfortotal = true; + if ($key == 'invoice') { + if ($element->close_code == 'replaced') + $qualifiedfortotal = false; // Replacement invoice + } + + $pdf->SetXY($this->posxref, $curY); + $pdf->MultiCell($this->posxdate - $this->posxref, 3, $element->ref, 1, 'L'); + + // Date + if ($tablename == 'commande_fournisseur' || $tablename == 'supplier_order') + $date = $element->date_commande; + else { + $date = $element->date; + if (empty($date)) + $date = $element->datep; + if (empty($date)) + $date = $element->date_contrat; + if (empty($date)) + $date = $element->datev; // Fiche inter + } + + $pdf->SetXY($this->posxdate, $curY); + $pdf->MultiCell($this->posxsociety - $this->posxdate, 3, dol_print_date($date, 'day'), 1, 'C'); + + $pdf->SetXY($this->posxsociety, $curY); + if (is_object($element->thirdparty)) + $pdf->MultiCell($this->posxamountht - $this->posxsociety, 3, $element->thirdparty->name, 1, 'L'); + + // Amount without tax + if (empty($value['disableamount'])) { + $pdf->SetXY($this->posxamountht, $curY); + $pdf->MultiCell($this->posxamountttc - $this->posxamountht, 3, (isset($element->total_ht) ? price($element->total_ht) : ' '), 1, 'R'); + $pdf->SetXY($this->posxamountttc, $curY); + $pdf->MultiCell($this->posxstatut - $this->posxamountttc, 3, (isset($element->total_ttc) ? price($element->total_ttc) : ' '), 1, 'R'); + } else { + $pdf->SetXY($this->posxamountht, $curY); + $pdf->MultiCell($this->posxstatut - $this->posxamountht, 3, "", 1, 'R'); + } + + // Status + if ($element instanceof CommonInvoice) { + // This applies for Facture and FactureFournisseur + $outputstatut = $element->getLibStatut(1, $element->getSommePaiement()); + } else { + $outputstatut = $element->getLibStatut(1); + } + $pdf->SetXY($this->posxstatut, $curY); + $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxstatut, 3, $outputstatut, 1, 'R', false, 1, '', '', true, 0, true); + + if ($qualifiedfortotal) { + $total_ht = $total_ht + $element->total_ht; + $total_ttc = $total_ttc + $element->total_ttc; + } + $nexY = $pdf->GetY(); + $curY = $nexY; + } + + if (empty($value['disableamount'])) { + $curY = $nexY; + $pdf->SetXY($this->posxref, $curY); + $pdf->MultiCell($this->posxamountttc - $this->posxref, 3, "TOTAL", 1, 'L'); + $pdf->SetXY($this->posxamountht, $curY); + $pdf->MultiCell($this->posxamountttc - $this->posxamountht, 3, (isset($element->total_ht) ? price($total_ht) : ' '), 1, 'R'); + $pdf->SetXY($this->posxamountttc, $curY); + $pdf->MultiCell($this->posxstatut - $this->posxamountttc, 3, (isset($element->total_ttc) ? price($total_ttc) : ' '), 1, 'R'); + $pdf->SetXY($this->posxstatut, $curY); + $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxstatut, 3, $outputlangs->transnoentities("Nb") . " " . $num, 1, 'L'); + } + $nexY = $pdf->GetY() + 5; + $curY = $nexY; + } + } + } + } diff --git a/htdocs/langs/en_US/projects.lang b/htdocs/langs/en_US/projects.lang index dc6cece9c3b..c15f99996d4 100644 --- a/htdocs/langs/en_US/projects.lang +++ b/htdocs/langs/en_US/projects.lang @@ -143,7 +143,8 @@ SelectElement=Select element AddElement=Link to element UnlinkElement=Unlink element # Documents models -DocumentModelBaleine=A complete project's report model (logo...) +DocumentModelBeluga=Project template for linked objects overview +DocumentModelBaleine=Project report template for tasks PlannedWorkload=Planned workload PlannedWorkloadShort=Workload WorkloadOccupation=Workload assignation From fabd751be4d1a3288b5201d0f41fcd799e1ed4c2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 17 Aug 2015 20:07:14 +0200 Subject: [PATCH 16/23] Fix Server hang with long loop when reading specimen pdf and high number of tasks. --- htdocs/core/modules/project/doc/pdf_baleine.modules.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/htdocs/core/modules/project/doc/pdf_baleine.modules.php b/htdocs/core/modules/project/doc/pdf_baleine.modules.php index fcac8bd2646..0471fad1877 100644 --- a/htdocs/core/modules/project/doc/pdf_baleine.modules.php +++ b/htdocs/core/modules/project/doc/pdf_baleine.modules.php @@ -154,6 +154,11 @@ class pdf_baleine extends ModelePDFProjects $task = new Task($this->db); $tasksarray = $task->getTasksArray(0,0,$object->id); + if (! $object->id > 0) // Special case when used with object = specimen, we may return all lines + { + $tasksarray=array_slice($tasksarray, 0, min(5, count($tasksarray))); + } + $object->lines=$tasksarray; $nblignes=count($object->lines); @@ -230,12 +235,12 @@ class pdf_baleine extends ModelePDFProjects $pdf->MultiCell($this->posxprogress-$this->posxworkload, 3, $planned_workload, 0, 'R'); $pdf->SetXY($this->posxprogress, $curY); $pdf->MultiCell($this->posxdatestart-$this->posxprogress, 3, $progress, 0, 'R'); + $pdf->SetXY($this->posxdatestart, $curY); $pdf->MultiCell($this->posxdateend-$this->posxdatestart, 3, $datestart, 0, 'C'); $pdf->SetXY($this->posxdateend, $curY); $pdf->MultiCell($this->page_largeur-$this->marge_droite-$this->posxdateend, 3, $dateend, 0, 'C'); - $pageposafter=$pdf->getPage(); $pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut From 241bf85da21d970701139d5a755ca6b38a0d8366 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 18 Aug 2015 09:53:04 +0200 Subject: [PATCH 17/23] Fix parameter sendmassremind --- htdocs/compta/facture/mergepdftool.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/mergepdftool.php b/htdocs/compta/facture/mergepdftool.php index d29f237c331..27741077f6d 100644 --- a/htdocs/compta/facture/mergepdftool.php +++ b/htdocs/compta/facture/mergepdftool.php @@ -56,7 +56,7 @@ if (GETPOST('button_search')) } if ($option == 'late') $filter = 'paye:0'; if ($option == 'unpaidall') $filter = 'paye:0'; -if ($mode == 'sendremind' && $filter == '') $filter = 'paye:0'; +if ($mode == 'sendmassremind' && $filter == '') $filter = 'paye:0'; if ($filter == '') $filter = 'paye:0'; $search_user = GETPOST('search_user','int'); From 5f30ad3b633ce0b8b5a5dbbad8dfd153f21068ab Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 19 Aug 2015 18:27:12 +0200 Subject: [PATCH 18/23] Fix no link to show if id empty --- build/debian/README.howto | 10 +++++----- htdocs/core/boxes/box_contacts.php | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/build/debian/README.howto b/build/debian/README.howto index 6140412b831..3c111f0a0ec 100644 --- a/build/debian/README.howto +++ b/build/debian/README.howto @@ -117,7 +117,7 @@ http://bugs.debian.org/package severity 123 xxx -##### Update but tracker system +##### Update bug tracker system To set status of a bug to "pending" > bts --smtp-host=yoursmtpserver tag 999999 +pending @@ -249,7 +249,7 @@ from git clone dir and make link to git. * If local branch upstream and pristine-tar does not exists, create it from origin/upstream and origin/pristine. -* If new upstream is available onto sourceforge, launch: +* When new upstream is available onto sourceforge, launch: > debian/get-orig-source.sh If script fails with error Bad certificate, you can set "export PERL_LWP_SSL_VERIFY_HOSTNAME=0" to solve this. @@ -273,8 +273,8 @@ Note: If there was errors solved manually after get-orig-sources.sh, you may nee * Fix debian/* files used to build package. Add an entry into debian/changelog > dch -v x.y.z+dfsgw-v "My comment" will add entry. -For example: dch -v x.y.z+dfsgw-1 "New upstream release." for a new version (x.y.z = version, w start from 1 and increaed for each new import) -Then modify changelog to replace "version" or "unstable" with "UNRELEASED". +For example: dch -v x.y.z+dfsgw-1 "New upstream release." for a new version (x.y.z = version, w start from 1 and increased for each new import) +Then check/modify changelog to replace "version" or "unstable" with "UNRELEASED". Then check/modify also the user/date signature: - Date must have format reported by "date -R" - Name and email must match value into debian/control file (Entry added here is used by next step). @@ -299,7 +299,7 @@ Note: Package is built into directory ../build-area * If package .deb is ok: Note: If there was errors managed manually, you may need to make a git commit but do not use option "amend" previous commit -> git push --all ou git push origin --all +> git push --all * If ok, you can tag. > Edit debian/changelog to replace "UNRELEASED" into "unstable", then push diff --git a/htdocs/core/boxes/box_contacts.php b/htdocs/core/boxes/box_contacts.php index 4695be5eaa0..dde2a559cd3 100644 --- a/htdocs/core/boxes/box_contacts.php +++ b/htdocs/core/boxes/box_contacts.php @@ -105,7 +105,7 @@ class box_contacts extends ModeleBoxes $this->info_box_contents[$line][] = array( 'td' => 'align="left"', - 'text' => $societestatic->getNomUrl(1), + 'text' => ($objp->fk_soc > 0 ? $societestatic->getNomUrl(1) : ''), 'asis' => 1, ); From 259a4e069466b3d5f9bdb39cca244e5e9307ee5a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 19 Aug 2015 18:52:18 +0200 Subject: [PATCH 19/23] Update doc --- ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 960bc09756b..1763325fd3e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -224,7 +224,7 @@ Dolibarr better: hook afterLogin or afterLoginFailed instead. - The trigger USER_CREATE_FROM_CONTACT has been replace with USER_CREATE and property context is now filled to make difference between creation from contact or not. - +- Function get_exdir require now 6 parameters. This is to prepare a future feature. ***** ChangeLog for 3.7.2 compared to 3.7.1 ***** FIX [ bug #2855 ] Wrong translation key in localtax report page From 9a6e13d2536e864aae5abeed24d9010fecf6e0c4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 19 Aug 2015 19:45:24 +0200 Subject: [PATCH 20/23] Fix test if empty was inverted --- htdocs/core/lib/functions.lib.php | 2 +- htdocs/fourn/class/fournisseur.facture.class.php | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index e0a7ec1b9f2..cc718334f13 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3743,7 +3743,7 @@ function yn($yesno, $case=1, $color=0) * * @param string $num Id of object * @param int $level Level of subdirs to return (1, 2 or 3 levels) - * @param int $alpha Use alpha ref + * @param int $alpha 0=Keep number only to forge path, 1=Use alpha part afer the - (By default, use 0). * @param int $withoutslash 0=With slash at end, 1=without slash at end (except if '/', we return '') * @param Object $object Object * @param string $modulepart Type of object ('invoice_supplier, 'donation', 'invoice', ...') diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 1bf286ff5aa..5e24417f618 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -1151,7 +1151,7 @@ class FactureFournisseur extends CommonInvoice if (empty($txtva)) $txtva=0; if (empty($txlocaltax1)) $txlocaltax1=0; if (empty($txlocaltax2)) $txlocaltax2=0; - + $remise_percent=price2num($remise_percent); $qty=price2num($qty); $pu=price2num($pu); @@ -1197,7 +1197,7 @@ class FactureFournisseur extends CommonInvoice } else { - dol_syslog("Error error=".$this->error, LOG_ERR); + dol_syslog("Error after updateline error=".$this->error, LOG_ERR); $this->db->rollback(); return -1; } @@ -2096,16 +2096,17 @@ class SupplierInvoiceLine extends CommonObjectLine $this->db->begin(); - if ($this->fk_product) { + if (empty($this->fk_product)) + { $fk_product = "null"; } else { $fk_product = $this->fk_product; } - if ($this->fk_unit) { - $fk_unit = "'".$this->db->escape($this->fk_unit)."'"; - } else { + if (empty($this->fk_unit)) { $fk_unit = "null"; + } else { + $fk_unit = "'".$this->db->escape($this->fk_unit)."'"; } $sql = "UPDATE ".MAIN_DB_PREFIX."facture_fourn_det SET"; From 26e3fcc63688bc7068da7a8d1afe3a0f4eea4786 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 20 Aug 2015 03:38:21 +0200 Subject: [PATCH 21/23] Try a better fix to replace PR #3297 --- htdocs/core/tpl/objectline_edit.tpl.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/htdocs/core/tpl/objectline_edit.tpl.php b/htdocs/core/tpl/objectline_edit.tpl.php index e38b8f873bd..ec427addef9 100644 --- a/htdocs/core/tpl/objectline_edit.tpl.php +++ b/htdocs/core/tpl/objectline_edit.tpl.php @@ -322,7 +322,7 @@ if (! empty($conf->margin->enabled)) var remise = $("input[name='remise_percent']:first"); var rate = $("input[name='"+npRate+"']:first"); - if (rate.val() == '') return true; + if (rate.val() == '' || (typeof rate.val()) == 'undefined' ) return true; if (! $.isNumeric(rate.val().replace(',','.'))) { @@ -331,7 +331,7 @@ if (! empty($conf->margin->enabled)) setTimeout(function () { rate.focus() }, 50); return false; } - if (npRate == "markRate" && rate.val() >= 100) + if (npRate == "np_markRate" && rate.val() >= 100) { alert('trans("markRateShouldBeLesserThan100"); ?>'); e.stopPropagation(); @@ -347,9 +347,11 @@ if (! empty($conf->margin->enabled)) bpjs=price2numjs(buying_price.val()); ratejs=price2numjs(rate.val()); - if (npRate == "marginRate") + /* console.log(npRate+" - "+bpjs+" - "+ratejs); */ + + if (npRate == "np_marginRate") price = ((bpjs * (1 + ratejs / 100)) / (1 - remisejs / 100)); - else if (npRate == "markRate") + else if (npRate == "np_markRate") price = ((bpjs / (1 - ratejs / 100)) / (1 - remisejs / 100)); } $("input[name='price_ht']:first").val(price); // TODO Must use a function like php price to have here a formated value From 936f9122167ce1c878f609168b2dabfde0240403 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 20 Aug 2015 04:07:07 +0200 Subject: [PATCH 22/23] Fix filter on category --- htdocs/core/class/html.formother.class.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index 8e9ca33b2a0..437637c3bdf 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -303,13 +303,14 @@ class FormOther * Return select list for categories (to use in form search selectors) * * @param int $type Type of categories (0=product, 1=suppliers, 2=customers, 3=members) - * @param integer $selected Preselected value - * @param string $htmlname Name of combo list + * @param integer $selected Preselected value + * @param string $htmlname Name of combo list * @param int $nocateg Show also an entry "Not categorized" + * @param int $showempty Add also an empty line * @return string Html combo list code * @see select_all_categories */ - function select_categories($type,$selected=0,$htmlname='search_categ',$nocateg=0) + function select_categories($type,$selected=0,$htmlname='search_categ',$nocateg=0,$showempty=1) { global $conf, $langs; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; @@ -331,7 +332,7 @@ class FormOther // Print a select with each of them $moreforfilter.=''; - print ''; + print ''; print ''; print '';
'; // REF @@ -497,7 +497,6 @@ if (($action != 'create' && $action != 'add') && !$error) { print '