From 9f23528ccdad01acd200f55fbff3edbb59eb10da Mon Sep 17 00:00:00 2001 From: Ferran Marcet Date: Fri, 29 Oct 2021 12:39:22 +0200 Subject: [PATCH 01/16] Fix: Import don't work if extrafield is separator --- htdocs/core/modules/modAdherent.class.php | 2 +- htdocs/core/modules/modCommande.class.php | 4 ++-- htdocs/core/modules/modFournisseur.class.php | 8 ++++---- htdocs/core/modules/modProduct.class.php | 4 ++-- htdocs/core/modules/modProjet.class.php | 2 +- htdocs/core/modules/modPropale.class.php | 4 ++-- htdocs/core/modules/modResource.class.php | 2 +- htdocs/core/modules/modService.class.php | 2 +- htdocs/core/modules/modSociete.class.php | 4 ++-- htdocs/core/modules/modUser.class.php | 2 +- 10 files changed, 17 insertions(+), 17 deletions(-) diff --git a/htdocs/core/modules/modAdherent.class.php b/htdocs/core/modules/modAdherent.class.php index 1db3e2b7d50..a047d14371c 100644 --- a/htdocs/core/modules/modAdherent.class.php +++ b/htdocs/core/modules/modAdherent.class.php @@ -339,7 +339,7 @@ class modAdherent extends DolibarrModules 'a.datec'=>'DateCreation', 'a.datefin'=>'DateEndSubscription' ); // Add extra fields - $sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'adherent' AND entity IN (0,".$conf->entity.")"; + $sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE type != 'separate' AND elementtype = 'adherent' AND entity IN (0,".$conf->entity.")"; $resql = $this->db->query($sql); if ($resql) // This can fail when class is used on old database (during migration for example) { diff --git a/htdocs/core/modules/modCommande.class.php b/htdocs/core/modules/modCommande.class.php index f257c6e3132..2c0496430e6 100644 --- a/htdocs/core/modules/modCommande.class.php +++ b/htdocs/core/modules/modCommande.class.php @@ -310,7 +310,7 @@ class modCommande extends DolibarrModules // Add extra fields $import_extrafield_sample = []; - $sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'commande' AND entity IN (0, ".$conf->entity.")"; + $sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE type != 'separate' AND elementtype = 'commande' AND entity IN (0, ".$conf->entity.")"; $resql = $this->db->query($sql); if ($resql) { @@ -392,7 +392,7 @@ class modCommande extends DolibarrModules } // Add extra fields - $sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'commandedet' AND entity IN (0, ".$conf->entity.")"; + $sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE type != 'separate' AND elementtype = 'commandedet' AND entity IN (0, ".$conf->entity.")"; $resql = $this->db->query($sql); if ($resql) { while ($obj = $this->db->fetch_object($resql)) { diff --git a/htdocs/core/modules/modFournisseur.class.php b/htdocs/core/modules/modFournisseur.class.php index 39b2f3d3237..dd4f904a209 100644 --- a/htdocs/core/modules/modFournisseur.class.php +++ b/htdocs/core/modules/modFournisseur.class.php @@ -698,7 +698,7 @@ class modFournisseur extends DolibarrModules } // Add extra fields $import_extrafield_sample = []; - $sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'facture_fourn' AND entity IN (0, ".$conf->entity.")"; + $sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE type != 'separate' AND elementtype = 'facture_fourn' AND entity IN (0, ".$conf->entity.")"; $resql = $this->db->query($sql); if ($resql) { while ($obj = $this->db->fetch_object($resql)) { @@ -785,7 +785,7 @@ class modFournisseur extends DolibarrModules } // Add extra fields $import_extrafield_sample = []; - $sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'facture_fourn_det' AND entity IN (0, ".$conf->entity.")"; + $sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE type != 'separate' AND elementtype = 'facture_fourn_det' AND entity IN (0, ".$conf->entity.")"; $resql = $this->db->query($sql); if ($resql) { while ($obj = $this->db->fetch_object($resql)) { @@ -874,7 +874,7 @@ class modFournisseur extends DolibarrModules // Add extra fields $import_extrafield_sample = []; - $sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'commande_fournisseur' AND entity IN (0, ".$conf->entity.")"; + $sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE type != 'separate' AND elementtype = 'commande_fournisseur' AND entity IN (0, ".$conf->entity.")"; $resql = $this->db->query($sql); if ($resql) { @@ -951,7 +951,7 @@ class modFournisseur extends DolibarrModules } // Add extra fields - $sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'commande_fournisseurdet' AND entity IN (0, ".$conf->entity.")"; + $sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE type != 'separate' AND elementtype = 'commande_fournisseurdet' AND entity IN (0, ".$conf->entity.")"; $resql = $this->db->query($sql); if ($resql) { while ($obj = $this->db->fetch_object($resql)) { diff --git a/htdocs/core/modules/modProduct.class.php b/htdocs/core/modules/modProduct.class.php index 78f638b1821..46b9fb692ce 100644 --- a/htdocs/core/modules/modProduct.class.php +++ b/htdocs/core/modules/modProduct.class.php @@ -530,7 +530,7 @@ class modProduct extends DolibarrModules // Add extra fields $import_extrafield_sample = array(); - $sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'product' AND entity IN (0, ".$conf->entity.")"; + $sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE type != 'separate' AND elementtype = 'product' AND entity IN (0, ".$conf->entity.")"; $resql = $this->db->query($sql); if ($resql) // This can fail when class is used on old database (during migration for example) { @@ -666,7 +666,7 @@ class modProduct extends DolibarrModules // Add extra fields $import_extrafield_sample = array(); - $sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'product_fournisseur_price' AND entity IN (0, ".$conf->entity.")"; + $sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHEREtype != 'separate' AND elementtype = 'product_fournisseur_price' AND entity IN (0, ".$conf->entity.")"; $resql = $this->db->query($sql); if ($resql) // This can fail when class is used on old database (during migration for example) { diff --git a/htdocs/core/modules/modProjet.class.php b/htdocs/core/modules/modProjet.class.php index ff2edd3c787..4bd52a68ecf 100644 --- a/htdocs/core/modules/modProjet.class.php +++ b/htdocs/core/modules/modProjet.class.php @@ -293,7 +293,7 @@ class modProjet extends DolibarrModules $this->import_tables_array[$r] = array('t'=>MAIN_DB_PREFIX.'projet_task', 'extra'=>MAIN_DB_PREFIX.'projet_task_extrafields'); // List of tables to insert into (insert done in same order) $this->import_fields_array[$r] = array('t.fk_projet'=>'ProjectRef*', 't.ref'=>'RefTask*', 't.label'=>'LabelTask*', 't.dateo'=>"DateStart", 't.datee'=>"DateEnd", 't.planned_workload'=>"PlannedWorkload", 't.progress'=>"Progress", 't.note_private'=>"NotePrivate", 't.note_public'=>"NotePublic", 't.datec'=>"DateCreation"); // Add extra fields - $sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'projet_task' AND entity IN (0,".$conf->entity.")"; + $sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE type != 'separate' AND elementtype = 'projet_task' AND entity IN (0,".$conf->entity.")"; $resql = $this->db->query($sql); if ($resql) // This can fail when class is used on old database (during migration for example) { diff --git a/htdocs/core/modules/modPropale.class.php b/htdocs/core/modules/modPropale.class.php index 9b40a236511..156cd845128 100644 --- a/htdocs/core/modules/modPropale.class.php +++ b/htdocs/core/modules/modPropale.class.php @@ -292,7 +292,7 @@ class modPropale extends DolibarrModules } // Add extra fields $import_extrafield_sample = []; - $sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'propal' AND entity IN (0, ".$conf->entity.")"; + $sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE type != 'separate' AND elementtype = 'propal' AND entity IN (0, ".$conf->entity.")"; $resql = $this->db->query($sql); if ($resql) { while ($obj = $this->db->fetch_object($resql)) { @@ -376,7 +376,7 @@ class modPropale extends DolibarrModules } // Add extra fields $import_extrafield_sample = []; - $sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'propaldet' AND entity IN (0, ".$conf->entity.")"; + $sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE type != 'separate' AND elementtype = 'propaldet' AND entity IN (0, ".$conf->entity.")"; $resql = $this->db->query($sql); if ($resql) { while ($obj = $this->db->fetch_object($resql)) { diff --git a/htdocs/core/modules/modResource.class.php b/htdocs/core/modules/modResource.class.php index 0d1353076ec..62c86e2e2a8 100644 --- a/htdocs/core/modules/modResource.class.php +++ b/htdocs/core/modules/modResource.class.php @@ -265,7 +265,7 @@ class modResource extends DolibarrModules $this->import_tables_array[$r] = array('r'=>MAIN_DB_PREFIX.'resource', 'extra'=>MAIN_DB_PREFIX.'resource_extrafields'); // List of tables to insert into (insert done in same order) $this->import_fields_array[$r] = array('r.ref'=>"ResourceFormLabel_ref*", 'r.fk_code_type_resource'=>'ResourceTypeCode', 'r.description'=>'ResourceFormLabel_description', 'r.note_private'=>"NotePrivate", 'r.note_public'=>"NotePublic", 'r.asset_number'=>'AssetNumber', 'r.datec'=>'DateCreation'); // Add extra fields - $sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'resource' AND entity IN (0,".$conf->entity.")"; + $sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE type != 'separate' AND elementtype = 'resource' AND entity IN (0,".$conf->entity.")"; $resql = $this->db->query($sql); if ($resql) // This can fail when class is used on old database (during migration for example) { diff --git a/htdocs/core/modules/modService.class.php b/htdocs/core/modules/modService.class.php index b4dd93ff3e0..02c1a989914 100644 --- a/htdocs/core/modules/modService.class.php +++ b/htdocs/core/modules/modService.class.php @@ -462,7 +462,7 @@ class modService extends DolibarrModules if (!empty($conf->global->PRODUCT_USE_UNITS)) $this->import_fields_array[$r]['p.fk_unit'] = 'Unit'; // Add extra fields $import_extrafield_sample = array(); - $sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'product' AND entity IN (0,".$conf->entity.")"; + $sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE type != 'separate' AND elementtype = 'product' AND entity IN (0,".$conf->entity.")"; $resql = $this->db->query($sql); if ($resql) // This can fail when class is used on old database (during migration for example) { diff --git a/htdocs/core/modules/modSociete.class.php b/htdocs/core/modules/modSociete.class.php index 1bb0c61b83e..2382e59f1aa 100644 --- a/htdocs/core/modules/modSociete.class.php +++ b/htdocs/core/modules/modSociete.class.php @@ -465,7 +465,7 @@ class modSociete extends DolibarrModules ); if (!empty($conf->global->PRODUIT_MULTIPRICES)) $this->import_fields_array[$r]['s.price_level'] = 'PriceLevel'; // Add extra fields - $sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'societe' AND entity IN (0, ".$conf->entity.")"; + $sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE type != 'separate' AND elementtype = 'societe' AND entity IN (0, ".$conf->entity.")"; $resql = $this->db->query($sql); if ($resql) // This can fail when class is used on old database (during migration for example) { @@ -642,7 +642,7 @@ class modSociete extends DolibarrModules 's.note_public' => "NotePublic" ); // Add extra fields - $sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'socpeople' AND entity IN (0, ".$conf->entity.")"; + $sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE type != 'separate' AND elementtype = 'socpeople' AND entity IN (0, ".$conf->entity.")"; $resql = $this->db->query($sql); if ($resql) // This can fail when class is used on an old database (during a migration for example) { diff --git a/htdocs/core/modules/modUser.class.php b/htdocs/core/modules/modUser.class.php index 4b397df65e4..9c99c43b804 100644 --- a/htdocs/core/modules/modUser.class.php +++ b/htdocs/core/modules/modUser.class.php @@ -291,7 +291,7 @@ class modUser extends DolibarrModules 'u.statut'=>'Status' ); // Add extra fields - $sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'user' AND entity IN (0,".$conf->entity.")"; + $sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE type != 'separate' AND elementtype = 'user' AND entity IN (0,".$conf->entity.")"; $resql = $this->db->query($sql); if ($resql) // This can fail when class is used on old database (during migration for example) { From 419eaa217fad255c53b2e7352841a612d02cc020 Mon Sep 17 00:00:00 2001 From: Ferran Marcet Date: Fri, 26 Nov 2021 12:38:09 +0100 Subject: [PATCH 02/16] dejar igual que 13 --- htdocs/core/modules/modAdherent.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/modAdherent.class.php b/htdocs/core/modules/modAdherent.class.php index a047d14371c..a3d9f7a5323 100644 --- a/htdocs/core/modules/modAdherent.class.php +++ b/htdocs/core/modules/modAdherent.class.php @@ -339,7 +339,7 @@ class modAdherent extends DolibarrModules 'a.datec'=>'DateCreation', 'a.datefin'=>'DateEndSubscription' ); // Add extra fields - $sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE type != 'separate' AND elementtype = 'adherent' AND entity IN (0,".$conf->entity.")"; + $sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE type <> 'separate' AND elementtype = 'adherent' AND entity IN (0,".$conf->entity.")"; $resql = $this->db->query($sql); if ($resql) // This can fail when class is used on old database (during migration for example) { From 5265cd808415ccab398347fbe8b00b4777214c9c Mon Sep 17 00:00:00 2001 From: Ferran Marcet Date: Fri, 26 Nov 2021 12:49:07 +0100 Subject: [PATCH 03/16] Fix: correctly display the products of a warehouse in the pdf --- .../stock/doc/pdf_standard.modules.php | 32 +++++++++++-------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/htdocs/core/modules/stock/doc/pdf_standard.modules.php b/htdocs/core/modules/stock/doc/pdf_standard.modules.php index 55923d68a79..519da28a3b5 100644 --- a/htdocs/core/modules/stock/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/stock/doc/pdf_standard.modules.php @@ -289,8 +289,8 @@ class pdf_standard extends ModelePDFStock $pdf->MultiCell(0, 3, ''); // Set interline to 3 $pdf->SetTextColor(0, 0, 0); - $tab_top = 80 + $top_shift; - $tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD) ? 42 + $top_shift : 10); + $tab_top = 65 + $top_shift; + $tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD) ? 65 + $top_shift : 10); $tab_height = 130; @@ -323,7 +323,7 @@ class pdf_standard extends ModelePDFStock $i = 0; $nblines = $num; - $this->tabTitleHeight = 0; + $this->tabTitleHeight = 10; $nexY = $tab_top + $this->tabTitleHeight; for ($i = 0; $i < $nblines; $i++) @@ -362,7 +362,8 @@ class pdf_standard extends ModelePDFStock $showpricebeforepagebreak = 1; $pdf->startTransaction(); - pdf_writelinedesc($pdf, $object, $i, $outputlangs, $this->posxtva - $curX, 3, $curX, $curY, $hideref, $hidedesc); + $pdf->writeHTMLCell($this->wref, 3, $curX, $curY, $outputlangs->convToOutputCharset($objp->ref), 0, 1, false, true, 'J', true); + //pdf_writelinedesc($pdf, $object, $i, $outputlangs, $this->posxtva - $curX, 3, $curX, $curY, $hideref, $hidedesc); $pageposafter = $pdf->getPage(); if ($pageposafter > $pageposbefore) // There is a pagebreak { @@ -370,7 +371,8 @@ class pdf_standard extends ModelePDFStock $pageposafter = $pageposbefore; //print $pageposafter.'-'.$pageposbefore;exit; $pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. - pdf_writelinedesc($pdf, $object, $i, $outputlangs, $this->posxtva - $curX, 4, $curX, $curY, $hideref, $hidedesc); + $pdf->writeHTMLCell($this->wref, 4, $curX, $curY, $outputlangs->convToOutputCharset($objp->ref), 0, 1, false, true, 'J', true); + //pdf_writelinedesc($pdf, $object, $i, $outputlangs, $this->posxtva - $curX, 4, $curX, $curY, $hideref, $hidedesc); $pageposafter = $pdf->getPage(); $posyafter = $pdf->GetY(); if ($posyafter > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + $heightforinfotot))) // There is no space left for total+free text @@ -418,8 +420,8 @@ class pdf_standard extends ModelePDFStock $productstatic->status_batch = $objp->tobatch; // Ref. - $pdf->SetXY($this->posxdesc, $curY); - $pdf->MultiCell($this->wref, 3, $productstatic->ref, 0, 'L'); + //$pdf->SetXY($this->posxdesc, $curY); + //$pdf->MultiCell($this->wref, 3, $productstatic->ref, 0, 'L'); // Label $pdf->SetXY($this->posxlabel + 0.8, $curY); @@ -506,7 +508,7 @@ class pdf_standard extends ModelePDFStock /** * Footer table */ - $nexY = $pdf->GetY(); + //$nexY = $pdf->GetY(); $nexY += 2; $curY = $nexY; @@ -572,11 +574,11 @@ class pdf_standard extends ModelePDFStock $height_note = 0; } - $iniY = $tab_top + 7; + /*$iniY = $tab_top + 7; $curY = $tab_top + 7; $nexY = $tab_top + 7; - $tab_top = $tab_top_newpage + 25 + $top_shift; + $tab_top = $tab_top_newpage + 25 + $top_shift;*/ // Show square if ($pagenb == 1) @@ -732,10 +734,12 @@ class pdf_standard extends ModelePDFStock $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->postotalht, 2, $outputlangs->transnoentities("EstimatedStockValueSellShort"), '', 'R'); } - $pdf->SetDrawColor(200, 200, 200); - $pdf->SetLineStyle(array('dash'=>'0', 'color'=>array(200, 200, 200))); - $pdf->line($this->marge_gauche, $tab_top + 11, $this->page_largeur - $this->marge_droite, $tab_top + 11); - $pdf->SetLineStyle(array('dash'=>0)); + if (empty($hidetop)) { + $pdf->SetDrawColor(200, 200, 200); + $pdf->SetLineStyle(array('dash' => '0', 'color' => array(200, 200, 200))); + $pdf->line($this->marge_gauche, $tab_top + 10, $this->page_largeur - $this->marge_droite, $tab_top + 10); + $pdf->SetLineStyle(array('dash' => 0)); + } } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore From ac975ecc6157af1a01a226f4a5516858312dfc40 Mon Sep 17 00:00:00 2001 From: Ferran Marcet Date: Tue, 30 Nov 2021 13:30:17 +0100 Subject: [PATCH 04/16] Undo changes --- .../stock/doc/pdf_standard.modules.php | 32 ++++++++----------- 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/htdocs/core/modules/stock/doc/pdf_standard.modules.php b/htdocs/core/modules/stock/doc/pdf_standard.modules.php index 519da28a3b5..55923d68a79 100644 --- a/htdocs/core/modules/stock/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/stock/doc/pdf_standard.modules.php @@ -289,8 +289,8 @@ class pdf_standard extends ModelePDFStock $pdf->MultiCell(0, 3, ''); // Set interline to 3 $pdf->SetTextColor(0, 0, 0); - $tab_top = 65 + $top_shift; - $tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD) ? 65 + $top_shift : 10); + $tab_top = 80 + $top_shift; + $tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD) ? 42 + $top_shift : 10); $tab_height = 130; @@ -323,7 +323,7 @@ class pdf_standard extends ModelePDFStock $i = 0; $nblines = $num; - $this->tabTitleHeight = 10; + $this->tabTitleHeight = 0; $nexY = $tab_top + $this->tabTitleHeight; for ($i = 0; $i < $nblines; $i++) @@ -362,8 +362,7 @@ class pdf_standard extends ModelePDFStock $showpricebeforepagebreak = 1; $pdf->startTransaction(); - $pdf->writeHTMLCell($this->wref, 3, $curX, $curY, $outputlangs->convToOutputCharset($objp->ref), 0, 1, false, true, 'J', true); - //pdf_writelinedesc($pdf, $object, $i, $outputlangs, $this->posxtva - $curX, 3, $curX, $curY, $hideref, $hidedesc); + pdf_writelinedesc($pdf, $object, $i, $outputlangs, $this->posxtva - $curX, 3, $curX, $curY, $hideref, $hidedesc); $pageposafter = $pdf->getPage(); if ($pageposafter > $pageposbefore) // There is a pagebreak { @@ -371,8 +370,7 @@ class pdf_standard extends ModelePDFStock $pageposafter = $pageposbefore; //print $pageposafter.'-'.$pageposbefore;exit; $pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. - $pdf->writeHTMLCell($this->wref, 4, $curX, $curY, $outputlangs->convToOutputCharset($objp->ref), 0, 1, false, true, 'J', true); - //pdf_writelinedesc($pdf, $object, $i, $outputlangs, $this->posxtva - $curX, 4, $curX, $curY, $hideref, $hidedesc); + pdf_writelinedesc($pdf, $object, $i, $outputlangs, $this->posxtva - $curX, 4, $curX, $curY, $hideref, $hidedesc); $pageposafter = $pdf->getPage(); $posyafter = $pdf->GetY(); if ($posyafter > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + $heightforinfotot))) // There is no space left for total+free text @@ -420,8 +418,8 @@ class pdf_standard extends ModelePDFStock $productstatic->status_batch = $objp->tobatch; // Ref. - //$pdf->SetXY($this->posxdesc, $curY); - //$pdf->MultiCell($this->wref, 3, $productstatic->ref, 0, 'L'); + $pdf->SetXY($this->posxdesc, $curY); + $pdf->MultiCell($this->wref, 3, $productstatic->ref, 0, 'L'); // Label $pdf->SetXY($this->posxlabel + 0.8, $curY); @@ -508,7 +506,7 @@ class pdf_standard extends ModelePDFStock /** * Footer table */ - //$nexY = $pdf->GetY(); + $nexY = $pdf->GetY(); $nexY += 2; $curY = $nexY; @@ -574,11 +572,11 @@ class pdf_standard extends ModelePDFStock $height_note = 0; } - /*$iniY = $tab_top + 7; + $iniY = $tab_top + 7; $curY = $tab_top + 7; $nexY = $tab_top + 7; - $tab_top = $tab_top_newpage + 25 + $top_shift;*/ + $tab_top = $tab_top_newpage + 25 + $top_shift; // Show square if ($pagenb == 1) @@ -734,12 +732,10 @@ class pdf_standard extends ModelePDFStock $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->postotalht, 2, $outputlangs->transnoentities("EstimatedStockValueSellShort"), '', 'R'); } - if (empty($hidetop)) { - $pdf->SetDrawColor(200, 200, 200); - $pdf->SetLineStyle(array('dash' => '0', 'color' => array(200, 200, 200))); - $pdf->line($this->marge_gauche, $tab_top + 10, $this->page_largeur - $this->marge_droite, $tab_top + 10); - $pdf->SetLineStyle(array('dash' => 0)); - } + $pdf->SetDrawColor(200, 200, 200); + $pdf->SetLineStyle(array('dash'=>'0', 'color'=>array(200, 200, 200))); + $pdf->line($this->marge_gauche, $tab_top + 11, $this->page_largeur - $this->marge_droite, $tab_top + 11); + $pdf->SetLineStyle(array('dash'=>0)); } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore From 2b7c3be5110b8bb2efc860af4c205f60719d0732 Mon Sep 17 00:00:00 2001 From: Ferran Marcet Date: Mon, 20 Dec 2021 12:34:46 +0100 Subject: [PATCH 05/16] Replace sql operator --- htdocs/core/modules/modCommande.class.php | 4 ++-- htdocs/core/modules/modFournisseur.class.php | 8 ++++---- htdocs/core/modules/modProduct.class.php | 2 +- htdocs/core/modules/modPropale.class.php | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/core/modules/modCommande.class.php b/htdocs/core/modules/modCommande.class.php index 2c0496430e6..c195ab02521 100644 --- a/htdocs/core/modules/modCommande.class.php +++ b/htdocs/core/modules/modCommande.class.php @@ -310,7 +310,7 @@ class modCommande extends DolibarrModules // Add extra fields $import_extrafield_sample = []; - $sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE type != 'separate' AND elementtype = 'commande' AND entity IN (0, ".$conf->entity.")"; + $sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE type <> 'separate' AND elementtype = 'commande' AND entity IN (0, ".$conf->entity.")"; $resql = $this->db->query($sql); if ($resql) { @@ -392,7 +392,7 @@ class modCommande extends DolibarrModules } // Add extra fields - $sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE type != 'separate' AND elementtype = 'commandedet' AND entity IN (0, ".$conf->entity.")"; + $sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE type <> 'separate' AND elementtype = 'commandedet' AND entity IN (0, ".$conf->entity.")"; $resql = $this->db->query($sql); if ($resql) { while ($obj = $this->db->fetch_object($resql)) { diff --git a/htdocs/core/modules/modFournisseur.class.php b/htdocs/core/modules/modFournisseur.class.php index dd4f904a209..2e8adf476a9 100644 --- a/htdocs/core/modules/modFournisseur.class.php +++ b/htdocs/core/modules/modFournisseur.class.php @@ -698,7 +698,7 @@ class modFournisseur extends DolibarrModules } // Add extra fields $import_extrafield_sample = []; - $sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE type != 'separate' AND elementtype = 'facture_fourn' AND entity IN (0, ".$conf->entity.")"; + $sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE type <> 'separate' AND elementtype = 'facture_fourn' AND entity IN (0, ".$conf->entity.")"; $resql = $this->db->query($sql); if ($resql) { while ($obj = $this->db->fetch_object($resql)) { @@ -785,7 +785,7 @@ class modFournisseur extends DolibarrModules } // Add extra fields $import_extrafield_sample = []; - $sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE type != 'separate' AND elementtype = 'facture_fourn_det' AND entity IN (0, ".$conf->entity.")"; + $sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE type <> 'separate' AND elementtype = 'facture_fourn_det' AND entity IN (0, ".$conf->entity.")"; $resql = $this->db->query($sql); if ($resql) { while ($obj = $this->db->fetch_object($resql)) { @@ -874,7 +874,7 @@ class modFournisseur extends DolibarrModules // Add extra fields $import_extrafield_sample = []; - $sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE type != 'separate' AND elementtype = 'commande_fournisseur' AND entity IN (0, ".$conf->entity.")"; + $sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE type <> 'separate' AND elementtype = 'commande_fournisseur' AND entity IN (0, ".$conf->entity.")"; $resql = $this->db->query($sql); if ($resql) { @@ -951,7 +951,7 @@ class modFournisseur extends DolibarrModules } // Add extra fields - $sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE type != 'separate' AND elementtype = 'commande_fournisseurdet' AND entity IN (0, ".$conf->entity.")"; + $sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE type <> 'separate' AND elementtype = 'commande_fournisseurdet' AND entity IN (0, ".$conf->entity.")"; $resql = $this->db->query($sql); if ($resql) { while ($obj = $this->db->fetch_object($resql)) { diff --git a/htdocs/core/modules/modProduct.class.php b/htdocs/core/modules/modProduct.class.php index c06d4693074..560ca3d7277 100644 --- a/htdocs/core/modules/modProduct.class.php +++ b/htdocs/core/modules/modProduct.class.php @@ -666,7 +666,7 @@ class modProduct extends DolibarrModules // Add extra fields $import_extrafield_sample = array(); - $sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE type != 'separate' AND elementtype = 'product_fournisseur_price' AND entity IN (0, ".$conf->entity.")"; + $sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE type <> 'separate' AND elementtype = 'product_fournisseur_price' AND entity IN (0, ".$conf->entity.")"; $resql = $this->db->query($sql); if ($resql) // This can fail when class is used on old database (during migration for example) { diff --git a/htdocs/core/modules/modPropale.class.php b/htdocs/core/modules/modPropale.class.php index 156cd845128..2f05d9b7471 100644 --- a/htdocs/core/modules/modPropale.class.php +++ b/htdocs/core/modules/modPropale.class.php @@ -292,7 +292,7 @@ class modPropale extends DolibarrModules } // Add extra fields $import_extrafield_sample = []; - $sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE type != 'separate' AND elementtype = 'propal' AND entity IN (0, ".$conf->entity.")"; + $sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE type <> 'separate' AND elementtype = 'propal' AND entity IN (0, ".$conf->entity.")"; $resql = $this->db->query($sql); if ($resql) { while ($obj = $this->db->fetch_object($resql)) { @@ -376,7 +376,7 @@ class modPropale extends DolibarrModules } // Add extra fields $import_extrafield_sample = []; - $sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE type != 'separate' AND elementtype = 'propaldet' AND entity IN (0, ".$conf->entity.")"; + $sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE type <> 'separate' AND elementtype = 'propaldet' AND entity IN (0, ".$conf->entity.")"; $resql = $this->db->query($sql); if ($resql) { while ($obj = $this->db->fetch_object($resql)) { From fee64f57d49a19bc0b3e1d090d80d77da5566bc1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 23 Dec 2021 10:09:20 +0100 Subject: [PATCH 06/16] FIX Can't close a down payment if paid with credit notes. --- htdocs/compta/facture/card.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 1ca81169cfb..15f1a7c8abe 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -5377,7 +5377,8 @@ if ($action == 'create') { } } - $sumofpayment = $object->getSommePaiement(); + $sumofpayment = $totalpaye; + $sumofpaymentall = $totalpaye + $totalcreditnotes + $totaldeposits; // Reverse back money or convert to reduction if ($object->type == Facture::TYPE_CREDIT_NOTE || $object->type == Facture::TYPE_DEPOSIT || $object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_SITUATION) { @@ -5401,8 +5402,8 @@ if ($action == 'create') { print ''.$langs->trans('ConvertToReduc').''; } // For deposit invoice - if ($object->type == Facture::TYPE_DEPOSIT && $usercancreate && $object->statut > 0 && empty($discount->id)) { - if (price2num($object->total_ttc, 'MT') == price2num($sumofpayment, 'MT')) { + if ($object->type == Facture::TYPE_DEPOSIT && $usercancreate && $object->statut > Facture::STATUS_DRAFT && empty($discount->id)) { + if (price2num($object->total_ttc, 'MT') == price2num($sumofpaymentall, 'MT')) { // We can close a down payment only if paid amount is same than amount of down payment (by definition) print ''.$langs->trans('ConvertToReduc').''; } else { @@ -5415,7 +5416,7 @@ if ($action == 'create') { if (($object->statut == Facture::STATUS_VALIDATED && $object->paye == 0 && $usercanissuepayment && (($object->type != Facture::TYPE_CREDIT_NOTE && $object->type != Facture::TYPE_DEPOSIT && $resteapayer <= 0) || ($object->type == Facture::TYPE_CREDIT_NOTE && $resteapayer >= 0) || ($object->type == Facture::TYPE_DEPOSIT && $object->total_ttc > 0))) ) { - if ($object->type == Facture::TYPE_DEPOSIT && price2num($object->total_ttc, 'MT') != price2num($sumofpayment, 'MT')) { + if ($object->type == Facture::TYPE_DEPOSIT && price2num($object->total_ttc, 'MT') != price2num($sumofpaymentall, 'MT')) { // We can close a down payment only if paid amount is same than amount of down payment (by definition) print ''.$langs->trans('ClassifyPaid').''; } else { From 00b43be7e6061c11c3e5878b2b7d1868351bcdee Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 23 Dec 2021 10:20:01 +0100 Subject: [PATCH 07/16] Code comment --- htdocs/compta/facture/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 15f1a7c8abe..2f7efbf11ba 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -5424,7 +5424,7 @@ if ($action == 'create') { } } - // Classify 'closed not completely paid' (possible if validated and not yet filed paid) + // Classify 'closed not completely paid' (possible if validated and not yet set paid) if ($object->statut == Facture::STATUS_VALIDATED && $object->paye == 0 && $resteapayer > 0 && $usercanissuepayment) { if ($totalpaye > 0 || $totalcreditnotes > 0) { // If one payment or one credit note was linked to this invoice From 0273ab67fe99ec798065f8830554d10af9c7189a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 23 Dec 2021 10:24:06 +0100 Subject: [PATCH 08/16] Prepare 14.0.5 --- htdocs/filefunc.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index 40f3f124ae8..038810332bb 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -34,7 +34,7 @@ if (!defined('DOL_APPLICATION_TITLE')) { define('DOL_APPLICATION_TITLE', 'Dolibarr'); } if (!defined('DOL_VERSION')) { - define('DOL_VERSION', '14.0.4'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c + define('DOL_VERSION', '14.0.5'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c } if (!defined('EURO')) { From d82c1f34e0a5d935761f335372158a75b5da1a47 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sat, 25 Dec 2021 11:33:26 +0100 Subject: [PATCH 09/16] Fix modulebuilder params for updatemask action --- htdocs/modulebuilder/template/admin/setup.php | 6 +++--- .../core/modules/mymodule/mod_myobject_advanced.php | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/modulebuilder/template/admin/setup.php b/htdocs/modulebuilder/template/admin/setup.php index d66ede05696..1d00f81fffa 100644 --- a/htdocs/modulebuilder/template/admin/setup.php +++ b/htdocs/modulebuilder/template/admin/setup.php @@ -75,10 +75,10 @@ if ((float) DOL_VERSION >= 6) if ($action == 'updateMask') { - $maskconstorder = GETPOST('maskconstorder', 'alpha'); - $maskorder = GETPOST('maskorder', 'alpha'); + $maskconst = GETPOST('maskconst', 'alpha'); + $maskvalue = GETPOST('maskvalue', 'alpha'); - if ($maskconstorder) $res = dolibarr_set_const($db, $maskconstorder, $maskorder, 'chaine', 0, '', $conf->entity); + if ($maskconstorder) $res = dolibarr_set_const($db, $maskconst, $maskvalue, 'chaine', 0, '', $conf->entity); if (!$res > 0) $error++; diff --git a/htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_advanced.php b/htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_advanced.php index ae5f5d1e876..d18001ba3fe 100644 --- a/htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_advanced.php +++ b/htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_advanced.php @@ -68,7 +68,7 @@ class mod_myobject_advanced extends ModeleNumRefMyObject $texte .= '
'; $texte .= ''; $texte .= ''; - $texte .= ''; + $texte .= ''; $texte .= ''; $tooltip = $langs->trans("GenericMaskCodes", $langs->transnoentities("MyObject"), $langs->transnoentities("MyObject")); @@ -79,7 +79,7 @@ class mod_myobject_advanced extends ModeleNumRefMyObject // Parametrage du prefix $texte .= ''; - $texte .= ''; + $texte .= ''; $texte .= ''; From 3ada0a8741386289184f32ccea1d842bc889f146 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Tue, 28 Dec 2021 10:40:44 +0100 Subject: [PATCH 10/16] Fix #19672 : email unicity was checked when email was null --- htdocs/recruitment/recruitmentcandidature_card.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/recruitment/recruitmentcandidature_card.php b/htdocs/recruitment/recruitmentcandidature_card.php index a1e98ded601..18ecc57512b 100644 --- a/htdocs/recruitment/recruitmentcandidature_card.php +++ b/htdocs/recruitment/recruitmentcandidature_card.php @@ -260,6 +260,8 @@ if (empty($reshook)) { $nuser->employee = 1; $nuser->firstname = $object->firstname; $nuser->lastname = $object->lastname; + $nuser->email = ''; + $nuser->personal_email = $object->email; $nuser->personal_mobile = $object->phone; $nuser->birth = $object->date_birth; $nuser->salary = $object->remuneration_proposed; From 1bb07dbc6b4738b7e24d902eccc79f192cae4666 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Tue, 28 Dec 2021 11:02:45 +0100 Subject: [PATCH 11/16] Fix #19404 : only validated invoice must be considered in unpaid indicator --- htdocs/fourn/class/fournisseur.facture.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 077f306aa3f..66c441841d1 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -2418,7 +2418,7 @@ class FactureFournisseur extends CommonInvoice $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= ' WHERE ff.paye=0'; - $sql .= ' AND ff.fk_statut > 0'; + $sql .= ' AND ff.fk_statut = '.self::STATUS_VALIDATED; $sql .= " AND ff.entity = ".$conf->entity; if ($user->socid) { $sql .= ' AND ff.fk_soc = '.$user->socid; From 0e9b707801430f22b6d4d77375c6f1ce1b5b00d2 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Tue, 28 Dec 2021 11:57:26 +0100 Subject: [PATCH 12/16] Fix #19249 : wrong payment cond and mode on mass order billing --- htdocs/core/actions_massactions.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index cadb7a1768a..64578ad68bb 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -657,8 +657,8 @@ if ($massaction == 'confirm_createbills') { // Create bills from orders. // If we want one invoice per order or if there is no first invoice yet for this thirdparty. $objecttmp->socid = $cmd->socid; $objecttmp->type = $objecttmp::TYPE_STANDARD; - $objecttmp->cond_reglement_id = ($cmd->cond_reglement_id || $cmd->thirdparty->cond_reglement_id); - $objecttmp->mode_reglement_id = ($cmd->mode_reglement_id || $cmd->thirdparty->mode_reglement_id); + $objecttmp->cond_reglement_id = !empty($cmd->cond_reglement_id) ? $cmd->cond_reglement_id : $cmd->thirdparty->cond_reglement_id; + $objecttmp->mode_reglement_id = !empty($cmd->mode_reglement_id) ? $cmd->mode_reglement_id : $cmd->thirdparty->mode_reglement_id; $objecttmp->fk_project = $cmd->fk_project; $objecttmp->multicurrency_code = $cmd->multicurrency_code; From 1d20694f33de4b6196278b9fd7bde2dbdbfe7a41 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Tue, 28 Dec 2021 15:47:46 +0100 Subject: [PATCH 13/16] Fix #19667 : bankentries wrong SQL parenthesis + missing filter --- htdocs/compta/bank/bankentries_list.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php index 84938f24dbc..b68d769da2b 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -613,14 +613,14 @@ if ($search_thirdparty_user) { $sql.= " ( SELECT bu.fk_bank FROM ".MAIN_DB_PREFIX."bank_url AS bu"; $sql.= " JOIN ".MAIN_DB_PREFIX."bank AS b2 ON b2.rowid = bu.fk_bank"; $sql.= " JOIN ".MAIN_DB_PREFIX."user AS subUser ON (bu.type = 'user' AND bu.url_id = subUser.rowid)"; - $sql.= " WHERE ". natural_search(array("subUser.firstname", "subUser.lastname"), $search_thirdparty_user, '', 1)."))"; + $sql.= " WHERE ". natural_search(array("subUser.firstname", "subUser.lastname"), $search_thirdparty_user, '', 1).")"; $sql.= " OR b.rowid IN "; $sql.= " ( SELECT bu.fk_bank FROM ".MAIN_DB_PREFIX."bank_url AS bu"; $sql.= " JOIN ".MAIN_DB_PREFIX."bank AS b2 ON b2.rowid = bu.fk_bank"; $sql.= " JOIN ".MAIN_DB_PREFIX."societe AS subSoc ON (bu.type = 'company' AND bu.url_id = subSoc.rowid)"; $sql.= " WHERE ". natural_search(array("subSoc.nom"), $search_thirdparty_user, '', 1); - $sql.= ")"; + $sql.= "))"; } if ($search_description) { $search_description_to_use = $search_description; @@ -1050,7 +1050,7 @@ if ($resql) { print ''; } if (!empty($arrayfields['bu.label']['checked'])) { - print ''; + print ''; } if (!empty($arrayfields['ba.ref']['checked'])) { print '
'.$langs->trans("Mask").':'.$form->textwithpicto('', $tooltip, 1, 1).''.$form->textwithpicto('', $tooltip, 1, 1).'  '; From 12880f1716ec58cb8d388110c7da75c694193124 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Tue, 28 Dec 2021 16:02:51 +0100 Subject: [PATCH 14/16] Fix : replace old filters by new ones --- htdocs/compta/bank/bankentries_list.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php index b68d769da2b..d3ef0fc3077 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -283,17 +283,17 @@ if ((GETPOST('confirm_savestatement', 'alpha') || GETPOST('confirm_reconcile', ' if ($search_description) { $param .= '&search_description='.urlencode($search_description); } - if ($search_start_dt) { - $param .= '&search_start_dt='.urlencode($search_start_dt); + if (dol_strlen($search_dt_start) > 0) { + $param .= '&search_start_dtmonth='.GETPOST('search_start_dtmonth', 'int').'&search_start_dtday='.GETPOST('search_start_dtday', 'int').'&search_start_dtyear='.GETPOST('search_start_dtyear', 'int'); } - if ($search_end_dt) { - $param .= '&search_end_dt='.urlencode($search_end_dt); + if (dol_strlen($search_dt_end) > 0) { + $param .= '&search_end_dtmonth='.GETPOST('search_end_dtmonth', 'int').'&search_end_dtday='.GETPOST('search_end_dtday', 'int').'&search_end_dtyear='.GETPOST('search_end_dtyear', 'int'); } - if ($search_start_dv) { - $param .= '&search_start_dv='.urlencode($search_start_dv); + if (dol_strlen($search_dv_start) > 0) { + $param .= '&search_start_dvmonth='.GETPOST('search_start_dvmonth', 'int').'&search_start_dvday='.GETPOST('search_start_dvday', 'int').'&search_start_dvyear='.GETPOST('search_start_dvyear', 'int'); } - if ($search_end_dv) { - $param .= '&search_end_dv='.urlencode($search_end_dv); + if (dol_strlen($search_dv_end) > 0) { + $param .= '&search_end_dvmonth='.GETPOST('search_end_dvmonth', 'int').'&search_end_dvday='.GETPOST('search_end_dvday', 'int').'&search_end_dvyear='.GETPOST('search_end_dvyear', 'int'); } if ($search_type) { $param .= '&search_type='.urlencode($search_type); From 4b3289ed842fc7bed20b03d25830545cbe75ed50 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Tue, 28 Dec 2021 16:20:01 +0100 Subject: [PATCH 15/16] Fix #19666 : missing quotes in SQL statement --- .../mysql/data/llx_accounting_account_de.sql | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/htdocs/install/mysql/data/llx_accounting_account_de.sql b/htdocs/install/mysql/data/llx_accounting_account_de.sql index d1b6b00f800..0165c3ec06e 100644 --- a/htdocs/install/mysql/data/llx_accounting_account_de.sql +++ b/htdocs/install/mysql/data/llx_accounting_account_de.sql @@ -2739,21 +2739,21 @@ INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, acc INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3866, 'SKR04', 'Anlagevermögen', 280, 3854, 'Außenanlagen für Geschäfts-, Fabrik- und andere Bauten'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3867, 'SKR04', 'Anlagevermögen', 285, 3854, 'Hof- und Wegbefestigungen'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3868, 'SKR04', 'Anlagevermögen', 290, 3854, 'Einrichtungen für Geschäfts-. Fabrik- und andere Bauten'); ---INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3869, 'SKR04', 'Anlagevermögen', 300, 3854, Wohnbauten'); ---INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3870, 'SKR04', 'Anlagevermögen', 305, 3854, Garagen'); ---INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3871, 'SKR04', 'Anlagevermögen', 310, 3854, Außenanlagen'); ---INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3872, 'SKR04', 'Anlagevermögen', 315, 3854, Hof- und Wegbefestigungen'); ---INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3873, 'SKR04', 'Anlagevermögen', 320, 3854, Einrichtungen für Wohnbauten'); ---INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3874, 'SKR04', 'Anlagevermögen', 329, 3854, Gebäudeteil des häuslichen Arbeitszimmers'); ---INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3875, 'SKR04', 'Anlagevermögen', 330, 3854, Bauten auf fremden Grundstücken'); ---INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3876, 'SKR04', 'Anlagevermögen', 340, 3854, Geschäftsbauten'); ---INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3877, 'SKR04', 'Anlagevermögen', 350, 3854, Fabrikbauten'); ---INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3878, 'SKR04', 'Anlagevermögen', 360, 3854, Wohnbauten'); ---INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3879, 'SKR04', 'Anlagevermögen', 370, 3854, Andere Bauten'); ---INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3880, 'SKR04', 'Anlagevermögen', 380, 3854, Garagen'); ---INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3881, 'SKR04', 'Anlagevermögen', 390, 3854, Außenanlagen'); ---INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3882, 'SKR04', 'Anlagevermögen', 395, 3854, Hof- und Wegbefestigungen'); ---INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3883, 'SKR04', 'Anlagevermögen', 398, 3854, Einrichtungen für Geschäfts-. Fabrik-, Wohn- und andere Bauten'); +--INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3869, 'SKR04', 'Anlagevermögen', 300, 3854, 'Wohnbauten'); +--INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3870, 'SKR04', 'Anlagevermögen', 305, 3854, 'Garagen'); +--INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3871, 'SKR04', 'Anlagevermögen', 310, 3854, 'Außenanlagen'); +--INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3872, 'SKR04', 'Anlagevermögen', 315, 3854, 'Hof- und Wegbefestigungen'); +--INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3873, 'SKR04', 'Anlagevermögen', 320, 3854, 'Einrichtungen für Wohnbauten'); +--INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3874, 'SKR04', 'Anlagevermögen', 329, 3854, 'Gebäudeteil des häuslichen Arbeitszimmers'); +--INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3875, 'SKR04', 'Anlagevermögen', 330, 3854, 'Bauten auf fremden Grundstücken'); +--INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3876, 'SKR04', 'Anlagevermögen', 340, 3854, 'Geschäftsbauten'); +--INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3877, 'SKR04', 'Anlagevermögen', 350, 3854, 'Fabrikbauten'); +--INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3878, 'SKR04', 'Anlagevermögen', 360, 3854, 'Wohnbauten'); +--INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3879, 'SKR04', 'Anlagevermögen', 370, 3854, 'Andere Bauten'); +--INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3880, 'SKR04', 'Anlagevermögen', 380, 3854, 'Garagen'); +--INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3881, 'SKR04', 'Anlagevermögen', 390, 3854, 'Außenanlagen'); +--INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3882, 'SKR04', 'Anlagevermögen', 395, 3854, 'Hof- und Wegbefestigungen'); +--INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3883, 'SKR04', 'Anlagevermögen', 398, 3854, 'Einrichtungen für Geschäfts-. Fabrik-, Wohn- und andere Bauten'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3884, 'SKR04', 'Anlagevermögen', 400, 0, 'Technische Anlagen und Maschinen'); --INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3885, 'SKR04', 'Anlagevermögen', 420, 3884, 'Technische Anlagen'); --INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3886, 'SKR04', 'Anlagevermögen', 440, 3884, 'Maschinen'); From f16166c47cd9caf0e485a1e5bc9913fb3f443fee Mon Sep 17 00:00:00 2001 From: lvessiller Date: Thu, 30 Dec 2021 15:35:49 +0100 Subject: [PATCH 16/16] FIX title for nature of third party in company list --- htdocs/societe/list.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 5299b4ece95..518aa06b34a 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -985,7 +985,9 @@ if (!empty($arrayfields['s.idprof4']['checked'])) print_liste_field_titre if (!empty($arrayfields['s.idprof5']['checked'])) print_liste_field_titre($form->textwithpicto($langs->trans("ProfId5Short"), $textprofid[4], 1, 0), $_SERVER["PHP_SELF"], "s.idprof5", "", $param, '', $sortfield, $sortorder, 'nowrap '); if (!empty($arrayfields['s.idprof6']['checked'])) print_liste_field_titre($form->textwithpicto($langs->trans("ProfId6Short"), $textprofid[4], 1, 0), $_SERVER["PHP_SELF"], "s.idprof6", "", $param, '', $sortfield, $sortorder, 'nowrap '); if (!empty($arrayfields['s.tva_intra']['checked'])) print_liste_field_titre($arrayfields['s.tva_intra']['label'], $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder, 'nowrap '); -if (!empty($arrayfields['customerorsupplier']['checked'])) print_liste_field_titre(''); // type of customer +if (!empty($arrayfields['customerorsupplier']['checked'])) { + print_liste_field_titre($arrayfields['customerorsupplier']['label'], $_SERVER['PHP_SELF'], '', '', $param, '', $sortfield, $sortorder, 'center '); // type of customer +} if (!empty($arrayfields['s.fk_prospectlevel']['checked'])) print_liste_field_titre($arrayfields['s.fk_prospectlevel']['label'], $_SERVER["PHP_SELF"], "s.fk_prospectlevel", "", $param, '', $sortfield, $sortorder, 'center '); if (!empty($arrayfields['s.fk_stcomm']['checked'])) print_liste_field_titre($arrayfields['s.fk_stcomm']['label'], $_SERVER["PHP_SELF"], "s.fk_stcomm", "", $param, '', $sortfield, $sortorder, 'center '); if (!empty($arrayfields['s2.nom']['checked'])) print_liste_field_titre($arrayfields['s2.nom']['label'], $_SERVER["PHP_SELF"], "s2.nom", "", $param, '', $sortfield, $sortorder, 'center ');