From 1523b2ef8095cd95f46e617d7a75cb18054780d1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 28 Aug 2017 14:02:08 +0200 Subject: [PATCH 01/29] FIX #7222 --- htdocs/install/mysql/data/llx_accounting.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/data/llx_accounting.sql b/htdocs/install/mysql/data/llx_accounting.sql index 6448646bda0..f8696de1ea5 100644 --- a/htdocs/install/mysql/data/llx_accounting.sql +++ b/htdocs/install/mysql/data/llx_accounting.sql @@ -378,7 +378,7 @@ INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (323,'PCG99-BASE','CHARGE','XXXXXX', '601', '322', 'Achats stockés - Matières premières (et fournitures)', 1); INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (324,'PCG99-BASE','CHARGE','XXXXXX', '602', '322', 'Achats stockés - Autres approvisionnements', 1); INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (325,'PCG99-BASE','CHARGE','XXXXXX', '603', '322', 'Variations des stocks (approvisionnements et marchandises)', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (326,'PCG99-BASE','CHARGE','XXXXXX', '604', '322', 'Achats stockés - Matières premières (et fournitures)', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (326,'PCG99-BASE','CHARGE','XXXXXX', '604', '322', 'Achats études et prestations de services', 1); INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (327,'PCG99-BASE','CHARGE','XXXXXX', '605', '322', 'Achats de matériel, équipements et travaux', 1); INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (328,'PCG99-BASE','CHARGE','XXXXXX', '606', '322', 'Achats non stockés de matière et fournitures', 1); INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (329,'PCG99-BASE','CHARGE','XXXXXX', '607', '322', 'Achats de marchandises', 1); From 07f7db1b6d17de941b9473853729ddc38b003bb2 Mon Sep 17 00:00:00 2001 From: atm-quentin Date: Tue, 29 Aug 2017 11:22:50 +0200 Subject: [PATCH 02/29] FIX createFromCurrent lastvalue --- htdocs/compta/facture/class/facture.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 221f224e043..efb55f9b64c 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -783,7 +783,7 @@ class Facture extends CommonInvoice $facture->situation_final = $this->situation_final; // Loop on each line of new invoice - foreach($facture->lines as $i => $line) + foreach($facture->lines as $i => &$line) { $facture->lines[$i]->fk_prev_id = $this->lines[$i]->rowid; if ($invertdetail) From e9cdf852868a3744b838c1fe762870a4321bcf2c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 29 Aug 2017 12:58:18 +0200 Subject: [PATCH 03/29] Fxi repeair of collation --- htdocs/install/mysql/migration/repair.sql | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/repair.sql b/htdocs/install/mysql/migration/repair.sql index cd55b7b38e2..e759985b7a8 100755 --- a/htdocs/install/mysql/migration/repair.sql +++ b/htdocs/install/mysql/migration/repair.sql @@ -35,7 +35,10 @@ -- VMYSQLUTF8UNICODECI ALTER TABLE llx_product_lot MODIFY batch VARCHAR(30) COLLATE utf8_unicode_ci; -- VMYSQLUTF8UNICODECI ALTER TABLE llx_product_batch MODIFY batch VARCHAR(30) CHARACTER SET utf8; -- VMYSQLUTF8UNICODECI ALTER TABLE llx_product_batch MODIFY batch VARCHAR(30) COLLATE utf8_unicode_ci; - +-- VMYSQLUTF8UNICODECI ALTER TABLE llx_product MODIFY accountancy_code_sell VARCHAR(32) CHARACTER SET utf8; +-- VMYSQLUTF8UNICODECI ALTER TABLE llx_product MODIFY accountancy_code_sell VARCHAR(32) COLLATE utf8_unicode_ci; +-- VMYSQLUTF8UNICODECI ALTER TABLE llx_product MODIFY accountancy_code_buy VARCHAR(32) CHARACTER SET utf8; +-- VMYSQLUTF8UNICODECI ALTER TABLE llx_product MODIFY accountancy_code_buy VARCHAR(32) COLLATE utf8_unicode_ci; -- VMYSQL4.1 SET sql_mode = 'ALLOW_INVALID_DATES'; From 22ca29a51febce118d726fdc6f1f0d5a4369c6eb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 29 Aug 2017 13:32:25 +0200 Subject: [PATCH 04/29] Fix sql syntax error --- htdocs/core/menus/standard/auguria.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/menus/standard/auguria.lib.php b/htdocs/core/menus/standard/auguria.lib.php index fd4d2a4e7f7..3d38328249d 100644 --- a/htdocs/core/menus/standard/auguria.lib.php +++ b/htdocs/core/menus/standard/auguria.lib.php @@ -357,8 +357,8 @@ function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabM $sql = "SELECT rowid, code, label, nature"; $sql.= " FROM ".MAIN_DB_PREFIX."accounting_journal"; $sql.= " WHERE entity = ".$conf->entity; - $sql.= " active = 1"; - $sql.= " ORDER BY label"; + $sql.= " AND active = 1"; + $sql.= " ORDER BY label DESC"; $resql = $db->query($sql); if ($resql) From eebaff95cf6a3f2ca9e384a355f1537da8d6b312 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 29 Aug 2017 13:41:44 +0200 Subject: [PATCH 05/29] Fix pb with imagick --- htdocs/core/lib/files.lib.php | 31 +++++++++++++++++++------------ htdocs/core/lib/functions.lib.php | 7 +++++-- 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 99b80049999..e3419be0d14 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -1565,34 +1565,41 @@ function dol_remove_file_process($filenb,$donotupdatesession=0,$donotdeletefile= * @param string $fileinput Input file name * @param string $ext Format of target file (It is also extension added to file if fileoutput is not provided). * @param string $fileoutput Output filename - * @return int <0 if KO, >0 if OK + * @return int <0 if KO, 0=Nothing done, >0 if OK */ function dol_convert_file($fileinput,$ext='png',$fileoutput='') { global $langs; - $image=new Imagick(); - $ret = $image->readImage($fileinput); - if ($ret) + if (class_exists('Imagick')) { - $ret = $image->setImageFormat($ext); + $image=new Imagick(); + $ret = $image->readImage($fileinput); if ($ret) { - if (empty($fileoutput)) $fileoutput=$fileinput.".".$ext; + $ret = $image->setImageFormat($ext); + if ($ret) + { + if (empty($fileoutput)) $fileoutput=$fileinput.".".$ext; - $count = $image->getNumberImages(); - $ret = $image->writeImages($fileoutput, true); - if ($ret) return $count; - else return -3; + $count = $image->getNumberImages(); + $ret = $image->writeImages($fileoutput, true); + if ($ret) return $count; + else return -3; + } + else + { + return -2; + } } else { - return -2; + return -1; } } else { - return -1; + return 0; } } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 46796467ae6..4af0679920d 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1236,8 +1236,11 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r && (! file_exists($fileimagebis) || (filemtime($fileimagebis) < filemtime($file))) ) { - $ret = dol_convert_file($file, 'png', $fileimage); - if ($ret < 0) $error++; + if (empty($conf->global->MAIN_DISABLE_PDF_THUMBS)) // If you experienc trouble with pdf thumb generation and imagick, you can disable here. + { + $ret = dol_convert_file($file, 'png', $fileimage); + if ($ret < 0) $error++; + } } $heightforphotref=70; From 8f01db10a6a77c5938d1e49d3e95311d1e181aae Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 29 Aug 2017 13:41:55 +0200 Subject: [PATCH 06/29] Fix setup for india --- htdocs/install/mysql/data/llx_c_tva.sql | 4 ++-- htdocs/install/mysql/migration/5.0.0-6.0.0.sql | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/htdocs/install/mysql/data/llx_c_tva.sql b/htdocs/install/mysql/data/llx_c_tva.sql index df533f39db0..cce279d79da 100644 --- a/htdocs/install/mysql/data/llx_c_tva.sql +++ b/htdocs/install/mysql/data/llx_c_tva.sql @@ -138,8 +138,8 @@ insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (11 insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1173, 117, '1','0','VAT super-reduced rate',0); insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1174, 117, '0','0','VAT Rate 0', 0); -insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1176, 117, 'IGST+CGST', 8, 8, '1', 0, '0', 0, 'IGST+CGST', 1); -insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1177, 117, 'SGST' , 0, 0, '0', 16, '1', 0, 'SGST', 1); +insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1176, 117, 'CGST+SGST', 0, 9, '1', 9, '1', 0, 'CGST+SGST - Same state sales', 1); +insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1177, 117, 'IGST' , 18, 0, '0', 0, '0', 0, 'IGST', 1); -- IRELAND (id country=8) insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (81, 8, '0','0','VAT Rate 0',1); diff --git a/htdocs/install/mysql/migration/5.0.0-6.0.0.sql b/htdocs/install/mysql/migration/5.0.0-6.0.0.sql index e41e561da38..b1a7088062d 100644 --- a/htdocs/install/mysql/migration/5.0.0-6.0.0.sql +++ b/htdocs/install/mysql/migration/5.0.0-6.0.0.sql @@ -582,6 +582,5 @@ ALTER TABLE llx_mailing_cibles MODIFY COLUMN source_url varchar(255); -- VPGSQL8.2 CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_website FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); -- VPGSQL8.2 CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_website_page FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); - -insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1176, 117, 'IGST-CGST', 8, 8, '1', 0, '0', 0, 'IGST-CGST', 1); -insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1177, 117, 'SGST', 0, 0, '0', 16, '1', 0, 'SGST', 1); +insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1176, 117, 'CGST+SGST', 0, 9, '1', 9, '1', 0, 'CGST+SGST - Same state sales', 1); +insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1177, 117, 'IGST' , 18, 0, '0', 0, '0', 0, 'IGST', 1); From 7218a9de0ebb781f0a73dfdedae3dbb6beb83925 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 29 Aug 2017 13:52:24 +0200 Subject: [PATCH 07/29] Fix translation of total VAT --- .../commande/doc/pdf_einstein.modules.php | 30 +++++++++---------- .../modules/facture/doc/pdf_crabe.modules.php | 2 +- .../modules/propale/doc/pdf_azur.modules.php | 24 +++++++-------- .../pdf/pdf_canelle.modules.php | 4 +-- .../pdf/pdf_muscadet.modules.php | 8 ++--- .../doc/pdf_aurore.modules.php | 14 ++++----- 6 files changed, 41 insertions(+), 41 deletions(-) diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index 396ac54e9b5..785e4361c04 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -45,28 +45,28 @@ class pdf_einstein extends ModelePDFCommandes * @var DoliDb Database handler */ public $db; - + /** * @var string model name */ public $name; - + /** * @var string model description (short text) */ public $description; - + /** * @var string document type */ public $type; - + /** * @var array() Minimum version of PHP required by module. * e.g.: PHP ≥ 5.3 = array(5, 3) */ - public $phpmin = array(5, 2); - + public $phpmin = array(5, 2); + /** * Dolibarr version of the loaded document * @public string @@ -240,11 +240,11 @@ class pdf_einstein extends ModelePDFCommandes $pdf=pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance $pdf->SetAutoPageBreak(1,0); - + $heightforinfotot = 40; // Height reserved to output the info and total part $heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) - + if (class_exists('TCPDF')) { $pdf->setPrintHeader(false); @@ -317,16 +317,16 @@ class pdf_einstein extends ModelePDFCommandes $pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top-1, dol_htmlentitiesbr($desc_incoterms), 0, 1); $nexY = $pdf->GetY(); $height_incoterms=$nexY-$tab_top; - + // Rect prend une longueur en 3eme param $pdf->SetDrawColor(192,192,192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_incoterms+1); - + $tab_top = $nexY+6; $height_incoterms += 4; } } - + // Affiche notes $notetoshow=empty($object->note_public)?'':$object->note_public; if (! empty($conf->global->MAIN_ADD_SALE_REP_SIGNATURE_IN_NOTE)) @@ -478,7 +478,7 @@ class pdf_einstein extends ModelePDFCommandes // Collecte des totaux par valeur de tva dans $this->tva["taux"]=total_tva if ($conf->multicurrency->enabled && $object->multicurrency_tx != 1) $tvaligne=$object->lines[$i]->multicurrency_total_tva; else $tvaligne=$object->lines[$i]->total_tva; - + $localtax1ligne=$object->lines[$i]->total_localtax1; $localtax2ligne=$object->lines[$i]->total_localtax2; $localtax1_rate=$object->lines[$i]->localtax1_tx; @@ -585,7 +585,7 @@ class pdf_einstein extends ModelePDFCommandes $posy=$this->_tableau_versements($pdf, $object, $posy, $outputlangs); } */ - + // Pied de page $this->_pagefoot($pdf,$object,$outputlangs); if (method_exists($pdf,'AliasNbPages')) $pdf->AliasNbPages(); @@ -953,7 +953,7 @@ class pdf_einstein extends ModelePDFCommandes $tvakey=str_replace('*','',$tvakey); $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; } - $totalvat =$outputlangs->transnoentities("TotalVAT").' '; + $totalvat =$outputlangs->transcountrynoentities("TotalVAT",$mysoc->country_code).' '; $totalvat.=vatrate($tvakey,1).$tvacompl; $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); @@ -1294,7 +1294,7 @@ class pdf_einstein extends ModelePDFCommandes $pdf->MultiCell(100, 3, $langs->trans("SalesRepresentative")." : ".$usertmp->getFullName($langs), '', 'R'); } } - + $posy+=2; // Show list of linked objects diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 092ae36fe28..491b7562408 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -1176,7 +1176,7 @@ class pdf_crabe extends ModelePDFFactures $tvakey=str_replace('*','',$tvakey); $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; } - $totalvat =$outputlangs->transnoentities("TotalVAT").' '; + $totalvat =$outputlangs->transcountrynoentities("TotalVAT",$mysoc->country_code).' '; $totalvat.=vatrate($tvakey,1).$tvacompl; $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index d2ecfb60d81..621e2af3218 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -273,7 +273,7 @@ class pdf_azur extends ModelePDFPropales $pdf=pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance $pdf->SetAutoPageBreak(1,0); - + if (class_exists('TCPDF')) { $pdf->setPrintHeader(false); @@ -322,19 +322,19 @@ class pdf_azur extends ModelePDFPropales $pdf->AddPage(); if (! empty($tplidx)) $pdf->useTemplate($tplidx); $pagenb++; - + $heightforinfotot = 40; // Height reserved to output the info and total part $heightforsignature = empty($conf->global->PROPAL_DISABLE_SIGNATURE)?(pdfGetHeightForHtmlContent($pdf, $outputlangs->transnoentities("ProposalCustomerSignature"))+10):0; $heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) - //print $heightforinfotot + $heightforsignature + $heightforfreetext + $heightforfooter;exit; - + //print $heightforinfotot + $heightforsignature + $heightforfreetext + $heightforfooter;exit; + $this->_pagehead($pdf, $object, 1, $outputlangs); $pdf->SetFont('','', $default_font_size - 1); $pdf->MultiCell(0, 3, ''); // Set interline to 3 $pdf->SetTextColor(0,0,0); - + $tab_top = 90; $tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?42:10); $tab_height = 130; @@ -383,7 +383,7 @@ class pdf_azur extends ModelePDFPropales $notetoshow.='Affaire suivi par '.$tmpuser->getFullName($langs); if ($tmpuser->email) $notetoshow.=', Mail: '.$tmpuser->email; if ($tmpuser->office_phone) $notetoshow.=', Tel: '.$tmpuser->office_phone; - } + } if ($notetoshow) { $tab_top = 88 + $height_incoterms; @@ -552,14 +552,14 @@ class pdf_azur extends ModelePDFPropales // Collecte des totaux par valeur de tva dans $this->tva["taux"]=total_tva if ($conf->multicurrency->enabled && $object->multicurrency_tx != 1) $tvaligne=$object->lines[$i]->multicurrency_total_tva; else $tvaligne=$object->lines[$i]->total_tva; - + $localtax1ligne=$object->lines[$i]->total_localtax1; $localtax2ligne=$object->lines[$i]->total_localtax2; $localtax1_rate=$object->lines[$i]->localtax1_tx; $localtax2_rate=$object->lines[$i]->localtax2_tx; $localtax1_type=$object->lines[$i]->localtax1_type; - $localtax2_type=$object->lines[$i]->localtax2_type; - + $localtax2_type=$object->lines[$i]->localtax2_type; + if ($object->remise_percent) $tvaligne-=($tvaligne*$object->remise_percent)/100; if ($object->remise_percent) $localtax1ligne-=($localtax1ligne*$object->remise_percent)/100; if ($object->remise_percent) $localtax2ligne-=($localtax2ligne*$object->remise_percent)/100; @@ -667,7 +667,7 @@ class pdf_azur extends ModelePDFPropales { $posy=$this->_signature_area($pdf, $object, $posy, $outputlangs); } - + // Pied de page $this->_pagefoot($pdf,$object,$outputlangs); if (method_exists($pdf,'AliasNbPages')) $pdf->AliasNbPages(); @@ -1103,7 +1103,7 @@ class pdf_azur extends ModelePDFPropales $tvakey=str_replace('*','',$tvakey); $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; } - $totalvat =$outputlangs->transnoentities("TotalVAT").' '; + $totalvat =$outputlangs->transcountrynoentities("TotalVAT",$mysoc->country_code).' '; $totalvat.=vatrate($tvakey,1).$tvacompl; $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); @@ -1479,7 +1479,7 @@ class pdf_azur extends ModelePDFPropales $pdf->MultiCell(100, 3, $langs->trans("SalesRepresentative")." : ".$usertmp->getFullName($langs), '', 'R'); } } - + $posy+=2; // Show list of linked objects diff --git a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php index 1e7e6f4bcad..36750226a0d 100644 --- a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php @@ -620,7 +620,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; } - $totalvat =$outputlangs->transnoentities("TotalVAT").' '; + $totalvat =$outputlangs->transcountrynoentities("TotalVAT",$mysoc->country_code).' '; $totalvat.=vatrate($tvakey,1).$tvacompl; $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); @@ -632,7 +632,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices { $index++; $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalVAT"), 0, 'L', 1); + $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transcountrynoentities("TotalVAT", $mysoc->country_code), 0, 'L', 1); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_tva), 0, 'R', 1); diff --git a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php index c882ed89800..0365eb2bfb4 100644 --- a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php @@ -439,7 +439,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders // Collecte des totaux par valeur de tva dans $this->tva["taux"]=total_tva if ($conf->multicurrency->enabled && $object->multicurrency_tx != 1) $tvaligne=$object->lines[$i]->multicurrency_total_tva; else $tvaligne=$object->lines[$i]->total_tva; - + $localtax1ligne=$object->lines[$i]->total_localtax1; $localtax2ligne=$object->lines[$i]->total_localtax2; $localtax1_rate=$object->lines[$i]->localtax1_tx; @@ -718,7 +718,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; } - $totalvat =$outputlangs->transnoentities("TotalVAT").' '; + $totalvat =$outputlangs->transcountrynoentities("TotalVAT",$mysoc->country_code).' '; $totalvat.=vatrate($tvakey,1).$tvacompl; $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); @@ -730,7 +730,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders { $index++; $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalVAT"), 0, 'L', 1); + $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transcountrynoentities("TotalVAT", $mysoc->country_code), 0, 'L', 1); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_tva), 0, 'R', 1); @@ -1124,7 +1124,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $pdf->MultiCell(100, 3, $langs->trans("BuyerName")." : ".$usertmp->getFullName($langs), '', 'R'); } } - + $posy+=1; $pdf->SetTextColor(0,0,60); diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php index a7e8952c604..0982a18f3d0 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -177,7 +177,7 @@ class pdf_aurore extends ModelePDFSupplierProposal $pdir = get_exdir(0,2,0,0,$objphoto,'product') . dol_sanitizeFileName($objphoto->ref).'/'; $dir = $conf->product->dir_output.'/'.$pdir; } - + $realpath=''; foreach ($objphoto->liste_photos($dir,1) as $key => $obj) { @@ -445,7 +445,7 @@ class pdf_aurore extends ModelePDFSupplierProposal if ($up_excl_tax > 0) $pdf->MultiCell($this->posxqty-$this->posxup-0.8, 3, $up_excl_tax, 0, 'R', 0); */ - + // Quantity $qty = pdf_getlineqty($object, $i, $outputlangs, $hidedetails); $pdf->SetXY($this->posxqty, $curY); @@ -466,11 +466,11 @@ class pdf_aurore extends ModelePDFSupplierProposal if ($total_excl_tax > 0) $pdf->MultiCell($this->page_largeur-$this->marge_droite-$this->postotalht, 3, $total_excl_tax, 0, 'R', 0); */ - + // Collecte des totaux par valeur de tva dans $this->tva["taux"]=total_tva if ($conf->multicurrency->enabled && $object->multicurrency_tx != 1) $tvaligne=$object->lines[$i]->multicurrency_total_tva; else $tvaligne=$object->lines[$i]->total_tva; - + $localtax1ligne=$object->lines[$i]->total_localtax1; $localtax2ligne=$object->lines[$i]->total_localtax2; $localtax1_rate=$object->lines[$i]->localtax1_tx; @@ -941,7 +941,7 @@ class pdf_aurore extends ModelePDFSupplierProposal $tvakey=str_replace('*','',$tvakey); $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; } - $totalvat =$outputlangs->transnoentities("TotalVAT").' '; + $totalvat =$outputlangs->transcountrynoentities("TotalVAT",$mysoc->country_code).' '; $totalvat.=vatrate($tvakey,1).$tvacompl; $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); @@ -1035,7 +1035,7 @@ class pdf_aurore extends ModelePDFSupplierProposal $resteapayer = $object->total_ttc - $deja_regle; if (! empty($object->paye)) $resteapayer=0; */ - + if ($deja_regle > 0) { $index++; @@ -1297,7 +1297,7 @@ class pdf_aurore extends ModelePDFSupplierProposal $pdf->MultiCell(100, 3, $langs->trans("BuyerName")." : ".$usertmp->getFullName($langs), '', 'R'); } } - + $posy+=2; // Show list of linked objects From d96a83adaccf74d19bea6ccd1be54d6e6d2cb093 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 29 Aug 2017 16:37:00 +0200 Subject: [PATCH 08/29] Fix bad total included tax when mutlicurrency is on --- htdocs/core/modules/commande/doc/pdf_einstein.modules.php | 2 +- htdocs/core/modules/facture/doc/pdf_crabe.modules.php | 2 +- htdocs/core/modules/propale/doc/pdf_azur.modules.php | 2 +- .../core/modules/supplier_invoice/pdf/pdf_canelle.modules.php | 2 +- htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index 785e4361c04..c87a66de791 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -1035,7 +1035,7 @@ class pdf_einstein extends ModelePDFCommandes $pdf->SetFillColor(224,224,224); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC"), $useborder, 'L', 1); - $total_ttc = ($conf->multicurrency->enabled && $object->multiccurency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc; + $total_ttc = ($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc; $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc, 0, $outputlangs), $useborder, 'R', 1); } diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 491b7562408..c473740a05d 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -1270,7 +1270,7 @@ class pdf_crabe extends ModelePDFFactures $pdf->SetFillColor(224,224,224); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC"), $useborder, 'L', 1); - $total_ttc = ($conf->multicurrency->enabled && $object->multiccurency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc; + $total_ttc = ($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc; $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($largcol2, $tab2_hl, price($sign * $total_ttc, 0, $outputlangs), $useborder, 'R', 1); } diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 621e2af3218..9a928a7ce2b 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -1186,7 +1186,7 @@ class pdf_azur extends ModelePDFPropales $pdf->SetFillColor(224,224,224); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC"), $useborder, 'L', 1); - $total_ttc = ($conf->multicurrency->enabled && $object->multiccurency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc; + $total_ttc = ($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc; $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc, 0, $outputlangs), $useborder, 'R', 1); } diff --git a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php index 36750226a0d..8737c39f67f 100644 --- a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php @@ -723,7 +723,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $pdf->SetFillColor(224,224,224); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC"), $useborder, 'L', 1); - $total_ttc = ($conf->multicurrency->enabled && $object->multiccurency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc; + $total_ttc = ($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc; $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc), $useborder, 'R', 1); diff --git a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php index 0365eb2bfb4..8380ff65e9a 100644 --- a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php @@ -829,7 +829,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $pdf->SetFillColor(224,224,224); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC"), $useborder, 'L', 1); - $total_ttc = ($conf->multicurrency->enabled && $object->multiccurency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc; + $total_ttc = ($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc; $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc), $useborder, 'R', 1); $pdf->SetFont('','', $default_font_size - 1); From e862ba9daf02bab51a5876e182d8bd4e566d6142 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 29 Aug 2017 17:22:03 +0200 Subject: [PATCH 09/29] NEW Add detail of all tax rates into pdf column tax sale. --- htdocs/core/lib/pdf.lib.php | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 5b344056efb..e4fa52e787f 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -1470,7 +1470,7 @@ function pdf_getlineref_supplier($object,$i,$outputlangs,$hidedetails=0) */ function pdf_getlinevatrate($object,$i,$outputlangs,$hidedetails=0) { - global $hookmanager; + global $conf, $hookmanager, $mysoc; $result=''; $reshook=0; @@ -1487,7 +1487,32 @@ function pdf_getlinevatrate($object,$i,$outputlangs,$hidedetails=0) } if (empty($reshook)) { - if (empty($hidedetails) || $hidedetails > 1) $result.=vatrate($object->lines[$i]->tva_tx,1,$object->lines[$i]->info_bits,1); + if (empty($hidedetails) || $hidedetails > 1) + { + $tmpresult=''; + + $tmpresult.=vatrate($object->lines[$i]->tva_tx,1,$object->lines[$i]->info_bits,1); + if (empty($conf->PDF_MAIN_HIDE_SECOND_TAX)) + { + if ($object->lines[$i]->total_localtax1 != 0) + { + if (preg_replace('/[\s0%]/','',$tmpresult)) $tmpresult.='+'; + else $tmpresult=''; + $tmpresult.=vatrate(abs($object->lines[$i]->total_localtax1),1); + } + } + if (empty($conf->PDF_MAIN_HIDE_THIRD_TAX)) + { + if ($object->lines[$i]->total_localtax2 != 0) + { + if (preg_replace('/[\s0%]/','',$tmpresult)) $tmpresult.='+'; + else $tmpresult=''; + $tmpresult.=vatrate(abs($object->lines[$i]->total_localtax2),1); + } + } + + $result.=$tmpresult; + } } return $result; } From dabd8820560c549355456e78498b07a2cde1e3df Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 29 Aug 2017 17:24:49 +0200 Subject: [PATCH 10/29] Use a slash --- htdocs/core/lib/pdf.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index e4fa52e787f..7e282c3667d 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -1496,7 +1496,7 @@ function pdf_getlinevatrate($object,$i,$outputlangs,$hidedetails=0) { if ($object->lines[$i]->total_localtax1 != 0) { - if (preg_replace('/[\s0%]/','',$tmpresult)) $tmpresult.='+'; + if (preg_replace('/[\s0%]/','',$tmpresult)) $tmpresult.='/'; else $tmpresult=''; $tmpresult.=vatrate(abs($object->lines[$i]->total_localtax1),1); } @@ -1505,7 +1505,7 @@ function pdf_getlinevatrate($object,$i,$outputlangs,$hidedetails=0) { if ($object->lines[$i]->total_localtax2 != 0) { - if (preg_replace('/[\s0%]/','',$tmpresult)) $tmpresult.='+'; + if (preg_replace('/[\s0%]/','',$tmpresult)) $tmpresult.='/'; else $tmpresult=''; $tmpresult.=vatrate(abs($object->lines[$i]->total_localtax2),1); } From 044feab00fd887d226e64863475b945861589cc8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 29 Aug 2017 17:52:10 +0200 Subject: [PATCH 11/29] Fix duplicate code --- htdocs/holiday/list.php | 55 ++++++++++++++++++++++++++++++----------- 1 file changed, 41 insertions(+), 14 deletions(-) diff --git a/htdocs/holiday/list.php b/htdocs/holiday/list.php index 8541454e549..9c7ff195018 100644 --- a/htdocs/holiday/list.php +++ b/htdocs/holiday/list.php @@ -260,9 +260,16 @@ if ($id > 0) dol_banner_tab($fuser,'id',$linkback,$user->rights->user->user->lire || $user->admin); - print '
'; + if (empty($conf->global->HOLIDAY_HIDE_BALANCE)) + { + print '
'; - print '
'; + print '
'; + + showMyBalance($holiday, $user_id); + } + + dol_fiche_end(); } else { @@ -270,23 +277,43 @@ else //print count($holiday->holiday); print_barre_liste($langs->trans("ListeCP"), $page, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, "", $num, count($holiday->holiday), 'title_hrm.png', 0, '', '', $limit); - dol_fiche_head(''); + if (empty($conf->global->HOLIDAY_HIDE_BALANCE)) + { + dol_fiche_head(''); + + showMyBalance($holiday, $user_id); + + dol_fiche_end(); + } } -$alltypeleaves=$holiday->getTypes(1,-1); // To have labels -$out=''; -$typeleaves=$holiday->getTypes(1,1); -foreach($typeleaves as $key => $val) + +/** + * Show balance of user + * + * @param Holiday $holiday Object $holiday + * @param int $user_id User id + * @return string Html code with balance + */ +function showMyBalance($holiday, $user_id) { - $nb_type = $holiday->getCPforUser($user_id, $val['rowid']); - $nb_holiday += $nb_type; - $out .= ' - '.$val['label'].': '.($nb_type?price2num($nb_type):0).'
'; -} -print $langs->trans('SoldeCPUser', round($nb_holiday,5)).'
'; -print $out; + global $conf, $langs; + + $alltypeleaves=$holiday->getTypes(1,-1); // To have labels + + $out=''; + $typeleaves=$holiday->getTypes(1,1); + foreach($typeleaves as $key => $val) + { + $nb_type = $holiday->getCPforUser($user_id, $val['rowid']); + $nb_holiday += $nb_type; + $out .= ' - '.$val['label'].': '.($nb_type?price2num($nb_type):0).'
'; + } + print $langs->trans('SoldeCPUser', round($nb_holiday,5)).'
'; + print $out; +} -dol_fiche_end(); if ($id > 0) print '
'; From 945fb61e591193c3c8bf92a3004426facfc7120d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 29 Aug 2017 18:22:01 +0200 Subject: [PATCH 12/29] Update facture.class.php --- htdocs/compta/facture/class/facture.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index efb55f9b64c..b5a399675e7 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -783,7 +783,7 @@ class Facture extends CommonInvoice $facture->situation_final = $this->situation_final; // Loop on each line of new invoice - foreach($facture->lines as $i => &$line) + foreach($facture->lines as $i => $tmpline) { $facture->lines[$i]->fk_prev_id = $this->lines[$i]->rowid; if ($invertdetail) From 6c202c5fa1910347f66ec85eaef35938bd5d7133 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 29 Aug 2017 19:55:49 +0200 Subject: [PATCH 13/29] Fix vat rate to show and not vat amount --- htdocs/core/lib/pdf.lib.php | 10 +++++----- htdocs/langs/en_US/errors.lang | 1 + htdocs/langs/en_US/main.lang | 4 ++-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 7e282c3667d..77f295bd813 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -1491,23 +1491,23 @@ function pdf_getlinevatrate($object,$i,$outputlangs,$hidedetails=0) { $tmpresult=''; - $tmpresult.=vatrate($object->lines[$i]->tva_tx,1,$object->lines[$i]->info_bits,1); + $tmpresult.=vatrate($object->lines[$i]->tva_tx, 1, $object->lines[$i]->info_bits, 1); if (empty($conf->PDF_MAIN_HIDE_SECOND_TAX)) { - if ($object->lines[$i]->total_localtax1 != 0) + if ($object->lines[$i]->localtax1_tx != 0) { if (preg_replace('/[\s0%]/','',$tmpresult)) $tmpresult.='/'; else $tmpresult=''; - $tmpresult.=vatrate(abs($object->lines[$i]->total_localtax1),1); + $tmpresult.=vatrate(abs($object->lines[$i]->localtax1_tx),1); } } if (empty($conf->PDF_MAIN_HIDE_THIRD_TAX)) { - if ($object->lines[$i]->total_localtax2 != 0) + if ($object->lines[$i]->localtax2_tx != 0) { if (preg_replace('/[\s0%]/','',$tmpresult)) $tmpresult.='/'; else $tmpresult=''; - $tmpresult.=vatrate(abs($object->lines[$i]->total_localtax2),1); + $tmpresult.=vatrate(abs($object->lines[$i]->localtax2_tx),1); } } diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index b03b8ad37bb..8dfc02c49f1 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -195,6 +195,7 @@ ErrorNoWarehouseDefined=Error, no warehouses defined. ErrorBadLinkSourceSetButBadValueForRef=The link you use is not valid. A 'source' for payment is defined, but value for 'ref' is not valid. ErrorTooManyErrorsProcessStopped=Too many errors. Process was stopped. ErrorOnlyInvoiceValidatedCanBeSentInMassAction=Only validated invoices can be sent using the "Send by email" mass action. +ErrorChooseBetweenFreeEntryOrPredefinedProduct=You must choose if article is a predefined product or not # Warnings WarningPasswordSetWithNoAccount=A password was set for this member. However, no user account was created. So this password is stored but can't be used to login to Dolibarr. It may be used by an external module/interface but if you don't need to define any login nor password for a member, you can disable option "Manage a login for each member" from Member module setup. If you need to manage a login but don't need any password, you can keep this field empty to avoid this warning. Note: Email can also be used as a login if the member is linked to a user. diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 8d180568073..b8544ee3eda 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -657,8 +657,8 @@ Page=Page Notes=Notes AddNewLine=Add new line AddFile=Add file -FreeZone=Free entry -FreeLineOfType=Free entry of type +FreeZone=Not a predefined product/service +FreeLineOfType=Not a predefined entry of type CloneMainAttributes=Clone object with its main attributes PDFMerge=PDF Merge Merge=Merge From 991a33f7b67a34a0e7aee41f473cbfe36661adae Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 29 Aug 2017 20:40:51 +0200 Subject: [PATCH 14/29] Make different vat rates visible --- htdocs/core/lib/functions.lib.php | 8 +++++- htdocs/core/tpl/objectline_view.tpl.php | 33 ++++++++++++++++--------- 2 files changed, 28 insertions(+), 13 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 4af0679920d..d79c3def247 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3702,7 +3702,13 @@ function vatrate($rate, $addpercent=false, $info_bits=0, $usestarfornpr=0) $info_bits |= 1; } - $ret=price($rate,0,'',0,0).($addpercent?'%':''); + // If rate is '9/9/9' we don't change it. If rate is '9.000' we apply price() + if (! preg_match('/\//', $rate)) $ret=price($rate,0,'',0,0).($addpercent?'%':''); + else + { + // TODO Split on / and output with a price2num to have clean numbers with ton of 000. + $ret=$rate.($addpercent?'%':''); + } if ($info_bits & 1) $ret.=' *'; $ret.=$morelabel; return $ret; diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index c347c693691..5cfe2459247 100644 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -32,7 +32,7 @@ * $usemargins (0 to disable all margins columns, 1 to show according to margin setup) * $object_rights->creer initialized from = $object->getRights() * $disableedit, $disablemove, $disableremove - * + * * $type, $text, $description, $line */ @@ -55,7 +55,7 @@ if (empty($outputalsopricetotalwithtax)) $outputalsopricetotalwithtax=0;
- info_bits & 2) == 2) { ?> @@ -83,7 +83,7 @@ if (empty($outputalsopricetotalwithtax)) $outputalsopricetotalwithtax=0; $discount->fetch($line->fk_remise_except); echo ($txt?' - ':'').$langs->transnoentities("DiscountFromDeposit",$discount->getNomUrl(0)); // Add date of deposit - if (! empty($conf->global->INVOICE_ADD_DEPOSIT_DATE)) + if (! empty($conf->global->INVOICE_ADD_DEPOSIT_DATE)) echo ' ('.dol_print_date($discount->datec).')'; } elseif ($line->description == '(EXCESS RECEIVED)' && $objp->fk_remise_except > 0) @@ -101,11 +101,11 @@ if (empty($outputalsopricetotalwithtax)) $outputalsopricetotalwithtax=0; else { $format = $conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE?'dayhour':'day'; - + if ($line->fk_product > 0) { echo $form->textwithtooltip($text,$description,3,'','',$i,0,(!empty($line->fk_parent_line)?img_picto('', 'rightarrow'):'')); - + // Show range echo get_date_range($line->date_start, $line->date_end, $format); @@ -138,17 +138,26 @@ if (empty($outputalsopricetotalwithtax)) $outputalsopricetotalwithtax=0; element == 'supplier_proposal') { ?> ref_fourn; ?> - - tva_tx.($line->vat_src_code?(' ('.$line->vat_src_code.')'):''), '%', $line->info_bits); ?> + tva_tx)) $positiverates.=($positiverates?'/':'').price2num($line->tva_tx); + if (price2num($line->localtax1_tx)) $positiverates.=($positiverates?'/':'').price2num($line->localtax1_tx); + if (price2num($line->localtax2_tx)) $positiverates.=($positiverates?'/':'').price2num($line->localtax2_tx); + if (empty($positiverates)) $positiverates='0'; + echo vatrate($positiverates.($line->vat_src_code?' ('.$line->vat_src_code.')':''), '%', $line->info_bits); + //echo vatrate($line->tva_tx.($line->vat_src_code?(' ('.$line->vat_src_code.')'):''), '%', $line->info_bits); + ?> subprice); ?> - + multicurrency->enabled)) { ?> multicurrency_subprice); ?> - + pu_ttc)?price($line->pu_ttc):price($line->subprice)); ?> @@ -194,7 +203,7 @@ if (empty($outputalsopricetotalwithtax)) $outputalsopricetotalwithtax=0; { $rounding = min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOT); ?> - + rights->margins->creer)) { ?> pa_ht); ?> @@ -220,7 +229,7 @@ if (empty($outputalsopricetotalwithtax)) $outputalsopricetotalwithtax=0; - statut == 0 && ($object_rights->creer)) { ?> info_bits & 2) == 2 || ! empty($disableedit)) { ?> @@ -241,7 +250,7 @@ if (empty($outputalsopricetotalwithtax)) $outputalsopricetotalwithtax=0; ?> - 1 && empty($conf->browser->phone) && ($this->situation_counter == 1 || !$this->situation_cycle_ref) && empty($disablemove)) { ?> 0) { ?> From 4998eb3061cb403f283202a6be0f2e197a39623d Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Tue, 29 Aug 2017 21:21:59 +0200 Subject: [PATCH 15/29] Fix: Accountancy journal, fetch on rowid, not code --- htdocs/compta/bank/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/bank/index.php b/htdocs/compta/bank/index.php index 9e5ddf8008a..fa880e0597f 100644 --- a/htdocs/compta/bank/index.php +++ b/htdocs/compta/bank/index.php @@ -514,7 +514,7 @@ foreach ($accounts as $key=>$type) if (! empty($conf->accounting->enabled)) { $accountingjournal = new AccountingJournal($db); - $accountingjournal->fetch('',$acc->fk_accountancy_journal); + $accountingjournal->fetch($acc->fk_accountancy_journal); print $accountingjournal->getNomUrl(0,1,1,'',1); } else From d3c95e030baafb3da50f5e4a30e31c429aa85d63 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 30 Aug 2017 14:34:36 +0200 Subject: [PATCH 16/29] Fix delete file not possible for external user even with permissions --- htdocs/comm/propal/document.php | 1 - htdocs/commande/document.php | 1 - htdocs/compta/facture/document.php | 17 +++++++++-------- htdocs/core/actions_linkedfiles.inc.php | 6 +++--- .../tpl/document_actions_post_headers.tpl.php | 2 +- htdocs/supplier_proposal/document.php | 19 +++++++++---------- 6 files changed, 22 insertions(+), 24 deletions(-) diff --git a/htdocs/comm/propal/document.php b/htdocs/comm/propal/document.php index 65b8eef5a66..3a9f3a98e26 100644 --- a/htdocs/comm/propal/document.php +++ b/htdocs/comm/propal/document.php @@ -45,7 +45,6 @@ $ref = GETPOST('ref','alpha'); $socid=''; if (! empty($user->societe_id)) { - $action=''; $socid = $user->societe_id; } $result = restrictedArea($user, 'propal', $id); diff --git a/htdocs/commande/document.php b/htdocs/commande/document.php index 7eea9c95877..d69ec07360a 100644 --- a/htdocs/commande/document.php +++ b/htdocs/commande/document.php @@ -44,7 +44,6 @@ $ref = GETPOST('ref'); // Security check if ($user->societe_id) { - $action=''; $socid = $user->societe_id; } $result=restrictedArea($user,'commande',$id,''); diff --git a/htdocs/compta/facture/document.php b/htdocs/compta/facture/document.php index b6c77207952..1ab0d7ceb93 100644 --- a/htdocs/compta/facture/document.php +++ b/htdocs/compta/facture/document.php @@ -49,7 +49,6 @@ $confirm=GETPOST('confirm', 'alpha'); // Security check if ($user->societe_id) { - $action=''; $socid = $user->societe_id; } $result=restrictedArea($user,'facture',$id,''); @@ -72,9 +71,11 @@ if ($object->fetch($id)) $upload_dir = $conf->facture->dir_output . "/" . dol_sanitizeFileName($object->ref); } + /* * Actions */ + include_once DOL_DOCUMENT_ROOT . '/core/actions_linkedfiles.inc.php'; @@ -100,7 +101,7 @@ if ($id > 0 || ! empty($ref)) dol_fiche_head($head, 'documents', $langs->trans('InvoiceCustomer'), -1, 'bill'); $totalpaye = $object->getSommePaiement(); - + // Construit liste des fichiers $filearray=dol_dir_list($upload_dir,"files",0,'','(\.meta|_preview.*\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1); $totalsize=0; @@ -109,11 +110,11 @@ if ($id > 0 || ! empty($ref)) $totalsize+=$file['size']; } - + // Invoice content - + $linkback = '' . $langs->trans("BackToList") . ''; - + $morehtmlref='
'; // Ref customer $morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1); @@ -154,14 +155,14 @@ if ($id > 0 || ! empty($ref)) } } $morehtmlref.='
'; - + $object->totalpaye = $totalpaye; // To give a chance to dol_banner_tab to use already paid amount to show correct status - + dol_banner_tab($object, 'ref', $linkback, 1, 'facnumber', 'ref', $morehtmlref, '', 0); print '
'; print '
'; - + print ''; print ''; diff --git a/htdocs/core/actions_linkedfiles.inc.php b/htdocs/core/actions_linkedfiles.inc.php index f21c41d828d..981de037c13 100644 --- a/htdocs/core/actions_linkedfiles.inc.php +++ b/htdocs/core/actions_linkedfiles.inc.php @@ -30,9 +30,9 @@ if (GETPOST('sendit') && ! empty($conf->global->MAIN_UPLOAD_DOC)) if ($object->id) { if (! empty($upload_dirold) && ! empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) - dol_add_file_process($upload_dirold, 0, 1, 'userfile', GETPOST('savingdocmask')); + $result = dol_add_file_process($upload_dirold, 0, 1, 'userfile', GETPOST('savingdocmask')); else - dol_add_file_process($upload_dir, 0, 1, 'userfile', GETPOST('savingdocmask')); + $result = dol_add_file_process($upload_dir, 0, 1, 'userfile', GETPOST('savingdocmask')); } } elseif (GETPOST('linkit') && ! empty($conf->global->MAIN_UPLOAD_DOC)) @@ -176,7 +176,7 @@ elseif ($action == 'renamefile' && GETPOST('renamefilesave')) setEventMessages($langs->trans("FileRenamed"), null); } - else + else { $langs->load("errors"); // key must be loaded because we can't rely on loading during output, we need var substitution to be done now. setEventMessages($langs->trans("ErrorFailToRenameFile", $filenamefrom, $filenameto), null, 'errors'); diff --git a/htdocs/core/tpl/document_actions_post_headers.tpl.php b/htdocs/core/tpl/document_actions_post_headers.tpl.php index 064eda8e5b5..e613c479ee0 100644 --- a/htdocs/core/tpl/document_actions_post_headers.tpl.php +++ b/htdocs/core/tpl/document_actions_post_headers.tpl.php @@ -80,7 +80,7 @@ $formfile->form_attach_new_file( $disablemove=1; if ($modulepart == 'produit') $disablemove=0; - + // List of document $formfile->list_of_documents( $filearray, diff --git a/htdocs/supplier_proposal/document.php b/htdocs/supplier_proposal/document.php index cec276a6064..4985fd34629 100644 --- a/htdocs/supplier_proposal/document.php +++ b/htdocs/supplier_proposal/document.php @@ -44,7 +44,6 @@ $ref = GETPOST('ref','alpha'); $socid=''; if (! empty($user->societe_id)) { - $action=''; $socid = $user->societe_id; } $result = restrictedArea($user, 'supplier_proposal', $id); @@ -96,8 +95,8 @@ if ($object->id > 0) // Supplier proposal card $linkback = '' . $langs->trans("BackToList") . ''; - - + + $morehtmlref='
'; // Ref supplier //$morehtmlref.=$form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->fournisseur->commande->creer, 'string', '', 0, 1); @@ -138,14 +137,14 @@ if ($object->id > 0) } } $morehtmlref.='
'; - - + + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); - - + + print '
'; print '
'; - + print '
'.$langs->trans("NbOfAttachedFiles").''.count($filearray).'
'; print ''; @@ -154,9 +153,9 @@ if ($object->id > 0) print '
'.$langs->trans("NbOfAttachedFiles").''.count($filearray).'
'; print '
'; - + dol_fiche_end(); - + $modulepart = 'supplier_proposal'; $permission = $user->rights->supplier_proposal->creer; $permtoedit = $user->rights->supplier_proposal->creer; From bfc5f01e1ea364c068f4e9e1f912173e0c3861f6 Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Wed, 30 Aug 2017 14:36:00 +0200 Subject: [PATCH 17/29] NEW Add detail of all tax rates into pdf column tax sale. -Can be hidden by pdf setup page -For know if localtax is applied into line we have to read totaltax line --- htdocs/admin/pdf.php | 76 ++++++++++++++++++++++++- htdocs/core/lib/pdf.lib.php | 12 ++-- htdocs/core/tpl/objectline_view.tpl.php | 5 +- htdocs/langs/en_US/admin.lang | 6 +- 4 files changed, 87 insertions(+), 12 deletions(-) diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index 6698be8b01f..f366d8a5ce3 100644 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -2,7 +2,7 @@ /* Copyright (C) 2001-2005 Rodolphe Quiedeville * Copyright (C) 2004-2012 Laurent Destailleur * Copyright (C) 2005-2011 Regis Houssin - * Copyright (C) 2012-2105 Juanjo Menent + * Copyright (C) 2012-2107 Juanjo Menent * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -74,7 +74,11 @@ if ($action == 'update') dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_HIDE_REF", $_POST["MAIN_GENERATE_DOCUMENTS_HIDE_REF"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_PDF_USE_ISO_LOCATION", $_POST["MAIN_PDF_USE_ISO_LOCATION"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS", $_POST["MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS"],'chaine',0,'',$conf->entity); - + + + dolibarr_set_const($db, "MAIN_PDF_MAIN_HIDE_SECOND_TAX", $_POST["MAIN_PDF_MAIN_HIDE_SECOND_TAX"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_PDF_MAIN_HIDE_THIRD_TAX", $_POST["_MAIN_PDF_MAIN_HIDE_THIRD_TAX"],'chaine',0,'',$conf->entity); + header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup"); exit; } @@ -249,6 +253,40 @@ if ($action == 'edit') // Edit print '
'; + // Localtaxes + if ($mysoc->useLocalTax(1) || $mysoc->useLocalTax(2)) + { + $locales =''; + $text=''; + + if ($mysoc->useLocalTax(1)) + { + $locales = $langs->transcountry("LT1",$mysoc->country_code); + $text ='' . $langs->trans("HideLocalTaxOnPDF",$langs->transcountry("LT1",$mysoc->country_code)) . ''; + $text.= $form->selectyesno('MAIN_PDF_MAIN_HIDE_SECOND_TAX', (!empty($conf->global->MAIN_PDF_MAIN_HIDE_SECOND_TAX)) ? $conf->global->MAIN_PDF_MAIN_HIDE_SECOND_TAX : 0, 1); + $text .= ''; + } + + if ($mysoc->useLocalTax(2)) + { + $locales.=($locales?' & ':'').$langs->transcountry("LT2",$mysoc->country_code); + + $text.= '' . $langs->trans("HideLocalTaxOnPDF",$langs->transcountry("LT2",$mysoc->country_code)) . ''; + $text.= $form->selectyesno('MAIN_PDF_MAIN_HIDE_THIRD_TAX', (!empty($conf->global->MAIN_PDF_MAIN_HIDE_THIRD_TAX)) ? $conf->global->MAIN_PDF_MAIN_HIDE_THIRD_TAX : 0, 1); + $text.= ''; + } + + print load_fiche_titre($langs->trans("PDFLocaltax",$locales),'',''); + $var=true; + print ''; + print ''; + print $text; + + print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; + print '
'; + + } + // Other print load_fiche_titre($langs->trans("Other"),'','').'
'; $var=true; @@ -444,6 +482,40 @@ else // Show print '
'; + // Localtaxes + if ($mysoc->useLocalTax(1) || $mysoc->useLocalTax(2)) + { + $locales =''; + $text=''; + + if ($mysoc->useLocalTax(1)) + { + $locales = $langs->transcountry("LT1",$mysoc->country_code); + $text ='' . $langs->trans("HideLocalTaxOnPDF",$langs->transcountry("LT1",$mysoc->country_code)) . ''; + $text .= yn($conf->global->MAIN_PDF_MAIN_HIDE_SECOND_TAX,1); + $text .= ''; + } + + if ($mysoc->useLocalTax(2)) + { + $locales.=($locales?' & ':'').$langs->transcountry("LT2",$mysoc->country_code); + + $text.= '' . $langs->trans("HideLocalTaxOnPDF",$langs->transcountry("LT2",$mysoc->country_code)) . ''; + $text.= yn($conf->global->MAIN_PDF_MAIN_HIDE_THIRD_TAX,1); + $text.= ''; + } + + print load_fiche_titre($langs->trans("PDFLocaltax",$locales),'',''); + $var=true; + print ''; + print ''; + print $text; + + print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; + print '
'; + + } + // Other print load_fiche_titre($langs->trans("Other"),'',''); $var=true; diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 77f295bd813..8a445625022 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -1,9 +1,9 @@ +/* Copyright (C) 2006-2017 Laurent Destailleur * Copyright (C) 2006 Rodolphe Quiedeville * Copyright (C) 2007 Patrick Raguin * Copyright (C) 2010-2012 Regis Houssin - * Copyright (C) 2010 Juanjo Menent + * Copyright (C) 2010-2017 Juanjo Menent * Copyright (C) 2012 Christophe Battarel * Copyright (C) 2012 Cédric Salvador * Copyright (C) 2012-2015 Raphaël Doursenaud @@ -1492,18 +1492,18 @@ function pdf_getlinevatrate($object,$i,$outputlangs,$hidedetails=0) $tmpresult=''; $tmpresult.=vatrate($object->lines[$i]->tva_tx, 1, $object->lines[$i]->info_bits, 1); - if (empty($conf->PDF_MAIN_HIDE_SECOND_TAX)) + if (empty($conf->global->MAIN_PDF_MAIN_HIDE_SECOND_TAX)) { - if ($object->lines[$i]->localtax1_tx != 0) + if ($object->lines[$i]->total_localtax1 != 0) { if (preg_replace('/[\s0%]/','',$tmpresult)) $tmpresult.='/'; else $tmpresult=''; $tmpresult.=vatrate(abs($object->lines[$i]->localtax1_tx),1); } } - if (empty($conf->PDF_MAIN_HIDE_THIRD_TAX)) + if (empty($conf->global->MAIN_PDF_MAIN_HIDE_THIRD_TAX)) { - if ($object->lines[$i]->localtax2_tx != 0) + if ($object->lines[$i]->total_localtax2 != 0) { if (preg_replace('/[\s0%]/','',$tmpresult)) $tmpresult.='/'; else $tmpresult=''; diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index 5cfe2459247..7176e4a028d 100644 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -5,6 +5,7 @@ * Copyright (C) 2012 Cédric Salvador * Copyright (C) 2012-2014 Raphaël Doursenaud * Copyright (C) 2013 Florian Henry + * Copyright (C) 2017 Juanjo Menent * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -145,8 +146,8 @@ if (empty($outputalsopricetotalwithtax)) $outputalsopricetotalwithtax=0; //var_dump($line); $positiverates=''; if (price2num($line->tva_tx)) $positiverates.=($positiverates?'/':'').price2num($line->tva_tx); - if (price2num($line->localtax1_tx)) $positiverates.=($positiverates?'/':'').price2num($line->localtax1_tx); - if (price2num($line->localtax2_tx)) $positiverates.=($positiverates?'/':'').price2num($line->localtax2_tx); + if (price2num($line->total_localtax1)) $positiverates.=($positiverates?'/':'').price2num($line->localtax1_tx); + if (price2num($line->total_localtax2_tx)) $positiverates.=($positiverates?'/':'').price2num($line->localtax2_tx); if (empty($positiverates)) $positiverates='0'; echo vatrate($positiverates.($line->vat_src_code?' ('.$line->vat_src_code.')':''), '%', $line->info_bits); //echo vatrate($line->tva_tx.($line->vat_src_code?(' ('.$line->vat_src_code.')'):''), '%', $line->info_bits); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 2e3ccdd965e..4ef46f4d2fc 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -356,6 +356,8 @@ PDF=PDF PDFDesc=You can set each global options related to the PDF generation PDFAddressForging=Rules to forge address boxes HideAnyVATInformationOnPDF=Hide all information related to VAT on generated PDF +PDFLocaltax=Rules for %s +HideLocalTaxOnPDF=Hide %s into pdf column tax sale HideDescOnPDF=Hide products description on generated PDF HideRefOnPDF=Hide products ref. on generated PDF HideDetailsOnPDF=Hide product lines details on generated PDF @@ -1638,11 +1640,11 @@ BackgroundTableLineEvenColor=Background color for even table lines MinimumNoticePeriod=Minimum notice period (Your leave request must be done before this delay) NbAddedAutomatically=Number of days added to counters of users (automatically) each month EnterAnyCode=This field contains a reference to identify line. Enter any value of your choice, but without special characters. -UnicodeCurrency=Enter here between braces, list of byte number that represent the currency symbol. For exemple: for $, enter [36] - for brazil real R$ [82,36] - for €, enter [8364] +UnicodeCurrency=Enter here between braces, list of byte number that represent the currency symbol. For exemple: for $, enter [36] - for brazil real R$ [82,36] - for ?, enter [8364] ColorFormat=The RGB color is in HEX format, eg: FF0000 PositionIntoComboList=Position of line into combo lists SellTaxRate=Sale tax rate -RecuperableOnly=Yes for VAT "Non Perçue Récupérable" dedicated for some state in France. Keep value to "No" in all other cases. +RecuperableOnly=Yes for VAT "Non Per?ue R?cup?rable" dedicated for some state in France. Keep value to "No" in all other cases. UrlTrackingDesc=If the provider or transport service offer a page or web site to check status of your shipping, you can enter it here. You can use the key {TRACKID} into URL parameters so the system will replace it with value of tracking number user entered into shipment card. OpportunityPercent=When you create an opportunity, you will defined an estimated amount of project/lead. According to status of opportunity, this amount may be multiplicated by this rate to evaluate global amount all your opportunities may generate. Value is percent (between 0 and 100). TemplateForElement=This template record is dedicated to which element From 70cbaeb423684fe231b61f509459e6dcb6b15bd8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 30 Aug 2017 16:10:39 +0200 Subject: [PATCH 18/29] Fix mass merging must read only PDF generated for REF. --- htdocs/core/actions_massactions.inc.php | 38 ++++++++++++------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index e424fe0376b..68258025098 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -429,7 +429,7 @@ if (! $error && $massaction == "builddoc" && $permtoread && ! GETPOST('button_se } $arrayofinclusion=array(); - foreach($listofobjectref as $tmppdf) $arrayofinclusion[]=preg_quote($tmppdf.'.pdf','/'); + foreach($listofobjectref as $tmppdf) $arrayofinclusion[]='^'.preg_quote($tmppdf.'.pdf','/').'$'; $listoffiles = dol_dir_list($uploaddir,'all',1,implode('|',$arrayofinclusion),'\.meta$|\.png','date',SORT_DESC,0,true); // build list of files with full path @@ -505,8 +505,8 @@ if (! $error && $massaction == "builddoc" && $permtoread && ! GETPOST('button_se $pdf=pdf_getInstance(); if (class_exists('TCPDF')) { - $pdf->setPrintHeader(false); - $pdf->setPrintFooter(false); + $pdf->setPrintHeader(false); + $pdf->setPrintFooter(false); } $pdf->SetFont(pdf_getPDFFont($outputlangs)); @@ -515,15 +515,15 @@ if (! $error && $massaction == "builddoc" && $permtoread && ! GETPOST('button_se // Add all others foreach($files as $file) { - // Charge un document PDF depuis un fichier. - $pagecount = $pdf->setSourceFile($file); - for ($i = 1; $i <= $pagecount; $i++) - { - $tplidx = $pdf->importPage($i); - $s = $pdf->getTemplatesize($tplidx); - $pdf->AddPage($s['h'] > $s['w'] ? 'P' : 'L'); - $pdf->useTemplate($tplidx); - } + // Charge un document PDF depuis un fichier. + $pagecount = $pdf->setSourceFile($file); + for ($i = 1; $i <= $pagecount; $i++) + { + $tplidx = $pdf->importPage($i); + $s = $pdf->getTemplatesize($tplidx); + $pdf->AddPage($s['h'] > $s['w'] ? 'P' : 'L'); + $pdf->useTemplate($tplidx); + } } // Create output dir if not exists @@ -536,18 +536,18 @@ if (! $error && $massaction == "builddoc" && $permtoread && ! GETPOST('button_se // Save merged file if ($filter=='paye:0') { - if ($option=='late') $filename.='_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Unpaid"))).'_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Late"))); - else $filename.='_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Unpaid"))); + if ($option=='late') $filename.='_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Unpaid"))).'_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Late"))); + else $filename.='_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Unpaid"))); } if ($year) $filename.='_'.$year; if ($month) $filename.='_'.$month; if ($pagecount) { - $now=dol_now(); - $file=$diroutputmassaction.'/'.$filename.'_'.dol_print_date($now,'dayhourlog').'.pdf'; - $pdf->Output($file,'F'); - if (! empty($conf->global->MAIN_UMASK)) - @chmod($file, octdec($conf->global->MAIN_UMASK)); + $now=dol_now(); + $file=$diroutputmassaction.'/'.$filename.'_'.dol_print_date($now,'dayhourlog').'.pdf'; + $pdf->Output($file,'F'); + if (! empty($conf->global->MAIN_UMASK)) + @chmod($file, octdec($conf->global->MAIN_UMASK)); $langs->load("exports"); setEventMessages($langs->trans('FileSuccessfullyBuilt',$filename.'_'.dol_print_date($now,'dayhourlog')), null, 'mesgs'); From a3085cb44a95afd7453f12e33362158ad5c27dca Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 30 Aug 2017 16:43:57 +0200 Subject: [PATCH 19/29] Update objectline_view.tpl.php --- htdocs/core/tpl/objectline_view.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index 7176e4a028d..f968fdcbfc7 100644 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -147,7 +147,7 @@ if (empty($outputalsopricetotalwithtax)) $outputalsopricetotalwithtax=0; $positiverates=''; if (price2num($line->tva_tx)) $positiverates.=($positiverates?'/':'').price2num($line->tva_tx); if (price2num($line->total_localtax1)) $positiverates.=($positiverates?'/':'').price2num($line->localtax1_tx); - if (price2num($line->total_localtax2_tx)) $positiverates.=($positiverates?'/':'').price2num($line->localtax2_tx); + if (price2num($line->total_localtax2)) $positiverates.=($positiverates?'/':'').price2num($line->localtax2_tx); if (empty($positiverates)) $positiverates='0'; echo vatrate($positiverates.($line->vat_src_code?' ('.$line->vat_src_code.')':''), '%', $line->info_bits); //echo vatrate($line->tva_tx.($line->vat_src_code?(' ('.$line->vat_src_code.')'):''), '%', $line->info_bits); From 2c4e8cbb4a9cc12b5c829560978c04a766423ccd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 30 Aug 2017 16:45:53 +0200 Subject: [PATCH 20/29] Update admin.lang --- htdocs/langs/en_US/admin.lang | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 4ef46f4d2fc..75b904dfa2d 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1640,11 +1640,11 @@ BackgroundTableLineEvenColor=Background color for even table lines MinimumNoticePeriod=Minimum notice period (Your leave request must be done before this delay) NbAddedAutomatically=Number of days added to counters of users (automatically) each month EnterAnyCode=This field contains a reference to identify line. Enter any value of your choice, but without special characters. -UnicodeCurrency=Enter here between braces, list of byte number that represent the currency symbol. For exemple: for $, enter [36] - for brazil real R$ [82,36] - for ?, enter [8364] +UnicodeCurrency=Enter here between braces, list of byte number that represent the currency symbol. For exemple: for $, enter [36] - for brazil real R$ [82,36] - for €, enter [8364] ColorFormat=The RGB color is in HEX format, eg: FF0000 PositionIntoComboList=Position of line into combo lists SellTaxRate=Sale tax rate -RecuperableOnly=Yes for VAT "Non Per?ue R?cup?rable" dedicated for some state in France. Keep value to "No" in all other cases. +RecuperableOnly=Yes for VAT "Not Perceived but Recoverable" dedicated for some state in France. Keep value to "No" in all other cases. UrlTrackingDesc=If the provider or transport service offer a page or web site to check status of your shipping, you can enter it here. You can use the key {TRACKID} into URL parameters so the system will replace it with value of tracking number user entered into shipment card. OpportunityPercent=When you create an opportunity, you will defined an estimated amount of project/lead. According to status of opportunity, this amount may be multiplicated by this rate to evaluate global amount all your opportunities may generate. Value is percent (between 0 and 100). TemplateForElement=This template record is dedicated to which element From 3e4a7ba97cde90c818666b37f4a01042c0a0e314 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 30 Aug 2017 16:46:50 +0200 Subject: [PATCH 21/29] Update admin.lang --- htdocs/langs/en_US/admin.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 75b904dfa2d..dfd6e90929a 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -357,7 +357,7 @@ PDFDesc=You can set each global options related to the PDF generation PDFAddressForging=Rules to forge address boxes HideAnyVATInformationOnPDF=Hide all information related to VAT on generated PDF PDFLocaltax=Rules for %s -HideLocalTaxOnPDF=Hide %s into pdf column tax sale +HideLocalTaxOnPDF=Hide %s rate into pdf column tax sale HideDescOnPDF=Hide products description on generated PDF HideRefOnPDF=Hide products ref. on generated PDF HideDetailsOnPDF=Hide product lines details on generated PDF From 0a67ca53d450e5850b6d9280f56ebbccf282870a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 30 Aug 2017 17:14:54 +0200 Subject: [PATCH 22/29] Fix menu auguria --- htdocs/core/menus/init_menu_auguria.sql | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql index 5655ada681c..445ec83d58d 100644 --- a/htdocs/core/menus/init_menu_auguria.sql +++ b/htdocs/core/menus/init_menu_auguria.sql @@ -288,16 +288,16 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3602__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/list.php?leftmenu=projects', 'List', 1, 'projects', '$user->rights->projet->lire', '', 2, 2, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3603__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/stats/index.php?leftmenu=projects', 'Statistics', 1, 'projects', '$user->rights->projet->lire', '', 2, 3, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3700__+MAX_llx_menu__, 'project', '', 7__+MAX_llx_menu__, '/projet/activity/index.php?leftmenu=projects', 'Activities', 0, 'projects', '$user->rights->projet->lire', '', 2, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3701__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks.php?leftmenu=projects&action=create', 'NewTask', 1, 'projects', '$user->rights->projet->creer', '', 2, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3702__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks/list.php?leftmenu=projects', 'List', 1, 'projects', '$user->rights->projet->lire', '', 2, 2, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3704__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks/stats/index.php?leftmenu=projects', 'Statistics', 1, 'projects', '$user->rights->projet->lire', '', 2, 4, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled && $conf->global->PROJECT_USE_TASKS', __HANDLER__, 'left', 3700__+MAX_llx_menu__, 'project', '', 7__+MAX_llx_menu__, '/projet/activity/index.php?leftmenu=projects', 'Activities', 0, 'projects', '$user->rights->projet->lire', '', 2, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled && $conf->global->PROJECT_USE_TASKS', __HANDLER__, 'left', 3701__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks.php?leftmenu=projects&action=create', 'NewTask', 1, 'projects', '$user->rights->projet->creer', '', 2, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled && $conf->global->PROJECT_USE_TASKS', __HANDLER__, 'left', 3702__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks/list.php?leftmenu=projects', 'List', 1, 'projects', '$user->rights->projet->lire', '', 2, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled && $conf->global->PROJECT_USE_TASKS', __HANDLER__, 'left', 3704__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks/stats/index.php?leftmenu=projects', 'Statistics', 1, 'projects', '$user->rights->projet->lire', '', 2, 4, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3400__+MAX_llx_menu__, 'project', '', 7__+MAX_llx_menu__, '/projet/activity/perweek.php?leftmenu=projects', 'NewTimeSpent', 0, 'projects', '$user->rights->projet->lire', '', 2, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled && $conf->global->PROJECT_USE_TASKS', __HANDLER__, 'left', 3400__+MAX_llx_menu__, 'project', '', 7__+MAX_llx_menu__, '/projet/activity/perweek.php?leftmenu=projects', 'NewTimeSpent', 0, 'projects', '$user->rights->projet->lire', '', 2, 3, __ENTITY__); -- Project - Categories -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->categorie->enabled', __HANDLER__, 'left', 3804__+MAX_llx_menu__, 'project', 'cat', 3__+MAX_llx_menu__, '/categories/index.php?leftmenu=cat&type=6', 'Categories', 0, 'categories', '$user->rights->categorie->lire', '', 2, 4, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->categorie->enabled', __HANDLER__, 'left', 3805__+MAX_llx_menu__, 'project', '', 3200__+MAX_llx_menu__, '/categories/card.php?action=create&type=6', 'NewCategory', 1, 'categories', '$user->rights->categorie->creer', '', 2, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->categorie->enabled', __HANDLER__, 'left', 3804__+MAX_llx_menu__, 'project', 'cat', 7__+MAX_llx_menu__, '/categories/index.php?leftmenu=cat&type=6', 'Categories', 0, 'categories', '$user->rights->categorie->lire', '', 2, 4, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->categorie->enabled', __HANDLER__, 'left', 3805__+MAX_llx_menu__, 'project', '', 3804__+MAX_llx_menu__, '/categories/card.php?action=create&type=6', 'NewCategory', 1, 'categories', '$user->rights->categorie->creer', '', 2, 0, __ENTITY__); -- Tools insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->mailing->enabled', __HANDLER__, 'left', 3900__+MAX_llx_menu__, 'tools', 'mailing', 8__+MAX_llx_menu__, '/comm/mailing/index.php?leftmenu=mailing', 'EMailings', 0, 'mails', '$user->rights->mailing->lire', '', 0, 0, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->mailing->enabled', __HANDLER__, 'left', 3901__+MAX_llx_menu__, 'tools', '', 3900__+MAX_llx_menu__, '/comm/mailing/card.php?leftmenu=mailing&action=create', 'NewMailing', 1, 'mails', '$user->rights->mailing->creer', '', 0, 0, __ENTITY__); From 6a3d110d3ac1339e7a60664d03378719959aaf30 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 31 Aug 2017 14:44:32 +0200 Subject: [PATCH 23/29] Enhance repair for utf8 mix collation --- htdocs/install/mysql/migration/repair.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/install/mysql/migration/repair.sql b/htdocs/install/mysql/migration/repair.sql index e759985b7a8..14622a3963c 100755 --- a/htdocs/install/mysql/migration/repair.sql +++ b/htdocs/install/mysql/migration/repair.sql @@ -29,6 +29,8 @@ -- VMYSQLUTF8UNICODECI ALTER TABLE llx_accounting_account MODIFY account_number VARCHAR(20) CHARACTER SET utf8; -- VMYSQLUTF8UNICODECI ALTER TABLE llx_accounting_account MODIFY account_number VARCHAR(20) COLLATE utf8_unicode_ci; +-- VMYSQLUTF8UNICODECI ALTER TABLE llx_accounting_bookkeeping MODIFY numero_compte VARCHAR(20) CHARACTER SET utf8; +-- VMYSQLUTF8UNICODECI ALTER TABLE llx_accounting_bookkeeping MODIFY numero_compte VARCHAR(20) COLLATE utf8_unicode_ci; -- VMYSQLUTF8UNICODECI ALTER TABLE llx_stock_mouvement MODIFY batch VARCHAR(30) CHARACTER SET utf8; -- VMYSQLUTF8UNICODECI ALTER TABLE llx_stock_mouvement MODIFY batch VARCHAR(30) COLLATE utf8_unicode_ci; -- VMYSQLUTF8UNICODECI ALTER TABLE llx_product_lot MODIFY batch VARCHAR(30) CHARACTER SET utf8; From 2ab12f54ff33beee452e3881230df751cb969e43 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 31 Aug 2017 22:42:14 +0200 Subject: [PATCH 24/29] Fix install error due to too large column with index --- htdocs/install/mysql/migration/5.0.0-6.0.0.sql | 1 + htdocs/install/mysql/tables/llx_holiday_config.sql | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/5.0.0-6.0.0.sql b/htdocs/install/mysql/migration/5.0.0-6.0.0.sql index b1a7088062d..f6a2c18da82 100644 --- a/htdocs/install/mysql/migration/5.0.0-6.0.0.sql +++ b/htdocs/install/mysql/migration/5.0.0-6.0.0.sql @@ -24,6 +24,7 @@ -- -- VPGSQL8.2 DELETE FROM llx_usergroup_user WHERE fk_user NOT IN (SELECT rowid from llx_user); -- -- VMYSQL4.1 DELETE FROM llx_usergroup_user WHERE fk_usergroup NOT IN (SELECT rowid from llx_usergroup); +ALTER TABLE llx_holiday_config MODIFY COLUMN name varchar(128); ALTER TABLE llx_supplier_proposaldet CHANGE COLUMN fk_askpricesupplier fk_supplier_proposal integer NOT NULL; diff --git a/htdocs/install/mysql/tables/llx_holiday_config.sql b/htdocs/install/mysql/tables/llx_holiday_config.sql index 2f08bf5aa41..d5989747778 100644 --- a/htdocs/install/mysql/tables/llx_holiday_config.sql +++ b/htdocs/install/mysql/tables/llx_holiday_config.sql @@ -19,7 +19,7 @@ CREATE TABLE llx_holiday_config ( rowid integer NOT NULL AUTO_INCREMENT PRIMARY KEY, -name VARCHAR( 255 ) NOT NULL UNIQUE, +name VARCHAR(128) NOT NULL UNIQUE, value TEXT NULL ) ENGINE=innodb; \ No newline at end of file From d88a75b6668f5b2be1685089f6f4faa58015b26f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 1 Sep 2017 13:47:12 +0200 Subject: [PATCH 25/29] Fix typo --- ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 746893edb58..c915c04a08d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,7 +9,7 @@ NEW: Add a payment module for Stripe. NEW: Add module "Product variant" (like red, blue for the product shoes) NEW: Accountancy - Activate multi-journal & Add journal_label to database (FEC) NEW: Add a tracking id into mass emailing. -NEW: Tax system more compatible with the new tax roollout in India (IGST / CGST / SGST). +NEW: Tax system more compatible with the new tax rollout in India (IGST / CGST / SGST). NEW: Add calculation function for Loan schedule NEW: Add "depends on" and "required by" into module informations NEW: Add hidden option THIRDPARTY_INCLUDE_PARENT_IN_LINKTO From 2768878618587f0cc4caf08bac01b014d43275af Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 1 Sep 2017 16:37:45 +0200 Subject: [PATCH 26/29] FIX Bad condition on sms log debug --- htdocs/core/class/CSMSFile.class.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/CSMSFile.class.php b/htdocs/core/class/CSMSFile.class.php index 4456df76f83..3bdd644ecc1 100644 --- a/htdocs/core/class/CSMSFile.class.php +++ b/htdocs/core/class/CSMSFile.class.php @@ -107,6 +107,7 @@ class CSMSFile if (empty($conf->global->MAIN_DISABLE_ALL_SMS)) { + // Action according to choosed sending method if ($conf->global->MAIN_SMS_SENDMODE == 'ovh') // Backward compatibility @deprecated { @@ -129,7 +130,7 @@ class CSMSFile { dol_syslog("CSMSFile::sendfile: sms send success with id=".$res, LOG_DEBUG); //var_dump($res); // 1973128 - $this->dump_sms_result($res); + if (! empty($conf->global->MAIN_SMS_DEBUG)) $this->dump_sms_result($res); } } else if (! empty($conf->global->MAIN_SMS_SENDMODE)) // $conf->global->MAIN_SMS_SENDMODE looks like a value 'class@module' @@ -159,7 +160,7 @@ class CSMSFile { dol_syslog("CSMSFile::sendfile: sms send success with id=".$res, LOG_DEBUG); //var_dump($res); // 1973128 - $this->dump_sms_result($res); + if (! empty($conf->global->MAIN_SMS_DEBUG)) $this->dump_sms_result($res); } } catch(Exception $e) From 223e1b1cd4228e42cd63f97917b803ccae73cb1a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 1 Sep 2017 16:54:06 +0200 Subject: [PATCH 27/29] Fix missing the nostop tag --- htdocs/core/class/CSMSFile.class.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/core/class/CSMSFile.class.php b/htdocs/core/class/CSMSFile.class.php index 3bdd644ecc1..570cf6f9b6c 100644 --- a/htdocs/core/class/CSMSFile.class.php +++ b/htdocs/core/class/CSMSFile.class.php @@ -42,6 +42,7 @@ class CSMSFile var $priority; var $class; var $message; + var $nostop; /** @@ -81,6 +82,7 @@ class CSMSFile $this->priority=$priority; $this->class=$class; $this->message=$msg; + $this->nostop=false; } @@ -119,6 +121,7 @@ class CSMSFile $sms->deferred=$this->deferred; $sms->priority=$this->priority; $sms->class=$this->class; + $sms->nostop=$this->nostop; $res=$sms->SmsSend(); if ($res <= 0) @@ -148,6 +151,7 @@ class CSMSFile $sms->priority=$this->priority; $sms->class=$this->class; $sms->message=$this->message; + $sms->nostop=$this->nostop; $res=$sms->SmsSend(); $this->error = $sms->error; From 4660bc58fc80c5921373307f4d0b9a200aceadb2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 1 Sep 2017 17:07:26 +0200 Subject: [PATCH 28/29] Fix nostop option --- htdocs/core/class/CSMSFile.class.php | 1 + htdocs/core/class/html.formsms.class.php | 18 ++++++++++++------ htdocs/langs/en_US/sms.lang | 2 +- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/htdocs/core/class/CSMSFile.class.php b/htdocs/core/class/CSMSFile.class.php index 570cf6f9b6c..0a149feabf4 100644 --- a/htdocs/core/class/CSMSFile.class.php +++ b/htdocs/core/class/CSMSFile.class.php @@ -212,6 +212,7 @@ class CSMSFile fputs($fp, "Priority: ".$this->priority."\n"); fputs($fp, "Class: ".$this->class."\n"); fputs($fp, "Deferred: ".$this->deferred."\n"); + fputs($fp, "DisableStop: ".$this->nostop."\n"); fputs($fp, "Message:\n".$this->message); fclose($fp); diff --git a/htdocs/core/class/html.formsms.class.php b/htdocs/core/class/html.formsms.class.php index 9412582599d..4c64e04187a 100644 --- a/htdocs/core/class/html.formsms.class.php +++ b/htdocs/core/class/html.formsms.class.php @@ -147,7 +147,7 @@ function limitChars(textarea, limit, infodiv) { if ($this->withfromreadonly) { - print ''.$langs->trans("SmsFrom"); + print ''.$langs->trans("SmsFrom"); print ''; print ""; if ($this->fromtype == 'user') @@ -223,7 +223,7 @@ function limitChars(textarea, limit, infodiv) if (is_array($resultsender) && count($resultsender) > 0) { - print ''; foreach($resultsender as $obj) { print ''; @@ -244,7 +244,7 @@ function limitChars(textarea, limit, infodiv) // To (target) if ($this->withto || is_array($this->withto)) { - print ''; + print ''; //$moretext=$langs->trans("YouCanUseCommaSeparatorForSeveralRecipients"); $moretext=''; print $form->textwithpicto($langs->trans("SmsTo"),$moretext); @@ -285,7 +285,7 @@ function limitChars(textarea, limit, infodiv) $defaultmessage=str_replace('\n',"\n",$defaultmessage); print ""; - print "".$langs->trans("SmsText").""; + print ''.$langs->trans("SmsText").""; print ""; if ($this->withbodyreadonly) { @@ -306,7 +306,7 @@ function limitChars(textarea, limit, infodiv) '.$langs->trans("Priority").' : - @@ -314,11 +314,17 @@ function limitChars(textarea, limit, infodiv) '.$langs->trans("Type").' : - + + + '.$langs->trans("DisableStopIfSupported").' : + '; print "\n"; diff --git a/htdocs/langs/en_US/sms.lang b/htdocs/langs/en_US/sms.lang index 8918aa6a365..05b521aae36 100644 --- a/htdocs/langs/en_US/sms.lang +++ b/htdocs/langs/en_US/sms.lang @@ -48,4 +48,4 @@ SmsInfoNumero= (format international ie : +33899701761) DelayBeforeSending=Delay before sending (minutes) SmsNoPossibleSenderFound=No sender available. Check setup of your SMS provider. SmsNoPossibleRecipientFound=No target available. Check setup of your SMS provider. - +DisableStopIfSupported=Disable STOP message (if supported) From 0d0b7f8af27d7f2a604e4d31cbfca15e04bc8538 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 1 Sep 2017 17:18:07 +0200 Subject: [PATCH 29/29] Fix email --- htdocs/societe/tpl/linesalesrepresentative.tpl.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/societe/tpl/linesalesrepresentative.tpl.php b/htdocs/societe/tpl/linesalesrepresentative.tpl.php index 34a7ce3f4c4..3ec07697ec7 100644 --- a/htdocs/societe/tpl/linesalesrepresentative.tpl.php +++ b/htdocs/societe/tpl/linesalesrepresentative.tpl.php @@ -32,6 +32,8 @@ $userstatic->firstname=$val['firstname']; $userstatic->statut=$val['statut']; $userstatic->photo=$val['photo']; + $userstatic->email=$val['email']; + $userstatic->entity=$val['entity']; print $userstatic->getNomUrl(-1); $i++; if ($i < $nbofsalesrepresentative) print ', ';