|
|
|
|
|
|
|
|
if($product['quantity_remaining'] < 0) $product['quantity_remaining'] = 0 ; |
|
|
if($product['quantity_remaining'] < 0) $product['quantity_remaining'] = 0 ; |
|
|
$product['quantity_form'] = 0 ; |
|
|
$product['quantity_form'] = 0 ; |
|
|
|
|
|
|
|
|
if($product['productDistribution'][0]['active']) { |
|
|
|
|
|
$potentialRevenues += $product['quantity_max'] * $product['price']; |
|
|
|
|
|
$potentialWeight += $product['quantity_max'] * $product['weight'] / 1000; |
|
|
|
|
|
|
|
|
if($product['productDistribution'][0]['active'] && $product['productDistribution'][0]['quantity_max']) { |
|
|
|
|
|
$potentialRevenues += $product['productDistribution'][0]['quantity_max'] * $product['price']; |
|
|
|
|
|
$potentialWeight += $product['productDistribution'][0]['quantity_max'] * $product['weight'] / 1000; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
$json['distribution']['potential_revenues'] = $potentialRevenues ; |
|
|
$json['distribution']['potential_revenues'] = $potentialRevenues ; |
|
|
$json['distribution']['potential_weight'] = $potentialWeight ; |
|
|
$json['distribution']['potential_weight'] = $potentialWeight ; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//die('potential revenues : '.$json['distribution']['potential_revenues']) ; |
|
|
|
|
|
|
|
|
$json['products'] = $productsArray ; |
|
|
$json['products'] = $productsArray ; |
|
|
|
|
|
|
|
|
// orders as array |
|
|
// orders as array |