diff --git a/back/methods/dms/uploadFile.js b/back/methods/dms/uploadFile.js
index 220f944d8..e137ca8ff 100644
--- a/back/methods/dms/uploadFile.js
+++ b/back/methods/dms/uploadFile.js
@@ -69,12 +69,22 @@ module.exports = Self => {
if (!hasWriteRole)
throw new UserError(`You don't have enough privileges`);
+ // Create final folder if not exists
+ const dmsType = await models.DmsType.findById(args.dmsTypeId);
+ await models.Container.getContainer(dmsType.path).catch(async err => {
+ if (err.code === 'ENOENT') {
+ await models.Container.createContainer({
+ name: dmsType.path
+ });
+ }
+ });
+
+ // Upload file to temporary path
const uploaded = await models.Container.upload('temp', ctx.req, ctx.result, fileOptions);
const files = Object.values(uploaded.files).map(file => {
return file[0];
});
- const dmsType = await models.DmsType.findById(args.dmsTypeId);
const promises = [];
files.forEach(file => {
diff --git a/db/changes/10050-pentecostes/00-dmsType.sql b/db/changes/10050-pentecostes/00-dmsType.sql
deleted file mode 100644
index 1692c6f50..000000000
--- a/db/changes/10050-pentecostes/00-dmsType.sql
+++ /dev/null
@@ -1,4 +0,0 @@
-UPDATE `vn2008`.`gesttip` SET `writeRoleFk`='1', `readRoleFk`='1' WHERE `id`='5';
-UPDATE `vn2008`.`gesttip` SET `writeRoleFk`='1', `readRoleFk`='1' WHERE `id`='12';
-UPDATE `vn2008`.`gesttip` SET `writeRoleFk`='1', `readRoleFk`='1' WHERE `id`='14';
-UPDATE `vn2008`.`gesttip` SET `writeRoleFk`='1', `readRoleFk`='1' WHERE `id`='13';
diff --git a/db/changes/10050-pentecostes/02-dmsType.sql b/db/changes/10050-pentecostes/02-dmsType.sql
new file mode 100644
index 000000000..24d88903f
--- /dev/null
+++ b/db/changes/10050-pentecostes/02-dmsType.sql
@@ -0,0 +1,24 @@
+UPDATE `vn2008`.`gesttip` SET `writeRoleFk`='1', `readRoleFk`='1' WHERE `id`='5';
+UPDATE `vn2008`.`gesttip` SET `writeRoleFk`='1', `readRoleFk`='1' WHERE `id`='12';
+UPDATE `vn2008`.`gesttip` SET `writeRoleFk`='1', `readRoleFk`='1' WHERE `id`='14';
+UPDATE `vn2008`.`gesttip` SET `writeRoleFk`='1', `readRoleFk`='1' WHERE `id`='13';
+UPDATE `vn2008`.`gesttip` SET `code`='invoiceIn' WHERE `id`='1';
+UPDATE `vn2008`.`gesttip` SET `code`='officialDoc' WHERE `id`='2';
+UPDATE `vn2008`.`gesttip` SET `code`='hhrrData' WHERE `id`='3';
+UPDATE `vn2008`.`gesttip` SET `code`='deliveryNote' WHERE `id`='4';
+UPDATE `vn2008`.`gesttip` SET `code`='miscellaneous' WHERE `id`='5';
+UPDATE `vn2008`.`gesttip` SET `code`='tests' WHERE `id`='6';
+UPDATE `vn2008`.`gesttip` SET `code`='economicActivitiesTax' WHERE `id`='7';
+UPDATE `vn2008`.`gesttip` SET `code`='fiscal' WHERE `id`='8';
+UPDATE `vn2008`.`gesttip` SET `code`='vehicles' WHERE `id`='9';
+UPDATE `vn2008`.`gesttip` SET `code`='templates' WHERE `id`='10';
+UPDATE `vn2008`.`gesttip` SET `code`='contracts' WHERE `id`='11';
+UPDATE `vn2008`.`gesttip` SET `code`='paymentsLaw' WHERE `id`='12';
+UPDATE `vn2008`.`gesttip` SET `code`='trash' WHERE `id`='13';
+UPDATE `vn2008`.`gesttip` SET `code`='ticket' WHERE `id`='14';
+UPDATE `vn2008`.`gesttip` SET `code`='budgets' WHERE `id`='15';
+UPDATE `vn2008`.`gesttip` SET `code`='logistics' WHERE `id`='16';
+UPDATE `vn2008`.`gesttip` SET `code`='cmr' WHERE `id`='17';
+UPDATE `vn2008`.`gesttip` SET `code`='dua' WHERE `id`='18';
+UPDATE `vn2008`.`gesttip` SET `code`='fixedAssets' WHERE `id`='19';
+
diff --git a/db/dump/fixtures.sql b/db/dump/fixtures.sql
index fe9d40669..fc125872a 100644
--- a/db/dump/fixtures.sql
+++ b/db/dump/fixtures.sql
@@ -332,9 +332,9 @@ INSERT INTO `vn`.`observationType`(`id`,`description`)
INSERT INTO `vn`.`addressObservation`(`id`,`addressFk`,`observationTypeFk`,`description`)
VALUES
- (1, 1, 1, 'under the floor'),
- (2, 1, 2, 'wears leather and goes out at night'),
- (3, 1, 3, 'care with the dog');
+ (1, 121, 1, 'under the floor'),
+ (2, 121, 2, 'wears leather and goes out at night'),
+ (3, 121, 3, 'care with the dog');
INSERT INTO `vn`.`creditClassification`(`id`, `client`, `dateStart`, `dateEnd`)
VALUES
diff --git a/db/tests/cache/last_buy_refresh.spec.js b/db/tests/cache/last_buy_refresh.spec.js
index e6203a00a..485c725bb 100644
--- a/db/tests/cache/last_buy_refresh.spec.js
+++ b/db/tests/cache/last_buy_refresh.spec.js
@@ -20,21 +20,27 @@ describe('last_buy_refresh()', () => {
let lastBuyTable = result[lastBuyTableIndex];
- expect(lastBuyTable.length).toEqual(4);
+ expect(lastBuyTable.length).toEqual(6);
expect(lastBuyTable[0].item_id).toEqual(1);
expect(lastBuyTable[1].item_id).toEqual(2);
expect(lastBuyTable[2].item_id).toEqual(3);
expect(lastBuyTable[3].item_id).toEqual(4);
+ expect(lastBuyTable[4].item_id).toEqual(8);
+ expect(lastBuyTable[5].item_id).toEqual(9);
expect(lastBuyTable[0].warehouse_id).toEqual(1);
expect(lastBuyTable[1].warehouse_id).toEqual(1);
expect(lastBuyTable[2].warehouse_id).toEqual(1);
expect(lastBuyTable[3].warehouse_id).toEqual(1);
+ expect(lastBuyTable[4].warehouse_id).toEqual(1);
+ expect(lastBuyTable[5].warehouse_id).toEqual(1);
expect(lastBuyTable[1].buy_id).toEqual(4);
expect(lastBuyTable[0].buy_id).toEqual(3);
expect(lastBuyTable[2].buy_id).toEqual(5);
- expect(lastBuyTable[3].buy_id).toEqual(6);
+ expect(lastBuyTable[3].buy_id).toEqual(8);
+ expect(lastBuyTable[4].buy_id).toEqual(6);
+ expect(lastBuyTable[5].buy_id).toEqual(7);
});
});
diff --git a/db/tests/vn/buyUltimate.spec.js b/db/tests/vn/buyUltimate.spec.js
index 4ff6c4708..8a5e6a3df 100644
--- a/db/tests/vn/buyUltimate.spec.js
+++ b/db/tests/vn/buyUltimate.spec.js
@@ -29,21 +29,27 @@ describe('buyUltimate()', () => {
let buyUltimateTable = result[buyUltimateTableIndex];
- expect(buyUltimateTable.length).toEqual(4);
+ expect(buyUltimateTable.length).toEqual(6);
expect(buyUltimateTable[0].itemFk).toEqual(1);
expect(buyUltimateTable[1].itemFk).toEqual(2);
expect(buyUltimateTable[2].itemFk).toEqual(3);
expect(buyUltimateTable[3].itemFk).toEqual(4);
+ expect(buyUltimateTable[4].itemFk).toEqual(8);
+ expect(buyUltimateTable[5].itemFk).toEqual(9);
expect(buyUltimateTable[0].warehouseFk).toEqual(1);
expect(buyUltimateTable[1].warehouseFk).toEqual(1);
expect(buyUltimateTable[2].warehouseFk).toEqual(1);
expect(buyUltimateTable[3].warehouseFk).toEqual(1);
+ expect(buyUltimateTable[4].warehouseFk).toEqual(1);
+ expect(buyUltimateTable[5].warehouseFk).toEqual(1);
expect(buyUltimateTable[1].buyFk).toEqual(4);
expect(buyUltimateTable[0].buyFk).toEqual(3);
expect(buyUltimateTable[2].buyFk).toEqual(5);
- expect(buyUltimateTable[3].buyFk).toEqual(6);
+ expect(buyUltimateTable[3].buyFk).toEqual(8);
+ expect(buyUltimateTable[4].buyFk).toEqual(6);
+ expect(buyUltimateTable[5].buyFk).toEqual(7);
});
});
diff --git a/db/tests/vn/ticketCalculateClon.spec.js b/db/tests/vn/ticketCalculateClon.spec.js
index 0b3969f1f..4015d57db 100644
--- a/db/tests/vn/ticketCalculateClon.spec.js
+++ b/db/tests/vn/ticketCalculateClon.spec.js
@@ -86,18 +86,20 @@ describe('ticket ticketCalculateClon()', () => {
stmt = new ParameterizedSQL('CALL vn.ticketCalculateClon(@result, ?)', [params.originalTicketId]);
stmts.push(stmt);
-
- let orderIndex = stmts.push(`SELECT * FROM vn.orderTicket WHERE ticketFk = @result`) - 1;
-
stmts.push('ROLLBACK');
let sql = ParameterizedSQL.join(stmts, ';');
- let result = await app.models.Ticket.rawStmt(sql);
- let expectedOrder = 11;
- let newestTicketIdInFixtures = 21;
+ let error;
- expect(result[orderIndex][0].orderFk).toEqual(expectedOrder);
- expect(result[orderIndex][0].ticketFk).toBeGreaterThan(newestTicketIdInFixtures);
+ try {
+ await app.models.Ticket.rawStmt(sql);
+ } catch (e) {
+ error = e;
+ }
+
+ expect(error).toBeDefined();
+ expect(error.statusCode).toBe(500);
+ expect(error.code).toBe('ER_SIGNAL_EXCEPTION');
});
});
diff --git a/db/tests/vn/ticketCreateWithUser.spec.js b/db/tests/vn/ticketCreateWithUser.spec.js
index e45d95f78..623f23422 100644
--- a/db/tests/vn/ticketCreateWithUser.spec.js
+++ b/db/tests/vn/ticketCreateWithUser.spec.js
@@ -14,8 +14,8 @@ describe('ticket ticketCreateWithUser()', () => {
shipped: today,
warehouseFk: 1,
companyFk: 442,
- addressFk: 1,
- agencyModeFk: 2,
+ addressFk: 121,
+ agencyModeFk: 1,
routeFk: null,
landed: today,
userId: 18
@@ -64,8 +64,8 @@ describe('ticket ticketCreateWithUser()', () => {
shipped: today,
warehouseFk: 1,
companyFk: 442,
- addressFk: 1,
- agencyModeFk: 2,
+ addressFk: 121,
+ agencyModeFk: 1,
routeFk: null,
landed: today,
userId: 18
@@ -91,7 +91,6 @@ describe('ticket ticketCreateWithUser()', () => {
let sql = ParameterizedSQL.join(stmts, ';');
let result = await app.models.Ticket.rawStmt(sql);
-
let firstTicketObservation = result[ticketObsevationsIndex][0];
let secondTicketObservation = result[ticketObsevationsIndex][1];
let thirdTicketObservation = result[ticketObsevationsIndex][2];
@@ -116,7 +115,7 @@ describe('ticket ticketCreateWithUser()', () => {
warehouseFk: 1,
companyFk: 442,
addressFk: 0,
- agencyModeFk: 2,
+ agencyModeFk: 1,
routeFk: null,
landed: today,
userId: 18
@@ -162,8 +161,8 @@ describe('ticket ticketCreateWithUser()', () => {
shipped: today,
warehouseFk: 1,
companyFk: 442,
- addressFk: 0,
- agencyModeFk: 2,
+ addressFk: 121,
+ agencyModeFk: 1,
routeFk: null,
landed: today,
userId: 18
@@ -186,7 +185,8 @@ describe('ticket ticketCreateWithUser()', () => {
params.userId
]);
stmts.push(stmt);
-
+ let ticket = stmts.push(`select @newTicketId`);
+ console.log('NUm ticket', ticket);
let ticketStateCodeIndex = stmts.push(`SELECT code FROM vn.ticketState WHERE ticketFk = @newTicketId`) - 1;
stmts.push('ROLLBACK');
@@ -196,6 +196,6 @@ describe('ticket ticketCreateWithUser()', () => {
let ticketStateCode = result[ticketStateCodeIndex][0].code;
- expect(ticketStateCode).toEqual('DELIVERED');
+ expect(ticketStateCode).toEqual('FREE');
});
});
diff --git a/e2e/paths/03-worker-module/01_pbx.spec.js b/e2e/paths/03-worker-module/01_pbx.spec.js
index 73c37643a..49d4db133 100644
--- a/e2e/paths/03-worker-module/01_pbx.spec.js
+++ b/e2e/paths/03-worker-module/01_pbx.spec.js
@@ -28,6 +28,6 @@ describe('Worker pbx path', () => {
.waitToClick(selectors.workerPbx.saveButton)
.waitForLastSnackbar();
- expect(result).toEqual('Data saved!');
+ expect(result).toEqual('Data saved! User must access web');
});
});
diff --git a/front/core/components/autocomplete/autocomplete.html b/front/core/components/autocomplete/autocomplete.html
index ecb21fe2f..c616c794a 100755
--- a/front/core/components/autocomplete/autocomplete.html
+++ b/front/core/components/autocomplete/autocomplete.html
@@ -14,7 +14,10 @@
translate-attr="{title: 'Clear'}">
-
+
-
+
diff --git a/front/core/components/textfield/textfield.js b/front/core/components/textfield/textfield.js
index fcf823c6b..bf6d5bfd5 100644
--- a/front/core/components/textfield/textfield.js
+++ b/front/core/components/textfield/textfield.js
@@ -84,6 +84,7 @@ ngModule.component('vnTextfield', {
label: '@?',
name: '@?',
disabled: '',
+ required: '@?',
readonly: '',
rule: '@?',
type: '@?',
diff --git a/loopback/locale/es.json b/loopback/locale/es.json
index 64427d88f..68eb76d15 100644
--- a/loopback/locale/es.json
+++ b/loopback/locale/es.json
@@ -1,5 +1,5 @@
{
- "PHONE_INVALID_FORMAT": "El formato del teléfono no es correcto",
+ "Phone format is invalid": "El formato del teléfono no es correcto",
"You are not allowed to change the credit": "No tienes privilegios para modificar el crédito",
"Unable to mark the equivalence surcharge": "No se puede marcar el recargo de equivalencia",
"The default consignee can not be unchecked": "No se puede desmarcar el consignatario predeterminado",
@@ -73,12 +73,10 @@
"You cannot remove this department": "No puedes eliminar este departamento",
"The extension must be unique": "La extensión debe ser unica",
"The secret can't be blank": "La contraseña no puede estar en blanco",
- "EXTENSION_INVALID_FORMAT": "La extensión es invalida",
"We weren't able to send this SMS": "No hemos podido enviar el SMS",
"This client can't be invoiced": "Este cliente no puede ser facturado",
"This ticket can't be invoiced": "Este ticket no puede ser facturado",
"That item is not available on that day": "El item no esta disponible para esa fecha",
- "That item doesn't exists": "No existe el artículo",
"You cannot add or modify services to an invoiced ticket": "No puedes añadir o modificar servicios a un ticket facturado",
"This ticket can not be modified": "Este ticket no puede ser modificado",
"The introduced hour already exists": "Esta hora ya ha sido introducida",
@@ -90,5 +88,8 @@
"The sales of this ticket can't be modified": "Las lineas de este ticket no pueden ser modificadas",
"Please select at least one sale": "Por favor selecciona al menos una linea",
"All sales must belong to the same ticket": "Todas las lineas deben pertenecer al mismo ticket",
- "NO_ZONE_FOR_THIS_PARAMETERS": "Para este día no hay ninguna zona configurada"
+ "NO_ZONE_FOR_THIS_PARAMETERS": "Para este día no hay ninguna zona configurada",
+ "That item doesn't exists": "El artículo no existe",
+ "NOT_ZONE_WITH_THIS_PARAMETERS": "Para este día no hay ninguna zona configurada",
+ "Extension format is invalid": "El formato de la extensión es inválido"
}
\ No newline at end of file
diff --git a/modules/claim/back/methods/claim-beginning/importToNewRefundTicket.spec.js b/modules/claim/back/methods/claim-beginning/importToNewRefundTicket.spec.js
index b7f961b13..1ba6e59f2 100644
--- a/modules/claim/back/methods/claim-beginning/importToNewRefundTicket.spec.js
+++ b/modules/claim/back/methods/claim-beginning/importToNewRefundTicket.spec.js
@@ -31,7 +31,7 @@ describe('claimBeginning', () => {
expect(refundTicketSales.length).toEqual(2);
expect(refundTicketSales[0].quantity).toEqual(-5);
expect(refundTicketSales[1].quantity).toEqual(-4);
- expect(refundTicketObservations[0].description).toEqual('Reclama ticket: 11');
+ expect(refundTicketObservations[3].description).toEqual('Reclama ticket: 11');
expect(refundTicketState.stateFk).toEqual(16);
expect(salesInsertedInClaimEnd[0].saleFk).toEqual(refundTicketSales[0].id);
expect(salesInsertedInClaimEnd[1].saleFk).toEqual(refundTicketSales[1].id);
diff --git a/modules/claim/front/detail/index.html b/modules/claim/front/detail/index.html
index a7031e31a..ba7a34ffd 100644
--- a/modules/claim/front/detail/index.html
+++ b/modules/claim/front/detail/index.html
@@ -146,9 +146,7 @@