diff --git a/htdocs/fourn/facture/contact.php b/htdocs/fourn/facture/contact.php
index 6f58239c150..9f54a9eceeb 100644
--- a/htdocs/fourn/facture/contact.php
+++ b/htdocs/fourn/facture/contact.php
@@ -134,6 +134,8 @@ if ($id > 0 || ! empty($ref))
{
$object->fetch_thirdparty();
+ $alreadypaid=$object->getSommePaiement();
+
$head = facturefourn_prepare_head($object);
dol_fiche_head($head, 'contact', $langs->trans('SupplierInvoice'), 0, 'bill');
@@ -181,10 +183,10 @@ if ($id > 0 || ! empty($ref))
}
$morehtmlref.='';
- $object->totalpaye = $totalpaye; // To give a chance to dol_banner_tab to use already paid amount to show correct status
-
- dol_banner_tab($object, 'ref', $linkback, 1, 'facnumber', 'ref', $morehtmlref, '', 0);
+ $object->totalpaye = $alreadypaid; // To give a chance to dol_banner_tab to use already paid amount to show correct status
+ dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
+
print '
';
print '
';
@@ -234,10 +236,6 @@ if ($id > 0 || ! empty($ref))
print $form->editfieldval("Label",'label',$object->label,$object,0);
print '';
- // Status
- $alreadypaid=$object->getSommePaiement();
- print '
| '.$langs->trans('Status').' | '.$object->getLibStatut(4,$alreadypaid).' |
';
-
// Amount
print '
| '.$langs->trans('AmountHT').' | '.price($object->total_ht,1,$langs,0,-1,-1,$conf->currency).' |
';
print '
| '.$langs->trans('AmountVAT').' | '.price($object->total_tva,1,$langs,0,-1,-1,$conf->currency).' |
';
diff --git a/htdocs/fourn/facture/document.php b/htdocs/fourn/facture/document.php
index 5b95056e0dc..5ffe26f07c7 100644
--- a/htdocs/fourn/facture/document.php
+++ b/htdocs/fourn/facture/document.php
@@ -90,7 +90,8 @@ if ($object->id > 0)
{
$head = facturefourn_prepare_head($object);
dol_fiche_head($head, 'documents', $langs->trans('SupplierInvoice'), 0, 'bill');
- $totalpaye = $object->getSommePaiement();
+
+ $totalpaye = $object->getSommePaiement();
$linkback = '
' . $langs->trans("BackToList") . '';
@@ -137,7 +138,7 @@ if ($object->id > 0)
$object->totalpaye = $totalpaye; // To give a chance to dol_banner_tab to use already paid amount to show correct status
- dol_banner_tab($object, 'ref', $linkback, 1, 'facnumber', 'ref', $morehtmlref, '', 0);
+ dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, '', 0);
print '
';
print '
';
diff --git a/htdocs/fourn/facture/info.php b/htdocs/fourn/facture/info.php
index db89ff22a50..766eec3e724 100644
--- a/htdocs/fourn/facture/info.php
+++ b/htdocs/fourn/facture/info.php
@@ -32,12 +32,14 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
$langs->load('bills');
-$id = GETPOST("facid",'int');
+$id = GETPOST("facid",'int')?GETPOST("facid",'int'):GETPOST("id",'int');
+$ref = GETPOST("ref",'alpha');
// Security check
if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'fournisseur', $id, 'facture_fourn', 'facture');
+$object = new FactureFournisseur($db);
/*
@@ -48,11 +50,12 @@ $title = $langs->trans('SupplierInvoice') . " - " . $langs->trans('Info');
$helpurl = "EN:Module_Suppliers_Invoices|FR:Module_Fournisseurs_Factures|ES:Módulo_Facturas_de_proveedores";
llxHeader('', $title, $helpurl);
-$object = new FactureFournisseur($db);
-$object->fetch($id);
-$object->info($id);
-$soc = new Societe($db);
-$soc->fetch($object->socid);
+$object->fetch($id, $ref);
+$object->fetch_thirdparty();
+
+$object->info($object->id);
+
+$alreadypaid=$object->getSommePaiement();
$head = facturefourn_prepare_head($object);
$titre=$langs->trans('SupplierInvoice');
@@ -81,11 +84,11 @@ if (! empty($conf->projet->enabled))
$morehtmlref.='
';
} else {
- $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
+ $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->thirdparty->id, $object->fk_project, 'none', 0, 0, 0, 1);
}
} else {
if (! empty($object->fk_project)) {
@@ -101,9 +104,9 @@ if (! empty($conf->projet->enabled))
}
$morehtmlref.='
';
-$object->totalpaye = $totalpaye; // To give a chance to dol_banner_tab to use already paid amount to show correct status
+$object->totalpaye = $alreadypaid; // To give a chance to dol_banner_tab to use already paid amount to show correct status
-dol_banner_tab($object, 'ref', $linkback, 1, 'facnumber', 'ref', $morehtmlref, '', 0);
+dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, '', 0);
print '
';
print '
';
diff --git a/htdocs/fourn/facture/note.php b/htdocs/fourn/facture/note.php
index 0ec9d519e06..96945304869 100644
--- a/htdocs/fourn/facture/note.php
+++ b/htdocs/fourn/facture/note.php
@@ -75,6 +75,8 @@ if ($object->id > 0)
{
$object->fetch_thirdparty();
+ $alreadypaid=$object->getSommePaiement();
+
$head = facturefourn_prepare_head($object);
$titre=$langs->trans('SupplierInvoice');
dol_fiche_head($head, 'note', $titre, 0, 'bill');