From a5f83fa1fab0fc5989ff6cf3f00e4a8981d4d9a5 Mon Sep 17 00:00:00 2001 From: marina Date: Fri, 21 Feb 2025 10:13:22 +0300 Subject: [PATCH] =?utf8?q?ERP-302=20=D0=A0=D0=B5=D0=B4=D0=B0=D0=BA=D1=82?= =?utf8?q?=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5=20=D0=B1=D1=83?= =?utf8?q?=D0=BA=D0=B5=D1=82=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- erp24/views/bouquet/_product_edit.php | 4 ++-- erp24/web/js/bouquet/bouquet.js | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/erp24/views/bouquet/_product_edit.php b/erp24/views/bouquet/_product_edit.php index 1f3479cc..e1f5b9c6 100644 --- a/erp24/views/bouquet/_product_edit.php +++ b/erp24/views/bouquet/_product_edit.php @@ -16,14 +16,14 @@ use yii\helpers\Html; ]) ?>
-
+

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

Наценка:

Цена: ₽

-
+
'btn btn-warning calculate-btn w-100']) ?> diff --git a/erp24/web/js/bouquet/bouquet.js b/erp24/web/js/bouquet/bouquet.js index 03c72a73..4b273deb 100644 --- a/erp24/web/js/bouquet/bouquet.js +++ b/erp24/web/js/bouquet/bouquet.js @@ -46,7 +46,7 @@ $('.calculate-btn').on('click', function () { let data = []; $('.selected-item').each(function () { - let id = $(this).data('id'); + let id = $(this).data('id'); let quantity = $(this).find('.quantity-input').val(); if (id && quantity) { @@ -56,6 +56,9 @@ $('.calculate-btn').on('click', function () { }); } }); + $('.cost-value').text(null); + $('.selfcost-value').text(null); + $('.markup-value').text(null); $.ajax({ url: '/bouquet/get-calculates', @@ -66,7 +69,7 @@ $('.calculate-btn').on('click', function () { success: function(response) { if (response) { if (response.cost !== undefined) { - $('.price-value').text(response.cost); + $('.cost-value').text(response.cost); } if (response.selfcost !== undefined) { $('.selfcost-value').text(response.selfcost); -- 2.39.5