';
print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"f.rowid","",$param,"",$sortfield,$sortorder);
- print_liste_field_titre($langs->trans("RefSupplier"),$_SERVER["PHP_SELF"],"f.facnumber","",$param,"",$sortfield,$sortorder);
+ print_liste_field_titre($langs->trans("RefSupplier"),$_SERVER["PHP_SELF"],"f.ref_supplier","",$param,"",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"f.datef","",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("DateDue"),$_SERVER["PHP_SELF"],"f.date_lim_reglement","",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom","",$param,"",$sortfield,$sortorder);
@@ -242,7 +242,7 @@ if ($user->rights->fournisseur->facture->lire)
print $facturestatic->getNomUrl(1);
print "\n";
- print "".dol_trunc($objp->facnumber,12)." \n";
+ print "".dol_trunc($objp->ref_supplier,12)." \n";
print "".dol_print_date($db->jdate($objp->df),'day')." \n";
print "".dol_print_date($db->jdate($objp->datelimite),'day');
diff --git a/htdocs/fourn/facture/index.php b/htdocs/fourn/facture/index.php
index b5922f52b29..6a3415f02f0 100644
--- a/htdocs/fourn/facture/index.php
+++ b/htdocs/fourn/facture/index.php
@@ -103,7 +103,7 @@ $htmlother=new FormOther($db);
llxHeader('',$langs->trans("SuppliersInvoices"),'EN:Suppliers_Invoices|FR:FactureFournisseur|ES:Facturas_de_proveedores');
$sql = "SELECT s.rowid as socid, s.nom, ";
-$sql.= " fac.rowid as facid, fac.ref, fac.facnumber, fac.datef, fac.date_lim_reglement as date_echeance,";
+$sql.= " fac.rowid as facid, fac.ref, fac.ref_supplier, fac.datef, fac.date_lim_reglement as date_echeance,";
$sql.= " fac.total_ht, fac.total_ttc, fac.paye as paye, fac.fk_statut as fk_statut, fac.libelle";
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 fac";
@@ -131,7 +131,7 @@ if (GETPOST("search_ref"))
}
if (GETPOST("search_ref_supplier"))
{
- $sql .= " AND fac.facnumber LIKE '%".$db->escape(GETPOST("search_ref_supplier"))."%'";
+ $sql .= " AND fac.ref_supplier LIKE '%".$db->escape(GETPOST("search_ref_supplier"))."%'";
}
if ($month > 0)
{
@@ -193,7 +193,7 @@ if ($resql)
print '';
print '';
print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"fac.rowid","",$param,"",$sortfield,$sortorder);
- print_liste_field_titre($langs->trans("RefSupplier"),$_SERVER["PHP_SELF"],"facnumber","",$param,"",$sortfield,$sortorder);
+ print_liste_field_titre($langs->trans("RefSupplier"),$_SERVER["PHP_SELF"],"ref_supplier","",$param,"",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"fac.datef,fac.rowid","",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("DateDue"),$_SERVER["PHP_SELF"],"fac.date_lim_reglement","",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"fac.libelle","",$param,"",$sortfield,$sortorder);
@@ -249,10 +249,10 @@ if ($resql)
print '';
$facturestatic->id=$obj->facid;
$facturestatic->ref=$obj->ref;
- $facturestatic->ref_supplier=$obj->facnumber;
+ $facturestatic->ref_supplier=$obj->ref_supplier;
print $facturestatic->getNomUrl(1);
print " \n";
- print ''.dol_trunc($obj->facnumber,10)." ";
+ print ''.dol_trunc($obj->ref_supplier,10)." ";
print ''.dol_print_date($db->jdate($obj->datef),'day').' ';
print ''.dol_print_date($db->jdate($obj->date_echeance),'day');
if (($obj->paye == 0) && ($obj->fk_statut > 0) && $db->jdate($obj->date_echeance) < ($now - $conf->facture->fournisseur->warning_delay)) print img_picto($langs->trans("Late"),"warning");
diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php
index 51b9972260e..9ee8f4d9a23 100644
--- a/htdocs/fourn/facture/paiement.php
+++ b/htdocs/fourn/facture/paiement.php
@@ -192,7 +192,7 @@ if ($action == 'create' || $action == 'add_paiement')
$dateinvoice=($datefacture==''?(empty($conf->global->MAIN_AUTOFILL_DATE)?-1:0):$datefacture);
$sql = 'SELECT s.nom, s.rowid as socid,';
- $sql.= ' f.rowid as ref, f.facnumber, f.amount, f.total_ttc as total';
+ $sql.= ' f.rowid, f.ref, f.ref_supplier, 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";
@@ -214,7 +214,7 @@ if ($action == 'create' || $action == 'add_paiement')
print ' ';
print ' ';
print ' ';
- print ' ';
+ print ' ';
print ' ';
print ' ';
@@ -257,7 +257,7 @@ if ($action == 'create' || $action == 'add_paiement')
/*
* Autres factures impayees
*/
- $sql = 'SELECT f.rowid as facid, f.rowid as ref, f.facnumber, f.total_ht, f.total_ttc, f.datef as df';
+ $sql = 'SELECT f.rowid as facid, f.ref, f.ref_supplier, f.total_ht, f.total_ttc, f.datef as df';
$sql.= ', SUM(pf.amount) as am';
$sql.= ' FROM '.MAIN_DB_PREFIX.'facture_fourn as f';
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'paiementfourn_facturefourn as pf ON pf.fk_facturefourn = f.rowid';
@@ -265,7 +265,7 @@ if ($action == 'create' || $action == 'add_paiement')
$sql.= ' AND f.fk_soc = '.$object->socid;
$sql.= ' AND f.paye = 0';
$sql.= ' AND f.fk_statut = 1'; // Statut=0 => non validee, Statut=2 => annulee
- $sql.= ' GROUP BY f.rowid, f.facnumber, f.total_ht, f.total_ttc, f.datef';
+ $sql.= ' GROUP BY f.rowid, f.ref_supplier, f.total_ht, f.total_ttc, f.datef';
$resql = $db->query($sql);
if ($resql)
{
@@ -298,7 +298,7 @@ if ($action == 'create' || $action == 'add_paiement')
print ' ';
print ''.img_object($langs->trans('ShowBill'),'bill').' '.$objp->ref;
print ' ';
- print ''.$objp->facnumber.' ';
+ print ''.$objp->ref_supplier.' ';
if ($objp->df > 0 )
{
print '';
@@ -441,7 +441,7 @@ if (empty($action))
print_liste_field_titre($langs->trans('Type'),'paiement.php','c.libelle','',$paramlist,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans('Account'),'paiement.php','ba.label','',$paramlist,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans('Amount'),'paiement.php','f.amount','',$paramlist,'align="right"',$sortfield,$sortorder);
- //print_liste_field_titre($langs->trans('Invoice'),'paiement.php','facnumber','',$paramlist,'',$sortfield,$sortorder);
+ //print_liste_field_titre($langs->trans('Invoice'),'paiement.php','ref_supplier','',$paramlist,'',$sortfield,$sortorder);
print " \n";
// Lines for filters fields
@@ -492,7 +492,7 @@ if (empty($action))
print ''.price($objp->pamount).' ';
// Ref invoice
- /*$invoicesupplierstatic->ref=$objp->facnumber;
+ /*$invoicesupplierstatic->ref=$objp->ref_supplier;
$invoicesupplierstatic->id=$objp->facid;
print '';
print $invoicesupplierstatic->getNomUrl(1);
diff --git a/htdocs/fourn/fiche.php b/htdocs/fourn/fiche.php
index 4a745fc9ef9..2d9a7a151b3 100644
--- a/htdocs/fourn/fiche.php
+++ b/htdocs/fourn/fiche.php
@@ -319,12 +319,12 @@ if ($object->fetch($id))
if ($user->rights->fournisseur->facture->lire)
{
// TODO move to DAO class
- $sql = 'SELECT f.rowid,f.libelle,f.facnumber,f.fk_statut,f.datef as df,f.total_ttc as amount,f.paye,';
+ $sql = 'SELECT f.rowid,f.libelle,f.ref_supplier,f.fk_statut,f.datef as df,f.total_ttc as amount,f.paye,';
$sql.= ' SUM(pf.amount) as am';
$sql.= ' FROM '.MAIN_DB_PREFIX.'facture_fourn as f';
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'paiementfourn_facturefourn as pf ON f.rowid=pf.fk_facturefourn';
$sql.= ' WHERE f.fk_soc = '.$object->id;
- $sql.= ' GROUP BY f.rowid,f.libelle,f.facnumber,f.fk_statut,f.datef,f.total_ttc,f.paye';
+ $sql.= ' GROUP BY f.rowid,f.libelle,f.ref_supplier,f.fk_statut,f.datef,f.total_ttc,f.paye';
$sql.= ' ORDER BY f.datef DESC';
$resql=$db->query($sql);
if ($resql)
@@ -349,7 +349,7 @@ if ($object->fetch($id))
print ' ';
print '';
print '';
- print img_object($langs->trans('ShowBill'),'bill').' '.$obj->facnumber.' '.dol_trunc($obj->libelle,14).' ';
+ print img_object($langs->trans('ShowBill'),'bill').' '.$obj->ref_supplier.' '.dol_trunc($obj->libelle,14).'';
print ''.dol_print_date($db->jdate($obj->df),'day').' ';
print ''.price($obj->amount).' ';
print '';
diff --git a/htdocs/fourn/index.php b/htdocs/fourn/index.php
index 25f781ccf0d..49ab7bdaeae 100644
--- a/htdocs/fourn/index.php
+++ b/htdocs/fourn/index.php
@@ -163,7 +163,7 @@ if (! empty($conf->fournisseur->enabled))
// Draft invoices
if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture->lire)
{
- $sql = "SELECT ff.facnumber, ff.rowid, ff.total_ttc, ff.type";
+ $sql = "SELECT ff.ref_supplier, ff.rowid, ff.total_ttc, ff.type";
$sql.= ", s.nom, s.rowid as socid";
$sql.= " FROM ".MAIN_DB_PREFIX."facture_fourn as ff";
$sql.= ", ".MAIN_DB_PREFIX."societe as s";
@@ -192,7 +192,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture-
$obj = $db->fetch_object($resql);
$var=!$var;
print ' ';
- $facturestatic->ref=$obj->facnumber;
+ $facturestatic->ref=$obj->ref;
$facturestatic->id=$obj->rowid;
$facturestatic->type=$obj->type;
print $facturestatic->getNomUrl(1,'');
@@ -321,7 +321,7 @@ if (count($companystatic->SupplierCategories))
//print "
\n";
-print '';
+print '
';
llxFooter();
diff --git a/htdocs/fourn/paiement/fiche.php b/htdocs/fourn/paiement/fiche.php
index b967a43984c..30afab7e935 100644
--- a/htdocs/fourn/paiement/fiche.php
+++ b/htdocs/fourn/paiement/fiche.php
@@ -234,7 +234,7 @@ if ($result > 0)
* Liste des factures
*/
$allow_delete = 1 ;
- $sql = 'SELECT f.rowid as ref, f.facnumber as ref_supplier, f.total_ttc, pf.amount, f.rowid as facid, f.paye, f.fk_statut, s.nom, s.rowid as socid';
+ $sql = 'SELECT f.rowid, f.ref, f.ref_supplier, f.total_ttc, pf.amount, f.rowid as facid, f.paye, f.fk_statut, s.nom, s.rowid as socid';
$sql .= ' FROM '.MAIN_DB_PREFIX.'paiementfourn_facturefourn as pf,'.MAIN_DB_PREFIX.'facture_fourn as f,'.MAIN_DB_PREFIX.'societe as s';
$sql .= ' WHERE pf.fk_facturefourn = f.rowid AND f.fk_soc = s.rowid';
$sql .= ' AND pf.fk_paiementfourn = '.$object->id;
diff --git a/htdocs/fourn/recap-fourn.php b/htdocs/fourn/recap-fourn.php
index ba10ab420c0..78cde75300f 100644
--- a/htdocs/fourn/recap-fourn.php
+++ b/htdocs/fourn/recap-fourn.php
@@ -90,7 +90,7 @@ if ($socid > 0)
print '';
- $sql = "SELECT s.nom, s.rowid as socid, f.facnumber, f.amount, f.datef as df,";
+ $sql = "SELECT s.nom, s.rowid as socid, f.ref_supplier, f.amount, f.datef as df,";
$sql.= " f.paye as paye, f.fk_statut as statut, f.rowid as facid,";
$sql.= " u.login, u.rowid as userid";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture_fourn as f,".MAIN_DB_PREFIX."user as u";
diff --git a/htdocs/install/mysql/migration/3.3.0-3.4.0.sql b/htdocs/install/mysql/migration/3.3.0-3.4.0.sql
index 5c2a86122ea..c47b7a9adcf 100755
--- a/htdocs/install/mysql/migration/3.3.0-3.4.0.sql
+++ b/htdocs/install/mysql/migration/3.3.0-3.4.0.sql
@@ -85,6 +85,7 @@ alter table llx_societe_rib CHANGE COLUMN adresse_proprio owner_address text;
alter table llx_societe_address CHANGE COLUMN ville town text;
alter table llx_societe_address CHANGE COLUMN cp zip varchar(10);
alter table llx_expedition CHANGE COLUMN fk_expedition_methode fk_shipping_method integer;
+alter table llx_facture_fourn CHANGE COLUMN facnumber ref_supplier varchar(30);
ALTER TABLE llx_c_shipment_mode ADD COLUMN tracking VARCHAR(256) NOT NULL DEFAULT '' AFTER description;
@@ -208,5 +209,3 @@ ALTER TABLE llx_user ADD COLUMN town varchar(50);
ALTER TABLE llx_user ADD COLUMN fk_state integer DEFAULT 0;
ALTER TABLE llx_user ADD COLUMN fk_country integer DEFAULT 0;
-
-ALTER TABLE llx_user_clicktodial ADD COLUMN url varchar(255);