diff --git a/CHANGELOG.md b/CHANGELOG.md index aa63ad637..17259f545 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [2308.01] - 2023-03-09 ### Added -- +- (Client -> Descriptor) Nuevo icono $ con barrotes para los clientes con impago ### Changed - diff --git a/e2e/paths/05-ticket/01-sale/02_edit_sale.spec.js b/e2e/paths/05-ticket/01-sale/02_edit_sale.spec.js index 9d6fddbe6..9e4898be9 100644 --- a/e2e/paths/05-ticket/01-sale/02_edit_sale.spec.js +++ b/e2e/paths/05-ticket/01-sale/02_edit_sale.spec.js @@ -197,6 +197,7 @@ describe('Ticket Edit sale path', () => { }); it('should check in the history that logs has been added', async() => { + await page.reload({waitUntil: ['networkidle0', 'domcontentloaded']}); await page.waitToClick(selectors.ticketSales.firstSaleHistoryButton); await page.waitForSelector(selectors.ticketSales.firstSaleHistory); const result = await page.countElement(selectors.ticketSales.firstSaleHistory); diff --git a/e2e/paths/05-ticket/18_index_payout.spec.js b/e2e/paths/05-ticket/18_index_payout.spec.js index 89b5937a1..220dacf61 100644 --- a/e2e/paths/05-ticket/18_index_payout.spec.js +++ b/e2e/paths/05-ticket/18_index_payout.spec.js @@ -63,6 +63,6 @@ describe('Ticket index payout path', () => { const reference = await page.waitToGetProperty(selectors.clientBalance.firstLineReference, 'innerText'); expect(count).toEqual(4); - expect(reference).toContain('Cash,Albaran: 7, 8Payment'); + expect(reference).toContain('Cash, Albaran: 7, 8Payment'); }); }); diff --git a/loopback/common/methods/application/post.js b/loopback/common/methods/application/post.js index 9ea9a7f71..739f1341a 100644 --- a/loopback/common/methods/application/post.js +++ b/loopback/common/methods/application/post.js @@ -12,6 +12,7 @@ module.exports = Self => { }); Self.post = async ctx => { + console.log(ctx.req.body); return ctx.req.body; }; }; diff --git a/modules/claim/back/methods/claim/filter.js b/modules/claim/back/methods/claim/filter.js index d653229e5..2daee6413 100644 --- a/modules/claim/back/methods/claim/filter.js +++ b/modules/claim/back/methods/claim/filter.js @@ -166,7 +166,8 @@ module.exports = Self => { c.name AS clientName, cl.workerFk, u.name AS workerName, - cs.description, + cs.code stateCode, + cs.description stateDescription, cl.created FROM claim cl LEFT JOIN client c ON c.id = cl.clientFk diff --git a/modules/claim/back/models/claim.json b/modules/claim/back/models/claim.json index 14c4f3452..cd5b767e4 100644 --- a/modules/claim/back/models/claim.json +++ b/modules/claim/back/models/claim.json @@ -77,6 +77,11 @@ "type": "belongsTo", "model": "Ticket", "foreignKey": "ticketFk" - } + }, + "claimDms": { + "type": "hasMany", + "model": "ClaimDms", + "foreignKey": "claimFk" + } } } diff --git a/modules/claim/front/index/index.html b/modules/claim/front/index/index.html index 102e27245..6b2481429 100644 --- a/modules/claim/front/index/index.html +++ b/modules/claim/front/index/index.html @@ -52,8 +52,8 @@ - - {{::claim.description}} + + {{::claim.stateDescription}} diff --git a/modules/claim/front/index/index.js b/modules/claim/front/index/index.js index 084618e16..e3fdabf79 100644 --- a/modules/claim/front/index/index.js +++ b/modules/claim/front/index/index.js @@ -55,13 +55,13 @@ class Controller extends Section { } } - stateColor(claim) { - switch (claim.description) { - case 'Pendiente': + stateColor(code) { + switch (code) { + case 'pending': return 'warning'; - case 'Gestionado': + case 'managed': return 'notice'; - case 'Resuelto': + case 'resolved': return 'success'; } } diff --git a/modules/client/back/methods/client/getCard.js b/modules/client/back/methods/client/getCard.js index afbe36e49..99c59f757 100644 --- a/modules/client/back/methods/client/getCard.js +++ b/modules/client/back/methods/client/getCard.js @@ -80,6 +80,7 @@ module.exports = function(Self) { const data = await Self.rawSql(query, [id, date], myOptions); client.debt = data[0].debt; + client.unpaid = await Self.app.models.ClientUnpaid.findOne({id}, myOptions); return client; }; diff --git a/modules/client/front/balance/create/index.js b/modules/client/front/balance/create/index.js index ef22c968a..cc9e1ab5a 100644 --- a/modules/client/front/balance/create/index.js +++ b/modules/client/front/balance/create/index.js @@ -68,7 +68,7 @@ class Controller extends Dialog { this.receipt.description.push(accountingType.receiptDescription); if (this.originalDescription) this.receipt.description.push(this.originalDescription); - this.receipt.description.join(', '); + this.receipt.description = this.receipt.description.join(', '); } this.maxAmount = accountingType && accountingType.maxAmount; diff --git a/modules/client/front/balance/create/index.spec.js b/modules/client/front/balance/create/index.spec.js index 408e6b66a..fa6b48ea4 100644 --- a/modules/client/front/balance/create/index.spec.js +++ b/modules/client/front/balance/create/index.spec.js @@ -38,7 +38,7 @@ describe('Client', () => { } }; - expect(controller.receipt.description.join(',')).toEqual('Cash,Albaran: 1, 2'); + expect(controller.receipt.description).toEqual('Cash, Albaran: 1, 2'); }); }); diff --git a/modules/client/front/descriptor/index.html b/modules/client/front/descriptor/index.html index ef5c2997f..edf3cc8c3 100644 --- a/modules/client/front/descriptor/index.html +++ b/modules/client/front/descriptor/index.html @@ -18,26 +18,26 @@
+ info="Invoices minus payments plus orders not yet invoiced"> - {{$ctrl.client.salesPersonUser.name}} @@ -70,6 +70,11 @@ icon="icon-no036" ng-if="$ctrl.client.isTaxDataChecked == false"> + +