diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js index 097c6e1ab..cfc641a5d 100644 --- a/e2e/helpers/selectors.js +++ b/e2e/helpers/selectors.js @@ -688,7 +688,7 @@ export default { searchResult: 'vn-ticket-future tbody tr', openAdvancedSearchButton: 'vn-searchbar .append vn-icon[icon="arrow_drop_down"]', originDated: 'vn-date-picker[label="Origin date"]', - futureDated: 'vn-date-picker[label="Destination date"]', + futureScopeDays: 'vn-date-picker[label="Destination date"]', linesMax: 'vn-textfield[label="Max Lines"]', litersMax: 'vn-textfield[label="Max Liters"]', ipt: 'vn-autocomplete[label="Origin IPT"]', diff --git a/e2e/paths/05-ticket/21_future.spec.js b/e2e/paths/05-ticket/21_future.spec.js index 7b7d478f7..294d79cda 100644 --- a/e2e/paths/05-ticket/21_future.spec.js +++ b/e2e/paths/05-ticket/21_future.spec.js @@ -30,11 +30,11 @@ describe('Ticket Future path', () => { expect(message.text).toContain('warehouseFk is a required argument'); await page.waitToClick(selectors.ticketFuture.openAdvancedSearchButton); - await page.clearInput(selectors.ticketFuture.futureDated); + await page.clearInput(selectors.ticketFuture.futureScopeDays); await page.waitToClick(selectors.ticketFuture.submit); message = await page.waitForSnackbar(); - expect(message.text).toContain('futureDated is a required argument'); + expect(message.text).toContain('futureScopeDays is a required argument'); await page.waitToClick(selectors.ticketFuture.openAdvancedSearchButton); await page.clearInput(selectors.ticketFuture.originDated); diff --git a/modules/ticket/back/methods/ticket/getTicketsFuture.js b/modules/ticket/back/methods/ticket/getTicketsFuture.js index abd269e5e..247924591 100644 --- a/modules/ticket/back/methods/ticket/getTicketsFuture.js +++ b/modules/ticket/back/methods/ticket/getTicketsFuture.js @@ -9,13 +9,13 @@ module.exports = Self => { accessType: 'READ', accepts: [ { - arg: 'originDated', + arg: 'originScopeDays', type: 'date', description: 'The date in question', required: true }, { - arg: 'futureDated', + arg: 'futureScopeDays', type: 'date', description: 'The date to probe', required: true @@ -129,9 +129,9 @@ module.exports = Self => { ] }; case 'state': - return {'f.stateCode': {like: `%${value}%`}}; + return {'f.alertLevel': value}; case 'futureState': - return {'f.futureStateCode': {like: `%${value}%`}}; + return {'f.futureAlertLevel': value}; } }); @@ -141,7 +141,7 @@ module.exports = Self => { stmt = new ParameterizedSQL( `CALL vn.ticket_canbePostponed(?,?,?)`, - [args.originDated, args.futureDated, args.warehouseFk]); + [args.originScopeDays, args.futureScopeDays, args.warehouseFk]); stmts.push(stmt); @@ -170,7 +170,7 @@ module.exports = Self => { LEFT JOIN tmp.ticket_problems tp ON tp.ticketFk = f.id `); - if (args.problems != undefined && (!args.originDated && !args.futureDated)) + if (args.problems != undefined && (!args.originScopeDays && !args.futureScopeDays)) throw new UserError('Choose a date range or days forward'); let condition; diff --git a/modules/ticket/back/methods/ticket/specs/getTicketsFuture.spec.js b/modules/ticket/back/methods/ticket/specs/getTicketsFuture.spec.js index 4b28f34ea..e1e9a0ed2 100644 --- a/modules/ticket/back/methods/ticket/specs/getTicketsFuture.spec.js +++ b/modules/ticket/back/methods/ticket/specs/getTicketsFuture.spec.js @@ -12,8 +12,8 @@ describe('ticket getTicketsFuture()', () => { const options = {transaction: tx}; const args = { - originDated: today, - futureDated: today, + originScopeDays: today, + futureScopeDays: today, warehouseFk: 1, }; @@ -35,8 +35,8 @@ describe('ticket getTicketsFuture()', () => { const options = {transaction: tx}; const args = { - originDated: today, - futureDated: today, + originScopeDays: today, + futureScopeDays: today, warehouseFk: 1, problems: true }; @@ -60,8 +60,8 @@ describe('ticket getTicketsFuture()', () => { const options = {transaction: tx}; const args = { - originDated: today, - futureDated: today, + originScopeDays: today, + futureScopeDays: today, warehouseFk: 1, problems: false }; @@ -85,8 +85,8 @@ describe('ticket getTicketsFuture()', () => { const options = {transaction: tx}; const args = { - originDated: today, - futureDated: today, + originScopeDays: today, + futureScopeDays: today, warehouseFk: 1, problems: null }; @@ -110,8 +110,8 @@ describe('ticket getTicketsFuture()', () => { const options = {transaction: tx}; const args = { - originDated: today, - futureDated: today, + originScopeDays: today, + futureScopeDays: today, warehouseFk: 1, state: 'OK' }; @@ -135,8 +135,8 @@ describe('ticket getTicketsFuture()', () => { const options = {transaction: tx}; const args = { - originDated: today, - futureDated: today, + originScopeDays: today, + futureScopeDays: today, warehouseFk: 1, futureState: 'OK' }; @@ -160,8 +160,8 @@ describe('ticket getTicketsFuture()', () => { const options = {transaction: tx}; const args = { - originDated: today, - futureDated: today, + originScopeDays: today, + futureScopeDays: today, warehouseFk: 1, ipt: null }; @@ -185,8 +185,8 @@ describe('ticket getTicketsFuture()', () => { const options = {transaction: tx}; const args = { - originDated: today, - futureDated: today, + originScopeDays: today, + futureScopeDays: today, warehouseFk: 1, ipt: 'H' }; @@ -210,8 +210,8 @@ describe('ticket getTicketsFuture()', () => { const options = {transaction: tx}; const args = { - originDated: today, - futureDated: today, + originScopeDays: today, + futureScopeDays: today, warehouseFk: 1, futureIpt: null }; @@ -235,8 +235,8 @@ describe('ticket getTicketsFuture()', () => { const options = {transaction: tx}; const args = { - originDated: today, - futureDated: today, + originScopeDays: today, + futureScopeDays: today, warehouseFk: 1, futureIpt: 'H' }; @@ -260,8 +260,8 @@ describe('ticket getTicketsFuture()', () => { const options = {transaction: tx}; const args = { - originDated: today, - futureDated: today, + originScopeDays: today, + futureScopeDays: today, warehouseFk: 1, id: 13 }; @@ -285,8 +285,8 @@ describe('ticket getTicketsFuture()', () => { const options = {transaction: tx}; const args = { - originDated: today, - futureDated: today, + originScopeDays: today, + futureScopeDays: today, warehouseFk: 1, futureId: 12 }; diff --git a/modules/ticket/front/future-search-panel/index.html b/modules/ticket/front/future-search-panel/index.html index d873fbc37..d74a0f2a0 100644 --- a/modules/ticket/front/future-search-panel/index.html +++ b/modules/ticket/front/future-search-panel/index.html @@ -1,7 +1,7 @@