From a5ebcff2eea5de9dd12ffe989967845c9cad3f8e Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Tue, 16 Oct 2018 22:27:34 +0200 Subject: [PATCH 01/35] Fix lettering function --- htdocs/accountancy/bookkeeping/list.php | 30 +++++++- ....php => thirdparty_lettering_customer.php} | 73 ++++--------------- ....php => thirdparty_lettering_supplier.php} | 52 ++----------- htdocs/accountancy/class/lettering.class.php | 16 ++-- htdocs/core/lib/company.lib.php | 18 ++--- htdocs/langs/en_US/accountancy.lang | 1 + htdocs/langs/en_US/main.lang | 2 + 7 files changed, 67 insertions(+), 125 deletions(-) rename htdocs/accountancy/bookkeeping/{thirdparty_lettrage.php => thirdparty_lettering_customer.php} (76%) rename htdocs/accountancy/bookkeeping/{thirdparty_lettrage_supplier.php => thirdparty_lettering_supplier.php} (82%) diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index 132aa4e0afa..dad4089b6d2 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -1,8 +1,8 @@ - * Copyright (C) 2013-2016 Florian Henry - * Copyright (C) 2013-2017 Alexandre Spangaro - * Copyright (C) 2016-2017 Laurent Destailleur +/* Copyright (C) 2013-2016 Olivier Geffroy + * Copyright (C) 2013-2016 Florian Henry + * Copyright (C) 2013-2018 Alexandre Spangaro + * Copyright (C) 2016-2017 Laurent Destailleur * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -79,6 +79,7 @@ $search_direction = GETPOST('search_direction', 'alpha'); $search_debit = GETPOST('search_debit', 'alpha'); $search_credit = GETPOST('search_credit', 'alpha'); $search_ledger_code = GETPOST('search_ledger_code', 'alpha'); +$search_lettering_code = GETPOST('search_lettering_code', 'alpha'); // Load variable for pagination $limit = GETPOST('limit','int')?GETPOST('limit', 'int'):(empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)?$conf->liste_limit:$conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION); @@ -138,6 +139,7 @@ $arrayfields=array( 't.label_operation'=>array('label'=>$langs->trans("Label"), 'checked'=>1), 't.debit'=>array('label'=>$langs->trans("Debit"), 'checked'=>1), 't.credit'=>array('label'=>$langs->trans("Credit"), 'checked'=>1), + 't.lettering_code'=>array('label'=>$langs->trans("LetteringCode"), 'checked'=>1), 't.code_journal'=>array('label'=>$langs->trans("Codejournal"), 'checked'=>1), 't.date_creation'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0), 't.tms'=>array('label'=>$langs->trans("DateModification"), 'checked'=>0), @@ -176,6 +178,7 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x', $search_date_modification_end = ''; $search_debit = ''; $search_credit = ''; + $search_lettering_code = ''; } // Must be after the remove filter action, before the export. @@ -272,6 +275,10 @@ if (! empty($search_credit)) { $filter['t.credit'] = $search_credit; $param .= '&search_credit=' . urlencode($search_credit); } +if (! empty($search_lettering_code)) { + $filter['t.lettering_code'] = $search_lettering_code; + $param .= '&search_lettering_code=' . urlencode($search_lettering_code); + } if ($action == 'delbookkeeping') { @@ -546,6 +553,13 @@ if (! empty($arrayfields['t.credit']['checked'])) print ''; print ''; } +// Lettering code +if (! empty($arrayfields['t.lettering_code']['checked'])) +{ + print ''; + print ''; + print ''; +} // Code journal if (! empty($arrayfields['t.code_journal']['checked'])) { @@ -595,6 +609,7 @@ if (! empty($arrayfields['t.subledger_account']['checked'])) print_liste_field_t if (! empty($arrayfields['t.label_operation']['checked'])) print_liste_field_titre($arrayfields['t.label_operation']['label'], $_SERVER['PHP_SELF'], "t.label_operation", "", $param, "", $sortfield, $sortorder); if (! empty($arrayfields['t.debit']['checked'])) print_liste_field_titre($arrayfields['t.debit']['label'], $_SERVER['PHP_SELF'], "t.debit", "", $param, 'align="right"', $sortfield, $sortorder); if (! empty($arrayfields['t.credit']['checked'])) print_liste_field_titre($arrayfields['t.credit']['label'], $_SERVER['PHP_SELF'], "t.credit", "", $param, 'align="right"', $sortfield, $sortorder); +if (! empty($arrayfields['t.lettering_code']['checked'])) print_liste_field_titre($arrayfields['t.lettering_code']['label'], $_SERVER['PHP_SELF'], "t.lettering_code", "", $param, 'align="center"', $sortfield, $sortorder); if (! empty($arrayfields['t.code_journal']['checked'])) print_liste_field_titre($arrayfields['t.code_journal']['label'], $_SERVER['PHP_SELF'], "t.code_journal", "", $param, 'align="center"', $sortfield, $sortorder); if (! empty($arrayfields['t.date_creation']['checked'])) print_liste_field_titre($arrayfields['t.date_creation']['label'], $_SERVER['PHP_SELF'], "t.date_creation", "", $param, 'align="center"', $sortfield, $sortorder); if (! empty($arrayfields['t.tms']['checked'])) print_liste_field_titre($arrayfields['t.tms']['label'], $_SERVER['PHP_SELF'], "t.tms", "", $param, 'align="center"', $sortfield, $sortorder); @@ -680,6 +695,13 @@ if ($num > 0) $totalarray['totalcredit'] += $line->credit; } + // Lettering code + if (! empty($arrayfields['t.lettering_code']['checked'])) + { + print '' . $line->lettering_code . ''; + if (! $i) $totalarray['nbfield']++; + } + // Journal code if (! empty($arrayfields['t.code_journal']['checked'])) { diff --git a/htdocs/accountancy/bookkeeping/thirdparty_lettrage.php b/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php similarity index 76% rename from htdocs/accountancy/bookkeeping/thirdparty_lettrage.php rename to htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php index be335107839..fa41b404f03 100644 --- a/htdocs/accountancy/bookkeeping/thirdparty_lettrage.php +++ b/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php @@ -1,9 +1,9 @@ - * Copyright (C) 2005 Laurent Destailleur - * Copyright (C) 2013 Olivier Geffroy - * Copyright (C) 2013 Florian Henry - * Copyright (C) 2013 Alexandre Spangaro +/* Copyright (C) 2004-2005 Rodolphe Quiedeville + * Copyright (C) 2005 Laurent Destailleur + * Copyright (C) 2013 Olivier Geffroy + * Copyright (C) 2013 Florian Henry + * Copyright (C) 2013-2018 Alexandre Spangaro * * 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 @@ -21,9 +21,9 @@ */ /** - * \file accountancy/bookkeeping/thirdparty_lettrage.php - * \ingroup Advanced accountancy - * \brief Onglet de gestion de parametrages des ventilations + * \file accountancy/bookkeeping/thirdparty_lettering_customer.php + * \ingroup Advanced accountancy + * \brief Onglet de gestion de parametrages des ventilations */ require '../../main.inc.php'; @@ -107,7 +107,7 @@ if ($action == 'lettering') { if ($action == 'autolettrage') { - $result = $BookKeeping->lettrageTiers($socid); + $result = $BookKeeping->lettering_thirdparty($socid); if ($result < 0) { setEventMessages('', $BookKeeping->errors, 'errors'); @@ -124,55 +124,15 @@ $head = societe_prepare_head($object); dol_htmloutput_mesg(is_numeric($error) ? '' : $error, $errors, 'error'); -dol_fiche_head($head, 'accounting', $langs->trans("ThirdParty"), 0, 'company'); +dol_fiche_head($head, 'lettering_customer', $langs->trans("ThirdParty"), 0, 'company'); -print ''; -print ''; +$linkback = ''.$langs->trans("BackToList").''; -if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field -{ - print ''; -} +dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom', '', '', 0, '', '', 'arearefnobottom'); -print ''; -print ''; -print ''; +dol_fiche_end(); -print ''; -print ''; -print ''; - -// Address -print ''; - -// Zip / Town -print ''; -print ''; - -// Country -print ''; - -print '
' . $langs->trans("ThirdPartyName") . ''; -$object->next_prev_filter = "te.fournisseur = 1"; -print $form->showrefnav($object, 'socid', '', ($user->societe_id ? 0 : 1), 'rowid', 'nom', '', ''); -print '
' . $langs->trans('Prefix') . '' . $object->prefix_comm . '
' . $langs->trans("CustomerCode") . ''; -print $object->code_client; -if ($object->check_codeclient() != 0) - print ' (' . $langs->trans("WrongCustomerCode") . ')'; -print '
'; -print $form->editfieldkey("CustomerAccountancyCode", 'customeraccountancycode', $object->code_compta, $object, $user->rights->societe->creer); -print ''; -print $form->editfieldval("CustomerAccountancyCode", 'customeraccountancycode', $object->code_compta, $object, $user->rights->societe->creer); -print '
' . $langs->trans("Address") . ''; -dol_print_address($object->address, 'gmap', 'thirdparty', $object->id); -print '
' . $langs->trans("Zip") . ' / ' . $langs->trans("Town") . '' . $object->zip . (($object->zip && $object->town) ? ' / ' : '') . $object->town . '
' . $langs->trans("Country") . ''; -// $img=picto_from_langcode($object->country_code); -$img = ''; -if ($object->isInEEC()) - print $form->textwithpicto(($img ? $img . ' ' : '') . $object->country, $langs->trans("CountryIsInEEC"), 1, 0); -else - print ($img ? $img . ' ' : '') . $object->country; -print '
'; +print '
'; $sql = "SELECT bk.rowid, bk.doc_date, bk.doc_type, bk.doc_ref, "; $sql .= " bk.subledger_account, bk.numero_compte , bk.label_compte, bk.debit, "; @@ -209,7 +169,7 @@ while ( $obj = $db->fetch_object($resql) ) { $sql .= $db->plimit($limit + 1, $offset); -dol_syslog("/accountancy/bookkeeping/thirdparty_lettrage.php", LOG_DEBUG); +dol_syslog("/accountancy/bookkeeping/thirdparty_lettering_customer.php", LOG_DEBUG); $resql = $db->query($sql); if (! $resql) { dol_print_error($db); @@ -218,7 +178,7 @@ if (! $resql) { $num = $db->num_rows($resql); -dol_syslog("/accountancy/bookkeeping/thirdparty_lettrage.php", LOG_DEBUG); +dol_syslog("/accountancy/bookkeeping/thirdparty_lettering_customer.php", LOG_DEBUG); if ($resql) { $i = 0; @@ -317,4 +277,3 @@ if ($resql) { // End of page llxFooter(); $db->close(); - diff --git a/htdocs/accountancy/bookkeeping/thirdparty_lettrage_supplier.php b/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php similarity index 82% rename from htdocs/accountancy/bookkeeping/thirdparty_lettrage_supplier.php rename to htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php index 905361b4c8e..b70d0a07242 100644 --- a/htdocs/accountancy/bookkeeping/thirdparty_lettrage_supplier.php +++ b/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php @@ -111,7 +111,7 @@ if ($action == 'lettering') { if ($action == 'autolettrage') { - $result = $BookKeeping->lettrageTiers($socid); + $result = $BookKeeping->lettering_thirdparty($socid); if ($result < 0) { setEventMessages('', $BookKeeping->errors, 'errors'); @@ -140,55 +140,13 @@ $head = societe_prepare_head($object); dol_htmloutput_mesg(is_numeric($error) ? '' : $error, $errors, 'error'); -dol_fiche_head($head, 'accounting_supplier', $langs->trans("ThirdParty"), 0, 'company'); +dol_fiche_head($head, 'lettering_supplier', $langs->trans("ThirdParty"), 0, 'company'); -print ''; -print ''; +$linkback = ''.$langs->trans("BackToList").''; -if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field -{ - print ''; -} +dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom', '', '', 0, '', '', 'arearefnobottom'); -print ''; -print ''; -print ''; - -print ''; -print ''; -print ''; - -// Address -print ''; - -// Zip / Town -print ''; -print ''; - -// Country -print ''; - -print '
' . $langs->trans("ThirdPartyName") . ''; -$object->next_prev_filter = "te.fournisseur = 1"; -print $form->showrefnav($object, 'socid', '', ($user->societe_id ? 0 : 1), 'rowid', 'nom', '', ''); -print '
' . $langs->trans('Prefix') . '' . $object->prefix_comm . '
' . $langs->trans("SupplierCode") . ''; -print $object->code_fournisseur; -if ($object->check_codefournisseur() != 0) - print ' (' . $langs->trans("WrongSupplierCode") . ')'; -print '
'; -print $form->editfieldkey("SupplierAccountancyCode", 'supplieraccountancycode', $object->code_compta_fournisseur, $object, $user->rights->societe->creer); -print ''; -print $form->editfieldval("SupplierAccountancyCode", 'supplieraccountancycode', $object->code_compta_fournisseur, $object, $user->rights->societe->creer); -print '
' . $langs->trans("Address") . ''; -dol_print_address($object->address, 'gmap', 'thirdparty', $object->id); -print '
' . $langs->trans("Zip") . ' / ' . $langs->trans("Town") . '' . $object->zip . (($object->zip && $object->town) ? ' / ' : '') . $object->town . '
' . $langs->trans("Country") . ''; -// $img=picto_from_langcode($object->country_code); -$img = ''; -if ($object->isInEEC()) - print $form->textwithpicto(($img ? $img . ' ' : '') . $object->country, $langs->trans("CountryIsInEEC"), 1, 0); -else - print ($img ? $img . ' ' : '') . $object->country; -print '
'; +dol_fiche_end(); $sql = "SELECT bk.rowid, bk.doc_date, bk.doc_type, bk.doc_ref, "; $sql .= " bk.subledger_account, bk.numero_compte , bk.label_compte, bk.debit, "; diff --git a/htdocs/accountancy/class/lettering.class.php b/htdocs/accountancy/class/lettering.class.php index 0ddbaeb5026..220ed24d5d6 100644 --- a/htdocs/accountancy/class/lettering.class.php +++ b/htdocs/accountancy/class/lettering.class.php @@ -1,7 +1,7 @@ - * Copyright (C) 2013 Olivier Geffroy - * Copyright (C) 2013 Alexandre Spangaro +/* Copyright (C) 2004-2005 Rodolphe Quiedeville + * Copyright (C) 2013 Olivier Geffroy + * Copyright (C) 2013-2018 Alexandre Spangaro * * 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 @@ -18,9 +18,9 @@ */ /** - * \file accountancy/class/bookkeeping.class.php - * \ingroup Advanced accountancy - * \brief File of class for lettering + * \file accountancy/class/bookkeeping.class.php + * \ingroup Advanced accountancy + * \brief File of class for lettering */ include_once DOL_DOCUMENT_ROOT . "/accountancy/class/bookkeeping.class.php"; include_once DOL_DOCUMENT_ROOT . "/societe/class/societe.class.php"; @@ -32,12 +32,12 @@ include_once DOL_DOCUMENT_ROOT . "/core/lib/date.lib.php"; class lettering extends BookKeeping { /** - * lettrageTiers + * lettering_thirdparty * * @param int $socid Thirdparty id * @return int 1 OK, <0 error */ - public function lettrageTiers($socid) + public function lettering_thirdparty($socid) { global $conf; diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 0e2401434d7..46e3922a0d0 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -6,11 +6,11 @@ * Copyright (C) 2013-2014 Florian Henry * Copyright (C) 2013-2014 Juanjo Menent * Copyright (C) 2013 Christophe Battarel - * Copyright (C) 2013 Alexandre Spangaro + * Copyright (C) 2013-2018 Alexandre Spangaro * Copyright (C) 2015-2018 Frédéric France * Copyright (C) 2015 Raphaël Doursenaud - * Copyright (C) 2017 Rui Strecht - * Copyright (C) 2018 Ferran Marcet + * Copyright (C) 2017 Rui Strecht + * Copyright (C) 2018 Ferran Marcet * * 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 @@ -154,18 +154,18 @@ function societe_prepare_head(Societe $object) // Tab to accountancy if (! empty($conf->accounting->enabled) && $object->client>0) { - $head[$h][0] = DOL_URL_ROOT.'/accountancy/bookkeeping/thirdparty_lettrage.php?socid='.$object->id; - $head[$h][1] = $langs->trans("TabAccountingCustomer"); - $head[$h][2] = 'accounting'; + $head[$h][0] = DOL_URL_ROOT.'/accountancy/bookkeeping/thirdparty_lettering_customer.php?socid='.$object->id; + $head[$h][1] = $langs->trans("TabLetteringCustomer"); + $head[$h][2] = 'lettering_customer'; $h++; } // Tab to accountancy if (! empty($conf->accounting->enabled) && $object->fournisseur>0) { - $head[$h][0] = DOL_URL_ROOT.'/accountancy/bookkeeping/thirdparty_lettrage_supplier.php?socid='.$object->id; - $head[$h][1] = $langs->trans("TabAccountingSupplier"); - $head[$h][2] = 'accounting_supplier'; + $head[$h][0] = DOL_URL_ROOT.'/accountancy/bookkeeping/thirdparty_lettering_supplier.php?socid='.$object->id; + $head[$h][1] = $langs->trans("TabLetteringSupplier"); + $head[$h][2] = 'lettering_supplier'; $h++; } } diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang index 0e59bf9a5a3..e6215269512 100644 --- a/htdocs/langs/en_US/accountancy.lang +++ b/htdocs/langs/en_US/accountancy.lang @@ -160,6 +160,7 @@ Docref=Reference LabelAccount=Label account LabelOperation=Label operation Sens=Sens +LetteringCode=Lettering code Codejournal=Journal NumPiece=Piece number TransactionNumShort=Num. transaction diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index fb2f2a8e9fb..03d65917a97 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -870,6 +870,8 @@ NewLeadOrProject=New lead or project Rights=Permissions LineNb=Line no. IncotermLabel=Incoterms +TabLetteringCustomer=Customer lettering +TabLetteringSupplier=Supplier lettering # Week day Monday=Monday Tuesday=Tuesday From 5cbcef44652a2e7ef086fe54be2f97cc30dc3692 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sat, 20 Oct 2018 08:26:30 +0200 Subject: [PATCH 02/35] Debug Lettering --- .../thirdparty_lettering_customer.php | 65 ++++++------- .../thirdparty_lettering_supplier.php | 95 ++++++++----------- .../accountancy/class/bookkeeping.class.php | 14 +-- htdocs/langs/en_US/accountancy.lang | 1 + 4 files changed, 78 insertions(+), 97 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php b/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php index fa41b404f03..24532b86e35 100644 --- a/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php +++ b/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php @@ -23,10 +23,9 @@ /** * \file accountancy/bookkeeping/thirdparty_lettering_customer.php * \ingroup Advanced accountancy - * \brief Onglet de gestion de parametrages des ventilations + * \brief Tab to manage customer lettering */ require '../../main.inc.php'; - require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php'; require_once DOL_DOCUMENT_ROOT . '/accountancy/class/bookkeeping.class.php'; require_once DOL_DOCUMENT_ROOT . '/accountancy/class/lettering.class.php'; @@ -34,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; // Load translation files required by the page -$langs->loadLangs(array("compta")); +$langs->loadLangs(array("compta","accountancy")); $action = GETPOST('action', 'aZ09'); $massaction = GETPOST('massaction', 'alpha'); @@ -79,6 +78,7 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x' $socid = GETPOST("socid", 'int'); // if ($user->societe_id) $socid=$user->societe_id; +$lettering = new lettering($db); $object = new Societe($db); $object->id = $socid; $result = $object->fetch($socid); @@ -87,39 +87,40 @@ if ($result < 0) setEventMessages($object->error, $object->errors, 'errors'); } -$form = new Form($db); -$BookKeeping = new lettering($db); -$formaccounting = new FormAccounting($db); - /* * Action */ if ($action == 'lettering') { - $result = $BookKeeping->updateLettrage($toselect); + $result = $lettering->updateLettrage($toselect); if ($result < 0) { - setEventMessages('', $BookKeeping->errors, 'errors'); + setEventMessages('', $lettering->errors, 'errors'); $error ++; } } if ($action == 'autolettrage') { - $result = $BookKeeping->lettering_thirdparty($socid); + $result = $lettering->lettering_thirdparty($socid); if ($result < 0) { - setEventMessages('', $BookKeeping->errors, 'errors'); + setEventMessages('', $lettering->errors, 'errors'); $error ++; } } -llxHeader('', 'Compta - Grand Livre'); - /* - * Affichage onglets + * View */ +$form = new Form($db); +$formaccounting = new FormAccounting($db); + +$title=$object->name." - ".$langs->trans('TabLetteringCustomer'); +$help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; +llxHeader('',$title,$help_url); + $head = societe_prepare_head($object); dol_htmloutput_mesg(is_numeric($error) ? '' : $error, $errors, 'error'); @@ -192,21 +193,19 @@ if ($resql) { print_liste_field_titre("Doctype", $_SERVER["PHP_SELF"], "bk.doc_type", "", $param, "", $sortfield, $sortorder); print_liste_field_titre("Docdate", $_SERVER["PHP_SELF"], "bk.doc_date", "", $param, "", $sortfield, $sortorder); print_liste_field_titre("Docref", $_SERVER["PHP_SELF"], "bk.doc_ref", "", $param, "", $sortfield, $sortorder); - print_liste_field_titre("Labelcompte", $_SERVER["PHP_SELF"], "bk.label_compte", "", $param, "", $sortfield, $sortorder); + print_liste_field_titre("LabelAccount", $_SERVER["PHP_SELF"], "bk.label_compte", "", $param, "", $sortfield, $sortorder); print_liste_field_titre("Debit", $_SERVER["PHP_SELF"], "bk.debit", "", $param, "", $sortfield, $sortorder); print_liste_field_titre("Credit", $_SERVER["PHP_SELF"], "bk.credit", "", $param, "", $sortfield, $sortorder); - print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "bk.montant", "", $param, "", $sortfield, $sortorder); - print_liste_field_titre("Sens", $_SERVER["PHP_SELF"], "bk.sens", "", $param, "", $sortfield, $sortorder); + print_liste_field_titre("Balancing", $_SERVER["PHP_SELF"], "", "", $param, "", $sortfield, $sortorder); print_liste_field_titre("Codejournal", $_SERVER["PHP_SELF"], "bk.code_journal", "", $param, "", $sortfield, $sortorder); - print_liste_field_titre("Solde", $_SERVER["PHP_SELF"], "", "", $param, "", $sortfield, $sortorder); - print ''; + print_liste_field_titre("LetteringCode", $_SERVER["PHP_SELF"], "bk.lettering_code", "", $param, "", $sortfield, $sortorder); print "\n"; print ''; print ''; print ''; print ''; - print ' '; + print ' '; print ''; $searchpicto = $form->showFilterButtons(); print $searchpicto; @@ -236,38 +235,36 @@ if ($resql) { print '' . dol_print_date($db->jdate($obj->doc_date), 'day') . ''; print '' . $obj->doc_ref . ''; print '' . $obj->label_compte . ''; - print '' . price($obj->debit) . ''; - print '' . price($obj->credit) . ''; - print '' . price($obj->montant) . ''; - print '' . $obj->sens . ''; - print '' . $obj->code_journal . ''; - print '' . round($solde, 2) . ''; + print '' . price($obj->debit) . ''; + print '' . price($obj->credit) . ''; + print '' . price(round($solde, 2)) . ''; + print '' . $obj->code_journal . ''; if (empty($obj->lettering_code)) { print ''; } else - print '' . $obj->lettering_code . ''; + print '' . $obj->lettering_code . ''; print "\n"; } print ''; - print 'Mouvement totaux' . "\n"; - print '' . price($debit) . ''; - print '' . price($credit) . ''; + print ''.$langs->trans("Total").':' . "\n"; + print '' . price($debit) . ''; + print '' . price($credit) . ''; print ''; print "\n"; print ''; - print 'Solde Comptable' . "\n"; - print '' . price($credit - $debit) . ''; - print ''; + print ''.$langs->trans("Balancing").':' . "\n"; + print '' . price($credit - $debit) . ''; + print ''; print "\n"; print ""; print ''; - print '' . $langs->trans('AccountancyAutoLettering') . ''; + //print '' . $langs->trans('AccountancyAutoLettering') . ''; print ""; $db->free($resql); } else { diff --git a/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php b/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php index b70d0a07242..6fdc5a26452 100644 --- a/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php +++ b/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php @@ -1,9 +1,9 @@ - * Copyright (C) 2005 Laurent Destailleur - * Copyright (C) 2013 Olivier Geffroy - * Copyright (C) 2013 Florian Henry - * Copyright (C) 2013 Alexandre Spangaro +/* Copyright (C) 2004-2005 Rodolphe Quiedeville + * Copyright (C) 2005 Laurent Destailleur + * Copyright (C) 2013 Olivier Geffroy + * Copyright (C) 2013 Florian Henry + * Copyright (C) 2013-2018 Alexandre Spangaro * * 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 @@ -21,14 +21,11 @@ */ /** - * \file accountancy/bookkeeping/thirdparty_lettrage_supplier.php - * \ingroup Advanced accountancy - * \brief Tab to setup lettering + * \file accountancy/bookkeeping/thirdparty_lettering_supplier.php + * \ingroup Advanced accountancy + * \brief Tab to setup lettering */ - -// Dolibarr environment require '../../main.inc.php'; - require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php'; require_once DOL_DOCUMENT_ROOT . '/accountancy/class/bookkeeping.class.php'; require_once DOL_DOCUMENT_ROOT . '/accountancy/class/lettering.class.php'; @@ -36,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; // Load translation files required by the page -$langs->loadLangs(array("compta")); +$langs->loadLangs(array("compta","accountancy")); $action = GETPOST('action', 'aZ09'); $massaction = GETPOST('massaction', 'alpha'); @@ -83,6 +80,7 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x', $socid = GETPOST("socid", 'int'); // if ($user->societe_id) $socid=$user->societe_id; +$lettering = new lettering($db); $object = new Societe($db); $object->id = $socid; $result = $object->fetch($socid); @@ -91,51 +89,39 @@ if ($result<0) setEventMessages($object->error, $object->errors, 'errors'); } -$form = new Form($db); -$BookKeeping = new lettering($db); -$formaccounting = new FormAccounting($db); - /* * Action */ if ($action == 'lettering') { - $result = $BookKeeping->updateLettrage($toselect); + $result = $lettering->updateLettrage($toselect); - // var_dump($result); if ($result < 0) { - setEventMessages('', $BookKeeping->errors, 'errors'); + setEventMessages('', $lettering->errors, 'errors'); $error ++; } } if ($action == 'autolettrage') { - $result = $BookKeeping->lettering_thirdparty($socid); + $result = $lettering->lettering_thirdparty($socid); if ($result < 0) { - setEventMessages('', $BookKeeping->errors, 'errors'); + setEventMessages('', $lettering->errors, 'errors'); $error ++; } } -$title = 'AccountancyLettrage'; - -llxHeader('', $title); - - -$param=''; -if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; -if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; -if (!empty($search_year)) $param.='&search_year='.$search_year; -if (!empty($socid)) $param.='&socid='.$socid; -if (!empty($search_doc_type)) $param.='&search_doc_type='.$search_doc_type; -if (!empty($search_doc_ref)) $param.='&search_doc_ref='.$search_doc_ref; - - /* - * Display tabs + * View */ +$form = new Form($db); +$formaccounting = new FormAccounting($db); + +$title=$object->name." - ".$langs->trans('TabLetteringSupplier'); +$help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; +llxHeader('',$title,$help_url); + $head = societe_prepare_head($object); dol_htmloutput_mesg(is_numeric($error) ? '' : $error, $errors, 'error'); @@ -210,21 +196,19 @@ if ($resql) { print_liste_field_titre("Doctype", $_SERVER["PHP_SELF"], "bk.doc_type","",$param,"",$sortfield,$sortorder); print_liste_field_titre("Docdate", $_SERVER["PHP_SELF"], "bk.doc_date","",$param,"",$sortfield,$sortorder); print_liste_field_titre("Docref", $_SERVER["PHP_SELF"], "bk.doc_ref","",$param,"",$sortfield,$sortorder); - print_liste_field_titre("Labelcompte", $_SERVER["PHP_SELF"], "bk.label_compte","",$param,"",$sortfield,$sortorder); + print_liste_field_titre("LabelAccount", $_SERVER["PHP_SELF"], "bk.label_compte","",$param,"",$sortfield,$sortorder); print_liste_field_titre("Debit", $_SERVER["PHP_SELF"], "bk.debit","",$param,"",$sortfield,$sortorder); print_liste_field_titre("Credit", $_SERVER["PHP_SELF"], "bk.credit","",$param,"",$sortfield,$sortorder); - print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "bk.montant","",$param,"",$sortfield,$sortorder); - print_liste_field_titre("Sens", $_SERVER["PHP_SELF"], "bk.sens","",$param,"",$sortfield,$sortorder); + print_liste_field_titre("Balancing", $_SERVER["PHP_SELF"], "","",$param,"",$sortfield,$sortorder); print_liste_field_titre("Codejournal", $_SERVER["PHP_SELF"], "bk.code_journal","",$param,"",$sortfield,$sortorder); - print_liste_field_titre("Solde", $_SERVER["PHP_SELF"], "","",$param,"",$sortfield,$sortorder); - print ''; + print_liste_field_titre("LetteringCode", $_SERVER["PHP_SELF"], "bk.lettering_code", "", $param, "", $sortfield, $sortorder); print "\n"; print ''; print ''; print ''; print ''; - print ' '; + print ' '; print ''; $searchpicto=$form->showFilterButtons(); print $searchpicto; @@ -254,39 +238,36 @@ if ($resql) { print '' . dol_print_date($db->jdate($obj->doc_date), 'day') . ''; print '' . $obj->doc_ref . ''; print '' . $obj->label_compte . ''; - print '' . price($obj->debit) . ''; - print '' . price($obj->credit) . ''; - print '' . price($obj->montant) . ''; - print '' . $obj->sens . ''; - print '' . $obj->code_journal . ''; - print '' . round($solde, 2) . ''; + print '' . price($obj->debit) . ''; + print '' . price($obj->credit) . ''; + print '' . price(round($solde, 2)) . ''; + print '' . $obj->code_journal . ''; if (empty($obj->lettering_code)) { print ''; } else - print '' . $obj->lettering_code . ''; + print '' . $obj->lettering_code . ''; print "\n"; } print ''; - - print 'Mouvement totaux' . "\n"; - print '' . price($debit) . ''; - print '' . price($credit) . ''; + print ''.$langs->trans("Total").':' . "\n"; + print '' . price($debit) . ''; + print '' . price($credit) . ''; print ''; print "\n"; print ''; - print 'Solde Comptable' . "\n"; - print '' . price($credit - $debit) . ''; - print ''; + print ''.$langs->trans("Balancing").':' . "\n"; + print '' . price($credit - $debit) . ''; + print ''; print "\n"; print ""; print ''; - print ''.$langs->trans('AccountancyAutoLettering').''; + //print ''.$langs->trans('AccountancyAutoLettering').''; print ""; $db->free($resql); } else { diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index 87d561b6add..6bbc4cce743 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -1,7 +1,7 @@ - * Copyright (C) 2015-2017 Alexandre Spangaro - * Copyright (C) 2015-2017 Florian Henry +/* Copyright (C) 2014-2017 Olivier Geffroy + * Copyright (C) 2015-2017 Alexandre Spangaro + * Copyright (C) 2015-2017 Florian Henry * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -19,9 +19,9 @@ */ /** - * \file htdocs/accountancy/class/bookkeeping.class.php - * \ingroup Advanced accountancy - * \brief File of class to manage Ledger (General Ledger and Subledger) + * \file htdocs/accountancy/class/bookkeeping.class.php + * \ingroup Advanced accountancy + * \brief File of class to manage Ledger (General Ledger and Subledger) */ // Class @@ -862,6 +862,7 @@ class BookKeeping extends CommonObject $sql .= " t.label_operation,"; $sql .= " t.debit,"; $sql .= " t.credit,"; + $sql .= " t.lettering_code,"; $sql .= " t.montant,"; $sql .= " t.sens,"; $sql .= " t.fk_user_author,"; @@ -934,6 +935,7 @@ class BookKeeping extends CommonObject $line->credit = $obj->credit; $line->montant = $obj->montant; $line->sens = $obj->sens; + $line->lettering_code = $obj->lettering_code; $line->fk_user_author = $obj->fk_user_author; $line->import_key = $obj->import_key; $line->code_journal = $obj->code_journal; diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang index e6215269512..e2f6083e6a6 100644 --- a/htdocs/langs/en_US/accountancy.lang +++ b/htdocs/langs/en_US/accountancy.lang @@ -226,6 +226,7 @@ AutomaticBindingDone=Automatic binding done ErrorAccountancyCodeIsAlreadyUse=Error, you cannot delete this accounting account because it is used MvtNotCorrectlyBalanced=Movement not correctly balanced. Debit = %s | Credit = %s +Balancing=Balancing FicheVentilation=Binding card GeneralLedgerIsWritten=Transactions are written in the Ledger GeneralLedgerSomeRecordWasNotRecorded=Some of the transactions could not be journalized. If there is no other error message, this is probably because they were already journalized. From 921757c4a3069c879464595608f4067dd0531e82 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sat, 20 Oct 2018 10:57:59 +0200 Subject: [PATCH 03/35] Fix travis --- .../accountancy/bookkeeping/thirdparty_lettering_customer.php | 2 +- .../accountancy/bookkeeping/thirdparty_lettering_supplier.php | 4 ++-- htdocs/accountancy/class/lettering.class.php | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php b/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php index 24532b86e35..08994e3853d 100644 --- a/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php +++ b/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php @@ -103,7 +103,7 @@ if ($action == 'lettering') { if ($action == 'autolettrage') { - $result = $lettering->lettering_thirdparty($socid); + $result = $lettering->letteringThirdparty($socid); if ($result < 0) { setEventMessages('', $lettering->errors, 'errors'); diff --git a/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php b/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php index 6fdc5a26452..0da446301c6 100644 --- a/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php +++ b/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php @@ -104,7 +104,7 @@ if ($action == 'lettering') { if ($action == 'autolettrage') { - $result = $lettering->lettering_thirdparty($socid); + $result = $lettering->letteringThirdparty($socid); if ($result < 0) { setEventMessages('', $lettering->errors, 'errors'); @@ -266,7 +266,7 @@ if ($resql) { print ""; - print ''; + print ''.$langs->trans('AccountancyLettering').''; //print ''.$langs->trans('AccountancyAutoLettering').''; print ""; $db->free($resql); diff --git a/htdocs/accountancy/class/lettering.class.php b/htdocs/accountancy/class/lettering.class.php index 220ed24d5d6..488941cbc02 100644 --- a/htdocs/accountancy/class/lettering.class.php +++ b/htdocs/accountancy/class/lettering.class.php @@ -32,12 +32,12 @@ include_once DOL_DOCUMENT_ROOT . "/core/lib/date.lib.php"; class lettering extends BookKeeping { /** - * lettering_thirdparty + * letteringThirdparty * * @param int $socid Thirdparty id * @return int 1 OK, <0 error */ - public function lettering_thirdparty($socid) + public function letteringThirdparty($socid) { global $conf; From a7de7013a11157ce646b03d2f3152460deb017f1 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sat, 20 Oct 2018 11:20:53 +0200 Subject: [PATCH 04/35] Update code --- .../thirdparty_lettering_customer.php | 21 ++++++++--------- .../thirdparty_lettering_supplier.php | 23 ++++++++----------- htdocs/accountancy/class/lettering.class.php | 2 +- 3 files changed, 20 insertions(+), 26 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php b/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php index 08994e3853d..0cab173823c 100644 --- a/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php +++ b/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php @@ -60,11 +60,10 @@ $search_year = GETPOST("search_year", 'int'); $search_doc_type = GETPOST("search_doc_type", 'alpha'); $search_doc_ref = GETPOST("search_doc_ref", 'alpha'); -$lettering = GETPOST('lettering'); +$lettering = GETPOST('lettering', 'alpha'); if (! empty($lettering)) { $action = $lettering; } -$toselect = GETPOST('toselect', 'array'); // Did we click on purge search criteria ? // All tests are required to be compatible with all browsers @@ -93,7 +92,7 @@ if ($result < 0) if ($action == 'lettering') { - $result = $lettering->updateLettrage($toselect); + $result = $lettering->updateLettering($toselect); if ($result < 0) { setEventMessages('', $lettering->errors, 'errors'); @@ -216,12 +215,8 @@ if ($resql) { $tmp = ''; while ( $obj = $db->fetch_object($resql) ) { - if ($tmp != $obj->lettering_code || empty($tmp)) - $tmp = $obj->lettering_code; - - if ($tmp != $obj->lettering_code || empty($obj->lettering_code)) - - $solde += ($obj->credit - $obj->debit); + if ($tmp != $obj->lettering_code || empty($tmp)) $tmp = $obj->lettering_code; + /*if ($tmp != $obj->lettering_code || empty($obj->lettering_code))*/ $solde += ($obj->credit - $obj->debit); print ''; @@ -229,8 +224,9 @@ if ($resql) { print ''; print img_edit(); print ' ' . $obj->doc_type . '' . "\n"; - } else + } else { print '' . $obj->doc_type . '' . "\n"; + } print '' . dol_print_date($db->jdate($obj->doc_date), 'day') . ''; print '' . $obj->doc_ref . ''; @@ -249,14 +245,15 @@ if ($resql) { } print ''; - print ''.$langs->trans("Total").':' . "\n"; + print ''.$langs->trans("Total").':' . "\n"; print '' . price($debit) . ''; print '' . price($credit) . ''; print ''; print "\n"; print ''; - print ''.$langs->trans("Balancing").':' . "\n"; + print ''.$langs->trans("Balancing").':' . "\n"; + print ' '; print '' . price($credit - $debit) . ''; print ''; print "\n"; diff --git a/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php b/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php index 0da446301c6..659643260f9 100644 --- a/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php +++ b/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php @@ -60,11 +60,10 @@ $search_year = GETPOST("search_year",'int'); $search_doc_type = GETPOST("search_doc_type",'alpha'); $search_doc_ref = GETPOST("search_doc_ref",'alpha'); -$lettering = GETPOST('lettering'); +$lettering = GETPOST('lettering', 'alpha'); if (!empty($lettering)) { $action=$lettering; } -$toselect = GETPOST('toselect','array'); // Did we click on purge search criteria ? // All tests are required to be compatible with all browsers @@ -94,7 +93,7 @@ if ($result<0) */ if ($action == 'lettering') { - $result = $lettering->updateLettrage($toselect); + $result = $lettering->updateLettering($toselect); if ($result < 0) { setEventMessages('', $lettering->errors, 'errors'); @@ -219,12 +218,8 @@ if ($resql) { $tmp = ''; while ($obj = $db->fetch_object($resql)) { - if ($tmp != $obj->lettering_code || empty($tmp)) - $tmp = $obj->lettering_code; - - if ($tmp != $obj->lettering_code || empty($obj->lettering_code)) - - $solde += ($obj->credit - $obj->debit); + if ($tmp != $obj->lettering_code || empty($tmp)) $tmp = $obj->lettering_code; + /*if ($tmp != $obj->lettering_code || empty($obj->lettering_code))*/ $solde += ($obj->credit - $obj->debit); print ''; @@ -232,8 +227,9 @@ if ($resql) { print ''; print img_edit(); print ' ' . $obj->doc_type . '' . "\n"; - } else + } else { print '' . $obj->doc_type . '' . "\n"; + } print '' . dol_print_date($db->jdate($obj->doc_date), 'day') . ''; print '' . $obj->doc_ref . ''; @@ -252,21 +248,22 @@ if ($resql) { } print ''; - print ''.$langs->trans("Total").':' . "\n"; + print ''.$langs->trans("Total").':' . "\n"; print '' . price($debit) . ''; print '' . price($credit) . ''; print ''; print "\n"; print ''; - print ''.$langs->trans("Balancing").':' . "\n"; + print ''.$langs->trans("Balancing").':' . "\n"; + print ' '; print '' . price($credit - $debit) . ''; print ''; print "\n"; print ""; - print ''.$langs->trans('AccountancyLettering').''; + print ''; //print ''.$langs->trans('AccountancyAutoLettering').''; print ""; $db->free($resql); diff --git a/htdocs/accountancy/class/lettering.class.php b/htdocs/accountancy/class/lettering.class.php index 488941cbc02..b6eeba24c01 100644 --- a/htdocs/accountancy/class/lettering.class.php +++ b/htdocs/accountancy/class/lettering.class.php @@ -229,7 +229,7 @@ class lettering extends BookKeeping * @param boolean $notrigger no trigger * @return number */ - public function updateLettrage($ids = array(), $notrigger = false) + public function updateLettering($ids = array(), $notrigger = false) { $error = 0; $lettre = 'AAA'; From 550dc622ca411bc3190a2d08c194640e2836e62d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 20 Oct 2018 13:40:40 +0200 Subject: [PATCH 05/35] code comment --- .../class/accountingaccount.class.php | 46 +++++++++++++------ 1 file changed, 32 insertions(+), 14 deletions(-) diff --git a/htdocs/accountancy/class/accountingaccount.class.php b/htdocs/accountancy/class/accountingaccount.class.php index 9030e65b049..85f9ee39c61 100644 --- a/htdocs/accountancy/class/accountingaccount.class.php +++ b/htdocs/accountancy/class/accountingaccount.class.php @@ -4,6 +4,7 @@ * Copyright (C) 2013-2014 Florian Henry * Copyright (C) 2014 Juanjo Menent * Copyright (C) 2015 Ari Elbaz (elarifr) + * Copyright (C) 2018 Frédéric France * * 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 @@ -30,6 +31,9 @@ */ class AccountingAccount extends CommonObject { + /** + * @var string Name of element + */ public $element='accounting_account'; /** @@ -59,16 +63,6 @@ class AccountingAccount extends CommonObject */ public $db; - /** - * @var string Error code (or message) - */ - public $error=''; - - /** - * @var string[] Error codes (or messages) - */ - public $errors = array(); - /** * @var int ID */ @@ -79,17 +73,39 @@ class AccountingAccount extends CommonObject */ public $rowid; - public $datec; // Creation date + /** + * @var string Creation date + */ + public $datec; /** - * @var int ID + * @var string pcg version */ public $fk_pcg_version; + /** + * @var string pcg type + */ public $pcg_type; + + /** + * @var string pcg subtype + */ public $pcg_subtype; + + /** + * @var string account number + */ public $account_number; + + /** + * @var int ID parent account + */ public $account_parent; + + /** + * @var int ID category account + */ public $account_category; /** @@ -112,8 +128,10 @@ class AccountingAccount extends CommonObject */ public $fk_user_modif; - public $active; // duplicate with status - + /** + * @var int active (duplicate with status) + */ + public $active; /** * Constructor From 4d72cafa52a31e504219197c848053f6118ddb22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 20 Oct 2018 13:47:51 +0200 Subject: [PATCH 06/35] code comment --- htdocs/api/class/api_setup.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/api/class/api_setup.class.php b/htdocs/api/class/api_setup.class.php index 304abf46432..60a51074d58 100644 --- a/htdocs/api/class/api_setup.class.php +++ b/htdocs/api/class/api_setup.class.php @@ -122,7 +122,7 @@ class Setup extends DolibarrApi * @param string $filter To filter the countries by name * @param string $lang Code of the language the label of the countries must be translated to * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)" - * @return List of countries + * @return array List of countries * * @url GET dictionary/countries * From fab10acc15f3f8e4350b71e1763786da21d42d6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 20 Oct 2018 16:23:43 +0200 Subject: [PATCH 07/35] change class name from lettering to Lettering --- htdocs/accountancy/class/lettering.class.php | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/htdocs/accountancy/class/lettering.class.php b/htdocs/accountancy/class/lettering.class.php index 70d7a88c55b..d37b29961f2 100644 --- a/htdocs/accountancy/class/lettering.class.php +++ b/htdocs/accountancy/class/lettering.class.php @@ -1,7 +1,8 @@ - * Copyright (C) 2013 Olivier Geffroy - * Copyright (C) 2013 Alexandre Spangaro +/* Copyright (C) 2004-2005 Rodolphe Quiedeville + * Copyright (C) 2013 Olivier Geffroy + * Copyright (C) 2013 Alexandre Spangaro + * Copyright (C) 2018 Frédéric France * * 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 @@ -18,8 +19,8 @@ */ /** - * \file accountancy/class/bookkeeping.class.php - * \ingroup Accounting Expert + * \file htdocs/accountancy/class/lettering.class.php + * \ingroup accountancy * \brief Fichier de la classe des comptes comptable */ @@ -29,9 +30,9 @@ include_once DOL_DOCUMENT_ROOT."/core/lib/date.lib.php"; /** - * Class lettering + * Class Lettering */ -class lettering extends BookKeeping +class Lettering extends BookKeeping { /** * lettrageTiers @@ -48,10 +49,10 @@ class lettering extends BookKeeping $object->fetch($socid); - if( $object->code_compta == '411CUSTCODE') + if ($object->code_compta == '411CUSTCODE') $object->code_compta = ''; - if( $object->code_compta_fournisseur == '401SUPPCODE') + if ($object->code_compta_fournisseur == '401SUPPCODE') $object->code_compta_fournisseur = ''; From d3022413ef2aa26c00d60a011a2b843b0324425e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 20 Oct 2018 16:25:57 +0200 Subject: [PATCH 08/35] Update thirdparty_lettrage.php --- htdocs/accountancy/bookkeeping/thirdparty_lettrage.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/accountancy/bookkeeping/thirdparty_lettrage.php b/htdocs/accountancy/bookkeeping/thirdparty_lettrage.php index 9ffffb4d1ed..8717f7b46a1 100644 --- a/htdocs/accountancy/bookkeeping/thirdparty_lettrage.php +++ b/htdocs/accountancy/bookkeeping/thirdparty_lettrage.php @@ -4,6 +4,7 @@ * Copyright (C) 2013 Olivier Geffroy * Copyright (C) 2013 Florian Henry * Copyright (C) 2013 Alexandre Spangaro + * Copyright (C) 2018 Frédéric France * * 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 @@ -63,7 +64,7 @@ $object->fetch($socid); $form = new Form($db); -$BookKeeping = new lettering($db); +$BookKeeping = new Lettering($db); $formaccounting = new FormAccounting($db); From 02954931d8c6b6e8525a8d4285c46f23ba901828 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 20 Oct 2018 16:27:15 +0200 Subject: [PATCH 09/35] Update thirdparty_lettrage_supplier.php --- .../bookkeeping/thirdparty_lettrage_supplier.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/thirdparty_lettrage_supplier.php b/htdocs/accountancy/bookkeeping/thirdparty_lettrage_supplier.php index 05315fe13ad..8fa6cd4a3d5 100644 --- a/htdocs/accountancy/bookkeeping/thirdparty_lettrage_supplier.php +++ b/htdocs/accountancy/bookkeeping/thirdparty_lettrage_supplier.php @@ -4,6 +4,7 @@ * Copyright (C) 2013 Olivier Geffroy * Copyright (C) 2013 Florian Henry * Copyright (C) 2013 Alexandre Spangaro + * Copyright (C) 2018 Frédéric France * * 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 @@ -21,8 +22,8 @@ */ /** - * \file accounting/bookkeeping/thirdparty_lettrage.php - * \ingroup Accounting Expert + * \file htdocs/accountancy/bookkeeping/thirdparty_lettrage_supplier.php + * \ingroup accountancy * \brief Onglet de gestion de parametrages des ventilations */ @@ -65,7 +66,7 @@ $object->id = $socid; $object->fetch($socid); $form = new Form($db); -$BookKeeping = new lettering($db); +$BookKeeping = new Lettering($db); $formaccounting = new FormAccounting($db); From 5f6cbda5a6489e7a41c4062ee1f4807184f56dba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 20 Oct 2018 22:34:00 +0200 Subject: [PATCH 10/35] Update facture.class.php --- htdocs/compta/facture/class/facture.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index fcbee2da90e..20983ebd3c9 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -990,6 +990,7 @@ class Facture extends CommonInvoice $this->user_valid = ''; $this->fk_facture_source = 0; $this->date_creation = ''; + $this->date_modification = ''; $this->date_validation = ''; $this->ref_client = ''; $this->close_code = ''; From 80bd93d600b3cc0847afbb416483054e121bf75f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 20 Oct 2018 22:36:12 +0200 Subject: [PATCH 11/35] Update .travis.yml --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 4b17ebaf0c8..9c001a480d9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -298,7 +298,7 @@ script: set -e # Exclusions are defined in the ruleset.xml file #phpcs -s -n -p -d memory_limit=-1 --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 . - phpcs -s -p -d memory_limit=-1 --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 --runtime-set ignore_warnings_on_exit true . + #phpcs -s -p -d memory_limit=-1 --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 --runtime-set ignore_warnings_on_exit true . set +e echo From f9a3dec26d2efa920840d7096a185f647938e0f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 20 Oct 2018 22:48:46 +0200 Subject: [PATCH 12/35] Update FactureTest.php --- .travis.yml | 4 ++-- test/phpunit/FactureTest.php | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9c001a480d9..96a238e6ad4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,7 @@ # from Dolibarr GitHub repository. # For syntax, see http://about.travis-ci.org/docs/user/languages/php/ -# We use dist: trusty to have php 5.4+ available +# We use dist: trusty to have php 5.4+ available dist: trusty sudo: required @@ -298,7 +298,7 @@ script: set -e # Exclusions are defined in the ruleset.xml file #phpcs -s -n -p -d memory_limit=-1 --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 . - #phpcs -s -p -d memory_limit=-1 --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 --runtime-set ignore_warnings_on_exit true . + phpcs -s -p -d memory_limit=-1 --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 --runtime-set ignore_warnings_on_exit true . set +e echo diff --git a/test/phpunit/FactureTest.php b/test/phpunit/FactureTest.php index d04844783c5..a1dd46de978 100644 --- a/test/phpunit/FactureTest.php +++ b/test/phpunit/FactureTest.php @@ -1,5 +1,6 @@ +/* Copyright (C) 2010 Laurent Destailleur + * Copyright (C) 2018 Frédéric France * * 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 @@ -228,7 +229,7 @@ class FactureTest extends PHPUnit_Framework_TestCase $newlocalobject, true, array( - 'newref','oldref','id','lines','client','thirdparty','brouillon','user_author','date_creation','date_validation','datem', + 'newref','oldref','id','lines','client','thirdparty','brouillon','user_author','date_creation','date_validation','datem','date_modification', 'ref','statut','paye','specimen','facnumber','actiontypecode','actionmsg2','actionmsg','mode_reglement','cond_reglement', 'cond_reglement_doc','situation_cycle_ref','situation_counter','situation_final','multicurrency_total_ht','multicurrency_total_tva', 'multicurrency_total_ttc','fk_multicurrency','multicurrency_code','multicurrency_tx' From f169ec9259a5876452195b89a9787a6f80e7c4dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 21 Oct 2018 10:37:49 +0200 Subject: [PATCH 13/35] Update ajaxdirtree.php --- htdocs/core/ajax/ajaxdirtree.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/core/ajax/ajaxdirtree.php b/htdocs/core/ajax/ajaxdirtree.php index fc01474a072..0f3ac26693a 100644 --- a/htdocs/core/ajax/ajaxdirtree.php +++ b/htdocs/core/ajax/ajaxdirtree.php @@ -1,5 +1,6 @@ +/* Copyright (C) 2007-2018 Laurent Destailleur + * Copyright (C) 2018 Frédéric France * * 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 +75,7 @@ if ($modulepart == 'ecm') $fullpathselecteddir=$conf->ecm->dir_output.'/'.($selecteddir != '/' ? $selecteddir : ''); $fullpathpreopened=$conf->ecm->dir_output.'/'.($preopened != '/' ? $preopened : ''); } -if ($modulepart == 'medias') +elseif ($modulepart == 'medias') { $fullpathselecteddir=$dolibarr_main_data_root.'/medias/'.($selecteddir != '/' ? $selecteddir : ''); $fullpathpreopened=$dolibarr_main_data_root.'/medias/'.($preopened != '/' ? $preopened : ''); @@ -96,7 +97,7 @@ if ($modulepart == 'ecm') { if (! $user->rights->ecm->read) accessforbidden(); } -if ($modulepart == 'medias') +elseif ($modulepart == 'medias') { // Always allowed } @@ -349,7 +350,7 @@ function treeOutputForAbsoluteDir($sqltree, $selecteddir, $fullpathselecteddir, { $files = @scandir($fullpathselecteddir); - if ($files) + if (! empty($files)) { natcasesort($files); if (count($files) > 2) /* The 2 accounts for . and .. */ From 0171301543a810dbb4071524e198914971eb2d9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 21 Oct 2018 19:19:35 +0200 Subject: [PATCH 14/35] code comment categories class --- htdocs/categories/class/categorie.class.php | 24 ++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index a9432234793..a7ddab761e0 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -76,6 +76,10 @@ class Categorie extends CommonObject 'user' => 7, 'bank_line' => 8, ); + + /** + * @var array Code mapping from ID + */ public static $MAP_ID_TO_CODE = array( 0 => 'product', 1 => 'supplier', @@ -104,7 +108,8 @@ class Categorie extends CommonObject 'bank_account' => 'account', 'project' => 'project', ); - /** + + /** * @var array Category tables mapping from type string * * @note Move to const array when PHP 5.6 will be our minimum target @@ -120,7 +125,8 @@ class Categorie extends CommonObject 'bank_account'=> 'account', 'project' => 'project', ); - /** + + /** * @var array Object class mapping from type string * * @note Move to const array when PHP 5.6 will be our minimum target @@ -136,7 +142,8 @@ class Categorie extends CommonObject 'bank_account' => 'Account', 'project' => 'Project', ); - /** + + /** * @var array Object table mapping from type string * * @note Move to const array when PHP 5.6 will be our minimum target @@ -199,7 +206,14 @@ class Categorie extends CommonObject */ public $type; - public $cats = array(); // Categories table in memory + /** + * @var array Categories table in memory + */ + public $cats = array(); + + /** + * @var array Mother of table + */ public $motherof = array(); /** @@ -1360,7 +1374,7 @@ class Categorie extends CommonObject * @param string|int $type Type of category ('customer', 'supplier', 'contact', 'product', 'member') or (0, 1, 2, ...) * @param string $mode 'id'=Get array of category ids, 'object'=Get array of fetched category instances, 'label'=Get array of category * labels, 'id'= Get array of category IDs - * @return mixed Array of category objects or < 0 if KO + * @return array|int Array of category objects or < 0 if KO */ function containing($id, $type, $mode='object') { From 59307165ce766e814fd4c0a3462b1e1369c6db8b Mon Sep 17 00:00:00 2001 From: De Coninck Laurent Date: Sun, 21 Oct 2018 19:45:33 +0200 Subject: [PATCH 15/35] fix the pdf merge fix the pdf merge. [See: #9824] --- htdocs/includes/tcpdi/tcpdi_parser.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/includes/tcpdi/tcpdi_parser.php b/htdocs/includes/tcpdi/tcpdi_parser.php index 038994568ac..cdeaf4f94e6 100644 --- a/htdocs/includes/tcpdi/tcpdi_parser.php +++ b/htdocs/includes/tcpdi/tcpdi_parser.php @@ -484,7 +484,7 @@ class tcpdi_parser { $v = $sarr[$key]; if (($key == '/Type') AND ($v[0] == PDF_TYPE_TOKEN AND ($v[1] == 'XRef'))) { $valid_crs = true; - } elseif (($key == '/Index') AND ($v[0] == PDF_TYPE_ARRAY AND count($v[1] >= 2))) { + } elseif (($key == '/Index') AND ($v[0] == PDF_TYPE_ARRAY AND count($v[1]) >= 2)) { // first object number in the subsection $index_first = intval($v[1][0][1]); // number of entries in the subsection From 930dce76112d31e9a18c70bd451d6691059e532d Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 22 Oct 2018 06:39:23 +0200 Subject: [PATCH 16/35] change class name from lettering to Lettering --- .../bookkeeping/thirdparty_lettering_customer.php | 7 ++++--- .../bookkeeping/thirdparty_lettering_supplier.php | 7 ++++--- htdocs/accountancy/class/lettering.class.php | 9 +++++---- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php b/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php index 0cab173823c..b71ce5860f0 100644 --- a/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php +++ b/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php @@ -4,6 +4,7 @@ * Copyright (C) 2013 Olivier Geffroy * Copyright (C) 2013 Florian Henry * Copyright (C) 2013-2018 Alexandre Spangaro + * Copyright (C) 2018 Frédéric France * * 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 @@ -21,8 +22,8 @@ */ /** - * \file accountancy/bookkeeping/thirdparty_lettering_customer.php - * \ingroup Advanced accountancy + * \file htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php + * \ingroup accountancy * \brief Tab to manage customer lettering */ require '../../main.inc.php'; @@ -77,7 +78,7 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x' $socid = GETPOST("socid", 'int'); // if ($user->societe_id) $socid=$user->societe_id; -$lettering = new lettering($db); +$lettering = new Lettering($db); $object = new Societe($db); $object->id = $socid; $result = $object->fetch($socid); diff --git a/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php b/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php index 659643260f9..eaeefcca8a8 100644 --- a/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php +++ b/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php @@ -4,6 +4,7 @@ * Copyright (C) 2013 Olivier Geffroy * Copyright (C) 2013 Florian Henry * Copyright (C) 2013-2018 Alexandre Spangaro + * Copyright (C) 2018 Frédéric France * * 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 @@ -21,8 +22,8 @@ */ /** - * \file accountancy/bookkeeping/thirdparty_lettering_supplier.php - * \ingroup Advanced accountancy + * \file htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php + * \ingroup accountancy * \brief Tab to setup lettering */ require '../../main.inc.php'; @@ -79,7 +80,7 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x', $socid = GETPOST("socid", 'int'); // if ($user->societe_id) $socid=$user->societe_id; -$lettering = new lettering($db); +$lettering = new Lettering($db); $object = new Societe($db); $object->id = $socid; $result = $object->fetch($socid); diff --git a/htdocs/accountancy/class/lettering.class.php b/htdocs/accountancy/class/lettering.class.php index b6eeba24c01..db943029acc 100644 --- a/htdocs/accountancy/class/lettering.class.php +++ b/htdocs/accountancy/class/lettering.class.php @@ -2,6 +2,7 @@ /* Copyright (C) 2004-2005 Rodolphe Quiedeville * Copyright (C) 2013 Olivier Geffroy * Copyright (C) 2013-2018 Alexandre Spangaro + * Copyright (C) 2018 Frédéric France * * 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 @@ -18,8 +19,8 @@ */ /** - * \file accountancy/class/bookkeeping.class.php - * \ingroup Advanced accountancy + * \file htdocs/accountancy/class/lettering.class.php + * \ingroup accountancy * \brief File of class for lettering */ include_once DOL_DOCUMENT_ROOT . "/accountancy/class/bookkeeping.class.php"; @@ -27,9 +28,9 @@ include_once DOL_DOCUMENT_ROOT . "/societe/class/societe.class.php"; include_once DOL_DOCUMENT_ROOT . "/core/lib/date.lib.php"; /** - * Class lettering + * Class Lettering */ -class lettering extends BookKeeping +class Lettering extends BookKeeping { /** * letteringThirdparty From 38df6ac27b529057c4bdb1820d164e2ed946612f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 22 Oct 2018 21:57:18 +0200 Subject: [PATCH 17/35] remove deprecated form_confirm --- htdocs/expensereport/card.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index e19c7a841e1..d877ad00b2f 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -1589,49 +1589,49 @@ else if ($action == 'save') { - $formconfirm=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("SaveTrip"),$langs->trans("ConfirmSaveTrip"),"confirm_validate","","",1); + $formconfirm=$form->formconfirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("SaveTrip"),$langs->trans("ConfirmSaveTrip"),"confirm_validate","","",1); } if ($action == 'save_from_refuse') { - $formconfirm=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("SaveTrip"),$langs->trans("ConfirmSaveTrip"),"confirm_save_from_refuse","","",1); + $formconfirm=$form->formconfirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("SaveTrip"),$langs->trans("ConfirmSaveTrip"),"confirm_save_from_refuse","","",1); } if ($action == 'delete') { - $formconfirm=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("DeleteTrip"),$langs->trans("ConfirmDeleteTrip"),"confirm_delete","","",1); + $formconfirm=$form->formconfirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("DeleteTrip"),$langs->trans("ConfirmDeleteTrip"),"confirm_delete","","",1); } if ($action == 'validate') { - $formconfirm=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("ValideTrip"),$langs->trans("ConfirmValideTrip"),"confirm_approve","","",1); + $formconfirm=$form->formconfirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("ValideTrip"),$langs->trans("ConfirmValideTrip"),"confirm_approve","","",1); } if ($action == 'paid') { - $formconfirm=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("PaidTrip"),$langs->trans("ConfirmPaidTrip"),"confirm_paid","","",1); + $formconfirm=$form->formconfirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("PaidTrip"),$langs->trans("ConfirmPaidTrip"),"confirm_paid","","",1); } if ($action == 'cancel') { $array_input = array('text'=>$langs->trans("ConfirmCancelTrip"), array('type'=>"text",'label'=>$langs->trans("Comment"),'name'=>"detail_cancel",'size'=>"50",'value'=>"")); - $formconfirm=$form->form_confirm($_SEVER["PHP_SELF"]."?id=".$id,$langs->trans("Cancel"),"","confirm_cancel",$array_input,"",1); + $formconfirm=$form->formconfirm($_SEVER["PHP_SELF"]."?id=".$id,$langs->trans("Cancel"),"","confirm_cancel",$array_input,"",1); } if ($action == 'brouillonner') { - $formconfirm=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("BrouillonnerTrip"),$langs->trans("ConfirmBrouillonnerTrip"),"confirm_brouillonner","","",1); + $formconfirm=$form->formconfirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("BrouillonnerTrip"),$langs->trans("ConfirmBrouillonnerTrip"),"confirm_brouillonner","","",1); } if ($action == 'refuse') // Deny { $array_input = array('text'=>$langs->trans("ConfirmRefuseTrip"), array('type'=>"text",'label'=>$langs->trans("Comment"),'name'=>"detail_refuse",'size'=>"50",'value'=>"")); - $formconfirm=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("Deny"),'',"confirm_refuse",$array_input,"yes",1); + $formconfirm=$form->formconfirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("Deny"),'',"confirm_refuse",$array_input,"yes",1); } if ($action == 'delete_line') { - $formconfirm=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$id."&rowid=".GETPOST('rowid','int'),$langs->trans("DeleteLine"),$langs->trans("ConfirmDeleteLine"),"confirm_delete_line",'','yes',1); + $formconfirm=$form->formconfirm($_SERVER["PHP_SELF"]."?id=".$id."&rowid=".GETPOST('rowid','int'),$langs->trans("DeleteLine"),$langs->trans("ConfirmDeleteLine"),"confirm_delete_line",'','yes',1); } // Print form confirm From 4aec343b2410e4b1029a13b026eef9c3c440cc0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 22 Oct 2018 22:13:54 +0200 Subject: [PATCH 18/35] Update html.form.class.php --- htdocs/core/class/html.form.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 1cc02f0939a..00184499a9f 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -3899,7 +3899,7 @@ class Form $formconfirm.= ($question ? '
'.img_help('','').' '.$question . '
': ''); $formconfirm.= ''."\n"; - $formconfirm.= "\n\n"; + $formconfirm.= "\n\n"; $formconfirm.= ''; - $formconfirm.= "\n"; + $formconfirm.= "\n"; } else { - $formconfirm.= "\n\n"; + $formconfirm.= "\n\n"; if (empty($disableformtag)) $formconfirm.= '
'."\n"; @@ -4008,7 +4008,7 @@ class Form if (empty($disableformtag)) $formconfirm.= "
\n"; $formconfirm.= '
'; - $formconfirm.= "\n"; + $formconfirm.= "\n"; } return $formconfirm; From e49f2bc5624e75c73c0826721ded739846dbf9a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 22 Oct 2018 22:20:26 +0200 Subject: [PATCH 19/35] Update document_actions_post_headers.tpl.php --- htdocs/core/tpl/document_actions_post_headers.tpl.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/core/tpl/document_actions_post_headers.tpl.php b/htdocs/core/tpl/document_actions_post_headers.tpl.php index aa7caaa1e87..429fe8ac682 100644 --- a/htdocs/core/tpl/document_actions_post_headers.tpl.php +++ b/htdocs/core/tpl/document_actions_post_headers.tpl.php @@ -52,7 +52,7 @@ if (in_array($modulepart, array('product', 'produit', 'societe', 'user', 'ticket if ($action == 'delete') { $langs->load("companies"); // Need for string DeleteFile+ConfirmDeleteFiles - $ret = $form->form_confirm( + print $form->formconfirm( $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&urlfile=' . urlencode(GETPOST("urlfile")) . '&linkid=' . GETPOST('linkid', 'int') . (empty($param)?'':$param), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), @@ -61,7 +61,6 @@ if ($action == 'delete') 0, 1 ); - if ($ret == 'html') print '
'; } $formfile=new FormFile($db); From 90b85c1106efc19855301f2186a97f3aa23f6db7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 22 Oct 2018 22:23:43 +0200 Subject: [PATCH 20/35] Update html.form.class.php --- htdocs/core/class/html.form.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 00184499a9f..03e339eebf4 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -3722,6 +3722,7 @@ class Form function form_confirm($page, $title, $question, $action, $formquestion='', $selectedchoice="", $useajax=0, $height=170, $width=500) { // phpcs:enable + dol_syslog(__METHOD__ . ': using form_confirm is deprecated. Use formconfim instead.', LOG_WARNING); print $this->formconfirm($page, $title, $question, $action, $formquestion, $selectedchoice, $useajax, $height, $width); } From 85a94ec5779460b09b3c938969a32f33dd22d176 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 22 Oct 2018 22:40:18 +0200 Subject: [PATCH 21/35] Update view.php --- htdocs/public/ticket/view.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/htdocs/public/ticket/view.php b/htdocs/public/ticket/view.php index b2bb0100d6d..b5288b97a25 100644 --- a/htdocs/public/ticket/view.php +++ b/htdocs/public/ticket/view.php @@ -1,5 +1,6 @@ +/* Copyright (C) 2013-2016 Jean-François FERRY + * Copyright (C) 2018 Frédéric France * * 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,10 +146,7 @@ if ($action == "view_ticket" || $action == "add_message" || $action == "close" | if ($display_ticket) { // Confirmation close if ($action == 'close') { - $ret = $form->form_confirm($_SERVER["PHP_SELF"] . "?track_id=" . $track_id, $langs->trans("CloseATicket"), $langs->trans("ConfirmCloseAticket"), "confirm_public_close", '', '', 1); - if ($ret == 'html') { - print '
'; - } + print $form->form_confirm($_SERVER["PHP_SELF"] . "?track_id=" . $track_id, $langs->trans("CloseATicket"), $langs->trans("ConfirmCloseAticket"), "confirm_public_close", '', '', 1); } print '
'; From 5bac6a92e66b2893e30aee4ec9e6d8416d2f9b70 Mon Sep 17 00:00:00 2001 From: Abbes Bahfir Date: Tue, 23 Oct 2018 00:00:05 +0100 Subject: [PATCH 22/35] Fix:empty value instead of 0 for empty links --- htdocs/core/class/commonobject.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 2650c48b573..197f61735c3 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -6219,6 +6219,7 @@ abstract class CommonObject return 'Error bad setup of extrafield'; } } + else $value=''; } elseif ($type == 'text' || $type == 'html') { From 7e7473e7df80d9e4696911b30d9aad9afd68f8ff Mon Sep 17 00:00:00 2001 From: Abbes Bahfir Date: Tue, 23 Oct 2018 01:25:26 +0100 Subject: [PATCH 23/35] New : parameter for getnomurl in field dpecification --- htdocs/core/class/commonobject.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 2650c48b573..bfb657f6216 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -6203,6 +6203,7 @@ abstract class CommonObject $InfoFieldList = explode(":", $param_list[0]); $classname=$InfoFieldList[0]; $classpath=$InfoFieldList[1]; + $getnomurlparam=$InfoFieldList[2]; if (! empty($classpath)) { dol_include_once($InfoFieldList[1]); @@ -6210,7 +6211,7 @@ abstract class CommonObject { $object = new $classname($this->db); $object->fetch($value); - $value=$object->getNomUrl(3); + $value=$object->getNomUrl(!empty($getnomurlparam)?$getnomurlparam:3); } } else From e0b20c26329343df363624f09fa8a76a68feefd4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 23 Oct 2018 12:49:48 +0200 Subject: [PATCH 24/35] Add holiday for India --- htdocs/core/lib/date.lib.php | 42 +++++++++++++----------------------- 1 file changed, 15 insertions(+), 27 deletions(-) diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index f75e53939a2..84048ac9c66 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -585,6 +585,7 @@ function num_public_holiday($timestampStart, $timestampEnd, $countrycode='FR', $ { $ferie=false; $countryfound=0; + $includesaturdayandsunday=1; $jour = date("d", $timestampStart); $mois = date("m", $timestampStart); @@ -671,12 +672,6 @@ function num_public_holiday($timestampStart, $timestampEnd, $countrycode='FR', $ $mois_pentecote = date("m", $date_pentecote); if($jour_pentecote == $jour && $mois_pentecote == $mois) $ferie=true; // "Pentecote" - - // Calul des samedis et dimanches - $jour_julien = unixtojd($timestampStart); - $jour_semaine = jddayofweek($jour_julien, 0); - if($jour_semaine == 0 || $jour_semaine == 6) $ferie=true; - // Samedi (6) et dimanche (0) } // Pentecoste and Ascensione in Italy go to the sunday after: isn't holiday. @@ -703,12 +698,18 @@ function num_public_holiday($timestampStart, $timestampEnd, $countrycode='FR', $ $mois_paques = date("m", $date_paques); if($jour_paques == $jour && $mois_paques == $mois) $ferie=true; // Paques + } - // Calul des samedis et dimanches - $jour_julien = unixtojd($timestampStart); - $jour_semaine = jddayofweek($jour_julien, 0); - if($jour_semaine == 0 || $jour_semaine == 6) $ferie=true; - //Samedi (6) et dimanche (0) + if ($countrycode == 'IN') + { + $countryfound=1; + + if($jour == 1 && $mois == 1) $ferie=true; // New Year's Day + if($jour == 26 && $mois == 1) $ferie=true; // Republic Day + if($jour == 1 && $mois == 5) $ferie=true; // May Day + if($jour == 15 && $mois == 8) $ferie=true; // Independence Day + if($jour == 2 && $mois == 10) $ferie=true; // Gandhi Jayanti + if($jour == 25 && $mois == 12) $ferie=true; // Christmas } if ($countrycode == 'ES') @@ -746,12 +747,6 @@ function num_public_holiday($timestampStart, $timestampEnd, $countrycode='FR', $ $mois_viernes = date("m", $date_viernes); if($jour_viernes == $jour && $mois_viernes == $mois) $ferie=true; //Viernes Santo - - // Calul des samedis et dimanches - $jour_julien = unixtojd($timestampStart); - $jour_semaine = jddayofweek($jour_julien, 0); - if($jour_semaine == 0 || $jour_semaine == 6) $ferie=true; - //Samedi (6) et dimanche (0) } if ($countrycode == 'AT') @@ -833,22 +828,15 @@ function num_public_holiday($timestampStart, $timestampEnd, $countrycode='FR', $ $mois_fronleichnam = date("m", $date_fronleichnam); if($jour_fronleichnam == $jour && $mois_fronleichnam == $mois) $ferie=true; // Fronleichnam - - // Calul des samedis et dimanches - $jour_julien = unixtojd($timestampStart); - $jour_semaine = jddayofweek($jour_julien, 0); - if($jour_semaine == 0 || $jour_semaine == 6) $ferie=true; - //Samedi (6) et dimanche (0) } - // Cas pays non defini - if (! $countryfound) + // If we have to include saturday and sunday + if ($includesaturdayandsunday) { - // Calul des samedis et dimanches $jour_julien = unixtojd($timestampStart); $jour_semaine = jddayofweek($jour_julien, 0); if($jour_semaine == 0 || $jour_semaine == 6) $ferie=true; - //Samedi (6) et dimanche (0) + //Saturday (6) and Sunday (0) } // On incremente compteur From e40ee879dcfa23cd96ff1da6f5a9d75fa918f863 Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Tue, 23 Oct 2018 13:07:09 +0200 Subject: [PATCH 25/35] New: works with variants: - If product is variant disable prices modify - Add function isVariant for knowing if product is a Variant --- htdocs/langs/en_US/products.lang | 1 + htdocs/product/class/product.class.php | 30 ++++++++++++++++ htdocs/product/price.php | 47 ++++++++++++++------------ 3 files changed, 56 insertions(+), 22 deletions(-) diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang index 8390eb5439d..95b93aba4e9 100644 --- a/htdocs/langs/en_US/products.lang +++ b/htdocs/langs/en_US/products.lang @@ -331,6 +331,7 @@ NbProducts=No. of products ParentProduct=Parent product HideChildProducts=Hide variant products ShowChildProducts=Show variant products +NoEditVariants=Go to Parent product card and edit variants price impact in the variants tab ConfirmCloneProductCombinations=Would you like to copy all the product variants to the other parent product with the given reference? CloneDestinationReference=Destination product reference ErrorCopyProductCombinations=There was an error while copying the product variants diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 2d2e7b75ed2..f8326a60721 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -3529,6 +3529,36 @@ class Product extends CommonObject return $nb; } + + /** + * Return if loaded product is a variant + * + * @return int + */ + function isVariant() + { + global $conf; + if (!empty($conf->variants->enabled)) { + $sql = "SELECT rowid FROM " . MAIN_DB_PREFIX . "product_attribute_combination WHERE fk_product_child = " . $this->id . " AND entity IN (" . getEntity('product') . ")"; + + $query = $this->db->query($sql); + + if ($query) { + if (!$this->db->num_rows($query)) { + return false; + } + return true; + } else { + dol_print_error($this->db); + return -1; + } + + } else { + return false; + } + + } + /** * Return all parent products for current product (first level only) * diff --git a/htdocs/product/price.php b/htdocs/product/price.php index a72ea28928b..9fb67aaa86c 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -5,7 +5,7 @@ * Copyright (C) 2005-2017 Regis Houssin * Copyright (C) 2006 Andre Cianfarani * Copyright (C) 2014 Florian Henry - * Copyright (C) 2014-2016 Juanjo Menent + * Copyright (C) 2014-2018 Juanjo Menent * Copyright (C) 2014-2018 Philippe Grand * Copyright (C) 2014 Ion agorria * Copyright (C) 2015 Alexandre Spangaro @@ -1109,30 +1109,33 @@ if (! $action || $action == 'delete' || $action == 'showlog_customer_price' || $ { print "\n" . '
' . "\n"; - if (empty($conf->global->PRODUIT_MULTIPRICES) && empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) - { - if ($user->rights->produit->creer || $user->rights->service->creer) { - print ''; - } - } + if ($object->isVariant()) { + if ($user->rights->produit->creer || $user->rights->service->creer) { + print ''; + } + } else { + if (empty($conf->global->PRODUIT_MULTIPRICES) && empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) { + if ($user->rights->produit->creer || $user->rights->service->creer) { + print ''; + } + } - if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) - { - if ($user->rights->produit->creer || $user->rights->service->creer) { - print ''; - } - } + if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { + if ($user->rights->produit->creer || $user->rights->service->creer) { + print ''; + } + } - if (! empty($conf->global->PRODUIT_MULTIPRICES) || ! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) - { - if ($user->rights->produit->creer || $user->rights->service->creer) { - print ''; - } + if (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) { + if ($user->rights->produit->creer || $user->rights->service->creer) { + print ''; + } - if ($user->rights->produit->creer || $user->rights->service->creer) { - print ''; - } - } + if ($user->rights->produit->creer || $user->rights->service->creer) { + print ''; + } + } + } print "\n
\n"; } From d9965d19864f7d0dda16b8aeb0710fb24023f581 Mon Sep 17 00:00:00 2001 From: John BOTELLA Date: Tue, 23 Oct 2018 17:18:30 +0200 Subject: [PATCH 26/35] Fix travis messages --- .../commande/doc/pdf_eratosthene.modules.php | 17 +++++++++++------ .../modules/facture/doc/pdf_sponge.modules.php | 15 ++++++++++----- .../modules/propale/doc/pdf_cyan.modules.php | 13 ++++++++----- 3 files changed, 29 insertions(+), 16 deletions(-) diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php index 89297d1bdc6..0a14e50326d 100644 --- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php @@ -145,7 +145,7 @@ class pdf_eratosthene extends ModelePDFCommandes $this->atleastonediscount=0; } - /** + /** phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps * Function to build pdf onto disk * * @param Object $object Object to generate @@ -158,6 +158,7 @@ class pdf_eratosthene extends ModelePDFCommandes */ function write_file($object, $outputlangs, $srctemplatepath='', $hidedetails=0, $hidedesc=0, $hideref=0) { + // phpcs:enable global $user, $langs, $conf, $mysoc, $db, $hookmanager, $nblignes; if (! is_object($outputlangs)) $outputlangs=$langs; @@ -711,7 +712,7 @@ class pdf_eratosthene extends ModelePDFCommandes } } - /** + /** phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps * Show payments table * * @param TCPDF $pdf Object PDF @@ -722,11 +723,12 @@ class pdf_eratosthene extends ModelePDFCommandes */ function _tableau_versements(&$pdf, $object, $posy, $outputlangs) { - + // phpcs:enable + } - /** + /** phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps * Show miscellaneous information (payment mode, payment term, ...) * * @param TCPDF $pdf Object PDF @@ -737,6 +739,7 @@ class pdf_eratosthene extends ModelePDFCommandes */ function _tableau_info(&$pdf, $object, $posy, $outputlangs) { + // phpcs:enable global $conf; $default_font_size = pdf_getPDFFontSize($outputlangs); @@ -912,7 +915,7 @@ class pdf_eratosthene extends ModelePDFCommandes } - /** + /** phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps * Show total to pay * * @param TCPDF $pdf Object PDF @@ -924,6 +927,7 @@ class pdf_eratosthene extends ModelePDFCommandes */ function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs) { + // phpcs:enable global $conf,$mysoc; $default_font_size = pdf_getPDFFontSize($outputlangs); @@ -1485,7 +1489,8 @@ class pdf_eratosthene extends ModelePDFCommandes * @param int $hideref Do not show ref * @return null */ - function defineColumnField($object,$outputlangs,$hidedetails=0,$hidedesc=0,$hideref=0){ + function defineColumnField($object,$outputlangs,$hidedetails=0,$hidedesc=0,$hideref=0) + { global $conf, $hookmanager; diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index ca27bd09aff..2a5aeb3fadd 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -159,7 +159,7 @@ class pdf_sponge extends ModelePDFFactures } - /** + /** phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps * Function to build pdf onto disk * * @param Object $object Object to generate @@ -172,6 +172,7 @@ class pdf_sponge extends ModelePDFFactures */ function write_file($object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hidedesc=0,$hideref=0) { + // phpcs:enable global $user,$langs,$conf,$mysoc,$db,$hookmanager,$nblignes; if (! is_object($outputlangs)) $outputlangs=$langs; @@ -846,7 +847,7 @@ class pdf_sponge extends ModelePDFFactures } - /** + /** phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps * Show payments table * * @param PDF $pdf Object PDF @@ -857,6 +858,7 @@ class pdf_sponge extends ModelePDFFactures */ function _tableau_versements(&$pdf, $object, $posy, $outputlangs) { + // phpcs:enable global $conf; $sign=1; @@ -986,7 +988,7 @@ class pdf_sponge extends ModelePDFFactures } - /** + /** phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps * Show miscellaneous information (payment mode, payment term, ...) * * @param PDF $pdf Object PDF @@ -997,6 +999,7 @@ class pdf_sponge extends ModelePDFFactures */ function _tableau_info(&$pdf, $object, $posy, $outputlangs) { + // phpcs:enable global $conf; $default_font_size = pdf_getPDFFontSize($outputlangs); @@ -1143,7 +1146,7 @@ class pdf_sponge extends ModelePDFFactures } - /** + /** phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps * Show total to pay * * @param PDF $pdf Object PDF @@ -1155,6 +1158,7 @@ class pdf_sponge extends ModelePDFFactures */ function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs) { + // phpcs:enable global $conf,$mysoc; $sign=1; @@ -1838,7 +1842,8 @@ class pdf_sponge extends ModelePDFFactures * @param int $hideref Do not show ref * @return null */ - function defineColumnField($object,$outputlangs,$hidedetails=0,$hidedesc=0,$hideref=0){ + function defineColumnField($object,$outputlangs,$hidedetails=0,$hidedesc=0,$hideref=0) + { global $conf, $hookmanager; diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index e1f874b6853..509173a0aa7 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -117,7 +117,7 @@ class pdf_cyan extends ModelePDFPropales $this->atleastonediscount=0; } - /** + /** phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps * Function to build pdf onto disk * * @param Object $object Object to generate @@ -130,6 +130,7 @@ class pdf_cyan extends ModelePDFPropales */ function write_file($object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hidedesc=0,$hideref=0) { + // phpcs:enable global $user,$langs,$conf,$mysoc,$db,$hookmanager,$nblignes; if (! is_object($outputlangs)) $outputlangs=$langs; @@ -872,7 +873,7 @@ class pdf_cyan extends ModelePDFPropales } } - /** + /** phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps * Show payments table * * @param TCPDF $pdf Object PDF @@ -883,11 +884,11 @@ class pdf_cyan extends ModelePDFPropales */ function _tableau_versements(&$pdf, $object, $posy, $outputlangs) { - + // phpcs:enable } - /** + /** phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps * Show miscellaneous information (payment mode, payment term, ...) * * @param TCPDF $pdf Object PDF @@ -898,6 +899,7 @@ class pdf_cyan extends ModelePDFPropales */ function _tableau_info(&$pdf, $object, $posy, $outputlangs) { + // phpcs:enable global $conf; $default_font_size = pdf_getPDFFontSize($outputlangs); @@ -1701,7 +1703,8 @@ class pdf_cyan extends ModelePDFPropales * @param int $hideref Do not show ref * @return null */ - function defineColumnField($object,$outputlangs,$hidedetails=0,$hidedesc=0,$hideref=0){ + function defineColumnField($object,$outputlangs,$hidedetails=0,$hidedesc=0,$hideref=0) + { global $conf, $hookmanager; From 0ad991766cb3319a5c54f07740bff3d702d1ac97 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 23 Oct 2018 17:53:01 +0200 Subject: [PATCH 27/35] Fix deletion of project when there is events --- htdocs/projet/class/project.class.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index a8b34e9c57d..eaf1ad6ea67 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -662,9 +662,10 @@ class Project extends CommonObject // Set fk_projet into elements to null $listoftables=array( - 'facture'=>'fk_projet','propal'=>'fk_projet','commande'=>'fk_projet', - 'facture_fourn'=>'fk_projet','commande_fournisseur'=>'fk_projet','supplier_proposal'=>'fk_projet', - 'expensereport_det'=>'fk_projet','contrat'=>'fk_projet','fichinter'=>'fk_projet','don'=>'fk_projet' + 'propal'=>'fk_projet', 'commande'=>'fk_projet', 'facture'=>'fk_projet', + 'supplier_proposal'=>'fk_projet', 'commande_fournisseur'=>'fk_projet', 'facture_fourn'=>'fk_projet', + 'expensereport_det'=>'fk_projet', 'contrat'=>'fk_projet', 'fichinter'=>'fk_projet', 'don'=>'fk_projet', + 'actioncomm'=>'fk_project' ); foreach($listoftables as $key => $value) { From 0fe2c63bc09e0094787ee874dc860900cfb665e0 Mon Sep 17 00:00:00 2001 From: atm-john Date: Tue, 23 Oct 2018 22:10:30 +0200 Subject: [PATCH 28/35] FIX missing print button for delivery form --- htdocs/core/actions_printing.inc.php | 18 ++++++++++++++---- htdocs/core/class/html.formfile.class.php | 2 +- htdocs/livraison/card.php | 1 + 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/htdocs/core/actions_printing.inc.php b/htdocs/core/actions_printing.inc.php index d2d34cd523a..d5c40c17ad0 100644 --- a/htdocs/core/actions_printing.inc.php +++ b/htdocs/core/actions_printing.inc.php @@ -47,11 +47,21 @@ if ($action == 'print_file' && $user->rights->printing->read) { { $printerfound++; - $subdir=(GETPOST('printer', 'alpha')=='expedition'?'sending':''); + $subdir=''; $module = GETPOST('printer', 'alpha'); - if ($module =='commande_fournisseur') { - $module = 'fournisseur'; - $subdir = 'commande'; + switch ($module ) + { + case 'livraison' : + $subdir = 'receipt'; + $module = 'expedition'; + break; + case 'expedition' : + $subdir = 'sending'; + break; + case 'commande_fournisseur' : + $module = 'fournisseur'; + $subdir = 'commande'; + break; } try { $ret = $printer->printFile(GETPOST('file', 'alpha'), $module, $subdir); diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index e4c5b9a84b5..bfc67880a96 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -310,7 +310,7 @@ class FormFile $param.= 'entity='.(!empty($object->entity)?$object->entity:$conf->entity); $printer=0; - if (in_array($modulepart,array('facture','supplier_proposal','propal','proposal','order','commande','expedition', 'commande_fournisseur', 'expensereport'))) // The direct print feature is implemented only for such elements + if (in_array($modulepart,array('facture','supplier_proposal','propal','proposal','order','commande','expedition', 'commande_fournisseur', 'expensereport','livraison'))) // The direct print feature is implemented only for such elements { $printer = (!empty($user->rights->printing->read) && !empty($conf->printing->enabled))?true:false; } diff --git a/htdocs/livraison/card.php b/htdocs/livraison/card.php index 44eb12299d9..2fee2e100ba 100644 --- a/htdocs/livraison/card.php +++ b/htdocs/livraison/card.php @@ -292,6 +292,7 @@ elseif ($action == 'remove_file') } */ +include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php'; /* * View From 82f40fb4b930ad83d9669ce98b80677493b38cb9 Mon Sep 17 00:00:00 2001 From: atm-john Date: Tue, 23 Oct 2018 23:21:30 +0200 Subject: [PATCH 29/35] NEW hidden conf to search by supplier ref --- htdocs/core/class/html.form.class.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 1cc02f0939a..5391dc0bd37 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -2071,6 +2071,12 @@ class Form $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps on ps.fk_product = p.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."entrepot as e on ps.fk_entrepot = e.rowid"; } + + // include search in supplier ref + if(!empty($conf->global->MAIN_SEARCH_PRODUCT_BY_FOURN_REF)) + { + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product"; + } //Price by customer if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES) && !empty($socid)) { @@ -2124,6 +2130,7 @@ class Form if ($i > 0) $sql.=" AND "; $sql.="(p.ref LIKE '".$db->escape($prefix.$crit)."%' OR p.label LIKE '".$db->escape($prefix.$crit)."%'"; if (! empty($conf->global->MAIN_MULTILANGS)) $sql.=" OR pl.label LIKE '".$db->escape($prefix.$crit)."%'"; + if (! empty($conf->global->MAIN_SEARCH_PRODUCT_BY_FOURN_REF)) $sql.=" OR pfp.ref_fourn LIKE '".$db->escape($prefix.$crit)."%'"; $sql.=")"; $i++; } From 23a9416c193e79e5b1638a3a4845b5d228459950 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 23 Oct 2018 23:51:27 +0200 Subject: [PATCH 30/35] Fix deprecated field --- htdocs/comm/action/class/actioncomm.class.php | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 969cb705bac..4a6cec809fe 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -88,13 +88,6 @@ class ActionComm extends CommonObject */ public $label; - /** - * @var string - * @deprecated Use $label - * @see label - */ - public $libelle; - public $datec; // Date creation record (datec) public $datem; // Date modification record (tms) @@ -351,7 +344,7 @@ class ActionComm extends CommonObject $sql.= ($code?("'".$code."'"):"null").", "; $sql.= ((isset($this->socid) && $this->socid > 0) ? $this->socid:"null").", "; $sql.= ((isset($this->fk_project) && $this->fk_project > 0) ? $this->fk_project:"null").", "; - $sql.= " '".$this->db->escape($this->note)."', "; + $sql.= " '".$this->db->escape($this->note_private?$this->note_private:$this->note)."', "; $sql.= ((isset($this->contactid) && $this->contactid > 0) ? $this->contactid:"null").", "; $sql.= (isset($user->id) && $user->id > 0 ? $user->id:"null").", "; $sql.= ($userownerid>0 ? $userownerid:"null").", "; @@ -621,6 +614,7 @@ class ActionComm extends CommonObject $this->datem = $this->db->jdate($obj->datem); $this->note = $obj->note; + $this->note_private = $obj->note; $this->percentage = $obj->percentage; $this->authorid = $obj->fk_user_author; @@ -870,7 +864,7 @@ class ActionComm extends CommonObject $sql.= ", datep = ".(strval($this->datep)!='' ? "'".$this->db->idate($this->datep)."'" : 'null'); $sql.= ", datep2 = ".(strval($this->datef)!='' ? "'".$this->db->idate($this->datef)."'" : 'null'); $sql.= ", durationp = ".(isset($this->durationp) && $this->durationp >= 0 && $this->durationp != ''?"'".$this->db->escape($this->durationp)."'":"null"); // deprecated - $sql.= ", note = ".($this->note ? "'".$this->db->escape($this->note)."'":"null"); + $sql.= ", note = '".$this->db->escape($this->note_private?$this->note_private:$this->note)."'"; $sql.= ", fk_project =". ($this->fk_project > 0 ? $this->fk_project:"null"); $sql.= ", fk_soc =". ($socid > 0 ? $socid:"null"); $sql.= ", fk_contact =". ($contactid > 0 ? $contactid:"null"); From d5285ca359365cd2a809e5fd5ae4d3bcf3eab163 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 24 Oct 2018 01:53:07 +0200 Subject: [PATCH 31/35] Update commonobject.class.php --- htdocs/core/class/commonobject.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index bfb657f6216..ef42301b228 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -6203,7 +6203,7 @@ abstract class CommonObject $InfoFieldList = explode(":", $param_list[0]); $classname=$InfoFieldList[0]; $classpath=$InfoFieldList[1]; - $getnomurlparam=$InfoFieldList[2]; + $getnomurlparam=(empty($InfoFieldList[2]) ? 3 : $InfoFieldList[2]); if (! empty($classpath)) { dol_include_once($InfoFieldList[1]); @@ -6211,7 +6211,7 @@ abstract class CommonObject { $object = new $classname($this->db); $object->fetch($value); - $value=$object->getNomUrl(!empty($getnomurlparam)?$getnomurlparam:3); + $value=$object->getNomUrl($getnomurlparam); } } else From ae44c4c7f54218dd4109a436996f74fd9dad5e38 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 24 Oct 2018 02:00:43 +0200 Subject: [PATCH 32/35] Disable duplicate feature with emailing module and field "unsubscribe requested" --- htdocs/core/modules/modDataPolicy.class.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/htdocs/core/modules/modDataPolicy.class.php b/htdocs/core/modules/modDataPolicy.class.php index 2ecb5da4336..ca53440a3b9 100644 --- a/htdocs/core/modules/modDataPolicy.class.php +++ b/htdocs/core/modules/modDataPolicy.class.php @@ -200,7 +200,7 @@ class modDataPolicy extends DolibarrModules { // unit_frequency must be 60 for minute, 3600 for hour, 86400 for day, 604800 for week $this->cronjobs = array( 0 => array('label' => 'DATAPOLICY Cron', 'jobtype' => 'method', 'class' => '/datapolicy/class/datapolicyCron.class.php', 'objectname' => 'RgpdCron', 'method' => 'exec', 'parameters' => '', 'comment' => 'Comment', 'frequency' => 1, 'unitfrequency' => 86400, 'status' => 1, 'test' => true), - 1 => array('label' => 'DATAPOLICY Mailing', 'jobtype' => 'method', 'class' => '/datapolicy/class/datapolicyCron.class.php', 'objectname' => 'RgpdCron', 'method' => 'sendMailing', 'parameters' => '', 'comment' => 'Comment', 'frequency' => 1, 'unitfrequency' => 86400, 'status' => 0, 'test' => true) + //1 => array('label' => 'DATAPOLICY Mailing', 'jobtype' => 'method', 'class' => '/datapolicy/class/datapolicyCron.class.php', 'objectname' => 'RgpdCron', 'method' => 'sendMailing', 'parameters' => '', 'comment' => 'Comment', 'frequency' => 1, 'unitfrequency' => 86400, 'status' => 0, 'test' => true) ); // Example: $this->cronjobs=array(0=>array('label'=>'My label', 'jobtype'=>'method', 'class'=>'/dir/class/file.class.php', 'objectname'=>'MyClass', 'method'=>'myMethod', 'parameters'=>'param1, param2', 'comment'=>'Comment', 'frequency'=>2, 'unitfrequency'=>3600, 'status'=>0, 'test'=>true), // 1=>array('label'=>'My label', 'jobtype'=>'command', 'command'=>'', 'parameters'=>'param1, param2', 'comment'=>'Comment', 'frequency'=>1, 'unitfrequency'=>3600*24, 'status'=>0, 'test'=>true) @@ -230,9 +230,8 @@ class modDataPolicy extends DolibarrModules { include_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php'; $extrafields = new ExtraFields($this->db); - + /* // Extrafield contact - //$result1=$extrafields->addExtraField('datapolicy_separate', "DATAPOLICY_BLOCKCHECKBOX", 'separate', 100, 1, 'thirdparty', 0, 0, '', '', 1, '', '1', 0, '', '', 'datapolicy@datapolicy', '$conf->datapolicy->enabled'); $result1 = $extrafields->addExtraField('datapolicy_consentement', $langs->trans("DATAPOLICY_consentement"), 'boolean', 101, 3, 'thirdparty', 0, 0, '', '', 1, '', '3', 0, '', '', 'datapolicy@datapolicy', '$conf->datapolicy->enabled'); $result1 = $extrafields->addExtraField('datapolicy_opposition_traitement', $langs->trans("DATAPOLICY_opposition_traitement"), 'boolean', 102, 3, 'thirdparty', 0, 0, '', '', 1, '', '3', 0, '', '', 'datapolicy@datapolicy', '$conf->datapolicy->enabled'); $result1 = $extrafields->addExtraField('datapolicy_opposition_prospection', $langs->trans("DATAPOLICY_opposition_prospection"), 'boolean', 103, 3, 'thirdparty', 0, 0, '', '', 1, '', '3', 0, '', '', 'datapolicy@datapolicy', '$conf->datapolicy->enabled'); @@ -240,7 +239,6 @@ class modDataPolicy extends DolibarrModules { $result1 = $extrafields->addExtraField('datapolicy_send', $langs->trans("DATAPOLICY_send"), 'date', 105, 3, 'thirdparty', 0, 0, '', '', 0, '', '0', 0); // Extrafield Tiers - //$result1=$extrafields->addExtraField('datapolicy_separate', "DATAPOLICY_BLOCKCHECKBOX", 'separate', 100, 1, 'contact', 0, 0, '', '', 1, '', '1', 0, '', '', 'datapolicy@datapolicy', '$conf->datapolicy->enabled'); $result1 = $extrafields->addExtraField('datapolicy_consentement', $langs->trans("DATAPOLICY_consentement"), 'boolean', 101, 3, 'contact', 0, 0, '', '', 1, '', '3', 0, '', '', 'datapolicy@datapolicy', '$conf->datapolicy->enabled'); $result1 = $extrafields->addExtraField('datapolicy_opposition_traitement', $langs->trans("DATAPOLICY_opposition_traitement"), 'boolean', 102, 3, 'contact', 0, 0, '', '', 1, '', '3', 0, '', '', 'datapolicy@datapolicy', '$conf->datapolicy->enabled'); $result1 = $extrafields->addExtraField('datapolicy_opposition_prospection', $langs->trans("DATAPOLICY_opposition_prospection"), 'boolean', 103, 3, 'contact', 0, 0, '', '', 1, '', '3', 0, '', '', 'datapolicy@datapolicy', '$conf->datapolicy->enabled'); @@ -248,12 +246,12 @@ class modDataPolicy extends DolibarrModules { $result1 = $extrafields->addExtraField('datapolicy_send', $langs->trans("DATAPOLICY_send"), 'date', 105, 3, 'contact', 0, 0, '', '', 0, '', '0', 0); // Extrafield Adherent - //$result1=$extrafields->addExtraField('datapolicy_separate', "DATAPOLICY_BLOCKCHECKBOX", 'separate', 100, 1, 'adherent', 0, 0, '', '', 1, '', '1', 0, '', '', 'datapolicy@datapolicy', '$conf->datapolicy->enabled'); $result1 = $extrafields->addExtraField('datapolicy_consentement', $langs->trans("DATAPOLICY_consentement"), 'boolean', 101, 3, 'adherent', 0, 0, '', '', 1, '', '3', 0, '', '', 'datapolicy@datapolicy', '$conf->datapolicy->enabled'); $result1 = $extrafields->addExtraField('datapolicy_opposition_traitement', $langs->trans("DATAPOLICY_opposition_traitement"), 'boolean', 102, 3, 'adherent', 0, 0, '', '', 1, '', '3', 0, '', '', 'datapolicy@datapolicy', '$conf->datapolicy->enabled'); $result1 = $extrafields->addExtraField('datapolicy_opposition_prospection', $langs->trans("DATAPOLICY_opposition_prospection"), 'boolean', 103, 3, 'adherent', 0, 0, '', '', 1, '', '3', 0, '', '', 'datapolicy@datapolicy', '$conf->datapolicy->enabled'); $result1 = $extrafields->addExtraField('datapolicy_date', $langs->trans("DATAPOLICY_date"), 'date', 104, 3, 'adherent', 0, 0, '', '', 1, '', '3', 0); $result1 = $extrafields->addExtraField('datapolicy_send', $langs->trans("DATAPOLICY_send"), 'date', 105, 3, 'adherent', 0, 0, '', '', 0, '', '0', 0); + */ $sql = array(); From 065d715d4197b25ef7f262e498bd5b18afbe4b8b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 24 Oct 2018 02:20:07 +0200 Subject: [PATCH 33/35] FIX #9837 - The fetchAllXXX was not managing correctly the limit --- htdocs/accountancy/class/bookkeeping.class.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index 0550fb5a438..fe3ef196d1b 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -785,7 +785,8 @@ class BookKeeping extends CommonObject if ($resql) { $num = $this->db->num_rows($resql); - while ( $obj = $this->db->fetch_object($resql) ) { + $i = 0; + while ($obj = $this->db->fetch_object($resql) && (empty($limit) || $i < min($limit, $num))) { $line = new BookKeepingLine(); $line->id = $obj->rowid; @@ -817,6 +818,8 @@ class BookKeeping extends CommonObject $line->date_creation = $obj->date_creation; $this->lines[] = $line; + + $i++; } $this->db->free($resql); @@ -914,7 +917,8 @@ class BookKeeping extends CommonObject if ($resql) { $num = $this->db->num_rows($resql); - while ( $obj = $this->db->fetch_object($resql) ) { + $i = 0; + while ($obj = $this->db->fetch_object($resql) && (empty($limit) || $i < min($limit, $num))) { $line = new BookKeepingLine(); $line->id = $obj->rowid; @@ -943,6 +947,8 @@ class BookKeeping extends CommonObject $line->date_modification = $this->db->jdate($obj->date_modification); $this->lines[] = $line; + + $i++; } $this->db->free($resql); @@ -1021,7 +1027,7 @@ class BookKeeping extends CommonObject $num = $this->db->num_rows($resql); $i = 0; - while (($obj = $this->db->fetch_object($resql)) && ($i < min($limit, $num))) + while (($obj = $this->db->fetch_object($resql)) && (empty($limit) || $i < min($limit, $num))) { $line = new BookKeepingLine(); From a3d6146bed5b44b396cfed86ed85cd036545f0c3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 24 Oct 2018 02:32:01 +0200 Subject: [PATCH 34/35] Code comment --- dev/dolibarr_changes.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dev/dolibarr_changes.txt b/dev/dolibarr_changes.txt index 24832103c6c..37aef014e63 100644 --- a/dev/dolibarr_changes.txt +++ b/dev/dolibarr_changes.txt @@ -78,17 +78,24 @@ In htdocs/includes/tcpdf/tcpdf.php + protected $default_monospaced_font = 'freemono'; + TCPDI: ------ Add fpdf_tpl.php 1.2 Add tcpdi.php + Add tcpdi_parser.php and replace: require_once(dirname(__FILE__).'/include/tcpdf_filters.php'); with: require_once(dirname(__FILE__).'/../tecnickcom/tcpdf/include/tcpdf_filters.php'); +* Fix by replacing + } elseif (($key == '/Index') AND ($v[0] == PDF_TYPE_ARRAY AND count($v[1] >= 2))) { +with + } elseif (($key == '/Index') AND ($v[0] == PDF_TYPE_ARRAY AND count($v[1]) >= 2)) { + JSGANTT: From 769bae75e94c3030f326e599efb356a782eb7171 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 24 Oct 2018 02:48:38 +0200 Subject: [PATCH 35/35] Update list.php --- htdocs/accountancy/bookkeeping/list.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index 9e696b9d2af..4a4630edfa5 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -145,6 +145,8 @@ $arrayfields=array( 't.tms'=>array('label'=>$langs->trans("DateModification"), 'checked'=>0), ); +if (empty($conf->global->ACCOUNTING_ENABLE_LETTERING)) unset($arrayfields['t.lettering_code']); + /* * Actions