diff --git a/CHANGELOG.md b/CHANGELOG.md
index 75e807a7b..92c4ee3aa 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -24,13 +24,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- (Tickets -> Crear Factura) Al facturar se envia automáticamente el pdf al cliente
- (Artículos -> Histórico) Filtro para mostrar lo anterior al inventario
-
+- (Trabajadores -> Nuevo trabajador) Permite elegir el método de pago
### Changed
- (Trabajadores -> Nuevo trabajador) Los clientes se crean sin 'TR' pero se añade tipo de negocio 'Trabajador'
### Fixed
- (Tickets -> Líneas) Se permite hacer split de líneas al mismo ticket
+- (Tickets -> Cambiar estado) Ahora muestra la lista completa de todos los estados
diff --git a/back/methods/edi/sql/item.sql b/back/methods/edi/sql/item.sql
index 8d794c7cf..cd1bef88d 100644
--- a/back/methods/edi/sql/item.sql
+++ b/back/methods/edi/sql/item.sql
@@ -1,9 +1,9 @@
LOAD DATA LOCAL INFILE ?
INTO TABLE `edi`.`item`
+ CHARACTER SET ascii
FIELDS TERMINATED BY ';'
LINES TERMINATED BY '\n' (@col1, @col2, @col3, @col4, @col5, @col6, @col7, @col8, @col9, @col10, @col11, @col12)
- SET
- id = @col2,
+ SET id = @col2,
product_name = @col4,
name = @col5,
plant_id = @col7,
@@ -11,3 +11,4 @@ LOAD DATA LOCAL INFILE ?
entry_date = STR_TO_DATE(@col10, '%Y%m%d'),
expiry_date = IFNULL(NULL,STR_TO_DATE(@col11, '%Y%m%d')),
change_date_time = STR_TO_DATE(@col12, '%Y%m%d%H%i')
+
\ No newline at end of file
diff --git a/back/methods/edi/updateData.js b/back/methods/edi/updateData.js
index 232695f4e..1057be39b 100644
--- a/back/methods/edi/updateData.js
+++ b/back/methods/edi/updateData.js
@@ -3,236 +3,237 @@ const path = require('path');
const fs = require('fs-extra');
module.exports = Self => {
- Self.remoteMethodCtx('updateData', {
- description: 'Updates schema data from external provider',
- accessType: 'WRITE',
- returns: {
- type: 'object',
- root: true
- },
- http: {
- path: `/updateData`,
- verb: 'POST'
- }
- });
+ Self.remoteMethodCtx('updateData', {
+ description: 'Updates schema data from external provider',
+ accessType: 'WRITE',
+ returns: {
+ type: 'object',
+ root: true
+ },
+ http: {
+ path: `/updateData`,
+ verb: 'POST'
+ }
+ });
- Self.updateData = async() => {
- const models = Self.app.models;
+ Self.updateData = async() => {
+ const models = Self.app.models;
- // Get files checksum
- const tx = await Self.beginTransaction({});
+ // Get files checksum
+ const tx = await Self.beginTransaction({});
- try {
- const options = {transaction: tx};
- const files = await Self.rawSql('SELECT name, checksum, keyValue FROM edi.fileConfig', null, options);
+ try {
+ const options = {transaction: tx};
+ const files = await Self.rawSql('SELECT name, checksum, keyValue FROM edi.fileConfig', null, options);
- const updatableFiles = [];
- for (const file of files) {
- const fileChecksum = await getChecksum(file);
+ const updatableFiles = [];
+ for (const file of files) {
+ const fileChecksum = await getChecksum(file);
- if (file.checksum != fileChecksum) {
- updatableFiles.push({
- name: file.name,
- checksum: fileChecksum
- });
- } else
- console.debug(`File already updated, skipping...`);
- }
+ if (file.checksum != fileChecksum) {
+ updatableFiles.push({
+ name: file.name,
+ checksum: fileChecksum
+ });
+ } else
+ console.debug(`File already updated, skipping...`);
+ }
- if (updatableFiles.length === 0)
- return false;
+ if (updatableFiles.length === 0)
+ return false;
- // Download files
- const container = await models.TempContainer.container('edi');
- const tempPath = path.join(container.client.root, container.name);
+ // Download files
+ const container = await models.TempContainer.container('edi');
+ const tempPath = path.join(container.client.root, container.name);
- let remoteFile;
- let tempDir;
- let tempFile;
+ let remoteFile;
+ let tempDir;
+ let tempFile;
- const fileNames = updatableFiles.map(file => file.name);
+ const fileNames = updatableFiles.map(file => file.name);
- const tables = await Self.rawSql(`
- SELECT fileName, toTable, file
- FROM edi.tableConfig
- WHERE file IN (?)`, [fileNames], options);
+ const tables = await Self.rawSql(`
+ SELECT fileName, toTable, file
+ FROM edi.tableConfig
+ WHERE file IN (?)`, [fileNames], options);
- for (const table of tables) {
- const fileName = table.file;
+ for (const table of tables) {
+ const fileName = table.file;
- remoteFile = `codes/${fileName}.ZIP`;
- tempDir = `${tempPath}/${fileName}`;
- tempFile = `${tempPath}/${fileName}.zip`;
+ remoteFile = `codes/${fileName}.ZIP`;
+ tempDir = `${tempPath}/${fileName}`;
+ tempFile = `${tempPath}/${fileName}.zip`;
- try {
- await fs.readFile(tempFile);
- } catch (error) {
- if (error.code === 'ENOENT') {
- console.debug(`Downloading file ${fileName}...`);
- const downloadOutput = await downloadFile(remoteFile, tempFile);
- if (downloadOutput.error)
- continue;
- }
- }
+ try {
+ await fs.readFile(tempFile);
+ } catch (error) {
+ if (error.code === 'ENOENT') {
+ console.debug(`Downloading file ${fileName}...`);
+ const downloadOutput = await downloadFile(remoteFile, tempFile);
+ if (downloadOutput.error)
+ continue;
+ }
+ }
- await extractFile(fileName, tempFile, tempDir);
+ await extractFile(fileName, tempFile, tempDir);
- console.debug(`Updating table ${table.toTable}...`);
- await dumpData(tempDir, table, options);
- }
+ console.debug(`Updating table ${table.toTable}...`);
+ await dumpData(tempDir, table, options);
+ }
- // Update files checksum
- for (const file of updatableFiles) {
- console.log(`Updating file ${file.name} checksum...`);
- await Self.rawSql(`
- UPDATE edi.fileConfig
- SET checksum = ?
- WHERE name = ?`,
- [file.checksum, file.name], options);
- }
+ // Update files checksum
+ for (const file of updatableFiles) {
+ console.log(`Updating file ${file.name} checksum...`);
+ await Self.rawSql(`
+ UPDATE edi.fileConfig
+ SET checksum = ?
+ WHERE name = ?`,
+ [file.checksum, file.name], options);
+ }
- await tx.commit();
+ await tx.commit();
- // Clean files
- try {
- console.debug(`Cleaning files...`);
- await fs.remove(tempPath);
- } catch (error) {
- if (error.code !== 'ENOENT')
- throw e;
- }
+ // Clean files
+ try {
+ console.debug(`Cleaning files...`);
+ await fs.remove(tempPath);
+ } catch (error) {
+ if (error.code !== 'ENOENT')
+ throw e;
+ }
- return true;
- } catch (error) {
- await tx.rollback();
- throw error;
- }
- };
+ return true;
+ } catch (error) {
+ await tx.rollback();
+ throw error;
+ }
+ };
- let ftpClient;
- async function getFtpClient() {
- if (!ftpClient) {
- const [ftpConfig] = await Self.rawSql('SELECT host, user, password FROM edi.ftpConfig');
- console.debug(`Openning FTP connection to ${ftpConfig.host}...\n`);
+ let ftpClient;
+ async function getFtpClient() {
+ if (!ftpClient) {
+ const [ftpConfig] = await Self.rawSql('SELECT host, user, password FROM edi.ftpConfig');
+ console.debug(`Openning FTP connection to ${ftpConfig.host}...\n`);
- const FtpClient = require('ftps');
+ const FtpClient = require('ftps');
- ftpClient = new FtpClient({
- host: ftpConfig.host,
- username: ftpConfig.user,
- password: ftpConfig.password,
- procotol: 'ftp'
- });
- }
+ ftpClient = new FtpClient({
+ host: ftpConfig.host,
+ username: ftpConfig.user,
+ password: ftpConfig.password,
+ procotol: 'ftp',
+ additionalLftpCommands: 'set ssl:verify-certificate no'
+ });
+ }
- return ftpClient;
- }
+ return ftpClient;
+ }
- async function getChecksum(file) {
- const ftpClient = await getFtpClient();
- console.debug(`Checking checksum for file ${file.name}...`);
+ async function getChecksum(file) {
+ const ftpClient = await getFtpClient();
+ console.debug(`Checking checksum for file ${file.name}...`);
- ftpClient.cat(`codes/${file.name}.txt`);
+ ftpClient.cat(`codes/${file.name}.TXT`);
- const response = await new Promise((resolve, reject) => {
- ftpClient.exec((err, response) => {
- if (err || response.error) {
- console.debug(`Error downloading checksum file... ${response.error}`);
- return reject(err);
- }
+ const response = await new Promise((resolve, reject) => {
+ ftpClient.exec((err, response) => {
+ if (err || response.error) {
+ console.debug(`Error downloading checksum file... ${response.error}`);
+ return reject(err);
+ }
- resolve(response);
- });
- });
+ resolve(response);
+ });
+ });
- if (response && response.data) {
- const fileContents = response.data;
- const rows = fileContents.split('\n');
- const row = rows[4];
- const columns = row.split(/\s+/);
+ if (response && response.data) {
+ const fileContents = response.data;
+ const rows = fileContents.split('\n');
+ const row = rows[4];
+ const columns = row.split(/\s+/);
- let fileChecksum;
- if (file.keyValue)
- fileChecksum = columns[1];
+ let fileChecksum;
+ if (file.keyValue)
+ fileChecksum = columns[1];
- if (!file.keyValue)
- fileChecksum = columns[0];
+ if (!file.keyValue)
+ fileChecksum = columns[0];
- return fileChecksum;
- }
- }
+ return fileChecksum;
+ }
+ }
- async function downloadFile(remoteFile, tempFile) {
- const ftpClient = await getFtpClient();
+ async function downloadFile(remoteFile, tempFile) {
+ const ftpClient = await getFtpClient();
- ftpClient.get(remoteFile, tempFile);
+ ftpClient.get(remoteFile, tempFile);
- return new Promise((resolve, reject) => {
- ftpClient.exec((err, response) => {
- if (err || response.error) {
- console.debug(`Error downloading file... ${response.error}`);
- return reject(err);
- }
+ return new Promise((resolve, reject) => {
+ ftpClient.exec((err, response) => {
+ if (err || response.error) {
+ console.debug(`Error downloading file... ${response.error}`);
+ return reject(err);
+ }
- resolve(response);
- });
- });
- }
+ resolve(response);
+ });
+ });
+ }
- async function extractFile(fileName, tempFile, tempDir) {
- const JSZip = require('jszip');
+ async function extractFile(fileName, tempFile, tempDir) {
+ const JSZip = require('jszip');
- try {
- await fs.mkdir(tempDir);
- console.debug(`Extracting file ${fileName}...`);
- } catch (error) {
- if (error.code !== 'EEXIST')
- throw e;
- }
+ try {
+ await fs.mkdir(tempDir);
+ console.debug(`Extracting file ${fileName}...`);
+ } catch (error) {
+ if (error.code !== 'EEXIST')
+ throw e;
+ }
- const fileStream = await fs.readFile(tempFile);
- if (fileStream) {
- const zip = new JSZip();
- const zipContents = await zip.loadAsync(fileStream);
+ const fileStream = await fs.readFile(tempFile);
+ if (fileStream) {
+ const zip = new JSZip();
+ const zipContents = await zip.loadAsync(fileStream);
- if (!zipContents) return;
+ if (!zipContents) return;
- const fileNames = Object.keys(zipContents.files);
+ const fileNames = Object.keys(zipContents.files);
- for (const fileName of fileNames) {
- const fileContent = await zip.file(fileName).async('nodebuffer');
- const dest = path.join(tempDir, fileName);
- await fs.writeFile(dest, fileContent);
- }
- }
- }
+ for (const fileName of fileNames) {
+ const fileContent = await zip.file(fileName).async('nodebuffer');
+ const dest = path.join(tempDir, fileName);
+ await fs.writeFile(dest, fileContent);
+ }
+ }
+ }
- async function dumpData(tempDir, table, options) {
- const toTable = table.toTable;
- const baseName = table.fileName;
+ async function dumpData(tempDir, table, options) {
+ const toTable = table.toTable;
+ const baseName = table.fileName;
- console.log(`Emptying table ${toTable}...`);
- const tableName = `edi.${toTable}`;
- await Self.rawSql(`DELETE FROM ??`, [tableName]);
+ console.log(`Emptying table ${toTable}...`);
+ const tableName = `edi.${toTable}`;
+ await Self.rawSql(`DELETE FROM ??`, [tableName]);
- const dirFiles = await fs.readdir(tempDir);
- const files = dirFiles.filter(file => file.startsWith(baseName));
+ const dirFiles = await fs.readdir(tempDir);
+ const files = dirFiles.filter(file => file.startsWith(baseName));
- for (const file of files) {
- console.log(`Dumping data from file ${file}...`);
+ for (const file of files) {
+ console.log(`Dumping data from file ${file}...`);
- const templatePath = path.join(__dirname, `./sql/${toTable}.sql`);
- const sqlTemplate = await fs.readFile(templatePath, 'utf8');
- const filePath = path.join(tempDir, file);
+ const templatePath = path.join(__dirname, `./sql/${toTable}.sql`);
+ const sqlTemplate = await fs.readFile(templatePath, 'utf8');
+ const filePath = path.join(tempDir, file);
- await Self.rawSql(sqlTemplate, [filePath], options);
- await Self.rawSql(`
- UPDATE edi.tableConfig
- SET updated = ?
- WHERE fileName = ?
- `, [Date.vnNew(), baseName], options);
- }
+ await Self.rawSql(sqlTemplate, [filePath], options);
+ await Self.rawSql(`
+ UPDATE edi.tableConfig
+ SET updated = ?
+ WHERE fileName = ?
+ `, [Date.vnNew(), baseName], options);
+ }
- console.log(`Updated table ${toTable}\n`);
- }
+ console.log(`Updated table ${toTable}\n`);
+ }
};
diff --git a/back/methods/image/download.js b/back/methods/image/download.js
index 3a8bcf30e..c4037b809 100644
--- a/back/methods/image/download.js
+++ b/back/methods/image/download.js
@@ -67,7 +67,7 @@ module.exports = Self => {
if (!image) return false;
- const hasReadRole = models.ImageCollection.hasReadRole(ctx, collection);
+ const hasReadRole = await models.ImageCollection.hasReadRole(ctx, collection);
if (!hasReadRole)
throw new UserError(`You don't have enough privileges`);
diff --git a/back/models/dms-type.json b/back/models/dms-type.json
index c7a1815fe..de3d564b4 100644
--- a/back/models/dms-type.json
+++ b/back/models/dms-type.json
@@ -44,4 +44,4 @@
"principalId": "$everyone",
"permission": "ALLOW"
}]
-}
\ No newline at end of file
+}
diff --git a/back/models/image-collection.js b/back/models/image-collection.js
index 2c4d274ee..69905beca 100644
--- a/back/models/image-collection.js
+++ b/back/models/image-collection.js
@@ -9,10 +9,11 @@ module.exports = Self => {
* @return {boolean} True for user with read privileges
*/
Self.hasReadRole = async(ctx, name, options) => {
- const collection = await Self.findOne({where: {name}}, {
+ const collection = await Self.findOne({
include: {
relation: 'readRole'
- }
+ },
+ where: {name}
}, options);
return await hasRole(ctx, collection, options);
diff --git a/db/changes/231201/00-wagon.sql b/db/changes/231201/00-wagon.sql
index 3e4d225d7..9e817bac4 100644
--- a/db/changes/231201/00-wagon.sql
+++ b/db/changes/231201/00-wagon.sql
@@ -56,8 +56,6 @@ CREATE TABLE `vn`.`collectionWagonTicket` (
ALTER TABLE `vn`.`wagon` ADD `typeFk` int(11) unsigned NOT NULL;
ALTER TABLE `vn`.`wagon` ADD `label` int(11) unsigned NOT NULL;
-ALTER TABLE `vn`.`wagon` ADD CONSTRAINT `wagon_type` FOREIGN KEY (`typeFk`) REFERENCES `wagonType` (`id`) ON UPDATE CASCADE;
-
INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`)
VALUES
('WagonType', '*', '*', 'ALLOW', 'ROLE', 'productionAssi'),
@@ -70,3 +68,4 @@ INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `pri
('WagonType', 'createWagonType', '*', 'ALLOW', 'ROLE', 'productionAssi'),
('WagonType', 'deleteWagonType', '*', 'ALLOW', 'ROLE', 'productionAssi'),
('WagonType', 'editWagonType', '*', 'ALLOW', 'ROLE', 'productionAssi');
+
diff --git a/db/changes/231801/00-client_setRatingAcl.sql b/db/changes/231801/00-client_setRatingAcl.sql
index b041b131a..6687b11ec 100644
--- a/db/changes/231801/00-client_setRatingAcl.sql
+++ b/db/changes/231801/00-client_setRatingAcl.sql
@@ -27,7 +27,6 @@ INSERT INTO `salix`.`ACL` (model, property, accessType, permission, principalTyp
('Client', 'summary', '*', 'ALLOW', 'ROLE', 'employee'),
('Client', 'updateAddress', '*', 'ALLOW', 'ROLE', 'employee'),
('Client', 'updateFiscalData', '*', 'ALLOW', 'ROLE', 'employee'),
- ('Client', 'updateUser', '*', 'ALLOW', 'ROLE', 'employee'),
('Client', 'uploadFile', '*', 'ALLOW', 'ROLE', 'employee'),
('Client', 'campaignMetricsPdf', '*', 'ALLOW', 'ROLE', 'employee'),
('Client', 'campaignMetricsEmail', '*', 'ALLOW', 'ROLE', 'employee'),
diff --git a/db/changes/232001/00-wagon.sql b/db/changes/232001/00-wagon.sql
new file mode 100644
index 000000000..bdb384db5
--- /dev/null
+++ b/db/changes/232001/00-wagon.sql
@@ -0,0 +1 @@
+ALTER TABLE `vn`.`wagon` ADD CONSTRAINT `wagon_type` FOREIGN KEY (`typeFk`) REFERENCES `wagonType` (`id`) ON UPDATE CASCADE;
diff --git a/db/changes/232001/00-procedurecanAdvance.sql b/db/changes/232201/00-procedurecanAdvance.sql
similarity index 100%
rename from db/changes/232001/00-procedurecanAdvance.sql
rename to db/changes/232201/00-procedurecanAdvance.sql
diff --git a/db/changes/232001/00-procedurecanbePostponed.sql b/db/changes/232201/00-procedurecanbePostponed.sql
similarity index 100%
rename from db/changes/232001/00-procedurecanbePostponed.sql
rename to db/changes/232201/00-procedurecanbePostponed.sql
diff --git a/db/changes/232201/00-workerConfigPayMethod.sql b/db/changes/232201/00-workerConfigPayMethod.sql
index 91f477bec..8896f636d 100644
--- a/db/changes/232201/00-workerConfigPayMethod.sql
+++ b/db/changes/232201/00-workerConfigPayMethod.sql
@@ -1,7 +1,7 @@
ALTER TABLE `vn`.`workerConfig` ADD payMethodFk tinyint(3) unsigned NULL;
ALTER TABLE `vn`.`workerConfig` ADD CONSTRAINT workerConfig_FK FOREIGN KEY (roleFk) REFERENCES account.`role`(id) ON DELETE RESTRICT ON UPDATE CASCADE;
ALTER TABLE `vn`.`workerConfig` ADD CONSTRAINT workerConfig_FK_1 FOREIGN KEY (payMethodFk) REFERENCES `vn`.`payMethod`(id) ON DELETE SET NULL ON UPDATE CASCADE;
--- Cuando se apruebe el PR quitar y poner en redmine para hacerse manualmente
+
UPDATE `vn`.`workerConfig`
SET payMethodFk = 4
WHERE id=1;
diff --git a/db/changes/232401/00-buyConfig_travelConfig.sql b/db/changes/232401/00-buyConfig_travelConfig.sql
new file mode 100644
index 000000000..0f73ddc8c
--- /dev/null
+++ b/db/changes/232401/00-buyConfig_travelConfig.sql
@@ -0,0 +1,28 @@
+CREATE TABLE `vn`.`buyConfig` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `monthsAgo` int(11) NOT NULL DEFAULT 6 COMMENT 'Meses desde la última compra',
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
+
+CREATE TABLE `vn`.`travelConfig` (
+ `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
+ `warehouseInFk` smallint(6) unsigned NOT NULL DEFAULT 8 COMMENT 'Warehouse de origen',
+ `warehouseOutFk` smallint(6) unsigned NOT NULL DEFAULT 60 COMMENT 'Warehouse destino',
+ `agencyFk` int(11) NOT NULL DEFAULT 1378 COMMENT 'Agencia por defecto',
+ `companyFk` smallint(5) unsigned NOT NULL DEFAULT 442 COMMENT 'Compañía por defecto',
+ PRIMARY KEY (`id`),
+ KEY `travelConfig_FK` (`warehouseInFk`),
+ KEY `travelConfig_FK_1` (`warehouseOutFk`),
+ KEY `travelConfig_FK_2` (`agencyFk`),
+ KEY `travelConfig_FK_3` (`companyFk`),
+ CONSTRAINT `travelConfig_FK` FOREIGN KEY (`warehouseInFk`) REFERENCES `warehouse` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
+ CONSTRAINT `travelConfig_FK_1` FOREIGN KEY (`warehouseOutFk`) REFERENCES `warehouse` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
+ CONSTRAINT `travelConfig_FK_2` FOREIGN KEY (`agencyFk`) REFERENCES `agencyMode` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
+ CONSTRAINT `travelConfig_FK_3` FOREIGN KEY (`companyFk`) REFERENCES `company` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
+
+INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`)
+ VALUES
+ ('Entry', 'addFromPackaging', 'WRITE', 'ALLOW', 'ROLE', 'production'),
+ ('Entry', 'addFromBuy', 'WRITE', 'ALLOW', 'ROLE', 'production'),
+ ('Supplier', 'getItemsPackaging', 'READ', 'ALLOW', 'ROLE', 'production');
diff --git a/db/changes/232401/00-printer.sql b/db/changes/232401/00-printer.sql
new file mode 100644
index 000000000..6280c2c6d
--- /dev/null
+++ b/db/changes/232401/00-printer.sql
@@ -0,0 +1,3 @@
+ALTER TABLE `vn`.`sector` DROP COLUMN `printerFk`;
+ALTER TABLE `vn`.`sector` ADD COLUMN `mainPrinterFk` tinyint(3) unsigned;
+ALTER TABLE `vn`.`sector` ADD CONSTRAINT sector_FK_1 FOREIGN KEY (mainPrinterFk) REFERENCES vn.printer(id) ON DELETE CASCADE ON UPDATE CASCADE;
diff --git a/db/changes/232401/00-useSpecificsAcls.sql b/db/changes/232401/00-useSpecificsAcls.sql
new file mode 100644
index 000000000..0d17ca948
--- /dev/null
+++ b/db/changes/232401/00-useSpecificsAcls.sql
@@ -0,0 +1,121 @@
+INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`)
+ VALUES
+ ('Ticket', 'editDiscount', 'WRITE', 'ALLOW', 'ROLE', 'claimManager'),
+ ('Ticket', 'editDiscount', 'WRITE', 'ALLOW', 'ROLE', 'salesPerson'),
+ ('Ticket', 'isRoleAdvanced', '*', 'ALLOW', 'ROLE', 'salesAssistant'),
+ ('Ticket', 'isRoleAdvanced', '*', 'ALLOW', 'ROLE', 'deliveryBoss'),
+ ('Ticket', 'isRoleAdvanced', '*', 'ALLOW', 'ROLE', 'buyer'),
+ ('Ticket', 'isRoleAdvanced', '*', 'ALLOW', 'ROLE', 'claimManager'),
+ ('Ticket', 'deleteTicketWithPartPrepared', 'WRITE', 'ALLOW', 'ROLE', 'salesAssistant'),
+ ('Ticket', 'editZone', 'WRITE', 'ALLOW', 'ROLE', 'deliveryBoss'),
+ ('State', 'editableStates', 'READ', 'ALLOW', 'ROLE', 'employee'),
+ ('State', 'seeEditableStates', 'READ', 'ALLOW', 'ROLE', 'administrative'),
+ ('State', 'seeEditableStates', 'READ', 'ALLOW', 'ROLE', 'production'),
+ ('State', 'isSomeEditable', 'READ', 'ALLOW', 'ROLE', 'salesPerson'),
+ ('State', 'isAllEditable', 'READ', 'ALLOW', 'ROLE', 'production'),
+ ('State', 'isAllEditable', 'READ', 'ALLOW', 'ROLE', 'administrative'),
+ ('Agency', 'seeExpired', 'READ', 'ALLOW', 'ROLE', 'administrative'),
+ ('Agency', 'seeExpired', 'READ', 'ALLOW', 'ROLE', 'productionBoss'),
+ ('Claim', 'createAfterDeadline', 'WRITE', 'ALLOW', 'ROLE', 'claimManager'),
+ ('Client', 'editAddressLogifloraAllowed', 'WRITE', 'ALLOW', 'ROLE', 'salesAssistant'),
+ ('Client', 'editFiscalDataWithoutTaxDataCheck', 'WRITE', 'ALLOW', 'ROLE', 'salesAssistant'),
+ ('Client', 'editVerifiedDataWithoutTaxDataCheck', 'WRITE', 'ALLOW', 'ROLE', 'salesAssistant'),
+ ('Client', 'editCredit', 'WRITE', 'ALLOW', 'ROLE', 'financialBoss'),
+ ('Client', 'isNotEditableCredit', 'WRITE', 'ALLOW', 'ROLE', 'financialBoss'),
+ ('InvoiceOut', 'canCreatePdf', 'WRITE', 'ALLOW', 'ROLE', 'invoicing'),
+ ('Supplier', 'editPayMethodCheck', 'WRITE', 'ALLOW', 'ROLE', 'financial'),
+ ('Worker', 'isTeamBoss', 'WRITE', 'ALLOW', 'ROLE', 'teamBoss'),
+ ('Worker', 'forceIsSubordinate', 'READ', 'ALLOW', 'ROLE', 'hr'),
+ ('Claim', 'editState', 'WRITE', 'ALLOW', 'ROLE', 'claimManager');
+
+DELETE FROM `salix`.`ACL`
+ WHERE
+ model = 'Claim'
+ AND property = '*'
+ AND accessType = '*';
+
+INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`)
+ VALUES
+ ('Claim', 'find', 'READ', 'ALLOW', 'ROLE', 'salesPerson'),
+ ('Claim', 'findById', 'READ', 'ALLOW', 'ROLE', 'salesPerson'),
+ ('Claim', 'findOne', 'READ', 'ALLOW', 'ROLE', 'salesPerson'),
+ ('Claim', 'getSummary', 'READ', 'ALLOW', 'ROLE', 'salesPerson'),
+ ('Claim', 'updateClaim', 'WRITE', 'ALLOW', 'ROLE', 'salesPerson'),
+ ('Claim', 'regularizeClaim', 'WRITE', 'ALLOW', 'ROLE', 'claimManager'),
+ ('Claim', 'updateClaimDestination', 'WRITE', 'ALLOW', 'ROLE', 'claimManager'),
+ ('Claim', 'downloadFile', 'READ', 'ALLOW', 'ROLE', 'claimManager'),
+ ('Claim', 'deleteById', 'WRITE', 'ALLOW', 'ROLE', 'claimManager'),
+ ('Claim', 'filter', 'READ', 'ALLOW', 'ROLE', 'salesPerson'),
+ ('Claim', 'logs', 'READ', 'ALLOW', 'ROLE', 'claimManager');
+
+DELETE FROM `salix`.`ACL`
+ WHERE
+ model = 'Ticket'
+ AND property = '*'
+ AND accessType = '*';
+
+INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`)
+ VALUES
+ ('Ticket', 'find', 'READ', 'ALLOW', 'ROLE', 'employee'),
+ ('Ticket', 'findById', 'READ', 'ALLOW', 'ROLE', 'employee'),
+ ('Ticket', 'findOne', 'READ', 'ALLOW', 'ROLE', 'employee'),
+ ('Ticket', 'getVolume', 'READ', 'ALLOW', 'ROLE', 'employee'),
+ ('Ticket', 'getTotalVolume', 'READ', 'ALLOW', 'ROLE', 'employee'),
+ ('Ticket', 'summary', 'READ', 'ALLOW', 'ROLE', 'employee'),
+ ('Ticket', 'priceDifference', 'READ', 'ALLOW', 'ROLE', 'employee'),
+ ('Ticket', 'componentUpdate', 'WRITE', 'ALLOW', 'ROLE', 'employee'),
+ ('Ticket', 'new', 'WRITE', 'ALLOW', 'ROLE', 'employee'),
+ ('Ticket', 'isEditable', 'READ', 'ALLOW', 'ROLE', 'employee'),
+ ('Ticket', 'setDeleted', 'WRITE', 'ALLOW', 'ROLE', 'employee'),
+ ('Ticket', 'restore', 'WRITE', 'ALLOW', 'ROLE', 'employee'),
+ ('Ticket', 'getSales', 'READ', 'ALLOW', 'ROLE', 'employee'),
+ ('Ticket', 'getSalesPersonMana', 'READ', 'ALLOW', 'ROLE', 'employee'),
+ ('Ticket', 'filter', 'READ', 'ALLOW', 'ROLE', 'employee'),
+ ('Ticket', 'makeInvoice', 'WRITE', 'ALLOW', 'ROLE', 'employee'),
+ ('Ticket', 'updateEditableTicket', 'WRITE', 'ALLOW', 'ROLE', 'employee'),
+ ('Ticket', 'updateDiscount', 'WRITE', 'ALLOW', 'ROLE', 'employee'),
+ ('Ticket', 'transferSales', 'WRITE', 'ALLOW', 'ROLE', 'employee'),
+ ('Ticket', 'sendSms', 'WRITE', 'ALLOW', 'ROLE', 'employee'),
+ ('Ticket', 'isLocked', 'READ', 'ALLOW', 'ROLE', 'employee'),
+ ('Ticket', 'freightCost', 'READ', 'ALLOW', 'ROLE', 'employee'),
+ ('Ticket', 'getComponentsSum', 'READ', 'ALLOW', 'ROLE', 'employee'),
+ ('Ticket', 'updateAttributes', 'WRITE', 'ALLOW', 'ROLE', 'delivery'), -- Change Priority in Route tickets
+ ('Ticket', 'deliveryNoteCsv', 'READ', 'ALLOW', 'ROLE', 'employee');
+
+DELETE FROM `salix`.`ACL`
+ WHERE
+ model = 'State'
+ AND property = '*'
+ AND accessType = 'READ';
+
+INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`)
+ VALUES
+ ('State', 'find', 'READ', 'ALLOW', 'ROLE', 'employee'),
+ ('State', 'findById', 'READ', 'ALLOW', 'ROLE', 'employee'),
+ ('State', 'findOne', 'READ', 'ALLOW', 'ROLE', 'employee');
+
+DELETE FROM `salix`.`ACL`
+ WHERE
+ model = 'Worker'
+ AND property = '*'
+ AND accessType = 'READ';
+
+INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`)
+ VALUES
+ ('Worker', 'find', 'READ', 'ALLOW', 'ROLE', 'employee'),
+ ('Worker', 'findById', 'READ', 'ALLOW', 'ROLE', 'employee'),
+ ('Worker', 'findOne', 'READ', 'ALLOW', 'ROLE', 'employee'),
+ ('Worker', 'filter', 'READ', 'ALLOW', 'ROLE', 'employee'),
+ ('Worker', 'getWorkedHours', 'READ', 'ALLOW', 'ROLE', 'employee'),
+ ('Worker', 'active', 'READ', 'ALLOW', 'ROLE', 'employee'),
+ ('Worker', 'activeWithRole', 'READ', 'ALLOW', 'ROLE', 'employee'),
+ ('Worker', 'uploadFile', 'WRITE', 'ALLOW', 'ROLE', 'hr'),
+ ('Worker', 'contracts', 'READ', 'ALLOW', 'ROLE', 'employee'),
+ ('Worker', 'holidays', 'READ', 'ALLOW', 'ROLE', 'employee'),
+ ('Worker', 'activeContract', 'READ', 'ALLOW', 'ROLE', 'employee'),
+ ('Worker', 'activeWithInheritedRole', 'READ', 'ALLOW', 'ROLE', 'employee');
+
+DELETE FROM `salix`.`ACL`
+ WHERE model = 'Client'
+ AND property = 'updateUser'
+ AND accessType = '*';
diff --git a/db/dump/fixtures.sql b/db/dump/fixtures.sql
index 1304a6ec7..3476bfe48 100644
--- a/db/dump/fixtures.sql
+++ b/db/dump/fixtures.sql
@@ -179,6 +179,8 @@ INSERT INTO `vn`.`printer` (`id`, `name`, `path`, `isLabeler`, `sectorFk`, `ipAd
(2, 'printer2', 'path2', 1, 1 , NULL),
(4, 'printer4', 'path4', 0, NULL, '10.1.10.4');
+UPDATE `vn`.`sector` SET mainPrinterFk = 1 WHERE id = 1;
+
INSERT INTO `vn`.`worker`(`id`, `code`, `firstName`, `lastName`, `userFk`,`bossFk`, `phone`, `sectorFk`, `labelerFk`)
VALUES
(1106, 'LGN', 'David Charles', 'Haller', 1106, 19, 432978106, NULL, NULL),
@@ -905,7 +907,7 @@ INSERT INTO `vn`.`itemFamily`(`code`, `description`)
INSERT INTO `vn`.`item`(`id`, `typeFk`, `size`, `inkFk`, `stems`, `originFk`, `description`, `producerFk`, `intrastatFk`, `expenceFk`,
`comment`, `relevancy`, `image`, `subName`, `minPrice`, `stars`, `family`, `isFloramondo`, `genericFk`, `itemPackingTypeFk`, `hasMinPrice`, `packingShelve`, `weightByPiece`)
VALUES
- (1, 2, 70, 'YEL', 1, 1, NULL, 1, 06021010, 2000000000, NULL, 0, '1', NULL, 0, 1, 'VT', 0, NULL, 'V', 0, 15,3),
+ (1, 2, 70, 'YEL', 1, 1, NULL, 1, 06021010, 2000000000, NULL, 0, '1', NULL, 0, 1, 'EMB', 0, NULL, 'V', 0, 15,3),
(2, 2, 70, 'BLU', 1, 2, NULL, 1, 06021010, 2000000000, NULL, 0, '2', NULL, 0, 2, 'VT', 0, NULL, 'H', 0, 10,2),
(3, 1, 60, 'YEL', 1, 3, NULL, 1, 05080000, 4751000000, NULL, 0, '3', NULL, 0, 5, 'VT', 0, NULL, NULL, 0, 5,5),
(4, 1, 60, 'YEL', 1, 1, 'Increases block', 1, 05080000, 4751000000, NULL, 0, '4', NULL, 0, 3, 'VT', 0, NULL, NULL, 0, NULL,NULL),
@@ -2332,26 +2334,26 @@ INSERT INTO `vn`.`workerTimeControl`(`userFk`, `timed`, `manual`, `direction`, `
INSERT INTO `vn`.`dmsType`(`id`, `name`, `path`, `readRoleFk`, `writeRoleFk`, `code`)
VALUES
- (1, 'Facturas Recibidas', 'recibidas', NULL, NULL, 'invoiceIn'),
- (2, 'Doc oficial', 'oficial', NULL, NULL, 'officialDoc'),
- (3, 'Laboral', 'laboral', 37, 37, 'hhrrData'),
- (4, 'Albaranes recibidos', 'entradas', NULL, NULL, 'deliveryNote'),
- (5, 'Otros', 'otros', 1, 1, 'miscellaneous'),
- (6, 'Pruebas', 'pruebas', NULL, NULL, 'tests'),
- (7, 'IAE Clientes', 'IAE_Clientes', 1, 1, 'economicActivitiesTax'),
- (8, 'Fiscal', 'fiscal', NULL, NULL, 'fiscal'),
- (9, 'Vehiculos', 'vehiculos', NULL, NULL, 'vehicles'),
- (10, 'Plantillas', 'plantillas', NULL, NULL, 'templates'),
- (11, 'Contratos', 'contratos', NULL, NULL, 'contracts'),
- (12, 'ley de pagos', 'ley pagos', 1, 1, 'paymentsLaw'),
- (13, 'Basura', 'basura', 1, 1, 'trash'),
- (14, 'Ticket', 'tickets', 1, 1, 'ticket'),
- (15, 'Presupuestos', 'Presupuestos', NULL, NULL, 'budgets'),
- (16, 'Logistica', 'logistica', NULL, NULL, 'logistics'),
- (17, 'cmr', 'cmr', NULL, NULL, 'cmr'),
- (18, 'dua', 'dua', NULL, NULL, 'dua'),
- (19, 'inmovilizado', 'inmovilizado', NULL, NULL, 'fixedAssets'),
- (20, 'Reclamación', 'reclamacion', 1, 1, 'claim');
+ (1, 'Facturas Recibidas', 'recibidas', NULL, NULL, 'invoiceIn'),
+ (2, 'Doc oficial', 'oficial', NULL, NULL, 'officialDoc'),
+ (3, 'Laboral', 'laboral', 37, 37, 'hhrrData'),
+ (4, 'Albaranes recibidos', 'entradas', NULL, NULL, 'deliveryNote'),
+ (5, 'Otros', 'otros', 1, 1, 'miscellaneous'),
+ (6, 'Pruebas', 'pruebas', NULL, NULL, 'tests'),
+ (7, 'IAE Clientes', 'IAE_Clientes', 1, 1, 'economicActivitiesTax'),
+ (8, 'Fiscal', 'fiscal', NULL, NULL, 'fiscal'),
+ (9, 'Vehiculos', 'vehiculos', NULL, NULL, 'vehicles'),
+ (10, 'Plantillas', 'plantillas', NULL, NULL, 'templates'),
+ (11, 'Contratos', 'contratos', NULL, NULL, 'contracts'),
+ (12, 'ley de pagos', 'ley pagos', 1, 1, 'paymentsLaw'),
+ (13, 'Basura', 'basura', 1, 1, 'trash'),
+ (14, 'Ticket', 'tickets', 1, 1, 'ticket'),
+ (15, 'Presupuestos', 'Presupuestos', NULL, NULL, 'budgets'),
+ (16, 'Logistica', 'logistica', NULL, NULL, 'logistics'),
+ (17, 'cmr', 'cmr', NULL, NULL, 'cmr'),
+ (18, 'dua', 'dua', NULL, NULL, 'dua'),
+ (19, 'inmovilizado', 'inmovilizado', NULL, NULL, 'fixedAssets'),
+ (20, 'Reclamación', 'reclamacion', 1, 1, 'claim');
INSERT INTO `vn`.`dms`(`id`, `dmsTypeFk`, `file`, `contentType`, `workerFk`, `warehouseFk`, `companyFk`, `hardCopyNumber`, `hasFile`, `reference`, `description`, `created`)
VALUES
@@ -2729,6 +2731,7 @@ INSERT INTO `util`.`notification` (`id`, `name`, `description`)
VALUES
(1, 'print-email', 'notification fixture one'),
(2, 'invoice-electronic', 'A electronic invoice has been generated'),
+ (3, 'not-main-printer-configured', 'A printer distinct than main has been configured'),
(4, 'supplier-pay-method-update', 'A supplier pay method has been updated');
INSERT INTO `util`.`notificationAcl` (`notificationFk`, `roleFk`)
@@ -2886,6 +2889,10 @@ INSERT INTO `vn`.`wagonTypeTray` (`id`, `typeFk`, `height`, `colorFk`)
(2, 1, 50, 2),
(3, 1, 0, 3);
+INSERT INTO `vn`.`travelConfig` (`id`, `warehouseInFk`, `warehouseOutFk`, `agencyFk`, `companyFk`)
+ VALUES
+ (1, 1, 1, 1, 442);
-
-
+INSERT INTO `vn`.`buyConfig` (`id`, `monthsAgo`)
+ VALUES
+ (1, 6);
diff --git a/db/dump/structure.sql b/db/dump/structure.sql
index cbb1e39c8..3ce7f7bb5 100644
--- a/db/dump/structure.sql
+++ b/db/dump/structure.sql
@@ -61950,7 +61950,6 @@ BEGIN
* @vWarehouseFk almacen donde buscar
* @vDate Si la fecha es null, muestra el histórico desde el inventario. Si la fecha no es null, muestra histórico desde la fecha pasada.
*/
-
DECLARE vDateInventory DATETIME;
DECLARE vInvCalculated INT;
diff --git a/docker-compose.yml b/docker-compose.yml
index 13a7bc751..0d2db1a63 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -43,7 +43,7 @@ services:
- node.role == worker
resources:
limits:
- memory: 4G
+ memory: 8G
configs:
datasources:
external: true
diff --git a/e2e/helpers/puppeteer.js b/e2e/helpers/puppeteer.js
index abd76b434..ac4f6cc02 100644
--- a/e2e/helpers/puppeteer.js
+++ b/e2e/helpers/puppeteer.js
@@ -22,7 +22,8 @@ export async function getBrowser() {
env.E2E_SHOW = true;
}
- const headless = !env.E2E_SHOW;
+ const headless = env.E2E_SHOW ? false : 'new';
+
const browser = await Puppeteer.launch({
args,
defaultViewport: null,
diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js
index 65d446790..fff0a2f15 100644
--- a/e2e/helpers/selectors.js
+++ b/e2e/helpers/selectors.js
@@ -627,6 +627,7 @@ export default {
selectAllSalesCheckbox: 'vn-ticket-sale vn-thead vn-check',
secondSaleCheckbox: 'vn-ticket-sale vn-tr:nth-child(2) vn-check[ng-model="sale.checked"]',
thirdSaleCheckbox: 'vn-ticket-sale vn-tr:nth-child(3) vn-check[ng-model="sale.checked"]',
+ fourthSaleCheckbox: 'vn-ticket-sale vn-tr:nth-child(4) vn-check[ng-model="sale.checked"]',
deleteSaleButton: 'vn-ticket-sale vn-tool-bar > vn-button[icon="delete"]',
transferSaleButton: 'vn-ticket-sale vn-tool-bar > vn-button[icon="call_split"]',
moveToTicketInput: 'form vn-input-number[ng-model="$ctrl.transfer.ticketId"] input',
diff --git a/e2e/paths/01-salix/03_smartTable_searchBar_integrations.spec.js b/e2e/paths/01-salix/03_smartTable_searchBar_integrations.spec.js
index c4f091d1f..526afa140 100644
--- a/e2e/paths/01-salix/03_smartTable_searchBar_integrations.spec.js
+++ b/e2e/paths/01-salix/03_smartTable_searchBar_integrations.spec.js
@@ -64,6 +64,6 @@ describe('SmartTable SearchBar integration', () => {
await page.reload({
waitUntil: 'networkidle2'
});
- await page.waitForTextInField(selectors.itemFixedPrice.firstItemID, '13');
+ await page.waitForTextInField(selectors.itemFixedPrice.firstItemID, '3');
});
});
diff --git a/e2e/paths/04-item/13_fixedPrice.spec.js b/e2e/paths/04-item/13_fixedPrice.spec.js
index 37c4401b0..f36138e18 100644
--- a/e2e/paths/04-item/13_fixedPrice.spec.js
+++ b/e2e/paths/04-item/13_fixedPrice.spec.js
@@ -88,7 +88,8 @@ describe('Item fixed prices path', () => {
it('should reload the section and check the created price has the expected ID', async() => {
await page.goto(`http://localhost:5000/#!/item/fixed-price`);
-
+ await page.autocompleteSearch($.warehouseFilter, 'Warehouse one');
+ await page.click($.chip);
const result = await page.waitToGetProperty($.fourthItemID, 'value');
expect(result).toContain('13');
diff --git a/e2e/paths/05-ticket/01-sale/02_edit_sale.spec.js b/e2e/paths/05-ticket/01-sale/02_edit_sale.spec.js
index 8699ee002..6264073f6 100644
--- a/e2e/paths/05-ticket/01-sale/02_edit_sale.spec.js
+++ b/e2e/paths/05-ticket/01-sale/02_edit_sale.spec.js
@@ -261,7 +261,6 @@ describe('Ticket Edit sale path', () => {
await page.waitToClick(selectors.ticketSales.moreMenu);
await page.waitToClick(selectors.ticketSales.moreMenuCreateClaim);
await page.waitToClick(selectors.globalItems.acceptButton);
- await page.waitToClick(selectors.globalItems.acceptButton);
await page.waitForState('claim.card.basicData');
});
@@ -327,7 +326,7 @@ describe('Ticket Edit sale path', () => {
it('should confirm the transfered quantity is the correct one', async() => {
const result = await page.waitToGetProperty(selectors.ticketSales.secondSaleQuantityCell, 'innerText');
- expect(result).toContain('10');
+ expect(result).toContain('20');
});
it('should go back to the original ticket sales section', async() => {
diff --git a/e2e/paths/05-ticket/21_future.spec.js b/e2e/paths/05-ticket/21_future.spec.js
index 82525c1db..c854dcbaf 100644
--- a/e2e/paths/05-ticket/21_future.spec.js
+++ b/e2e/paths/05-ticket/21_future.spec.js
@@ -1,8 +1,7 @@
import selectors from '../../helpers/selectors.js';
import getBrowser from '../../helpers/puppeteer';
-// 'https:// redmine.verdnatura.es/issues/5642'
-xdescribe('Ticket Future path', () => {
+describe('Ticket Future path', () => {
let browser;
let page;
let httpRequest;
@@ -22,7 +21,7 @@ xdescribe('Ticket Future path', () => {
await browser.close();
});
- it('should show errors snackbar because of the required data', async() => {
+ it('should search with required data, check three last tickets and move to the future', async() => {
await page.waitToClick(selectors.ticketFuture.openAdvancedSearchButton);
await page.clearInput(selectors.ticketFuture.warehouseFk);
await page.waitToClick(selectors.ticketFuture.submit);
@@ -43,69 +42,58 @@ xdescribe('Ticket Future path', () => {
message = await page.waitForSnackbar();
expect(message.text).toContain('originDated is a required argument');
+
+ await page.waitToClick(selectors.ticketFuture.openAdvancedSearchButton);
+ await page.waitToClick(selectors.ticketFuture.submit);
+
+ expect(httpRequest).toBeDefined();
+
+ await page.waitToClick(selectors.ticketFuture.openAdvancedSearchButton);
+
+ await page.autocompleteSearch(selectors.ticketFuture.ipt, 'H');
+ await page.waitToClick(selectors.ticketFuture.submit);
+
+ expect(httpRequest).toContain('ipt=H');
+
+ await page.waitToClick(selectors.ticketFuture.openAdvancedSearchButton);
+
+ await page.clearInput(selectors.ticketFuture.ipt);
+
+ await page.autocompleteSearch(selectors.ticketFuture.futureIpt, 'H');
+ await page.waitToClick(selectors.ticketFuture.submit);
+
+ expect(httpRequest).toContain('futureIpt=H');
+
+ await page.waitToClick(selectors.ticketFuture.openAdvancedSearchButton);
+
+ await page.clearInput(selectors.ticketFuture.futureIpt);
+
+ await page.autocompleteSearch(selectors.ticketFuture.state, 'Free');
+ await page.waitToClick(selectors.ticketFuture.submit);
+
+ expect(httpRequest).toContain('state=FREE');
+
+ await page.waitToClick(selectors.ticketFuture.openAdvancedSearchButton);
+
+ await page.clearInput(selectors.ticketFuture.state);
+
+ await page.autocompleteSearch(selectors.ticketFuture.futureState, 'Free');
+ await page.waitToClick(selectors.ticketFuture.submit);
+
+ expect(httpRequest).toContain('futureState=FREE');
+
+ await page.waitToClick(selectors.ticketFuture.openAdvancedSearchButton);
+ await page.clearInput(selectors.ticketFuture.state);
+ await page.clearInput(selectors.ticketFuture.futureState);
+ await page.waitToClick(selectors.ticketFuture.submit);
+
+ await page.waitForNumberOfElements(selectors.ticketFuture.searchResult, 4);
+ await page.waitToClick(selectors.ticketFuture.multiCheck);
+ await page.waitToClick(selectors.ticketFuture.firstCheck);
+ await page.waitToClick(selectors.ticketFuture.moveButton);
+ await page.waitToClick(selectors.globalItems.acceptButton);
+ message = await page.waitForSnackbar();
+
+ expect(message.text).toContain('Tickets moved successfully!');
});
-
- // it('should search with the required data', async() => {
- // await page.waitToClick(selectors.ticketFuture.openAdvancedSearchButton);
- // await page.waitToClick(selectors.ticketFuture.submit);
-
- // expect(httpRequest).toBeDefined();
- // });
-
- // it('should search with the origin IPT', async() => {
- // await page.waitToClick(selectors.ticketFuture.openAdvancedSearchButton);
-
- // await page.autocompleteSearch(selectors.ticketFuture.ipt, 'H');
- // await page.waitToClick(selectors.ticketFuture.submit);
-
- // expect(httpRequest).toContain('ipt=H');
- // });
-
- // it('should search with the destination IPT', async() => {
- // await page.waitToClick(selectors.ticketFuture.openAdvancedSearchButton);
-
- // await page.clearInput(selectors.ticketFuture.ipt);
-
- // await page.autocompleteSearch(selectors.ticketFuture.futureIpt, 'H');
- // await page.waitToClick(selectors.ticketFuture.submit);
-
- // expect(httpRequest).toContain('futureIpt=H');
- // });
-
- // it('should search with the origin grouped state', async() => {
- // await page.waitToClick(selectors.ticketFuture.openAdvancedSearchButton);
-
- // await page.clearInput(selectors.ticketFuture.futureIpt);
-
- // await page.autocompleteSearch(selectors.ticketFuture.state, 'Free');
- // await page.waitToClick(selectors.ticketFuture.submit);
-
- // expect(httpRequest).toContain('state=FREE');
- // });
-
- // it('should search with the destination grouped state', async() => {
- // await page.waitToClick(selectors.ticketFuture.openAdvancedSearchButton);
-
- // await page.clearInput(selectors.ticketFuture.state);
-
- // await page.autocompleteSearch(selectors.ticketFuture.futureState, 'Free');
- // await page.waitToClick(selectors.ticketFuture.submit);
-
- // expect(httpRequest).toContain('futureState=FREE');
-
- // await page.waitToClick(selectors.ticketFuture.openAdvancedSearchButton);
- // await page.clearInput(selectors.ticketFuture.futureState);
- // await page.waitToClick(selectors.ticketFuture.submit);
- // });
-
- // it('should check the three last tickets and move to the future', async() => {
- // await page.waitForNumberOfElements(selectors.ticketFuture.searchResult, 4);
- // await page.waitToClick(selectors.ticketFuture.multiCheck);
- // await page.waitToClick(selectors.ticketFuture.firstCheck);
- // await page.waitToClick(selectors.ticketFuture.moveButton);
- // await page.waitToClick(selectors.globalItems.acceptButton);
- // const message = await page.waitForSnackbar();
-
- // expect(message.text).toContain('Tickets moved successfully!');
- // });
});
diff --git a/e2e/paths/05-ticket/22_advance.spec.js b/e2e/paths/05-ticket/22_advance.spec.js
index f27120b3b..0e5b5e0c3 100644
--- a/e2e/paths/05-ticket/22_advance.spec.js
+++ b/e2e/paths/05-ticket/22_advance.spec.js
@@ -1,8 +1,7 @@
import selectors from '../../helpers/selectors.js';
import getBrowser from '../../helpers/puppeteer';
-// 'https:// redmine.verdnatura.es/issues/5642'
-xdescribe('Ticket Advance path', () => {
+describe('Ticket Advance path', () => {
let browser;
let page;
let httpRequest;
@@ -22,7 +21,7 @@ xdescribe('Ticket Advance path', () => {
await browser.close();
});
- it('should show errors snackbar because of the required data', async() => {
+ it('should search with the required data, check the first ticket and move to the present', async() => {
await page.waitToClick(selectors.ticketAdvance.openAdvancedSearchButton);
await page.clearInput(selectors.ticketAdvance.warehouseFk);
@@ -44,45 +43,37 @@ xdescribe('Ticket Advance path', () => {
message = await page.waitForSnackbar();
expect(message.text).toContain('dateFuture is a required argument');
+
+ await page.waitToClick(selectors.ticketAdvance.openAdvancedSearchButton);
+ await page.waitToClick(selectors.ticketAdvance.submit);
+
+ expect(httpRequest).toBeDefined();
+
+ await page.waitToClick(selectors.ticketAdvance.openAdvancedSearchButton);
+ await page.autocompleteSearch(selectors.ticketAdvance.futureIpt, 'H');
+ await page.waitToClick(selectors.ticketAdvance.submit);
+
+ expect(httpRequest).toContain('futureIpt=H');
+
+ await page.waitToClick(selectors.ticketAdvance.openAdvancedSearchButton);
+ await page.clearInput(selectors.ticketAdvance.futureIpt);
+ await page.waitToClick(selectors.ticketAdvance.submit);
+
+ await page.waitToClick(selectors.ticketAdvance.openAdvancedSearchButton);
+ await page.autocompleteSearch(selectors.ticketAdvance.ipt, 'H');
+ await page.waitToClick(selectors.ticketAdvance.submit);
+
+ expect(httpRequest).toContain('ipt=H');
+
+ await page.waitToClick(selectors.ticketAdvance.openAdvancedSearchButton);
+ await page.clearInput(selectors.ticketAdvance.ipt);
+ await page.waitToClick(selectors.ticketAdvance.submit);
+
+ await page.waitToClick(selectors.ticketAdvance.firstCheck);
+ await page.waitToClick(selectors.ticketAdvance.moveButton);
+ await page.waitToClick(selectors.ticketAdvance.acceptButton);
+ message = await page.waitForSnackbar();
+
+ expect(message.text).toContain('Tickets moved successfully!');
});
-
- // it('should search with the required data', async() => {
- // await page.waitToClick(selectors.ticketAdvance.openAdvancedSearchButton);
- // await page.waitToClick(selectors.ticketAdvance.submit);
-
- // expect(httpRequest).toBeDefined();
- // });
-
- // it('should search with the origin IPT', async() => {
- // await page.waitToClick(selectors.ticketAdvance.openAdvancedSearchButton);
- // await page.autocompleteSearch(selectors.ticketAdvance.futureIpt, 'H');
- // await page.waitToClick(selectors.ticketAdvance.submit);
-
- // expect(httpRequest).toContain('futureIpt=H');
-
- // await page.waitToClick(selectors.ticketAdvance.openAdvancedSearchButton);
- // await page.clearInput(selectors.ticketAdvance.futureIpt);
- // await page.waitToClick(selectors.ticketAdvance.submit);
- // });
-
- // it('should search with the destination IPT', async() => {
- // await page.waitToClick(selectors.ticketAdvance.openAdvancedSearchButton);
- // await page.autocompleteSearch(selectors.ticketAdvance.ipt, 'H');
- // await page.waitToClick(selectors.ticketAdvance.submit);
-
- // expect(httpRequest).toContain('ipt=H');
-
- // await page.waitToClick(selectors.ticketAdvance.openAdvancedSearchButton);
- // await page.clearInput(selectors.ticketAdvance.ipt);
- // await page.waitToClick(selectors.ticketAdvance.submit);
- // });
-
- // it('should check the first ticket and move to the present', async() => {
- // await page.waitToClick(selectors.ticketAdvance.firstCheck);
- // await page.waitToClick(selectors.ticketAdvance.moveButton);
- // await page.waitToClick(selectors.ticketAdvance.acceptButton);
- // const message = await page.waitForSnackbar();
-
- // expect(message.text).toContain('Tickets moved successfully!');
- // });
});
diff --git a/e2e/paths/06-claim/05_summary.spec.js b/e2e/paths/06-claim/05_summary.spec.js
index 758dc2ee3..9656ea656 100644
--- a/e2e/paths/06-claim/05_summary.spec.js
+++ b/e2e/paths/06-claim/05_summary.spec.js
@@ -17,7 +17,7 @@ describe('Claim summary path', () => {
});
it('should navigate to the target claim summary section', async() => {
- await page.loginAndModule('employee', 'claim');
+ await page.loginAndModule('salesPerson', 'claim');
await page.accessToSearchResult(claimId);
await page.waitForState('claim.card.summary');
});
diff --git a/e2e/paths/06-claim/06_descriptor.spec.js b/e2e/paths/06-claim/06_descriptor.spec.js
index 0826bad63..059bd68dd 100644
--- a/e2e/paths/06-claim/06_descriptor.spec.js
+++ b/e2e/paths/06-claim/06_descriptor.spec.js
@@ -16,7 +16,7 @@ describe('Claim descriptor path', () => {
});
it('should now navigate to the target claim summary section', async() => {
- await page.loginAndModule('employee', 'claim');
+ await page.loginAndModule('salesPerson', 'claim');
await page.accessToSearchResult(claimId);
await page.waitForState('claim.card.summary');
});
diff --git a/front/salix/components/descriptor/style.scss b/front/salix/components/descriptor/style.scss
index 27f482f26..b96e900c4 100644
--- a/front/salix/components/descriptor/style.scss
+++ b/front/salix/components/descriptor/style.scss
@@ -7,22 +7,24 @@ vn-descriptor-content {
.photo {
position: relative;
+ width: 100%;
+ text-align: center;
+ overflow: hidden;
& > img[ng-src] {
min-height: 16em;
display: block;
- max-width: 100%;
height: 256px;
}
vn-float-button {
- position: absolute;
- margin: 1em;
- bottom: 0;
+ position: absolute;
+ margin: 1em;
+ bottom: 0;
right: 0
}
}
-
+
& > vn-spinner {
display: block;
height: 40px;
@@ -39,7 +41,7 @@ vn-descriptor-content {
align-items: stretch;
color: $color-font-dark;
- & > a,
+ & > a,
& > vn-icon-button {
display: flex;
min-width: 45px;
@@ -89,7 +91,7 @@ vn-descriptor-content {
display: flex;
align-items: center;
justify-content: center;
-
+
& > vn-icon {
padding: $spacing-xs $spacing-sm;
font-size: 1.5rem;
diff --git a/front/salix/components/log/index.js b/front/salix/components/log/index.js
index 7452c6636..ef1b370b5 100644
--- a/front/salix/components/log/index.js
+++ b/front/salix/components/log/index.js
@@ -150,10 +150,10 @@ export default class Controller extends Section {
if (value == null || value == '') return null;
switch (prop) {
case 'search':
- const or = [{changedModelId: value}];
- if (!/^[0-9]+$/.test(value))
- or.push({changedModelValue: {like: `%${value}%`}});
- return {or};
+ if (/^[0-9]+$/.test(value))
+ return {changedModelId: value};
+ else
+ return {changedModelValue: {like: `%${value}%`}};
case 'changes':
return {or: [
{oldInstance: {like: `%${value}%`}},
diff --git a/front/salix/components/user-popover/index.js b/front/salix/components/user-popover/index.js
index 6cc47db7d..1d88137ff 100644
--- a/front/salix/components/user-popover/index.js
+++ b/front/salix/components/user-popover/index.js
@@ -20,8 +20,6 @@ class Controller {
name: config.languages[code] ? config.languages[code] : code
});
}
-
- vnConfig.initialize();
}
set lang(value) {
diff --git a/front/salix/routes.js b/front/salix/routes.js
index f32c143ef..4cc72ec95 100644
--- a/front/salix/routes.js
+++ b/front/salix/routes.js
@@ -10,6 +10,9 @@ function config($stateProvider, $urlRouterProvider) {
.state('layout', {
abstract: true,
template: '