Please, ensure you put the correct data!
diff --git a/modules/client/front/postcode/index.js b/modules/client/front/postcode/index.js index bbf0b1953c..836ea9a81e 100644 --- a/modules/client/front/postcode/index.js +++ b/modules/client/front/postcode/index.js @@ -35,25 +35,20 @@ class Controller extends Component { this.$.postcode.focus(); } - onResponse(response) { - if (response == 'accept') { - try { - if (!this.data.code) - throw new Error(`The postcode can't be empty`); - if (!this.data.townFk) - throw new Error(`The town can't be empty`); + onAccept() { + try { + if (!this.data.code) + throw new Error(`The postcode can't be empty`); + if (!this.data.townFk) + throw new Error(`The town can't be empty`); - this.$http.patch(`postcodes`, this.data).then(response => { - if (response.data) { - this.vnApp.showMessage(this.$translate.instant('The postcode has been saved')); - - this.emit('response', {response: response.data}); - } - }); - } catch (e) { - this.vnApp.showError(this.$translate.instant(e.message)); - return false; - } + this.$http.patch(`postcodes`, this.data).then(res => { + this.vnApp.showMessage(this.$translate.instant('The postcode has been saved')); + this.emit('response', {$response: res.data}); + }); + } catch (e) { + this.vnApp.showError(this.$translate.instant(e.message)); + return false; } return true; } diff --git a/modules/client/front/postcode/index.spec.js b/modules/client/front/postcode/index.spec.js index 04f1a8924d..a5e5db9d56 100644 --- a/modules/client/front/postcode/index.spec.js +++ b/modules/client/front/postcode/index.spec.js @@ -15,7 +15,7 @@ describe('Client', () => { controller.client = {id: 101}; })); - describe('onResponse()', () => { + describe('onAccept()', () => { it('should perform a POST query and show a success snackbar', () => { let params = {townFk: 1, provinceFk: 1, countryFk: 1, code: '46460'}; controller.data = {townFk: 1, provinceFk: 1, countryFk: 1, code: '46460'}; @@ -24,7 +24,7 @@ describe('Client', () => { $httpBackend.when('PATCH', `postcodes`, params).respond(200, params); $httpBackend.expect('PATCH', `postcodes`, params).respond(params); - controller.onResponse('accept'); + controller.onAccept(); $httpBackend.flush(); expect(controller.vnApp.showMessage).toHaveBeenCalledWith('The postcode has been saved'); diff --git a/modules/client/front/search-panel/index.html b/modules/client/front/search-panel/index.html index 579f044c14..7577676716 100644 --- a/modules/client/front/search-panel/index.html +++ b/modules/client/front/search-panel/index.html @@ -9,18 +9,6 @@ vn-focus>{{$t('type')}} | -{{$t('taxBase')}} | +{{$t('type')}} | ++ {{$t('taxBase')}} + | {{$t('tax')}} | {{$t('fee')}} | ||||
{{tax.name}} | -{{tax.Base | currency('EUR', locale)}} | +{{tax.name}} | ++ {{tax.Base | currency('EUR', locale)}} + | {{tax.vatPercent | percentage}} | {{tax.tax | currency('EUR', locale)}} | ||||
{{$t('subtotal')}} | -{{getTotalBase() | currency('EUR', locale)}} | +{{$t('subtotal')}} | ++ {{getTotalBase() | currency('EUR', locale)}} + | {{getTotalTax()| currency('EUR', locale)}} |
{{$t('order')}} | {{$t('ticket')}} | -{{$t('client')}} | +{{$t('client')}} | {{$t('address')}} | {{$t('packages')}} |
{{ticket.priority}} | {{ticket.id}} | -{{ticket.clientFk}} {{ticket.addressName}} | +{{ticket.clientFk}} {{ticket.addressName}} | {{ticket.addressFk.toString().substr(0, ticket.addressFk.toString().length - 3)}} @@ -141,7 +141,7 @@ | |
{{$t('import')}} | -{{ticket.import}} | +{{ticket.import | currency('EUR', locale)}} |
---|