From cefad3f18eceb4beb9c562af4ca7b545fc440c40 Mon Sep 17 00:00:00 2001 From: Schin Chauhan Date: Fri, 27 Nov 2020 19:13:29 +0530 Subject: [PATCH 1/4] fix-donation-ticket-sale-stats --- app/templates/components/currency-amount.hbs | 18 +++++++++++++++++- app/templates/events/view/tickets/index.hbs | 9 ++++++--- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/app/templates/components/currency-amount.hbs b/app/templates/components/currency-amount.hbs index 30c4b78e763..7c90578497d 100644 --- a/app/templates/components/currency-amount.hbs +++ b/app/templates/components/currency-amount.hbs @@ -1 +1,17 @@ -{{#if (gt @amount 0)}}{{currency-symbol @currency}}{{/if}} {{format-money @amount}} +{{#if (eq @ticket.type 'donation')}} + {{#if (eq @state 'completed')}} + {{#if (gt @ticket.orderStatistics.sales.completed 0)}}{{currency-symbol @currency}}{{/if}} {{format-money @ticket.orderStatistics.sales.completed}} + {{else if (eq @state 'placed')}} + {{#if (gt @ticket.orderStatistics.sales.placed 0)}}{{currency-symbol @currency}}{{/if}} {{format-money @ticket.orderStatistics.sales.placed}} + {{else if (eq @state 'pending')}} + {{#if (gt @ticket.orderStatistics.sales.pending 0)}}{{currency-symbol @currency}}{{/if}} {{format-money @ticket.orderStatistics.sales.pending}} + {{/if}} +{{else}} + {{#if (eq @state 'completed')}} + {{#if (gt (mult @ticket.orderStatistics.tickets.completed @ticket.price) 0)}}{{currency-symbol @currency}}{{/if}} {{format-money (mult @ticket.orderStatistics.tickets.completed @ticket.price) }} + {{else if (eq @state 'placed')}} + {{#if (gt (mult @ticket.orderStatistics.tickets.placed @ticket.price) 0)}}{{currency-symbol @currency}}{{/if}} {{format-money (mult @ticket.orderStatistics.tickets.placed @ticket.price) }} + {{else if (eq @state 'pending')}} + {{#if (gt (mult @ticket.orderStatistics.tickets.pending @ticket.price) 0)}}{{currency-symbol @currency}}{{/if}} {{format-money (mult @ticket.orderStatistics.tickets.pending @ticket.price) }} + {{/if}} +{{/if}} diff --git a/app/templates/events/view/tickets/index.hbs b/app/templates/events/view/tickets/index.hbs index 848be3f3b83..dccb2011780 100644 --- a/app/templates/events/view/tickets/index.hbs +++ b/app/templates/events/view/tickets/index.hbs @@ -144,15 +144,18 @@ {{#unless this.device.isMobile}} {{ticket.orderStatistics.tickets.completed}} {{/unless}} - + + {{#unless this.device.isMobile}} {{ticket.orderStatistics.tickets.placed}} {{/unless}} - + + {{#unless this.device.isMobile}} {{ticket.orderStatistics.tickets.pending}} {{/unless}} - + + {{/each}} From 32f9585a808e1da753fe9d3949a2c99c628baa81 Mon Sep 17 00:00:00 2001 From: Schin Chauhan Date: Fri, 27 Nov 2020 20:54:26 +0530 Subject: [PATCH 2/4] Revert "fix-donation-ticket-sale-stats" This reverts commit cefad3f18eceb4beb9c562af4ca7b545fc440c40. --- app/templates/components/currency-amount.hbs | 18 +----------------- app/templates/events/view/tickets/index.hbs | 9 +++------ 2 files changed, 4 insertions(+), 23 deletions(-) diff --git a/app/templates/components/currency-amount.hbs b/app/templates/components/currency-amount.hbs index 7c90578497d..30c4b78e763 100644 --- a/app/templates/components/currency-amount.hbs +++ b/app/templates/components/currency-amount.hbs @@ -1,17 +1 @@ -{{#if (eq @ticket.type 'donation')}} - {{#if (eq @state 'completed')}} - {{#if (gt @ticket.orderStatistics.sales.completed 0)}}{{currency-symbol @currency}}{{/if}} {{format-money @ticket.orderStatistics.sales.completed}} - {{else if (eq @state 'placed')}} - {{#if (gt @ticket.orderStatistics.sales.placed 0)}}{{currency-symbol @currency}}{{/if}} {{format-money @ticket.orderStatistics.sales.placed}} - {{else if (eq @state 'pending')}} - {{#if (gt @ticket.orderStatistics.sales.pending 0)}}{{currency-symbol @currency}}{{/if}} {{format-money @ticket.orderStatistics.sales.pending}} - {{/if}} -{{else}} - {{#if (eq @state 'completed')}} - {{#if (gt (mult @ticket.orderStatistics.tickets.completed @ticket.price) 0)}}{{currency-symbol @currency}}{{/if}} {{format-money (mult @ticket.orderStatistics.tickets.completed @ticket.price) }} - {{else if (eq @state 'placed')}} - {{#if (gt (mult @ticket.orderStatistics.tickets.placed @ticket.price) 0)}}{{currency-symbol @currency}}{{/if}} {{format-money (mult @ticket.orderStatistics.tickets.placed @ticket.price) }} - {{else if (eq @state 'pending')}} - {{#if (gt (mult @ticket.orderStatistics.tickets.pending @ticket.price) 0)}}{{currency-symbol @currency}}{{/if}} {{format-money (mult @ticket.orderStatistics.tickets.pending @ticket.price) }} - {{/if}} -{{/if}} +{{#if (gt @amount 0)}}{{currency-symbol @currency}}{{/if}} {{format-money @amount}} diff --git a/app/templates/events/view/tickets/index.hbs b/app/templates/events/view/tickets/index.hbs index dccb2011780..848be3f3b83 100644 --- a/app/templates/events/view/tickets/index.hbs +++ b/app/templates/events/view/tickets/index.hbs @@ -144,18 +144,15 @@ {{#unless this.device.isMobile}} {{ticket.orderStatistics.tickets.completed}} {{/unless}} - - + {{#unless this.device.isMobile}} {{ticket.orderStatistics.tickets.placed}} {{/unless}} - - + {{#unless this.device.isMobile}} {{ticket.orderStatistics.tickets.pending}} {{/unless}} - - + {{/each}} From b8b39d973cabcf63f88771f3649020ae2f80f673 Mon Sep 17 00:00:00 2001 From: Schin Chauhan Date: Fri, 27 Nov 2020 21:00:26 +0530 Subject: [PATCH 3/4] fixes-donation-ticket-stats --- app/templates/events/view/tickets/index.hbs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/templates/events/view/tickets/index.hbs b/app/templates/events/view/tickets/index.hbs index 848be3f3b83..024fc2706f5 100644 --- a/app/templates/events/view/tickets/index.hbs +++ b/app/templates/events/view/tickets/index.hbs @@ -4,7 +4,7 @@
{{this.totalOrders}}
{{t 'Orders'}}
-
{{round this.totalAmount decimals=2}}
{{t 'Sales'}}{{#if this.totalAmount}}({{currency-symbol this.model.eventDetail.paymentCurrency}}){{/if}}
+
{{if this.totalAmount (round this.totalAmount decimals=2) '0.00'}}
{{t 'Sales'}}{{#if this.totalAmount}}({{currency-symbol this.model.eventDetail.paymentCurrency}}){{/if}}
{{this.totalSales}}
{{t 'Tickets sold'}}
@@ -144,15 +144,15 @@ {{#unless this.device.isMobile}} {{ticket.orderStatistics.tickets.completed}} {{/unless}} - + {{#unless this.device.isMobile}} {{ticket.orderStatistics.tickets.placed}} {{/unless}} - + {{#unless this.device.isMobile}} {{ticket.orderStatistics.tickets.pending}} {{/unless}} - + {{/each}} From 795fb94563dd045e52230c7031a5bbb88569c800 Mon Sep 17 00:00:00 2001 From: Areeb Jamal Date: Fri, 27 Nov 2020 22:01:56 +0530 Subject: [PATCH 4/4] Update app/templates/events/view/tickets/index.hbs --- app/templates/events/view/tickets/index.hbs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/templates/events/view/tickets/index.hbs b/app/templates/events/view/tickets/index.hbs index 024fc2706f5..38c220e7604 100644 --- a/app/templates/events/view/tickets/index.hbs +++ b/app/templates/events/view/tickets/index.hbs @@ -4,7 +4,7 @@
{{this.totalOrders}}
{{t 'Orders'}}
-
{{if this.totalAmount (round this.totalAmount decimals=2) '0.00'}}
{{t 'Sales'}}{{#if this.totalAmount}}({{currency-symbol this.model.eventDetail.paymentCurrency}}){{/if}}
+
{{round this.totalAmount decimals=2}}
{{t 'Sales'}}{{#if this.totalAmount}}({{currency-symbol this.model.eventDetail.paymentCurrency}}){{/if}}
{{this.totalSales}}
{{t 'Tickets sold'}}
@@ -158,4 +158,3 @@ -