diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php
index 7a1a768a197..861bdbdb765 100644
--- a/htdocs/compta/index.php
+++ b/htdocs/compta/index.php
@@ -120,7 +120,7 @@ if ($conf->facture->enabled)
*/
if ($conf->facture->enabled && $user->rights->facture->lire)
{
- $sql = "SELECT f.facnumber, f.rowid, f.total_ttc, s.nom, s.idp";
+ $sql = "SELECT f.facnumber, f.rowid, f.total_ttc, f.type, s.nom, s.idp";
if (!$user->rights->commercial->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user ";
$sql .= " FROM ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."societe as s";
if (!$user->rights->commercial->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@@ -151,7 +151,8 @@ if ($conf->facture->enabled && $user->rights->facture->lire)
$var=!$var;
print '
| ';
$facturestatic->ref=$obj->facnumber;
- $facturestatic->id=$obj->idp;
+ $facturestatic->id=$obj->rowid;
+ $facturestatic->type=$obj->type;
print $facturestatic->getNomUrl(1,'');
print ' | ';
print ''.img_object($langs->trans("ShowCompany"),"company").' '.dolibarr_trunc($obj->nom,16).' | ';
@@ -359,7 +360,8 @@ if ($conf->facture->enabled && $user->rights->facture->lire)
{
$facstatic=new Facture($db);
- $sql = "SELECT f.rowid, f.facnumber, f.fk_statut, f.total, f.total_ttc, ".$db->pdate("f.date_lim_reglement")." as datelimite,";
+ $sql = "SELECT f.rowid, f.facnumber, f.fk_statut, f.type, f.total, f.total_ttc, ";
+ $sql.= $db->pdate("f.date_lim_reglement")." as datelimite,";
$sql.= " sum(pf.amount) as am,";
$sql.= " s.nom, s.idp";
if (!$user->rights->commercial->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user ";
@@ -400,6 +402,7 @@ if ($conf->facture->enabled && $user->rights->facture->lire)
print '';
$facturestatic->ref=$obj->facnumber;
$facturestatic->id=$obj->rowid;
+ $facturestatic->type=$obj->type;
print $facturestatic->getNomUrl(1,'');
if ($obj->datelimite < (time() - $conf->facture->client->warning_delay)) print img_warning($langs->trans("Late"));
print ' | ';
diff --git a/htdocs/facture.class.php b/htdocs/facture.class.php
index 29e37fa3fdc..dc435366088 100644
--- a/htdocs/facture.class.php
+++ b/htdocs/facture.class.php
@@ -361,8 +361,16 @@ class Facture extends CommonObject
$lien = '';
$lienfin='';
+
+ $picto='bill';
+ if ($this->type == 1) $picto.='r';
+ if ($this->type == 2) $picto.='a';
- if ($withpicto) $result.=($lien.img_object($langs->trans("ShowInvoice"),'bill').$lienfin.' ');
+ $label=$langs->trans("ShowInvoice");
+ if ($this->type == 1) $label=$langs->trans("ShowInvoiceReplace");
+ if ($this->type == 2) $label=$langs->trans("ShowInvoiceAvoir");
+
+ if ($withpicto) $result.=($lien.img_object($label,$picto).$lienfin.' ');
$result.=$lien.$this->ref.$lienfin;
return $result;
}
diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang
index 022821bd295..f1b3ee2218d 100644
--- a/htdocs/langs/en_US/bills.lang
+++ b/htdocs/langs/en_US/bills.lang
@@ -120,6 +120,8 @@ NumberOfBills=Nb of invoices
NumberOfBillsByMonth=Nb of invoices by month
ShowBill=Show invoice
ShowInvoice=Show invoice
+ShowInvoiceReplace=Show replacing invoice
+ShowInvoiceAvoir=Show avoir invoice
ShowPayment=Show payment
File=File
AlreadyPayed=Already payed
diff --git a/htdocs/langs/fr_FR/bills.lang b/htdocs/langs/fr_FR/bills.lang
index c15630c822c..20f3b9183e7 100644
--- a/htdocs/langs/fr_FR/bills.lang
+++ b/htdocs/langs/fr_FR/bills.lang
@@ -120,6 +120,8 @@ NumberOfBills=Nb de factures
NumberOfBillsByMonth=Nb de factures par mois
ShowBill=Afficher facture
ShowInvoice=Afficher facture
+ShowInvoiceReplace=Afficher facture de remplacement
+ShowInvoiceAvoir=Afficher facture avoir
ShowPayment=Afficher paiement
File=Fichier
AlreadyPayed=Déjà réglé
diff --git a/htdocs/theme/dev/img/object_billa.png b/htdocs/theme/dev/img/object_billa.png
new file mode 100644
index 00000000000..3635f753a31
Binary files /dev/null and b/htdocs/theme/dev/img/object_billa.png differ
diff --git a/htdocs/theme/dev/img/object_billr.png b/htdocs/theme/dev/img/object_billr.png
new file mode 100644
index 00000000000..3c7443cba3e
Binary files /dev/null and b/htdocs/theme/dev/img/object_billr.png differ
diff --git a/htdocs/theme/dolibarr/img/object_billa.png b/htdocs/theme/dolibarr/img/object_billa.png
new file mode 100644
index 00000000000..3635f753a31
Binary files /dev/null and b/htdocs/theme/dolibarr/img/object_billa.png differ
diff --git a/htdocs/theme/dolibarr/img/object_billr.png b/htdocs/theme/dolibarr/img/object_billr.png
new file mode 100644
index 00000000000..3c7443cba3e
Binary files /dev/null and b/htdocs/theme/dolibarr/img/object_billr.png differ
diff --git a/htdocs/theme/eldy/img/object_billa.png b/htdocs/theme/eldy/img/object_billa.png
new file mode 100644
index 00000000000..3635f753a31
Binary files /dev/null and b/htdocs/theme/eldy/img/object_billa.png differ
diff --git a/htdocs/theme/eldy/img/object_billr.png b/htdocs/theme/eldy/img/object_billr.png
new file mode 100644
index 00000000000..3c7443cba3e
Binary files /dev/null and b/htdocs/theme/eldy/img/object_billr.png differ
diff --git a/htdocs/theme/freelug/img/object_billa.png b/htdocs/theme/freelug/img/object_billa.png
new file mode 100644
index 00000000000..3635f753a31
Binary files /dev/null and b/htdocs/theme/freelug/img/object_billa.png differ
diff --git a/htdocs/theme/freelug/img/object_billr.png b/htdocs/theme/freelug/img/object_billr.png
new file mode 100644
index 00000000000..3c7443cba3e
Binary files /dev/null and b/htdocs/theme/freelug/img/object_billr.png differ
diff --git a/htdocs/theme/yellow/img/object_billa.png b/htdocs/theme/yellow/img/object_billa.png
new file mode 100644
index 00000000000..3635f753a31
Binary files /dev/null and b/htdocs/theme/yellow/img/object_billa.png differ
diff --git a/htdocs/theme/yellow/img/object_billr.png b/htdocs/theme/yellow/img/object_billr.png
new file mode 100644
index 00000000000..3c7443cba3e
Binary files /dev/null and b/htdocs/theme/yellow/img/object_billr.png differ