From a5ebcff2eea5de9dd12ffe989967845c9cad3f8e Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Tue, 16 Oct 2018 22:27:34 +0200 Subject: [PATCH 1/6] 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 2/6] 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 3/6] 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 4/6] 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 930dce76112d31e9a18c70bd451d6691059e532d Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 22 Oct 2018 06:39:23 +0200 Subject: [PATCH 5/6] 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 769bae75e94c3030f326e599efb356a782eb7171 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 24 Oct 2018 02:48:38 +0200 Subject: [PATCH 6/6] 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