Fix label of invoice
This commit is contained in:
parent
ca71d90d96
commit
536eb7e008
@ -456,7 +456,7 @@ if ($object->id > 0)
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Last supplier proposal
|
* Latest supplier proposal
|
||||||
*/
|
*/
|
||||||
$proposalstatic = new SupplierProposal($db);
|
$proposalstatic = new SupplierProposal($db);
|
||||||
|
|
||||||
@ -465,7 +465,7 @@ if ($object->id > 0)
|
|||||||
$sql = "SELECT p.rowid, p.ref, p.date_valid as dc, p.fk_statut, p.total_ht, p.tva as total_tva, p.total as total_ttc";
|
$sql = "SELECT p.rowid, p.ref, p.date_valid as dc, p.fk_statut, p.total_ht, p.tva as total_tva, p.total as total_ttc";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."supplier_proposal as p ";
|
$sql.= " FROM ".MAIN_DB_PREFIX."supplier_proposal as p ";
|
||||||
$sql.= " WHERE p.fk_soc =".$object->id;
|
$sql.= " WHERE p.fk_soc =".$object->id;
|
||||||
$sql.= " AND p.entity =".$conf->entity;
|
$sql.= " AND p.entity IN (".getEntity('supplier_proposal').")";
|
||||||
$sql.= " ORDER BY p.date_valid DESC";
|
$sql.= " ORDER BY p.date_valid DESC";
|
||||||
$sql.= " ".$db->plimit($MAXLIST);
|
$sql.= " ".$db->plimit($MAXLIST);
|
||||||
|
|
||||||
@ -528,7 +528,7 @@ if ($object->id > 0)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Last supplier orders
|
* Latest supplier orders
|
||||||
*/
|
*/
|
||||||
$orderstatic = new CommandeFournisseur($db);
|
$orderstatic = new CommandeFournisseur($db);
|
||||||
|
|
||||||
@ -541,6 +541,7 @@ if ($object->id > 0)
|
|||||||
$sql2.= ' FROM '.MAIN_DB_PREFIX.'societe as s';
|
$sql2.= ' FROM '.MAIN_DB_PREFIX.'societe as s';
|
||||||
$sql2.= ', '.MAIN_DB_PREFIX.'commande_fournisseur as c';
|
$sql2.= ', '.MAIN_DB_PREFIX.'commande_fournisseur as c';
|
||||||
$sql2.= ' WHERE c.fk_soc = s.rowid';
|
$sql2.= ' WHERE c.fk_soc = s.rowid';
|
||||||
|
$sql2.= " AND c.entity IN (".getEntity('commande_fournisseur').")";
|
||||||
$sql2.= ' AND s.rowid = '.$object->id;
|
$sql2.= ' AND s.rowid = '.$object->id;
|
||||||
// Show orders with status validated, shipping started and delivered (well any order we can bill)
|
// Show orders with status validated, shipping started and delivered (well any order we can bill)
|
||||||
$sql2.= " AND c.fk_statut IN (5)";
|
$sql2.= " AND c.fk_statut IN (5)";
|
||||||
@ -560,7 +561,7 @@ if ($object->id > 0)
|
|||||||
$sql = "SELECT count(p.rowid) as total";
|
$sql = "SELECT count(p.rowid) as total";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as p";
|
$sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as p";
|
||||||
$sql.= " WHERE p.fk_soc =".$object->id;
|
$sql.= " WHERE p.fk_soc =".$object->id;
|
||||||
$sql.= " AND p.entity =".$conf->entity;
|
$sql.= " AND p.entity IN (".getEntity('commande_fournisseur').")";
|
||||||
$resql=$db->query($sql);
|
$resql=$db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
@ -571,7 +572,7 @@ if ($object->id > 0)
|
|||||||
$sql = "SELECT p.rowid,p.ref, p.date_commande as dc, p.fk_statut, p.total_ht, p.tva as total_tva, p.total_ttc";
|
$sql = "SELECT p.rowid,p.ref, p.date_commande as dc, p.fk_statut, p.total_ht, p.tva as total_tva, p.total_ttc";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as p";
|
$sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as p";
|
||||||
$sql.= " WHERE p.fk_soc =".$object->id;
|
$sql.= " WHERE p.fk_soc =".$object->id;
|
||||||
$sql.= " AND p.entity =".$conf->entity;
|
$sql.= " AND p.entity IN (".getEntity('commande_fournisseur').")";
|
||||||
$sql.= " ORDER BY p.date_commande DESC";
|
$sql.= " ORDER BY p.date_commande DESC";
|
||||||
$sql.= " ".$db->plimit($MAXLIST);
|
$sql.= " ".$db->plimit($MAXLIST);
|
||||||
$resql=$db->query($sql);
|
$resql=$db->query($sql);
|
||||||
@ -632,7 +633,7 @@ if ($object->id > 0)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Last supplier invoices
|
* Latest supplier invoices
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$langs->load('bills');
|
$langs->load('bills');
|
||||||
@ -646,7 +647,7 @@ if ($object->id > 0)
|
|||||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'facture_fourn as f';
|
$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.= ' LEFT JOIN '.MAIN_DB_PREFIX.'paiementfourn_facturefourn as pf ON f.rowid=pf.fk_facturefourn';
|
||||||
$sql.= ' WHERE f.fk_soc = '.$object->id;
|
$sql.= ' WHERE f.fk_soc = '.$object->id;
|
||||||
$sql.= " AND f.entity =".$conf->entity;
|
$sql.= " AND f.entity IN (".getEntity('facture_fourn').")";
|
||||||
$sql.= ' GROUP BY f.rowid,f.libelle,f.ref,f.ref_supplier,f.fk_statut,f.datef,f.total_ht,f.total_tva,f.total_ttc,f.paye';
|
$sql.= ' GROUP BY f.rowid,f.libelle,f.ref,f.ref_supplier,f.fk_statut,f.datef,f.total_ht,f.total_tva,f.total_ttc,f.paye';
|
||||||
$sql.= ' ORDER BY f.datef DESC';
|
$sql.= ' ORDER BY f.datef DESC';
|
||||||
$resql=$db->query($sql);
|
$resql=$db->query($sql);
|
||||||
@ -674,15 +675,15 @@ if ($object->id > 0)
|
|||||||
print '<td>';
|
print '<td>';
|
||||||
print '<a href="facture/card.php?facid='.$obj->rowid.'">';
|
print '<a href="facture/card.php?facid='.$obj->rowid.'">';
|
||||||
$facturestatic->id=$obj->rowid;
|
$facturestatic->id=$obj->rowid;
|
||||||
$facturestatic->ref=($obj->ref?$obj->ref:$obj->rowid).($obj->ref_supplier?' - '.$obj->ref_supplier:'');
|
$facturestatic->ref=($obj->ref?$obj->ref:$obj->rowid);
|
||||||
$facturestatic->ref_supplier = $obj->ref_supplier;
|
$facturestatic->ref_supplier = $obj->ref_supplier;
|
||||||
|
$facturestatic->libelle = $obj->libelle;
|
||||||
$facturestatic->total_ht = $obj->total_ht;
|
$facturestatic->total_ht = $obj->total_ht;
|
||||||
$facturestatic->total_tva = $obj->total_tva;
|
$facturestatic->total_tva = $obj->total_tva;
|
||||||
$facturestatic->total_ttc = $obj->total_ttc;
|
$facturestatic->total_ttc = $obj->total_ttc;
|
||||||
//$facturestatic->ref_supplier=$obj->ref_supplier;
|
|
||||||
print $facturestatic->getNomUrl(1);
|
print $facturestatic->getNomUrl(1);
|
||||||
//print img_object($langs->trans('ShowBill'),'bill').' '.($obj->ref?$obj->ref:$obj->rowid).' - '.$obj->ref_supplier.'</a>';
|
print $obj->ref_supplier?' - '.$obj->ref_supplier:'';
|
||||||
print ' '.dol_trunc($obj->libelle,14);
|
print ($obj->libelle?' - ':'').dol_trunc($obj->libelle,14);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td align="center" class="nowrap">'.dol_print_date($db->jdate($obj->df),'day').'</td>';
|
print '<td align="center" class="nowrap">'.dol_print_date($db->jdate($obj->df),'day').'</td>';
|
||||||
print '<td align="right" class="nowrap">'.price($obj->amount).'</td>';
|
print '<td align="right" class="nowrap">'.price($obj->amount).'</td>';
|
||||||
|
|||||||
@ -1929,6 +1929,8 @@ class FactureFournisseur extends CommonInvoice
|
|||||||
$label .= '<br><b>' . $langs->trans('Ref') . ':</b> ' . $this->ref;
|
$label .= '<br><b>' . $langs->trans('Ref') . ':</b> ' . $this->ref;
|
||||||
if (! empty($this->ref_supplier))
|
if (! empty($this->ref_supplier))
|
||||||
$label.= '<br><b>' . $langs->trans('RefSupplier') . ':</b> ' . $this->ref_supplier;
|
$label.= '<br><b>' . $langs->trans('RefSupplier') . ':</b> ' . $this->ref_supplier;
|
||||||
|
if (! empty($this->libelle))
|
||||||
|
$label.= '<br><b>' . $langs->trans('Label') . ':</b> ' . $this->libelle;
|
||||||
if (! empty($this->total_ht))
|
if (! empty($this->total_ht))
|
||||||
$label.= '<br><b>' . $langs->trans('AmountHT') . ':</b> ' . price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency);
|
$label.= '<br><b>' . $langs->trans('AmountHT') . ':</b> ' . price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency);
|
||||||
if (! empty($this->total_tva))
|
if (! empty($this->total_tva))
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user