$productOrder->price = $p->price; | $productOrder->price = $p->price; | ||||
$productOrder->unit = $p->unit; | $productOrder->unit = $p->unit; | ||||
$productOrder->step = $p->step; | $productOrder->step = $p->step; | ||||
$productOrder->id_tax_rate = $p->taxRate->id ; | |||||
$productOrder->save(); | $productOrder->save(); | ||||
} | } | ||||
} | } | ||||
$productOrder->price = $p->price; | $productOrder->price = $p->price; | ||||
$productOrder->unit = $p->unit; | $productOrder->unit = $p->unit; | ||||
$productOrder->step = $p->step; | $productOrder->step = $p->step; | ||||
$productOrder->id_tax_rate = $p->taxRate->id ; | |||||
$productOrder->save(); | $productOrder->save(); | ||||
} | } | ||||
} | } | ||||
$productOrder->unit = $product->unit; | $productOrder->unit = $product->unit; | ||||
$productOrder->step = $product->step; | $productOrder->step = $product->step; | ||||
$productOrder->price = $product->price; | $productOrder->price = $product->price; | ||||
$productOrder->id_tax_rate = $product->taxRate->id; | |||||
$productOrder->save(); | $productOrder->save(); | ||||
} | } | ||||
} | } | ||||
$productOrder->unit = $product->unit; | $productOrder->unit = $product->unit; | ||||
$productOrder->step = $product->step; | $productOrder->step = $product->step; | ||||
$productOrder->price = $product->price; | $productOrder->price = $product->price; | ||||
$productOrder->id_tax_rate = $product->taxRate->id; | |||||
} | } | ||||
} | } | ||||
public static function getPriceWithTax($priceWithoutTax, $taxRate) | public static function getPriceWithTax($priceWithoutTax, $taxRate) | ||||
{ | { | ||||
return floatval($priceWithoutTax) * ($taxRate + 1) ; | |||||
return self::numberTwoDecimals(floatval($priceWithoutTax) * ($taxRate + 1)) ; | |||||
} | } | ||||
public static function numberTwoDecimals($number) | public static function numberTwoDecimals($number) |
$productOrder->price = $productSubscription->product->price; | $productOrder->price = $productSubscription->product->price; | ||||
$productOrder->unit = $productSubscription->product->unit; | $productOrder->unit = $productSubscription->product->unit; | ||||
$productOrder->step = $productSubscription->product->step; | $productOrder->step = $productSubscription->product->step; | ||||
$productOrder->id_tax_rate = $productSubscription->product->taxRate->id; | |||||
$productOrder->save(); | $productOrder->save(); | ||||
$productsAdd = true; | $productsAdd = true; | ||||
} | } |
$productOrder->id_product = $product->id; | $productOrder->id_product = $product->id; | ||||
$productOrder->price = $product->price; | $productOrder->price = $product->price; | ||||
$productOrder->id_tax_rate = $product->id_tax_rate; | |||||
$productOrder->id_tax_rate = $product->taxRate->id; | |||||
$unit = (!is_null($order) && isset($unitsArray[$product->id])) ? $unitsArray[$product->id] : $product->unit; | $unit = (!is_null($order) && isset($unitsArray[$product->id])) ? $unitsArray[$product->id] : $product->unit; | ||||
$coefficient = Product::$unitsArray[$unit]['coefficient']; | $coefficient = Product::$unitsArray[$unit]['coefficient']; |