Review of ledger display (#26423)
* Review of ledger display * typo * Update listbyaccount.php * Update listbyaccount.php --------- Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
This commit is contained in:
parent
23c944a104
commit
ba458ddfd6
2 changed files with 60 additions and 34 deletions
|
|
@ -2,7 +2,7 @@
|
|||
/* Copyright (C) 2016 Neil Orley <neil.orley@oeris.fr>
|
||||
* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2020 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013-2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2013-2023 Alexandre Spangaro <aspangaro@easya.solutions>
|
||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -164,12 +164,13 @@ $arrayfields = array(
|
|||
't.doc_date'=>array('label'=>$langs->trans("Docdate"), 'checked'=>1),
|
||||
't.doc_ref'=>array('label'=>$langs->trans("Piece"), 'checked'=>1),
|
||||
't.label_operation'=>array('label'=>$langs->trans("Label"), 'checked'=>1),
|
||||
't.lettering_code'=>array('label'=>$langs->trans("Lettering"), 'checked'=>1),
|
||||
't.debit'=>array('label'=>$langs->trans("AccountingDebit"), 'checked'=>1),
|
||||
't.credit'=>array('label'=>$langs->trans("AccountingCredit"), 'checked'=>1),
|
||||
't.lettering_code'=>array('label'=>$langs->trans("LetteringCode"), 'checked'=>1),
|
||||
't.date_export'=>array('label'=>$langs->trans("DateExport"), 'checked'=>1),
|
||||
't.date_validated'=>array('label'=>$langs->trans("DateValidation"), 'checked'=>1, 'enabled'=>!getDolGlobalString("ACCOUNTANCY_DISABLE_CLOSURE_LINE_BY_LINE")),
|
||||
't.import_key'=>array('label'=>$langs->trans("ImportId"), 'checked'=>0, 'position'=>1100),
|
||||
't.balance'=>array('label'=>$langs->trans("Balance"), 'checked'=>1),
|
||||
't.date_export'=>array('label'=>$langs->trans("DateExport"), 'checked'=>-1),
|
||||
't.date_validated'=>array('label'=>$langs->trans("DateValidation"), 'checked'=>-1, 'enabled'=>!getDolGlobalString("ACCOUNTANCY_DISABLE_CLOSURE_LINE_BY_LINE")),
|
||||
't.import_key'=>array('label'=>$langs->trans("ImportId"), 'checked'=>-1, 'position'=>1100),
|
||||
);
|
||||
|
||||
if (!getDolGlobalString('ACCOUNTING_ENABLE_LETTERING')) {
|
||||
|
|
@ -260,9 +261,9 @@ if (empty($reshook)) {
|
|||
$search_date_validation_endyear = '';
|
||||
$search_date_validation_endmonth = '';
|
||||
$search_date_validation_endday = '';
|
||||
$search_lettering_code = '';
|
||||
$search_debit = '';
|
||||
$search_credit = '';
|
||||
$search_lettering_code = '';
|
||||
$search_not_reconciled = '';
|
||||
$search_import_key = '';
|
||||
$toselect = array();
|
||||
|
|
@ -339,6 +340,10 @@ if (empty($reshook)) {
|
|||
$param .= '&search_ledger_code[]='.urlencode($code);
|
||||
}
|
||||
}
|
||||
if (!empty($search_lettering_code)) {
|
||||
$filter['t.lettering_code'] = $search_lettering_code;
|
||||
$param .= '&search_lettering_code='.urlencode($search_lettering_code);
|
||||
}
|
||||
if (!empty($search_debit)) {
|
||||
$filter['t.debit'] = $search_debit;
|
||||
$param .= '&search_debit='.urlencode($search_debit);
|
||||
|
|
@ -347,10 +352,6 @@ if (empty($reshook)) {
|
|||
$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 (!empty($search_not_reconciled)) {
|
||||
$filter['t.reconciled_option'] = $search_not_reconciled;
|
||||
$param .= '&search_not_reconciled='.urlencode($search_not_reconciled);
|
||||
|
|
@ -679,7 +680,6 @@ if (empty($reshook)) {
|
|||
$newcardbutton .= dolGetButtonTitle($langs->trans('GroupByAccountAccounting'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT . '/accountancy/bookkeeping/listbyaccount.php?' . $url_param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected'));
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('GroupBySubAccountAccounting'), '', 'fa fa-align-left vmirror paddingleft imgforviewmode', DOL_URL_ROOT . '/accountancy/bookkeeping/listbyaccount.php?type=sub&' . $url_param, '', 1, array('morecss' => 'marginleftonly'));
|
||||
}
|
||||
$newcardbutton .= dolGetButtonTitleSeparator();
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('NewAccountingMvt'), '', 'fa fa-plus-circle paddingleft', DOL_URL_ROOT.'/accountancy/bookkeeping/card.php?action=create');
|
||||
}
|
||||
|
||||
|
|
@ -844,6 +844,13 @@ if (!empty($arrayfields['t.doc_ref']['checked'])) {
|
|||
if (!empty($arrayfields['t.label_operation']['checked'])) {
|
||||
print '<td class="liste_titre"><input type="text" size="7" class="flat" name="search_label_operation" value="'.dol_escape_htmltag($search_label_operation).'"/></td>';
|
||||
}
|
||||
// Lettering code
|
||||
if (!empty($arrayfields['t.lettering_code']['checked'])) {
|
||||
print '<td class="liste_titre center">';
|
||||
print '<input type="text" size="3" class="flat" name="search_lettering_code" value="'.$search_lettering_code.'"/>';
|
||||
print '<br><span class="nowrap"><input type="checkbox" name="search_not_reconciled" value="notreconciled"'.($search_not_reconciled == 'notreconciled' ? ' checked' : '').'>'.$langs->trans("NotReconciled").'</span>';
|
||||
print '</td>';
|
||||
}
|
||||
// Debit
|
||||
if (!empty($arrayfields['t.debit']['checked'])) {
|
||||
print '<td class="liste_titre right"><input type="text" class="flat" name="search_debit" size="4" value="'.dol_escape_htmltag($search_debit).'"></td>';
|
||||
|
|
@ -852,12 +859,9 @@ if (!empty($arrayfields['t.debit']['checked'])) {
|
|||
if (!empty($arrayfields['t.credit']['checked'])) {
|
||||
print '<td class="liste_titre right"><input type="text" class="flat" name="search_credit" size="4" value="'.dol_escape_htmltag($search_credit).'"></td>';
|
||||
}
|
||||
// Lettering code
|
||||
if (!empty($arrayfields['t.lettering_code']['checked'])) {
|
||||
print '<td class="liste_titre center">';
|
||||
print '<input type="text" size="3" class="flat" name="search_lettering_code" value="'.$search_lettering_code.'"/>';
|
||||
print '<br><span class="nowrap"><input type="checkbox" name="search_not_reconciled" value="notreconciled"'.($search_not_reconciled == 'notreconciled' ? ' checked' : '').'>'.$langs->trans("NotReconciled").'</span>';
|
||||
print '</td>';
|
||||
// Balance
|
||||
if (!empty($arrayfields['t.balance']['checked'])) {
|
||||
print '<td></td>';
|
||||
}
|
||||
// Date export
|
||||
if (!empty($arrayfields['t.date_export']['checked'])) {
|
||||
|
|
@ -920,14 +924,17 @@ if (!empty($arrayfields['t.doc_ref']['checked'])) {
|
|||
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.lettering_code']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['t.lettering_code']['label'], $_SERVER['PHP_SELF'], "t.lettering_code", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
}
|
||||
if (!empty($arrayfields['t.debit']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['t.debit']['label'], $_SERVER['PHP_SELF'], "t.debit", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||
}
|
||||
if (!empty($arrayfields['t.credit']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['t.credit']['label'], $_SERVER['PHP_SELF'], "t.credit", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||
}
|
||||
if (!empty($arrayfields['t.lettering_code']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['t.lettering_code']['label'], $_SERVER['PHP_SELF'], "t.lettering_code", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
if (!empty($arrayfields['t.balance']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['t.balance']['label'], "", "", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||
}
|
||||
if (!empty($arrayfields['t.date_export']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['t.date_export']['label'], $_SERVER['PHP_SELF'], "t.date_export", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
|
|
@ -977,18 +984,23 @@ while ($i < min($num, $limit)) {
|
|||
//if (empty($accountg)) $accountg = '-';
|
||||
|
||||
$colspan = 0; // colspan before field 'label of operation'
|
||||
$colspanend = 3; // colspan after debit/credit
|
||||
$colspanend = 0; // colspan after debit/credit
|
||||
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
$colspan++;
|
||||
}
|
||||
if (!empty($arrayfields['t.piece_num']['checked'])) { $colspan++; }
|
||||
if (!empty($arrayfields['t.code_journal']['checked'])) { $colspan++; }
|
||||
if (!empty($arrayfields['t.doc_date']['checked'])) { $colspan++; }
|
||||
if (!empty($arrayfields['t.doc_ref']['checked'])) { $colspan++; }
|
||||
if (!empty($arrayfields['t.label_operation']['checked'])) { $colspan++; }
|
||||
if (!empty($arrayfields['t.lettering_code']['checked'])) { $colspan++; }
|
||||
|
||||
if (!empty($arrayfields['t.balance']['checked'])) { $colspanend++; }
|
||||
if (!empty($arrayfields['t.date_export']['checked'])) { $colspanend++; }
|
||||
if (!empty($arrayfields['t.date_validating']['checked'])) { $colspanend++; }
|
||||
if (!empty($arrayfields['t.lettering_code']['checked'])) { $colspanend++; }
|
||||
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
$colspan++;
|
||||
$colspanend--;
|
||||
if (!empty($arrayfields['t.import_key']['checked'])) { $colspanend++; }
|
||||
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
$colspanend++;
|
||||
}
|
||||
|
||||
// Is it a break ?
|
||||
|
|
@ -1003,7 +1015,7 @@ while ($i < min($num, $limit)) {
|
|||
}
|
||||
print '<td class="nowrap right">'.price(price2num($sous_total_debit, 'MT')).'</td>';
|
||||
print '<td class="nowrap right">'.price(price2num($sous_total_credit, 'MT')).'</td>';
|
||||
print '<td colspan="'.$colspanend.'"></td>';
|
||||
if ($colspanend > 0) print '<td colspan="'.$colspanend.'"></td>';
|
||||
print '</tr>';
|
||||
// Show balance of last shown account
|
||||
$balance = $sous_total_debit - $sous_total_credit;
|
||||
|
|
@ -1020,7 +1032,7 @@ while ($i < min($num, $limit)) {
|
|||
print price(price2num($sous_total_credit - $sous_total_debit, 'MT'));
|
||||
print '</td>';
|
||||
}
|
||||
print '<td colspan="'.$colspanend.'"></td>';
|
||||
if ($colspanend > 0) print '<td colspan="'.$colspanend.'"></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
|
|
@ -1189,6 +1201,14 @@ while ($i < min($num, $limit)) {
|
|||
}
|
||||
}
|
||||
|
||||
// Lettering code
|
||||
if (!empty($arrayfields['t.lettering_code']['checked'])) {
|
||||
print '<td class="center">'.$line->lettering_code.'</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
|
||||
// Amount debit
|
||||
if (!empty($arrayfields['t.debit']['checked'])) {
|
||||
print '<td class="right nowraponall amount">'.($line->debit != 0 ? price($line->debit) : '').'</td>';
|
||||
|
|
@ -1213,12 +1233,16 @@ while ($i < min($num, $limit)) {
|
|||
$totalarray['val']['totalcredit'] += $line->credit;
|
||||
}
|
||||
|
||||
// Lettering code
|
||||
if (!empty($arrayfields['t.lettering_code']['checked'])) {
|
||||
print '<td class="center">'.$line->lettering_code.'</td>';
|
||||
// Amount balance
|
||||
if (!empty($arrayfields['t.balance']['checked'])) {
|
||||
print '<td class="right nowraponall amount">'.price(price2num($sous_total_debit + $line->debit - $sous_total_credit - $line->credit, 'MT')).'</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
if (!$i) {
|
||||
$totalarray['pos'][$totalarray['nbfield']] = 'totalbalance';
|
||||
};
|
||||
$totalarray['val']['totalbalance'] += $line->debit - $line->credit;
|
||||
}
|
||||
|
||||
// Exported operation date
|
||||
|
|
@ -1279,7 +1303,7 @@ if ($num > 0 && $colspan > 0) {
|
|||
print '<td class="right" colspan="'.$colspan.'">'.$langs->trans("TotalForAccount").' '.$accountg.':</td>';
|
||||
print '<td class="nowrap right">'.price(price2num($sous_total_debit, 'MT')).'</td>';
|
||||
print '<td class="nowrap right">'.price(price2num($sous_total_credit, 'MT')).'</td>';
|
||||
print '<td colspan="'.$colspanend.'"></td>';
|
||||
if ($colspanend > 0) print '<td colspan="'.$colspanend.'"></td>';
|
||||
print '</tr>';
|
||||
// Show balance of last shown account
|
||||
$balance = $sous_total_debit - $sous_total_credit;
|
||||
|
|
@ -1296,7 +1320,7 @@ if ($num > 0 && $colspan > 0) {
|
|||
print price(price2num($sous_total_credit - $sous_total_debit, 'MT'));
|
||||
print '</td>';
|
||||
}
|
||||
print '<td colspan="'.$colspanend.'"></td>';
|
||||
if ($colspanend > 0) print '<td colspan="'.$colspanend.'"></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
|
|
@ -1308,7 +1332,9 @@ if (!empty($totalarray['val']['totaldebit'])) {
|
|||
if (!empty($totalarray['val']['totalcredit'])) {
|
||||
$totalarray['val']['totalcredit'] = price2num($totalarray['val']['totalcredit'], 'MT');
|
||||
}
|
||||
|
||||
if (!empty($totalarray['val']['totalbalance'])) {
|
||||
$totalarray['val']['totalbalance'] = price2num($totalarray['val']['totaldebit'] - $totalarray['val']['totalcredit'], 'MT');
|
||||
}
|
||||
|
||||
// Show total line
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php';
|
||||
|
|
|
|||
|
|
@ -5247,12 +5247,12 @@ class Product extends CommonObject
|
|||
}
|
||||
|
||||
/**
|
||||
* Return clicable link of object (with eventually picto)
|
||||
* Return clickable link of object (with eventually picto)
|
||||
*
|
||||
* @param int $withpicto Add picto into link
|
||||
* @param string $option Where point the link ('stock', 'composition', 'category', 'supplier', '')
|
||||
* @param int $maxlength Maxlength of ref
|
||||
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
|
||||
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values when clicking
|
||||
* @param int $notooltip No tooltip
|
||||
* @param string $morecss ''=Add more css on link
|
||||
* @param int $add_label 0=Default, 1=Add label into string, >1=Add first chars into string
|
||||
|
|
|
|||
Loading…
Reference in a new issue