From 24981912e48c0bbca7897e26a3f74bfbe8380b46 Mon Sep 17 00:00:00 2001 From: joan Date: Thu, 13 May 2021 09:17:49 +0200 Subject: [PATCH 1/5] 2907 - Proper claim rate percentage --- modules/client/front/summary/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/client/front/summary/index.html b/modules/client/front/summary/index.html index b1ec1f781..8a4f6eec7 100644 --- a/modules/client/front/summary/index.html +++ b/modules/client/front/summary/index.html @@ -234,7 +234,7 @@ value="{{$ctrl.summary.mana.mana | currency: 'EUR':2}}"> + value="{{$ctrl.claimRate($ctrl.summary.claimsRatio.priceIncreasing / 100) | percentage}}"> From ac02f8b30982c5aea0abbaf7903251d968c22a75 Mon Sep 17 00:00:00 2001 From: joan Date: Thu, 13 May 2021 12:18:21 +0200 Subject: [PATCH 2/5] Ticket request hotfix --- modules/ticket/front/request/create/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ticket/front/request/create/index.html b/modules/ticket/front/request/create/index.html index f7280b2de..8d25358b5 100644 --- a/modules/ticket/front/request/create/index.html +++ b/modules/ticket/front/request/create/index.html @@ -20,7 +20,7 @@ ng-model="$ctrl.ticketRequest.attenderFk" url="Workers/activeWithRole" show-field="nickname" - where="{role: 'buyer'}" + where="{role: {inq: ['logistic', 'buyer']}}" search-function="{firstName: $search}"> From e6f7ef41b0d8053abd36fc9625935d59e838552b Mon Sep 17 00:00:00 2001 From: joan Date: Wed, 12 May 2021 14:22:29 +0200 Subject: [PATCH 3/5] Hotfix: Catalog items without ink --- modules/order/back/methods/order/catalogFilter.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/order/back/methods/order/catalogFilter.js b/modules/order/back/methods/order/catalogFilter.js index b2d49054d..4502435b5 100644 --- a/modules/order/back/methods/order/catalogFilter.js +++ b/modules/order/back/methods/order/catalogFilter.js @@ -118,8 +118,8 @@ module.exports = Self => { FROM tmp.ticketCalculateItem tci JOIN vn.item i ON i.id = tci.itemFk JOIN vn.itemType it ON it.id = i.typeFk - JOIN vn.ink ON ink.id = i.inkFk - JOIN vn.worker w on w.id = it.workerFk`); + JOIN vn.worker w on w.id = it.workerFk + LEFT JOIN vn.ink ON ink.id = i.inkFk`); // Apply order by tag if (orderBy.isTag) { From a70b29f9bf7098fb6b0690ff1e665c269ba7d507 Mon Sep 17 00:00:00 2001 From: joan Date: Fri, 14 May 2021 12:44:23 +0200 Subject: [PATCH 4/5] #2916 - HOTFIX: Grouping selection limit --- front/core/components/confirm/confirm.html | 2 +- modules/order/front/prices-popover/index.js | 21 +++++++++++---------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/front/core/components/confirm/confirm.html b/front/core/components/confirm/confirm.html index 3debb1cfe..5baf3d450 100644 --- a/front/core/components/confirm/confirm.html +++ b/front/core/components/confirm/confirm.html @@ -3,5 +3,5 @@ - + \ No newline at end of file diff --git a/modules/order/front/prices-popover/index.js b/modules/order/front/prices-popover/index.js index 7e2fb1900..aa5570f59 100644 --- a/modules/order/front/prices-popover/index.js +++ b/modules/order/front/prices-popover/index.js @@ -19,8 +19,9 @@ class Controller extends Popover { } show(parent, item) { - this.item = JSON.parse(JSON.stringify(item)); this.id = item.id; + this.item = JSON.parse(JSON.stringify(item)); + this.maxQuantity = this.item.available; this.prices = this.item.prices; super.show(parent); @@ -43,7 +44,6 @@ class Controller extends Popover { } this.totalQuantity = total; - this.maxQuantity = this.item.available - total; } addQuantity(price) { @@ -55,15 +55,16 @@ class Controller extends Popover { getGroupings() { const filledRows = []; - for (let price of this.prices) { - if (price.quantity && price.quantity > 0) { + for (let priceOption of this.prices) { + if (priceOption.quantity && priceOption.quantity > 0) { const priceMatch = filledRows.find(row => { - return row.warehouseFk == price.warehouseFk; + return row.warehouseFk == priceOption.warehouseFk + && row.price == priceOption.price; }); if (!priceMatch) - filledRows.push(Object.assign({}, price)); - else priceMatch.quantity += price.quantity; + filledRows.push(Object.assign({}, priceOption)); + else priceMatch.quantity += priceOption.quantity; } } @@ -74,14 +75,14 @@ class Controller extends Popover { const filledRows = this.getGroupings(); try { - const hasValidGropings = filledRows.some(row => - row.quantity % row.grouping == 0 + const hasInvalidGropings = filledRows.some(row => + row.quantity % row.grouping != 0 ); if (filledRows.length <= 0) throw new Error('First you must add some quantity'); - if (!hasValidGropings) + if (hasInvalidGropings) throw new Error(`The amounts doesn't match with the grouping`); const params = { From e45af1c60af04491f7c10fdf01ad14626c475df3 Mon Sep 17 00:00:00 2001 From: joan Date: Fri, 14 May 2021 13:56:04 +0200 Subject: [PATCH 5/5] Updated unit test --- modules/order/front/prices-popover/index.spec.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/order/front/prices-popover/index.spec.js b/modules/order/front/prices-popover/index.spec.js index a68a328a2..653682e52 100644 --- a/modules/order/front/prices-popover/index.spec.js +++ b/modules/order/front/prices-popover/index.spec.js @@ -23,6 +23,7 @@ describe('Order', () => { {warehouseFk: 1, grouping: 100, quantity: 100} ]; controller.item = {available: 1000}; + controller.maxQuantity = 1000; controller.order = {id: orderId}; })); @@ -41,11 +42,10 @@ describe('Order', () => { }); describe('getTotalQuantity()', () => { - it('should set the totalQuantity and maxQuantity properties', () => { + it('should set the totalQuantity property', () => { controller.getTotalQuantity(); expect(controller.totalQuantity).toEqual(100); - expect(controller.maxQuantity).toEqual(900); }); });