diff --git a/client/ticket/src/sale/index.html b/client/ticket/src/sale/index.html index 5803b9742..87edb05cf 100644 --- a/client/ticket/src/sale/index.html +++ b/client/ticket/src/sale/index.html @@ -41,33 +41,39 @@ - - - + + + + - + - + + + - + -
ItemDescriptionItemIdDescription Quantity PriceDiscountDisc Amount
- - - - + + + + + + {{::sale.itemFk}} {{sale.quantity}} @@ -108,11 +115,11 @@ {{(sale.quantity * sale.price) - ((sale.discount * (sale.quantity * sale.price))/100) | currency:' €':2}}
No resultsNo results
+

Subtotal {{$ctrl.subTotal | currency:' €':2}}

VAT {{$ctrl.VAT | currency:' €':2}}

diff --git a/client/ticket/src/sale/index.js b/client/ticket/src/sale/index.js index e18abd4a2..e468820aa 100644 --- a/client/ticket/src/sale/index.js +++ b/client/ticket/src/sale/index.js @@ -27,19 +27,17 @@ class Controller { }); } $onChanges() { - if (this.ticket) + if (this.ticket && this.ticket.clientFk) this.getSales(this.ticket.clientFk); } onMoreOpen() { let options = this.moreOptions.filter(o => o.always || this.isChecked); this.$.moreButton.data = options; } - getTaxes() { this.getSubTotal(); this.getVAT(); } - getSubTotal() { let sales = this.sales; @@ -48,14 +46,12 @@ class Controller { this.subTotal += (sale.quantity * sale.price) - ((sale.discount * (sale.quantity * sale.price)) / 100); }); } - getVAT() { this.$http.get(`/ticket/api/Tickets/${this.ticket.id}/getVAT`).then(res => { this.VAT = res.data || 0; this.total = this.subTotal + this.VAT; }); } - get isEditable() { try { return !this.ticket.tracking.state.alertLevel; @@ -63,7 +59,6 @@ class Controller { return true; } - get isChecked() { let data = this.sales; if (data) @@ -73,7 +68,6 @@ class Controller { return false; } - getCheckedLines() { let lines = []; let data = this.sales; @@ -84,11 +78,9 @@ class Controller { return lines; } - onMoreChange(callback) { callback.call(this); } - // Change State onStateOkClick() { let filter = {where: {code: "OK"}, fields: ["id"]}; @@ -97,7 +89,6 @@ class Controller { this.onStateChange(res.data[0].id); }); } - onStateChange(value) { let params = {ticketFk: this.$state.params.id, stateFk: value}; this.$http.post(`/ticket/api/TicketTrackings/changeState`, params).then(() => { @@ -105,12 +96,10 @@ class Controller { this.vnApp.showSuccess(this.translate.instant('Data saved!')); }); } - // Add Turn showAddTurnDialog() { this.$.addTurn.show(); } - addTurn(day) { let params = {ticketFk: this.$state.params.id, weekDay: day}; this.$http.patch(`/ticket/api/TicketWeeklies`, params).then(() => { @@ -118,24 +107,20 @@ class Controller { this.vnApp.showSuccess(this.translate.instant('Data saved!')); }); } - // Delete Ticket showDeleteTicketDialog() { this.$.deleteConfirmation.show(); } - returnDeleteTicketDialog(response) { if (response === 'ACCEPT') this.deleteTicket(); } - deleteTicket() { let params = {id: this.$state.params.id}; this.$http.post(`/ticket/api/Tickets/deleted`, params).then(() => { this.$state.go('ticket.list'); }); } - // Remove Lines onRemoveLinesClick(response) { if (response === 'ACCEPT') { @@ -147,17 +132,14 @@ class Controller { }); } } - removeInstances(instances) { for (let i = instances.length - 1; i >= 0; i--) { this.sales.splice(instances[i].instance, 1); } } - showRemoveLinesDialog() { this.$.deleteLines.show(); } - // Move Lines showTransferPopover(event) { let filter = {clientFk: this.ticket.clientFk, ticketFk: this.ticket.id}; @@ -169,7 +151,6 @@ class Controller { this.$.transfer.parent = event.target; this.$.transfer.show(); } - moveLines(ticketID) { let sales = this.getCheckedLines(); @@ -178,7 +159,6 @@ class Controller { this.goToTicket(ticketID); }); } - // In Progress linesToNewTicket() { let ticket = { @@ -198,11 +178,9 @@ class Controller { this.getSales(); }); } - goToTicket(ticketID) { this.$state.go("ticket.card.sale", {id: ticketID}); } - // Focus First Input focusFirstInput(e) { let firstFocusable = e.querySelector('input, textarea'); @@ -215,7 +193,6 @@ class Controller { }, 200); } } - // Slesperson Mana getManaSalespersonMana() { this.$http.get(`/api/Tickets/${this.$state.params.id}/getSalesPersonMana`).then(res => { @@ -228,11 +205,9 @@ class Controller { this.$.descriptor.parent = event.target; this.$.descriptor.show(); } - onDescriptorLoad() { this.$.popover.relocate(); } - // Edit Line showEditPricePopover(event, sale) { this.sale = sale; @@ -246,7 +221,6 @@ class Controller { this.$.editPricePopover.show(); this.focusFirstInput(this.$.editPricePopover.$element[0]); } - updatePrice() { if (this.editedPrice != this.sale.price) { this.$http.post(`/ticket/api/Sales/updatePrice`, {id: this.edit.id, price: this.editedPrice, ticketFk: this.ticket.id}).then(() => { @@ -256,7 +230,6 @@ class Controller { } this.$.editPricePopover.hide(); } - showEditPopover(event, sale) { this.sale = sale; this.edit = [{ @@ -270,23 +243,19 @@ class Controller { this.$.editPopover.show(); this.focusFirstInput(this.$.editPopover.$element[0]); } - showEditDialog() { this.edit = this.getCheckedLines(); this.$.editDialog.show(); this.focusFirstInput(this.$.editDialog.$element[0]); } - hideEditDialog() { this.getSales(); this.$.editDialog.hide(); } - hideEditPopover() { this.getSales(); this.$.editPopover.hide(); } - updateQuantity(id, quantity) { this.$http.post(`/ticket/api/Sales/${id}/updateQuantity`, {quantity: parseInt(quantity)}).then(() => { this.vnApp.showSuccess(this.translate.instant('Data saved!')); diff --git a/client/ticket/src/sale/locale/es.yml b/client/ticket/src/sale/locale/es.yml index f834f4c23..0b70f5c2e 100644 --- a/client/ticket/src/sale/locale/es.yml +++ b/client/ticket/src/sale/locale/es.yml @@ -13,4 +13,5 @@ You are going to delete lines of the ticket: Vas a borrar lineas del ticket Continue anyway?: ¿Estás seguro? The new quantity should be smaller than the old one: La nueva cantidad debe de ser menor que la anterior You have to allow pop-ups in your web browser to use this functionality: - Debes permitir los pop-pups en tu navegador para que esta herramienta funcione correctamente \ No newline at end of file + Debes permitir los pop-pups en tu navegador para que esta herramienta funcione correctamente +Disc: Dto \ No newline at end of file diff --git a/client/ticket/src/sale/style.scss b/client/ticket/src/sale/style.scss index c8d06babc..cb1c4c45a 100644 --- a/client/ticket/src/sale/style.scss +++ b/client/ticket/src/sale/style.scss @@ -1,25 +1,25 @@ @import "colors"; vn-ticket-sale { vn-popover.edit { - & div.popover{ + div.popover{ width: 200px; } - & vn-horizontal.header{ + vn-horizontal.header{ background-color: $main-01; - & h5{ + h5{ color: white; margin: 0 auto; } } - & p.simulatorTitle{ + p.simulatorTitle{ margin-bottom: 0px; font-size: 12px; color: $main-01; } - & vn-label-value{ + vn-label-value{ padding-bottom: 20px; } @@ -45,7 +45,7 @@ vn-ticket-sale { } vn-ticket-sale{ - & tr .mdl-textfield{ + tr .mdl-textfield{ width: inherit; max-width: 100%; } @@ -63,23 +63,30 @@ vn-ticket-sale { } vn-dialog.ticket-create{ - & vn-button[label=Cancel]{ + vn-button[label=Cancel]{ display: none; } - & vn-card.vn-ticket-create{ + vn-card.vn-ticket-create{ padding: 0!important; } } table { - & vn-textfield { + vn-textfield { max-width: 100px; float: right; + margin: 0!important; + input { + text-align: right; + } + } + img { + border-radius: 50%; } } vn-textfield { - & span.filter { + span.filter { padding-top: 3px; padding-right: 3px; color: $main-font-color