diff --git a/htdocs/comm/remx.php b/htdocs/comm/remx.php
index eabb217fb99..7a8b03cde4e 100644
--- a/htdocs/comm/remx.php
+++ b/htdocs/comm/remx.php
@@ -739,8 +739,8 @@ if ($socid > 0)
$sql.= " rc.datec as dc, rc.description, rc.fk_facture_line, rc.fk_facture,";
$sql.= " rc.fk_facture_source,";
$sql.= " u.login, u.rowid as user_id,";
- $sql.= " f.rowid, f.ref,";
- $sql.= " fa.ref as ref, fa.type as type";
+ $sql.= " f.rowid as invoiceid, f.ref,";
+ $sql.= " fa.ref as invoice_source_ref, fa.type as type";
$sql.= " FROM ".MAIN_DB_PREFIX."facture as f";
$sql.= " , ".MAIN_DB_PREFIX."user as u";
$sql.= " , ".MAIN_DB_PREFIX."facturedet as fc";
@@ -758,8 +758,8 @@ if ($socid > 0)
$sql2.= " rc.datec as dc, rc.description, rc.fk_facture_line, rc.fk_facture,";
$sql2.= " rc.fk_facture_source,";
$sql2.= " u.login, u.rowid as user_id,";
- $sql2.= " f.rowid, f.ref,";
- $sql2.= " fa.ref as ref, fa.type as type";
+ $sql2.= " f.rowid as invoiceid, f.ref,";
+ $sql2.= " fa.ref as invoice_source_ref, fa.type as type";
$sql2.= " FROM ".MAIN_DB_PREFIX."facture as f";
$sql2.= " , ".MAIN_DB_PREFIX."user as u";
$sql2.= " , ".MAIN_DB_PREFIX."societe_remise_except as rc";
@@ -833,7 +833,7 @@ if ($socid > 0)
{
print '
';
$facturestatic->id=$obj->fk_facture_source;
- $facturestatic->ref=$obj->ref;
+ $facturestatic->ref=$obj->invoice_source_ref;
$facturestatic->type=$obj->type;
print preg_replace('/\(CREDIT_NOTE\)/', $langs->trans("CreditNote"), $obj->description).' '.$facturestatic->getNomURl(1);
print ' | ';
@@ -842,7 +842,7 @@ if ($socid > 0)
{
print '';
$facturestatic->id=$obj->fk_facture_source;
- $facturestatic->ref=$obj->ref;
+ $facturestatic->ref=$obj->invoice_source_ref;
$facturestatic->type=$obj->type;
print preg_replace('/\(DEPOSIT\)/', $langs->trans("InvoiceDeposit"), $obj->description).' '.$facturestatic->getNomURl(1);
print ' | ';
@@ -851,7 +851,7 @@ if ($socid > 0)
{
print '';
$facturestatic->id=$obj->fk_facture_source;
- $facturestatic->ref=$obj->ref;
+ $facturestatic->ref=$obj->invoice_source_ref;
$facturestatic->type=$obj->type;
print preg_replace('/\(EXCESS RECEIVED\)/', $langs->trans("Invoice"), $obj->description).' '.$facturestatic->getNomURl(1);
print ' | ';
@@ -862,7 +862,12 @@ if ($socid > 0)
print $obj->description;
print '';
}
- print ''.img_object($langs->trans("ShowBill"), 'bill').' '.$obj->ref.' | ';
+ print '';
+ if ($obj->invoiceid)
+ {
+ print ''.img_object($langs->trans("ShowBill"), 'bill').' '.$obj->ref.'';
+ }
+ print ' | ';
print ''.price($obj->amount_ht).' | ';
if (! empty($conf->multicurrency->enabled))
{
@@ -909,8 +914,8 @@ if ($socid > 0)
$sql.= " rc.datec as dc, rc.description, rc.fk_invoice_supplier_line, rc.fk_invoice_supplier,";
$sql.= " rc.fk_invoice_supplier_source,";
$sql.= " u.login, u.rowid as user_id,";
- $sql.= " f.rowid, f.ref as ref,";
- $sql.= " fa.ref, fa.type as type";
+ $sql.= " f.rowid as invoiceid, f.ref as ref,";
+ $sql.= " fa.ref as invoice_source_ref, fa.type as type";
$sql.= " FROM ".MAIN_DB_PREFIX."facture_fourn as f";
$sql.= " , ".MAIN_DB_PREFIX."user as u";
$sql.= " , ".MAIN_DB_PREFIX."facture_fourn_det as fc";
@@ -928,8 +933,8 @@ if ($socid > 0)
$sql2.= " rc.datec as dc, rc.description, rc.fk_invoice_supplier_line, rc.fk_invoice_supplier,";
$sql2.= " rc.fk_invoice_supplier_source,";
$sql2.= " u.login, u.rowid as user_id,";
- $sql2.= " f.rowid, f.ref as ref,";
- $sql2.= " fa.ref, fa.type as type";
+ $sql2.= " f.rowid as invoiceid, f.ref as ref,";
+ $sql2.= " fa.ref as invoice_source_ref, fa.type as type";
$sql2.= " FROM ".MAIN_DB_PREFIX."facture_fourn as f";
$sql2.= " , ".MAIN_DB_PREFIX."user as u";
$sql2.= " , ".MAIN_DB_PREFIX."societe_remise_except as rc";
@@ -1003,7 +1008,7 @@ if ($socid > 0)
{
print '';
$facturefournstatic->id=$obj->fk_invoice_supplier_source;
- $facturefournstatic->ref=$obj->ref;
+ $facturefournstatic->ref=$obj->invoice_source_ref;
$facturefournstatic->type=$obj->type;
print preg_replace('/\(CREDIT_NOTE\)/', $langs->trans("CreditNote"), $obj->description).' '.$facturefournstatic->getNomURl(1);
print ' | ';
@@ -1012,7 +1017,7 @@ if ($socid > 0)
{
print '';
$facturefournstatic->id=$obj->fk_invoice_supplier_source;
- $facturefournstatic->ref=$obj->ref;
+ $facturefournstatic->ref=$obj->invoice_source_ref;
$facturefournstatic->type=$obj->type;
print preg_replace('/\(DEPOSIT\)/', $langs->trans("InvoiceDeposit"), $obj->description).' '.$facturefournstatic->getNomURl(1);
print ' | ';
@@ -1021,7 +1026,7 @@ if ($socid > 0)
{
print '';
$facturefournstatic->id=$obj->fk_invoice_supplier_source;
- $facturefournstatic->ref=$obj->ref;
+ $facturefournstatic->ref=$obj->invoice_source_ref;
$facturefournstatic->type=$obj->type;
print preg_replace('/\(EXCESS PAID\)/', $langs->trans("Invoice"), $obj->description).' '.$facturefournstatic->getNomURl(1);
print ' | ';
@@ -1032,7 +1037,11 @@ if ($socid > 0)
print $obj->description;
print '';
}
- print ''.img_object($langs->trans("ShowBill"), 'bill').' '.$obj->ref.' | ';
+ print '';
+ if ($obj->invoiceid) {
+ print ''.img_object($langs->trans("ShowBill"), 'bill').' '.$obj->ref.'';
+ }
+ print ' | ';
print ''.price($obj->amount_ht).' | ';
if (! empty($conf->multicurrency->enabled))
{