Merge pull request 'fixes #4866 más detalle en faltas' (!1201) from 4866-detalle-faltas into dev
gitea/salix/pipeline/head This commit looks good Details

Reviewed-on: #1201
Reviewed-by: Javi Gallego <jgallego@verdnatura.es>
Reviewed-by: Juan Ferrer <juan@verdnatura.es>
This commit is contained in:
Alexandre Riera 2023-01-17 07:37:49 +00:00
commit abf4c4e59b
8 changed files with 103 additions and 26 deletions

View File

@ -679,7 +679,10 @@ export default {
moveToTicketButton: '.vn-popover.shown vn-icon[icon="arrow_forward_ios"]',
moveToNewTicketButton: '.vn-popover.shown vn-button[label="New ticket"]',
stateMenuButton: 'vn-ticket-sale vn-tool-bar > vn-button-menu[label="State"]',
moreMenuState: 'body > div > div > div.content > div.filter.ng-scope > vn-textfield'
moreMenuState: 'body > div > div > div.content > div.filter.ng-scope > vn-textfield',
firstSaleHistoryButton: 'vn-ticket-sale vn-tr:nth-child(1) vn-icon-button[icon="history"]',
firstSaleHistory: 'form vn-table div > vn-tbody > vn-tr',
closeHistory: 'div.window vn-button[icon="clear"]'
},
ticketTracking: {
createStateButton: 'vn-float-button'

View File

@ -196,6 +196,15 @@ describe('Ticket Edit sale path', () => {
expect(result).toContain('22.50');
});
it('should check in the history that logs has been added', async() => {
await page.waitToClick(selectors.ticketSales.firstSaleHistoryButton);
await page.waitForSelector(selectors.ticketSales.firstSaleHistory);
const result = await page.countElement(selectors.ticketSales.firstSaleHistory);
expect(result).toBeGreaterThan(0);
await page.waitToClick(selectors.ticketSales.closeHistory);
});
it('should recalculate price of sales', async() => {
await page.waitToClick(selectors.ticketSales.firstSaleCheckbox);
await page.waitToClick(selectors.ticketSales.secondSaleCheckbox);

View File

@ -19,4 +19,5 @@ import './user-popover';
import './upload-photo';
import './bank-entity';
import './log';
import './instance-log';
import './sendSms';

View File

@ -0,0 +1,12 @@
<vn-dialog
vn-id="instanceLog">
<tpl-body>
<vn-log
url="{{$ctrl.url}}"
origin-id="$ctrl.originId"
changed-model="$ctrl.changedModel"
changed-model-id="$ctrl.changedModelId">
</vn-log>
</tpl-body>
</vn-dialog>

View File

@ -0,0 +1,21 @@
import ngModule from '../../module';
import Section from '../section';
import './style.scss';
export default class Controller extends Section {
open() {
this.$.instanceLog.show();
}
}
ngModule.vnComponent('vnInstanceLog', {
controller: Controller,
template: require('./index.html'),
bindings: {
model: '<',
originId: '<',
changedModelId: '<',
changedModel: '@',
url: '@'
}
});

View File

@ -0,0 +1,13 @@
.vn-dialog {
& > .window:not(:has(.empty-rows)) {
width:60%;
vn-log {
vn-card {
visibility: hidden;
& > * {
visibility: visible;
}
}
}
}
}

View File

@ -68,6 +68,7 @@
<vn-th number>Disc</vn-th>
<vn-th number>Amount</vn-th>
<vn-th shrink>Packaging</vn-th>
<vn-th shrink></vn-th>
</vn-tr>
</vn-thead>
<vn-tbody>
@ -204,6 +205,22 @@
<vn-td shrink>
{{::sale.item.itemPackingTypeFk | dashIfEmpty}}
</vn-td>
<vn-td shrink>
<vn-icon-button
vn-none
vn-tooltip="History"
icon="history"
ng-click="log.open()">
</vn-icon-button>
<vn-instance-log
vn-id="log"
url="TicketLogs"
origin-id="$ctrl.$params.id"
changed-model="Sale"
changed-model-id="sale.id">
</vn-instance-log>
</vn-td>
</vn-tr>
</vn-tbody>
</vn-table>

View File

@ -39,3 +39,4 @@ Packaging: Encajado
Refund: Abono
Promotion mana: Maná promoción
Claim mana: Maná reclamación
History: Historial