1368-ticket_sale_refactor #327

Merged
joan merged 20 commits from 1368-ticket_sale_refactor into dev 2020-07-02 12:58:12 +00:00
3 changed files with 11 additions and 11 deletions
Showing only changes of commit 789769ad7d - Show all commits

View File

@ -213,9 +213,8 @@
<!-- Price Popover -->
<vn-popover
vn-id="edit-price-popover"
on-open="$ctrl.getMana()"
on-close="$ctrl.edit = null">
<div class="edit-price">
on-open="$ctrl.getMana()">
<div class="edit-popover">
<vn-spinner class="vn-pa-xs"
ng-if="$ctrl.edit.mana == null"
enable="true">
@ -247,9 +246,8 @@
<!-- Discount popover -->
<vn-popover
vn-id="editDiscount"
on-open="$ctrl.getMana()"
on-close="$ctrl.edit = null">
<div class="edit-price">
on-open="$ctrl.getMana()">
<div class="edit-popover">
<vn-spinner class="vn-pa-xs"
ng-if="$ctrl.edit.mana == null"
enable="true">
@ -287,7 +285,6 @@
<!-- Multiple discount dialog -->
<vn-dialog vn-id="editDiscountDialog"
on-open="$ctrl.getMana()"
on-close="$ctrl.edit = null"
message="Edit discount">
<tpl-body>
<vn-spinner class="vn-pa-xs"

View File

@ -328,7 +328,7 @@ class Controller extends Section {
const query = `Sales/${sale.id}/updatePrice`;
this.$http.post(query, {newPrice}).then(res => {
sale.price = res.data.price;
this.edit = null;
this.vnApp.showSuccess(this.$t('Data saved!'));
}).finally(() => {
if (this.newInstances().length === 0)
@ -399,6 +399,8 @@ class Controller extends Section {
for (let sale of sales)
sale.discount = this.edit.discount;
this.edit = null;
}).catch(e => {
this.vnApp.showError(e.message);
});
@ -614,7 +616,7 @@ class Controller extends Section {
calculateSalePrice() {
const sale = this.checkedLines()[0];
const query = `Sales/${sale.id}/recalculatePrice`;
this.$http.post(query).then(res => {
this.$http.post(query).then(() => {
this.vnApp.showSuccess(this.$t('Data saved!'));
this.$.model.refresh();
});

View File

@ -24,7 +24,7 @@ vn-ticket-sale {
}
}
vn-dialog.edit {
@extend .edit-price;
@extend .edit-popover;
&>div{
padding: 0!important;
@ -81,8 +81,9 @@ vn-ticket-sale {
width: 400px
}
}
.edit-price {
.vn-popover .edit-popover {
min-width: 200px;
text-align: center;
section.header {
background-color: $color-main;