diff --git a/htdocs/accountancy/admin/categories.php b/htdocs/accountancy/admin/categories.php index 39aa21f2d63..e65572eafd3 100644 --- a/htdocs/accountancy/admin/categories.php +++ b/htdocs/accountancy/admin/categories.php @@ -1,6 +1,6 @@ - * Copyright (C) 2017 Alexandre Spangaro +/* Copyright (C) 2016 Jamal Elbaz + * Copyright (C) 2017-2022 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 @@ -124,7 +124,8 @@ if (!empty($cat_id)) { $arraykeyvalue = array(); foreach ($accountingcategory->lines_cptbk as $key => $val) { - $arraykeyvalue[length_accountg($val->numero_compte)] = length_accountg($val->numero_compte).' ('.$val->label_compte.($val->doc_ref ? ' '.$val->doc_ref : '').')'; + $doc_ref = !empty($val->doc_ref) ? $val->doc_ref : ''; + $arraykeyvalue[length_accountg($val->numero_compte)] = length_accountg($val->numero_compte) . ' - ' . $val->label_compte . ($doc_ref ? ' '.$doc_ref : ''); } if (is_array($accountingcategory->lines_cptbk) && count($accountingcategory->lines_cptbk) > 0) { diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php index c2071e76cea..315b7a49847 100644 --- a/htdocs/accountancy/bookkeeping/card.php +++ b/htdocs/accountancy/bookkeeping/card.php @@ -1,7 +1,7 @@ * Copyright (C) 2013-2017 Florian Henry - * Copyright (C) 2013-2021 Alexandre Spangaro + * Copyright (C) 2013-2022 Alexandre Spangaro * Copyright (C) 2017 Laurent Destailleur * Copyright (C) 2018-2020 Frédéric France * @@ -540,21 +540,24 @@ if ($action == 'create') { print ''; print ''; - // Date document export - print ''; - print ''.$langs->trans("DateExport").''; - print ''; - print $object->date_export ? dol_print_date($object->date_export, 'dayhour') : ' '; - print ''; - print ''; + // Don't show in tmp mode, inevitably empty + if ($mode != "_tmp") { + // Date document export + print ''; + print '' . $langs->trans("DateExport") . ''; + print ''; + print $object->date_export ? dol_print_date($object->date_export, 'dayhour') : ' '; + print ''; + print ''; - // Date document validation - print ''; - print ''.$langs->trans("DateValidation").''; - print ''; - print $object->date_validation ? dol_print_date($object->date_validation, 'dayhour') : ' '; - print ''; - print ''; + // Date document validation + print ''; + print '' . $langs->trans("DateValidation") . ''; + print ''; + print $object->date_validation ? dol_print_date($object->date_validation, 'dayhour') : ' '; + print ''; + print ''; + } // Validate /* diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index f27a23256b6..23d33acd3b7 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -1,7 +1,7 @@ * Copyright (C) 2013-2016 Florian Henry - * Copyright (C) 2013-2021 Alexandre Spangaro + * Copyright (C) 2013-2022 Alexandre Spangaro * Copyright (C) 2016-2017 Laurent Destailleur * Copyright (C) 2018-2021 Frédéric France * @@ -1133,6 +1133,13 @@ $line = new BookKeepingLine(); // -------------------------------------------------------------------- $i = 0; $totalarray = array(); +$totalarray['val'] = array (); +$totalarray['nbfield'] = 0; +$total_debit = 0; +$total_credit = 0; +$totalarray['val']['totaldebit'] = 0; +$totalarray['val']['totalcredit'] = 0; + while ($i < min($num, $limit)) { $obj = $db->fetch_object($resql); if (empty($obj)) { diff --git a/htdocs/accountancy/bookkeeping/listbyaccount.php b/htdocs/accountancy/bookkeeping/listbyaccount.php index 0bd1c06aab8..4b5f0d9bad6 100644 --- a/htdocs/accountancy/bookkeeping/listbyaccount.php +++ b/htdocs/accountancy/bookkeeping/listbyaccount.php @@ -824,17 +824,22 @@ print $hookmanager->resPrint; print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch '); print "\n"; - -$total_debit = 0; -$total_credit = 0; -$sous_total_debit = 0; -$sous_total_credit = 0; $displayed_account_number = null; // Start with undefined to be able to distinguish with empty // Loop on record // -------------------------------------------------------------------- $i = 0; + $totalarray = array(); +$totalarray['val'] = array (); +$totalarray['nbfield'] = 0; +$total_debit = 0; +$total_credit = 0; +$sous_total_debit = 0; +$sous_total_credit = 0; +$totalarray['val']['totaldebit'] = 0; +$totalarray['val']['totalcredit'] = 0; + while ($i < min($num, $limit)) { $line = $object->lines[$i]; diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index 992b885f272..0cc8ab4e8d9 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -1,6 +1,6 @@ - * Copyright (C) 2015-2017 Alexandre Spangaro + * Copyright (C) 2015-2022 Alexandre Spangaro * Copyright (C) 2015-2020 Florian Henry * Copyright (C) 2018-2020 Frédéric France * @@ -1667,7 +1667,9 @@ class BookKeeping extends CommonObject $this->doc_type = $obj->doc_type; $this->date_creation = $this->db->jdate($obj->date_creation); $this->date_modification = $this->db->jdate($obj->date_modification); - $this->date_export = $this->db->jdate($obj->date_export); + if ($mode != "_tmp") { + $this->date_export = $this->db->jdate($obj->date_export); + } $this->date_validation = $this->db->jdate($obj->date_validation); } else { $this->error = "Error ".$this->db->lasterror(); @@ -1764,7 +1766,9 @@ class BookKeeping extends CommonObject $line->piece_num = $obj->piece_num; $line->date_creation = $obj->date_creation; $line->date_modification = $obj->date_modification; - $line->date_export = $obj->date_export; + if ($mode != "_tmp") { + $line->date_export = $obj->date_export; + } $line->date_validation = $obj->date_validation; $this->linesmvt[] = $line; diff --git a/htdocs/accountancy/tpl/export_journal.tpl.php b/htdocs/accountancy/tpl/export_journal.tpl.php index b595402228e..22537a60a39 100644 --- a/htdocs/accountancy/tpl/export_journal.tpl.php +++ b/htdocs/accountancy/tpl/export_journal.tpl.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2015-2022 Alexandre Spangaro * Copyright (C) 2016 Charlie Benke * * This program is free software; you can redistribute it and/or modify @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -// $formatexportset ùust be defined +// $formatexportset must be defined // Protection to avoid direct call of template if (empty($conf) || !is_object($conf)) { @@ -24,11 +24,11 @@ if (empty($conf) || !is_object($conf)) { exit; } -$code = $conf->global->MAIN_INFO_ACCOUNTANT_CODE; -$prefix = $conf->global->ACCOUNTING_EXPORT_PREFIX_SPEC; -$format = $conf->global->ACCOUNTING_EXPORT_FORMAT; -$nodateexport = $conf->global->ACCOUNTING_EXPORT_NO_DATE_IN_FILENAME; -$siren = $conf->global->MAIN_INFO_SIREN; +$code = getDolGlobalString('MAIN_INFO_ACCOUNTANT_CODE'); +$prefix = getDolGlobalString('ACCOUNTING_EXPORT_PREFIX_SPEC'); +$format = getDolGlobalString('ACCOUNTING_EXPORT_FORMAT'); +$nodateexport = getDolGlobalInt('ACCOUNTING_EXPORT_NO_DATE_IN_FILENAME'); +$siren = getDolGlobalString('MAIN_INFO_SIREN'); $date_export = "_".dol_print_date(dol_now(), '%Y%m%d%H%M%S'); $endaccountingperiod = dol_print_date(dol_now(), '%Y%m%d');