From 4a19cba257b20552b0e41849b323e09fd0f7b110 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 5 Feb 2019 06:34:05 +0100 Subject: [PATCH 01/18] FIX [URGENT] broken feature, "$usercancreate" is for Dolibarr 9 --- 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 4881e42abf1..73b2bfdb314 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -4551,7 +4551,7 @@ else if ($id > 0 || ! empty($ref)) $ret = $object->printObjectLines($action, $mysoc, $soc, $lineid, 1); // Form to add new line - if ($object->statut == 0 && $usercancreate && $action != 'valid' && $action != 'editline') + if ($object->statut == 0 && $user->rights->facture->creer && $action != 'valid' && $action != 'editline') { if ($action != 'editline' && $action != 'selectlines') { From 8860eab6b11e449ae1394ae2315690876668aad1 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 5 Feb 2019 07:40:50 +0100 Subject: [PATCH 02/18] FIX wrong merged conflict --- htdocs/compta/facture/card.php | 2 +- htdocs/core/lib/functions.lib.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 9f2de6d3eb9..2df6e96e7c2 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -4594,7 +4594,7 @@ else if ($id > 0 || ! empty($ref)) $ret = $object->printObjectLines($action, $mysoc, $soc, $lineid, 1); // Form to add new line - if ($object->statut == 0 && $usercancreate && $action != 'valid' && $action != 'editline' && ($object->is_first() || empty($object->situation_cycle_ref))) + if ($object->statut == 0 && $usercancreate && $action != 'valid' && $action != 'editline') { if ($action != 'editline' && $action != 'selectlines') { diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 73ee29373f6..a593e70a7f6 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -5907,10 +5907,10 @@ function getCommonSubstitutionArray($outputlangs, $onlykey=0, $exclude=null, $ob $substitutionarray['__REF__'] = $object->ref; $substitutionarray['__REF_CLIENT__'] = (isset($object->ref_client) ? $object->ref_client : (isset($object->ref_customer) ? $object->ref_customer : null)); $substitutionarray['__REF_SUPPLIER__'] = (isset($object->ref_supplier) ? $object->ref_supplier : null); + $substitutionarray['__SUPPLIER_ORDER_DATE_DELIVERY__'] = (isset($object->date_livraison) ? dol_print_date($object->date_livraison, 'day', 0, $outputlangs): ''); // For backward compatibility $substitutionarray['__REFCLIENT__'] = (isset($object->ref_client) ? $object->ref_client : (isset($object->ref_customer) ? $object->ref_customer : null)); $substitutionarray['__REFSUPPLIER__'] = (isset($object->ref_supplier) ? $object->ref_supplier : null); - $substitutionarray['__SUPPLIER_ORDER_DATE_DELIVERY__'] = (isset($object->date_livraison) ? dol_print_date($object->date_livraison, 'day', 0, $outputlangs): ''); // TODO Remove this $msgishtml = 0; From 730a2a90fffb43bf47acd605a3ac4e584608a3a8 Mon Sep 17 00:00:00 2001 From: atm-quentin Date: Tue, 5 Feb 2019 09:43:14 +0100 Subject: [PATCH 03/18] FIX supplier invoice product stats total ht is line total not invoice total --- htdocs/product/stats/facture_fournisseur.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/product/stats/facture_fournisseur.php b/htdocs/product/stats/facture_fournisseur.php index 6bd722220ba..a31d94ada69 100644 --- a/htdocs/product/stats/facture_fournisseur.php +++ b/htdocs/product/stats/facture_fournisseur.php @@ -126,7 +126,7 @@ if ($id > 0 || ! empty($ref)) if ($user->rights->fournisseur->facture->lire) { - $sql = "SELECT DISTINCT s.nom as name, s.rowid as socid, s.code_client, d.rowid, d.total_ht as total_ht,"; + $sql = "SELECT DISTINCT s.nom as name, s.rowid as socid, s.code_client, d.rowid, d.total_ht as line_total_ht,"; $sql .= " f.rowid as facid, f.ref, f.ref_supplier, f.datef, f.libelle, f.total_ht, f.total_ttc, f.total_tva, f.paye, f.fk_statut as statut, d.qty"; if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", sc.fk_soc, sc.fk_user "; @@ -205,7 +205,7 @@ if ($id > 0 || ! empty($ref)) print_liste_field_titre("SupplierCode", $_SERVER["PHP_SELF"], "s.code_client", "", $option, '', $sortfield, $sortorder); print_liste_field_titre("DateInvoice", $_SERVER["PHP_SELF"], "f.datef", "", $option, 'align="center"', $sortfield, $sortorder); print_liste_field_titre("Qty", $_SERVER["PHP_SELF"], "d.qty", "", $option, 'align="center"', $sortfield, $sortorder); - print_liste_field_titre("AmountHT", $_SERVER["PHP_SELF"], "f.total_ht", "", $option, 'align="right"', $sortfield, $sortorder); + print_liste_field_titre("AmountHT", $_SERVER["PHP_SELF"], "d.total_ht", "", $option, 'align="right"', $sortfield, $sortorder); print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "f.paye,f.fk_statut", "", $option, 'align="right"', $sortfield, $sortorder); print "\n"; @@ -215,7 +215,7 @@ if ($id > 0 || ! empty($ref)) { $objp = $db->fetch_object($result); - $total_ht+=$objp->total_ht; + $total_ht+=$objp->line_total_ht; $total_qty+=$objp->qty; $supplierinvoicestatic->id = $objp->facid; @@ -237,7 +237,7 @@ if ($id > 0 || ! empty($ref)) print ''; print dol_print_date($db->jdate($objp->datef), 'dayhour') . ""; print '' . $objp->qty . "\n"; - print '' . price($objp->total_ht) . "\n"; + print '' . price($objp->line_total_ht) . "\n"; print '' . $supplierinvoicestatic->LibStatut($objp->paye, $objp->statut, 5) . ''; print "\n"; $i++; From da0c863f459387d0f2dcbd7d79a3f62c70d002f6 Mon Sep 17 00:00:00 2001 From: atm-quentin Date: Tue, 5 Feb 2019 10:30:38 +0100 Subject: [PATCH 04/18] FIX supplier invoice payment total dont care about deposit or credit --- htdocs/fourn/facture/paiement.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index 74593cb8675..8a87d4903a1 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -602,7 +602,10 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print ''.price($objp->total_ttc).''; - print ''.price($objp->am).''; + print ''.price($objp->am); + if ($creditnotes) print '+'.price($creditnotes); + if ($deposits) print '+'.price($deposits); + print ''; print ''.price($remaintopay).''; @@ -657,6 +660,8 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie $total+=$objp->total_ht; $total_ttc+=$objp->total_ttc; $totalrecu+=$objp->am; + $totalrecucreditnote+=$creditnotes; + $totalrecudeposits+=$deposits; $i++; } if ($i > 1) @@ -669,8 +674,11 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie if (!empty($conf->multicurrency->enabled)) print ' '; if (!empty($conf->multicurrency->enabled)) print ' '; print ''.price($total_ttc).''; - print ''.price($totalrecu).''; - print ''.price($total_ttc - $totalrecu).''; + print ''.price($totalrecu); + if ($totalrecucreditnote) print '+'.price($totalrecucreditnote); + if ($totalrecudeposits) print '+'.price($totalrecudeposits); + print ''; + print ''.price(price2num($total_ttc - $totalrecu - $totalrecucreditnote - $totalrecudeposits,'MT')).''; print ''; // Autofilled if (!empty($conf->multicurrency->enabled)) print ''; print "\n"; From 64739098ae31d8277a145784fa45863f7f65baf7 Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio Date: Tue, 5 Feb 2019 11:58:49 +0100 Subject: [PATCH 05/18] FIX: expedition: reset status on rollback + replace hardcoded status with const --- htdocs/expedition/class/expedition.class.php | 21 +++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index b4e4e0c8614..d7960d6ff52 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -538,7 +538,7 @@ class Expedition extends CommonObject $this->db->free($result); - if ($this->statut == 0) $this->brouillon = 1; + if ($this->statut == self::STATUS_DRAFT) $this->brouillon = 1; // Tracking url $this->GetUrlTrackingStatus($obj->tracking_number); @@ -783,7 +783,7 @@ class Expedition extends CommonObject if (! $error) { $this->ref = $numref; - $this->statut = 1; + $this->statut = self::STATUS_VALIDATED; } if (! $error) @@ -816,7 +816,7 @@ class Expedition extends CommonObject if ($conf->livraison_bon->enabled) { - if ($this->statut == 1 || $this->statut == 2) + if ($this->statut == self::STATUS_VALIDATED || $this->statut == self::STATUS_CLOSED) { // Expedition validee include_once DOL_DOCUMENT_ROOT.'/livraison/class/livraison.class.php'; @@ -1111,7 +1111,7 @@ class Expedition extends CommonObject $this->db->begin(); // Stock control - if ($conf->stock->enabled && $conf->global->STOCK_CALCULATE_ON_SHIPMENT && $this->statut > 0) + if ($conf->stock->enabled && $conf->global->STOCK_CALCULATE_ON_SHIPMENT && $this->statut > self::STATUS_DRAFT) { require_once(DOL_DOCUMENT_ROOT."/product/stock/class/mouvementstock.class.php"); @@ -1663,7 +1663,7 @@ class Expedition extends CommonObject $this->id=0; $this->ref = 'SPECIMEN'; $this->specimen=1; - $this->statut = 1; + $this->statut = self::STATUS_VALIDATED; $this->livraison_id = 0; $this->date = $now; $this->date_creation = $now; @@ -2037,6 +2037,7 @@ class Expedition extends CommonObject } else { + $this->statut = self::STATUS_VALIDATED; $this->db->rollback(); return -1; } @@ -2060,7 +2061,7 @@ class Expedition extends CommonObject $resql=$this->db->query($sql); if ($resql) { - $this->statut=2; + $this->statut=self::STATUS_CLOSED; $this->billed=1; // Call trigger @@ -2080,6 +2081,8 @@ class Expedition extends CommonObject } else { + $this->statut=self::STATUS_VALIDATED; + $this->billed=0; $this->db->rollback(); return -1; } @@ -2104,13 +2107,15 @@ class Expedition extends CommonObject $this->db->begin(); + $oldbilled=$this->billed; + $sql = 'UPDATE '.MAIN_DB_PREFIX.'expedition SET fk_statut=1'; $sql .= ' WHERE rowid = '.$this->id.' AND fk_statut > 0'; $resql=$this->db->query($sql); if ($resql) { - $this->statut=1; + $this->statut=self::STATUS_VALIDATED; $this->billed=0; // If stock increment is done on closing @@ -2208,6 +2213,8 @@ class Expedition extends CommonObject } else { + $this->statut=self::STATUS_CLOSED; + $this->billed=$oldbilled; $this->db->rollback(); return -1; } From 428efa922797502740342eac001a70e53a20c5db Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio Date: Tue, 5 Feb 2019 12:02:49 +0100 Subject: [PATCH 06/18] FIX: line edit template: keep fk_parent_line --- htdocs/core/tpl/objectline_edit.tpl.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/core/tpl/objectline_edit.tpl.php b/htdocs/core/tpl/objectline_edit.tpl.php index 41d419694e8..b5d2f035695 100644 --- a/htdocs/core/tpl/objectline_edit.tpl.php +++ b/htdocs/core/tpl/objectline_edit.tpl.php @@ -69,9 +69,13 @@ $coldisplay=-1; // We remove first td + fk_product > 0) { ?> + fk_parent_line > 0) echo img_picto('', 'rightarrow'); + ?> product_type==1) echo img_object($langs->trans('ShowService'),'service'); From 95cc9faf7e0978228627a6331b78db1e9e0cd65b Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Wed, 6 Feb 2019 09:01:24 +0100 Subject: [PATCH 07/18] fix php warning --- htdocs/core/class/commondocgenerator.class.php | 12 ++++++++---- htdocs/imports/import.php | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index 18e2817f040..214c47fc20d 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -340,6 +340,8 @@ abstract class CommonDocGenerator global $conf; $sumpayed=$sumdeposit=$sumcreditnote=''; + $already_payed_all=0; + $remain_to_pay=0; if ($object->element == 'facture') { $invoice_source=new Facture($this->db); @@ -350,6 +352,8 @@ abstract class CommonDocGenerator $sumpayed = $object->getSommePaiement(); $sumdeposit = $object->getSumDepositsUsed(); $sumcreditnote = $object->getSumCreditNotesUsed(); + $already_payed_all=$sumpayed + $sumdeposit + $sumcreditnote; + $remain_to_pay=$sumpayed - $sumdeposit - $sumcreditnote; } $date = ($object->element == 'contrat' ? $object->date_contrat : $object->date); @@ -411,12 +415,12 @@ abstract class CommonDocGenerator $array_key.'_already_creditnote_locale'=>price($sumcreditnote, 0, $outputlangs), $array_key.'_already_creditnote'=>price2num($sumcreditnote), - $array_key.'_already_payed_all_locale'=>price(price2num($sumpayed + $sumdeposit + $sumcreditnote, 'MT'), 0, $outputlangs), - $array_key.'_already_payed_all'=> price2num(($sumpayed + $sumdeposit + $sumcreditnote), 'MT'), + $array_key.'_already_payed_all_locale'=>price(price2num($already_payed_all, 'MT'), 0, $outputlangs), + $array_key.'_already_payed_all'=> price2num($already_payed_all, 'MT'), // Remain to pay with all know infrmation (except open direct debit requests) - $array_key.'_remain_to_pay_locale'=>price(price2num($object->total_ttc - $sumpayed - $sumdeposit - $sumcreditnote, 'MT'), 0, $outputlangs), - $array_key.'_remain_to_pay'=>price2num($object->total_ttc - $sumpayed - $sumdeposit - $sumcreditnote, 'MT') + $array_key.'_remain_to_pay_locale'=>price(price2num($object->total_ttc - $remain_to_pay, 'MT'), 0, $outputlangs), + $array_key.'_remain_to_pay'=>price2num($object->total_ttc - $remain_to_pay, 'MT') ); if (method_exists($object, 'getTotalDiscount')) { diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php index c57a4207782..b1caff18022 100644 --- a/htdocs/imports/import.php +++ b/htdocs/imports/import.php @@ -1332,7 +1332,7 @@ if ($step == 5 && $datatoimport) } print '   '.$langs->trans("Modify").''; } else { - if (count($objimport->array_import_updatekeys[0])) + if (is_array($objimport->array_import_updatekeys[0]) && count($objimport->array_import_updatekeys[0])) { print $form->multiselectarray('updatekeys', $objimport->array_import_updatekeys[0], $updatekeys, 0, 0, '', 1, '80%'); print $form->textwithpicto("", $langs->trans("SelectPrimaryColumnsForUpdateAttempt")); From 29e4fce45084965b5d3d036be84761d121ad3e8c Mon Sep 17 00:00:00 2001 From: gauthier Date: Wed, 6 Feb 2019 12:35:23 +0100 Subject: [PATCH 08/18] FIX : can't add lines on invoices --- 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 4881e42abf1..0aaac3f8f2e 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -108,7 +108,7 @@ if ($id > 0 || ! empty($ref)) { // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('invoicecard','globalcard')); -$permissionnote = $user->rights->facture->creer; // Used by the include of actions_setnotes.inc.php +$usercancreate = $permissionnote = $user->rights->facture->creer; // Used by the include of actions_setnotes.inc.php $permissiondellink=$user->rights->facture->creer; // Used by the include of actions_dellink.inc.php $permissiontoedit = $user->rights->facture->creer; // Used by the include of actions_lineupdonw.inc.php From 8e6a567b091795e9641ea6b234b4a43aaaa93d56 Mon Sep 17 00:00:00 2001 From: atm-ph Date: Thu, 7 Feb 2019 12:36:22 +0100 Subject: [PATCH 09/18] Fix display payment table on multiple pages --- .../modules/facture/doc/pdf_crabe.modules.php | 82 ++++++++++++++----- 1 file changed, 60 insertions(+), 22 deletions(-) diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 4c0724d393d..91d20d4830b 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -706,7 +706,7 @@ class pdf_crabe extends ModelePDFFactures // Affiche zone versements if (($deja_regle || $amount_credit_notes_included || $amount_deposits_included) && empty($conf->global->INVOICE_NO_PAYMENT_DETAILS)) { - $posy=$this->_tableau_versements($pdf, $object, $posy, $outputlangs); + $posy=$this->_tableau_versements($pdf, $object, $posy, $outputlangs, $heightforfooter); } // Pied de page @@ -751,15 +751,17 @@ class pdf_crabe extends ModelePDFFactures * @param Object $object Object invoice * @param int $posy Position y in PDF * @param Translate $outputlangs Object langs for output + * @param int $heightforfooter height for footer * @return int <0 if KO, >0 if OK */ - function _tableau_versements(&$pdf, $object, $posy, $outputlangs) + function _tableau_versements(&$pdf, $object, $posy, $outputlangs, $heightforfooter) { global $conf; $sign=1; if ($object->type == 2 && ! empty($conf->global->INVOICE_POSITIVE_CREDIT_NOTE)) $sign=-1; + $current_page = $pdf->getPage(); $tab3_posx = 120; $tab3_top = $posy + 8; $tab3_width = 80; @@ -771,26 +773,7 @@ class pdf_crabe extends ModelePDFFactures $default_font_size = pdf_getPDFFontSize($outputlangs); - $title=$outputlangs->transnoentities("PaymentsAlreadyDone"); - if ($object->type == 2) $title=$outputlangs->transnoentities("PaymentsBackAlreadyDone"); - - $pdf->SetFont('','', $default_font_size - 3); - $pdf->SetXY($tab3_posx, $tab3_top - 4); - $pdf->MultiCell(60, 3, $title, 0, 'L', 0); - - $pdf->line($tab3_posx, $tab3_top, $tab3_posx+$tab3_width, $tab3_top); - - $pdf->SetFont('','', $default_font_size - 4); - $pdf->SetXY($tab3_posx, $tab3_top); - $pdf->MultiCell(20, 3, $outputlangs->transnoentities("Payment"), 0, 'L', 0); - $pdf->SetXY($tab3_posx+21, $tab3_top); - $pdf->MultiCell(20, 3, $outputlangs->transnoentities("Amount"), 0, 'L', 0); - $pdf->SetXY($tab3_posx+40, $tab3_top); - $pdf->MultiCell(20, 3, $outputlangs->transnoentities("Type"), 0, 'L', 0); - $pdf->SetXY($tab3_posx+58, $tab3_top); - $pdf->MultiCell(20, 3, $outputlangs->transnoentities("Num"), 0, 'L', 0); - - $pdf->line($tab3_posx, $tab3_top-1+$tab3_height, $tab3_posx+$tab3_width, $tab3_top-1+$tab3_height); + $this->_tableau_versements_header($pdf, $object, $outputlangs, $default_font_size, $tab3_posx, $tab3_top, $tab3_width, $tab3_height); $y=0; @@ -812,6 +795,17 @@ class pdf_crabe extends ModelePDFFactures while ($i < $num) { $y+=3; + if ($tab3_top+$y >= $this->page_hauteur-$heightforfooter) + { + $y=0; + $current_page++; + $pdf->AddPage('','',true); + if (! empty($tplidx)) $pdf->useTemplate($tplidx); + if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs); + $pdf->setPage($current_page); + $this->_tableau_versements_header($pdf, $object, $outputlangs, $default_font_size, $tab3_posx, $tab3_top+$y-3, $tab3_width, $tab3_height); + } + $obj = $this->db->fetch_object($resql); if ($obj->type == 2) $text=$outputlangs->transnoentities("CreditNote"); @@ -858,6 +852,17 @@ class pdf_crabe extends ModelePDFFactures $i=0; while ($i < $num) { $y+=3; + if ($tab3_top+$y >= $this->page_hauteur-$heightforfooter) + { + $y=0; + $current_page++; + $pdf->AddPage('','',true); + if (! empty($tplidx)) $pdf->useTemplate($tplidx); + if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs); + $pdf->setPage($current_page); + $this->_tableau_versements_header($pdf, $object, $outputlangs, $default_font_size, $tab3_posx, $tab3_top+$y-3, $tab3_width, $tab3_height); + } + $row = $this->db->fetch_object($resql); $pdf->SetXY($tab3_posx, $tab3_top+$y); @@ -884,6 +889,39 @@ class pdf_crabe extends ModelePDFFactures } + /** + * @param PDF $pdf Object PDF + * @param Facture $object Object invoice + * @param Translate $outputlangs Object langs for output + * @param int $default_font_size Font size + * @param int $tab3_posx pos x + * @param int $tab3_top pos y + * @param int $tab3_width width + * @param int $tab3_height height + */ + function _tableau_versements_header($pdf, $object, $outputlangs, $default_font_size, $tab3_posx, $tab3_top, $tab3_width, $tab3_height) + { + $title=$outputlangs->transnoentities("PaymentsAlreadyDone"); + if ($object->type == 2) $title=$outputlangs->transnoentities("PaymentsBackAlreadyDone"); + + $pdf->SetFont('','', $default_font_size - 3); + $pdf->SetXY($tab3_posx, $tab3_top - 4); + $pdf->MultiCell(60, 3, $title, 0, 'L', 0); + + $pdf->line($tab3_posx, $tab3_top, $tab3_posx+$tab3_width, $tab3_top); + + $pdf->SetFont('','', $default_font_size - 4); + $pdf->SetXY($tab3_posx, $tab3_top); + $pdf->MultiCell(20, 3, $outputlangs->transnoentities("Payment"), 0, 'L', 0); + $pdf->SetXY($tab3_posx+21, $tab3_top); + $pdf->MultiCell(20, 3, $outputlangs->transnoentities("Amount"), 0, 'L', 0); + $pdf->SetXY($tab3_posx+40, $tab3_top); + $pdf->MultiCell(20, 3, $outputlangs->transnoentities("Type"), 0, 'L', 0); + $pdf->SetXY($tab3_posx+58, $tab3_top); + $pdf->MultiCell(20, 3, $outputlangs->transnoentities("Num"), 0, 'L', 0); + + $pdf->line($tab3_posx, $tab3_top-1+$tab3_height, $tab3_posx+$tab3_width, $tab3_top-1+$tab3_height); + } /** * Show miscellaneous information (payment mode, payment term, ...) From 9d0e0c2798127d3324a61bf148dd2490200b3121 Mon Sep 17 00:00:00 2001 From: atm-greg Date: Thu, 7 Feb 2019 15:17:52 +0100 Subject: [PATCH 10/18] FIX add fk_unit on addline action --- htdocs/supplier_proposal/card.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index e47dc48d6ca..7b1bf417b40 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -634,6 +634,8 @@ if (empty($reshook)) $ref_supplier = $productsupplier->ref_supplier; + $fk_unit = $productsupplier->fk_unit; + $tva_tx = get_default_tva($object->thirdparty, $mysoc, $productsupplier->id, GETPOST('idprodfournprice','alpha')); $tva_npr = get_default_npr($object->thirdparty, $mysoc, $productsupplier->id, GETPOST('idprodfournprice','alpha')); if (empty($tva_tx)) $tva_npr=0; From ec7ef265b7a0230ea6b993139def74937d1fdc7a Mon Sep 17 00:00:00 2001 From: atm-ph Date: Thu, 7 Feb 2019 17:47:17 +0100 Subject: [PATCH 11/18] Fix psql search insensitive accent --- htdocs/core/db/pgsql.class.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/htdocs/core/db/pgsql.class.php b/htdocs/core/db/pgsql.class.php index 8e57b29109e..392e0998d6b 100644 --- a/htdocs/core/db/pgsql.class.php +++ b/htdocs/core/db/pgsql.class.php @@ -152,6 +152,7 @@ class DoliDBPgsql extends DoliDB */ static function convertSQLFromMysql($line,$type='auto',$unescapeslashquot=false) { + global $conf; // Removed empty line if this is a comment line for SVN tagging if (preg_match('/^--\s\$Id/i',$line)) { return ''; @@ -311,7 +312,14 @@ class DoliDBPgsql extends DoliDB } // To have postgresql case sensitive - $line=str_replace(' LIKE \'',' ILIKE \'',$line); + $count_like=0; + $line=str_replace(' LIKE \'',' ILIKE \'',$line,$count_like); + if (!empty($conf->global->PSQL_USE_UNACCENT) && $count_like > 0) + { + // @see https://docs.postgresql.fr/11/unaccent.html : 'unaccent()' function must be installed before + $line=preg_replace('/\s+(\(?\s*)([a-zA-Z0-9\-\_\.]+) ILIKE /', ' \1unaccent(\2) ILIKE ', $line); + } + $line=str_replace(' LIKE BINARY \'',' LIKE \'',$line); // Replace INSERT IGNORE into INSERT From 51515a487ed72eabd7a5fbbade31a0a7d50d80b9 Mon Sep 17 00:00:00 2001 From: atm-ph Date: Thu, 7 Feb 2019 17:58:25 +0100 Subject: [PATCH 12/18] Fix search unaccent from left menu search box --- htdocs/core/db/pgsql.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/db/pgsql.class.php b/htdocs/core/db/pgsql.class.php index 392e0998d6b..3d365142a0a 100644 --- a/htdocs/core/db/pgsql.class.php +++ b/htdocs/core/db/pgsql.class.php @@ -317,7 +317,7 @@ class DoliDBPgsql extends DoliDB if (!empty($conf->global->PSQL_USE_UNACCENT) && $count_like > 0) { // @see https://docs.postgresql.fr/11/unaccent.html : 'unaccent()' function must be installed before - $line=preg_replace('/\s+(\(?\s*)([a-zA-Z0-9\-\_\.]+) ILIKE /', ' \1unaccent(\2) ILIKE ', $line); + $line=preg_replace('/\s+(\(+\s*)([a-zA-Z0-9\-\_\.]+) ILIKE /', ' \1unaccent(\2) ILIKE ', $line); } $line=str_replace(' LIKE BINARY \'',' LIKE \'',$line); From 8abebb091c16343c66de43b7fa6668d093bb38ba Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 Feb 2019 09:33:01 +0100 Subject: [PATCH 13/18] Var no more used --- 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 0a0e2ad7cd5..73b2bfdb314 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -108,7 +108,7 @@ if ($id > 0 || ! empty($ref)) { // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('invoicecard','globalcard')); -$usercancreate = $permissionnote = $user->rights->facture->creer; // Used by the include of actions_setnotes.inc.php +$permissionnote = $user->rights->facture->creer; // Used by the include of actions_setnotes.inc.php $permissiondellink=$user->rights->facture->creer; // Used by the include of actions_dellink.inc.php $permissiontoedit = $user->rights->facture->creer; // Used by the include of actions_lineupdonw.inc.php From 43fbcf7081cd5a2dcb51153ce47c0e926053f31e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 Feb 2019 10:28:59 +0100 Subject: [PATCH 14/18] Prepare 8.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 36e3ba38b58..3981de21751 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -31,7 +31,7 @@ */ if (! defined('DOL_APPLICATION_TITLE')) define('DOL_APPLICATION_TITLE','Dolibarr'); -if (! defined('DOL_VERSION')) define('DOL_VERSION','8.0.4'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c +if (! defined('DOL_VERSION')) define('DOL_VERSION','8.0.5'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c if (! defined('EURO')) define('EURO',chr(128)); From 26860620319457c881a916ef96031dc12e656784 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 Feb 2019 10:30:07 +0100 Subject: [PATCH 15/18] Prepare version 9.0.1 --- 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 b98c91add1a..b2213c5d03c 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -31,7 +31,7 @@ */ if (! defined('DOL_APPLICATION_TITLE')) define('DOL_APPLICATION_TITLE','Dolibarr'); -if (! defined('DOL_VERSION')) define('DOL_VERSION','9.0.0'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c +if (! defined('DOL_VERSION')) define('DOL_VERSION','9.0.1'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c if (! defined('EURO')) define('EURO',chr(128)); From 3a5fc8f0c375dca22d36049aa0923d2c4aed7af5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 Feb 2019 10:41:11 +0100 Subject: [PATCH 16/18] NEW Add protection to avoid packaging if files non indexed exists into dir. --- build/makepack-dolibarr.pl | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index bbdfa564183..16b4f64a0d2 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -387,6 +387,15 @@ if ($nboftargetok) { #----------------------- if ($CHOOSEDTARGET{'-CHKSUM'}) { + $ret=`git ls-files . --exclude-standard --others`; + if ($ret) + { + print "Some files exists in source directory and are not indexed neither excluded in .gitignore.\n"; + print $ret; + print "Canceled.\n"; + exit; + } + print 'Create xml check file with md5 checksum with command php '.$SOURCE.'/build/generate_filelist_xml.php release='.$MAJOR.'.'.$MINOR.'.'.$BUILD."\n"; $ret=`php $SOURCE/build/generate_filelist_xml.php release=$MAJOR.$MINOR.$BUILD`; print $ret."\n"; From 662ed9fba7133a59124003fdf4c7d2beaf2a6200 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 Feb 2019 10:47:25 +0100 Subject: [PATCH 17/18] Prepare 9.0.1 --- ChangeLog | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/ChangeLog b/ChangeLog index 39c4d5d6ca8..e87c9c14f8b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,27 @@ English Dolibarr ChangeLog -------------------------------------------------------------- +***** ChangeLog for 9.0.1 compared to 9.0.0 ***** +FIX: #10381 +FIX: #10460 compatibility with MariaDB 10.4 +FIX: #10485 +FIX: add fk_unit on addline action +FIX: better test on fetch +FIX: Default language of company is not set +FIX: error report not returned +FIX: expedition: reset status on rollback + replace hardcoded status with const +FIX: line edit template: keep fk_parent_line +FIX: Missing province in export of invoice +FIX: must fetch member in current entity +FIX: Price in combo list of service does not use the correct price level +FIX: supplier invoice payment total doesnt care about deposit or credit +FIX: supplier invoice product stats total ht is line total not invoice total +FIX: Translation not loaded by scheduled jobs +FIX: [URGENT] broken feature, "$usercancreate" is for Dolibarr 9 - can't add lines on invoices +FIX: wrong merged conflict +FIX: wrong tests on fetch +NEW: Add protection to avoid packaging if files non indexed exists into + ***** ChangeLog for 9.0.0 compared to 8.0.0 ***** For Users: NEW: Stable module: DAV (WebDAV only for the moment) From 9b2a91893d956f7af47ebe17931aef7e33ce81ad Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 Feb 2019 10:49:02 +0100 Subject: [PATCH 18/18] Update doc --- ChangeLog | 1 - 1 file changed, 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index e87c9c14f8b..441bbb189b8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -19,7 +19,6 @@ FIX: Price in combo list of service does not use the correct price level FIX: supplier invoice payment total doesnt care about deposit or credit FIX: supplier invoice product stats total ht is line total not invoice total FIX: Translation not loaded by scheduled jobs -FIX: [URGENT] broken feature, "$usercancreate" is for Dolibarr 9 - can't add lines on invoices FIX: wrong merged conflict FIX: wrong tests on fetch NEW: Add protection to avoid packaging if files non indexed exists into