28require
'../../main.inc.php';
31require_once DOL_DOCUMENT_ROOT.
'/core/lib/accounting.lib.php';
32require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
33require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/bookkeeping.class.php';
34require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/accountingjournal.class.php';
35require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/accountingaccount.class.php';
36require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/accountancyexport.class.php';
37require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formaccounting.class.php';
38require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
41$langs->loadLangs(array(
"accountancy",
"compta"));
43$action =
GETPOST(
'action',
'aZ09');
44$optioncss =
GETPOST(
'optioncss',
'alpha');
45$type =
GETPOST(
'type',
'alpha');
47 $context_default =
'balancesubaccountlist';
49 $context_default =
'balancelist';
51$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') : $context_default;
52$show_subgroup =
GETPOST(
'show_subgroup',
'alpha');
55$search_ledger_code =
GETPOST(
'search_ledger_code',
'array');
56$search_accountancy_code_start =
GETPOST(
'search_accountancy_code_start',
'alpha');
57if ($search_accountancy_code_start == - 1) {
58 $search_accountancy_code_start =
'';
60$search_accountancy_code_end =
GETPOST(
'search_accountancy_code_end',
'alpha');
61if ($search_accountancy_code_end == - 1) {
62 $search_accountancy_code_end =
'';
64$search_not_reconciled =
GETPOST(
'search_not_reconciled',
'alpha');
67$limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
68$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
69$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
70$page = GETPOSTISSET(
'pageplusone') ? (
GETPOST(
'pageplusone') - 1) :
GETPOST(
"page",
'int');
71if (empty($page) || $page == -1 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha') || (empty($toselect) && $massaction ===
'0')) {
74$offset = $limit * $page;
77if ($sortorder ==
"") {
80if ($sortfield ==
"") {
81 $sortfield =
"t.numero_compte";
86$hookmanager->initHooks(array($contextpage));
92if (empty($search_date_start) && !GETPOSTISSET(
'formfilteraction')) {
93 $sql =
"SELECT date_start, date_end from ".MAIN_DB_PREFIX.
"accounting_fiscalyear ";
94 $sql .=
" WHERE date_start < '".$db->idate(
dol_now()).
"' AND date_end > '".$db->idate(
dol_now()).
"'";
95 $sql .= $db->plimit(1);
96 $res = $db->query($sql);
98 if ($res->num_rows > 0) {
99 $fiscalYear = $db->fetch_object($res);
100 $search_date_start = strtotime($fiscalYear->date_start);
101 $search_date_end = strtotime($fiscalYear->date_end);
103 $month_start = ($conf->global->SOCIETE_FISCAL_MONTH_START ? ($conf->global->SOCIETE_FISCAL_MONTH_START) : 1);
108 $year_end = $year_start + 1;
109 $month_end = $month_start - 1;
110 if ($month_end < 1) {
114 $search_date_start =
dol_mktime(0, 0, 0, $month_start, 1, $year_start);
119if (!isModEnabled(
'accounting')) {
122if ($user->socid > 0) {
125if (!$user->hasRight(
'accounting',
'mouvements',
'lire')) {
135$parameters = array(
'socid'=>$socid);
136$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
141if (empty($reshook)) {
142 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
144 $search_date_start =
'';
145 $search_date_end =
'';
146 $search_date_startyear =
'';
147 $search_date_startmonth =
'';
148 $search_date_startday =
'';
149 $search_date_endyear =
'';
150 $search_date_endmonth =
'';
151 $search_date_endday =
'';
152 $search_accountancy_code_start =
'';
153 $search_accountancy_code_end =
'';
154 $search_not_reconciled =
'';
155 $search_ledger_code = array();
162 if (!empty($search_date_start)) {
163 $filter[
't.doc_date>='] = $search_date_start;
164 $param .=
'&date_startmonth=' .
GETPOST(
'date_startmonth',
'int') .
'&date_startday=' .
GETPOST(
'date_startday',
'int') .
'&date_startyear=' .
GETPOST(
'date_startyear',
'int');
166 if (!empty($search_date_end)) {
167 $filter[
't.doc_date<='] = $search_date_end;
168 $param .=
'&date_endmonth=' .
GETPOST(
'date_endmonth',
'int') .
'&date_endday=' .
GETPOST(
'date_endday',
'int') .
'&date_endyear=' .
GETPOST(
'date_endyear',
'int');
170 if (!empty($search_doc_date)) {
171 $filter[
't.doc_date'] = $search_doc_date;
172 $param .=
'&doc_datemonth=' .
GETPOST(
'doc_datemonth',
'int') .
'&doc_dateday=' .
GETPOST(
'doc_dateday',
'int') .
'&doc_dateyear=' .
GETPOST(
'doc_dateyear',
'int');
174 if (!empty($search_accountancy_code_start)) {
175 if ($type ==
'sub') {
176 $filter[
't.subledger_account>='] = $search_accountancy_code_start;
178 $filter[
't.numero_compte>='] = $search_accountancy_code_start;
180 $param .=
'&search_accountancy_code_start=' . urlencode($search_accountancy_code_start);
182 if (!empty($search_accountancy_code_end)) {
183 if ($type ==
'sub') {
184 $filter[
't.subledger_account<='] = $search_accountancy_code_end;
186 $filter[
't.numero_compte<='] = $search_accountancy_code_end;
188 $param .=
'&search_accountancy_code_end=' . urlencode($search_accountancy_code_end);
190 if (!empty($search_ledger_code)) {
191 $filter[
't.code_journal'] = $search_ledger_code;
192 foreach ($search_ledger_code as $code) {
193 $param .=
'&search_ledger_code[]=' . urlencode($code);
196 if (!empty($search_not_reconciled)) {
197 $filter[
't.reconciled_option'] = $search_not_reconciled;
198 $param .=
'&search_not_reconciled='.urlencode($search_not_reconciled);
200 if (!empty($show_subgroup)) {
201 $param .=
'&show_subgroup='.urlencode($show_subgroup);
205 $url_param = substr($param, 1);
207 $param =
'&type=' . $type . $param;
211if ($action ==
'export_csv') {
212 $sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
214 $filename =
'balance';
215 $type_export =
'balance';
216 include DOL_DOCUMENT_ROOT.
'/accountancy/tpl/export_journal.tpl.php';
218 if ($type ==
'sub') {
219 $result = $object->fetchAllBalance($sortorder, $sortfield, $limit, 0, $filter,
'AND', 1);
221 $result = $object->fetchAllBalance($sortorder, $sortfield, $limit, 0, $filter);
227 foreach ($object->lines as $line) {
228 if ($type ==
'sub') {
230 print
'"' . $line->subledger_label .
'"' . $sep;
233 print
'"' . $object->get_compte_desc($line->numero_compte) .
'"' . $sep;
235 print
'"'.price($line->debit).
'"'.$sep;
236 print
'"'.price($line->credit).
'"'.$sep;
237 print
'"'.price($line->debit - $line->credit).
'"'.$sep;
249 $title_page = $langs->trans(
"AccountBalanceSubAccount");
251 $title_page = $langs->trans(
"AccountBalance");
257if ($action !=
'export_csv') {
259 $nbtotalofrecords =
'';
261 if ($type ==
'sub') {
262 $nbtotalofrecords = $object->fetchAllBalance($sortorder, $sortfield, 0, 0, $filter,
'AND', 1);
264 $nbtotalofrecords = $object->fetchAllBalance($sortorder, $sortfield, 0, 0, $filter);
267 if ($nbtotalofrecords < 0) {
272 if ($type ==
'sub') {
273 $result = $object->fetchAllBalance($sortorder, $sortfield, $limit, $offset, $filter,
'AND', 1);
275 $result = $object->fetchAllBalance($sortorder, $sortfield, $limit, $offset, $filter);
282 print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">';
283 print
'<input type="hidden" name="token" value="'.newToken().
'">';
284 print
'<input type="hidden" name="action" id="action" value="list">';
285 if ($optioncss !=
'') {
286 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
288 print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
289 print
'<input type="hidden" name="type" value="'.$type.
'">';
290 print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
291 print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
292 print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
293 print
'<input type="hidden" name="page" value="'.$page.
'">';
296 $parameters = array();
297 $reshook = $hookmanager->executeHooks(
'addMoreActionsButtons', $parameters, $object, $action);
303 $newcardbutton = empty($hookmanager->resPrint) ?
'' : $hookmanager->resPrint;
305 if (empty($reshook)) {
306 $newcardbutton =
'<input type="button" id="exportcsvbutton" name="exportcsvbutton" class="butAction" value="'.$langs->trans(
"Export").
' ('.$conf->global->ACCOUNTING_EXPORT_FORMAT.
')" />';
308 print
'<script type="text/javascript">
309 jQuery(document).ready(function() {
310 jQuery("#exportcsvbutton").click(function(event) {
311 event.preventDefault();
312 console.log("Set action to export_csv");
313 jQuery("#action").val("export_csv");
314 jQuery("#searchFormList").submit();
315 jQuery("#action").val("list");
320 if ($type ==
'sub') {
321 $newcardbutton .=
dolGetButtonTitle($langs->trans(
'AccountBalance').
" - ".$langs->trans(
'GroupByAccountAccounting'),
'',
'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT .
'/accountancy/bookkeeping/balance.php?' . $url_param,
'', 1, array(
'morecss' =>
'marginleftonly'));
322 $newcardbutton .=
dolGetButtonTitle($langs->trans(
'AccountBalance').
" - ".$langs->trans(
'GroupBySubAccountAccounting'),
'',
'fa fa-align-left vmirror paddingleft imgforviewmode', DOL_URL_ROOT .
'/accountancy/bookkeeping/balance.php?type=sub&' . $url_param,
'', 1, array(
'morecss' =>
'marginleftonly btnTitleSelected'));
324 $newcardbutton .=
dolGetButtonTitle($langs->trans(
'AccountBalance').
" - ".$langs->trans(
'GroupByAccountAccounting'),
'',
'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT .
'/accountancy/bookkeeping/balance.php?' . $url_param,
'', 1, array(
'morecss' =>
'marginleftonly btnTitleSelected'));
325 $newcardbutton .=
dolGetButtonTitle($langs->trans(
'AccountBalance').
" - ".$langs->trans(
'GroupBySubAccountAccounting'),
'',
'fa fa-align-left vmirror paddingleft imgforviewmode', DOL_URL_ROOT .
'/accountancy/bookkeeping/balance.php?type=sub&' . $url_param,
'', 1, array(
'morecss' =>
'marginleftonly'));
327 $newcardbutton .=
dolGetButtonTitle($langs->trans(
'NewAccountingMvt'),
'',
'fa fa-plus-circle paddingleft', DOL_URL_ROOT.
'/accountancy/bookkeeping/card.php?action=create');
329 if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
330 $param .=
'&contextpage='.urlencode($contextpage);
332 if ($limit > 0 && $limit != $conf->liste_limit) {
333 $param .=
'&limit='.((int) $limit);
336 print_barre_liste($title_page, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder,
'', $result, $nbtotalofrecords,
'title_accountancy', 0, $newcardbutton,
'', $limit, 0, 0, 1);
338 $selectedfields =
'';
341 if ($type ==
'sub') {
342 print
info_admin($langs->trans(
"WarningRecordWithoutSubledgerAreExcluded"));
347 $moreforfilter .=
'<div class="divsearchfield">';
348 $moreforfilter .= $langs->trans(
'DateStart').
': ';
349 $moreforfilter .= $form->selectDate($search_date_start ? $search_date_start : -1,
'date_start', 0, 0, 1,
'', 1, 0);
350 $moreforfilter .= $langs->trans(
'DateEnd').
': ';
351 $moreforfilter .= $form->selectDate($search_date_end ? $search_date_end : -1,
'date_end', 0, 0, 1,
'', 1, 0);
352 $moreforfilter .=
'</div>';
354 $moreforfilter .=
'<div class="divsearchfield">';
355 $moreforfilter .=
'<label for="show_subgroup">'.$langs->trans(
'ShowSubtotalByGroup').
'</label>: ';
356 $moreforfilter .=
'<input type="checkbox" name="show_subgroup" id="show_subgroup" value="show_subgroup"'.($show_subgroup ==
'show_subgroup' ?
' checked' :
'').
'>';
357 $moreforfilter .=
'</div>';
359 $moreforfilter .=
'<div class="divsearchfield">';
360 $moreforfilter .= $langs->trans(
"Journals").
': ';
361 $moreforfilter .= $formaccounting->multi_select_journal($search_ledger_code,
'search_ledger_code', 0, 1, 1, 1);
362 $moreforfilter .=
'</div>';
364 $moreforfilter .=
'</br>';
365 $moreforfilter .=
'<div class="divsearchfield">';
367 $moreforfilter .= $langs->trans(
'AccountAccounting').
': ';
368 if ($type ==
'sub') {
369 $moreforfilter .= $formaccounting->select_auxaccount($search_accountancy_code_start,
'search_accountancy_code_start', $langs->trans(
'From'),
'maxwidth200');
371 $moreforfilter .= $formaccounting->select_account($search_accountancy_code_start,
'search_accountancy_code_start', $langs->trans(
'From'), array(), 1, 1,
'maxwidth200',
'accounts');
373 $moreforfilter .=
' ';
374 if ($type ==
'sub') {
375 $moreforfilter .= $formaccounting->select_auxaccount($search_accountancy_code_end,
'search_accountancy_code_end', $langs->trans(
'to'),
'maxwidth200');
377 $moreforfilter .= $formaccounting->select_account($search_accountancy_code_end,
'search_accountancy_code_end', $langs->trans(
'to'), array(), 1, 1,
'maxwidth200',
'accounts');
379 $moreforfilter .=
'</div>';
381 if (!empty($conf->global->ACCOUNTING_ENABLE_LETTERING)) {
382 $moreforfilter .=
'<div class="divsearchfield">';
383 $moreforfilter .=
'<label for="notreconciled">'.$langs->trans(
'NotReconciled').
'</label>: ';
384 $moreforfilter .=
'<input type="checkbox" name="search_not_reconciled" id="notreconciled" value="notreconciled"'.($search_not_reconciled ==
'notreconciled' ?
' checked' :
'').
'>';
385 $moreforfilter .=
'</div>';
388 if (!empty($moreforfilter)) {
389 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
390 print $moreforfilter;
391 $parameters = array();
392 $reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters);
393 print $hookmanager->resPrint;
398 $colspan = (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE) ? 5 : 4);
400 print
'<table class="liste '.($moreforfilter ?
"listwithfilterbefore" :
"").
'">';
402 print
'<tr class="liste_titre_filter">';
405 print
'<td class="liste_titre maxwidthsearch">';
406 $searchpicto = $form->showFilterButtons();
411 print
'<td class="liste_titre" colspan="'.$colspan.
'">';
415 $parameters = array(
'arrayfields'=>$arrayfields);
416 $reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object);
417 print $hookmanager->resPrint;
421 print
'<td class="liste_titre maxwidthsearch">';
422 $searchpicto = $form->showFilterButtons();
428 print
'<tr class="liste_titre">';
430 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
432 print_liste_field_titre(
"AccountAccounting", $_SERVER[
'PHP_SELF'],
"t.numero_compte",
"", $param,
"", $sortfield, $sortorder);
437 if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
438 print_liste_field_titre(
"OpeningBalance", $_SERVER[
'PHP_SELF'],
"", $param,
"",
'class="right"', $sortfield, $sortorder);
440 print_liste_field_titre(
"AccountingDebit", $_SERVER[
'PHP_SELF'],
"t.debit",
"", $param,
'class="right"', $sortfield, $sortorder);
441 print_liste_field_titre(
"AccountingCredit", $_SERVER[
'PHP_SELF'],
"t.credit",
"", $param,
'class="right"', $sortfield, $sortorder);
442 print_liste_field_titre(
"Balance", $_SERVER[
"PHP_SELF"],
"", $param,
"",
'class="right"', $sortfield, $sortorder);
445 $parameters = array(
'arrayfields'=>$arrayfields,
'param'=>$param,
'sortfield'=>$sortfield,
'sortorder'=>$sortorder);
446 $reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object);
447 print $hookmanager->resPrint;
450 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
456 $sous_total_debit = 0;
457 $sous_total_credit = 0;
458 $total_opening_balance = 0;
459 $sous_total_opening_balance = 0;
460 $displayed_account =
"";
466 if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
467 $sql =
"SELECT t.numero_compte, (SUM(t.debit) - SUM(t.credit)) as opening_balance";
468 $sql .=
" FROM " . MAIN_DB_PREFIX .
"accounting_bookkeeping as t";
469 $sql .=
" WHERE t.entity = " . $conf->entity;
470 $sql .=
" AND t.doc_date < '" . $db->idate($search_date_start) .
"'";
471 $sql .=
" GROUP BY t.numero_compte";
473 $resql = $db->query($sql);
474 $nrows = $resql->num_rows;
475 $opening_balances = array();
476 for ($i = 0; $i < $nrows; $i++) {
477 $arr = $resql->fetch_array();
478 $opening_balances[
"'" . $arr[
'numero_compte'] .
"'"] = $arr[
'opening_balance'];
482 foreach ($object->lines as $line) {
484 $accountingaccountstatic->id = 0;
485 $accountingaccountstatic->account_number =
'';
487 if ($type !=
'sub') {
488 $accountingaccountstatic->fetch(
null, $line->numero_compte,
true);
489 if (!empty($accountingaccountstatic->account_number)) {
490 $accounting_account = $accountingaccountstatic->getNomUrl(0, 1, 1);
497 $total_debit += $line->debit;
498 $total_credit += $line->credit;
499 $opening_balance = isset($opening_balances[
"'".$line->numero_compte.
"'"]) ? $opening_balances[
"'".$line->numero_compte.
"'"] : 0;
500 $total_opening_balance += $opening_balance;
502 $tmparrayforrootaccount = $object->getRootAccount($line->numero_compte);
503 $root_account_description = $tmparrayforrootaccount[
'label'];
504 $root_account_number = $tmparrayforrootaccount[
'account_number'];
509 if (empty($accountingaccountstatic->label) && $accountingaccountstatic->id > 0) {
510 $link =
'<a class="editfielda reposition" href="' . DOL_URL_ROOT .
'/accountancy/admin/card.php?action=update&token=' . newToken() .
'&id=' . $accountingaccountstatic->id .
'">' .
img_edit() .
'</a>';
511 } elseif ($accounting_account ==
'NotDefined') {
512 $link =
'<a href="' . DOL_URL_ROOT .
'/accountancy/admin/card.php?action=create&token=' . newToken() .
'&accountingaccount=' .
length_accountg($line->numero_compte) .
'">' .
img_edit_add() .
'</a>';
513 } elseif (empty($tmparrayforrootaccount[
'label'])) {
521 if (!empty($show_subgroup)) {
523 if (empty($displayed_account) || $root_account_number != $displayed_account) {
525 if ($displayed_account !=
"") {
526 print
'<tr class="liste_total">';
527 print
'<td class="right">'.$langs->trans(
"SubTotal").
':</td>';
528 if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
529 print
'<td class="right nowraponall amount">'.price($sous_total_opening_balance).
'</td>';
531 print
'<td class="right nowraponall amount">'.price($sous_total_debit).
'</td>';
532 print
'<td class="right nowraponall amount">'.price($sous_total_credit).
'</td>';
533 if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
534 print
'<td class="right nowraponall amount">'.price(
price2num($sous_total_opening_balance + $sous_total_debit - $sous_total_credit)).
'</td>';
536 print
'<td class="right nowraponall amount">'.price(
price2num($sous_total_debit - $sous_total_credit)).
'</td>';
543 print
'<tr class="trforbreak">';
544 print
'<td colspan="'.($colspan+1).
'" class="tdforbreak">'.$root_account_number.($root_account_description ?
' - '.$root_account_description :
'').
'</td>';
547 $displayed_account = $root_account_number;
548 $sous_total_debit = 0;
549 $sous_total_credit = 0;
550 $sous_total_opening_balance = 0;
554 print
'<tr class="oddeven">';
558 print
'<td class="center">';
564 if ($type ==
'sub') {
565 print
'<td>'.$line->subledger_account.
' <span class="opacitymedium">('.$line->subledger_label.
')</span></td>';
567 print
'<td>'.$accounting_account.
'</td>';
576 if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
577 print
'<td class="right nowraponall amount">'.price(
price2num($opening_balance,
'MT')).
'</td>';
581 if ($type ==
'sub') {
582 if ($line->subledger_account) {
583 $urlzoom = DOL_URL_ROOT .
'/accountancy/bookkeeping/listbyaccount.php?type=sub&search_accountancy_code_start=' . urlencode($line->subledger_account) .
'&search_accountancy_code_end=' . urlencode($line->subledger_account);
584 if (GETPOSTISSET(
'date_startmonth')) {
585 $urlzoom .=
'&search_date_startmonth=' .
GETPOST(
'date_startmonth',
'int') .
'&search_date_startday=' .
GETPOST(
'date_startday',
'int') .
'&search_date_startyear=' .
GETPOST(
'date_startyear',
'int');
587 if (GETPOSTISSET(
'date_endmonth')) {
588 $urlzoom .=
'&search_date_endmonth=' .
GETPOST(
'date_endmonth',
'int') .
'&search_date_endday=' .
GETPOST(
'date_endday',
'int') .
'&search_date_endyear=' .
GETPOST(
'date_endyear',
'int');
592 if ($line->numero_compte) {
593 $urlzoom = DOL_URL_ROOT .
'/accountancy/bookkeeping/listbyaccount.php?search_accountancy_code_start=' . urlencode($line->numero_compte) .
'&search_accountancy_code_end=' . urlencode($line->numero_compte);
594 if (GETPOSTISSET(
'date_startmonth')) {
595 $urlzoom .=
'&search_date_startmonth=' .
GETPOST(
'date_startmonth',
'int') .
'&search_date_startday=' .
GETPOST(
'date_startday',
'int') .
'&search_date_startyear=' .
GETPOST(
'date_startyear',
'int');
597 if (GETPOSTISSET(
'date_endmonth')) {
598 $urlzoom .=
'&search_date_endmonth=' .
GETPOST(
'date_endmonth',
'int') .
'&search_date_endday=' .
GETPOST(
'date_endday',
'int') .
'&search_date_endyear=' .
GETPOST(
'date_endyear',
'int');
603 print
'<td class="right nowraponall amount"><a href="'.$urlzoom.
'">'.
price(
price2num($line->debit,
'MT')).
'</a></td>';
605 print
'<td class="right nowraponall amount"><a href="'.$urlzoom.
'">'.
price(
price2num($line->credit,
'MT')).
'</a></td>';
607 if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
608 print
'<td class="right nowraponall amount">'.price(
price2num($opening_balance + $line->debit - $line->credit,
'MT')).
'</td>';
610 print
'<td class="right nowraponall amount">'.price(
price2num($line->debit - $line->credit,
'MT')).
'</td>';
615 print
'<td class="center">';
623 $sous_total_debit += $line->debit;
624 $sous_total_credit += $line->credit;
625 $sous_total_opening_balance += $opening_balance;
628 if (!empty($show_subgroup)) {
629 print
'<tr class="liste_total">';
634 print
'<td class="right">'.$langs->trans(
"SubTotal").
':</td>';
635 if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
636 print
'<td class="right nowraponall amount">'.price(
price2num($sous_total_opening_balance,
'MT')).
'</td>';
638 print
'<td class="right nowraponall amount">'.price(
price2num($sous_total_debit,
'MT')).
'</td>';
639 print
'<td class="right nowraponall amount">'.price(
price2num($sous_total_credit,
'MT')).
'</td>';
640 if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
641 print
'<td class="right nowraponall amount">' .
price(
price2num($sous_total_opening_balance + $sous_total_debit - $sous_total_credit,
'MT')) .
'</td>';
643 print
'<td class="right nowraponall amount">' .
price(
price2num($sous_total_debit - $sous_total_credit,
'MT')) .
'</td>';
652 print
'<tr class="liste_total">';
657 print
'<td class="right">'.$langs->trans(
"AccountBalance").
':</td>';
658 if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
659 print
'<td class="nowrap right">'.price(
price2num($total_opening_balance,
'MT')).
'</td>';
661 print
'<td class="right nowraponall amount">'.price(
price2num($total_debit,
'MT')).
'</td>';
662 print
'<td class="right nowraponall amount">'.price(
price2num($total_credit,
'MT')).
'</td>';
663 if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
664 print
'<td class="right nowraponall amount">' .
price(
price2num($total_opening_balance + $total_debit - $total_credit,
'MT')) .
'</td>';
666 print
'<td class="right nowraponall amount">' .
price(
price2num($total_debit - $total_credit,
'MT')) .
'</td>';
674 $parameters = array(
'arrayfields'=>$arrayfields,
'sql'=>$sql);
675 $reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object, $action);
676 print $hookmanager->resPrint;
length_accountg($account)
Return General accounting account with defined length (used for product and miscellaneous)
length_accounta($accounta)
Return Auxiliary accounting account of thirdparties with defined length.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
Class to manage accounting accounts.
Class to manage Ledger (General Ledger and Subledger)
dol_get_last_day($year, $month=12, $gm=false)
Return GMT time for last day of a month or year.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed informations (by default a local PHP server timestamp) Re...
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
dolGetButtonTitle($label, $helpText='', $iconClass='fa fa-file', $url='', $id='', $status=1, $params=array())
Function dolGetButtonTitle : this kind of buttons are used in title in list.
price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerounding=-1, $currency_code='')
Function to format a value into an amount for visual output Function used into PDF and HTML pages.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
dol_now($mode='auto')
Return date for now.
getDolGlobalInt($key, $default=0)
Return dolibarr global constant int value.
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $disablesortlink=0, $tooltip='', $forcenowrapcolumntitle=0)
Get title line of an array.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin='1', $morecss='hideonsmartphone', $textfordropdown='')
Show information for admin users or standard users.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
print_barre_liste($titre, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $hideselectlimit=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
img_edit_add($titlealt='default', $other='')
Show logo +.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
img_edit($titlealt='default', $float=0, $other='')
Show logo editer/modifier fiche.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.