From 18b0ae034c181710e771e77af248c92253efaca3 Mon Sep 17 00:00:00 2001 From: Joan Sanchez Date: Fri, 18 Oct 2019 09:53:30 +0200 Subject: [PATCH] #1815 - show summary correct photos on claim index --- e2e/helpers/selectors.js | 6 +- modules/claim/front/detail/index.html | 152 +++++++-------- modules/claim/front/summary/index.html | 222 +++++++++++----------- modules/claim/front/summary/index.js | 20 ++ modules/claim/front/summary/index.spec.js | 2 + modules/worker/front/log/index.html | 2 +- 6 files changed, 215 insertions(+), 189 deletions(-) diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js index bc68f96e4..1abe93ace 100644 --- a/e2e/helpers/selectors.js +++ b/e2e/helpers/selectors.js @@ -530,13 +530,13 @@ export default { header: 'vn-claim-summary > vn-card > div > h5', state: 'vn-claim-summary vn-label-value[label="State"] > section > span', observation: 'vn-claim-summary vn-textarea[ng-model="$ctrl.summary.claim.observation"] textarea', - firstSaleItemId: 'vn-claim-summary vn-horizontal > vn-auto:nth-child(4) > vn-table > div > vn-tbody > vn-tr:nth-child(1) > vn-td:nth-child(1) > span', + firstSaleItemId: 'vn-claim-summary vn-horizontal > vn-auto:nth-child(4) vn-table > div > vn-tbody > vn-tr:nth-child(1) > vn-td:nth-child(1) > span', firstSaleDescriptorImage: '.vn-popover.shown vn-item-descriptor img', itemDescriptorPopover: '.vn-popover.shown vn-item-descriptor', itemDescriptorPopoverItemDiaryButton: '.vn-popover.shown vn-item-descriptor a[href="#!/item/2/diary"]', - firstDevelopmentWorker: 'vn-claim-summary vn-horizontal > vn-auto:nth-child(5) > vn-table > div > vn-tbody > vn-tr:nth-child(1) > vn-td:nth-child(4) > span', + firstDevelopmentWorker: 'vn-claim-summary vn-horizontal > vn-auto:nth-child(5) vn-table > div > vn-tbody > vn-tr:nth-child(1) > vn-td:nth-child(4) > span', firstDevelopmentWorkerGoToClientButton: '.vn-popover.shown vn-worker-descriptor div.quicklinks > a[href="#!/client/21/summary"]', - firstActionTicketId: 'vn-claim-summary > vn-card > div > vn-horizontal > vn-auto:nth-child(6) > vn-table > div > vn-tbody > vn-tr > vn-td:nth-child(2) > span', + firstActionTicketId: 'vn-claim-summary > vn-card > div > vn-horizontal > vn-auto:nth-child(6) vn-table > div > vn-tbody > vn-tr > vn-td:nth-child(2) > span', firstActionTicketDescriptor: '.vn-popover.shown vn-ticket-descriptor' }, claimBasicData: { diff --git a/modules/claim/front/detail/index.html b/modules/claim/front/detail/index.html index 90e7b5914..4a5767194 100644 --- a/modules/claim/front/detail/index.html +++ b/modules/claim/front/detail/index.html @@ -1,84 +1,84 @@ - - - - - -
- - - - -
-
- - - - Landed - Quantity - Claimed - Description - Price - Disc. - Total - - - - - - {{::saleClaimed.sale.ticket.landed | dateTime:'dd/MM/yyyy'}} - {{::saleClaimed.sale.quantity}} - - - - - - - {{::saleClaimed.sale.concept}} - - - {{::saleClaimed.sale.price | currency: 'EUR':2}} - - - {{::saleClaimed.sale.discount}} % - - - - {{::$ctrl.getSaleTotal(saleClaimed.sale) | currency: 'EUR':2}} - - - - - - - - -
-
- - - -
+ + + + + + + + + + + + + + Landed + Quantity + Claimed + Description + Price + Disc. + Total + + + + + + {{::saleClaimed.sale.ticket.landed | dateTime:'dd/MM/yyyy'}} + {{::saleClaimed.sale.quantity}} + + + + + + + {{::saleClaimed.sale.concept}} + + + {{::saleClaimed.sale.price | currency: 'EUR':2}} + + + {{::saleClaimed.sale.discount}} % + + + + {{::$ctrl.getSaleTotal(saleClaimed.sale) | currency: 'EUR':2}} + + + + + + + + + + + + + + + diff --git a/modules/claim/front/summary/index.html b/modules/claim/front/summary/index.html index 314d71bc9..8d837dd73 100644 --- a/modules/claim/front/summary/index.html +++ b/modules/claim/front/summary/index.html @@ -1,11 +1,9 @@ - + data="photos"> -
{{$ctrl.summary.claim.id}} - {{$ctrl.summary.claim.client.name}}
+
{{::$ctrl.summary.claim.id}} - {{::$ctrl.summary.claim.client.name}}

Detail

