return [
'selfcost' => round($model->getSelfCost($data), 2),
- 'cost' => round($model->getBouquetCost($data), 2),
+ 'cost' => round($model->getBouquetCost($data, true), 2),
'markup' => round($model->getBouquetCostMarkup($data), 2),
];
}
$newPriceDynamic->save();
}
- public function getBouquetCost($data = null) {
+ public function getBouquetCost($data = null, $forceDefault = false) {
$priceModel = PricesDynamic::find()
->where(['product_id' => $this->guid])
->andWhere(['=', 'active', PricesDynamic::ACTIVE])
->one();
/* @var PricesDynamic $priceModel */
- return $priceModel ? $priceModel->price : $this->getSelfCost($data) * 1.3 * 1.15;
+ return $priceModel && !$forceDefault ? $priceModel->price : $this->getSelfCost($data) * 1.3 * 1.15;
}
public function getBouquetCostMarkup($data = null) {