Fix warning

This commit is contained in:
Laurent Destailleur
2023-10-11 13:01:37 +02:00
parent ce87d92301
commit c07ac94d86
2 changed files with 13 additions and 11 deletions

View File

@@ -132,7 +132,7 @@ if (!$user->hasRight('accounting', 'mouvements', 'lire')) {
$param = ''; $param = '';
$parameters = array('socid'=>$socid); $parameters = array();
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) { if ($reshook < 0) {
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
@@ -358,7 +358,7 @@ if ($action != 'export_csv') {
$moreforfilter .= $formaccounting->multi_select_journal($search_ledger_code, 'search_ledger_code', 0, 1, 1, 1); $moreforfilter .= $formaccounting->multi_select_journal($search_ledger_code, 'search_ledger_code', 0, 1, 1, 1);
$moreforfilter .= '</div>'; $moreforfilter .= '</div>';
$moreforfilter .= '</br>'; //$moreforfilter .= '<br>';
$moreforfilter .= '<div class="divsearchfield">'; $moreforfilter .= '<div class="divsearchfield">';
// Accountancy account // Accountancy account
$moreforfilter .= $langs->trans('AccountAccounting').': '; $moreforfilter .= $langs->trans('AccountAccounting').': ';
@@ -409,7 +409,7 @@ if ($action != 'export_csv') {
print '</td>'; print '</td>';
// Fields from hook // Fields from hook
$parameters = array('arrayfields'=>$arrayfields); $parameters = array();
$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object); // Note that $action and $object may have been modified by hook $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint; print $hookmanager->resPrint;
@@ -439,7 +439,7 @@ if ($action != 'export_csv') {
print_liste_field_titre("Balance", $_SERVER["PHP_SELF"], "", $param, "", 'class="right"', $sortfield, $sortorder); print_liste_field_titre("Balance", $_SERVER["PHP_SELF"], "", $param, "", 'class="right"', $sortfield, $sortorder);
// Hook fields // Hook fields
$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder); $parameters = array('param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder);
$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint; print $hookmanager->resPrint;
// Action column // Action column
@@ -668,7 +668,7 @@ if ($action != 'export_csv') {
} }
print '</tr>'; print '</tr>';
$parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql); $parameters = array();
$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint; print $hookmanager->resPrint;

View File

@@ -1153,7 +1153,7 @@ class BookKeeping extends CommonObject
* @param int $offset offset limit * @param int $offset offset limit
* @param array $filter filter array * @param array $filter filter array
* @param string $filtermode filter mode (AND or OR) * @param string $filtermode filter mode (AND or OR)
* @param int $option option (0: general account or 1: subaccount) * @param int $option option (0: aggregate by general account or 1: aggreegate by subaccount)
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
public function fetchAllBalance($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, array $filter = array(), $filtermode = 'AND', $option = 0) public function fetchAllBalance($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, array $filter = array(), $filtermode = 'AND', $option = 0)
@@ -1209,9 +1209,9 @@ class BookKeeping extends CommonObject
} }
if (!empty($option)) { if (!empty($option)) {
$sql .= ' AND t.subledger_account IS NOT NULL'; $sql .= " AND t.subledger_account IS NOT NULL";
$sql .= ' AND t.subledger_account != ""'; $sql .= " AND t.subledger_account <> ''";
$sql .= ' GROUP BY t.numero_compte, t.label_compte, t.subledger_account, t.subledger_label'; $sql .= " GROUP BY t.numero_compte, t.label_compte, t.subledger_account, t.subledger_label";
$sortfield = 't.subledger_account'.($sortfield ? ','.$sortfield : ''); $sortfield = 't.subledger_account'.($sortfield ? ','.$sortfield : '');
$sortorder = 'ASC'.($sortfield ? ','.$sortfield : ''); $sortorder = 'ASC'.($sortfield ? ','.$sortfield : '');
} else { } else {
@@ -1237,8 +1237,10 @@ class BookKeeping extends CommonObject
$line->numero_compte = $obj->numero_compte; $line->numero_compte = $obj->numero_compte;
$line->label_compte = $obj->label_compte; $line->label_compte = $obj->label_compte;
$line->subledger_account = $obj->subledger_account; if (!empty($option)) {
$line->subledger_label = $obj->subledger_label; $line->subledger_account = $obj->subledger_account;
$line->subledger_label = $obj->subledger_label;
}
$line->debit = $obj->debit; $line->debit = $obj->debit;
$line->credit = $obj->credit; $line->credit = $obj->credit;