diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 11931de6a7e..83066e21df6 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -3,7 +3,7 @@ * Copyright (C) 2004 Eric Seigne * Copyright (C) 2004-2012 Laurent Destailleur * Copyright (C) 2005 Marc Barilley / Ocebo - * Copyright (C) 2005-2013 Regis Houssin + * Copyright (C) 2005-2015 Regis Houssin * Copyright (C) 2006 Andre Cianfarani * Copyright (C) 2010-2012 Juanjo Menent * Copyright (C) 2012 Christophe Battarel @@ -69,7 +69,7 @@ $search_refcustomer=GETPOST('search_refcustomer','alpha'); $search_societe=GETPOST('search_societe','alpha'); $search_montant_ht=GETPOST('search_montant_ht','alpha'); $search_montant_ttc=GETPOST('search_montant_ttc','alpha'); -$search_status=GETPOST('search_status','alpha'); +$search_status=GETPOST('search_status','int'); $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); @@ -191,7 +191,7 @@ if ($search_refcustomer) $sql .= natural_search('f.ref_client', $search_refcusto if ($search_societe) $sql .= natural_search('s.nom', $search_societe); if ($search_montant_ht != '') $sql.= natural_search('f.total', $search_montant_ht, 1); if ($search_montant_ttc != '') $sql.= natural_search('f.total_ttc', $search_montant_ttc, 1); -if ($search_status >= 0 ) $sql.= " AND f.fk_statut = ".$db->escape($search_status); +if ($search_status != '') $sql.= " AND f.fk_statut = ".$db->escape($search_status); if ($month > 0) { if ($year > 0 && empty($day)) diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index cf5d6c990aa..59ed9afc504 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -1,7 +1,7 @@ * Copyright (C) 2004-2013 Laurent Destailleur - * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2005-2015 Regis Houssin * Copyright (C) 2015 Juanjo Menent * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2015 Raphaël Doursenaud @@ -781,6 +781,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire) print ''; print ''; + print ''; if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print ''; print ''; print ''; @@ -830,6 +831,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire) $societestatic->code_fournisseur = $obj->code_fournisseur; print $societestatic->getNomUrl(1,'customer',44); print ''; + print ''; if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print ''; print ''; print ''; @@ -844,6 +846,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire) } print ''; + print ''; if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print ''; print ''; print ''; @@ -852,7 +855,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire) } else { - $colspan=5; + $colspan=6; if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) $colspan++; print ''; } @@ -873,6 +876,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture- $facstatic=new FactureFournisseur($db); $sql = "SELECT ff.rowid, ff.ref, ff.fk_statut, ff.libelle, ff.total_ht, ff.total_tva, ff.total_ttc, ff.paye"; + $sql.= ", ff.date_lim_reglement"; $sql.= ", s.nom as name"; $sql.= ", s.rowid as socid"; $sql.= ", s.code_client"; @@ -889,6 +893,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture- if ($socid) $sql.= " AND ff.fk_soc = ".$socid; $sql.= " GROUP BY ff.rowid, ff.ref, ff.fk_statut, ff.libelle, ff.total_ht, ff.tva, ff.total_tva, ff.total_ttc, ff.paye,"; $sql.= " s.nom, s.rowid, s.code_client, s.code_fournisseur"; + $sql.= " ORDER BY ff.date_lim_reglement ASC"; $resql=$db->query($sql); if ($resql) @@ -898,6 +903,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture- print '
'.$langs->trans("BillsCustomersUnpaid",$num).' '.$num.''.$langs->trans("DateDue").''.$langs->trans("AmountHT").''.$langs->trans("AmountTTC").''.$langs->trans("Received").''.dol_print_date($db->jdate($obj->datelimite),'day').''.price($obj->total_ht).''.price($obj->total_ttc).''.price($obj->am).'
'.$langs->trans("Total").'   ('.$langs->trans("RemainderToTake").': '.price($total_ttc-$totalam).')  '.price($total).''.price($total_ttc).''.price($totalam).'
'.$langs->trans("NoInvoice").'
'; print ''; + print ''; if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print ''; print ''; print ''; @@ -926,6 +932,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture- $societestatic->code_client = $obj->code_client; $societestatic->code_fournisseur = $obj->code_fournisseur; print ''; + print ''; if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print ''; print ''; print ''; @@ -939,6 +946,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture- } print ''; + print ''; if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print ''; print ''; print ''; @@ -947,7 +955,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture- } else { - $colspan=5; + $colspan=6; if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) $colspan++; print ''; }
'.$langs->trans("BillsSuppliersUnpaid",$num).' '.$num.''.$langs->trans("DateDue").''.$langs->trans("AmountHT").''.$langs->trans("AmountTTC").''.$langs->trans("Paid").''.$societestatic->getNomUrl(1, 'supplier', 44).''.dol_print_date($db->jdate($obj->date_lim_reglement),'day').''.price($obj->total_ht).''.price($obj->total_ttc).''.price($obj->am).'
'.$langs->trans("Total").'   ('.$langs->trans("RemainderToPay").': '.price($total_ttc-$totalam).')  '.price($total).''.price($total_ttc).''.price($totalam).'
'.$langs->trans("NoInvoice").'