From c0c2465155ed9d2dbf16474d4ceae5d7aa49ae3e Mon Sep 17 00:00:00 2001 From: fomichev Date: Mon, 19 May 2025 13:05:10 +0300 Subject: [PATCH] =?utf8?q?=20=D0=A0=D0=B0=D0=B7=D0=BC=D0=B5=D1=82=D0=BA?= =?utf8?q?=D0=B0=20=D0=BA=D0=BE=D0=BD=D1=81=D1=82=D0=B0=D0=BD=D1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- erp24/records/BouquetComposition.php | 4 ++-- erp24/records/BouquetCompositionPrice.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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} -- 2.39.5