diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 5e9fc895f0b..bef8c6951bf 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2015 Laurent Destailleur * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2010-2013 Juanjo Menent + * Copyright (C) 2010-2016 Juanjo Menent * Copyright (C) 2011-2015 Philippe Grand * Copyright (C) 2011 Remy Younes * Copyright (C) 2012-2015 Marcos GarcĂ­a @@ -624,7 +624,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) $i=0; foreach ($listfieldinsert as $f => $value) { - if ($value == 'price' || preg_match('/^amount/i',$value) || preg_match('/^localtax/i',$value) || $value == 'taux') { + if ($value == 'price' || preg_match('/^amount/i',$value) || $value == 'taux') { $_POST[$listfieldvalue[$i]] = price2num($_POST[$listfieldvalue[$i]],'MU'); } else if ($value == 'entity') { @@ -672,7 +672,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) $i = 0; foreach ($listfieldmodify as $field) { - if ($field == 'price' || preg_match('/^amount/i',$field) || preg_match('/^localtax/i',$field) || $field == 'taux') { + if ($field == 'price' || preg_match('/^amount/i',$field) || $field == 'taux') { $_POST[$listfieldvalue[$i]] = price2num($_POST[$listfieldvalue[$i]],'MU'); } else if ($field == 'entity') { @@ -1290,23 +1290,12 @@ if ($id) $valuetoshow = ''; $align="center"; } - else if ($fieldlist[$field]=='localtax1') { + else if ($fieldlist[$field]=='taux') { $valuetoshow = price($valuetoshow, 0, $langs, 0, 0); if ($obj->localtax1 == 0) $valuetoshow = ''; $align="right"; } - else if ($fieldlist[$field]=='localtax2') { - $valuetoshow = price($valuetoshow, 0, $langs, 0, 0); - if ($obj->localtax2 == 0) - $valuetoshow = ''; - $align="right"; - } - else if (in_array($fieldlist[$field],array('taux','localtax1','localtax2'))) - { - $valuetoshow = price($valuetoshow, 0, $langs, 0, 0); - $align="right"; - } else if (in_array($fieldlist[$field],array('recuperableonly'))) { $align="center"; diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 19395db756c..80566e9c1cb 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -65,7 +65,7 @@ class CommandeFournisseur extends CommonOrder // -> 9=Refused -> (reopen) 1=Validated // Note: billed or not is on another field "billed" var $statuts; // List of status - + var $socid; var $fourn_id; var $date; @@ -254,6 +254,8 @@ class CommandeFournisseur extends CommonOrder $this->fetchObjectLinked(); + $this->lines=array(); + $sql = "SELECT l.rowid, l.ref as ref_supplier, l.fk_product, l.product_type, l.label, l.description,"; $sql.= " l.qty,"; $sql.= " l.tva_tx, l.remise_percent, l.subprice,"; @@ -517,7 +519,7 @@ class CommandeFournisseur extends CommonOrder $billedtext=''; //if ($statut==5 && $this->billed == 1) $statut = 8; if ($billed == 1) $billedtext=$langs->trans("Billed"); - + // List of language codes for status $statutshort[0] = 'StatusOrderDraftShort'; $statutshort[1] = 'StatusOrderValidatedShort'; @@ -1356,7 +1358,7 @@ class CommandeFournisseur extends CommonOrder $localtaxes_type=getLocalTaxesFromRate($txtva,0,$mysoc,$this->thirdparty); $txtva = preg_replace('/\s*\(.*\)/','',$txtva); // Remove code into vatrate. - + $tabprice = calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $product_type, $this->thirdparty, $localtaxes_type); $total_ht = $tabprice[0]; $total_tva = $tabprice[1]; @@ -2115,7 +2117,7 @@ class CommandeFournisseur extends CommonOrder $localtaxes_type=getLocalTaxesFromRate($txtva,0,$mysoc, $this->thirdparty); $txtva = preg_replace('/\s*\(.*\)/','',$txtva); // Remove code into vatrate. - + $tabprice=calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $type, $this->thirdparty, $localtaxes_type); $total_ht = $tabprice[0]; $total_tva = $tabprice[1]; @@ -2533,10 +2535,10 @@ class CommandeFournisseur extends CommonOrder public function hasDelay() { global $conf; - + $now = dol_now(); $date_to_test = empty($this->date_livraison) ? $this->date_commande : $this->date_livraison; - + return ($this->statut != 3) && $date_to_test && $date_to_test < ($now - $conf->commande->fournisseur->warning_delay); } }