28 require
'../../main.inc.php';
31 require_once DOL_DOCUMENT_ROOT.
'/core/lib/accounting.lib.php';
32 require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
33 require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/bookkeeping.class.php';
34 require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/accountingjournal.class.php';
35 require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/accountingaccount.class.php';
36 require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/accountancyexport.class.php';
37 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formaccounting.class.php';
38 require_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');
57 if ($search_accountancy_code_start == - 1) {
58 $search_accountancy_code_start =
'';
60 $search_accountancy_code_end =
GETPOST(
'search_accountancy_code_end',
'alpha');
61 if ($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');
71 if (empty($page) || $page == -1 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha') || (empty($toselect) && $massaction ===
'0')) {
74 $offset = $limit * $page;
75 $pageprev = $page - 1;
76 $pagenext = $page + 1;
77 if ($sortorder ==
"") {
80 if ($sortfield ==
"") {
81 $sortfield =
"t.numero_compte";
86 $hookmanager->initHooks(array($contextpage));
92 if (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);
122 if ($user->socid > 0) {
125 if (!$user->hasRight(
'accounting',
'mouvements',
'lire')) {
135 $parameters = array(
'socid'=>$socid);
136 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
141 if (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);
202 $url_param = substr($param, 1);
204 $param =
'&type=' . $type . $param;
208 if ($action ==
'export_csv') {
209 $sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
211 $filename =
'balance';
212 $type_export =
'balance';
213 include DOL_DOCUMENT_ROOT.
'/accountancy/tpl/export_journal.tpl.php';
215 if ($type ==
'sub') {
216 $result = $object->fetchAllBalance($sortorder, $sortfield, $limit, 0, $filter,
'AND', 1);
218 $result = $object->fetchAllBalance($sortorder, $sortfield, $limit, 0, $filter);
224 foreach ($object->lines as $line) {
225 if ($type ==
'sub') {
227 print
'"' . $line->subledger_label .
'"' . $sep;
230 print
'"' . $object->get_compte_desc($line->numero_compte) .
'"' . $sep;
232 print
'"'.price($line->debit).
'"'.$sep;
233 print
'"'.price($line->credit).
'"'.$sep;
234 print
'"'.price($line->debit - $line->credit).
'"'.$sep;
245 if ($type ==
'sub') {
246 $title_page = $langs->trans(
"AccountBalanceSubAccount");
248 $title_page = $langs->trans(
"AccountBalance");
254 if ($action !=
'export_csv') {
257 if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
258 if ($type ==
'sub') {
259 $nbtotalofrecords = $object->fetchAllBalance($sortorder, $sortfield, 0, 0, $filter,
'AND', 1);
261 $nbtotalofrecords = $object->fetchAllBalance($sortorder, $sortfield, 0, 0, $filter);
269 if ($type ==
'sub') {
270 $result = $object->fetchAllBalance($sortorder, $sortfield, $limit, $offset, $filter,
'AND', 1);
272 $result = $object->fetchAllBalance($sortorder, $sortfield, $limit, $offset, $filter);
279 print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">';
280 print
'<input type="hidden" name="token" value="'.newToken().
'">';
281 print
'<input type="hidden" name="action" id="action" value="list">';
282 if ($optioncss !=
'') {
283 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
285 print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
286 print
'<input type="hidden" name="type" value="'.$type.
'">';
287 print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
288 print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
289 print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
290 print
'<input type="hidden" name="page" value="'.$page.
'">';
293 $parameters = array();
294 $reshook = $hookmanager->executeHooks(
'addMoreActionsButtons', $parameters, $object, $action);
300 $newcardbutton = empty($hookmanager->resPrint) ?
'' : $hookmanager->resPrint;
302 if (empty($reshook)) {
303 $newcardbutton =
'<input type="button" id="exportcsvbutton" name="exportcsvbutton" class="butAction" value="'.$langs->trans(
"Export").
' ('.$conf->global->ACCOUNTING_EXPORT_FORMAT.
')" />';
305 print
'<script type="text/javascript">
306 jQuery(document).ready(function() {
307 jQuery("#exportcsvbutton").click(function() {
308 event.preventDefault();
309 console.log("Set action to export_csv");
310 jQuery("#action").val("export_csv");
311 jQuery("#searchFormList").submit();
312 jQuery("#action").val("list");
317 if ($type ==
'sub') {
318 $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'));
319 $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'));
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 btnTitleSelected'));
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'));
324 $newcardbutton .=
dolGetButtonTitle($langs->trans(
'NewAccountingMvt'),
'',
'fa fa-plus-circle paddingleft', DOL_URL_ROOT.
'/accountancy/bookkeeping/card.php?action=create');
326 if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
327 $param .=
'&contextpage='.urlencode($contextpage);
329 if ($limit > 0 && $limit != $conf->liste_limit) {
330 $param .=
'&limit='.urlencode($limit);
333 print_barre_liste($title_page, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder,
'', $result,
$nbtotalofrecords,
'title_accountancy', 0, $newcardbutton,
'', $limit, 0, 0, 1);
335 $selectedfields =
'';
338 if ($type ==
'sub') {
339 print
info_admin($langs->trans(
"WarningRecordWithoutSubledgerAreExcluded"));
344 $moreforfilter .=
'<div class="divsearchfield">';
345 $moreforfilter .= $langs->trans(
'DateStart').
': ';
346 $moreforfilter .=
$form->selectDate($search_date_start ? $search_date_start : -1,
'date_start', 0, 0, 1,
'', 1, 0);
347 $moreforfilter .= $langs->trans(
'DateEnd').
': ';
348 $moreforfilter .=
$form->selectDate($search_date_end ? $search_date_end : -1,
'date_end', 0, 0, 1,
'', 1, 0);
349 $moreforfilter .=
'</div>';
351 $moreforfilter .=
'<div class="divsearchfield">';
352 $moreforfilter .=
'<label for="show_subgroup">'.$langs->trans(
'ShowSubtotalByGroup').
'</label>: ';
353 $moreforfilter .=
'<input type="checkbox" name="show_subgroup" id="show_subgroup" value="show_subgroup"'.($show_subgroup ==
'show_subgroup' ?
' checked' :
'').
'>';
354 $moreforfilter .=
'</div>';
356 $moreforfilter .=
'<div class="divsearchfield">';
357 $moreforfilter .= $langs->trans(
"Journals").
': ';
358 $moreforfilter .= $formaccounting->multi_select_journal($search_ledger_code,
'search_ledger_code', 0, 1, 1, 1);
359 $moreforfilter .=
'</div>';
361 $moreforfilter .=
'</br>';
362 $moreforfilter .=
'<div class="divsearchfield">';
364 $moreforfilter .= $langs->trans(
'AccountAccounting').
': ';
365 if ($type ==
'sub') {
366 $moreforfilter .= $formaccounting->select_auxaccount($search_accountancy_code_start,
'search_accountancy_code_start', $langs->trans(
'From'),
'maxwidth200');
368 $moreforfilter .= $formaccounting->select_account($search_accountancy_code_start,
'search_accountancy_code_start', $langs->trans(
'From'), array(), 1, 1,
'maxwidth200',
'accounts');
370 $moreforfilter .=
' ';
371 if ($type ==
'sub') {
372 $moreforfilter .= $formaccounting->select_auxaccount($search_accountancy_code_end,
'search_accountancy_code_end', $langs->trans(
'to'),
'maxwidth200');
374 $moreforfilter .= $formaccounting->select_account($search_accountancy_code_end,
'search_accountancy_code_end', $langs->trans(
'to'), array(), 1, 1,
'maxwidth200',
'accounts');
376 $moreforfilter .=
'</div>';
378 $moreforfilter .=
'<div class="divsearchfield">';
379 $moreforfilter .=
'<label for="notreconciled">'.$langs->trans(
'NotReconciled').
'</label>: ';
380 $moreforfilter .=
'<input type="checkbox" name="search_not_reconciled" id="notreconciled" value="notreconciled"'.($search_not_reconciled ==
'notreconciled' ?
' checked' :
'').
'>';
381 $moreforfilter .=
'</div>';
383 if (!empty($moreforfilter)) {
384 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
385 print $moreforfilter;
386 $parameters = array();
387 $reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters);
388 print $hookmanager->resPrint;
393 $colspan = (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE) ? 5 : 4);
395 print
'<table class="liste '.($moreforfilter ?
"listwithfilterbefore" :
"").
'">';
397 print
'<tr class="liste_titre_filter">';
398 print
'<td class="liste_titre" colspan="'.$colspan.
'">';
402 $parameters = array(
'arrayfields'=>$arrayfields);
403 $reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object);
404 print $hookmanager->resPrint;
407 print
'<td class="liste_titre maxwidthsearch">';
408 $searchpicto =
$form->showFilterButtons();
413 print
'<tr class="liste_titre">';
414 print_liste_field_titre(
"AccountAccounting", $_SERVER[
'PHP_SELF'],
"t.numero_compte",
"", $param,
"", $sortfield, $sortorder);
419 if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
420 print_liste_field_titre(
"OpeningBalance", $_SERVER[
'PHP_SELF'],
"", $param,
"",
'class="right"', $sortfield, $sortorder);
422 print_liste_field_titre(
"Debit", $_SERVER[
'PHP_SELF'],
"t.debit",
"", $param,
'class="right"', $sortfield, $sortorder);
423 print_liste_field_titre(
"Credit", $_SERVER[
'PHP_SELF'],
"t.credit",
"", $param,
'class="right"', $sortfield, $sortorder);
424 print_liste_field_titre(
"Balance", $_SERVER[
"PHP_SELF"],
"", $param,
"",
'class="right"', $sortfield, $sortorder);
427 $parameters = array(
'arrayfields'=>$arrayfields,
'param'=>$param,
'sortfield'=>$sortfield,
'sortorder'=>$sortorder);
428 $reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object);
429 print $hookmanager->resPrint;
431 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
436 $sous_total_debit = 0;
437 $sous_total_credit = 0;
438 $total_opening_balance = 0;
439 $sous_total_opening_balance = 0;
440 $displayed_account =
"";
446 if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
447 $sql =
"SELECT t.numero_compte, (SUM(t.debit) - SUM(t.credit)) as opening_balance";
448 $sql .=
" FROM " . MAIN_DB_PREFIX .
"accounting_bookkeeping as t";
449 $sql .=
" WHERE t.entity = " . $conf->entity;
450 $sql .=
" AND t.doc_date < '" . $db->idate($search_date_start) .
"'";
451 $sql .=
" GROUP BY t.numero_compte";
453 $resql = $db->query(
$sql);
454 $nrows = $resql->num_rows;
455 $opening_balances = array();
456 for ($i = 0; $i < $nrows; $i++) {
457 $arr = $resql->fetch_array();
458 $opening_balances[
"'" . $arr[
'numero_compte'] .
"'"] = $arr[
'opening_balance'];
462 foreach ($object->lines as $line) {
464 $accountingaccountstatic->id = 0;
465 $accountingaccountstatic->account_number =
'';
467 if ($type !=
'sub') {
468 $accountingaccountstatic->fetch(
null, $line->numero_compte,
true);
469 if (!empty($accountingaccountstatic->account_number)) {
470 $accounting_account = $accountingaccountstatic->getNomUrl(0, 1, 1);
477 $total_debit += $line->debit;
478 $total_credit += $line->credit;
479 $opening_balance = isset($opening_balances[
"'".$line->numero_compte.
"'"]) ? $opening_balances[
"'".$line->numero_compte.
"'"] : 0;
480 $total_opening_balance += $opening_balance;
482 $tmparrayforrootaccount = $object->getRootAccount($line->numero_compte);
483 $root_account_description = $tmparrayforrootaccount[
'label'];
484 $root_account_number = $tmparrayforrootaccount[
'account_number'];
489 if (empty($accountingaccountstatic->label) && $accountingaccountstatic->id > 0) {
490 $link =
'<a class="editfielda reposition" href="' . DOL_URL_ROOT .
'/accountancy/admin/card.php?action=update&token=' .
newToken() .
'&id=' . $accountingaccountstatic->id .
'">' .
img_edit() .
'</a>';
491 } elseif ($accounting_account ==
'NotDefined') {
492 $link =
'<a href="' . DOL_URL_ROOT .
'/accountancy/admin/card.php?action=create&token=' .
newToken() .
'&accountingaccount=' .
length_accountg($line->numero_compte) .
'">' .
img_edit_add() .
'</a>';
493 } elseif (empty($tmparrayforrootaccount[
'label'])) {
501 if (!empty($show_subgroup)) {
503 if (empty($displayed_account) || $root_account_number != $displayed_account) {
505 if ($displayed_account !=
"") {
506 print
'<tr class="liste_total">';
507 print
'<td class="right">'.$langs->trans(
"SubTotal").
':</td>';
508 if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
509 print
'<td class="right nowraponall amount">'.price($sous_total_opening_balance).
'</td>';
511 print
'<td class="right nowraponall amount">'.price($sous_total_debit).
'</td>';
512 print
'<td class="right nowraponall amount">'.price($sous_total_credit).
'</td>';
513 if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
514 print
'<td class="right nowraponall amount">'.price(
price2num($sous_total_opening_balance + $sous_total_debit - $sous_total_credit)).
'</td>';
516 print
'<td class="right nowraponall amount">'.price(
price2num($sous_total_debit - $sous_total_credit)).
'</td>';
523 print
'<tr class="trforbreak">';
524 print
'<td colspan="'.($colspan+1).
'" style="font-weight:bold; border-bottom: 1pt solid black;">'.$line->numero_compte.($root_account_description ?
' - '.$root_account_description :
'').
'</td>';
527 $displayed_account = $root_account_number;
528 $sous_total_debit = 0;
529 $sous_total_credit = 0;
530 $sous_total_opening_balance = 0;
534 print
'<tr class="oddeven">';
536 if ($type ==
'sub') {
537 print
'<td>'.$line->subledger_account.
' <span class="opacitymedium">('.$line->subledger_label.
')</span></td>';
539 print
'<td>'.$accounting_account.
'</td>';
548 if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
549 print
'<td class="right nowraponall amount">'.price(
price2num($opening_balance,
'MT')).
'</td>';
553 if ($type ==
'sub') {
554 if ($line->subledger_account) {
555 $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);
557 $urlzoom .=
'&search_date_startmonth=' .
GETPOST(
'date_startmonth',
'int') .
'&search_date_startday=' .
GETPOST(
'date_startday',
'int') .
'&search_date_startyear=' .
GETPOST(
'date_startyear',
'int');
560 $urlzoom .=
'&search_date_endmonth=' .
GETPOST(
'date_endmonth',
'int') .
'&search_date_endday=' .
GETPOST(
'date_endday',
'int') .
'&search_date_endyear=' .
GETPOST(
'date_endyear',
'int');
564 if ($line->numero_compte) {
565 $urlzoom = DOL_URL_ROOT .
'/accountancy/bookkeeping/listbyaccount.php?search_accountancy_code_start=' . urlencode($line->numero_compte) .
'&search_accountancy_code_end=' . urlencode($line->numero_compte);
567 $urlzoom .=
'&search_date_startmonth=' .
GETPOST(
'date_startmonth',
'int') .
'&search_date_startday=' .
GETPOST(
'date_startday',
'int') .
'&search_date_startyear=' .
GETPOST(
'date_startyear',
'int');
570 $urlzoom .=
'&search_date_endmonth=' .
GETPOST(
'date_endmonth',
'int') .
'&search_date_endday=' .
GETPOST(
'date_endday',
'int') .
'&search_date_endyear=' .
GETPOST(
'date_endyear',
'int');
575 print
'<td class="right nowraponall amount"><a href="'.$urlzoom.
'">'.
price(
price2num($line->debit,
'MT')).
'</a></td>';
577 print
'<td class="right nowraponall amount"><a href="'.$urlzoom.
'">'.
price(
price2num($line->credit,
'MT')).
'</a></td>';
579 if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
580 print
'<td class="right nowraponall amount">'.price(
price2num($opening_balance + $line->debit - $line->credit,
'MT')).
'</td>';
582 print
'<td class="right nowraponall amount">'.price(
price2num($line->debit - $line->credit,
'MT')).
'</td>';
584 print
'<td class="center">';
590 $sous_total_debit += $line->debit;
591 $sous_total_credit += $line->credit;
592 $sous_total_opening_balance += $opening_balance;
595 if (!empty($show_subgroup)) {
596 print
'<tr class="liste_total"><td class="right">'.$langs->trans(
"SubTotal").
':</td>';
597 if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
598 print
'<td class="right nowraponall amount">'.price(
price2num($sous_total_opening_balance,
'MT')).
'</td>';
600 print
'<td class="right nowraponall amount">'.price(
price2num($sous_total_debit,
'MT')).
'</td>';
601 print
'<td class="right nowraponall amount">'.price(
price2num($sous_total_credit,
'MT')).
'</td>';
602 if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
603 print
'<td class="right nowraponall amount">' .
price(
price2num($sous_total_opening_balance + $sous_total_debit - $sous_total_credit,
'MT')) .
'</td>';
605 print
'<td class="right nowraponall amount">' .
price(
price2num($sous_total_debit - $sous_total_credit,
'MT')) .
'</td>';
611 print
'<tr class="liste_total"><td class="right">'.$langs->trans(
"AccountBalance").
':</td>';
612 if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
613 print
'<td class="nowrap right">'.price(
price2num($total_opening_balance,
'MT')).
'</td>';
615 print
'<td class="right nowraponall amount">'.price(
price2num($total_debit,
'MT')).
'</td>';
616 print
'<td class="right nowraponall amount">'.price(
price2num($total_credit,
'MT')).
'</td>';
617 if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
618 print
'<td class="right nowraponall amount">' .
price(
price2num($total_opening_balance + $total_debit - $total_credit,
'MT')) .
'</td>';
620 print
'<td class="right nowraponall amount">' .
price(
price2num($total_debit - $total_credit,
'MT')) .
'</td>';
625 $parameters = array(
'arrayfields'=>$arrayfields,
'sql'=>
$sql);
626 $reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object, $action);
627 print $hookmanager->resPrint;