From 1711107420dcaeea69c75e6a19ebac3ad457826d Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sat, 27 May 2017 07:11:17 +0200 Subject: [PATCH] FIX : colspan in bank entries --- htdocs/compta/bank/bankentries.php | 86 ++++++++++++++---------------- 1 file changed, 39 insertions(+), 47 deletions(-) diff --git a/htdocs/compta/bank/bankentries.php b/htdocs/compta/bank/bankentries.php index fd3c1ec9825..2598d1659d0 100644 --- a/htdocs/compta/bank/bankentries.php +++ b/htdocs/compta/bank/bankentries.php @@ -3,8 +3,8 @@ * Copyright (C) 2004-2016 Laurent Destailleur * Copyright (C) 2005-2010 Regis Houssin * Copyright (C) 2012 Vinícius Nogueira - * Copyright (C) 2014 Florian Henry - * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2014 Florian Henry + * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2016 Juanjo Menent * Copyright (C) 2017 Alexandre Spangaro * @@ -195,7 +195,7 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETP $search_num_releve=''; $search_conciliated=''; $thirdparty=''; - + $account=""; if ($id > 0 || ! empty($ref)) $account=$object->id; } @@ -436,7 +436,6 @@ if ($id > 0 || ! empty($ref)) print ''.$langs->trans("Conciliate").''; } } - print ''; } } @@ -548,9 +547,9 @@ if ($resql) { $var=True; $num = $db->num_rows($resql); - + $arrayofselected=is_array($toselect)?$toselect:array(); - + // List of mass actions available $arrayofmassactions = array( //'presend'=>$langs->trans("SendByMail"), @@ -559,16 +558,14 @@ if ($resql) //if ($user->rights->bank->supprimer) $arrayofmassactions['delete']=$langs->trans("Delete"); if ($massaction == 'presend') $arrayofmassactions=array(); $massactionbutton=$form->selectMassAction('', $arrayofmassactions); - - + // Confirmation delete if ($action == 'delete') { $text=$langs->trans('ConfirmDeleteTransaction'); print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id.'&rowid='.GETPOST("rowid"), $langs->trans('DeleteTransaction'), $text, 'confirm_delete', null, '', 1); } - - + // Lines of title fields print '
'."\n"; if ($optioncss != '') print ''; @@ -582,7 +579,7 @@ if ($resql) print ''; print ''; if (GETPOST('bid')) print ''; - + // Form to reconcile if ($user->rights->banque->consolidate && $action == 'reconcile') { @@ -657,11 +654,10 @@ if ($resql) }); }); - - '; - + '; + $i = 0; - + // Title $bankcateg=new BankCateg($db); $morehtml='
'; @@ -669,7 +665,7 @@ if ($resql) $morehtml.=''; $morehtml.='/'.$nbtotalofpages.' '; $morehtml.='
'; - + $picto='title_bank'; if ($id > 0 || ! empty($ref)) $picto=''; if (GETPOST("bid")) @@ -681,13 +677,12 @@ if ($resql) { print_barre_liste($langs->trans("BankTransactions"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, $picto, 0, $morehtml, '', $limit); } - + // We can add page now to param if ($page != '') $param.='&page='.urlencode($page); - - + $moreforfilter = ''; - + $moreforfilter.='
'; $moreforfilter .= $langs->trans('DateOperationShort').' : '; $moreforfilter .= '
'.$langs->trans('From') . ' '; @@ -695,7 +690,7 @@ if ($resql) //$moreforfilter .= ' - '; $moreforfilter .= '
'.$langs->trans('to') . ' ' . $form->select_date($search_dt_end, 'search_end_dt', 0, 0, 1, "search_form", 1, 0, 1).'
'; $moreforfilter .= '
'; - + $moreforfilter.='
'; $moreforfilter .= $langs->trans('DateValueShort').' : '; $moreforfilter .= '
'.$langs->trans('From') . ' '; @@ -703,7 +698,7 @@ if ($resql) //$moreforfilter .= ' - '; $moreforfilter .= '
'.$langs->trans('to') . ' ' . $form->select_date($search_dv_end, 'search_end_dv', 0, 0, 1, "search_form", 1, 0, 1).'
'; $moreforfilter .= '
'; - + $parameters=array(); $reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook if (empty($reshook)) $moreforfilter .= $hookmanager->resPrint; @@ -715,10 +710,10 @@ if ($resql) print $moreforfilter; print '
'."\n"; } - + $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage; $selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields - + print '
'; print ''."\n"; @@ -803,7 +798,6 @@ if ($resql) print ''; print "\n"; - // Fields title print ''; if (! empty($arrayfields['b.rowid']['checked'])) print_liste_field_titre($arrayfields['b.rowid']['label'],$_SERVER['PHP_SELF'],'b.rowid','',$param,'',$sortfield,$sortorder); @@ -838,14 +832,13 @@ if ($resql) print_liste_field_titre('', $_SERVER["PHP_SELF"],"",'','','align="right"',$sortfield,$sortorder,'maxwidthsearch '); print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch '); print "\n"; - - + $balance = 0; // For balance $balancecalculated = false; - + // Loop on each record $sign = 1; - + $totalarray=array(); while ($i < min($num,$limit)) { @@ -885,9 +878,9 @@ if ($resql) $balancecalculated=true; } - + $balance = price2num($balance + ($sign * $objp->amount),'MT'); - + if (empty($cachebankaccount[$objp->bankid])) { $bankaccounttmp = new Account($db); @@ -899,8 +892,6 @@ if ($resql) { $bankaccount = $cachebankaccount[$objp->bankid]; } - - print ''; @@ -1012,19 +1003,19 @@ if ($resql) } elseif ($links[$key]['type']=='company') { - + } elseif ($links[$key]['type']=='user') { - + } elseif ($links[$key]['type']=='member') { - + } elseif ($links[$key]['type']=='sc') { - + } else { @@ -1044,11 +1035,10 @@ if ($resql) print ''; } } - print ''; if (! $i) $totalarray['nbfield']++; } - + // Date ope if (! empty($arrayfields['b.dateo']['checked'])) { @@ -1089,7 +1079,7 @@ if ($resql) print '\n"; if (! $i) $totalarray['nbfield']++; } - + // Third party if (! empty($arrayfields['bu.label']['checked'])) { @@ -1114,7 +1104,7 @@ if ($resql) print ''; if (! $i) $totalarray['nbfield']++; } - + // Bank account if (! empty($arrayfields['ba.ref']['checked'])) { @@ -1123,7 +1113,7 @@ if ($resql) print "\n"; if (! $i) $totalarray['nbfield']++; } - + // Debit if (! empty($arrayfields['b.debit']['checked'])) { @@ -1137,6 +1127,7 @@ if ($resql) if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['totaldebfield']=$totalarray['nbfield']; } + // Credit if (! empty($arrayfields['b.credit']['checked'])) { @@ -1150,7 +1141,7 @@ if ($resql) if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['totalcredfield']=$totalarray['nbfield']; } - + // Balance if (! empty($arrayfields['balance']['checked'])) { @@ -1169,8 +1160,9 @@ if ($resql) { print ''; } + if (! $i) $totalarray['nbfield']++; } - + if (! empty($arrayfields['b.num_releve']['checked'])) { print ''; if (! $i) $totalarray['nbfield']++; } - + // Action edit/delete print '
'.($objp->num_chq?$objp->num_chq:"")."-'; @@ -1197,7 +1189,7 @@ if ($resql) print ''; // Transaction reconciliated or edit link @@ -1254,7 +1246,7 @@ if ($resql) $i++; } - + // Show total line if (isset($totalarray['totaldebfield']) || isset($totalarray['totalcredfield'])) { @@ -1277,7 +1269,7 @@ if ($resql) print "
"; print "
"; - + print ''; $db->free($resql); }