]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
Разметка констант
authorfomichev <vladimir.fomichev@erp-flowers.ru>
Mon, 19 May 2025 10:05:10 +0000 (13:05 +0300)
committerfomichev <vladimir.fomichev@erp-flowers.ru>
Mon, 19 May 2025 10:05:10 +0000 (13:05 +0300)
erp24/records/BouquetComposition.php
erp24/records/BouquetCompositionPrice.php

index 606d0120b31756e622b8b40f488ea00faf0261ef..c453d69ce2a99cb790d82a6495d52931168056c8 100644 (file)
@@ -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;
     }
 
 //    /**
index ac5507d2bf1e265c3e4a0bd7563c380cc4960585..c181c293e734cdcd6140690a94aa07326625bacd 100644 (file)
@@ -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}