This commit is contained in:
Laurent Destailleur 2015-12-19 19:48:36 +01:00
parent 1c1d176715
commit f0802eb36b
2 changed files with 8 additions and 4 deletions

View File

@ -55,6 +55,8 @@ class FormOrder
*/
function selectSupplierOrderStatus($selected='', $short=0, $hmlname='order_status')
{
$tmpsupplierorder=new CommandeFournisseur($db);
print '<select class="flat" name="'.$hmlname.'">';
print '<option value="-1">&nbsp;</option>';
$statustohow=array('0'=>'0','1'=>'1','2'=>'2','3'=>'3','4'=>'4','5'=>'5','6'=>'6,7','9'=>'9'); // 7 is same label than 6. 8 does not exists (billed is another field)
@ -62,7 +64,8 @@ class FormOrder
foreach($statustohow as $key => $value)
{
print '<option value="'.$value.'"'.(($selected == $key || $selected == $value)?' selected':'').'>';
print CommandeFournisseur::LibStatut($key,$short);
$tmpsupplierorder->statut=$key;
print $tmpsupplierorder->getLibStatut($short);
print '</option>';
}
print '</select>';

View File

@ -498,7 +498,7 @@ class CommandeFournisseur extends CommonOrder
*/
function getLibStatut($mode=0)
{
return $this->LibStatut($this->statut,$mode);
return $this->LibStatut($this->statut,$mode,$this->billed);
}
/**
@ -506,16 +506,17 @@ class CommandeFournisseur extends CommonOrder
*
* @param int $statut Id statut
* @param int $mode 0=Long label, 1=Short label, 2=Picto + Short label, 3=Picto, 4=Picto + Long label, 5=Short label + Picto
* @param int $billed 1=Billed
* @return string Label of status
*/
function LibStatut($statut,$mode=0)
function LibStatut($statut,$mode=0,$billed=0)
{
global $langs;
$langs->load('orders');
$billedtext='';
//if ($statut==5 && $this->billed == 1) $statut = 8;
if ($this->billed == 1) $billedtext=$langs->trans("Billed");
if ($billed == 1) $billedtext=$langs->trans("Billed");
// List of language codes for status
$statutshort[0] = 'StatusOrderDraftShort';