From: Alexander Smirnov Date: Wed, 26 Mar 2025 14:17:34 +0000 (+0300) Subject: [ERP-381] inputed cost 2 X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=1f82f33013595cc346b291aabee9fa2f1b13941b;p=erp24_rep%2Fyii-erp24%2F.git [ERP-381] inputed cost 2 --- diff --git a/erp24/records/BouquetComposition.php b/erp24/records/BouquetComposition.php index c168cca5..2ae35c57 100644 --- a/erp24/records/BouquetComposition.php +++ b/erp24/records/BouquetComposition.php @@ -369,7 +369,7 @@ class BouquetComposition extends ActiveRecord $newPriceDynamic->active = PricesDynamic::ACTIVE; $newPriceDynamic->date_from = date('Y-m-d H:i:s'); $newPriceDynamic->date_to = date('2100-01-01 00:00:00'); - $newPriceDynamic->price = $cost; + $newPriceDynamic->price = round($cost); $newPriceDynamic->save(); } diff --git a/erp24/views/bouquet/_product_edit.php b/erp24/views/bouquet/_product_edit.php index 284541a4..e5719214 100644 --- a/erp24/views/bouquet/_product_edit.php +++ b/erp24/views/bouquet/_product_edit.php @@ -27,9 +27,9 @@ $this->registerCSS('.cost-value {max-width: 75px}');

Себестоимость: ₽

-

Наценка: +30% / +₽

+

Наценка: +30% / +₽

Цена: ₽. +%

+ min="" step="1" />₽. +%

diff --git a/erp24/web/js/bouquet/bouquet.js b/erp24/web/js/bouquet/bouquet.js index 7b39edf8..1077329b 100644 --- a/erp24/web/js/bouquet/bouquet.js +++ b/erp24/web/js/bouquet/bouquet.js @@ -102,12 +102,12 @@ $('.calculate-btn').on('click', function () { $('.cost-value').val(+response.cost); } if (response.selfcost !== undefined) { - $('.selfcost-value').text(response.selfcost); - $('.markup-value').text(0.3 * (+response.selfcost)); - $('.cost-value').attr('min', 1.3 * (+response.selfcost)); + $('.selfcost-value').text(Math.round(response.selfcost)); + $('.markup-value').text(Math.round(0.3 * (+response.selfcost))); + $('.cost-value').attr('min', Math.round(1.3 * (+response.selfcost))); } if (response.markup !== undefined) { - $('.markup-cost-value').text(+response.markup); + $('.markup-cost-value').text(Math.round(+response.markup)); } } },