diff --git a/htdocs/compta/prelevement/bons.php b/htdocs/compta/prelevement/bons.php index 695afb7562f..8f90183f0f7 100644 --- a/htdocs/compta/prelevement/bons.php +++ b/htdocs/compta/prelevement/bons.php @@ -37,33 +37,57 @@ $socid = GETPOST('socid','int'); if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'prelevement','','','bons'); -// Get supervariables +$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; +$sortfield = GETPOST('sortfield','alpha'); +$sortorder = GETPOST('sortorder','alpha'); $page = GETPOST('page','int'); -$sortorder = ((GETPOST('sortorder','alpha')=="")) ? "DESC" : GETPOST('sortorder','alpha'); -$sortfield = ((GETPOST('sortfield','alpha')=="")) ? "p.datec" : GETPOST('sortfield','alpha'); +if ($page == -1) { $page = 0; } +$offset = $limit * $page; +$pageprev = $page - 1; +$pagenext = $page + 1; +if (! $sortorder) $sortorder="DESC"; +if (! $sortfield) $sortfield="p.datec"; + +// Get supervariables $statut = GETPOST('statut','int'); -$search_line = GETPOST('search_ligne','int'); +$search_ref = GETPOST('search_ref','alpha'); + + +/* + * Actions + */ + +if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers +{ + $search_ref=""; +} + + +/* + * View + */ llxHeader('',$langs->trans("WithdrawalsReceipts")); $bon=new BonPrelevement($db,""); -if ($page == -1) { $page = 0 ; } -$offset = $conf->liste_limit * $page ; -$pageprev = $page - 1; -$pagenext = $page + 1; - - -/* - * Mode List - * - */ $sql = "SELECT p.rowid, p.ref, p.amount, p.statut"; $sql.= ", p.datec"; $sql.= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p"; $sql.= " WHERE p.entity = ".$conf->entity; -$sql.= " ORDER BY $sortfield $sortorder "; -$sql.= $db->plimit($conf->liste_limit+1, $offset); +if ($search_ref) $sql.=natural_search("p.ref", $search_ref); + +$sql.= $db->order($sortfield,$sortorder); + +// Count total nb of records +$nbtotalofrecords = ''; +if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) +{ + $result = $db->query($sql); + $nbtotalofrecords = $db->num_rows($result); +} + +$sql.= $db->plimit($limit + 1,$offset); $result = $db->query($sql); if ($result) @@ -73,9 +97,22 @@ if ($result) $urladd= "&statut=".$statut; - print_barre_liste($langs->trans("WithdrawalsReceipts"), $page, $_SERVER["PHP_SELF"], $urladd, $sortfield, $sortorder, '', $num); + // Lines of title fields + print '
'; + if ($optioncss != '') print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + + print_barre_liste($langs->trans("WithdrawalsReceipts"), $page, $_SERVER["PHP_SELF"], $urladd, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_generic', 0, '', '', $limit); - print ''; + $moreforfilter=''; + + print '
'; + print '
'."\n"; print ''; print_liste_field_titre($langs->trans("WithdrawalsReceipts"),$_SERVER["PHP_SELF"],"p.ref",'','','class="liste_titre"'); @@ -84,17 +121,18 @@ if ($result) print "\n"; print ''; - print ''; - print ''; + print ''; print ''; - print ''; - print ''; + print ''; print ''; $var=True; - while ($i < min($num,$conf->liste_limit)) - { + while ($i < min($num,$limit)) + { $obj = $db->fetch_object($result); $var=!$var; @@ -113,6 +151,10 @@ if ($result) $i++; } print "
 '; + $searchpitco=$form->showFilterAndCheckAddButtons(0); + print $searchpitco; + print '
