|
|
|
|
|
|
|
|
} else { |
|
|
} else { |
|
|
$productOrderMatch = false; |
|
|
$productOrderMatch = false; |
|
|
foreach ($productsOrdersArray[$productOrder->id_product] as &$theProductOrder) { |
|
|
foreach ($productsOrdersArray[$productOrder->id_product] as &$theProductOrder) { |
|
|
if ($theProductOrder->unit == $productOrder->unit && $theProductOrder->price == $productOrder->price) { |
|
|
|
|
|
|
|
|
if ($theProductOrder->unit == $productOrder->unit |
|
|
|
|
|
&& ($theProductOrder->price == $productOrder->price |
|
|
|
|
|
|| ($this->isInvoicePrice() |
|
|
|
|
|
&& $theProductOrder->invoice_price == $productOrder->invoice_price))) { |
|
|
$theProductOrder->quantity += $productOrder->quantity; |
|
|
$theProductOrder->quantity += $productOrder->quantity; |
|
|
$productOrderMatch = true; |
|
|
$productOrderMatch = true; |
|
|
} |
|
|
} |