diff --git a/modules/client/back/methods/client/createAddress.js b/modules/client/back/methods/client/createAddress.js index 0319fc386..1a086b124 100644 --- a/modules/client/back/methods/client/createAddress.js +++ b/modules/client/back/methods/client/createAddress.js @@ -5,60 +5,60 @@ module.exports = function(Self) { description: 'Creates client address updating default address', accepts: [{ arg: 'id', - type: 'Number', + type: 'number', description: 'The client id', http: {source: 'path'} }, { arg: 'nickname', - type: 'String', + type: 'string', required: true }, { arg: 'city', - type: 'String', + type: 'string', required: true }, { arg: 'street', - type: 'String', + type: 'string', required: true }, { arg: 'phone', - type: 'String' + type: 'string' }, { arg: 'mobile', - type: 'String' + type: 'string' }, { arg: 'postalCode', - type: 'String' + type: 'string' }, { arg: 'provinceId', - type: 'Number' + type: 'number' }, { arg: 'agencyModeId', - type: 'Number' + type: 'number' }, { arg: 'incotermsId', - type: 'String' + type: 'string' }, { arg: 'customsAgentId', - type: 'Number' + type: 'number' }, { arg: 'isActive', - type: 'Boolean' + type: 'boolean' }, { arg: 'isDefaultAddress', - type: 'Boolean' + type: 'boolean' }], returns: { root: true, diff --git a/modules/client/back/methods/client/updateAddress.js b/modules/client/back/methods/client/updateAddress.js index b9270600f..aa0a7d178 100644 --- a/modules/client/back/methods/client/updateAddress.js +++ b/modules/client/back/methods/client/updateAddress.js @@ -10,55 +10,55 @@ module.exports = function(Self) { }, { arg: 'clientId', - type: 'Number', + type: ['number', 'null'], description: 'The client id', http: {source: 'path'} }, { arg: 'addressId', - type: 'Number', + type: ['number', 'null'], description: 'The address id', http: {source: 'path'} }, { arg: 'nickname', - type: 'String' + type: ['string'] }, { arg: 'city', - type: 'String' + type: ['string'] }, { arg: 'street', - type: 'String' + type: ['string'] }, { arg: 'phone', - type: 'String' + type: 'any' }, { arg: 'mobile', - type: 'String' + type: 'any' }, { arg: 'postalCode', - type: 'String' + type: 'any' }, { arg: 'provinceFk', - type: 'Number' + type: 'any' }, { arg: 'agencyModeFk', - type: 'Number' + type: 'any' }, { arg: 'incotermsFk', - type: 'String' + type: 'any' }, { arg: 'customsAgentFk', - type: 'Number' + type: 'any' }, { arg: 'isActive', diff --git a/modules/client/back/methods/client/updateFiscalData.js b/modules/client/back/methods/client/updateFiscalData.js index 4bc6fda9b..f16b0ef2b 100644 --- a/modules/client/back/methods/client/updateFiscalData.js +++ b/modules/client/back/methods/client/updateFiscalData.js @@ -17,75 +17,75 @@ module.exports = Self => { }, { arg: 'socialName', - type: 'String' + type: 'string' }, { arg: 'fi', - type: 'String' + type: 'string' }, { arg: 'street', - type: 'String' + type: 'string' }, { arg: 'postcode', - type: 'String' + type: 'string' }, { arg: 'city', - type: 'String' + type: 'string' }, { arg: 'countryFk', - type: 'Number' + type: 'number' }, { arg: 'provinceFk', - type: 'Number' + type: 'number' }, { arg: 'hasToInvoiceByAddress', - type: 'Boolean' + type: 'boolean' }, { arg: 'hasToInvoice', - type: 'Boolean' + type: 'boolean' }, { arg: 'isActive', - type: 'Boolean' + type: 'boolean' }, { arg: 'isFreezed', - type: 'Boolean' + type: 'boolean' }, { arg: 'isVies', - type: 'Boolean' + type: 'boolean' }, { arg: 'isToBeMailed', - type: 'Boolean' + type: 'boolean' }, { arg: 'isEqualizated', - type: 'Boolean' + type: 'boolean' }, { arg: 'isTaxDataVerified', - type: 'Boolean' + type: 'boolean' }, { arg: 'isTaxDataChecked', - type: 'Boolean' + type: 'boolean' }, { arg: 'despiteOfClient', - type: 'Number' + type: 'number' }], returns: { arg: 'res', - type: 'String', + type: 'string', root: true }, http: { diff --git a/modules/client/front/descriptor/index.js b/modules/client/front/descriptor/index.js index 3ef1e7616..95754b4df 100644 --- a/modules/client/front/descriptor/index.js +++ b/modules/client/front/descriptor/index.js @@ -55,10 +55,11 @@ class Controller extends Component { } showSMSDialog() { - const phone = this.$params.phone || this.client.phone; + const client = this.client; + const phone = this.$params.phone || client.mobile || client.phone; const message = this.$params.message || ''; this.newSMS = { - destinationFk: this.client.id, + destinationFk: client.id, destination: phone, message: message }; diff --git a/modules/ticket/front/card/index.js b/modules/ticket/front/card/index.js index 131968d65..3872259a9 100644 --- a/modules/ticket/front/card/index.js +++ b/modules/ticket/front/card/index.js @@ -27,7 +27,9 @@ class Controller extends ModuleCard { 'isFreezed', 'isTaxDataChecked', 'credit', - 'email' + 'email', + 'phone', + 'mobile' ], include: { relation: 'salesPerson', diff --git a/modules/ticket/front/descriptor/index.js b/modules/ticket/front/descriptor/index.js index 10da4cca9..d804a2eb2 100644 --- a/modules/ticket/front/descriptor/index.js +++ b/modules/ticket/front/descriptor/index.js @@ -241,7 +241,9 @@ class Controller extends Component { showSMSDialog() { const address = this.ticket.address; - const phone = this.$params.phone || address.mobile; + const client = this.ticket.client; + const phone = this.$params.phone || address.mobile || address.phone || + client.mobile || client.phone; const message = this.$params.message || this.$translate.instant('SMSPayment'); this.newSMS = { destinationFk: this.ticket.clientFk, diff --git a/modules/ticket/front/sale/index.js b/modules/ticket/front/sale/index.js index d0854c996..1ecb6fe41 100644 --- a/modules/ticket/front/sale/index.js +++ b/modules/ticket/front/sale/index.js @@ -431,6 +431,9 @@ class Controller { showSMSDialog() { const address = this.ticket.address; + const client = this.ticket.client; + const phone = address.mobile || address.phone || + client.mobile || client.phone; const sales = this.checkedLines(); const items = sales.map(sale => { return `${sale.quantity} ${sale.concept}`; @@ -443,7 +446,7 @@ class Controller { }; this.newSMS = { destinationFk: this.ticket.clientFk, - destination: address.mobile || null, + destination: phone, message: this.$translate.instant('SMSAvailability', params) }; this.$scope.sms.open();