-
New price
-
{{$ctrl.newPrice | currency: 'EUR':2}}
-
+
+
+
+
+
+
+
+
+
+
Total claimed price
+
{{$ctrl.newPrice | currency: 'EUR':2}}
+
+
diff --git a/modules/claim/front/detail/index.js b/modules/claim/front/detail/index.js
index 6589354ae0..f66a296c8e 100644
--- a/modules/claim/front/detail/index.js
+++ b/modules/claim/front/detail/index.js
@@ -128,25 +128,30 @@ class Controller {
this.$.editPopover.show();
}
- getManaSalespersonMana() {
+ getSalespersonMana() {
this.$http.get(`Tickets/${this.claim.ticketFk}/getSalesPersonMana`).then(res => {
this.mana = res.data;
});
}
updateDiscount() {
- if (this.newDiscount != this.saleClaimed.sale.discount) {
- const params = {salesIds: [this.saleClaimed.sale.id], newDiscount: this.newDiscount};
- const query = `Tickets/${this.saleClaimed.sale.ticketFk}/updateDiscount`;
+ const claimedSale = this.saleClaimed.sale;
+ if (this.newDiscount != claimedSale.discount) {
+ const params = {salesIds: [claimedSale.id], newDiscount: this.newDiscount};
+ const query = `Tickets/${claimedSale.ticketFk}/updateDiscount`;
this.$http.post(query, params).then(() => {
- this.vnApp.showSuccess(this.$translate.instant('Data saved!'));
+ claimedSale.discount = this.newDiscount;
+ this.calculateTotals();
this.clearDiscount();
- this.$.model.refresh();
+
+ this.vnApp.showSuccess(this.$translate.instant('Data saved!'));
}).catch(err => {
this.vnApp.showError(err.message);
});
}
+
+ this.$.editPopover.hide();
}
updateNewPrice() {
diff --git a/modules/claim/front/detail/index.spec.js b/modules/claim/front/detail/index.spec.js
index a8843df38e..24491075db 100644
--- a/modules/claim/front/detail/index.spec.js
+++ b/modules/claim/front/detail/index.spec.js
@@ -29,6 +29,9 @@ describe('claim', () => {
hide: () => {},
show: () => {}
};
+ controller.$.editPopover = {
+ hide: () => {}
+ };
}));
describe('openAddSalesDialog()', () => {
@@ -110,16 +113,18 @@ describe('claim', () => {
spyOn(controller.vnApp, 'showSuccess');
+ spyOn(controller, 'calculateTotals');
spyOn(controller, 'clearDiscount');
- spyOn(controller.$.model, 'refresh');
+ spyOn(controller.$.editPopover, 'hide');
$httpBackend.when('POST', 'Tickets/1/updateDiscount').respond({});
controller.updateDiscount();
$httpBackend.flush();
- expect(controller.vnApp.showSuccess).toHaveBeenCalledWith('Data saved!');
+ expect(controller.calculateTotals).toHaveBeenCalledWith();
expect(controller.clearDiscount).toHaveBeenCalledWith();
- expect(controller.$.model.refresh).toHaveBeenCalledWith();
+ expect(controller.vnApp.showSuccess).toHaveBeenCalledWith('Data saved!');
+ expect(controller.$.editPopover.hide).toHaveBeenCalledWith();
});
});
diff --git a/modules/claim/front/detail/locale/es.yml b/modules/claim/front/detail/locale/es.yml
index ae648d51d5..9bbfd7e861 100644
--- a/modules/claim/front/detail/locale/es.yml
+++ b/modules/claim/front/detail/locale/es.yml
@@ -6,4 +6,5 @@ Price: Precio
Claimable sales from ticket: Lineas reclamables del ticket
Detail: Detalles
Add sale item: Añadir artículo
-Insuficient permisos: Permisos insuficientes
\ No newline at end of file
+Insuficient permisos: Permisos insuficientes
+Total claimed price: Precio total reclamado
\ No newline at end of file
diff --git a/modules/claim/front/detail/style.scss b/modules/claim/front/detail/style.scss
index 2b5727d48b..6229e56fb6 100644
--- a/modules/claim/front/detail/style.scss
+++ b/modules/claim/front/detail/style.scss
@@ -1,47 +1,27 @@
@import "variables";
-vn-claim-detail {
- .vn-textfield {
- margin: 0!important;
- max-width: 100px;
- }
- vn-dialog[vn-id=addSales] {
- tpl-body {
- width: 950px;
- div {
- div.buttons {
- display: none;
- }
- vn-table{
- min-width: 950px;
- }
- }
- }
- }
- vn-popover.edit {
- div.popover {
- width: 200px;
- }
- vn-horizontal.header {
- background-color: $color-main;
- color: $color-font-dark;
+.vn-popover .discount-popover {
+ width: 16em;
- h5 {
- color: inherit;
- margin: 0 auto;
- }
- }
- p.simulatorTitle {
- margin-bottom: 0px;
- font-size: 12px;
- color: $color-main;
- }
- vn-label-value {
- padding-bottom: 20px;
- }
- div.simulator{
- text-align: center;
+ .header {
+ background-color: $color-main;
+ color: $color-font-dark;
+
+ h5 {
+ color: inherit;
+ margin: 0 auto;
}
}
+ .simulatorTitle {
+ margin-bottom: 0px;
+ font-size: 12px;
+ color: $color-main;
+ }
+ vn-label-value {
+ padding-bottom: 20px;
+ }
+ .simulator{
+ text-align: center;
+ }
}
diff --git a/modules/client/front/billing-data/locale/es.yml b/modules/client/front/billing-data/locale/es.yml
index 15373914ec..a7ecbbdae8 100644
--- a/modules/client/front/billing-data/locale/es.yml
+++ b/modules/client/front/billing-data/locale/es.yml
@@ -15,5 +15,4 @@ Received B2B VNL: Recibido B2B VNL
Save: Guardar
New bank entity: Nueva entidad bancaria
Name can't be empty: El nombre no puede quedar vacío
-Swift / BIC can't be empty: El Swift / BIC no puede quedar vacío
Entity Code: Código
\ No newline at end of file