From 38369bc5c09cf66b2e570b9546da21011235d0cb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 6 Mar 2008 12:00:57 +0000 Subject: [PATCH] Number for ref and ref supplier are not the same for supplier invoices --- htdocs/fourn/facture/impayees.php | 33 +++++++++++++++++++------------ htdocs/fourn/facture/paiement.php | 17 ++++++++++------ htdocs/langs/en_US/main.lang | 1 + htdocs/langs/fr_FR/main.lang | 1 + 4 files changed, 33 insertions(+), 19 deletions(-) diff --git a/htdocs/fourn/facture/impayees.php b/htdocs/fourn/facture/impayees.php index 18278c5442c..cd87e1f1c58 100644 --- a/htdocs/fourn/facture/impayees.php +++ b/htdocs/fourn/facture/impayees.php @@ -1,7 +1,7 @@ * Copyright (C) 2004 Éric Seigne - * Copyright (C) 2004-2007 Laurent Destailleur + * Copyright (C) 2004-2008 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,15 +16,13 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Id$ */ /** \file htdocs/fourn/facture/impayees.php \ingroup facture \brief Page de liste des factures fournisseurs impayées - \version $Revision$ + \version $Id$ */ require("./pre.inc.php"); @@ -69,7 +67,7 @@ if ($user->rights->fournisseur->facture->lire) $offset = $limit * $page ; $sql = "SELECT s.nom, s.rowid as socid,"; - $sql.= " f.facnumber,f.total_ht,f.total_ttc,"; + $sql.= " f.rowid as ref, f.facnumber, f.total_ht, f.total_ttc,"; $sql.= $db->pdate("f.datef")." as df, ".$db->pdate("f.date_lim_reglement")." as datelimite, "; $sql.= " f.paye as paye, f.rowid as facid, f.fk_statut"; $sql.= " ,sum(pf.amount) as am"; @@ -95,7 +93,11 @@ if ($user->rights->fournisseur->facture->lire) if ($_GET["search_ref"]) { - $sql .= " AND f.facnumber like '%".$_GET["search_ref"]."%'"; + $sql .= " AND f.rowid like '%".$_GET["search_ref"]."%'"; + } + if ($_GET["search_ref_supplier"]) + { + $sql .= " AND f.facnumber like '%".$_GET["search_ref_supplier"]."%'"; } if ($_GET["search_societe"]) @@ -144,7 +146,8 @@ if ($user->rights->fournisseur->facture->lire) print ''; print ''; - print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"f.facnumber","","&socid=$socid","",$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"f.rowid","","&socid=$socid","",$sortfield,$sortorder); + print_liste_field_titre($langs->trans("RefSupplier"),$_SERVER["PHP_SELF"],"f.facnumber","","&socid=$socid","",$sortfield,$sortorder); print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"f.datef","","&socid=$socid",'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("DateDue"),$_SERVER["PHP_SELF"],"f.date_lim_reglement","","&socid=$socid",'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom","","&socid=$socid","",$sortfield,$sortorder); @@ -158,15 +161,17 @@ if ($user->rights->fournisseur->facture->lire) print ''; print ''; print ''; + print ''; + print ''; print ''; print ''; print ''; @@ -194,10 +199,12 @@ if ($user->rights->fournisseur->facture->lire) $class = "impayee"; print '\n"; + print "\n"; + print "\n"; print "\n"; @@ -221,7 +228,7 @@ if ($user->rights->fournisseur->facture->lire) } print ''; - print ""; + print ""; print ""; print ""; print ""; diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index f061b631535..3fa892f0f59 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -200,7 +200,8 @@ if ($action == 'create' || $action == 'add_paiement') $facture = new FactureFournisseur($db); $facture->fetch($facid); - $sql = 'SELECT s.nom, s.rowid as socid, f.amount, f.total_ttc as total, f.facnumber'; + $sql = 'SELECT s.nom, s.rowid as socid,'; + $sql.= ' f.rowid as ref, f.facnumber, f.amount, f.total_ttc as total'; if (!$user->rights->societe->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user "; $sql .= ' FROM '.MAIN_DB_PREFIX.'societe as s, '.MAIN_DB_PREFIX.'facture_fourn as f'; if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; @@ -357,8 +358,8 @@ if (! $_GET['action'] && ! $_POST['action']) if (! $sortorder) $sortorder='DESC'; if (! $sortfield) $sortfield='p.datep'; - $sql = 'SELECT p.rowid, '.$db->pdate('p.datep').' as dp, p.amount as pamount,'; - $sql.= ' f.amount, f.facnumber, f.rowid as facid,'; + $sql = 'SELECT p.rowid, p.rowid as pid, '.$db->pdate('p.datep').' as dp, p.amount as pamount,'; + $sql.= ' f.rowid as facid, f.rowid as ref, f.facnumber, f.amount,'; $sql.= ' s.rowid as socid, s.nom,'; $sql.= ' c.libelle as paiement_type, p.num_paiement,'; $sql.= ' ba.rowid as bid, ba.label'; @@ -389,7 +390,8 @@ if (! $_GET['action'] && ! $_POST['action']) print_barre_liste($langs->trans('Payments'), $page, 'paiement.php','',$sortfield,$sortorder,'',$num); print '
'; - print ''; + print '  '; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; print ''; print ''.img_object($langs->trans("ShowBill"),"bill")." "; - print ''.$objp->facnumber.''; + print ''.$objp->ref.''; if ($objp->datelimite < (time() - $conf->facture->fournisseur->warning_delay) && ! $objp->paye && $objp->fk_statut == 1) print img_warning($langs->trans("Late")); print "".dolibarr_trunc($objp->facnumber,12)."".dolibarr_print_date($objp->df)."".dolibarr_print_date($objp->datelimite)."
".$langs->trans("Total").": ".$langs->trans("Total").": ".price($total_ht)."".price($total_ttc)."".price($total_payed)."
'; print ''; - print_liste_field_titre($langs->trans('Ref'),'paiement.php','rowid','','','',$sortfield,$sortorder); + print_liste_field_titre($langs->trans('RefPayment'),'paiement.php','rowid','','','',$sortfield,$sortorder); + print_liste_field_titre($langs->trans('Invoice'),'paiement.php','facnumber','','','',$sortfield,$sortorder); print_liste_field_titre($langs->trans('Date'),'paiement.php','dp','','','',$sortfield,$sortorder); print_liste_field_titre($langs->trans('ThirdParty'),'paiement.php','s.nom','','','',$sortfield,$sortorder); print_liste_field_titre($langs->trans('Type'),'paiement.php','c.libelle','','','',$sortfield,$sortorder); @@ -404,9 +406,12 @@ if (! $_GET['action'] && ! $_POST['action']) $var=!$var; print ''; - // Ref - print ''; + // Ref payment + print ''; + // Ref invoice + print ''; + // Date print '\n"; diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 4d1be37f8f4..601428d446d 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -238,6 +238,7 @@ Statistics=Statistics Status=Status Ref=Ref. RefSupplier=Ref. supplier +RefPayment=Ref. payment CommercialProposals=Commercial proposals Comment=Comment Comments=Comments diff --git a/htdocs/langs/fr_FR/main.lang b/htdocs/langs/fr_FR/main.lang index 1d18b4f5723..992df7b2979 100644 --- a/htdocs/langs/fr_FR/main.lang +++ b/htdocs/langs/fr_FR/main.lang @@ -239,6 +239,7 @@ Statistics=Statistiques Status=État Ref=Réf. RefSupplier=Réf. fournisseur +RefPayment=Réf. paiement CommercialProposals=Propositions commerciales/devis Comment=Commentaire Comments=Commentaires
'.img_object($langs->trans('ShowPayment'),'payment').' '.$objp->rowid.''.img_object($langs->trans('ShowPayment'),'payment').' '.$objp->pid.''.dolibarr_trunc($objp->facnumber,12).''.dolibarr_print_date($objp->dp,'day')."