diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php
index af543c5f5e8..70e4cc03974 100644
--- a/htdocs/compta/facture/list.php
+++ b/htdocs/compta/facture/list.php
@@ -690,9 +690,15 @@ if ($resql)
// Type
if (! empty($arrayfields['f.type']['checked']))
{
- print '
';
- $listtype=array('0'=>$langs->trans("InvoiceStandard"), '1'=>$langs->trans("InvoiceReplacement"), '2'=>$langs->trans("InvoiceAvoir"), '3'=>$langs->trans("InvoiceDeposit"), '4'=>$langs->trans("InvoiceProForma"), '5'=>$langs->trans("InvoiceDeposit"));
- print $form->selectarray('search_type', $listtype, $search_type, 1);
+ print ' | ';
+ $listtype=array(
+ Facture::TYPE_STANDARD=>$langs->trans("InvoiceStandard"),
+ Facture::TYPE_REPLACEMENT=>$langs->trans("InvoiceReplacement"),
+ Facture::TYPE_CREDIT_NOTE=>$langs->trans("InvoiceAvoir"),
+ Facture::TYPE_DEPOSIT=>$langs->trans("InvoiceDeposit"),
+ );
+ //$listtype[Facture::TYPE_PROFORMA]=$langs->trans("InvoiceProForma"); // A proformat invoice is not an invoice but must be an order.
+ print $form->selectarray('search_type', $listtype, $search_type, 1, 0, 0, '', 0, 0, 0, 'ASC', 'maxwidth100');
print ' | ';
}
// Date invoice
@@ -741,7 +747,7 @@ if ($resql)
if (! empty($arrayfields['typent.code']['checked']))
{
print '';
- print $form->selectarray("search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 0, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT)?'ASC':$conf->global->SOCIETE_SORT_ON_TYPEENT));
+ print $form->selectarray("search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 0, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT)?'ASC':$conf->global->SOCIETE_SORT_ON_TYPEENT), 'maxwidth100');
print ' | ';
}
// Payment mode
@@ -852,6 +858,7 @@ if ($resql)
$facturestatic->type=$obj->type;
$facturestatic->statut=$obj->fk_statut;
$facturestatic->date_lim_reglement=$db->jdate($obj->datelimite);
+ $facturestatic->type=$obj->type;
print '';
if (! empty($arrayfields['f.facnumber']['checked']))
@@ -901,7 +908,7 @@ if ($resql)
if (! empty($arrayfields['f.type']['checked']))
{
print '| ';
- print $object->getLibType($obj->type);
+ print $facturestatic->getLibType();
print " | ";
if (! $i) $totalarray['nbfield']++;
}
diff --git a/htdocs/core/class/commoninvoice.class.php b/htdocs/core/class/commoninvoice.class.php
index 7c68a5ff978..c08d645cf53 100644
--- a/htdocs/core/class/commoninvoice.class.php
+++ b/htdocs/core/class/commoninvoice.class.php
@@ -198,9 +198,9 @@ abstract class CommonInvoice extends CommonObject
}
/**
- * Retourne le libelle du type de facture
+ * Return label of type of invoice
*
- * @return string Libelle
+ * @return string Label of type of invoice
*/
function getLibType()
{
@@ -209,7 +209,7 @@ abstract class CommonInvoice extends CommonObject
if ($this->type == CommonInvoice::TYPE_REPLACEMENT) return $langs->trans("InvoiceReplacement");
if ($this->type == CommonInvoice::TYPE_CREDIT_NOTE) return $langs->trans("InvoiceAvoir");
if ($this->type == CommonInvoice::TYPE_DEPOSIT) return $langs->trans("InvoiceDeposit");
- if ($this->type == CommonInvoice::TYPE_PROFORMA) return $langs->trans("InvoiceProForma");
+ if ($this->type == CommonInvoice::TYPE_PROFORMA) return $langs->trans("InvoiceProForma"); // Not used.
if ($this->type == CommonInvoice::TYPE_SITUATION) return $langs->trans("InvoiceSituation");
return $langs->trans("Unknown");
}