"; + print ''; + + print ''; + $db->free($result); } else diff --git a/htdocs/compta/prelevement/list.php b/htdocs/compta/prelevement/list.php index 9e33bac4046..7a7eeb7610a 100644 --- a/htdocs/compta/prelevement/list.php +++ b/htdocs/compta/prelevement/list.php @@ -23,6 +23,7 @@ * \ingroup prelevement * \brief Page liste des prelevements */ + require('../../main.inc.php'); require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/ligneprelevement.class.php'; @@ -38,10 +39,18 @@ $socid = GETPOST('socid','int'); if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'prelevement','','','bons'); -// Get supervariables + +$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; +$sortfield = GETPOST('sortfield','alpha'); +$sortorder = GETPOST('sortorder','alpha'); $page = GETPOST('page','int'); -$sortorder = ((GETPOST('sortorder','alpha')=="")) ? "DESC" : GETPOST('sortorder','alpha'); -$sortfield = ((GETPOST('sortfield','alpha')=="")) ? "p.datec" : GETPOST('sortfield','alpha'); +if ($page == -1) { $page = 0; } +$offset = $limit * $page; +$pageprev = $page - 1; +$pagenext = $page + 1; +if (! $sortorder) $sortorder="DESC"; +if (! $sortfield) $sortfield="p.datec"; + $search_line = GETPOST('search_line','alpha'); $search_bon = GETPOST('search_bon','alpha'); $search_code = GETPOST('search_code','alpha'); @@ -51,9 +60,12 @@ $statut = GETPOST('statut','int'); $bon=new BonPrelevement($db,""); $ligne=new LignePrelevement($db,$user); -$offset = $conf->liste_limit * $page ; -if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers +/* + * Actions + */ + +if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers { $search_line=""; $search_bon=""; @@ -62,10 +74,13 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both $statut=""; } + /* * View */ +$form=new Form($db); + llxHeader('',$langs->trans("WithdrawalsLines")); $sql = "SELECT p.rowid, p.ref, p.statut, p.datec"; @@ -83,24 +98,22 @@ $sql.= " AND pf.fk_facture = f.rowid"; $sql.= " AND f.fk_soc = s.rowid"; $sql.= " AND f.entity = ".$conf->entity; if ($socid) $sql.= " AND s.rowid = ".$socid; -if ($search_line) +if ($search_line) $sql.= " AND pl.rowid = '".$db->escape($search_line)."'"; +if ($search_bon) $sql.= natural_search("p.ref", $search_bon); +if ($search_code) $sql.= natural_search("s.code_client", $search_code); +if ($search_company) natural_search("s.nom", $search_company); + +$sql.= $db->order($sortfield,$sortorder); + +// Count total nb of records +$nbtotalofrecords = ''; +if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { - $sql.= " AND pl.rowid = '".$db->escape($search_line)."'"; + $result = $db->query($sql); + $nbtotalofrecords = $db->num_rows($result); } -if ($search_bon) -{ - $sql.= " AND p.ref LIKE '%".$db->escape($search_bon)."%'"; -} -if ($search_code) -{ - $sql.= " AND s.code_client LIKE '%".$db->escape($search_code)."%'"; -} -if ($search_company) -{ - $sql .= " AND s.nom LIKE '%".$db->escape($search_company)."%'"; -} -$sql.=$db->order($sortfield,$sortorder); -$sql.=$db->plimit($conf->liste_limit+1, $offset); + +$sql.= $db->plimit($limit + 1,$offset); $result = $db->query($sql); if ($result) @@ -111,11 +124,15 @@ if ($result) $urladd = "&statut=".$statut; $urladd .= "&search_bon=".$search_bon; - print_barre_liste($langs->trans("WithdrawalsLines"), $page, $_SERVER["PHP_SELF"], $urladd, $sortfield, $sortorder, '', $num); + print_barre_liste($langs->trans("WithdrawalsLines"), $page, $_SERVER["PHP_SELF"], $urladd, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_generic', 0, '', '', $limit); print"\n\n"; print '
'; - print ''; + + $moreforfilter=''; + + print '
'; + print '
'."\n"; print ''; print_liste_field_titre($langs->trans("Line"),$_SERVER["PHP_SELF"]); @@ -144,7 +161,7 @@ if ($result) $var=True; - while ($i < min($num,$conf->liste_limit)) + while ($i < min($num,$limit)) { $obj = $db->fetch_object($result); @@ -185,6 +202,7 @@ if ($result) $i++; } print "
"; + print ''; print '
'; diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php index 74b80ec0e82..5b2c6b70a13 100644 --- a/htdocs/compta/resultat/index.php +++ b/htdocs/compta/resultat/index.php @@ -641,7 +641,9 @@ if (! empty($conf->don->enabled)) $totentrees=array(); $totsorties=array(); -print ''; +print '
'; +print '
'."\n"; + print ''; for ($annee = $year_start ; $annee <= $year_end ; $annee++) @@ -735,7 +737,7 @@ for ($annee = $year_start ; $annee <= $year_end ; $annee++) print "\n"; print "
 
"; - +print ''; llxFooter(); $db->close(); diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index 827fd5c5e4a..4ed3ecb7cef 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -967,7 +967,7 @@ if ($action == 'create') // Description (must be a textarea and not html must be allowed (used in list view) print ''.$langs->trans("Description").''; print ''; - print ''; + print ''; print ''; // Project diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php index 9d01643825a..563c57f5ad7 100644 --- a/htdocs/fichinter/list.php +++ b/htdocs/fichinter/list.php @@ -251,7 +251,8 @@ if ($result) $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage; $selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields - print ''; + print '
'; + print '
'."\n"; print ''; if (! empty($arrayfields['f.ref']['checked'])) print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"f.ref","",$param,'',$sortfield,$sortorder); if (! empty($arrayfields['s.nom']['checked'])) print_liste_field_titre($langs->trans("ThirdParty"),$_SERVER["PHP_SELF"],"s.nom","",$param,'',$sortfield,$sortorder); @@ -527,6 +528,8 @@ if ($result) } print '
'; + print ''; + print "\n"; $db->free($result); } diff --git a/htdocs/langs/en_US/compta.lang b/htdocs/langs/en_US/compta.lang index c4cd1b53d71..1afd69b73e0 100644 --- a/htdocs/langs/en_US/compta.lang +++ b/htdocs/langs/en_US/compta.lang @@ -81,7 +81,7 @@ LT2PaymentES=IRPF Payment LT2PaymentsES=IRPF Payments VATPayment=Sales tax payment VATPayments=Sales tax payments -VATRefund=Sales tax refund Refund +VATRefund=Sales tax refund Refund=Refund SocialContributionsPayments=Social/fiscal taxes payments ShowVatPayment=Show VAT payment