Fix label of invoice
This commit is contained in:
parent
ca71d90d96
commit
536eb7e008
@ -107,7 +107,7 @@ if (empty($reshook))
|
||||
// Fill array 'array_options' with data from update form
|
||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
||||
$ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute'));
|
||||
|
||||
|
||||
if ($ret < 0) $error++;
|
||||
if (! $error)
|
||||
{
|
||||
@ -456,7 +456,7 @@ if ($object->id > 0)
|
||||
|
||||
|
||||
/*
|
||||
* Last supplier proposal
|
||||
* Latest supplier proposal
|
||||
*/
|
||||
$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.= " FROM ".MAIN_DB_PREFIX."supplier_proposal as p ";
|
||||
$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.= " ".$db->plimit($MAXLIST);
|
||||
|
||||
@ -528,7 +528,7 @@ if ($object->id > 0)
|
||||
}
|
||||
|
||||
/*
|
||||
* Last supplier orders
|
||||
* Latest supplier orders
|
||||
*/
|
||||
$orderstatic = new CommandeFournisseur($db);
|
||||
|
||||
@ -541,6 +541,7 @@ if ($object->id > 0)
|
||||
$sql2.= ' FROM '.MAIN_DB_PREFIX.'societe as s';
|
||||
$sql2.= ', '.MAIN_DB_PREFIX.'commande_fournisseur as c';
|
||||
$sql2.= ' WHERE c.fk_soc = s.rowid';
|
||||
$sql2.= " AND c.entity IN (".getEntity('commande_fournisseur').")";
|
||||
$sql2.= ' AND s.rowid = '.$object->id;
|
||||
// Show orders with status validated, shipping started and delivered (well any order we can bill)
|
||||
$sql2.= " AND c.fk_statut IN (5)";
|
||||
@ -558,9 +559,9 @@ if ($object->id > 0)
|
||||
|
||||
// TODO move to DAO class
|
||||
$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.= " AND p.entity =".$conf->entity;
|
||||
$sql.= " AND p.entity IN (".getEntity('commande_fournisseur').")";
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
@ -569,9 +570,9 @@ 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.= " 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.= " AND p.entity =".$conf->entity;
|
||||
$sql.= " AND p.entity IN (".getEntity('commande_fournisseur').")";
|
||||
$sql.= " ORDER BY p.date_commande DESC";
|
||||
$sql.= " ".$db->plimit($MAXLIST);
|
||||
$resql=$db->query($sql);
|
||||
@ -632,7 +633,7 @@ if ($object->id > 0)
|
||||
}
|
||||
|
||||
/*
|
||||
* Last supplier invoices
|
||||
* Latest supplier invoices
|
||||
*/
|
||||
|
||||
$langs->load('bills');
|
||||
@ -646,7 +647,7 @@ if ($object->id > 0)
|
||||
$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.= " 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.= ' ORDER BY f.datef DESC';
|
||||
$resql=$db->query($sql);
|
||||
@ -674,15 +675,15 @@ if ($object->id > 0)
|
||||
print '<td>';
|
||||
print '<a href="facture/card.php?facid='.$obj->rowid.'">';
|
||||
$facturestatic->id=$obj->rowid;
|
||||
$facturestatic->ref=($obj->ref?$obj->ref:$obj->rowid).($obj->ref_supplier?' - '.$obj->ref_supplier:'');
|
||||
$facturestatic->ref_supplier = $obj->ref_supplier;
|
||||
$facturestatic->total_ht = $obj->total_ht;
|
||||
$facturestatic->ref=($obj->ref?$obj->ref:$obj->rowid);
|
||||
$facturestatic->ref_supplier = $obj->ref_supplier;
|
||||
$facturestatic->libelle = $obj->libelle;
|
||||
$facturestatic->total_ht = $obj->total_ht;
|
||||
$facturestatic->total_tva = $obj->total_tva;
|
||||
$facturestatic->total_ttc = $obj->total_ttc;
|
||||
//$facturestatic->ref_supplier=$obj->ref_supplier;
|
||||
print $facturestatic->getNomUrl(1);
|
||||
//print img_object($langs->trans('ShowBill'),'bill').' '.($obj->ref?$obj->ref:$obj->rowid).' - '.$obj->ref_supplier.'</a>';
|
||||
print ' '.dol_trunc($obj->libelle,14);
|
||||
print $obj->ref_supplier?' - '.$obj->ref_supplier:'';
|
||||
print ($obj->libelle?' - ':'').dol_trunc($obj->libelle,14);
|
||||
print '</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>';
|
||||
|
||||
@ -1929,6 +1929,8 @@ class FactureFournisseur extends CommonInvoice
|
||||
$label .= '<br><b>' . $langs->trans('Ref') . ':</b> ' . $this->ref;
|
||||
if (! empty($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))
|
||||
$label.= '<br><b>' . $langs->trans('AmountHT') . ':</b> ' . price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency);
|
||||
if (! empty($this->total_tva))
|
||||
|
||||
Loading…
Reference in New Issue
Block a user