diff --git a/README.md b/README.md
index b3cc9fdbe..06883779b 100644
--- a/README.md
+++ b/README.md
@@ -19,7 +19,7 @@ ext install dbaeumer.vscode-eslint
You will need to install globally the following items.
```
-# npm install -g karma-cli gulp-cli nodemon
+# npm install -g jest gulp-cli nodemon
```
## Linux Only Prerequisites
diff --git a/back/methods/message/send.js b/back/methods/message/send.js
index 5968964b1..f7b7ad76e 100644
--- a/back/methods/message/send.js
+++ b/back/methods/message/send.js
@@ -25,24 +25,24 @@ module.exports = Self => {
}
});
- Self.send = async(ctx, data, transaction) => {
+ Self.send = async(ctx, data, options) => {
const accessToken = ctx.options && ctx.options.accessToken || ctx.req && ctx.req.accessToken;
const userId = accessToken.userId;
const models = Self.app.models;
- const sender = await models.Account.findById(userId, transaction);
- const recipient = await models.Account.findById(data.recipientFk, transaction);
+ const sender = await models.Account.findById(userId, options);
+ const recipient = await models.Account.findById(data.recipientFk, options);
await Self.create({
sender: sender.name,
recipient: recipient.name,
message: data.message
- }, transaction);
+ }, options);
return await models.MessageInbox.create({
sender: sender.name,
recipient: recipient.name,
finalRecipient: recipient.name,
message: data.message
- }, transaction);
+ }, options);
};
};
diff --git a/db/dump/fixtures.sql b/db/dump/fixtures.sql
index e2d9c4f4b..c301d4a8d 100644
--- a/db/dump/fixtures.sql
+++ b/db/dump/fixtures.sql
@@ -576,7 +576,8 @@ INSERT INTO `vn`.`itemCategory`(`id`, `name`, `display`, `color`, `icon`)
(4, 'Handmade', 1, NULL, 'icon-handmade'),
(5, 'Artificial', 1, NULL, 'icon-artificial'),
(6, 'Green', 1, NULL, 'icon-greenery'),
- (7, 'Accessories', 1, NULL, 'icon-accessory');
+ (7, 'Accessories', 1, NULL, 'icon-accessory'),
+ (8, 'Fruit', 1, NULL, 'icon-fruit');
INSERT INTO `vn`.`itemType`(`id`, `code`, `name`, `categoryFk`, `life`,`workerFk`, `isPackaging`)
VALUES
diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js
index b0b048424..27eca90d4 100644
--- a/e2e/helpers/selectors.js
+++ b/e2e/helpers/selectors.js
@@ -33,8 +33,8 @@ export default {
taxNumber: `${components.vnTextfield}[name="fi"]`,
socialName: `${components.vnTextfield}[name="socialName"]`,
street: `${components.vnTextfield}[name="street"]`,
- postcode: `vn-autocomplete[field="$ctrl.client.postcode"]`,
- city: `vn-autocomplete[field="$ctrl.client.city"]`,
+ postcode: `${components.vnTextfield}[name="postcode"]`,
+ city: `${components.vnTextfield}[name="city"]`,
province: `vn-autocomplete[field="$ctrl.client.provinceFk"]`,
country: `vn-autocomplete[field="$ctrl.client.countryFk"]`,
userName: `${components.vnTextfield}[name="userName"]`,
@@ -65,8 +65,8 @@ export default {
equalizationTaxCheckbox: 'vn-check[label="Is equalizated"] md-checkbox',
acceptPropagationButton: 'vn-client-fiscal-data > vn-confirm button[response=ACCEPT]',
addressInput: `${components.vnTextfield}[name="street"]`,
- postcodeAutocomplete: `vn-autocomplete[field="$ctrl.client.postcode"]`,
- cityAutocomplete: `vn-autocomplete[field="$ctrl.client.city"]`,
+ postcodeInput: `${components.vnTextfield}[name="postcode"]`,
+ cityInput: `${components.vnTextfield}[name="city"]`,
provinceAutocomplete: 'vn-autocomplete[field="$ctrl.client.provinceFk"]',
countryAutocomplete: 'vn-autocomplete[field="$ctrl.client.countryFk"]',
activeCheckbox: 'vn-check[label="Active"] md-checkbox',
@@ -100,8 +100,8 @@ export default {
defaultCheckboxInput: 'vn-check[label="Default"] md-checkbox',
consigneeInput: `${components.vnTextfield}[name="nickname"]`,
streetAddressInput: `${components.vnTextfield}[name="street"]`,
- postcodeAutocomplete: `vn-autocomplete[field="$ctrl.address.postalCode"]`,
- cityAutocomplete: `vn-autocomplete[field="$ctrl.address.city"]`,
+ postcodeInput: `${components.vnTextfield}[name="postalCode"]`,
+ cityInput: `${components.vnTextfield}[name="city"]`,
provinceAutocomplete: 'vn-autocomplete[field="$ctrl.address.provinceFk"]',
agencyAutocomplete: 'vn-autocomplete[field="$ctrl.address.agencyModeFk"]',
phoneInput: `${components.vnTextfield}[name="phone"]`,
diff --git a/e2e/paths/02-client-module/01_create_client.spec.js b/e2e/paths/02-client-module/01_create_client.spec.js
index b9ea5e112..b67a89e68 100644
--- a/e2e/paths/02-client-module/01_create_client.spec.js
+++ b/e2e/paths/02-client-module/01_create_client.spec.js
@@ -53,7 +53,10 @@ describe('Client create path', () => {
.write(selectors.createClientView.name, 'Carol Danvers')
.write(selectors.createClientView.socialName, 'AVG tax')
.write(selectors.createClientView.street, 'Many places')
- .autocompleteSearch(selectors.createClientView.postcode, '46000')
+ .autocompleteSearch(selectors.createClientView.country, 'España')
+ .autocompleteSearch(selectors.createClientView.province, 'Province one')
+ .write(selectors.createClientView.city, 'Valencia')
+ .write(selectors.createClientView.postcode, '46000')
.clearInput(selectors.createClientView.email)
.write(selectors.createClientView.email, 'incorrect email format')
.waitToClick(selectors.createClientView.createButton)
@@ -64,7 +67,7 @@ describe('Client create path', () => {
it(`should check for autocompleted city, province and country`, async() => {
const clientCity = await nightmare
- .waitToGetProperty(`${selectors.createClientView.city} input`, 'value');
+ .waitToGetProperty(`${selectors.createClientView.city}`, 'value');
const clientProvince = await nightmare
.waitToGetProperty(`${selectors.createClientView.province} input`, 'value');
diff --git a/e2e/paths/02-client-module/03_edit_fiscal_data.spec.js b/e2e/paths/02-client-module/03_edit_fiscal_data.spec.js
index 4d8d160eb..0039a2515 100644
--- a/e2e/paths/02-client-module/03_edit_fiscal_data.spec.js
+++ b/e2e/paths/02-client-module/03_edit_fiscal_data.spec.js
@@ -67,8 +67,12 @@ describe('Client Edit fiscalData path', () => {
.write(selectors.clientFiscalData.fiscalIdInput, 'INVALID!')
.clearInput(selectors.clientFiscalData.addressInput)
.write(selectors.clientFiscalData.addressInput, 'Somewhere edited')
- .autocompleteSearch(selectors.clientFiscalData.cityAutocomplete, 'Valencia')
- .autocompleteSearch(selectors.clientFiscalData.postcodeAutocomplete, '46000')
+ .autocompleteSearch(selectors.clientFiscalData.countryAutocomplete, 'España')
+ .autocompleteSearch(selectors.clientFiscalData.provinceAutocomplete, 'Province one')
+ .clearInput(selectors.clientFiscalData.cityInput)
+ .write(selectors.clientFiscalData.cityInput, 'Valencia')
+ .clearInput(selectors.clientFiscalData.postcodeInput)
+ .write(selectors.clientFiscalData.postcodeInput, '46000')
.waitToClick(selectors.clientFiscalData.activeCheckbox)
.waitToClick(selectors.clientFiscalData.frozenCheckbox)
.waitToClick(selectors.clientFiscalData.hasToInvoiceCheckbox)
@@ -194,14 +198,14 @@ describe('Client Edit fiscalData path', () => {
it('should confirm the postcode have been edited', async() => {
const result = await nightmare
- .waitToGetProperty(`${selectors.clientFiscalData.postcodeAutocomplete} input`, 'value');
+ .waitToGetProperty(`${selectors.clientFiscalData.postcodeInput}`, 'value');
expect(result).toContain('46000');
});
it('should confirm the city have been autocompleted', async() => {
const result = await nightmare
- .waitToGetProperty(`${selectors.clientFiscalData.cityAutocomplete} input`, 'value');
+ .waitToGetProperty(`${selectors.clientFiscalData.cityInput}`, 'value');
expect(result).toEqual('Valencia');
});
diff --git a/e2e/paths/02-client-module/05_add_address.spec.js b/e2e/paths/02-client-module/05_add_address.spec.js
index 08227fc0f..f4e68634a 100644
--- a/e2e/paths/02-client-module/05_add_address.spec.js
+++ b/e2e/paths/02-client-module/05_add_address.spec.js
@@ -24,7 +24,11 @@ describe('Client Add address path', () => {
const result = await nightmare
.waitToClick(selectors.clientAddresses.defaultCheckboxInput)
.clearInput(selectors.clientAddresses.streetAddressInput)
- .autocompleteSearch(selectors.clientAddresses.postcodeAutocomplete, '46000')
+ .autocompleteSearch(selectors.clientAddresses.provinceAutocomplete, 'Province one')
+ .clearInput(selectors.clientAddresses.cityInput)
+ .write(selectors.clientAddresses.cityInput, 'Valencia')
+ .clearInput(selectors.clientAddresses.postcodeInput)
+ .write(selectors.clientAddresses.postcodeInput, '46000')
.autocompleteSearch(selectors.clientAddresses.agencyAutocomplete, 'Entanglement')
.write(selectors.clientAddresses.phoneInput, '999887744')
.write(selectors.clientAddresses.mobileInput, '999887744')
@@ -36,14 +40,14 @@ describe('Client Add address path', () => {
it('should confirm the postcode have been edited', async() => {
const result = await nightmare
- .waitToGetProperty(`${selectors.clientAddresses.postcodeAutocomplete} input`, 'value');
+ .waitToGetProperty(`${selectors.clientAddresses.postcodeInput}`, 'value');
expect(result).toContain('46000');
});
it('should confirm the city have been autocompleted', async() => {
const result = await nightmare
- .waitToGetProperty(`${selectors.clientAddresses.cityAutocomplete} input`, 'value');
+ .waitToGetProperty(`${selectors.clientAddresses.cityInput}`, 'value');
expect(result).toEqual('Valencia');
});
diff --git a/front/core/styles/salixfont.css b/front/core/styles/salixfont.css
index 5bea56e13..267e3ba01 100644
--- a/front/core/styles/salixfont.css
+++ b/front/core/styles/salixfont.css
@@ -23,263 +23,8 @@
-moz-osx-font-smoothing: grayscale;
}
-.icon-basketadd:before {
- content: "\e955";
-}
-.icon-catalog:before {
- content: "\e952";
-}
-.icon-agency:before {
- content: "\e910";
-}
-.icon-delivery:before {
- content: "\e94a";
-}
-.icon-wand:before {
- content: "\e954";
-}
-.icon-unavailable:before {
- content: "\e953";
-}
-.icon-buscaman:before {
- content: "\e951";
-}
-.icon-pbx:before {
- content: "\e950";
-}
-.icon-calendar:before {
- content: "\e94f";
-}
-.icon-linesplit:before {
- content: "\e945";
-}
-.icon-invoices:before {
- content: "\e91c";
-}
-.icon-pets:before {
- content: "\e94e";
-}
-.icon-100:before {
- content: "\e940";
-}
-.icon-accessory:before {
- content: "\e90a";
-}
-.icon-actions:before {
- content: "\e900";
-}
-.icon-addperson:before {
- content: "\e901";
-}
-.icon-albaran:before {
- content: "\e902";
-}
-.icon-apps:before {
- content: "\e948";
-}
-.icon-artificial:before {
- content: "\e903";
-}
-.icon-barcode:before {
- content: "\e904";
-}
-.icon-basket:before {
- content: "\e942";
-}
-.icon-bin:before {
- content: "\e905";
-}
-.icon-botanical:before {
- content: "\e906";
-}
-.icon-bucket:before {
- content: "\e907";
-}
-.icon-claims:before {
- content: "\e908";
-}
-.icon-clone:before {
- content: "\e909";
-}
-.icon-columnadd:before {
- content: "\e944";
-}
-.icon-columndelete:before {
- content: "\e90f";
-}
-.icon-components:before {
- content: "\e90b";
-}
-.icon-consignatarios:before {
- content: "\e90d";
-}
-.icon-control:before {
- content: "\e93f";
-}
-.icon-credit:before {
- content: "\e90e";
-}
-.icon-details:before {
- content: "\e911";
-}
-.icon-disabled:before {
- content: "\e91b";
-}
-.icon-doc:before {
- content: "\e913";
-}
-.icon-entry:before {
- content: "\e914";
-}
-.icon-exit:before {
- content: "\e947";
-}
-.icon-eye:before {
- content: "\e915";
-}
-.icon-fiscal:before {
- content: "\e912";
-}
-.icon-flower:before {
- content: "\e916";
-}
-.icon-frozen:before {
- content: "\e917";
-}
-.icon-greenery:before {
- content: "\e93c";
-}
-.icon-greuge:before {
- content: "\e918";
-}
-.icon-grid:before {
- content: "\e919";
-}
-.icon-handmade:before {
- content: "\e90c";
-}
-.icon-history:before {
- content: "\e91a";
-}
-.icon-info:before {
- content: "\e949";
-}
-.icon-item:before {
- content: "\e941";
-}
-.icon-languaje:before {
- content: "\e91d";
-}
-.icon-linedelete:before {
- content: "\e946";
-}
-.icon-lines:before {
- content: "\e91e";
-}
-.icon-linesprepaired:before {
- content: "\e94b";
-}
-.icon-logout:before {
- content: "\e91f";
-}
-.icon-mana:before {
- content: "\e920";
-}
-.icon-mandatory:before {
- content: "\e921";
-}
-.icon-niche:before {
- content: "\e922";
-}
-.icon-no036:before {
- content: "\e923";
-}
-.icon-notes:before {
- content: "\e924";
-}
-.icon-noweb:before {
- content: "\e925";
-}
-.icon-onlinepayment:before {
- content: "\e926";
-}
-.icon-package:before {
- content: "\e927";
-}
-.icon-payment:before {
- content: "\e928";
-}
-.icon-person:before {
- content: "\e929";
-}
-.icon-photo:before {
- content: "\e92a";
-}
-.icon-plant:before {
- content: "\e92b";
-}
-.icon-recovery:before {
- content: "\e92d";
-}
-.icon-regentry:before {
- content: "\e92e";
-}
-.icon-reserve:before {
- content: "\e92f";
-}
-.icon-revision:before {
- content: "\e94c";
-}
-.icon-risk:before {
- content: "\e930";
-}
-.icon-services:before {
- content: "\e94d";
-}
-.icon-settings:before {
- content: "\e931";
-}
-.icon-sms:before {
- content: "\e932";
-}
-.icon-solclaim:before {
- content: "\e933";
-}
-.icon-solunion:before {
- content: "\e934";
-}
-.icon-splur:before {
- content: "\e935";
-}
-.icon-stowaway:before {
- content: "\e92c";
-}
-.icon-supplier:before {
- content: "\e936";
-}
-.icon-tags:before {
- content: "\e937";
-}
-.icon-tax:before {
- content: "\e938";
-}
-.icon-ticket:before {
- content: "\e939";
-}
-.icon-traceability:before {
- content: "\e93a";
-}
-.icon-transaction:before {
- content: "\e93b";
-}
-.icon-volume:before {
- content: "\e93d";
-}
-.icon-web:before {
- content: "\e93e";
-}
-.icon-worker:before {
- content: "\e943";
+.icon-fruit:before {
+ content: "\e957";
}
.icon-deliveryprices:before {
content: "\e956";
diff --git a/front/core/styles/salixfont.svg b/front/core/styles/salixfont.svg
index 04dd47f6f..d3837cc76 100644
--- a/front/core/styles/salixfont.svg
+++ b/front/core/styles/salixfont.svg
@@ -94,4 +94,5 @@
+
\ No newline at end of file
diff --git a/front/core/styles/salixfont.ttf b/front/core/styles/salixfont.ttf
index b11c6f64c..5def0c5b8 100644
Binary files a/front/core/styles/salixfont.ttf and b/front/core/styles/salixfont.ttf differ
diff --git a/front/core/styles/salixfont.woff b/front/core/styles/salixfont.woff
index f88e6bfbf..3884346c1 100644
Binary files a/front/core/styles/salixfont.woff and b/front/core/styles/salixfont.woff differ
diff --git a/front/nginx.conf b/front/nginx.conf
index cf429b153..bbba60ab2 100644
--- a/front/nginx.conf
+++ b/front/nginx.conf
@@ -16,7 +16,7 @@ server {
listen [::]:80 default_server;
server_name _;
autoindex off;
- client_max_body_size 50M;
+ client_max_body_size 250M;
root /salix/dist;
error_page 404 = @notfound;
diff --git a/loopback/locale/en.json b/loopback/locale/en.json
index cfcb5bbdb..4c29d0a70 100644
--- a/loopback/locale/en.json
+++ b/loopback/locale/en.json
@@ -53,5 +53,7 @@
"Ticket id cannot be blank": "Ticket id cannot be blank",
"Weekday cannot be blank": "Weekday cannot be blank",
"This ticket can not be modified": "This ticket can not be modified",
- "You can't delete a confirmed order": "You can't delete a confirmed order"
+ "You can't delete a confirmed order": "You can't delete a confirmed order",
+ "Value has an invalid format": "Value has an invalid format",
+ "The postcode doesn't exists. Ensure you put the correct format": "The postcode doesn't exists. Ensure you put the correct format"
}
\ No newline at end of file
diff --git a/loopback/locale/es.json b/loopback/locale/es.json
index dfa637260..b6c70be3a 100644
--- a/loopback/locale/es.json
+++ b/loopback/locale/es.json
@@ -101,5 +101,11 @@
"This ticket is already on weekly tickets": "Este ticket ya está en tickets programados",
"Ticket id cannot be blank": "El id de ticket no puede quedar en blanco",
"Weekday cannot be blank": "El día de la semana no puede quedar en blanco",
- "You can't delete a confirmed order": "No puedes borrar un pedido confirmado"
+ "You can't delete a confirmed order": "No puedes borrar un pedido confirmado",
+ "Can't create stowaway for this ticket": "No se puede crear un polizon para este ticket",
+ "The socialName has an invalid format": "El nombre fiscal tiene un formato incorrecto",
+ "Invalid quantity": "Cantidad invalida",
+ "This postal code is not valid": "This postal code is not valid",
+ "is invalid": "is invalid",
+ "The postcode doesn't exists. Ensure you put the correct format": "El código postal no existe. Asegúrate de ponerlo con el formato correcto"
}
\ No newline at end of file
diff --git a/loopback/server/datasources.json b/loopback/server/datasources.json
index 8b016e324..4c9e407a0 100644
--- a/loopback/server/datasources.json
+++ b/loopback/server/datasources.json
@@ -20,7 +20,7 @@
"connector": "loopback-component-storage",
"provider": "filesystem",
"root": "./e2e/dms",
- "maxFileSize": "52428800",
+ "maxFileSize": "262144000",
"allowedContentTypes": [
"application/x-7z-compressed",
"application/x-zip-compressed",
diff --git a/modules/claim/back/methods/claim/regularizeClaim.js b/modules/claim/back/methods/claim/regularizeClaim.js
index 5c54a7a2f..a2896174e 100644
--- a/modules/claim/back/methods/claim/regularizeClaim.js
+++ b/modules/claim/back/methods/claim/regularizeClaim.js
@@ -22,18 +22,18 @@ module.exports = Self => {
const models = Self.app.models;
const resolvedState = 3;
- const claimEnds = await models.ClaimEnd.find({
- include: {
- relation: 'claimDestination',
- fields: ['addressFk']
- },
- where: {claimFk: params.claimFk}
- });
-
let tx = await Self.beginTransaction({});
try {
let options = {transaction: tx};
+ const claimEnds = await models.ClaimEnd.find({
+ include: {
+ relation: 'claimDestination',
+ fields: ['addressFk']
+ },
+ where: {claimFk: params.claimFk}
+ }, options);
+
for (let i = 0; i < claimEnds.length; i++) {
const claimEnd = claimEnds[i];
const destination = claimEnd.claimDestination();
@@ -42,7 +42,7 @@ module.exports = Self => {
if (!addressFk)
continue;
- let sale = await getSale(claimEnd.saleFk);
+ let sale = await getSale(claimEnd.saleFk, options);
let ticketFk = await getTicketId({
addressFk: addressFk,
companyFk: sale.ticket().companyFk,
@@ -51,7 +51,7 @@ module.exports = Self => {
let address = await models.Address.findOne({
where: {id: addressFk}
- });
+ }, options);
if (!ticketFk) {
ticketFk = await createTicket(ctx, {
@@ -84,7 +84,7 @@ module.exports = Self => {
}
}
- let claim = await Self.findById(params.claimFk);
+ let claim = await Self.findById(params.claimFk, null, options);
claim = await claim.updateAttributes({
claimStateFk: resolvedState
}, options);
@@ -98,7 +98,7 @@ module.exports = Self => {
}
};
- async function getSale(saleFk) {
+ async function getSale(saleFk, options) {
return await Self.app.models.Sale.findOne({
include: [
{
@@ -116,7 +116,7 @@ module.exports = Self => {
}
}],
where: {id: saleFk}
- });
+ }, options);
}
async function getTicketId(params, options) {
diff --git a/modules/client/back/methods/client/lastActiveTickets.js b/modules/client/back/methods/client/lastActiveTickets.js
index 4dc1e2c56..81d4c04ea 100644
--- a/modules/client/back/methods/client/lastActiveTickets.js
+++ b/modules/client/back/methods/client/lastActiveTickets.js
@@ -30,10 +30,11 @@ module.exports = Self => {
JOIN vn.ticketState ts ON t.id = ts.ticketFk
JOIN vn.agencyMode a ON t.agencyModeFk = a.id
JOIN vn.warehouse w ON t.warehouseFk = w.id
- WHERE t.shipped >= CURDATE() AND t.clientFk = ? AND ts.alertLevel = 0 AND t.id <> ?
+ WHERE t.shipped >= CURDATE() AND t.clientFk = ?
+ AND ts.alertLevel = 0 AND t.id <> ?
ORDER BY t.shipped
- LIMIT 3`;
-
- return Self.rawSql(query, [id, ticketId]);
+ LIMIT 5`;
+ let tickets = await Self.rawSql(query, [params.clientFk, params.ticketFk]);
+ return tickets;
};
};
diff --git a/modules/client/back/models/address.js b/modules/client/back/models/address.js
index d0cfd0900..afdacdee5 100644
--- a/modules/client/back/models/address.js
+++ b/modules/client/back/models/address.js
@@ -42,6 +42,21 @@ module.exports = Self => {
next();
});
+ Self.validateAsync('postalCode', hasValidPostcode, {
+ message: `The postcode doesn't exists. Ensure you put the correct format`
+ });
+
+ async function hasValidPostcode(err, done) {
+ if (!this.postalCode)
+ return done();
+
+ const models = Self.app.models;
+ const postcode = await models.Postcode.findById(this.postalCode);
+
+ if (!postcode) err();
+ done();
+ }
+
// Helpers
Self.observe('before save', async function(ctx) {
diff --git a/modules/client/back/models/client.js b/modules/client/back/models/client.js
index 25b9d7d35..cdff58f34 100644
--- a/modules/client/back/models/client.js
+++ b/modules/client/back/models/client.js
@@ -108,6 +108,8 @@ module.exports = Self => {
});
function cannotHaveET(err) {
+ if (!this.fi) return;
+
let tin = this.fi.toUpperCase();
let cannotHaveET = /^[A-B]/.test(tin);
@@ -150,6 +152,31 @@ module.exports = Self => {
done();
}
+ Self.validateBinded('socialName', isAlpha, {
+ message: 'The socialName has an invalid format'
+ });
+
+ function isAlpha(value) {
+ const regexp = new RegExp(/^[a-zA-Z\s]*$/);
+
+ return regexp.test(value);
+ }
+
+ Self.validateAsync('postCode', hasValidPostcode, {
+ message: `The postcode doesn't exists. Ensure you put the correct format`
+ });
+
+ async function hasValidPostcode(err, done) {
+ if (!this.postcode)
+ return done();
+
+ const models = Self.app.models;
+ const postcode = await models.Postcode.findById(this.postcode);
+
+ if (!postcode) err();
+ done();
+ }
+
Self.observe('before save', async function(ctx) {
let changes = ctx.data || ctx.instance;
let orgData = ctx.currentInstance;
@@ -199,9 +226,9 @@ module.exports = Self => {
if (payMethodChanged || ibanChanged || dueDayChanged) {
const message = `La forma de pago del cliente con id ${instance.id} ha cambiado`;
const salesPersonFk = instance.salesPersonFk;
- const salesPerson = await Self.app.models.Worker.findById(salesPersonFk);
- if (salesPerson) {
+ if (salesPersonFk) {
+ const salesPerson = await Self.app.models.Worker.findById(salesPersonFk);
await Self.app.models.Message.send(ctx, {
recipientFk: salesPerson.userFk,
message: message
diff --git a/modules/client/front/address/create/index.html b/modules/client/front/address/create/index.html
index 432d4ebbe..0240aceb5 100644
--- a/modules/client/front/address/create/index.html
+++ b/modules/client/front/address/create/index.html
@@ -31,7 +31,11 @@
value-field="id"
label="Province">
-
+
+
+
+
+
-
+
+
+
+
+
diff --git a/modules/client/front/create/index.html b/modules/client/front/create/index.html
index 4c54e0756..0c2e0290e 100644
--- a/modules/client/front/create/index.html
+++ b/modules/client/front/create/index.html
@@ -50,7 +50,11 @@
-
+
+
+
+
+
+
-
+
+
+
+
{
+ if (res.data)
+ this.ticket.zoneFk = res.data.id;
+
+ if (!res.data) {
+ this.vnApp.showMessage(
+ this.$translate.instant('No delivery zone available for this parameters')
+ );
+ }
+ });
+ }
+
async onStepChange() {
if (this.isFormInvalid()) {
return this.vnApp.showError(