From: fomichev Date: Mon, 19 May 2025 10:05:10 +0000 (+0300) Subject: Разметка констант X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=c0c2465155ed9d2dbf16474d4ceae5d7aa49ae3e;p=erp24_rep%2Fyii-erp24%2F.git Разметка констант --- diff --git a/erp24/records/BouquetComposition.php b/erp24/records/BouquetComposition.php index 606d0120..c453d69c 100644 --- a/erp24/records/BouquetComposition.php +++ b/erp24/records/BouquetComposition.php @@ -477,12 +477,12 @@ class BouquetComposition extends ActiveRecord ->andWhere(['=', 'active', PricesDynamic::ACTIVE]) ->one(); /* @var PricesDynamic $priceModel */ - return $priceModel && !$forceDefault ? $priceModel->price : $this->getSelfCost($data) * 1.3 * BouquetCompositionPrice::SURCHARGE_ASSEMBLY; + return $priceModel && !$forceDefault ? $priceModel->price : $this->getSelfCost($data) * (1 + BouquetCompositionPrice::SELF_COST_MARKUP / 100) * BouquetCompositionPrice::SURCHARGE_ASSEMBLY; } public function getBouquetCostMarkup($region_id, $data = null, $forceDefault = false) { $selfCost = $this->getSelfCost($data); - return $selfCost > 0 ? ($this->getBouquetCost($region_id, $data, $forceDefault) / (1.3 * $selfCost) - 1) * 100 : 0; + return $selfCost > 0 ? ($this->getBouquetCost($region_id, $data, $forceDefault) / ((1 + BouquetCompositionPrice::SELF_COST_MARKUP / 100) * $selfCost) - 1) * 100 : 0; } // /** diff --git a/erp24/records/BouquetCompositionPrice.php b/erp24/records/BouquetCompositionPrice.php index ac5507d2..c181c293 100644 --- a/erp24/records/BouquetCompositionPrice.php +++ b/erp24/records/BouquetCompositionPrice.php @@ -25,7 +25,7 @@ use yii\db\Expression; */ class BouquetCompositionPrice extends \yii\db\ActiveRecord { - const SELF_COST_MARKUP = 30; + const SELF_COST_MARKUP = 30; //Наценка над себестоимостью. По умолчанию 30% const SURCHARGE_ASSEMBLY = 1.15; // Коэффициент наценки за сборку - 15% /** * {@inheritdoc}