feat(description): concat bank with tickets #763

Merged
carlosjr merged 3 commits from 3260-ticket_receipt into dev 2021-10-28 11:36:30 +00:00
4 changed files with 14 additions and 6 deletions

View File

@ -1,3 +1,4 @@
/* eslint max-len: ["error", { "ignoreStrings": true }]*/
export default { export default {
globalItems: { globalItems: {
@ -273,6 +274,7 @@ export default {
deliveredAmount: '.vn-dialog vn-input-number[ng-model="$ctrl.deliveredAmount"]', deliveredAmount: '.vn-dialog vn-input-number[ng-model="$ctrl.deliveredAmount"]',
refundAmount: '.vn-dialog vn-input-number[ng-model="$ctrl.amountToReturn"]', refundAmount: '.vn-dialog vn-input-number[ng-model="$ctrl.amountToReturn"]',
saveButton: '.vn-dialog.shown [response="accept"]', saveButton: '.vn-dialog.shown [response="accept"]',
anyBalanceLine: 'vn-client-balance-index vn-tbody > vn-tr',
firstLineBalance: 'vn-client-balance-index vn-tbody > vn-tr:nth-child(1) > vn-td:nth-child(8)', firstLineBalance: 'vn-client-balance-index vn-tbody > vn-tr:nth-child(1) > vn-td:nth-child(8)',
firstLineReference: 'vn-client-balance-index vn-tbody > vn-tr:nth-child(1) > vn-td-editable', firstLineReference: 'vn-client-balance-index vn-tbody > vn-tr:nth-child(1) > vn-td-editable',
firstLineReferenceInput: 'vn-client-balance-index vn-tbody > vn-tr:nth-child(1) > vn-td-editable > div > field > vn-textfield' firstLineReferenceInput: 'vn-client-balance-index vn-tbody > vn-tr:nth-child(1) > vn-td-editable > div > field > vn-textfield'
@ -470,6 +472,7 @@ export default {
firstTicketCheckbox: 'vn-ticket-index vn-tbody > a:nth-child(1) > vn-td:nth-child(1) > vn-check', 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', 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', thirdTicketCheckbox: 'vn-ticket-index vn-tbody > a:nth-child(3) > vn-td:nth-child(1) > vn-check',
fifthTicketCheckbox: 'vn-ticket-index vn-tbody > a:nth-child(5) > vn-td:nth-child(1) > vn-check',
sixthTicketCheckbox: 'vn-ticket-index vn-tbody > a:nth-child(6) > vn-td:nth-child(1) > vn-check', sixthTicketCheckbox: 'vn-ticket-index vn-tbody > a:nth-child(6) > vn-td:nth-child(1) > vn-check',
payoutButton: 'vn-ticket-index vn-button[icon="icon-recovery"]', payoutButton: 'vn-ticket-index vn-button[icon="icon-recovery"]',
payoutCompany: '.vn-dialog vn-autocomplete[ng-model="$ctrl.companyFk"]', payoutCompany: '.vn-dialog vn-autocomplete[ng-model="$ctrl.companyFk"]',

View File

@ -21,8 +21,8 @@ describe('Ticket index payout path', () => {
it('should check the second ticket from a client and 1 of another', async() => { it('should check the second ticket from a client and 1 of another', async() => {
await page.waitToClick(selectors.globalItems.searchButton); await page.waitToClick(selectors.globalItems.searchButton);
await page.waitToClick(selectors.ticketsIndex.secondTicketCheckbox);
await page.waitToClick(selectors.ticketsIndex.thirdTicketCheckbox); await page.waitToClick(selectors.ticketsIndex.thirdTicketCheckbox);
await page.waitToClick(selectors.ticketsIndex.fifthTicketCheckbox);
await page.waitToClick(selectors.ticketsIndex.payoutButton); await page.waitToClick(selectors.ticketsIndex.payoutButton);
const message = await page.waitForSnackbar(); const message = await page.waitForSnackbar();
@ -58,9 +58,11 @@ describe('Ticket index payout path', () => {
await page.selectModule('client'); await page.selectModule('client');
await page.accessToSearchResult('1101'); await page.accessToSearchResult('1101');
await page.accessToSection('client.card.balance.index'); await page.accessToSection('client.card.balance.index');
await page.waitForSelector('vn-client-balance-index vn-tbody > vn-tr'); await page.waitForSelector(selectors.clientBalance.anyBalanceLine);
let result = await page.countElement('vn-client-balance-index vn-tbody > vn-tr'); const count = await page.countElement(selectors.clientBalance.anyBalanceLine);
const reference = await page.waitToGetProperty(selectors.clientBalance.firstLineReference, 'innerText');
expect(result).toEqual(4); expect(count).toEqual(4);
expect(reference).toContain('Cash, Albaran: 7, 8Payment');
}); });
}); });

View File

@ -45,6 +45,7 @@ class Controller extends Dialog {
set description(value) { set description(value) {
this.receipt.description = value; this.receipt.description = value;
this.originalDescription = value;
} }
get description() { get description() {
@ -60,7 +61,8 @@ class Controller extends Dialog {
if (value) { if (value) {
const accountingType = value.accountingType; const accountingType = value.accountingType;
this.receipt.description = accountingType && accountingType.receiptDescription; this.receipt.description =
`${accountingType && accountingType.receiptDescription}, ${this.originalDescription}`;
} }
} }

View File

@ -27,6 +27,7 @@ describe('Client', () => {
describe('bankSelection() setter', () => { describe('bankSelection() setter', () => {
it('should set the receipt description property', () => { it('should set the receipt description property', () => {
controller.originalDescription = 'Albaran: 1, 2';
controller.bankSelection = { controller.bankSelection = {
id: 1, id: 1,
bank: 'Cash', bank: 'Cash',
@ -36,7 +37,7 @@ describe('Client', () => {
} }
}; };
expect(controller.receipt.description).toEqual('Cash'); expect(controller.receipt.description).toEqual('Cash, Albaran: 1, 2');
}); });
}); });