diff --git a/htdocs/core/boxes/box_commandes.php b/htdocs/core/boxes/box_commandes.php
index 53e3aaf2861b5260da8e85f766ef776a87d8abbf..6eb5006182c945430e78897e336f6b494673b21e 100644
--- a/htdocs/core/boxes/box_commandes.php
+++ b/htdocs/core/boxes/box_commandes.php
@@ -128,7 +128,7 @@ class box_commandes extends ModeleBoxes
$this->info_box_contents[$line][] = array(
'td' => 'align="right"',
- 'text' => price($objp->total_ht),
+ 'text' => price($objp->total_ht, 0, $langs, 0, -1, -1, $conf->currency),
);
if (! empty($conf->global->ORDER_BOX_LAST_ORDERS_SHOW_VALIDATE_USER)) {
diff --git a/htdocs/core/boxes/box_factures.php b/htdocs/core/boxes/box_factures.php
index dd1059cf9d22b2d9f08478075c05775801aa987d..d04c3e48a3bf8e9c10ec555b11157b8c148ced18 100644
--- a/htdocs/core/boxes/box_factures.php
+++ b/htdocs/core/boxes/box_factures.php
@@ -94,10 +94,10 @@ class box_factures extends ModeleBoxes
$num = $db->num_rows($result);
$now=dol_now();
- $i = 0;
+ $line = 0;
$l_due_date = $langs->trans('Late').' ('.strtolower($langs->trans('DateEcheance')).': %s)';
- while ($i < $num) {
+ while ($line < $num) {
$objp = $db->fetch_object($result);
$datelimite = $db->jdate($objp->datelimite);
$date = $db->jdate($objp->df);
@@ -115,39 +115,39 @@ class box_factures extends ModeleBoxes
$late = '';
if ($objp->paye == 0 && ($objp->fk_statut != 2 && $objp->fk_statut != 3) && $datelimite < ($now - $conf->facture->client->warning_delay)) { $late = img_warning(sprintf($l_due_date,dol_print_date($datelimite,'day')));}
- $this->info_box_contents[$i][] = array(
+ $this->info_box_contents[$line][] = array(
'td' => 'align="left"',
'text' => $facturestatic->getNomUrl(1),
'text2'=> $late,
'asis' => 1,
);
- $this->info_box_contents[$i][] = array(
+ $this->info_box_contents[$line][] = array(
'td' => 'align="left"',
'text' => $societestatic->getNomUrl(1, '', 40),
'asis' => 1,
);
- $this->info_box_contents[$i][] = array(
+ $this->info_box_contents[$line][] = array(
'td' => 'align="right"',
- 'text' => price($objp->total_ht),
+ 'text' => price($objp->total_ht, 0, $langs, 0, -1, -1, $conf->currency),
);
- $this->info_box_contents[$i][] = array(
+ $this->info_box_contents[$line][] = array(
'td' => 'align="right"',
'text' => dol_print_date($date,'day'),
);
- $this->info_box_contents[$i][] = array(
+ $this->info_box_contents[$line][] = array(
'td' => 'align="right" width="18"',
'text' => $facturestatic->LibStatut($objp->paye,$objp->fk_statut,3),
);
- $i++;
+ $line++;
}
if ($num==0)
- $this->info_box_contents[$i][0] = array(
+ $this->info_box_contents[$line][0] = array(
'td' => 'align="center"',
'text'=>$langs->trans("NoRecordedInvoices"),
);
diff --git a/htdocs/core/boxes/box_factures_fourn.php b/htdocs/core/boxes/box_factures_fourn.php
index f48d2ab43d31f9fe586c848bc4fd458c54df2e72..2f31fa61f786d23ac41a2e42662119a6819831b6 100644
--- a/htdocs/core/boxes/box_factures_fourn.php
+++ b/htdocs/core/boxes/box_factures_fourn.php
@@ -56,10 +56,10 @@ class box_factures_fourn extends ModeleBoxes
$this->max=$max;
include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
- include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
+ include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
$facturestatic = new FactureFournisseur($db);
- $societestatic = new Societe($db);
+ $thirdpartytmp = new Fournisseur($db);
$this->info_box_head = array(
'text' => $langs->trans("BoxTitleLast".($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE?"":"Modified")."SupplierBills",$max)
@@ -95,10 +95,10 @@ class box_factures_fourn extends ModeleBoxes
$num = $db->num_rows($result);
$now=dol_now();
- $i = 0;
+ $line = 0;
$l_due_date = $langs->trans('Late').' ('.$langs->trans('DateEcheance').': %s)';
- while ($i < $num) {
+ while ($line < $num) {
$objp = $db->fetch_object($result);
$datelimite=$db->jdate($objp->datelimite);
$date=$db->jdate($objp->df);
@@ -108,36 +108,41 @@ class box_factures_fourn extends ModeleBoxes
$facturestatic->total_ht = $objp->total_ht;
$facturestatic->total_tva = $objp->total_tva;
$facturestatic->total_ttc = $objp->total_ttc;
- $societestatic->id = $objp->socid;
- $societestatic->name = $objp->name;
- $societestatic->fournisseur = 1;
- $societestatic->code_fournisseur = $objp->code_fournisseur;
- $societestatic->logo = $objp->logo;
+ $thirdpartytmp->id = $objp->socid;
+ $thirdpartytmp->name = $objp->name;
+ $thirdpartytmp->fournisseur = 1;
+ $thirdpartytmp->code_fournisseur = $objp->code_fournisseur;
+ $thirdpartytmp->logo = $objp->logo;
$late = '';
if ($objp->paye == 0 && $datelimite && $datelimite < ($now - $conf->facture->fournisseur->warning_delay)) $late=img_warning(sprintf($l_due_date, dol_print_date($datelimite,'day')));
- $this->info_box_contents[$i][] = array(
+ $this->info_box_contents[$line][] = array(
'td' => 'align="left"',
'text' => $facturestatic->getNomUrl(1),
'text2'=> $late,
'asis' => 1,
);
- $this->info_box_contents[$i][] = array(
+ $this->info_box_contents[$line][] = array(
'td' => 'align="left"',
'text' => $objp->ref_supplier,
'tooltip' => $langs->trans('SupplierInvoice').': '.($objp->ref?$objp->ref:$objp->facid).'<br>'.$langs->trans('RefSupplier').': '.$objp->ref_supplier,
'url' => DOL_URL_ROOT."/fourn/facture/card.php?facid=".$objp->facid,
);
- $this->info_box_contents[$i][] = array(
+ $this->info_box_contents[$line][] = array(
'td' => 'align="left"',
- 'text' => $societestatic->getNomUrl(1, 'supplier'),
+ 'text' => $thirdpartytmp->getNomUrl(1, 'supplier'),
'asis' => 1,
);
- $this->info_box_contents[$i][] = array(
+ $this->info_box_contents[$line][] = array(
+ 'td' => 'align="right"',
+ 'text' => price($objp->total_ht, 0, $langs, 0, -1, -1, $conf->currency),
+ );
+
+ $this->info_box_contents[$line][] = array(
'td' => 'align="right"',
'text' => dol_print_date($date,'day'),
);
@@ -145,16 +150,16 @@ class box_factures_fourn extends ModeleBoxes
$fac = new FactureFournisseur($db);
$fac->fetch($objp->facid);
$alreadypaid=$fac->getSommePaiement();
- $this->info_box_contents[$i][6] = array(
+ $this->info_box_contents[$line][] = array(
'td' => 'align="right" width="18"',
'text' => $facturestatic->LibStatut($objp->paye,$objp->fk_statut,3,$alreadypaid,$objp->type),
);
- $i++;
+ $line++;
}
if ($num==0)
- $this->info_box_contents[$i][0] = array(
+ $this->info_box_contents[$line][0] = array(
'td' => 'align="center"',
'text'=>$langs->trans("NoModifiedSupplierBills"),
);
diff --git a/htdocs/core/boxes/box_factures_fourn_imp.php b/htdocs/core/boxes/box_factures_fourn_imp.php
index a82af75332a26c6d250774d910aace1ebeb0d275..ecea4a27fd1a1f282123651725ba6c7bc34e4407 100644
--- a/htdocs/core/boxes/box_factures_fourn_imp.php
+++ b/htdocs/core/boxes/box_factures_fourn_imp.php
@@ -56,6 +56,8 @@ class box_factures_fourn_imp extends ModeleBoxes
include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
$facturestatic=new FactureFournisseur($db);
+ include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
+ $thirdpartytmp=new Fournisseur($db);
$this->info_box_head = array('text' => $langs->trans("BoxTitleOldestUnpaidSupplierBills",$max));
@@ -64,6 +66,9 @@ class box_factures_fourn_imp extends ModeleBoxes
$sql = "SELECT s.nom as name, s.rowid as socid,";
$sql.= " f.rowid as facid, f.ref, f.ref_supplier, f.date_lim_reglement as datelimite,";
$sql.= " f.amount, f.datef as df,";
+ $sql.= " f.total_ht as total_ht,";
+ $sql.= " f.tva as total_tva,";
+ $sql.= " f.total_ttc,";
$sql.= " f.paye, f.fk_statut, f.type";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
$sql.= ",".MAIN_DB_PREFIX."facture_fourn as f";
@@ -83,26 +88,30 @@ class box_factures_fourn_imp extends ModeleBoxes
$num = $db->num_rows($result);
$now=dol_now();
- $i = 0;
+ $line = 0;
$l_due_date = $langs->trans('Late').' ('.$langs->trans('DateEcheance').': %s)';
- while ($i < $num)
+ while ($line < $num)
{
$objp = $db->fetch_object($result);
$datelimite=$db->jdate($objp->datelimite);
+ $thirdpartytmp->id = $objp->socid;
+ $thirdpartytmp->name = $objp->name;
+ $thirdpartytmp->code_client = $objp->code_client;
+ $thirdpartytmp->logo = $objp->logo;
$late='';
if ($datelimite && $datelimite < ($now - $conf->facture->fournisseur->warning_delay)) $late=img_warning(sprintf($l_due_date,dol_print_date($datelimite,'day')));
$tooltip = $langs->trans('SupplierInvoice') . ': ' . ($objp->ref?$objp->ref:$objp->facid) . '<br>' . $langs->trans('RefSupplier') . ': ' . $objp->ref_supplier;
- $this->info_box_contents[$i][0] = array(
+ $this->info_box_contents[$line][] = array(
'td' => 'align="left" width="16"',
'logo' => $this->boximg,
'tooltip' => $tooltip,
'url' => DOL_URL_ROOT."/fourn/facture/card.php?facid=".$objp->facid,
);
- $this->info_box_contents[$i][1] = array(
+ $this->info_box_contents[$line][] = array(
'td' => 'align="left"',
'text' => ($objp->ref?$objp->ref:$objp->facid),
'text2'=> $late,
@@ -110,29 +119,18 @@ class box_factures_fourn_imp extends ModeleBoxes
'url' => DOL_URL_ROOT."/fourn/facture/card.php?facid=".$objp->facid,
);
- $this->info_box_contents[$i][2] = array(
+ $this->info_box_contents[$line][] = array(
'td' => 'align="left"',
- 'text' => $objp->ref_supplier,
- 'tooltip' => $tooltip,
- 'url' => DOL_URL_ROOT."/fourn/facture/card.php?facid=".$objp->facid,
+ 'text' => $thirdpartytmp->getNomUrl(1, '', 40),
+ 'asis' => 1,
);
- $tooltip = $langs->trans('Supplier') . ': '. $objp->name;
- $this->info_box_contents[$i][3] = array(
- 'td' => 'align="left" width="16"',
- 'logo' => 'company',
- 'tooltip' => $tooltip,
- 'url' => DOL_URL_ROOT."/fourn/card.php?socid=".$objp->socid,
- );
-
- $this->info_box_contents[$i][4] = array(
- 'td' => 'align="left"',
- 'text' => $objp->name,
- 'tooltip' => $tooltip,
- 'url' => DOL_URL_ROOT."/fourn/card.php?socid=".$objp->socid,
+ $this->info_box_contents[$line][] = array(
+ 'td' => 'align="right"',
+ 'text' => price($objp->total_ht, 0, $langs, 0, -1, -1, $conf->currency),
);
- $this->info_box_contents[$i][5] = array(
+ $this->info_box_contents[$line][] = array(
'td' => 'align="right"',
'text' => dol_print_date($datelimite,'day'),
);
@@ -140,16 +138,16 @@ class box_factures_fourn_imp extends ModeleBoxes
$fac = new FactureFournisseur($db);
$fac->fetch($objp->facid);
$alreadypaid=$fac->getSommePaiement();
- $this->info_box_contents[$i][6] = array(
+ $this->info_box_contents[$line][] = array(
'td' => 'align="right" width="18"',
'text' => $facturestatic->LibStatut($objp->paye,$objp->fk_statut,3,$alreadypaid,$objp->type),
);
- $i++;
+ $line++;
}
if ($num==0)
- $this->info_box_contents[$i][0] = array(
+ $this->info_box_contents[$line][0] = array(
'td' => 'align="center"',
'text'=>$langs->trans("NoUnpaidSupplierBills"),
);
diff --git a/htdocs/core/boxes/box_factures_imp.php b/htdocs/core/boxes/box_factures_imp.php
index d7817d134d3dbcdd56d874bcdd29a80d4606c271..42e889138cc4e402a2c81cb534dd62fb7fa9d4be 100644
--- a/htdocs/core/boxes/box_factures_imp.php
+++ b/htdocs/core/boxes/box_factures_imp.php
@@ -95,10 +95,10 @@ class box_factures_imp extends ModeleBoxes
$num = $db->num_rows($result);
$now=dol_now();
- $i = 0;
+ $line = 0;
$l_due_date = $langs->trans('Late').' ('.strtolower($langs->trans('DateEcheance')).': %s)';
- while ($i < $num)
+ while ($line < $num)
{
$objp = $db->fetch_object($result);
$datelimite=$db->jdate($objp->datelimite);
@@ -117,33 +117,38 @@ class box_factures_imp extends ModeleBoxes
$late='';
if ($datelimite < ($now - $conf->facture->client->warning_delay)) $late = img_warning(sprintf($l_due_date,dol_print_date($datelimite,'day')));
- $this->info_box_contents[$i][] = array(
+ $this->info_box_contents[$line][] = array(
'td' => 'align="left"',
'text' => $facturestatic->getNomUrl(1),
'text2'=> $late,
'asis' => 1,
);
- $this->info_box_contents[$i][] = array(
+ $this->info_box_contents[$line][] = array(
'td' => 'align="left"',
'text' => $societestatic->getNomUrl(1, '', 44),
'asis' => 1,
);
- $this->info_box_contents[$i][] = array(
+ $this->info_box_contents[$line][] = array(
+ 'td' => 'align="right"',
+ 'text' => price($objp->total_ht, 0, $langs, 0, -1, -1, $conf->currency),
+ );
+
+ $this->info_box_contents[$line][] = array(
'td' => 'align="right"',
'text' => dol_print_date($datelimite,'day'),
);
- $this->info_box_contents[$i][] = array(
+ $this->info_box_contents[$line][] = array(
'td' => 'align="right" width="18"',
'text' => $facturestatic->LibStatut($objp->paye,$objp->fk_statut,3),
);
- $i++;
+ $line++;
}
- if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoUnpaidCustomerBills"));
+ if ($num==0) $this->info_box_contents[$line][0] = array('td' => 'align="center"','text'=>$langs->trans("NoUnpaidCustomerBills"));
$db->free($result);
}
diff --git a/htdocs/core/boxes/box_fournisseurs.php b/htdocs/core/boxes/box_fournisseurs.php
index e9c21da739fffcb29d50e92d6594b84a0520b52e..e3e6061d803614700e9a511d803f8236d9301ecb 100644
--- a/htdocs/core/boxes/box_fournisseurs.php
+++ b/htdocs/core/boxes/box_fournisseurs.php
@@ -58,12 +58,16 @@ class box_fournisseurs extends ModeleBoxes
include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
$thirdpartystatic=new Societe($db);
+ include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
+ $thirdpartytmp=new Fournisseur($db);
$this->info_box_head = array('text' => $langs->trans("BoxTitleLastModifiedSuppliers",$max));
if ($user->rights->societe->lire)
{
- $sql = "SELECT s.nom as name, s.rowid as socid, s.datec, s.tms, s.status";
+ $sql = "SELECT s.nom as name, s.rowid as socid, s.datec, s.tms, s.status,";
+ $sql.= " s.code_fournisseur,";
+ $sql.= " s.logo";
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= " WHERE s.fournisseur = 1";
@@ -78,42 +82,37 @@ class box_fournisseurs extends ModeleBoxes
{
$num = $db->num_rows($result);
- $i = 0;
- while ($i < $num)
+ $line = 0;
+ while ($line < $num)
{
$objp = $db->fetch_object($result);
$datec=$db->jdate($objp->datec);
$datem=$db->jdate($objp->tms);
+ $thirdpartytmp->id = $objp->socid;
+ $thirdpartytmp->name = $objp->name;
+ $thirdpartytmp->code_client = $objp->code_client;
+ $thirdpartytmp->logo = $objp->logo;
- $tooltip = $langs->trans('Supplier') . ': ' . $objp->name;
- $this->info_box_contents[$i][0] = array(
- 'td' => 'align="left" width="16"',
- 'logo' => $this->boximg,
- 'tooltip' => $tooltip,
- 'url' => DOL_URL_ROOT."/fourn/card.php?socid=".$objp->socid,
- );
-
- $this->info_box_contents[$i][1] = array(
+ $this->info_box_contents[$line][] = array(
'td' => 'align="left"',
- 'text' => $objp->name,
- 'tooltip' => $tooltip,
- 'url' => DOL_URL_ROOT."/fourn/card.php?socid=".$objp->socid,
+ 'text' => $thirdpartytmp->getNomUrl(1, '', 40),
+ 'asis' => 1,
);
- $this->info_box_contents[$i][2] = array(
+ $this->info_box_contents[$line][] = array(
'td' => 'align="right"',
'text' => dol_print_date($datem, "day"),
);
- $this->info_box_contents[$i][3] = array(
+ $this->info_box_contents[$line][] = array(
'td' => 'align="right" width="18"',
'text' => $thirdpartystatic->LibStatut($objp->status,3),
);
- $i++;
+ $line++;
}
- if ($num==0) $this->info_box_contents[$i][0] = array(
+ if ($num==0) $this->info_box_contents[$line][0] = array(
'td' => 'align="center"',
'text'=>$langs->trans("NoRecordedSuppliers"),
);
diff --git a/htdocs/core/boxes/box_propales.php b/htdocs/core/boxes/box_propales.php
index 4e8b47aa0d4486ecb7ec3f1bc48aa0a5ba5d4b1d..c14cf07a51c9bc848f1a51c4501b8aafad972ff8 100644
--- a/htdocs/core/boxes/box_propales.php
+++ b/htdocs/core/boxes/box_propales.php
@@ -123,7 +123,7 @@ class box_propales extends ModeleBoxes
$this->info_box_contents[$line][] = array(
'td' => 'align="right"',
- 'text' => price($objp->total_ht),
+ 'text' => price($objp->total_ht, 0, $langs, 0, -1, -1, $conf->currency),
);
$this->info_box_contents[$line][] = array(
diff --git a/htdocs/core/boxes/box_supplier_orders.php b/htdocs/core/boxes/box_supplier_orders.php
index d435e5ca3dc3a3573d9fe82b1e3f82de32785237..84521bf4ee068831d1776ac68a94beae6c078217 100644
--- a/htdocs/core/boxes/box_supplier_orders.php
+++ b/htdocs/core/boxes/box_supplier_orders.php
@@ -58,13 +58,20 @@ class box_supplier_orders extends ModeleBoxes
include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
$supplierorderstatic=new CommandeFournisseur($db);
+ include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
+ $thirdpartytmp = new Fournisseur($db);
$this->info_box_head = array('text' => $langs->trans("BoxTitleLatest".($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE?"":"Modified")."SupplierOrders", $max));
if ($user->rights->fournisseur->commande->lire)
{
$sql = "SELECT s.nom as name, s.rowid as socid,";
+ $sql.= " s.code_client, s.code_fournisseur,";
+ $sql.= " s.logo,";
$sql.= " c.ref, c.tms, c.rowid, c.date_commande,";
+ $sql.= " c.total_ht,";
+ $sql.= " c.tva as total_tva,";
+ $sql.= " c.total_ttc,";
$sql.= " c.fk_statut";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
$sql.= ", ".MAIN_DB_PREFIX."commande_fournisseur as c";
@@ -82,60 +89,61 @@ class box_supplier_orders extends ModeleBoxes
{
$num = $db->num_rows($result);
- $i = 0;
- while ($i < $num) {
+ $line = 0;
+ while ($line < $num) {
$objp = $db->fetch_object($result);
$date=$db->jdate($objp->date_commande);
$datem=$db->jdate($objp->tms);
+ $thirdpartytmp->id = $objp->socid;
+ $thirdpartytmp->name = $objp->name;
+ $thirdpartytmp->fournisseur = 1;
+ $thirdpartytmp->code_fournisseur = $objp->code_fournisseur;
+ $thirdpartytmp->logo = $objp->logo;
$urlo = DOL_URL_ROOT."/fourn/commande/card.php?id=".$objp->rowid;
$urls = DOL_URL_ROOT."/fourn/card.php?socid=".$objp->socid;
$tooltip = $langs->trans('SupplierOrder') . ': ' . $objp->ref;
- $this->info_box_contents[$i][0] = array(
+ $this->info_box_contents[$line][] = array(
'td' => 'align="left" width="16"',
'logo' => $this->boximg,
'tooltip' => $tooltip,
'url' => $urlo,
);
- $this->info_box_contents[$i][1] = array(
+ $this->info_box_contents[$line][] = array(
'td' => 'align="left"',
'text' => $objp->ref,
'tooltip' => $tooltip,
'url' => $urlo,
);
- $tooltip = $langs->trans('Supplier') . ': ' . $objp->name;
- $this->info_box_contents[$i][2] = array(
- 'td' => 'align="left" width="16"',
- 'logo' => 'company',
- 'tooltip' => $tooltip,
- 'url' => $urls,
+ $this->info_box_contents[$line][] = array(
+ 'td' => 'align="left"',
+ 'text' => $thirdpartytmp->getNomUrl(1, 'supplier'),
+ 'asis' => 1,
);
- $this->info_box_contents[$i][3] = array(
- 'td' => 'align="left"',
- 'text' => $objp->name,
- 'tooltip' => $tooltip,
- 'url' => $urls,
+ $this->info_box_contents[$line][] = array(
+ 'td' => 'align="right"',
+ 'text' => price($objp->total_ht, 0, $langs, 0, -1, -1, $conf->currency),
);
- $this->info_box_contents[$i][4] = array(
+ $this->info_box_contents[$line][] = array(
'td' => 'align="right"',
'text' => dol_print_date($date,'day'),
);
- $this->info_box_contents[$i][5] = array(
+ $this->info_box_contents[$line][] = array(
'td' => 'align="right" width="18"',
'text' => $supplierorderstatic->LibStatut($objp->fk_statut,3),
);
- $i++;
+ $line++;
}
if ($num == 0)
- $this->info_box_contents[$i][0] = array(
+ $this->info_box_contents[$line][0] = array(
'td' => 'align="center"',
'text' => $langs->trans("NoSupplierOrder"),
);