2
0
forked from Wavyzz/dolibarr
This commit is contained in:
Laurent Destailleur
2015-02-08 00:39:51 +01:00
parent 381af3e6bc
commit 3f807a09b4
2 changed files with 11 additions and 9 deletions

View File

@@ -2109,12 +2109,13 @@ class CommandeFournisseur extends CommonOrder
/**
* Return the max number delivery delay in day
*
* @return string
*/
* @param Translate $langs Language object
* @return Translated string
*/
function getMaxDeliveryTimeDay($langs)
{
if (empty($this->lines)) return $langs->trans('Undefined');
$nb = 0;
foreach ($this->lines as $line) {
$obj = new ProductFournisseur($this->db);
@@ -2123,9 +2124,9 @@ class CommandeFournisseur extends CommonOrder
$obj->fetch($idp);
if ($obj->delivery_time_days > $nb) $nb = $obj->delivery_time_days;
}
}
if ($nb === 0) return $langs->trans('Undefined');
else return $nb.' '.$langs->trans('Days');
}
@@ -2134,7 +2135,7 @@ class CommandeFournisseur extends CommonOrder
/**
* Classe de gestion des lignes de commande
* Class to manage line orders
*/
class CommandeFournisseurLigne extends CommonOrderLine
{

View File

@@ -42,7 +42,7 @@ class ProductFournisseur extends Product
var $id; // product id
var $fourn_ref; // deprecated
var $delivery_time_days;
var $delivery_time_days;
var $ref_supplier; // ref supplier (can be set by get_buyprice)
var $vatrate_supplier; // default vat rate for this supplier/qty/product (can be set by get_buyprice)
@@ -154,6 +154,7 @@ class ProductFournisseur extends Product
* @param float $remise_percent Discount regarding qty (percent)
* @param float $remise Discount regarding qty (amount)
* @param int $newnpr Set NPR or not
* @param int $delivery_time_days Delay in days for delivery (max)
* @return int <0 if KO, >=0 if OK
*/
function update_buyprice($qty, $buyprice, $user, $price_base_type, $fourn, $availability, $ref_fourn, $tva_tx, $charges=0, $remise_percent=0, $remise=0, $newnpr=0, $delivery_time_days=0)
@@ -528,7 +529,7 @@ class ProductFournisseur extends Product
$record_array[]=$record;
}
if (count($record_array) == 0)
if (count($record_array) == 0)
{
$this->db->free($resql);
return 0;
@@ -537,7 +538,7 @@ class ProductFournisseur extends Product
{
$min = -1;
foreach($record_array as $record)
{
{
$fourn_price = $record["price"];
$fourn_unitprice = $record["unitprice"];
if (!empty($record["fk_supplier_price_expression"])) {