From: marina Date: Fri, 21 Feb 2025 07:13:22 +0000 (+0300) Subject: ERP-302 Редактирование букета X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=a5f83fa1fab0fc5989ff6cf3f00e4a8981d4d9a5;p=erp24_rep%2Fyii-erp24%2F.git ERP-302 Редактирование букета --- 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);