From 6e947add92748c1af17d8db0fe1d4b813b94f2ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 2 Oct 2015 08:58:09 +0200 Subject: [PATCH 1/4] Update index.php --- htdocs/compta/index.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index cf5d6c990aa..8dbd132297e 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -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").''.$obj->datelimite.''.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 ''; } From 6f9b0e1053fb928865a33f05d4b5c690318ed051 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 2 Oct 2015 10:37:08 +0200 Subject: [PATCH 2/4] Fix: sql error, status is an integer --- htdocs/compta/facture/list.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 11931de6a7e..8af55750bae 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_montant_ht != '') $sql.= " AND f.fk_statut = ".$db->escape($search_status); if ($month > 0) { if ($year > 0 && empty($day)) From 65935c6603f05ee5d195b7ae5274bed796e11ec2 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 2 Oct 2015 10:46:32 +0200 Subject: [PATCH 3/4] Fix: copy/paste error --- htdocs/compta/facture/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 8af55750bae..83066e21df6 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -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_montant_ht != '') $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)) From 8912e111a30d83b717f805eac3bc99dd4368524a Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 2 Oct 2015 11:21:23 +0200 Subject: [PATCH 4/4] Fix: wrong date format --- htdocs/compta/index.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index 8dbd132297e..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 @@ -831,7 +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 ''; + print ''; if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print ''; print ''; print ''; @@ -932,7 +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 ''; + print ''; if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print ''; print ''; print '';
'.$langs->trans("BillsSuppliersUnpaid",$num).' '.$num.''.$langs->trans("DateDue").''.$langs->trans("AmountHT").''.$langs->trans("AmountTTC").''.$langs->trans("Paid").''.$societestatic->getNomUrl(1, 'supplier', 44).''.$obj->date_lim_reglement.''.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").'
'.$obj->datelimite.''.dol_print_date($db->jdate($obj->datelimite),'day').''.price($obj->total_ht).''.price($obj->total_ttc).''.price($obj->am).''.$societestatic->getNomUrl(1, 'supplier', 44).''.$obj->date_lim_reglement.''.dol_print_date($db->jdate($obj->date_lim_reglement),'day').''.price($obj->total_ht).''.price($obj->total_ttc).''.price($obj->am).'