- - - - Item - Landed - Quantity - Claimed - Description - Price - Disc. - Total - - - - - - - {{saleClaimed.sale.itemFk | zeroFill:6}} - - - {{saleClaimed.sale.ticket.landed | dateTime: 'dd/MM/yyyy'}} - {{saleClaimed.sale.quantity}} - {{saleClaimed.quantity}} - {{saleClaimed.sale.concept}} - {{saleClaimed.sale.price | currency: 'EUR':2}} - {{saleClaimed.sale.discount}} % - - {{saleClaimed.sale.quantity * saleClaimed.sale.price * - ((100 - saleClaimed.sale.discount) / 100) | currency: 'EUR':2}} - - - - + + + + + Item + Landed + Quantity + Claimed + Description + Price + Disc. + Total + + + + + + + {{::saleClaimed.sale.itemFk | zeroFill:6}} + + + {{::saleClaimed.sale.ticket.landed | dateTime: 'dd/MM/yyyy'}} + {{::saleClaimed.sale.quantity}} + {{::saleClaimed.quantity}} + {{::saleClaimed.sale.concept}} + {{::saleClaimed.sale.price | currency: 'EUR':2}} + {{::saleClaimed.sale.discount}} % + + {{saleClaimed.sale.quantity * saleClaimed.sale.price * + ((100 - saleClaimed.sale.discount) / 100) | currency: 'EUR':2}} + + + + +

Photos

@@ -92,78 +92,82 @@

Development

- - - - Reason - Result - Responsible - Worker - Redelivery - - - - - {{development.claimReason.description}} - {{development.claimResult.description}} - {{development.claimResponsible.description}} - - - {{::development.worker.user.nickname}} - - - {{development.claimRedelivery.description}} - - - + + + + + Reason + Result + Responsible + Worker + Redelivery + + + + + {{::development.claimReason.description}} + {{::development.claimResult.description}} + {{::development.claimResponsible.description}} + + + {{::development.worker.user.nickname}} + + + {{::development.claimRedelivery.description}} + + + +

Action

- - - - Item - Ticket - Destination - Landed - Quantity - Description - Price - Disc. - Total - - - - - - - {{action.sale.itemFk | zeroFill:6}} - - - - - {{action.sale.ticket.id | zeroFill:6}} - - - {{action.claimBeggining.description}} - {{action.sale.ticket.landed | dateTime: 'dd/MM/yyyy'}} - {{action.sale.quantity}} - {{action.sale.concept}} - {{action.sale.price}} - {{action.sale.discount}} % - - {{action.sale.quantity * action.sale.price * - ((100 - action.sale.discount) / 100) | currency: 'EUR':2}} - - - - + + + + + Item + Ticket + Destination + Landed + Quantity + Description + Price + Disc. + Total + + + + + + + {{::action.sale.itemFk | zeroFill:6}} + + + + + {{::action.sale.ticket.id | zeroFill:6}} + + + {{::action.claimBeggining.description}} + {{::action.sale.ticket.landed | dateTime: 'dd/MM/yyyy'}} + {{::action.sale.quantity}} + {{::action.sale.concept}} + {{::action.sale.price}} + {{::action.sale.discount}} % + + {{action.sale.quantity * action.sale.price * + ((100 - action.sale.discount) / 100) | currency: 'EUR':2}} + + + + +
diff --git a/modules/claim/front/summary/index.js b/modules/claim/front/summary/index.js index 257be55e0..7d9e3716f 100644 --- a/modules/claim/front/summary/index.js +++ b/modules/claim/front/summary/index.js @@ -9,6 +9,26 @@ class Controller { this.accessToken = vnToken.token; } + get claim() { + return this._claim; + } + + + set claim(value) { + this._claim = value; + + // Get DMS on summary load + /* if (value) + this.$.$applyAsync(() => this.loadDms()); */ + } + + loadDms() { + this.$.model.where = { + claimFk: this.claim.id + }; + this.$.model.refresh(); + } + getSummary() { this.$http.get(`/claim/api/Claims/${this.claim.id}/getSummary`).then(response => { this.summary = response.data; diff --git a/modules/claim/front/summary/index.spec.js b/modules/claim/front/summary/index.spec.js index c56b91251..87b3caac0 100644 --- a/modules/claim/front/summary/index.spec.js +++ b/modules/claim/front/summary/index.spec.js @@ -1,4 +1,5 @@ import './index.js'; +import crudModel from 'core/mocks/crud-model'; describe('Claim', () => { describe('Component summary', () => { @@ -13,6 +14,7 @@ describe('Claim', () => { $httpBackend = _$httpBackend_; controller = $componentController('vnClaimSummary'); controller.claim = {id: 1}; + controller.$.model = crudModel; })); describe('getSummary()', () => { diff --git a/modules/worker/front/log/index.html b/modules/worker/front/log/index.html index 4f170ac35..91166f045 100644 --- a/modules/worker/front/log/index.html +++ b/modules/worker/front/log/index.html @@ -88,7 +88,7 @@ ng-if="!log.newProperties" id="description">
- {{log.description}} + {{::log.description}}