diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js
index 3fdbb47f4..fe35dcfe3 100644
--- a/e2e/helpers/selectors.js
+++ b/e2e/helpers/selectors.js
@@ -392,12 +392,15 @@ export default {
descriptorTicketId: 'vn-ticket-descriptor > vn-descriptor-content > div > div.body > div.top > div'
},
ticketsIndex: {
+ anySearchResult: 'vn-ticket-index vn-tbody > a',
openAdvancedSearchButton: 'vn-searchbar .append vn-icon[icon="arrow_drop_down"]',
advancedSearchInvoiceOut: 'vn-ticket-search-panel vn-textfield[ng-model="filter.refFk"]',
advancedSearchDaysOnward: 'vn-ticket-search-panel vn-input-number[ng-model="filter.scopeDays"]',
+ advancedSearchClient: 'vn-ticket-search-panel vn-textfield[ng-model="filter.clientFk"]',
advancedSearchButton: 'vn-ticket-search-panel button[type=submit]',
newTicketButton: 'vn-ticket-index a[ui-sref="ticket.create"]',
searchResult: 'vn-ticket-index vn-card > vn-table > div > vn-tbody > a.vn-tr',
+ firstTicketCheckbox: 'vn-ticket-index vn-tbody > a:nth-child(1) > vn-td:nth-child(1) > vn-check',
secondTicketCheckbox: 'vn-ticket-index vn-tbody > a:nth-child(2) > vn-td:nth-child(1) > vn-check',
thirdTicketCheckbox: 'vn-ticket-index vn-tbody > a:nth-child(3) > vn-td:nth-child(1) > vn-check',
sixthTicketCheckbox: 'vn-ticket-index vn-tbody > a:nth-child(6) > vn-td:nth-child(1) > vn-check',
diff --git a/e2e/paths/05-ticket/18_index_payout.spec.js b/e2e/paths/05-ticket/18_index_payout.spec.js
index 2292898b5..3d83e6fca 100644
--- a/e2e/paths/05-ticket/18_index_payout.spec.js
+++ b/e2e/paths/05-ticket/18_index_payout.spec.js
@@ -22,16 +22,21 @@ describe('Ticket index payout path', () => {
it('should check the second ticket from a client and 1 of another', async() => {
await page.waitToClick(selectors.globalItems.searchButton);
await page.waitToClick(selectors.ticketsIndex.secondTicketCheckbox);
- await page.waitToClick(selectors.ticketsIndex.sixthTicketCheckbox);
+ await page.waitToClick(selectors.ticketsIndex.thirdTicketCheckbox);
await page.waitToClick(selectors.ticketsIndex.payoutButton);
const message = await page.waitForSnackbar();
expect(message.text).toContain('You cannot make a payment on account from multiple clients');
});
- it('should uncheck the sixth ticket result and check the third which is from the same client then open the payout form', async() => {
- await page.waitToClick(selectors.ticketsIndex.sixthTicketCheckbox);
- await page.waitToClick(selectors.ticketsIndex.thirdTicketCheckbox);
+ it('should search for tickets of the same client then open the payout form', async() => {
+ await page.waitToClick(selectors.ticketsIndex.openAdvancedSearchButton);
+ await page.write(selectors.ticketsIndex.advancedSearchClient, '101');
+ await page.keyboard.press('Enter');
+ await page.waitForNumberOfElements(selectors.ticketsIndex.anySearchResult, 6);
+ await page.waitToClick(selectors.ticketsIndex.firstTicketCheckbox);
+ await page.waitToClick(selectors.ticketsIndex.secondTicketCheckbox);
+
await page.waitToClick(selectors.ticketsIndex.payoutButton);
await page.waitForSelector(selectors.ticketsIndex.payoutCompany);
diff --git a/modules/ticket/back/methods/ticket/filter.js b/modules/ticket/back/methods/ticket/filter.js
index 5341de8d1..5c941ef84 100644
--- a/modules/ticket/back/methods/ticket/filter.js
+++ b/modules/ticket/back/methods/ticket/filter.js
@@ -197,6 +197,7 @@ module.exports = Self => {
t.id,
t.shipped,
CAST(DATE(t.shipped) AS CHAR) AS shippedDate,
+ HOUR(t.shipped) AS shippedHour,
t.nickname,
t.refFk,
t.routeFk,
diff --git a/modules/ticket/front/index/index.html b/modules/ticket/front/index/index.html
index d137d40be..4243ef1ab 100644
--- a/modules/ticket/front/index/index.html
+++ b/modules/ticket/front/index/index.html
@@ -18,12 +18,12 @@
Salesperson
Date
Hour
+ Closure
Alias
Province
State
Zone
Warehouse
- Closure
Total
@@ -86,6 +86,7 @@
{{::ticket.shipped | date: 'HH:mm'}}
+ {{::ticket.zoneLanding | date: 'HH:mm'}}
{{::ticket.warehouse}}
- {{::ticket.zoneLanding | date: 'HH:mm'}}
{{::ticket.total | currency: 'EUR': 2}}
diff --git a/modules/ticket/front/main/index.html b/modules/ticket/front/main/index.html
index 953dc8a6b..8e9af1e12 100644
--- a/modules/ticket/front/main/index.html
+++ b/modules/ticket/front/main/index.html
@@ -2,7 +2,7 @@
vn-id="model"
url="Tickets/filter"
limit="20"
- order="shipped DESC, zoneHour DESC, zoneMinute DESC, clientFk">
+ order="shippedDate DESC, shippedHour ASC, zoneLanding ASC">
this.reload())
+ .then(() => {
+ if ('id' in this.$params) this.reload();
+ })
.then(() => {
this.vnApp.showSuccess(this.$t('Data saved!'));
});