From 353d0e352d60eb3fad430dc8ec4e0e09c9887507 Mon Sep 17 00:00:00 2001 From: joan Date: Wed, 16 Jun 2021 09:43:07 +0200 Subject: [PATCH] 2961 - Show tickets on summary --- modules/client/front/summary/index.html | 117 +++++++++++++++++++++++- modules/client/front/summary/index.js | 38 ++++++++ modules/client/front/summary/style.scss | 4 +- 3 files changed, 153 insertions(+), 6 deletions(-) diff --git a/modules/client/front/summary/index.html b/modules/client/front/summary/index.html index 8a4f6eec74..3fc1a8d24c 100644 --- a/modules/client/front/summary/index.html +++ b/modules/client/front/summary/index.html @@ -1,3 +1,12 @@ + +
- - + - + + + + +

Last tickets

+ + + + Id + Client + Salesperson + Date + State + Total + + + + +
+ {{::ticket.id}} + + + {{::ticket.nickname}} + + + + + {{::ticket.userName | dashIfEmpty}} + + + + + {{::ticket.shipped | date: 'dd/MM/yyyy'}} + + + + + {{::ticket.refFk}} + + + {{::ticket.state}} + + + + + {{::(ticket.totalWithVat ? ticket.totalWithVat : 0) | currency: 'EUR': 2}} + + + + + + + + + + + + + + + - \ No newline at end of file + + + + + + + \ No newline at end of file diff --git a/modules/client/front/summary/index.js b/modules/client/front/summary/index.js index 8ef724061a..7a30db95f3 100644 --- a/modules/client/front/summary/index.js +++ b/modules/client/front/summary/index.js @@ -39,6 +39,44 @@ class Controller extends Summary { if (rate) return rate * 100; } + + stateColor(ticket) { + if (ticket.alertLevelCode === 'OK') + return 'success'; + else if (ticket.alertLevelCode === 'FREE') + return 'notice'; + else if (ticket.alertLevel === 1) + return 'warning'; + else if (ticket.alertLevel === 0) + return 'alert'; + } + + chipColor(date) { + const today = new Date(); + today.setHours(0, 0, 0, 0); + + const ticketShipped = new Date(date); + ticketShipped.setHours(0, 0, 0, 0); + + const difference = today - ticketShipped; + + if (difference == 0) + return 'warning'; + if (difference < 0) + return 'success'; + console.log('a'); + } + + totalPriceColor(ticket) { + const total = parseInt(ticket.totalWithVat); + if (total > 0 && total < 50) + return 'warning'; + } + + preview(ticket) { + this.selectedTicket = ticket; + this.$.summary.show(); + } } ngModule.vnComponent('vnClientSummary', { diff --git a/modules/client/front/summary/style.scss b/modules/client/front/summary/style.scss index 1520659d2b..79708b3616 100644 --- a/modules/client/front/summary/style.scss +++ b/modules/client/front/summary/style.scss @@ -1,6 +1,8 @@ @import "variables"; -vn-client-summary { +vn-client-summary .summary { + max-width: $width-lg; + .alert span { color: $color-alert !important }