From 16c0187bc93eeb834f4f072ec6b8d85c5c7ea11e Mon Sep 17 00:00:00 2001
From: Elsio Sanchez <45974454+elsiosanchez@users.noreply.github.com>
Date: Tue, 19 Dec 2023 17:29:29 -0400
Subject: [PATCH] Fix: Apply Discount To All Lines (#1792)
---
.../HeaderOrder/ProductInfo/SearchProduct.vue | 12 +++++++++++
.../Form/VPOS2/Options/salesOrder.vue | 21 +++++++++++++++----
2 files changed, 29 insertions(+), 4 deletions(-)
diff --git a/src/components/ADempiere/Form/VPOS2/HeaderOrder/ProductInfo/SearchProduct.vue b/src/components/ADempiere/Form/VPOS2/HeaderOrder/ProductInfo/SearchProduct.vue
index a6d4f274352..50b7b6c215e 100644
--- a/src/components/ADempiere/Form/VPOS2/HeaderOrder/ProductInfo/SearchProduct.vue
+++ b/src/components/ADempiere/Form/VPOS2/HeaderOrder/ProductInfo/SearchProduct.vue
@@ -182,6 +182,18 @@ export default defineComponent({
})
} else {
const isProduct = store.getters.getListOrderLines.find(list => list.product.id === search.product.id)
+ if (isEmptyValue(isProduct)) {
+ store.dispatch('newLine', {
+ productId: search.product.id,
+ quantity: 1
+ })
+ .finally(() => {
+ searchProduct.value = ''
+ autocompleteSearchProduct.value.close()
+ autocompleteSearchProduct.value.suggestions = []
+ })
+ return
+ }
store.dispatch('updateCurrentLine', {
lineId: isProduct.id,
quantity: Number(isProduct.quantity_ordered) + 1
diff --git a/src/components/ADempiere/Form/VPOS2/Options/salesOrder.vue b/src/components/ADempiere/Form/VPOS2/Options/salesOrder.vue
index c2a9194b7db..2199f660e08 100644
--- a/src/components/ADempiere/Form/VPOS2/Options/salesOrder.vue
+++ b/src/components/ADempiere/Form/VPOS2/Options/salesOrder.vue
@@ -17,6 +17,7 @@ along with this program. If not, see .
+
.
+
.
+
.
.
element-loading-background="rgba(255, 255, 255, 0.8)"
class="view-loading"
/>
-
+
.
.
element-loading-background="rgba(255, 255, 255, 0.8)"
class="view-loading"
/>
-