diff --git a/db/changes/230201/00-triggersXDiario.sql b/db/changes/230201/00-triggersXDiario.sql
new file mode 100644
index 000000000..5cf0b6253
--- /dev/null
+++ b/db/changes/230201/00-triggersXDiario.sql
@@ -0,0 +1,73 @@
+DROP TRIGGER IF EXISTS vn.XDiario_beforeUpdate;
+USE vn;
+
+DELIMITER $$
+$$
+CREATE DEFINER=`root`@`localhost` TRIGGER `vn`.`XDiario_beforeUpdate`
+ BEFORE UPDATE ON `XDiario`
+ FOR EACH ROW
+BEGIN
+ IF NOT NEW.SUBCTA <=> OLD.SUBCTA THEN
+ IF NEW.SUBCTA <=> '' THEN
+ SET NEW.SUBCTA = NULL;
+ END IF;
+ IF NEW.SUBCTA IS NOT NULL AND NOT LENGTH(NEW.SUBCTA) <=> 10 THEN
+ CALL util.throw('INVALID_STRING_LENGTH');
+ END IF;
+ END IF;
+ IF NOT NEW.CONTRA <=> OLD.CONTRA THEN
+ IF NEW.CONTRA <=> '' THEN
+ SET NEW.CONTRA = NULL;
+ END IF;
+ IF NEW.CONTRA IS NOT NULL AND NOT LENGTH(NEW.CONTRA) <=> 10 THEN
+ CALL util.throw('INVALID_STRING_LENGTH');
+ END IF;
+ END IF;
+ IF NOT NEW.FECHA <=> OLD.FECHA THEN
+ CALL XDiario_checkDate(NEW.FECHA);
+ END IF;
+ IF NOT NEW.FECHA_EX <=> OLD.FECHA_EX THEN
+ CALL XDiario_checkDate(NEW.FECHA_EX);
+ END IF;
+ IF NOT NEW.FECHA_OP <=> OLD.FECHA_OP THEN
+ CALL XDiario_checkDate(NEW.FECHA_OP);
+ END IF;
+ IF NOT NEW.FECHA_RT <=> OLD.FECHA_RT THEN
+ CALL XDiario_checkDate(NEW.FECHA_RT);
+ END IF;
+ IF NOT NEW.FECREGCON <=> OLD.FECREGCON THEN
+ CALL XDiario_checkDate(NEW.FECREGCON);
+ END IF;
+END$$
+DELIMITER ;
+
+
+DROP TRIGGER IF EXISTS vn.XDiario_beforeInsert;
+USE vn;
+
+DELIMITER $$
+$$
+CREATE DEFINER=`root`@`localhost` TRIGGER `vn`.`XDiario_beforeInsert`
+ BEFORE INSERT ON `XDiario`
+ FOR EACH ROW
+BEGIN
+ IF NEW.SUBCTA <=> '' THEN
+ SET NEW.SUBCTA = NULL;
+ END IF;
+ IF NEW.SUBCTA IS NOT NULL AND NOT LENGTH(NEW.SUBCTA) <=> 10 THEN
+ CALL util.throw('INVALID_STRING_LENGTH');
+ END IF;
+ IF NEW.CONTRA <=> '' THEN
+ SET NEW.CONTRA = NULL;
+ END IF;
+ IF NEW.CONTRA IS NOT NULL AND NOT LENGTH(NEW.CONTRA) <=> 10 THEN
+ CALL util.throw('INVALID_STRING_LENGTH');
+ END IF;
+ CALL XDiario_checkDate(NEW.FECHA);
+ CALL XDiario_checkDate(NEW.FECHA_EX);
+ CALL XDiario_checkDate(NEW.FECHA_OP);
+ CALL XDiario_checkDate(NEW.FECHA_RT);
+ CALL XDiario_checkDate(NEW.FECREGCON);
+END$$
+DELIMITER ;
+
diff --git a/db/dump/structure.sql b/db/dump/structure.sql
index 47fdd6d74..4626279e4 100644
--- a/db/dump/structure.sql
+++ b/db/dump/structure.sql
@@ -80202,3 +80202,4 @@ USE `vncontrol`;
-- Dump completed on 2022-11-21 7:57:28
+
diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js
index 052d8a480..b8f0813ed 100644
--- a/e2e/helpers/selectors.js
+++ b/e2e/helpers/selectors.js
@@ -679,7 +679,10 @@ export default {
moveToTicketButton: '.vn-popover.shown vn-icon[icon="arrow_forward_ios"]',
moveToNewTicketButton: '.vn-popover.shown vn-button[label="New ticket"]',
stateMenuButton: 'vn-ticket-sale vn-tool-bar > vn-button-menu[label="State"]',
- moreMenuState: 'body > div > div > div.content > div.filter.ng-scope > vn-textfield'
+ moreMenuState: 'body > div > div > div.content > div.filter.ng-scope > vn-textfield',
+ firstSaleHistoryButton: 'vn-ticket-sale vn-tr:nth-child(1) vn-icon-button[icon="history"]',
+ firstSaleHistory: 'form vn-table div > vn-tbody > vn-tr',
+ closeHistory: 'div.window vn-button[icon="clear"]'
},
ticketTracking: {
createStateButton: 'vn-float-button'
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 67dfd83bf..9d6fddbe6 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
@@ -196,6 +196,15 @@ describe('Ticket Edit sale path', () => {
expect(result).toContain('22.50');
});
+ it('should check in the history that logs has been added', async() => {
+ await page.waitToClick(selectors.ticketSales.firstSaleHistoryButton);
+ await page.waitForSelector(selectors.ticketSales.firstSaleHistory);
+ const result = await page.countElement(selectors.ticketSales.firstSaleHistory);
+
+ expect(result).toBeGreaterThan(0);
+ await page.waitToClick(selectors.ticketSales.closeHistory);
+ });
+
it('should recalculate price of sales', async() => {
await page.waitToClick(selectors.ticketSales.firstSaleCheckbox);
await page.waitToClick(selectors.ticketSales.secondSaleCheckbox);
diff --git a/e2e/paths/05-ticket/21_future.spec.js b/e2e/paths/05-ticket/21_future.spec.js
index 45c39de86..34ae3d688 100644
--- a/e2e/paths/05-ticket/21_future.spec.js
+++ b/e2e/paths/05-ticket/21_future.spec.js
@@ -55,7 +55,7 @@ describe('Ticket Future path', () => {
await page.autocompleteSearch(selectors.ticketFuture.ipt, 'Horizontal');
await page.waitToClick(selectors.ticketFuture.submit);
- await page.waitForNumberOfElements(selectors.ticketFuture.table, 0);
+ await page.waitForNumberOfElements(selectors.ticketFuture.table, 4);
});
it('should search with the destination IPT', async() => {
@@ -68,7 +68,7 @@ describe('Ticket Future path', () => {
await page.autocompleteSearch(selectors.ticketFuture.futureIpt, 'Horizontal');
await page.waitToClick(selectors.ticketFuture.submit);
- await page.waitForNumberOfElements(selectors.ticketFuture.table, 0);
+ await page.waitForNumberOfElements(selectors.ticketFuture.table, 4);
});
it('should search with the origin grouped state', async() => {
@@ -152,50 +152,6 @@ describe('Ticket Future path', () => {
await page.waitForNumberOfElements(selectors.ticketFuture.table, 4);
});
- it('should search in smart-table with especified Lines', async() => {
- await page.waitToClick(selectors.ticketFuture.tableButtonSearch);
- await page.write(selectors.ticketFuture.tableLines, '0');
- await page.keyboard.press('Enter');
- await page.waitForNumberOfElements(selectors.ticketFuture.table, 1);
-
- await page.waitToClick(selectors.ticketFuture.tableButtonSearch);
- await page.waitToClick(selectors.ticketFuture.openAdvancedSearchButton);
- await page.waitToClick(selectors.ticketFuture.submit);
- await page.waitForNumberOfElements(selectors.ticketFuture.table, 4);
-
- await page.waitToClick(selectors.ticketFuture.tableButtonSearch);
- await page.write(selectors.ticketFuture.tableLines, '1');
- await page.keyboard.press('Enter');
- await page.waitForNumberOfElements(selectors.ticketFuture.table, 5);
-
- await page.waitToClick(selectors.ticketFuture.tableButtonSearch);
- await page.waitToClick(selectors.ticketFuture.openAdvancedSearchButton);
- await page.waitToClick(selectors.ticketFuture.submit);
- await page.waitForNumberOfElements(selectors.ticketFuture.table, 4);
- });
-
- it('should search in smart-table with especified Liters', async() => {
- await page.waitToClick(selectors.ticketFuture.tableButtonSearch);
- await page.write(selectors.ticketFuture.tableLiters, '0');
- await page.keyboard.press('Enter');
- await page.waitForNumberOfElements(selectors.ticketFuture.table, 1);
-
- await page.waitToClick(selectors.ticketFuture.tableButtonSearch);
- await page.waitToClick(selectors.ticketFuture.openAdvancedSearchButton);
- await page.waitToClick(selectors.ticketFuture.submit);
- await page.waitForNumberOfElements(selectors.ticketFuture.table, 4);
-
- await page.waitToClick(selectors.ticketFuture.tableButtonSearch);
- await page.write(selectors.ticketFuture.tableLiters, '28');
- await page.keyboard.press('Enter');
- await page.waitForNumberOfElements(selectors.ticketFuture.table, 5);
-
- await page.waitToClick(selectors.ticketFuture.tableButtonSearch);
- await page.waitToClick(selectors.ticketFuture.openAdvancedSearchButton);
- await page.waitToClick(selectors.ticketFuture.submit);
- await page.waitForNumberOfElements(selectors.ticketFuture.table, 4);
- });
-
it('should check the three last tickets and move to the future', async() => {
await page.waitToClick(selectors.ticketFuture.multiCheck);
await page.waitToClick(selectors.ticketFuture.firstCheck);
diff --git a/front/salix/components/index.js b/front/salix/components/index.js
index f6727fadf..8f5724862 100644
--- a/front/salix/components/index.js
+++ b/front/salix/components/index.js
@@ -19,4 +19,5 @@ import './user-popover';
import './upload-photo';
import './bank-entity';
import './log';
+import './instance-log';
import './sendSms';
diff --git a/front/salix/components/instance-log/index.html b/front/salix/components/instance-log/index.html
new file mode 100644
index 000000000..354e81080
--- /dev/null
+++ b/front/salix/components/instance-log/index.html
@@ -0,0 +1,12 @@
+
+