diff --git a/back/helpers.spec.js b/back/helpers.spec.js new file mode 100644 index 000000000..ba8936d41 --- /dev/null +++ b/back/helpers.spec.js @@ -0,0 +1,5 @@ +const baseTime = null; // new Date(2022, 0, 19, 8, 0, 0, 0); +if (baseTime) { + jasmine.clock().install(); + jasmine.clock().mockDate(baseTime); +} diff --git a/back/methods/account/set-password.js b/back/methods/account/set-password.js index fc54b5abe..ab4d3b3fe 100644 --- a/back/methods/account/set-password.js +++ b/back/methods/account/set-password.js @@ -1,16 +1,15 @@ - module.exports = Self => { Self.remoteMethod('setPassword', { description: 'Sets the user password', accepts: [ { arg: 'id', - type: 'Number', + type: 'number', description: 'The user id', http: {source: 'path'} }, { arg: 'newPassword', - type: 'String', + type: 'string', description: 'The new password', required: true } diff --git a/back/methods/edi/updateData.js b/back/methods/edi/updateData.js index 121e96778..3dae2d47d 100644 --- a/back/methods/edi/updateData.js +++ b/back/methods/edi/updateData.js @@ -200,6 +200,31 @@ module.exports = Self => { const toTable = table.toTable; const baseName = table.fileName; + const firstEntry = entries[0]; + const entryName = firstEntry.entryName; + const startIndex = (entryName.length - 10); + const endIndex = (entryName.length - 4); + const dateString = entryName.substring(startIndex, endIndex); + + const lastUpdated = new Date(); + + let updated = null; + if (file.updated) { + updated = new Date(file.updated); + updated.setHours(0, 0, 0, 0); + } + + // Format string date to a date object + lastUpdated.setFullYear(`20${dateString.substring(4, 6)}`); + lastUpdated.setMonth(parseInt(dateString.substring(2, 4)) - 1); + lastUpdated.setDate(dateString.substring(0, 2)); + lastUpdated.setHours(0, 0, 0, 0); + + if (updated && lastUpdated <= updated) { + console.debug(`Table ${toTable} already updated, skipping...`); + return; + } + const tx = await Self.beginTransaction({}); try { diff --git a/db/Dockerfile b/db/Dockerfile index 8980c34f4..c7be72a23 100644 --- a/db/Dockerfile +++ b/db/Dockerfile @@ -31,11 +31,13 @@ COPY \ import-changes.sh \ config.ini \ dump/mysqlPlugins.sql \ + dump/mockDate.sql \ dump/structure.sql \ dump/dumpedFixtures.sql \ ./ RUN gosu mysql docker-init.sh \ && docker-dump.sh mysqlPlugins \ + && docker-dump.sh mockDate \ && docker-dump.sh structure \ && docker-dump.sh dumpedFixtures \ && gosu mysql docker-temp-stop.sh diff --git a/db/changes/10470-family/00-aclMdb.sql b/db/changes/10470-family/00-aclMdb.sql index c57f60eb3..b02ddc451 100644 --- a/db/changes/10470-family/00-aclMdb.sql +++ b/db/changes/10470-family/00-aclMdb.sql @@ -1,14 +1,14 @@ -CREATE TABLE `vn`.`mdbBranch` ( +CREATE TABLE IF NOT EXISTS `vn`.`mdbBranch` ( `name` VARCHAR(255), PRIMARY KEY(`name`) ); -CREATE TABLE `vn`.`mdbVersion` ( +CREATE TABLE IF NOT EXISTS `vn`.`mdbVersion` ( `app` VARCHAR(255) NOT NULL, `branchFk` VARCHAR(255) NOT NULL, `version` INT, CONSTRAINT `mdbVersion_branchFk` FOREIGN KEY (`branchFk`) REFERENCES `vn`.`mdbBranch` (`name`) ON DELETE CASCADE ON UPDATE CASCADE ); -INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) - VALUES('MdbVersion', '*', '*', 'ALLOW', 'ROLE', 'developer'); +INSERT IGNORE INTO `salix`.`ACL` (`id`, `model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) + VALUES(318, 'MdbVersion', '*', '*', 'ALLOW', 'ROLE', 'developer'); diff --git a/db/changes/10480-june/00-creditInsurance.sql b/db/changes/10470-family/00-creditInsurance.sql similarity index 100% rename from db/changes/10480-june/00-creditInsurance.sql rename to db/changes/10470-family/00-creditInsurance.sql diff --git a/db/changes/10480-june/01-creditInsuranceTriggers.sql b/db/changes/10470-family/01-creditInsuranceTriggers.sql similarity index 100% rename from db/changes/10480-june/01-creditInsuranceTriggers.sql rename to db/changes/10470-family/01-creditInsuranceTriggers.sql diff --git a/db/changes/10480-june/00-ACL.sql b/db/changes/10480-june/00-ACL.sql new file mode 100644 index 000000000..3236ff1fd --- /dev/null +++ b/db/changes/10480-june/00-ACL.sql @@ -0,0 +1,4 @@ +INSERT INTO `salix`.`ACL` (model,property,accessType,permission,principalType,principalId) + VALUES + ('Client','setPassword','WRITE','ALLOW','ROLE','salesPerson'), + ('Client','updateUser','WRITE','ALLOW','ROLE','salesPerson'); diff --git a/db/changes/10481-june/delete.keep b/db/changes/10481-june/delete.keep deleted file mode 100644 index e69de29bb..000000000 diff --git a/db/dump/fixtures.sql b/db/dump/fixtures.sql index 08ff96eef..23ed8a86c 100644 --- a/db/dump/fixtures.sql +++ b/db/dump/fixtures.sql @@ -1,6 +1,9 @@ CREATE SCHEMA IF NOT EXISTS `vn2008`; CREATE SCHEMA IF NOT EXISTS `tmp`; +UPDATE `util`.`config` + SET `environment`= 'test'; + ALTER TABLE `vn`.`itemTaxCountry` AUTO_INCREMENT = 1; ALTER TABLE `vn`.`address` AUTO_INCREMENT = 1; ALTER TABLE `vn`.`zoneGeo` AUTO_INCREMENT = 1; @@ -8,8 +11,7 @@ ALTER TABLE `vn`.`ticket` AUTO_INCREMENT = 1; INSERT INTO `salix`.`AccessToken` (`id`, `ttl`, `created`, `userId`) VALUES - ('DEFAULT_TOKEN', '1209600', CURDATE(), 66); - + ('DEFAULT_TOKEN', '1209600', util.VN_CURDATE(), 66); INSERT INTO `vn`.`ticketConfig` (`id`, `scopeDays`) VALUES @@ -135,7 +137,7 @@ INSERT INTO `vn`.`country`(`id`, `country`, `isUeeMember`, `code`, `currencyFk`, INSERT INTO `vn`.`warehouseAlias`(`id`, `name`) VALUES (1, 'Main Warehouse'), - (2, 'Silla'); + (2, 'Gotham'); INSERT INTO `vn`.`warehouse`(`id`, `name`, `code`, `isComparative`, `isInventory`, `hasAvailable`, `isManaged`, `hasStowaway`, `hasDms`, `hasComission`, `aliasFk`, `countryFk`, `hasProduction`) VALUES @@ -197,8 +199,8 @@ INSERT INTO `vn`.`agency`(`id`, `name`, `warehouseFk`, `isVolumetric`, `bankFk`, (4, 'Entanglement' , 1, 0, 1, 1), (5, 'Quantum break device' , 1, 0, 1, 1), (6, 'Walking' , 1, 0, 1, 1), - (7, 'Silla247' , 1, 0, 1, 1), - (8, 'Silla247Expensive' , 1, 0, 1, 1), + (7, 'Gotham247' , 1, 0, 1, 1), + (8, 'Gotham247Expensive' , 1, 0, 1, 1), (9, 'Refund' , 1, 0, 1, 1), (10, 'Other agency' , 1, 0, 1, 1); @@ -208,8 +210,8 @@ UPDATE `vn`.`agencyMode` SET `id` = 3 WHERE `name` = 'Teleportation device'; UPDATE `vn`.`agencyMode` SET `id` = 4 WHERE `name` = 'Entanglement'; UPDATE `vn`.`agencyMode` SET `id` = 5 WHERE `name` = 'Quantum break device'; UPDATE `vn`.`agencyMode` SET `id` = 6 WHERE `name` = 'Walking'; -UPDATE `vn`.`agencyMode` SET `id` = 7 WHERE `name` = 'Silla247'; -UPDATE `vn`.`agencyMode` SET `id` = 8 WHERE `name` = 'Silla247Expensive'; +UPDATE `vn`.`agencyMode` SET `id` = 7 WHERE `name` = 'Gotham247'; +UPDATE `vn`.`agencyMode` SET `id` = 8 WHERE `name` = 'Gotham247Expensive'; UPDATE `vn`.`agencyMode` SET `id` = 23 WHERE `name` = 'Refund'; UPDATE `vn`.`agencyMode` SET `id` = 10 WHERE `name` = 'Other agency'; @@ -261,7 +263,7 @@ INSERT INTO `vn`.`province`(`id`, `name`, `countryFk`, `autonomyFk`, `warehouseF INSERT INTO `vn`.`town`(`id`, `name`, `provinceFk`) VALUES (1, 'Valencia', 1), - (2, 'Silla', 1), + (2, 'Gotham', 1), (3, 'Algemesi', 1), (4, 'Alzira', 1), (5, 'Quito', 5); @@ -295,30 +297,30 @@ INSERT INTO `vn`.`contactChannel`(`id`, `name`) INSERT INTO `vn`.`client`(`id`,`name`,`fi`,`socialName`,`contact`,`street`,`city`,`postcode`,`phone`,`mobile`,`isRelevant`,`email`,`iban`,`dueDay`,`accountingAccount`,`isEqualizated`,`provinceFk`,`hasToInvoice`,`credit`,`countryFk`,`isActive`,`gestdocFk`,`quality`,`payMethodFk`,`created`,`isToBeMailed`,`contactChannelFk`,`hasSepaVnl`,`hasCoreVnl`,`hasCoreVnh`,`riskCalculated`,`clientTypeFk`,`mailAddress`,`hasToInvoiceByAddress`,`isTaxDataChecked`,`isFreezed`,`creditInsurance`,`isCreatedAsServed`,`hasInvoiceSimplified`,`salesPersonFk`,`isVies`,`eypbc`, `businessTypeFk`) VALUES - (1101, 'Bruce Wayne', '84612325V', 'Batman', 'Alfred', '1007 Mountain Drive, Gotham', 'Silla', 46460, 1111111111, 222222222, 1, 'BruceWayne@mydomain.com', NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, NULL, 10, 5,CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 1, 1, 0, NULL, 0, 0, 18, 0, 1, 'florist'), - (1102, 'Petter Parker', '87945234L', 'Spider man', 'Aunt May', '20 Ingram Street, Queens, USA', 'Silla', 46460, 1111111111, 222222222, 1, 'PetterParker@mydomain.com', NULL, 0, 1234567890, 0, 2, 1, 300, 1, 1, NULL, 10, 5,CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 1, 1, 0, NULL, 0, 0, 18, 0, 1, 'florist'), - (1103, 'Clark Kent', '06815934E', 'Super man', 'lois lane', '344 Clinton Street, Apartament 3-D', 'Silla', 46460, 1111111111, 222222222, 1, 'ClarkKent@mydomain.com', NULL, 0, 1234567890, 0, 3, 1, 0, 19, 1, NULL, 10, 5,CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 1, 1, 0, NULL, 0, 0, 18, 0, 1, 'florist'), - (1104, 'Tony Stark', '06089160W', 'Iron man', 'Pepper Potts', '10880 Malibu Point, 90265', 'Silla', 46460, 1111111111, 222222222, 1, 'TonyStark@mydomain.com', NULL, 0, 1234567890, 0, 2, 1, 300, 1, 1, NULL, 10, 5,CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 1, 1, 0, NULL, 0, 0, 18, 0, 1, 'florist'), - (1105, 'Max Eisenhardt', '251628698', 'Magneto', 'Rogue', 'Unknown Whereabouts', 'Silla', 46460, 1111111111, 222222222, 1, 'MaxEisenhardt@mydomain.com', NULL, 0, 1234567890, 0, 3, 1, 300, 8, 1, NULL, 10, 5,CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 1, 1, 1, NULL, 0, 0, 18, 0, 1, 'florist'), - (1106, 'DavidCharlesHaller', '53136686Q', 'Legion', 'Charles Xavier', 'City of New York, New York, USA', 'Silla', 46460, 1111111111, 222222222, 1, 'DavidCharlesHaller@mydomain.com', NULL, 0, 1234567890, 0, 1, 1, 300, 1, 0, NULL, 10, 5,CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 1, 1, 0, NULL, 0, 0, 19, 0, 1, 'florist'), - (1107, 'Hank Pym', '09854837G', 'Ant man', 'Hawk', 'Anthill, San Francisco, California', 'Silla', 46460, 1111111111, 222222222, 1, 'HankPym@mydomain.com', NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, NULL, 10, 5,CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 1, 0, 0, NULL, 0, 0, 19, 0, 1, 'florist'), - (1108, 'Charles Xavier', '22641921P', 'Professor X', 'Beast', '3800 Victory Pkwy, Cincinnati, OH 45207, USA', 'Silla', 46460, 1111111111, 222222222, 1, 'CharlesXavier@mydomain.com', NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, NULL, 10, 5,CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 1, 1, 1, NULL, 0, 0, 19, 0, 1, 'florist'), - (1109, 'Bruce Banner', '16104829E', 'Hulk', 'Black widow', 'Somewhere in New York', 'Silla', 46460, 1111111111, 222222222, 1, 'BruceBanner@mydomain.com', NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, NULL, 10, 5,CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 1, 0, 0, NULL, 0, 0, 9, 0, 1, 'florist'), - (1110, 'Jessica Jones', '58282869H', 'Jessica Jones', 'Luke Cage', 'NYCC 2015 Poster', 'Silla', 46460, 1111111111, 222222222, 1, 'JessicaJones@mydomain.com', NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, NULL, 10, 5,CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 1, 0, 0, NULL, 0, 0, NULL, 0, 1, 'florist'), - (1111, 'Missing', NULL, 'Missing man', 'Anton', 'The space, Universe far away', 'Silla', 46460, 1111111111, 222222222, 1, NULL, NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, NULL, 10, 5,CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 4, 1, 0, 1, 0, NULL, 1, 0, NULL, 0, 1, NULL), - (1112, 'Trash', NULL, 'Garbage man', 'Unknown name', 'New York city, Underground', 'Silla', 46460, 1111111111, 222222222, 1, NULL, NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, NULL, 10, 5,CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 4, 1, 0, 1, 0, NULL, 1, 0, NULL, 0, 1, NULL); + (1101, 'Bruce Wayne', '84612325V', 'Batman', 'Alfred', '1007 Mountain Drive, Gotham', 'Gotham', 46460, 1111111111, 222222222, 1, 'BruceWayne@mydomain.com', NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 1, 1, 0, NULL, 0, 0, 18, 0, 1, 'florist'), + (1102, 'Petter Parker', '87945234L', 'Spider man', 'Aunt May', '20 Ingram Street, Queens, USA', 'Gotham', 46460, 1111111111, 222222222, 1, 'PetterParker@mydomain.com', NULL, 0, 1234567890, 0, 2, 1, 300, 1, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 1, 1, 0, NULL, 0, 0, 18, 0, 1, 'florist'), + (1103, 'Clark Kent', '06815934E', 'Super man', 'lois lane', '344 Clinton Street, Apartament 3-D', 'Gotham', 46460, 1111111111, 222222222, 1, 'ClarkKent@mydomain.com', NULL, 0, 1234567890, 0, 3, 1, 0, 19, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 1, 1, 0, NULL, 0, 0, 18, 0, 1, 'florist'), + (1104, 'Tony Stark', '06089160W', 'Iron man', 'Pepper Potts', '10880 Malibu Point, 90265', 'Gotham', 46460, 1111111111, 222222222, 1, 'TonyStark@mydomain.com', NULL, 0, 1234567890, 0, 2, 1, 300, 1, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 1, 1, 0, NULL, 0, 0, 18, 0, 1, 'florist'), + (1105, 'Max Eisenhardt', '251628698', 'Magneto', 'Rogue', 'Unknown Whereabouts', 'Gotham', 46460, 1111111111, 222222222, 1, 'MaxEisenhardt@mydomain.com', NULL, 0, 1234567890, 0, 3, 1, 300, 8, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 1, 1, 1, NULL, 0, 0, 18, 0, 1, 'florist'), + (1106, 'DavidCharlesHaller', '53136686Q', 'Legion', 'Charles Xavier', 'City of New York, New York, USA', 'Gotham', 46460, 1111111111, 222222222, 1, 'DavidCharlesHaller@mydomain.com', NULL, 0, 1234567890, 0, 1, 1, 300, 1, 0, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 1, 1, 0, NULL, 0, 0, 19, 0, 1, 'florist'), + (1107, 'Hank Pym', '09854837G', 'Ant man', 'Hawk', 'Anthill, San Francisco, California', 'Gotham', 46460, 1111111111, 222222222, 1, 'HankPym@mydomain.com', NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 1, 0, 0, NULL, 0, 0, 19, 0, 1, 'florist'), + (1108, 'Charles Xavier', '22641921P', 'Professor X', 'Beast', '3800 Victory Pkwy, Cincinnati, OH 45207, USA', 'Gotham', 46460, 1111111111, 222222222, 1, 'CharlesXavier@mydomain.com', NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 1, 1, 1, NULL, 0, 0, 19, 0, 1, 'florist'), + (1109, 'Bruce Banner', '16104829E', 'Hulk', 'Black widow', 'Somewhere in New York', 'Gotham', 46460, 1111111111, 222222222, 1, 'BruceBanner@mydomain.com', NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 1, 0, 0, NULL, 0, 0, 9, 0, 1, 'florist'), + (1110, 'Jessica Jones', '58282869H', 'Jessica Jones', 'Luke Cage', 'NYCC 2015 Poster', 'Gotham', 46460, 1111111111, 222222222, 1, 'JessicaJones@mydomain.com', NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 1, 0, 0, NULL, 0, 0, NULL, 0, 1, 'florist'), + (1111, 'Missing', NULL, 'Missing man', 'Anton', 'The space, Universe far away', 'Gotham', 46460, 1111111111, 222222222, 1, NULL, NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 4, 1, 0, 1, 0, NULL, 1, 0, NULL, 0, 1, NULL), + (1112, 'Trash', NULL, 'Garbage man', 'Unknown name', 'New York city, Underground', 'Gotham', 46460, 1111111111, 222222222, 1, NULL, NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 4, 1, 0, 1, 0, NULL, 1, 0, NULL, 0, 1, NULL); INSERT INTO `vn`.`client`(`id`, `name`, `fi`, `socialName`, `contact`, `street`, `city`, `postcode`, `isRelevant`, `email`, `iban`,`dueDay`,`accountingAccount`, `isEqualizated`, `provinceFk`, `hasToInvoice`, `credit`, `countryFk`, `isActive`, `gestdocFk`, `quality`, `payMethodFk`,`created`, `isTaxDataChecked`) - SELECT id, name, CONCAT(RPAD(CONCAT(id,9),8,id),'A'), CONCAT(name, 'Social'), CONCAT(name, 'Contact'), CONCAT(name, 'Street'), 'ALGEMESI', 46460, 1, CONCAT(name,'@mydomain.com'), NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1,NULL, 10, 5, CURDATE(), 1 + SELECT id, name, CONCAT(RPAD(CONCAT(id,9),8,id),'A'), CONCAT(name, 'Social'), CONCAT(name, 'Contact'), CONCAT(name, 'Street'), 'GOTHAM', 46460, 1, CONCAT(name,'@mydomain.com'), NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1,NULL, 10, 5, util.VN_CURDATE(), 1 FROM `account`.`role` `r` WHERE `r`.`hasLogin` = 1; INSERT INTO `vn`.`clientManaCache`(`clientFk`, `mana`, `dated`) VALUES - (1101, 50, DATE_ADD(CURDATE(), INTERVAL -1 MONTH)), - (1102, 100, DATE_ADD(CURDATE(), INTERVAL -1 MONTH)), - (1103, 0, DATE_ADD(CURDATE(), INTERVAL -1 MONTH)), - (1104, -30, DATE_ADD(CURDATE(), INTERVAL -1 MONTH)); + (1101, 50, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH)), + (1102, 100, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH)), + (1103, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH)), + (1104, -30, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH)); INSERT INTO `vn`.`clientConfig`(`riskTolerance`, `maxCreditRows`) VALUES @@ -345,7 +347,7 @@ INSERT INTO `vn`.`address`(`id`, `nickname`, `street`, `city`, `postalCode`, `pr (105, 'Somewhere in Potugal', 'address 05', 'Gotham', 46460, 1, 5555555555, 666666666, 1, 1109, 2, NULL, NULL, 0, 0), (106, 'Somewhere in UK', 'address 06', 'Gotham', 46460, 1, 5555555555, 666666666, 1, 1109, 2, NULL, NULL, 0, 0), (107, 'Somewhere in Valencia', 'address 07', 'Gotham', 46460, 1, 5555555555, 666666666, 1, 1109, 2, NULL, NULL, 0, 0), - (108, 'Somewhere in Gotham', 'address 08', 'Gotham', 46460, 1, 5555555555, 666666666, 1, 1109, 2, NULL, NULL, 0, 0), + (108, 'Somewhere in Gotham', 'address 08', 'Gotham', 46460, 1, 5555555555, 666666666, 1, 1109, 2, NULL, NULL, 0, 0), (109, 'Somewhere in London', 'address 09', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1109, 2, NULL, NULL, 0, 0), (110, 'Somewhere in Algemesi', 'address 10', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1109, 2, NULL, NULL, 0, 0), (111, 'Somewhere in Carlet', 'address 11', 'Gotham', 46460, 1, 1111111111, 222222222, 1, 1109, 2, NULL, NULL, 0, 0), @@ -400,20 +402,20 @@ DROP TEMPORARY TABLE tmp.address; INSERT INTO `vn`.`clientCredit`(`id`, `clientFk`, `workerFk`, `amount`, `created`) VALUES - (1 , 1101, 5, 300, DATE_ADD(CURDATE(), INTERVAL -11 MONTH)), - (2 , 1101, 5, 900, DATE_ADD(CURDATE(), INTERVAL -10 MONTH)), - (3 , 1101, 5, 800, DATE_ADD(CURDATE(), INTERVAL -9 MONTH)), - (4 , 1101, 5, 700, DATE_ADD(CURDATE(), INTERVAL -8 MONTH)), - (5 , 1101, 5, 600, DATE_ADD(CURDATE(), INTERVAL -7 MONTH)), - (6 , 1101, 5, 500, DATE_ADD(CURDATE(), INTERVAL -6 MONTH)), - (7 , 1101, 5, 400, DATE_ADD(CURDATE(), INTERVAL -5 MONTH)), - (8 , 1101, 9, 300, DATE_ADD(CURDATE(), INTERVAL -4 MONTH)), - (9 , 1101, 9, 200, DATE_ADD(CURDATE(), INTERVAL -3 MONTH)), - (10, 1101, 9, 100, DATE_ADD(CURDATE(), INTERVAL -2 MONTH)), - (11, 1101, 9, 50 , DATE_ADD(CURDATE(), INTERVAL -1 MONTH)), - (12, 1102, 9, 800, CURDATE()), - (14, 1104, 9, 90 , CURDATE()), - (15, 1105, 9, 90 , CURDATE()); + (1 , 1101, 5, 300, DATE_ADD(util.VN_CURDATE(), INTERVAL -11 MONTH)), + (2 , 1101, 5, 900, DATE_ADD(util.VN_CURDATE(), INTERVAL -10 MONTH)), + (3 , 1101, 5, 800, DATE_ADD(util.VN_CURDATE(), INTERVAL -9 MONTH)), + (4 , 1101, 5, 700, DATE_ADD(util.VN_CURDATE(), INTERVAL -8 MONTH)), + (5 , 1101, 5, 600, DATE_ADD(util.VN_CURDATE(), INTERVAL -7 MONTH)), + (6 , 1101, 5, 500, DATE_ADD(util.VN_CURDATE(), INTERVAL -6 MONTH)), + (7 , 1101, 5, 400, DATE_ADD(util.VN_CURDATE(), INTERVAL -5 MONTH)), + (8 , 1101, 9, 300, DATE_ADD(util.VN_CURDATE(), INTERVAL -4 MONTH)), + (9 , 1101, 9, 200, DATE_ADD(util.VN_CURDATE(), INTERVAL -3 MONTH)), + (10, 1101, 9, 100, DATE_ADD(util.VN_CURDATE(), INTERVAL -2 MONTH)), + (11, 1101, 9, 50 , DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH)), + (12, 1102, 9, 800, util.VN_CURDATE()), + (14, 1104, 9, 90 , util.VN_CURDATE()), + (15, 1105, 9, 90 , util.VN_CURDATE()); INSERT INTO `vn`.`clientCreditLimit`(`id`, `maxAmount`, `roleFk`) VALUES @@ -423,16 +425,16 @@ INSERT INTO `vn`.`clientCreditLimit`(`id`, `maxAmount`, `roleFk`) INSERT INTO `vn`.`clientObservation`(`id`, `clientFk`, `workerFk`, `text`, `created`) VALUES - (1, 1101, 1, 'Madness, as you know, is like gravity, all it takes is a little push', CURDATE()), - (2, 1102, 1, 'With great power, comes great responsibility', CURDATE()), - (3, 1103, 3, 'this is a job for Super-Man!', CURDATE()), - (4, 1104, 3, 'yes... I am Iron-Man', CURDATE()), - (5, 1105, 5, 'They do understand. Our mutant powers make us superior', CURDATE()), - (6, 1106, 5, 'My name is Legion, for we are many!', CURDATE()), - (7, 1107, 9, 'I think our first move should be calling the Avengers..', CURDATE()), - (8, 1108, 9, 'Just because someone stumbles and loses their path, does not mean they are lost forever.', CURDATE()), - (9, 1109, 18, 'HULK SMASH! ...', CURDATE()), - (10, 1110, 18, 'They say everyone is born a hero. But if you let it, life will push you over the line until you are the villain.', CURDATE()); + (1, 1101, 1, 'Madness, as you know, is like gravity, all it takes is a little push', util.VN_CURDATE()), + (2, 1102, 1, 'With great power, comes great responsibility', util.VN_CURDATE()), + (3, 1103, 3, 'this is a job for Super-Man!', util.VN_CURDATE()), + (4, 1104, 3, 'yes... I am Iron-Man', util.VN_CURDATE()), + (5, 1105, 5, 'They do understand. Our mutant powers make us superior', util.VN_CURDATE()), + (6, 1106, 5, 'My name is Legion, for we are many!', util.VN_CURDATE()), + (7, 1107, 9, 'I think our first move should be calling the Avengers..', util.VN_CURDATE()), + (8, 1108, 9, 'Just because someone stumbles and loses their path, does not mean they are lost forever.', util.VN_CURDATE()), + (9, 1109, 18, 'HULK SMASH! ...', util.VN_CURDATE()), + (10, 1110, 18, 'They say everyone is born a hero. But if you let it, life will push you over the line until you are the villain.', util.VN_CURDATE()); INSERT INTO `vn`.`observationType`(`id`,`description`, `code`) VALUES @@ -452,17 +454,17 @@ INSERT INTO `vn`.`addressObservation`(`id`,`addressFk`,`observationTypeFk`,`desc INSERT INTO `vn`.`creditClassification`(`id`, `client`, `dateStart`, `dateEnd`) VALUES - (1, 1101, CURDATE(), CURDATE()), - (2, 1102, CURDATE(), CURDATE()), - (3, 1103, CURDATE(), CURDATE()), - (4, 1104, CURDATE(), CURDATE()), - (5, 1105, CURDATE(), CURDATE()); + (1, 1101, util.VN_CURDATE(), util.VN_CURDATE()), + (2, 1102, util.VN_CURDATE(), util.VN_CURDATE()), + (3, 1103, util.VN_CURDATE(), util.VN_CURDATE()), + (4, 1104, util.VN_CURDATE(), util.VN_CURDATE()), + (5, 1105, util.VN_CURDATE(), util.VN_CURDATE()); INSERT INTO `vn`.`creditInsurance`(`id`, `creditClassificationFk`, `credit`, `creationDate`, `grade`) VALUES - (1, 1, 3000, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), NULL), - (2, 2, 6000, DATE_ADD(CURDATE(), INTERVAL -2 MONTH), NULL), - (3, 3, 10000, DATE_ADD(CURDATE(), INTERVAL -3 MONTH), NULL); + (1, 1, 3000, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), NULL), + (2, 2, 6000, DATE_ADD(util.VN_CURDATE(), INTERVAL -2 MONTH), NULL), + (3, 3, 10000, DATE_ADD(util.VN_CURDATE(), INTERVAL -3 MONTH), NULL); INSERT INTO `vn`.`companyGroup`(`id`, `code`) VALUES @@ -504,11 +506,11 @@ INSERT INTO `vn`.`invoiceOutSerial` (`code`, `description`, `isTaxed`, `taxAreaF INSERT INTO `vn`.`invoiceOut`(`id`, `serial`, `amount`, `issued`,`clientFk`, `created`, `companyFk`, `dued`, `booked`, `bankFk`, `hasPdf`) VALUES - (1, 'T', 1014.24, CURDATE(), 1101, CURDATE(), 442, CURDATE(), CURDATE(), 1, 0), - (2, 'T', 121.36, CURDATE(), 1102, CURDATE(), 442, CURDATE(), CURDATE(), 1, 0), - (3, 'T', 8.88, CURDATE(), 1103, CURDATE(), 442, CURDATE(), CURDATE(), 1, 0), - (4, 'T', 8.88, CURDATE(), 1103, CURDATE(), 442, CURDATE(), CURDATE(), 1, 0), - (5, 'A', 8.88, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 1103, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 442, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 1, 0); + (1, 'T', 1014.24, util.VN_CURDATE(), 1101, util.VN_CURDATE(), 442, util.VN_CURDATE(), util.VN_CURDATE(), 1, 0), + (2, 'T', 121.36, util.VN_CURDATE(), 1102, util.VN_CURDATE(), 442, util.VN_CURDATE(), util.VN_CURDATE(), 1, 0), + (3, 'T', 8.88, util.VN_CURDATE(), 1103, util.VN_CURDATE(), 442, util.VN_CURDATE(), util.VN_CURDATE(), 1, 0), + (4, 'T', 8.88, util.VN_CURDATE(), 1103, util.VN_CURDATE(), 442, util.VN_CURDATE(), util.VN_CURDATE(), 1, 0), + (5, 'A', 8.88, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 1103, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 442, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 1, 0); UPDATE `vn`.`invoiceOut` SET ref = 'T1111111' WHERE id = 1; UPDATE `vn`.`invoiceOut` SET ref = 'T2222222' WHERE id = 2; @@ -541,29 +543,29 @@ INSERT INTO `vn`.`expence`(`id`, `taxTypeFk`, `name`, `isWithheld`) INSERT INTO `vn`.`invoiceOutExpence`(`id`, `invoiceOutFk`, `amount`, `expenceFk`, `created`) VALUES - (1, 1, 813.06, 2000000000, CURDATE()), - (2, 1, 33.80, 4751000000, CURDATE()), - (3, 1, 70.70, 6210000567, CURDATE()), - (4, 2, 110.33, 2000000000, CURDATE()), - (5, 3, 8.07, 2000000000, CURDATE()), - (6, 4, 8.07, 2000000000, CURDATE()), - (7, 5, 8.07, 2000000000, CURDATE()); + (1, 1, 813.06, 2000000000, util.VN_CURDATE()), + (2, 1, 33.80, 4751000000, util.VN_CURDATE()), + (3, 1, 70.70, 6210000567, util.VN_CURDATE()), + (4, 2, 110.33, 2000000000, util.VN_CURDATE()), + (5, 3, 8.07, 2000000000, util.VN_CURDATE()), + (6, 4, 8.07, 2000000000, util.VN_CURDATE()), + (7, 5, 8.07, 2000000000, util.VN_CURDATE()); INSERT INTO `vn`.`zone` (`id`, `name`, `hour`, `agencyModeFk`, `travelingDays`, `price`, `bonus`, `itemMaxSize`) VALUES - (1, 'Zone pickup A', CONCAT(CURRENT_DATE(), ' ', TIME('23:59')), 1, 0, 0, 0, 100), - (2, 'Zone pickup B', CONCAT(CURRENT_DATE(), ' ', TIME('23:59')), 1, 0, 0, 0, 100), - (3, 'Zone 247 A', CONCAT(CURRENT_DATE(), ' ', TIME('23:59')), 7, 1, 2, 0, 100), - (4, 'Zone 247 B', CONCAT(CURRENT_DATE(), ' ', TIME('23:59')), 7, 1, 2, 0, 100), - (5, 'Zone expensive A', CONCAT(CURRENT_DATE(), ' ', TIME('23:59')), 8, 1, 1000, 0, 100), - (6, 'Zone expensive B', CONCAT(CURRENT_DATE(), ' ', TIME('23:59')), 8, 1, 1000, 0, 100), - (7, 'Zone refund', CONCAT(CURRENT_DATE(), ' ', TIME('23:59')), 23, 0, 0, 0, 100), - (8, 'Zone others', CONCAT(CURRENT_DATE(), ' ', TIME('23:59')), 10, 0, 0, 0, 100), - (9, 'Zone superMan', CONCAT(CURRENT_DATE(), ' ', TIME('23:59')), 2, 0, 0, 0, 100), - (10, 'Zone teleportation', CONCAT(CURRENT_DATE(), ' ', TIME('23:59')), 3, 0, 0, 0, 100), - (11, 'Zone pickup C', CONCAT(CURRENT_DATE(), ' ', TIME('23:59')), 1, 0, 0, 0, 100), - (12, 'Zone entanglement', CONCAT(CURRENT_DATE(), ' ', TIME('23:59')), 4, 0, 0, 0, 100), - (13, 'Zone quantum break', CONCAT(CURRENT_DATE(), ' ', TIME('23:59')), 5, 0, 0, 0, 100); + (1, 'Zone pickup A', CONCAT(util.VN_CURDATE(), ' ', TIME('23:59')), 1, 0, 0, 0, 100), + (2, 'Zone pickup B', CONCAT(util.VN_CURDATE(), ' ', TIME('23:59')), 1, 0, 0, 0, 100), + (3, 'Zone 247 A', CONCAT(util.VN_CURDATE(), ' ', TIME('23:59')), 7, 1, 2, 0, 100), + (4, 'Zone 247 B', CONCAT(util.VN_CURDATE(), ' ', TIME('23:59')), 7, 1, 2, 0, 100), + (5, 'Zone expensive A', CONCAT(util.VN_CURDATE(), ' ', TIME('23:59')), 8, 1, 1000, 0, 100), + (6, 'Zone expensive B', CONCAT(util.VN_CURDATE(), ' ', TIME('23:59')), 8, 1, 1000, 0, 100), + (7, 'Zone refund', CONCAT(util.VN_CURDATE(), ' ', TIME('23:59')), 23, 0, 0, 0, 100), + (8, 'Zone others', CONCAT(util.VN_CURDATE(), ' ', TIME('23:59')), 10, 0, 0, 0, 100), + (9, 'Zone superMan', CONCAT(util.VN_CURDATE(), ' ', TIME('23:59')), 2, 0, 0, 0, 100), + (10, 'Zone teleportation', CONCAT(util.VN_CURDATE(), ' ', TIME('23:59')), 3, 0, 0, 0, 100), + (11, 'Zone pickup C', CONCAT(util.VN_CURDATE(), ' ', TIME('23:59')), 1, 0, 0, 0, 100), + (12, 'Zone entanglement', CONCAT(util.VN_CURDATE(), ' ', TIME('23:59')), 4, 0, 0, 0, 100), + (13, 'Zone quantum break', CONCAT(util.VN_CURDATE(), ' ', TIME('23:59')), 5, 0, 0, 0, 100); INSERT INTO `vn`.`zoneWarehouse` (`id`, `zoneFk`, `warehouseFk`) VALUES @@ -583,61 +585,61 @@ INSERT INTO `vn`.`zoneWarehouse` (`id`, `zoneFk`, `warehouseFk`) INSERT INTO `vn`.`zoneClosure` (`zoneFk`, `dated`, `hour`) VALUES - (1, CURDATE(), '23:59'), - (2, CURDATE(), '23:59'), - (3, CURDATE(), '23:59'), - (4, CURDATE(), '23:59'), - (5, CURDATE(), '23:59'), - (6, CURDATE(), '23:59'), - (7, CURDATE(), '23:59'), - (8, CURDATE(), '23:59'), - (9, CURDATE(), '23:59'), - (10, CURDATE(), '23:59'), - (11, CURDATE(), '23:59'), - (12, CURDATE(), '23:59'), - (13, CURDATE(), '23:59'); + (1, util.VN_CURDATE(), '23:59'), + (2, util.VN_CURDATE(), '23:59'), + (3, util.VN_CURDATE(), '23:59'), + (4, util.VN_CURDATE(), '23:59'), + (5, util.VN_CURDATE(), '23:59'), + (6, util.VN_CURDATE(), '23:59'), + (7, util.VN_CURDATE(), '23:59'), + (8, util.VN_CURDATE(), '23:59'), + (9, util.VN_CURDATE(), '23:59'), + (10, util.VN_CURDATE(), '23:59'), + (11, util.VN_CURDATE(), '23:59'), + (12, util.VN_CURDATE(), '23:59'), + (13, util.VN_CURDATE(), '23:59'); INSERT INTO `vn`.`zoneConfig` (`scope`) VALUES ('1'); INSERT INTO `vn`.`route`(`id`, `time`, `workerFk`, `created`, `vehicleFk`, `agencyModeFk`, `description`, `m3`, `cost`, `started`, `finished`, `zoneFk`) VALUES - (1, '1899-12-30 12:15:00', 56, CURDATE(), 1, 1, 'first route', 1.8, 10, CURDATE(), DATE_ADD(CURDATE(), INTERVAL + 1 DAY), 1), - (2, '1899-12-30 13:20:00', 56, CURDATE(), 1, 2, 'second route', 0.2, 20, CURDATE(), DATE_ADD(CURDATE(), INTERVAL + 1 DAY), 9), - (3, '1899-12-30 14:30:00', 56, CURDATE(), 2, 3, 'third route', 0.5, 30, CURDATE(), DATE_ADD(CURDATE(), INTERVAL + 1 DAY), 10), - (4, '1899-12-30 15:45:00', 56, CURDATE(), 3, 4, 'fourth route', 0, 40, CURDATE(), DATE_ADD(CURDATE(), INTERVAL + 1 DAY), 12), - (5, '1899-12-30 16:00:00', 56, CURDATE(), 4, 5, 'fifth route', 0.1, 50, CURDATE(), DATE_ADD(CURDATE(), INTERVAL + 1 DAY), 13), - (6, NULL, 57, CURDATE(), 5, 7, 'sixth route', 1.7, 60, CURDATE(), DATE_ADD(CURDATE(), INTERVAL + 1 DAY), 3), - (7, NULL, 57, CURDATE(), 6, 8, 'seventh route', 0, 70, CURDATE(), DATE_ADD(CURDATE(), INTERVAL + 1 DAY), 5); + (1, '1899-12-30 12:15:00', 56, util.VN_CURDATE(), 1, 1, 'first route', 1.8, 10, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1), + (2, '1899-12-30 13:20:00', 56, util.VN_CURDATE(), 1, 2, 'second route', 0.2, 20, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 9), + (3, '1899-12-30 14:30:00', 56, util.VN_CURDATE(), 2, 3, 'third route', 0.5, 30, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 10), + (4, '1899-12-30 15:45:00', 56, util.VN_CURDATE(), 3, 4, 'fourth route', 0, 40, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 12), + (5, '1899-12-30 16:00:00', 56, util.VN_CURDATE(), 4, 5, 'fifth route', 0.1, 50, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 13), + (6, NULL, 57, util.VN_CURDATE(), 5, 7, 'sixth route', 1.7, 60, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 3), + (7, NULL, 57, util.VN_CURDATE(), 6, 8, 'seventh route', 0, 70, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 5); INSERT INTO `vn`.`ticket`(`id`, `priority`, `agencyModeFk`,`warehouseFk`,`routeFk`, `shipped`, `landed`, `clientFk`,`nickname`, `addressFk`, `refFk`, `isDeleted`, `zoneFk`, `zonePrice`, `zoneBonus`, `created`) VALUES - (1 , 3, 1, 1, 1, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), DATE_ADD(DATE_ADD(CURDATE(),INTERVAL -1 MONTH), INTERVAL +1 DAY), 1101, 'Bat cave', 121, 'T1111111', 0, 1, 5, 1, DATE_ADD(CURDATE(), INTERVAL -1 MONTH)), - (2 , 1, 1, 1, 1, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), DATE_ADD(DATE_ADD(CURDATE(),INTERVAL -1 MONTH), INTERVAL +1 DAY), 1104, 'Stark tower', 124, 'T1111111', 0, 1, 5, 1, DATE_ADD(CURDATE(), INTERVAL -1 MONTH)), - (3 , 1, 7, 1, 6, DATE_ADD(CURDATE(), INTERVAL -2 MONTH), DATE_ADD(DATE_ADD(CURDATE(),INTERVAL -2 MONTH), INTERVAL +1 DAY), 1104, 'Stark tower', 124, 'T2222222', 0, 3, 5, 1, DATE_ADD(CURDATE(), INTERVAL -2 MONTH)), - (4 , 3, 2, 1, 2, DATE_ADD(CURDATE(), INTERVAL -3 MONTH), DATE_ADD(DATE_ADD(CURDATE(),INTERVAL -3 MONTH), INTERVAL +1 DAY), 1104, 'Stark tower', 124, 'T3333333', 0, 9, 5, 1, DATE_ADD(CURDATE(), INTERVAL -3 MONTH)), - (5 , 3, 3, 3, 3, DATE_ADD(CURDATE(), INTERVAL -4 MONTH), DATE_ADD(DATE_ADD(CURDATE(),INTERVAL -4 MONTH), INTERVAL +1 DAY), 1104, 'Stark tower', 124, 'T4444444', 0, 10, 5, 1, DATE_ADD(CURDATE(), INTERVAL -4 MONTH)), - (6 , 1, 3, 3, 3, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), DATE_ADD(DATE_ADD(CURDATE(),INTERVAL -1 MONTH), INTERVAL +1 DAY), 1101, 'Mountain Drive Gotham', 1, 'A1111111', 0, 10, 5, 1, DATE_ADD(CURDATE(), INTERVAL -1 MONTH)), - (7 , NULL, 7, 1, 6, CURDATE(), DATE_ADD(CURDATE(), INTERVAL + 1 DAY), 1101, 'Mountain Drive Gotham', 1, NULL, 0, 3, 5, 1, CURDATE()), - (8 , NULL, 7, 1, 6, CURDATE(), DATE_ADD(CURDATE(), INTERVAL + 1 DAY), 1101, 'Bat cave', 121, NULL, 0, 3, 5, 1, CURDATE()), - (9 , NULL, 7, 1, 6, CURDATE(), DATE_ADD(CURDATE(), INTERVAL + 1 DAY), 1104, 'Stark tower', 124, NULL, 0, 3, 5, 1, CURDATE()), - (10, 1, 1, 5, 1, CURDATE(), DATE_ADD(CURDATE(), INTERVAL + 1 DAY), 1102, 'Ingram Street', 2, NULL, 0, 1, 5, 1, CURDATE()), - (11, 1, 7, 1, 6, CURDATE(), DATE_ADD(CURDATE(), INTERVAL + 1 DAY), 1102, 'NY roofs', 122, NULL, 0, 3, 5, 1, CURDATE()), - (12, 1, 8, 1, 1, CURDATE(), DATE_ADD(CURDATE(), INTERVAL + 1 DAY), 1103, 'Phone Box', 123, NULL, 0, 1, 5, 1, CURDATE()), - (13, 1, 7, 1, 6, CURDATE(), DATE_ADD(CURDATE(), INTERVAL + 1 DAY), 1103, 'Phone Box', 123, NULL, 0, 3, 5, 1, CURDATE()), - (14, 1, 2, 1, NULL, CURDATE(), CURDATE(), 1104, 'Malibu Point', 4, NULL, 0, 9, 5, 1, CURDATE()), - (15, 1, 7, 1, 6, CURDATE(), DATE_ADD(CURDATE(), INTERVAL + 1 DAY), 1105, 'An incredibly long alias for testing purposes', 125, NULL, 0, 3, 5, 1, CURDATE()), - (16, 1, 7, 1, 6, CURDATE(), DATE_ADD(CURDATE(), INTERVAL + 1 DAY), 1106, 'Many Places', 126, NULL, 0, 3, 5, 1, CURDATE()), - (17, 1, 7, 2, 6, CURDATE(), DATE_ADD(CURDATE(), INTERVAL + 1 DAY), 1106, 'Many Places', 126, NULL, 0, 3, 5, 1, CURDATE()), - (18, 1, 4, 4, 4, CURDATE(), DATE_ADD(CURDATE(), INTERVAL + 1 DAY), 1108, 'Cerebro', 128, NULL, 0, 12, 5, 1, CURDATE()), - (19, 1, 5, 5, NULL, CURDATE(), DATE_ADD(CURDATE(), INTERVAL + 1 DAY), 1109, 'Somewhere in Thailand', 129, NULL, 1, NULL, 5, 1, CURDATE()), - (20, 1, 5, 5, 3, DATE_ADD(CURDATE(), INTERVAL +1 MONTH), DATE_ADD(DATE_ADD(CURDATE(),INTERVAL +1 MONTH), INTERVAL +1 DAY), 1109, 'Somewhere in Thailand', 129, NULL, 0, 13, 5, 1, DATE_ADD(CURDATE(), INTERVAL +1 MONTH)), - (21, NULL, 5, 5, 5, DATE_ADD(CURDATE(), INTERVAL +1 MONTH), DATE_ADD(DATE_ADD(CURDATE(),INTERVAL +1 MONTH), INTERVAL +1 DAY), 1109, 'Somewhere in Holland', 102, NULL, 0, 13, 5, 1, DATE_ADD(CURDATE(), INTERVAL +1 MONTH)), - (22, NULL, 5, 5, 5, DATE_ADD(CURDATE(), INTERVAL +1 MONTH), DATE_ADD(DATE_ADD(CURDATE(),INTERVAL +1 MONTH), INTERVAL +1 DAY), 1109, 'Somewhere in Japan', 103, NULL, 0, 13, 5, 1, DATE_ADD(CURDATE(), INTERVAL +1 MONTH)), - (23, NULL, 8, 1, 7, CURDATE(), DATE_ADD(CURDATE(), INTERVAL + 1 DAY), 1101, 'address 21', 121, NULL, 0, 5, 5, 1, CURDATE()), - (24 ,NULL, 8, 1, 7, CURDATE(), CURDATE(), 1101, 'Bruce Wayne', 1, NULL, 0, 5, 5, 1, CURDATE()), - (25 ,NULL, 8, 1, NULL, CURDATE(), CURDATE(), 1101, 'Bruce Wayne', 1, NULL, 0, 1, 5, 1, CURDATE()), - (26 ,NULL, 8, 1, NULL, CURDATE(), CURDATE(), 1101, 'An incredibly long alias for testing purposes', 1, NULL, 0, 1, 5, 1, CURDATE()), - (27 ,NULL, 8, 1, NULL, CURDATE(), CURDATE(), 1101, 'Wolverine', 1, NULL, 0, 1, 5, 1, CURDATE()); + (1 , 3, 1, 1, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL -1 MONTH), INTERVAL +1 DAY), 1101, 'Bat cave', 121, 'T1111111', 0, 1, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH)), + (2 , 1, 1, 1, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL -1 MONTH), INTERVAL +1 DAY), 1104, 'Stark tower', 124, 'T1111111', 0, 1, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH)), + (3 , 1, 7, 1, 6, DATE_ADD(util.VN_CURDATE(), INTERVAL -2 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL -2 MONTH), INTERVAL +1 DAY), 1104, 'Stark tower', 124, 'T2222222', 0, 3, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -2 MONTH)), + (4 , 3, 2, 1, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -3 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL -3 MONTH), INTERVAL +1 DAY), 1104, 'Stark tower', 124, 'T3333333', 0, 9, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -3 MONTH)), + (5 , 3, 3, 3, 3, DATE_ADD(util.VN_CURDATE(), INTERVAL -4 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL -4 MONTH), INTERVAL +1 DAY), 1104, 'Stark tower', 124, 'T4444444', 0, 10, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -4 MONTH)), + (6 , 1, 3, 3, 3, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL -1 MONTH), INTERVAL +1 DAY), 1101, 'Mountain Drive Gotham', 1, 'A1111111', 0, 10, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH)), + (7 , NULL, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1101, 'Mountain Drive Gotham', 1, NULL, 0, 3, 5, 1, util.VN_CURDATE()), + (8 , NULL, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1101, 'Bat cave', 121, NULL, 0, 3, 5, 1, util.VN_CURDATE()), + (9 , NULL, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1104, 'Stark tower', 124, NULL, 0, 3, 5, 1, util.VN_CURDATE()), + (10, 1, 1, 5, 1, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1102, 'Ingram Street', 2, NULL, 0, 1, 5, 1, util.VN_CURDATE()), + (11, 1, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1102, 'NY roofs', 122, NULL, 0, 3, 5, 1, util.VN_CURDATE()), + (12, 1, 8, 1, 1, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1103, 'Phone Box', 123, NULL, 0, 1, 5, 1, util.VN_CURDATE()), + (13, 1, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1103, 'Phone Box', 123, NULL, 0, 3, 5, 1, util.VN_CURDATE()), + (14, 1, 2, 1, NULL, util.VN_CURDATE(), util.VN_CURDATE(), 1104, 'Malibu Point', 4, NULL, 0, 9, 5, 1, util.VN_CURDATE()), + (15, 1, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1105, 'An incredibly long alias for testing purposes', 125, NULL, 0, 3, 5, 1, util.VN_CURDATE()), + (16, 1, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1106, 'Many Places', 126, NULL, 0, 3, 5, 1, util.VN_CURDATE()), + (17, 1, 7, 2, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1106, 'Many Places', 126, NULL, 0, 3, 5, 1, util.VN_CURDATE()), + (18, 1, 4, 4, 4, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1108, 'Cerebro', 128, NULL, 0, 12, 5, 1, util.VN_CURDATE()), + (19, 1, 5, 5, NULL, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1109, 'Somewhere in Thailand', 129, NULL, 1, NULL, 5, 1, util.VN_CURDATE()), + (20, 1, 5, 5, 3, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL +1 MONTH), INTERVAL +1 DAY), 1109, 'Somewhere in Thailand', 129, NULL, 0, 13, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH)), + (21, NULL, 5, 5, 5, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL +1 MONTH), INTERVAL +1 DAY), 1109, 'Somewhere in Holland', 102, NULL, 0, 13, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH)), + (22, NULL, 5, 5, 5, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL +1 MONTH), INTERVAL +1 DAY), 1109, 'Somewhere in Japan', 103, NULL, 0, 13, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH)), + (23, NULL, 8, 1, 7, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1101, 'address 21', 121, NULL, 0, 5, 5, 1, util.VN_CURDATE()), + (24 ,NULL, 8, 1, 7, util.VN_CURDATE(), util.VN_CURDATE(), 1101, 'Bruce Wayne', 1, NULL, 0, 5, 5, 1, util.VN_CURDATE()), + (25 ,NULL, 8, 1, NULL, util.VN_CURDATE(), util.VN_CURDATE(), 1101, 'Bruce Wayne', 1, NULL, 0, 1, 5, 1, util.VN_CURDATE()), + (26 ,NULL, 8, 1, NULL, util.VN_CURDATE(), util.VN_CURDATE(), 1101, 'An incredibly long alias for testing purposes', 1, NULL, 0, 1, 5, 1, util.VN_CURDATE()), + (27 ,NULL, 8, 1, NULL, util.VN_CURDATE(), util.VN_CURDATE(), 1101, 'Wolverine', 1, NULL, 0, 1, 5, 1, util.VN_CURDATE()); INSERT INTO `vn`.`ticketObservation`(`id`, `ticketFk`, `observationTypeFk`, `description`) VALUES @@ -655,42 +657,42 @@ INSERT INTO `vn`.`ticketObservation`(`id`, `ticketFk`, `observationTypeFk`, `des (12, 11, 3, 'Delivery after 10am'); -- FIX for state hours on local, inter_afterInsert -UPDATE vncontrol.inter SET odbc_date = DATE_ADD(CURDATE(), INTERVAL -10 SECOND); +UPDATE vncontrol.inter SET odbc_date = DATE_ADD(util.VN_CURDATE(), INTERVAL -10 SECOND); INSERT INTO `vn`.`ticketTracking`(`ticketFk`, `stateFk`, `workerFk`, `created`) VALUES - (1, 16, 5 , DATE_ADD(NOW(), INTERVAL -1 MONTH)), - (2, 16, 5 , DATE_ADD(NOW(), INTERVAL -1 MONTH)), - (3, 16, 5 , DATE_ADD(NOW(), INTERVAL -2 MONTH)), - (4, 16, 5 , DATE_ADD(NOW(), INTERVAL -3 MONTH)), - (5, 16, 18, DATE_ADD(NOW(), INTERVAL -4 MONTH)), - (6, 16, 18, DATE_ADD(NOW(), INTERVAL -1 MONTH)), - (7, 10, 18, NOW()), - (8, 5, 19, NOW()), - (9, 5, 19, NOW()), - (10, 5, 19, NOW()), - (11, 3, 19, NOW()), - (12, 3, 19, NOW()), - (13, 3, 19, NOW()), - (14, 3, 19, NOW()), - (15, 2, 19, NOW()), - (16, 3, 19, NOW()), - (17, 2, 19, NOW()), - (18, 2, 19, NOW()), - (19, 2, 19, NOW()), - (20, 1, 19, DATE_ADD(NOW(), INTERVAL +1 MONTH)), - (21, 1, 19, DATE_ADD(NOW(), INTERVAL +1 MONTH)), - (22, 1, 19, DATE_ADD(NOW(), INTERVAL +1 MONTH)), - (23, 16, 21, NOW()), - (24, 16, 21, NOW()); + (1, 16, 5 , DATE_ADD(util.VN_NOW(), INTERVAL -1 MONTH)), + (2, 16, 5 , DATE_ADD(util.VN_NOW(), INTERVAL -1 MONTH)), + (3, 16, 5 , DATE_ADD(util.VN_NOW(), INTERVAL -2 MONTH)), + (4, 16, 5 , DATE_ADD(util.VN_NOW(), INTERVAL -3 MONTH)), + (5, 16, 18, DATE_ADD(util.VN_NOW(), INTERVAL -4 MONTH)), + (6, 16, 18, DATE_ADD(util.VN_NOW(), INTERVAL -1 MONTH)), + (7, 10, 18, util.VN_NOW()), + (8, 5, 19, util.VN_NOW()), + (9, 5, 19, util.VN_NOW()), + (10, 5, 19, util.VN_NOW()), + (11, 3, 19, util.VN_NOW()), + (12, 3, 19, util.VN_NOW()), + (13, 3, 19, util.VN_NOW()), + (14, 3, 19, util.VN_NOW()), + (15, 2, 19, util.VN_NOW()), + (16, 3, 19, util.VN_NOW()), + (17, 2, 19, util.VN_NOW()), + (18, 2, 19, util.VN_NOW()), + (19, 2, 19, util.VN_NOW()), + (20, 1, 19, DATE_ADD(util.VN_NOW(), INTERVAL +1 MONTH)), + (21, 1, 19, DATE_ADD(util.VN_NOW(), INTERVAL +1 MONTH)), + (22, 1, 19, DATE_ADD(util.VN_NOW(), INTERVAL +1 MONTH)), + (23, 16, 21, util.VN_NOW()), + (24, 16, 21, util.VN_NOW()); INSERT INTO `vn`.`stowaway`(`id`, `shipFk`, `created`) VALUES - (12, 13, CURDATE()); + (12, 13, util.VN_CURDATE()); INSERT INTO `vn`.`deliveryPoint` (`id`, `name`, `ubication`) VALUES - (1, 'Silla','46460 Av Espioca 100-Silla'); + (1, 'Gotham','1007 Mountain Drive, Gotham'); INSERT INTO `vn`.`vehicle`(`id`, `numberPlate`, `tradeMark`, `model`, `companyFk`, `warehouseFk`, `description`, `m3`, `isActive`, `deliveryPointFk`) VALUES @@ -703,7 +705,7 @@ INSERT INTO `vn`.`vehicle`(`id`, `numberPlate`, `tradeMark`, `model`, `companyFk INSERT INTO `vn`.`config`(`id`, `mdbServer`, `fakeEmail`, `defaultersMaxAmount`, `inventoried`) VALUES - (1, 'beta-server', 'nightmare@mydomain.com', '200', DATE_ADD(CURDATE(),INTERVAL -1 MONTH)); + (1, 'beta-server', 'nightmare@mydomain.com', '200', DATE_ADD(util.VN_CURDATE(),INTERVAL -1 MONTH)); INSERT INTO `vn`.`greugeType`(`id`, `name`, `code`) VALUES @@ -717,18 +719,18 @@ INSERT INTO `vn`.`greugeType`(`id`, `name`, `code`) INSERT INTO `vn`.`greuge`(`id`, `clientFk`, `description`, `amount`, `shipped`, `created`, `greugeTypeFk`, `ticketFk`) VALUES - (1, 1101, 'some diff charges', -19.99, DATE_ADD(CURDATE(), INTERVAL 1 MONTH), CURDATE(), 1, 1), - (2, 1101, 'more diff charges', 60, DATE_ADD(CURDATE(), INTERVAL 1 MONTH), CURDATE(), 2, 1), - (3, 1101, 'even more! diff charges', -9.99, DATE_ADD(CURDATE(), INTERVAL 1 MONTH), CURDATE(), 3, 1), - (4, 1101, 'insane diff charges', 60, DATE_ADD(CURDATE(), INTERVAL 1 MONTH), CURDATE(), 4, 1), - (5, 1101, 'gargantuous diff charges', -9.99, DATE_ADD(CURDATE(), INTERVAL 1 MONTH), CURDATE(), 5, 1), - (6, 1101, 'diff charges', 88.30, DATE_ADD(CURDATE(), INTERVAL 1 MONTH), CURDATE(), 6, 1), - (7, 1101, 'unaffordable diff charges', -39.12, DATE_ADD(CURDATE(), INTERVAL 1 MONTH), CURDATE(), 1, 1), - (8, 1101, 'some recovery charges', 29.35, DATE_ADD(CURDATE(), INTERVAL 1 MONTH), CURDATE(), 2, 1), - (9, 1101, 'some manna charges', -9.99, DATE_ADD(CURDATE(), INTERVAL 1 MONTH), CURDATE(), 3, 1), - (10, 1101, 'some claim charges', 13.13, DATE_ADD(CURDATE(), INTERVAL 1 MONTH), CURDATE(), 4, 1), - (11, 1101, 'some heritage charges', -15.99, DATE_ADD(CURDATE(), INTERVAL 1 MONTH), CURDATE(), 5, 1), - (12, 1101, 'some miscellaneous charges', 58.00, DATE_ADD(CURDATE(), INTERVAL 1 MONTH), CURDATE(), 6, 1); + (1, 1101, 'some diff charges', -19.99, DATE_ADD(util.VN_CURDATE(), INTERVAL 1 MONTH), util.VN_CURDATE(), 1, 1), + (2, 1101, 'more diff charges', 60, DATE_ADD(util.VN_CURDATE(), INTERVAL 1 MONTH), util.VN_CURDATE(), 2, 1), + (3, 1101, 'even more! diff charges', -9.99, DATE_ADD(util.VN_CURDATE(), INTERVAL 1 MONTH), util.VN_CURDATE(), 3, 1), + (4, 1101, 'insane diff charges', 60, DATE_ADD(util.VN_CURDATE(), INTERVAL 1 MONTH), util.VN_CURDATE(), 4, 1), + (5, 1101, 'gargantuous diff charges', -9.99, DATE_ADD(util.VN_CURDATE(), INTERVAL 1 MONTH), util.VN_CURDATE(), 5, 1), + (6, 1101, 'diff charges', 88.30, DATE_ADD(util.VN_CURDATE(), INTERVAL 1 MONTH), util.VN_CURDATE(), 6, 1), + (7, 1101, 'unaffordable diff charges', -39.12, DATE_ADD(util.VN_CURDATE(), INTERVAL 1 MONTH), util.VN_CURDATE(), 1, 1), + (8, 1101, 'some recovery charges', 29.35, DATE_ADD(util.VN_CURDATE(), INTERVAL 1 MONTH), util.VN_CURDATE(), 2, 1), + (9, 1101, 'some manna charges', -9.99, DATE_ADD(util.VN_CURDATE(), INTERVAL 1 MONTH), util.VN_CURDATE(), 3, 1), + (10, 1101, 'some claim charges', 13.13, DATE_ADD(util.VN_CURDATE(), INTERVAL 1 MONTH), util.VN_CURDATE(), 4, 1), + (11, 1101, 'some heritage charges', -15.99, DATE_ADD(util.VN_CURDATE(), INTERVAL 1 MONTH), util.VN_CURDATE(), 5, 1), + (12, 1101, 'some miscellaneous charges', 58.00, DATE_ADD(util.VN_CURDATE(), INTERVAL 1 MONTH), util.VN_CURDATE(), 6, 1); INSERT INTO `vn`.`mandateType`(`id`, `name`) VALUES @@ -738,7 +740,7 @@ INSERT INTO `vn`.`mandateType`(`id`, `name`) INSERT INTO `vn`.`mandate`(`id`, `clientFk`, `companyFk`, `code`, `created`, `mandateTypeFk`) VALUES - (1, 1102, 442, '1-1', CURDATE(), 2); + (1, 1102, 442, '1-1', util.VN_CURDATE(), 2); INSERT INTO `vn`.`itemCategory`(`id`, `name`, `display`, `color`, `icon`, `code`) VALUES @@ -793,10 +795,10 @@ INSERT INTO `vn`.`taxType`(`id`, `nickname`, `isAccrued`, `serial`, `TIPOOPE`, ` INSERT INTO `vn`.`taxCode`(`id`, `dated`, `code`, `taxTypeFk`, `rate`, `equalizationTax`, `type`, `link`, `isActive`, `updated`, `transactionCode`) VALUES - (1 , CURDATE(), '1111111111', 1, 7.0 , 0.0, 'R', 1, 1, CURDATE(), 1), - (2 , CURDATE(), '2222222222', 2, 16.0, 0.0, 'G', 2, 1, CURDATE(), 1), - (21 , CURDATE(), '3333333333', 1, 7.0, 0.0, 'R', 3, 1, CURDATE(), 1), - (108, CURDATE(), '4444444444', 2, 8.0 , 0.0, 'R', 4, 1, CURDATE(), 1); + (1 , util.VN_CURDATE(), '1111111111', 1, 7.0 , 0.0, 'R', 1, 1, util.VN_CURDATE(), 1), + (2 , util.VN_CURDATE(), '2222222222', 2, 16.0, 0.0, 'G', 2, 1, util.VN_CURDATE(), 1), + (21 , util.VN_CURDATE(), '3333333333', 1, 7.0, 0.0, 'R', 3, 1, util.VN_CURDATE(), 1), + (108, util.VN_CURDATE(), '4444444444', 2, 8.0 , 0.0, 'R', 4, 1, util.VN_CURDATE(), 1); INSERT INTO `vn`.`taxClass`(`id`, `description`, `code`) VALUES @@ -805,9 +807,9 @@ INSERT INTO `vn`.`taxClass`(`id`, `description`, `code`) INSERT INTO `vn`.`taxClassCode`(`taxClassFk`, `effectived`, `taxCodeFk`) VALUES - (1, CURDATE(), 1), - (1, CURDATE(), 21), - (2, CURDATE(), 2); + (1, util.VN_CURDATE(), 1), + (1, util.VN_CURDATE(), 21), + (2, util.VN_CURDATE(), 2); INSERT INTO `vn`.`intrastat`(`id`, `description`, `taxClassFk`, `taxCodeFk`) VALUES @@ -847,9 +849,9 @@ UPDATE `vn`.`itemTaxCountry` SET `taxClassFk` = 2 INSERT INTO `vn`.`priceFixed`(`id`, `itemFk`, `rate0`, `rate1`, `rate2`, `rate3`, `started`, `ended`, `bonus`, `warehouseFk`, `created`) VALUES - (1, 1, 0, 0, 2.5, 2, CURDATE(), DATE_ADD(CURDATE(), INTERVAL +1 MONTH), 0, 1, CURDATE()), - (2, 3, 10, 10, 10, 10, CURDATE(), DATE_ADD(CURDATE(), INTERVAL +1 MONTH), 0, 1, CURDATE()), - (3, 13, 8.5, 10, 7.5, 6, CURDATE(), DATE_ADD(CURDATE(), INTERVAL +1 MONTH), 1, 2, CURDATE()); + (1, 1, 0, 0, 2.5, 2, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), 0, 1, util.VN_CURDATE()), + (2, 3, 10, 10, 10, 10, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), 0, 1, util.VN_CURDATE()), + (3, 13, 8.5, 10, 7.5, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), 1, 2, util.VN_CURDATE()); INSERT INTO `vn`.`expeditionBoxVol`(`boxFk`, `m3`, `ratio`) VALUES @@ -857,14 +859,14 @@ INSERT INTO `vn`.`expeditionBoxVol`(`boxFk`, `m3`, `ratio`) INSERT INTO `vn`.`packaging`(`id`, `volume`, `width`, `height`, `depth`, `isPackageReturnable`, `created`, `itemFk`, `price`) VALUES - (1, 0.00, 10, 10, 0, 1, CURDATE(), 6, 1.50), - (2, 100.00, 20, 20, 0, 1, CURDATE(), 7, 1.00), - (3, 14000.00, 0, 0, 0, 1, CURDATE(), NULL, 0), - (4, 218000.00, 0, 0, 0, 0, CURDATE(), NULL, 0), - (5, 292000.00, 0, 0, 0, 0, CURDATE(), NULL, 0), - (94, 140875.00, 49.00, 115.00, 25.00, 0, CURDATE(), 71, 0.00), - ('cc', 1640038.00, 56.00, 220.00, 128.00, 1, CURDATE(), 15, 90.00), - ('pallet 100', 2745600.00, 100.00, 220.00, 120.00, 1, CURDATE(), 16, 0.00); + (1, 0.00, 10, 10, 0, 1, util.VN_CURDATE(), 6, 1.50), + (2, 100.00, 20, 20, 0, 1, util.VN_CURDATE(), 7, 1.00), + (3, 14000.00, 0, 0, 0, 1, util.VN_CURDATE(), NULL, 0), + (4, 218000.00, 0, 0, 0, 0, util.VN_CURDATE(), NULL, 0), + (5, 292000.00, 0, 0, 0, 0, util.VN_CURDATE(), NULL, 0), + (94, 140875.00, 49.00, 115.00, 25.00, 0, util.VN_CURDATE(), 71, 0.00), + ('cc', 1640038.00, 56.00, 220.00, 128.00, 1, util.VN_CURDATE(), 15, 90.00), + ('pallet 100', 2745600.00, 100.00, 220.00, 120.00, 1, util.VN_CURDATE(), 16, 0.00); INSERT INTO `vn`.`expeditionStateType`(`id`, `description`, `code`) VALUES @@ -875,68 +877,68 @@ INSERT INTO `vn`.`expeditionStateType`(`id`, `description`, `code`) INSERT INTO `vn`.`expedition`(`id`, `agencyModeFk`, `ticketFk`, `isBox`, `created`, `itemFk`, `counter`, `checked`, `workerFk`, `externalId`, `packagingFk`, `stateTypeFk`) VALUES - (1, 1, 1, 71, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 15, 1, 1, 18, 'UR9000006041', 94, 1), - (2, 1, 1, 71, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 16, 2, 1, 18, 'UR9000006041', 94, 1), - (3, 1, 1, 71, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), NULL, 3, 1, 18, 'UR9000006041', 94, 2), - (4, 1, 1, 71, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), NULL, 4, 1, 18, 'UR9000006041', 94, 2), - (5, 1, 2, 71, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), NULL, 1, 1, 18, NULL, 94, 3), - (6, 7, 3, 71, DATE_ADD(CURDATE(), INTERVAL -2 MONTH), NULL, 1, 1, 18, NULL, 94, 3), - (7, 2, 4, 71, DATE_ADD(CURDATE(), INTERVAL -3 MONTH), NULL, 1, 1, 18, NULL, 94, NULL), - (8, 3, 5, 71, DATE_ADD(CURDATE(), INTERVAL -4 MONTH), NULL, 1, 1, 18, NULL, 94, 1), - (9, 3, 6, 71, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), NULL, 1, 1, 18, NULL, 94, 2), + (1, 1, 1, 71, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 15, 1, 1, 18, 'UR9000006041', 94, 1), + (2, 1, 1, 71, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 16, 2, 1, 18, 'UR9000006041', 94, 1), + (3, 1, 1, 71, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), NULL, 3, 1, 18, 'UR9000006041', 94, 2), + (4, 1, 1, 71, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), NULL, 4, 1, 18, 'UR9000006041', 94, 2), + (5, 1, 2, 71, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), NULL, 1, 1, 18, NULL, 94, 3), + (6, 7, 3, 71, DATE_ADD(util.VN_CURDATE(), INTERVAL -2 MONTH), NULL, 1, 1, 18, NULL, 94, 3), + (7, 2, 4, 71, DATE_ADD(util.VN_CURDATE(), INTERVAL -3 MONTH), NULL, 1, 1, 18, NULL, 94, NULL), + (8, 3, 5, 71, DATE_ADD(util.VN_CURDATE(), INTERVAL -4 MONTH), NULL, 1, 1, 18, NULL, 94, 1), + (9, 3, 6, 71, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), NULL, 1, 1, 18, NULL, 94, 2), (10, 7, 7, 71, NOW(), NULL, 1, 1, 18, NULL, 94, 3); INSERT INTO `vn`.`expeditionState`(`id`, `created`, `expeditionFk`, `typeFk`, `userFk`) VALUES - (1, CURDATE(), 1, 1, 1), - (2, CURDATE(), 2, 1, 1), - (3, CURDATE(), 3, 1, 1), - (4, CURDATE(), 3, 2, 1106), - (5, CURDATE(), 5, 1, 1106), - (6, CURDATE(), 5, 3, 1106); + (1, util.VN_CURDATE(), 1, 1, 1), + (2, util.VN_CURDATE(), 2, 1, 1), + (3, util.VN_CURDATE(), 3, 1, 1), + (4, util.VN_CURDATE(), 3, 2, 1106), + (5, util.VN_CURDATE(), 5, 1, 1106), + (6, util.VN_CURDATE(), 5, 3, 1106); INSERT INTO `vn`.`ticketPackaging`(`id`, `ticketFk`, `packagingFk`, `quantity`, `created`, `pvp`) VALUES - (1, 1, 2, 2, CURDATE(), NULL), - (2, 2, 2, 1, CURDATE(), NULL), - (3, 3, 2, 4, CURDATE(), NULL); + (1, 1, 2, 2, util.VN_CURDATE(), NULL), + (2, 2, 2, 1, util.VN_CURDATE(), NULL), + (3, 3, 2, 4, util.VN_CURDATE(), NULL); INSERT INTO `vn`.`sale`(`id`, `itemFk`, `ticketFk`, `concept`, `quantity`, `price`, `discount`, `reserved`, `isPicked`, `created`) VALUES - (1, 1, 1, 'Ranged weapon longbow 2m', 5, 100.39, 0, 0, 0, DATE_ADD(CURDATE(), INTERVAL -1 MONTH)), - (2, 2, 1, 'Melee weapon combat fist 15cm', 10, 7.07, 0, 0, 0, DATE_ADD(CURDATE(), INTERVAL -1 MONTH)), - (3, 1, 1, 'Ranged weapon longbow 2m', 2, 100.39, 0, 0, 0, DATE_ADD(CURDATE(), INTERVAL -1 MONTH)), - (4, 4, 1, 'Melee weapon heavy shield 1x0.5m', 20, 1.69, 0, 0, 0, DATE_ADD(CURDATE(), INTERVAL -1 MONTH)), - (5, 1, 2, 'Ranged weapon longbow 2m', 1, 110.33, 0, 0, 0, DATE_ADD(CURDATE(), INTERVAL -1 MONTH)), - (6, 1, 3, 'Ranged weapon longbow 2m', 1, 110.33, 0, 0, 0, DATE_ADD(CURDATE(), INTERVAL -2 MONTH)), - (7, 2, 11, 'Melee weapon combat fist 15cm', 15, 7.44, 0, 0, 0, CURDATE()), - (8, 4, 11, 'Melee weapon heavy shield 1x0.5m', 10, 1.79, 0, 0, 0, CURDATE()), - (9, 1, 16, 'Ranged weapon longbow 2m', 1, 103.49, 0, 0, 0, CURDATE()), - (10, 2, 16, 'Melee weapon combat fist 15cm', 10, 7.09, 0, 0, 0, CURDATE()), - (11, 1, 16, 'Ranged weapon longbow 2m', 1, 103.49, 0, 0, 0, CURDATE()), - (12, 4, 16, 'Melee weapon heavy shield 1x0.5m', 20, 1.71, 0, 0, 0, CURDATE()), - (13, 2, 8, 'Melee weapon combat fist 15cm', 10, 7.08, 0, 0, 0, CURDATE()), - (14, 1, 8, 'Ranged weapon longbow 2m', 2, 103.49, 0, 0, 0, CURDATE()), - (15, 1, 19, 'Ranged weapon longbow 2m', 1, 103.49, 0, 0, 0, CURDATE()), - (16, 2, 20, 'Melee weapon combat fist 15cm', 20, 7.07, 0, 0, 0, CURDATE()), - (17, 2, 22, 'Melee weapon combat fist 15cm', 30, 7.07, 0, 0, 0, DATE_ADD(CURDATE(), INTERVAL +1 MONTH)), - (18, 4, 22, 'Melee weapon heavy shield 1x0.5m', 20, 1.69, 0, 0, 0, DATE_ADD(CURDATE(), INTERVAL +1 MONTH)), - (19, 1, 4, 'Ranged weapon longbow 2m', 1, 8.07, 0, 0, 0, DATE_ADD(CURDATE(), INTERVAL -3 MONTH)), - (20, 1, 5, 'Ranged weapon longbow 2m', 1, 8.07, 0, 0, 0, DATE_ADD(CURDATE(), INTERVAL -4 MONTH)), - (21, 1, 6, 'Ranged weapon longbow 2m', 1, 8.07, 0, 0, 0, DATE_ADD(CURDATE(), INTERVAL -1 MONTH)), - (22, 1, 7, 'Ranged weapon longbow 2m', 1, 8.07, 0, 0, 0, CURDATE()), - (23, 1, 9, 'Ranged weapon longbow 2m', 1, 8.07, 0, 0, 0, CURDATE()), - (24, 1, 10, 'Ranged weapon longbow 2m', 1, 8.07, 0, 0, 0, CURDATE()), - (25, 4, 12, 'Melee weapon heavy shield 1x0.5m', 20, 1.72, 0, 0, 0, CURDATE()), - (26, 4, 13, 'Melee weapon heavy shield 1x0.5m', 20, 1.72, 0, 0, 0, CURDATE()), - (27, 4, 14, 'Melee weapon heavy shield 1x0.5m', 20, 1.72, 0, 0, 0, CURDATE()), - (28, 4, 15, 'Melee weapon heavy shield 1x0.5m', 20, 1.72, 0, 0, 0, CURDATE()), - (29, 4, 17, 'Melee weapon heavy shield 1x0.5m', 20, 1.72, 0, 0, 0, CURDATE()), - (30, 4, 18, 'Melee weapon heavy shield 1x0.5m', 20, 1.72, 0, 0, 0, CURDATE()), - (31, 2, 23, 'Melee weapon combat fist 15cm', -5, 7.08, 0, 0, 0, CURDATE()), - (32, 1, 24, 'Ranged weapon longbow 2m', -1, 8.07, 0, 0, 0, CURDATE()), - (33, 5, 14, 'Ranged weapon pistol 9mm', 50, 1.79, 0, 0, 0, CURDATE()); + (1, 1, 1, 'Ranged weapon longbow 2m', 5, 100.39, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH)), + (2, 2, 1, 'Melee weapon combat fist 15cm', 10, 7.07, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH)), + (3, 1, 1, 'Ranged weapon longbow 2m', 2, 100.39, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH)), + (4, 4, 1, 'Melee weapon heavy shield 1x0.5m', 20, 1.69, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH)), + (5, 1, 2, 'Ranged weapon longbow 2m', 1, 110.33, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH)), + (6, 1, 3, 'Ranged weapon longbow 2m', 1, 110.33, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL -2 MONTH)), + (7, 2, 11, 'Melee weapon combat fist 15cm', 15, 7.44, 0, 0, 0, util.VN_CURDATE()), + (8, 4, 11, 'Melee weapon heavy shield 1x0.5m', 10, 1.79, 0, 0, 0, util.VN_CURDATE()), + (9, 1, 16, 'Ranged weapon longbow 2m', 1, 103.49, 0, 0, 0, util.VN_CURDATE()), + (10, 2, 16, 'Melee weapon combat fist 15cm', 10, 7.09, 0, 0, 0, util.VN_CURDATE()), + (11, 1, 16, 'Ranged weapon longbow 2m', 1, 103.49, 0, 0, 0, util.VN_CURDATE()), + (12, 4, 16, 'Melee weapon heavy shield 1x0.5m', 20, 1.71, 0, 0, 0, util.VN_CURDATE()), + (13, 2, 8, 'Melee weapon combat fist 15cm', 10, 7.08, 0, 0, 0, util.VN_CURDATE()), + (14, 1, 8, 'Ranged weapon longbow 2m', 2, 103.49, 0, 0, 0, util.VN_CURDATE()), + (15, 1, 19, 'Ranged weapon longbow 2m', 1, 103.49, 0, 0, 0, util.VN_CURDATE()), + (16, 2, 20, 'Melee weapon combat fist 15cm', 20, 7.07, 0, 0, 0, util.VN_CURDATE()), + (17, 2, 22, 'Melee weapon combat fist 15cm', 30, 7.07, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH)), + (18, 4, 22, 'Melee weapon heavy shield 1x0.5m', 20, 1.69, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH)), + (19, 1, 4, 'Ranged weapon longbow 2m', 1, 8.07, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL -3 MONTH)), + (20, 1, 5, 'Ranged weapon longbow 2m', 1, 8.07, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL -4 MONTH)), + (21, 1, 6, 'Ranged weapon longbow 2m', 1, 8.07, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH)), + (22, 1, 7, 'Ranged weapon longbow 2m', 1, 8.07, 0, 0, 0, util.VN_CURDATE()), + (23, 1, 9, 'Ranged weapon longbow 2m', 1, 8.07, 0, 0, 0, util.VN_CURDATE()), + (24, 1, 10, 'Ranged weapon longbow 2m', 1, 8.07, 0, 0, 0, util.VN_CURDATE()), + (25, 4, 12, 'Melee weapon heavy shield 1x0.5m', 20, 1.72, 0, 0, 0, util.VN_CURDATE()), + (26, 4, 13, 'Melee weapon heavy shield 1x0.5m', 20, 1.72, 0, 0, 0, util.VN_CURDATE()), + (27, 4, 14, 'Melee weapon heavy shield 1x0.5m', 20, 1.72, 0, 0, 0, util.VN_CURDATE()), + (28, 4, 15, 'Melee weapon heavy shield 1x0.5m', 20, 1.72, 0, 0, 0, util.VN_CURDATE()), + (29, 4, 17, 'Melee weapon heavy shield 1x0.5m', 20, 1.72, 0, 0, 0, util.VN_CURDATE()), + (30, 4, 18, 'Melee weapon heavy shield 1x0.5m', 20, 1.72, 0, 0, 0, util.VN_CURDATE()), + (31, 2, 23, 'Melee weapon combat fist 15cm', -5, 7.08, 0, 0, 0, util.VN_CURDATE()), + (32, 1, 24, 'Ranged weapon longbow 2m', -1, 8.07, 0, 0, 0, util.VN_CURDATE()), + (33, 5, 14, 'Ranged weapon pistol 9mm', 50, 1.79, 0, 0, 0, util.VN_CURDATE()); INSERT INTO `vn`.`saleChecked`(`saleFk`, `isChecked`) VALUES @@ -1098,10 +1100,10 @@ INSERT INTO `vncontrol`.`accion`(`accion_id`, `accion`) INSERT INTO `vn`.`saleTracking`(`saleFk`, `isChecked`, `created`, `originalQuantity`, `workerFk`, `actionFk`, `id`, `stateFk`) VALUES - (1, 0, CURDATE(), 5, 55, 3, 1, 14), - (1, 1, CURDATE(), 5, 54, 3, 2, 8), - (2, 1, CURDATE(), 10, 40, 4, 3, 8), - (3, 1, CURDATE(), 2, 40, 4, 4, 8); + (1, 0, util.VN_CURDATE(), 5, 55, 3, 1, 14), + (1, 1, util.VN_CURDATE(), 5, 54, 3, 2, 8), + (2, 1, util.VN_CURDATE(), 10, 40, 4, 3, 8), + (3, 1, util.VN_CURDATE(), 2, 40, 4, 4, 8); INSERT INTO `vn`.`itemBarcode`(`id`, `itemFk`, `code`) VALUES @@ -1124,22 +1126,20 @@ INSERT INTO `vn`.`train`(`id`, `name`) INSERT INTO `vn`.`collection`(`id`, `workerFk`, `stateFk`, `created`, `trainFk`) VALUES - (1, 1106, 5, DATE_ADD(CURDATE(),INTERVAL +1 DAY), 1), - (2, 1106, 14, CURDATE(), 1); + (1, 1106, 5, DATE_ADD(util.VN_CURDATE(),INTERVAL +1 DAY), 1), + (2, 1106, 14, util.VN_CURDATE(), 1); -INSERT INTO `vn`.`ticketCollection`(`id`, `ticketFk`, `collectionFk`) +INSERT INTO `vn`.`ticketCollection`(`ticketFk`, `collectionFk`, `level`) VALUES - (2, 2, 1), - (3, 3, 2); + (1, 1, 1), + (2, 1, NULL), + (3, 2, NULL), + (23, 1, NULL); INSERT INTO `vn`.`parking` (`column`, `row`, `sectorFk`, `code`, `pickingOrder`) VALUES ('100', '01', 1, '100-01', 1); -INSERT INTO `vn`.`ticketCollection` (`ticketFk`, `collectionFk`, `level`) - VALUES - (1, 1, 1); - INSERT INTO `vn`.`genus`(`id`, `name`) VALUES (1, 'Abelia'), @@ -1296,10 +1296,10 @@ INSERT INTO `vn`.`itemLog` (`id`, `originFk`, `userFk`, `action`, `description`) INSERT INTO `vn`.`recovery`(`id`, `clientFk`, `started`, `finished`, `amount`, `period`) VALUES - (1, 1101, DATE_ADD(CURDATE(),INTERVAL -7 MONTH), DATE_ADD(CURDATE(),INTERVAL -3 MONTH), 50, 7), - (2, 1102, DATE_ADD(CURDATE(),INTERVAL -5 MONTH), CURDATE(), 100, 1), - (3, 1102, CURDATE(), DATE_ADD(CURDATE(),INTERVAL 1 MONTH), 50, 7), - (4, 1103, CURDATE(), NULL, 50, 7); + (1, 1101, DATE_ADD(util.VN_CURDATE(),INTERVAL -7 MONTH), DATE_ADD(util.VN_CURDATE(),INTERVAL -3 MONTH), 50, 7), + (2, 1102, DATE_ADD(util.VN_CURDATE(),INTERVAL -5 MONTH), util.VN_CURDATE(), 100, 1), + (3, 1102, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(),INTERVAL 1 MONTH), 50, 7), + (4, 1103, util.VN_CURDATE(), NULL, 50, 7); INSERT INTO `vn`.`annualAverageInvoiced`(`clientFk`, `invoiced`) VALUES @@ -1327,9 +1327,9 @@ INSERT INTO `vn`.`supplierAddress`(`id`, `supplierFk`, `nickname`, `street`, `pr INSERT INTO `vn`.`supplier`(`id`, `name`, `nickname`,`account`,`countryFk`,`nif`, `commission`, `created`, `isActive`, `street`, `city`, `provinceFk`, `postCode`, `payMethodFk`, `payDemFk`, `payDay`, `taxTypeSageFk`, `withholdingSageFk`, `transactionTypeSageFk`, `workerFk`, `supplierActivityFk`, `isPayMethodChecked`, `healthRegister`) VALUES - (1, 'Plants SL', 'Plants nick', 4100000001, 1, '06089160W', 0, CURDATE(), 1, 'supplier address 1', 'PONTEVEDRA', 1, 15214, 1, 1, 15, 4, 1, 1, 18, 'flowerPlants', 1, '400664487V'), - (2, 'Farmer King', 'The farmer', 4000020002, 1, '87945234L', 0, CURDATE(), 1, 'supplier address 2', 'GOTHAM', 2, 43022, 1, 2, 10, 93, 2, 8, 18, 'animals', 1, '400664487V'), - (442, 'Verdnatura Levante SL', 'Verdnatura', 5115000442, 1, '06815934E', 0, CURDATE(), 1, 'supplier address 3', 'GOTHAM', 1, 43022, 1, 2, 15, 6, 9, 3, 18, 'complements', 1, '400664487V'); + (1, 'Plants SL', 'Plants nick', 4100000001, 1, '06089160W', 0, util.VN_CURDATE(), 1, 'supplier address 1', 'PONTEVEDRA', 1, 15214, 1, 1, 15, 4, 1, 1, 18, 'flowerPlants', 1, '400664487V'), + (2, 'Farmer King', 'The farmer', 4000020002, 1, '87945234L', 0, util.VN_CURDATE(), 1, 'supplier address 2', 'GOTHAM', 2, 43022, 1, 2, 10, 93, 2, 8, 18, 'animals', 1, '400664487V'), + (442, 'Verdnatura Levante SL', 'Verdnatura', 5115000442, 1, '06815934E', 0, util.VN_CURDATE(), 1, 'supplier address 3', 'GOTHAM', 1, 43022, 1, 2, 15, 6, 9, 3, 18, 'complements', 1, '400664487V'); INSERT INTO `vn`.`supplierContact`(`id`, `supplierFk`, `phone`, `mobile`, `email`, `observation`, `name`) VALUES @@ -1340,9 +1340,9 @@ INSERT INTO `vn`.`supplierContact`(`id`, `supplierFk`, `phone`, `mobile`, `email INSERT INTO `cache`.`cache_calc`(`id`, `cache_id`, `cacheName`, `params`, `last_refresh`, `expires`, `created`, `connection_id`) VALUES - (1, 2, 'available', CONCAT_WS('/',1,CURDATE()), CURRENT_TIMESTAMP(), DATE_ADD(CURRENT_TIMESTAMP(),INTERVAL 15 MINUTE), CURDATE(), NULL), - (2, 4, 'last_buy', CONCAT_WS('/',1,CURDATE()), CURRENT_TIMESTAMP(), DATE_ADD(CURRENT_TIMESTAMP(),INTERVAL 15 MINUTE), CURDATE(), NULL), - (3, 8, 'visible', CONCAT_WS('/',1,CURDATE()), CURRENT_TIMESTAMP(), DATE_ADD(CURRENT_TIMESTAMP(),INTERVAL 15 MINUTE), CURDATE(), NULL); + (1, 2, 'available', CONCAT_WS('/',1,util.VN_CURDATE()), util.VN_NOW(), DATE_ADD(util.VN_NOW(),INTERVAL 15 MINUTE), util.VN_CURDATE(), NULL), + (2, 4, 'last_buy', CONCAT_WS('/',1,util.VN_CURDATE()), util.VN_NOW(), DATE_ADD(util.VN_NOW(),INTERVAL 15 MINUTE), util.VN_CURDATE(), NULL), + (3, 8, 'visible', CONCAT_WS('/',1,util.VN_CURDATE()), util.VN_NOW(), DATE_ADD(util.VN_NOW(),INTERVAL 15 MINUTE), util.VN_CURDATE(), NULL); INSERT INTO `vn`.`ticketWeekly`(`ticketFk`, `weekDay`) VALUES @@ -1354,25 +1354,25 @@ INSERT INTO `vn`.`ticketWeekly`(`ticketFk`, `weekDay`) INSERT INTO `vn`.`travel`(`id`,`shipped`, `landed`, `warehouseInFk`, `warehouseOutFk`, `agencyFk`, `m3`, `kg`,`ref`, `totalEntries`, `cargoSupplierFk`) VALUES - (1, DATE_ADD(CURDATE(), INTERVAL -2 MONTH), DATE_ADD(CURDATE(), INTERVAL -2 MONTH), 1, 2, 1, 100.00, 1000, 'first travel', 1, 1), - (2, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 1, 2, 1, 150, 2000, 'second travel', 2, 2), - (3, CURDATE(), CURDATE(), 1, 2, 1, 0.00, 0.00, 'third travel', 1, 1), - (4, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 1, 3, 1, 50.00, 500, 'fourth travel', 0, 2), - (5, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 3, 3, 1, 50.00, 500, 'fifth travel', 1, 1), - (6, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 4, 4, 1, 50.00, 500, 'sixth travel', 1, 2), - (7, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 5, 4, 1, 50.00, 500, 'seventh travel', 2, 1), - (8, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 5, 1, 1, 50.00, 500, 'eight travel', 1, 2); + (1, DATE_ADD(util.VN_CURDATE(), INTERVAL -2 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -2 MONTH), 1, 2, 1, 100.00, 1000, 'first travel', 1, 1), + (2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 1, 2, 1, 150, 2000, 'second travel', 2, 2), + (3, util.VN_CURDATE(), util.VN_CURDATE(), 1, 2, 1, 0.00, 0.00, 'third travel', 1, 1), + (4, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 1, 3, 1, 50.00, 500, 'fourth travel', 0, 2), + (5, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 3, 3, 1, 50.00, 500, 'fifth travel', 1, 1), + (6, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 4, 4, 1, 50.00, 500, 'sixth travel', 1, 2), + (7, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 5, 4, 1, 50.00, 500, 'seventh travel', 2, 1), + (8, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 5, 1, 1, 50.00, 500, 'eight travel', 1, 2); INSERT INTO `vn`.`entry`(`id`, `supplierFk`, `created`, `travelFk`, `isConfirmed`, `companyFk`, `ref`,`isInventory`, `isRaid`, `notes`, `evaNotes`) VALUES - (1, 1, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 1, 1, 442, 'Movement 1', 0, 0, '', ''), - (2, 2, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 2, 0, 442, 'Movement 2', 0, 0, 'this is the note two', 'observation two'), - (3, 1, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 3, 0, 442, 'Movement 3', 0, 0, 'this is the note three', 'observation three'), - (4, 2, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 2, 0, 69, 'Movement 4', 0, 0, 'this is the note four', 'observation four'), - (5, 2, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 5, 0, 442, 'Movement 5', 0, 0, 'this is the note five', 'observation five'), - (6, 2, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 6, 0, 442, 'Movement 6', 0, 0, 'this is the note six', 'observation six'), - (7, 2, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 7, 0, 442, 'Movement 7', 0, 0, 'this is the note seven', 'observation seven'), - (8, 2, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 7, 0, 442, 'Movement 8', 1, 1, '', ''); + (1, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 1, 1, 442, 'Movement 1', 0, 0, '', ''), + (2, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 2, 0, 442, 'Movement 2', 0, 0, 'this is the note two', 'observation two'), + (3, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 3, 0, 442, 'Movement 3', 0, 0, 'this is the note three', 'observation three'), + (4, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 2, 0, 69, 'Movement 4', 0, 0, 'this is the note four', 'observation four'), + (5, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 5, 0, 442, 'Movement 5', 0, 0, 'this is the note five', 'observation five'), + (6, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 6, 0, 442, 'Movement 6', 0, 0, 'this is the note six', 'observation six'), + (7, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 7, 0, 442, 'Movement 7', 0, 0, 'this is the note seven', 'observation seven'), + (8, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 7, 0, 442, 'Movement 8', 1, 1, '', ''); INSERT INTO `vn`.`claimRatio`(`clientFk`, `yearSale`, `claimAmount`, `claimingRate`, `priceIncreasing`, `packingRate`) VALUES @@ -1383,97 +1383,97 @@ INSERT INTO `vn`.`claimRatio`(`clientFk`, `yearSale`, `claimAmount`, `claimingRa INSERT INTO `bs`.`waste`(`buyer`, `year`, `week`, `family`, `itemFk`, `itemTypeFk`, `saleTotal`, `saleWaste`, `rate`) VALUES - ('CharlesXavier', YEAR(DATE_ADD(CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(CURDATE(), INTERVAL -1 WEEK), 1), 'Carnation', 1, 1, '1062', '51', '4.8'), - ('CharlesXavier', YEAR(DATE_ADD(CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(CURDATE(), INTERVAL -1 WEEK), 1), 'Carnation Colombia', 2, 1, '35074', '687', '2.0'), - ('CharlesXavier', YEAR(DATE_ADD(CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(CURDATE(), INTERVAL -1 WEEK), 1), 'Carnation Mini', 3, 1, '1777', '13', '0.7'), - ('CharlesXavier', YEAR(DATE_ADD(CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(CURDATE(), INTERVAL -1 WEEK), 1), 'Carnation Short', 4, 1, '3182', '59', '0.6'), - ('CharlesXavier', YEAR(DATE_ADD(CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(CURDATE(), INTERVAL -1 WEEK), 1), 'Crisantemo', 5, 1, '1747', '13', '0.7'), - ('CharlesXavier', YEAR(DATE_ADD(CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(CURDATE(), INTERVAL -1 WEEK), 1), 'Lilium Oriental', 6, 1, '7182', '59', '0.6'), - ('CharlesXavier', YEAR(DATE_ADD(CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(CURDATE(), INTERVAL -1 WEEK), 1), 'Alstroemeria', 7, 1, '1777', '13', '0.7'), - ('CharlesXavier', YEAR(DATE_ADD(CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(CURDATE(), INTERVAL -1 WEEK), 1), 'Cymbidium', 1, 1, '4181', '59', '0.6'), - ('CharlesXavier', YEAR(DATE_ADD(CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(CURDATE(), INTERVAL -1 WEEK), 1), 'Cymbidium', 2, 1, '7268', '59', '0.6'), - ('DavidCharlesHaller', YEAR(DATE_ADD(CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(CURDATE(), INTERVAL -1 WEEK), 1), 'Containers', 2, 1, '-74', '0', '0.0'), - ('DavidCharlesHaller', YEAR(DATE_ADD(CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(CURDATE(), INTERVAL -1 WEEK), 1), 'Packagings', 3, 1, '-7', '0', '0.0'), - ('DavidCharlesHaller', YEAR(DATE_ADD(CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(CURDATE(), INTERVAL -1 WEEK), 1), 'Freight', 4, 1, '1100', '0', '0.0'), - ('HankPym', YEAR(DATE_ADD(CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(CURDATE(), INTERVAL -1 WEEK), 1), 'Funeral Accessories', 5, 1, '848', '-187', '-22.1'), - ('HankPym', YEAR(DATE_ADD(CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(CURDATE(), INTERVAL -1 WEEK), 1), 'Miscellaneous Accessories', 6, 1, '186', '0', '0.0'), - ('HankPym', YEAR(DATE_ADD(CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(CURDATE(), INTERVAL -1 WEEK), 1), 'Adhesives', 7, 1, '277', '0', '0.0'); + ('CharlesXavier', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 'Carnation', 1, 1, '1062', '51', '4.8'), + ('CharlesXavier', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 'Carnation Colombia', 2, 1, '35074', '687', '2.0'), + ('CharlesXavier', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 'Carnation Mini', 3, 1, '1777', '13', '0.7'), + ('CharlesXavier', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 'Carnation Short', 4, 1, '3182', '59', '0.6'), + ('CharlesXavier', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 'Crisantemo', 5, 1, '1747', '13', '0.7'), + ('CharlesXavier', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 'Lilium Oriental', 6, 1, '7182', '59', '0.6'), + ('CharlesXavier', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 'Alstroemeria', 7, 1, '1777', '13', '0.7'), + ('CharlesXavier', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 'Cymbidium', 1, 1, '4181', '59', '0.6'), + ('CharlesXavier', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 'Cymbidium', 2, 1, '7268', '59', '0.6'), + ('DavidCharlesHaller', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 'Containers', 2, 1, '-74', '0', '0.0'), + ('DavidCharlesHaller', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 'Packagings', 3, 1, '-7', '0', '0.0'), + ('DavidCharlesHaller', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 'Freight', 4, 1, '1100', '0', '0.0'), + ('HankPym', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 'Funeral Accessories', 5, 1, '848', '-187', '-22.1'), + ('HankPym', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 'Miscellaneous Accessories', 6, 1, '186', '0', '0.0'), + ('HankPym', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 'Adhesives', 7, 1, '277', '0', '0.0'); INSERT INTO `vn`.`buy`(`id`,`entryFk`,`itemFk`,`buyingValue`,`quantity`,`packageFk`,`stickers`,`freightValue`,`packageValue`,`comissionValue`,`packing`,`grouping`,`groupingMode`,`location`,`price1`,`price2`,`price3`,`producer`,`printedStickers`,`isChecked`,`isIgnored`,`weight`, `created`) VALUES - (1, 1, 1, 50, 5000, 4, 1, 1.500, 1.500, 0.000, 1, 1, 1, NULL, 0.00, 99.6, 99.4, NULL, 0, 1, 0, 1, DATE_ADD(CURDATE(), INTERVAL -2 MONTH)), - (2, 2, 1, 50, 100, 4, 1, 1.500, 1.500, 0.000, 1, 1, 1, NULL, 0.00, 99.6, 99.4, NULL, 0, 1, 0, 1, DATE_ADD(CURDATE(), INTERVAL -1 MONTH)), - (3, 3, 1, 50, 100, 4, 1, 1.500, 1.500, 0.000, 1, 1, 0, NULL, 0.00, 99.6, 99.4, NULL, 0, 1, 0, 1, CURDATE()), - (4, 2, 2, 5, 450, 3, 1, 1.000, 1.000, 0.000, 10, 10, 0, NULL, 0.00, 7.30, 7.00, NULL, 0, 1, 0, 2.5, CURDATE()), - (5, 3, 3, 55, 500, 5, 1, 1.000, 1.000, 0.000, 1, 1, 0, NULL, 0.00, 78.3, 75.6, NULL, 0, 1, 0, 2.5, CURDATE()), - (6, 4, 8, 50, 1000, 4, 1, 1.000, 1.000, 0.000, 1, 1, 1, NULL, 0.00, 99.6, 99.4, NULL, 0, 1, 0, 2.5, CURDATE()), - (7, 4, 9, 20, 1000, 3, 1, 0.500, 0.500, 0.000, 10, 10, 1, NULL, 0.00, 30.50, 29.00, NULL, 0, 1, 0, 2.5, CURDATE()), - (8, 4, 4, 1.25, 1000, 3, 1, 0.500, 0.500, 0.000, 10, 10, 1, NULL, 0.00, 1.75, 1.67, NULL, 0, 1, 0, 2.5, CURDATE()), - (9, 4, 4, 1.25, 1000, 3, 1, 0.500, 0.500, 0.000, 10, 10, 1, NULL, 0.00, 1.75, 1.67, NULL, 0, 1, 0, 4, CURDATE()), - (10, 5, 1, 50, 10, 4, 1, 2.500, 2.500, 0.000, 1, 1, 1, NULL, 0.00, 99.6, 99.4, NULL, 0, 1, 0, 4, CURDATE()), - (11, 5, 4, 1.25, 10, 3, 1, 2.500, 2.500, 0.000, 10, 10, 1, NULL, 0.00, 1.75, 1.67, NULL, 0, 1, 0, 4, CURDATE()), - (12, 6, 4, 1.25, 0, 3, 1, 2.500, 2.500, 0.000, 10, 10, 1, NULL, 0.00, 1.75, 1.67, NULL, 0, 1, 0, 4, CURDATE()), - (13, 7, 1, 50, 0, 3, 1, 2.000, 2.000, 0.000, 1, 1, 1, NULL, 0.00, 99.6, 99.4, NULL, 0, 1, 0, 4, CURDATE()), - (14, 7, 2, 5, 0, 3, 1, 2.000, 2.000, 0.000, 10, 10, 1, NULL, 0.00, 7.30, 7.00, NULL, 0, 1, 0, 4, CURDATE()), - (15, 7, 4, 1.25, 0, 3, 1, 2.000, 2.000, 0.000, 10, 10, 1, NULL, 0.00, 1.75, 1.67, NULL, 0, 1, 0, 4, CURDATE()); + (1, 1, 1, 50, 5000, 4, 1, 1.500, 1.500, 0.000, 1, 1, 1, NULL, 0.00, 99.6, 99.4, NULL, 0, 1, 0, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -2 MONTH)), + (2, 2, 1, 50, 100, 4, 1, 1.500, 1.500, 0.000, 1, 1, 1, NULL, 0.00, 99.6, 99.4, NULL, 0, 1, 0, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH)), + (3, 3, 1, 50, 100, 4, 1, 1.500, 1.500, 0.000, 1, 1, 0, NULL, 0.00, 99.6, 99.4, NULL, 0, 1, 0, 1, util.VN_CURDATE()), + (4, 2, 2, 5, 450, 3, 1, 1.000, 1.000, 0.000, 10, 10, 0, NULL, 0.00, 7.30, 7.00, NULL, 0, 1, 0, 2.5, util.VN_CURDATE()), + (5, 3, 3, 55, 500, 5, 1, 1.000, 1.000, 0.000, 1, 1, 0, NULL, 0.00, 78.3, 75.6, NULL, 0, 1, 0, 2.5, util.VN_CURDATE()), + (6, 4, 8, 50, 1000, 4, 1, 1.000, 1.000, 0.000, 1, 1, 1, NULL, 0.00, 99.6, 99.4, NULL, 0, 1, 0, 2.5, util.VN_CURDATE()), + (7, 4, 9, 20, 1000, 3, 1, 0.500, 0.500, 0.000, 10, 10, 1, NULL, 0.00, 30.50, 29.00, NULL, 0, 1, 0, 2.5, util.VN_CURDATE()), + (8, 4, 4, 1.25, 1000, 3, 1, 0.500, 0.500, 0.000, 10, 10, 1, NULL, 0.00, 1.75, 1.67, NULL, 0, 1, 0, 2.5, util.VN_CURDATE()), + (9, 4, 4, 1.25, 1000, 3, 1, 0.500, 0.500, 0.000, 10, 10, 1, NULL, 0.00, 1.75, 1.67, NULL, 0, 1, 0, 4, util.VN_CURDATE()), + (10, 5, 1, 50, 10, 4, 1, 2.500, 2.500, 0.000, 1, 1, 1, NULL, 0.00, 99.6, 99.4, NULL, 0, 1, 0, 4, util.VN_CURDATE()), + (11, 5, 4, 1.25, 10, 3, 1, 2.500, 2.500, 0.000, 10, 10, 1, NULL, 0.00, 1.75, 1.67, NULL, 0, 1, 0, 4, util.VN_CURDATE()), + (12, 6, 4, 1.25, 0, 3, 1, 2.500, 2.500, 0.000, 10, 10, 1, NULL, 0.00, 1.75, 1.67, NULL, 0, 1, 0, 4, util.VN_CURDATE()), + (13, 7, 1, 50, 0, 3, 1, 2.000, 2.000, 0.000, 1, 1, 1, NULL, 0.00, 99.6, 99.4, NULL, 0, 1, 0, 4, util.VN_CURDATE()), + (14, 7, 2, 5, 0, 3, 1, 2.000, 2.000, 0.000, 10, 10, 1, NULL, 0.00, 7.30, 7.00, NULL, 0, 1, 0, 4, util.VN_CURDATE()), + (15, 7, 4, 1.25, 0, 3, 1, 2.000, 2.000, 0.000, 10, 10, 1, NULL, 0.00, 1.75, 1.67, NULL, 0, 1, 0, 4, util.VN_CURDATE()); INSERT INTO `hedera`.`order`(`id`, `date_send`, `customer_id`, `delivery_method_id`, `agency_id`, `address_id`, `company_id`, `note`, `source_app`, `confirmed`,`total`, `date_make`, `first_row_stamp`, `confirm_date`) VALUES - (1, DATE_ADD(DATE_ADD(CURDATE(),INTERVAL -1 MONTH), INTERVAL +1 DAY), 1101, 3, 1, 121, 442, NULL, 'TPV', 1,'155.89', DATE_ADD(CURDATE(), INTERVAL -1 MONTH), DATE_ADD(CURDATE(), INTERVAL -1 MONTH), DATE_ADD(CURDATE(), INTERVAL -1 MONTH)), - (2, DATE_ADD(DATE_ADD(CURDATE(),INTERVAL -1 MONTH), INTERVAL +1 DAY), 1104, 3, 1, 124, 442, NULL, 'WEB', 1,'100.10', DATE_ADD(CURDATE(), INTERVAL -1 MONTH), DATE_ADD(CURDATE(), INTERVAL -1 MONTH), DATE_ADD(CURDATE(), INTERVAL -1 MONTH)), - (3, DATE_ADD(DATE_ADD(CURDATE(),INTERVAL -2 MONTH), INTERVAL +1 DAY), 1104, 1, 2, 124, 442, NULL, 'ANDROID', 1,'107.25', DATE_ADD(CURDATE(), INTERVAL -2 MONTH), DATE_ADD(CURDATE(), INTERVAL -2 MONTH), DATE_ADD(CURDATE(), INTERVAL -2 MONTH)), - (4, DATE_ADD(DATE_ADD(CURDATE(),INTERVAL -3 MONTH), INTERVAL +1 DAY), 1104, 1, 2, 124, 442, NULL, 'SALIX', 1,'10.01', DATE_ADD(CURDATE(), INTERVAL -3 MONTH), DATE_ADD(CURDATE(), INTERVAL -3 MONTH), DATE_ADD(CURDATE(), INTERVAL -3 MONTH)), - (5, DATE_ADD(DATE_ADD(CURDATE(),INTERVAL -4 MONTH), INTERVAL +1 DAY), 1104, 1, 3, 124, 442, NULL, 'SALIX', 1,'10.01', DATE_ADD(CURDATE(), INTERVAL -4 MONTH), DATE_ADD(CURDATE(), INTERVAL -4 MONTH), DATE_ADD(CURDATE(), INTERVAL -4 MONTH)), - (6, DATE_ADD(DATE_ADD(CURDATE(),INTERVAL -1 MONTH), INTERVAL +1 DAY), 1101, 1, 3, 1, 442, NULL, 'SALIX', 1,'10.01', DATE_ADD(CURDATE(), INTERVAL -1 MONTH), DATE_ADD(CURDATE(), INTERVAL -1 MONTH), DATE_ADD(CURDATE(), INTERVAL -1 MONTH)), - (7, DATE_ADD(CURDATE(), INTERVAL + 1 DAY), 1101, 2, 7, 1, 442, NULL, 'SALIX', 0,'10.01', CURDATE(), CURDATE(), CURDATE()), - (8, DATE_ADD(CURDATE(), INTERVAL + 1 DAY), 1101, 2, 7, 121, 442, NULL, 'SALIX', 0,'123.53', CURDATE(), CURDATE(), CURDATE()), - (9, DATE_ADD(CURDATE(), INTERVAL + 1 DAY), 1104, 2, 7, 124, 442, NULL, 'SALIX', 0,'10.01', CURDATE(), CURDATE(), CURDATE()), - (10, DATE_ADD(CURDATE(), INTERVAL + 1 DAY), 1102, 3, 1, 2, 442, NULL, 'SALIX', 0,'10.01', CURDATE(), CURDATE(), CURDATE()), - (11, DATE_ADD(CURDATE(), INTERVAL + 1 DAY), 1102, 2, 7, 122, 442, NULL, 'SALIX', 0,'60.90', CURDATE(), CURDATE(), CURDATE()), - (12, DATE_ADD(CURDATE(), INTERVAL + 1 DAY), 1103, 3, 1, 3, 442, NULL, 'SALIX', 0,'72.60', CURDATE(), CURDATE(), CURDATE()), - (13, DATE_ADD(CURDATE(), INTERVAL + 1 DAY), 1103, 1, 2, 123, 442, NULL, 'SALIX', 0,'72.60', CURDATE(), CURDATE(), CURDATE()), - (14, DATE_ADD(CURDATE(), INTERVAL + 1 DAY), 1104, 1, 2, 4, 442, NULL, 'SALIX', 0,'72.60', CURDATE(), CURDATE(), CURDATE()), - (15, DATE_ADD(CURDATE(), INTERVAL + 1 DAY), 1105, 1, 3, 125, 442, NULL, 'SALIX', 0,'72.60', CURDATE(), CURDATE(), CURDATE()), - (16, DATE_ADD(CURDATE(), INTERVAL + 1 DAY), 1106, 2, 7, 126, 442, NULL, 'SALIX', 0,'155.89', CURDATE(), CURDATE(), CURDATE()), - (17, DATE_ADD(CURDATE(), INTERVAL + 1 DAY), 1107, 1, 4, 127, 442, NULL, 'SALIX', 0,'72.60', CURDATE(), CURDATE(), CURDATE()), - (18, DATE_ADD(CURDATE(), INTERVAL + 1 DAY), 1108, 1, 4, 128, 442, NULL, 'SALIX', 0,'72.60', CURDATE(), CURDATE(), CURDATE()), - (19, DATE_ADD(CURDATE(), INTERVAL + 1 DAY), 1109, 1, 5, 129, 442, NULL, 'SALIX', 0,'16.50', CURDATE(), CURDATE(), CURDATE()), - (20, DATE_ADD(DATE_ADD(CURDATE(),INTERVAL +1 MONTH), INTERVAL +1 DAY), 1109, 1, 5, 101, 442, NULL, 'SALIX', 0,'21.45', DATE_ADD(CURDATE(), INTERVAL +1 MONTH), DATE_ADD(CURDATE(), INTERVAL +1 MONTH), DATE_ADD(CURDATE(), INTERVAL +1 MONTH)), - (21, DATE_ADD(DATE_ADD(CURDATE(),INTERVAL +1 MONTH), INTERVAL +1 DAY), 1109, 1, 5, 102, 442, NULL, 'SALIX', 0,'0.00', DATE_ADD(CURDATE(), INTERVAL +1 MONTH), DATE_ADD(CURDATE(), INTERVAL +1 MONTH), DATE_ADD(CURDATE(), INTERVAL +1 MONTH)), - (22, DATE_ADD(DATE_ADD(CURDATE(),INTERVAL +1 MONTH), INTERVAL +1 DAY), 1109, 1, 5, 103, 442, NULL, 'SALIX', 0,'148.50', DATE_ADD(CURDATE(), INTERVAL +1 MONTH), DATE_ADD(CURDATE(), INTERVAL +1 MONTH), DATE_ADD(CURDATE(), INTERVAL +1 MONTH)); + (1, DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL -1 MONTH), INTERVAL +1 DAY), 1101, 3, 1, 121, 442, NULL, 'TPV', 1,'155.89', DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH)), + (2, DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL -1 MONTH), INTERVAL +1 DAY), 1104, 3, 1, 124, 442, NULL, 'WEB', 1,'100.10', DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH)), + (3, DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL -2 MONTH), INTERVAL +1 DAY), 1104, 1, 2, 124, 442, NULL, 'ANDROID', 1,'107.25', DATE_ADD(util.VN_CURDATE(), INTERVAL -2 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -2 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -2 MONTH)), + (4, DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL -3 MONTH), INTERVAL +1 DAY), 1104, 1, 2, 124, 442, NULL, 'SALIX', 1,'10.01', DATE_ADD(util.VN_CURDATE(), INTERVAL -3 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -3 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -3 MONTH)), + (5, DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL -4 MONTH), INTERVAL +1 DAY), 1104, 1, 3, 124, 442, NULL, 'SALIX', 1,'10.01', DATE_ADD(util.VN_CURDATE(), INTERVAL -4 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -4 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -4 MONTH)), + (6, DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL -1 MONTH), INTERVAL +1 DAY), 1101, 1, 3, 1, 442, NULL, 'SALIX', 1,'10.01', DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH)), + (7, DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1101, 2, 7, 1, 442, NULL, 'SALIX', 0,'10.01', util.VN_CURDATE(), util.VN_CURDATE(), util.VN_CURDATE()), + (8, DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1101, 2, 7, 121, 442, NULL, 'SALIX', 0,'123.53', util.VN_CURDATE(), util.VN_CURDATE(), util.VN_CURDATE()), + (9, DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1104, 2, 7, 124, 442, NULL, 'SALIX', 0,'10.01', util.VN_CURDATE(), util.VN_CURDATE(), util.VN_CURDATE()), + (10, DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1102, 3, 1, 2, 442, NULL, 'SALIX', 0,'10.01', util.VN_CURDATE(), util.VN_CURDATE(), util.VN_CURDATE()), + (11, DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1102, 2, 7, 122, 442, NULL, 'SALIX', 0,'60.90', util.VN_CURDATE(), util.VN_CURDATE(), util.VN_CURDATE()), + (12, DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1103, 3, 1, 3, 442, NULL, 'SALIX', 0,'72.60', util.VN_CURDATE(), util.VN_CURDATE(), util.VN_CURDATE()), + (13, DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1103, 1, 2, 123, 442, NULL, 'SALIX', 0,'72.60', util.VN_CURDATE(), util.VN_CURDATE(), util.VN_CURDATE()), + (14, DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1104, 1, 2, 4, 442, NULL, 'SALIX', 0,'72.60', util.VN_CURDATE(), util.VN_CURDATE(), util.VN_CURDATE()), + (15, DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1105, 1, 3, 125, 442, NULL, 'SALIX', 0,'72.60', util.VN_CURDATE(), util.VN_CURDATE(), util.VN_CURDATE()), + (16, DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1106, 2, 7, 126, 442, NULL, 'SALIX', 0,'155.89', util.VN_CURDATE(), util.VN_CURDATE(), util.VN_CURDATE()), + (17, DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1107, 1, 4, 127, 442, NULL, 'SALIX', 0,'72.60', util.VN_CURDATE(), util.VN_CURDATE(), util.VN_CURDATE()), + (18, DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1108, 1, 4, 128, 442, NULL, 'SALIX', 0,'72.60', util.VN_CURDATE(), util.VN_CURDATE(), util.VN_CURDATE()), + (19, DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1109, 1, 5, 129, 442, NULL, 'SALIX', 0,'16.50', util.VN_CURDATE(), util.VN_CURDATE(), util.VN_CURDATE()), + (20, DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL +1 MONTH), INTERVAL +1 DAY), 1109, 1, 5, 101, 442, NULL, 'SALIX', 0,'21.45', DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH)), + (21, DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL +1 MONTH), INTERVAL +1 DAY), 1109, 1, 5, 102, 442, NULL, 'SALIX', 0,'0.00', DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH)), + (22, DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL +1 MONTH), INTERVAL +1 DAY), 1109, 1, 5, 103, 442, NULL, 'SALIX', 0,'148.50', DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH)); INSERT INTO `hedera`.`orderRow`(`id`, `orderFk`, `itemFk`, `warehouseFk`, `shipment`, `amount`, `price`, `rate`, `created`, `saleFk`) VALUES - (1, 1, 1, 1, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 5, 9.10, 0, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 1), - (2, 1, 2, 1, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 10, 1.07, 0, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 2), - (3, 1, 1, 1, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 2, 9.10, 0, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 3), - (4, 1, 4, 1, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 20, 3.06, 0, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 4), - (5, 2, 1, 1, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 10, 9.10, 0, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 5), - (6, 3, 1, 2, DATE_ADD(CURDATE(), INTERVAL -2 MONTH), 15, 6.50, 0, DATE_ADD(CURDATE(), INTERVAL -2 MONTH), 6), - (7, 11, 2, 1, CURDATE(), 15, 1.30, 0, CURDATE(), 7), - (8, 11, 4, 1, CURDATE(), 10, 3.26, 0, CURDATE(), 8), - (9, 16, 1, 1, CURDATE(), 5, 9.10, 0, CURDATE(), 9), - (10, 16, 2, 1, CURDATE(), 10, 1.07, 0, CURDATE(), 10), - (11, 16, 1, 1, CURDATE(), 2, 9.10, 0, CURDATE(), 11), - (12, 16, 4, 1, CURDATE(), 20, 3.06, 0, CURDATE(), 12), - (13, 8, 2, 1, CURDATE(), 15, 1.30, 0, CURDATE(), 13), - (14, 8, 1, 1, CURDATE(), 10, 9.28, 0, CURDATE(), 14), - (15, 19, 1, 1, CURDATE(), 10, 1.50, 0, CURDATE(), 15), - (16, 20, 2, 1, CURDATE(), 15, 1.30, 0, CURDATE(), 16), - (17, 22, 2, 1, DATE_ADD(CURDATE(), INTERVAL +1 MONTH), 30, 2.30, 0, DATE_ADD(CURDATE(), INTERVAL +1 MONTH), 17), - (18, 22, 4, 1, DATE_ADD(CURDATE(), INTERVAL +1 MONTH), 20, 3.00, 0, DATE_ADD(CURDATE(), INTERVAL +1 MONTH), 18), - (19, 4, 1, 1, DATE_ADD(CURDATE(), INTERVAL -3 MONTH), 1, 9.10, 0, DATE_ADD(CURDATE(), INTERVAL -3 MONTH), 19), - (20, 5, 1, 1, DATE_ADD(CURDATE(), INTERVAL -4 MONTH), 1, 9.10, 0, DATE_ADD(CURDATE(), INTERVAL -4 MONTH), 20), - (21, 6, 1, 1, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 1, 9.10, 0, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 21), - (22, 7, 1, 1, CURDATE(), 1, 9.10, 0, CURDATE(), 22), - (23, 9, 1, 1, CURDATE(), 1, 9.10, 0, CURDATE(), 23), - (24, 10, 1, 1, CURDATE(), 1, 9.10, 0, CURDATE(), 24), - (25, 12, 4, 1, CURDATE(), 20, 3.00, 0, CURDATE(), 25), - (26, 13, 4, 1, CURDATE(), 20, 3.00, 0, CURDATE(), 26), - (27, 14, 4, 1, CURDATE(), 20, 3.00, 0, CURDATE(), 27), - (28, 15, 4, 1, CURDATE(), 20, 3.00, 0, CURDATE(), 28), - (29, 17, 4, 1, CURDATE(), 20, 3.00, 0, CURDATE(), 29), - (30, 18, 4, 1, CURDATE(), 20, 3.00, 0, CURDATE(), 30); + (1, 1, 1, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 5, 9.10, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 1), + (2, 1, 2, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 10, 1.07, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 2), + (3, 1, 1, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 2, 9.10, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 3), + (4, 1, 4, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 20, 3.06, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 4), + (5, 2, 1, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 10, 9.10, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 5), + (6, 3, 1, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -2 MONTH), 15, 6.50, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL -2 MONTH), 6), + (7, 11, 2, 1, util.VN_CURDATE(), 15, 1.30, 0, util.VN_CURDATE(), 7), + (8, 11, 4, 1, util.VN_CURDATE(), 10, 3.26, 0, util.VN_CURDATE(), 8), + (9, 16, 1, 1, util.VN_CURDATE(), 5, 9.10, 0, util.VN_CURDATE(), 9), + (10, 16, 2, 1, util.VN_CURDATE(), 10, 1.07, 0, util.VN_CURDATE(), 10), + (11, 16, 1, 1, util.VN_CURDATE(), 2, 9.10, 0, util.VN_CURDATE(), 11), + (12, 16, 4, 1, util.VN_CURDATE(), 20, 3.06, 0, util.VN_CURDATE(), 12), + (13, 8, 2, 1, util.VN_CURDATE(), 15, 1.30, 0, util.VN_CURDATE(), 13), + (14, 8, 1, 1, util.VN_CURDATE(), 10, 9.28, 0, util.VN_CURDATE(), 14), + (15, 19, 1, 1, util.VN_CURDATE(), 10, 1.50, 0, util.VN_CURDATE(), 15), + (16, 20, 2, 1, util.VN_CURDATE(), 15, 1.30, 0, util.VN_CURDATE(), 16), + (17, 22, 2, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), 30, 2.30, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), 17), + (18, 22, 4, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), 20, 3.00, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), 18), + (19, 4, 1, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -3 MONTH), 1, 9.10, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL -3 MONTH), 19), + (20, 5, 1, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -4 MONTH), 1, 9.10, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL -4 MONTH), 20), + (21, 6, 1, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 1, 9.10, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 21), + (22, 7, 1, 1, util.VN_CURDATE(), 1, 9.10, 0, util.VN_CURDATE(), 22), + (23, 9, 1, 1, util.VN_CURDATE(), 1, 9.10, 0, util.VN_CURDATE(), 23), + (24, 10, 1, 1, util.VN_CURDATE(), 1, 9.10, 0, util.VN_CURDATE(), 24), + (25, 12, 4, 1, util.VN_CURDATE(), 20, 3.00, 0, util.VN_CURDATE(), 25), + (26, 13, 4, 1, util.VN_CURDATE(), 20, 3.00, 0, util.VN_CURDATE(), 26), + (27, 14, 4, 1, util.VN_CURDATE(), 20, 3.00, 0, util.VN_CURDATE(), 27), + (28, 15, 4, 1, util.VN_CURDATE(), 20, 3.00, 0, util.VN_CURDATE(), 28), + (29, 17, 4, 1, util.VN_CURDATE(), 20, 3.00, 0, util.VN_CURDATE(), 29), + (30, 18, 4, 1, util.VN_CURDATE(), 20, 3.00, 0, util.VN_CURDATE(), 30); INSERT INTO `hedera`.`orderRowComponent`(`rowFk`, `componentFk`, `price`) VALUES @@ -1661,43 +1661,43 @@ INSERT INTO `hedera`.`visitAgent`(`id`, `visitFk`) INSERT INTO `hedera`.`visitAccess`(`id`, `agentFk`, `stamp`) VALUES - (1, 1, CURDATE()), - (2, 2, CURDATE()), - (3, 3, CURDATE()), - (4, 4, CURDATE()), - (5, 5, CURDATE()), - (6, 6, CURDATE()), - (7, 7, CURDATE()), - (8, 8, CURDATE()), - (9, 9, CURDATE()), - (10, 10, CURDATE()), - (11, 11, CURDATE()); + (1, 1, util.VN_CURDATE()), + (2, 2, util.VN_CURDATE()), + (3, 3, util.VN_CURDATE()), + (4, 4, util.VN_CURDATE()), + (5, 5, util.VN_CURDATE()), + (6, 6, util.VN_CURDATE()), + (7, 7, util.VN_CURDATE()), + (8, 8, util.VN_CURDATE()), + (9, 9, util.VN_CURDATE()), + (10, 10, util.VN_CURDATE()), + (11, 11, util.VN_CURDATE()); INSERT INTO `hedera`.`visitUser`(`id`, `accessFk`, `userFk`, `stamp`) VALUES - (1, 1, 1101, CURDATE()), - (2, 2, 1101, CURDATE()), - (3, 3, 1101, CURDATE()), - (4, 4, 1102, CURDATE()), - (5, 5, 1102, CURDATE()), - (6, 6, 1102, CURDATE()), - (7, 7, 1103, CURDATE()), - (8, 8, 1103, CURDATE()), - (9, 9, 1103, CURDATE()), - (10, 10, 1102, DATE_SUB(CURDATE(), INTERVAL 1 DAY)), - (11, 11, 1103, DATE_SUB(CURDATE(), INTERVAL 1 DAY)); + (1, 1, 1101, util.VN_CURDATE()), + (2, 2, 1101, util.VN_CURDATE()), + (3, 3, 1101, util.VN_CURDATE()), + (4, 4, 1102, util.VN_CURDATE()), + (5, 5, 1102, util.VN_CURDATE()), + (6, 6, 1102, util.VN_CURDATE()), + (7, 7, 1103, util.VN_CURDATE()), + (8, 8, 1103, util.VN_CURDATE()), + (9, 9, 1103, util.VN_CURDATE()), + (10, 10, 1102, DATE_SUB(util.VN_CURDATE(), INTERVAL 1 DAY)), + (11, 11, 1103, DATE_SUB(util.VN_CURDATE(), INTERVAL 1 DAY)); INSERT INTO `hedera`.`userSession`(`created`, `lastUpdate`, `ssid`, `data`, `userVisitFk`) VALUES - (CURDATE(), CURDATE(), '121', 'data', 1), - (CURDATE(), CURDATE(), '122', 'data', 2), - (CURDATE(), CURDATE(), '123', 'data', 3), - (CURDATE(), CURDATE(), '124', 'data', 4), - (CURDATE(), CURDATE(), '125', 'data', 5), - (CURDATE(), CURDATE(), '126', 'data', 6), - (CURDATE(), CURDATE(), '127', 'data', 7), - (CURDATE(), CURDATE(), '128', 'data', 8), - (CURDATE(), CURDATE(), '129', 'data', 9); + (util.VN_CURDATE(), util.VN_CURDATE(), '121', 'data', 1), + (util.VN_CURDATE(), util.VN_CURDATE(), '122', 'data', 2), + (util.VN_CURDATE(), util.VN_CURDATE(), '123', 'data', 3), + (util.VN_CURDATE(), util.VN_CURDATE(), '124', 'data', 4), + (util.VN_CURDATE(), util.VN_CURDATE(), '125', 'data', 5), + (util.VN_CURDATE(), util.VN_CURDATE(), '126', 'data', 6), + (util.VN_CURDATE(), util.VN_CURDATE(), '127', 'data', 7), + (util.VN_CURDATE(), util.VN_CURDATE(), '128', 'data', 8), + (util.VN_CURDATE(), util.VN_CURDATE(), '129', 'data', 9); INSERT INTO `vn`.`clientContact`(`id`, `clientFk`, `name`, `phone`) VALUES @@ -1721,11 +1721,11 @@ call vn.manaSpellersRequery(18); INSERT INTO `vn`.`clientSample`(`id`, `clientFk`, `typeFk`, `created`, `workerFk`, `userFk`, `companyFk`) VALUES - (1, 1101, 1, CURDATE(), 18, 18, 442), - (2, 1101, 1, CURDATE(), 18, 18, 442), - (3, 1101, 2, CURDATE(), 18, 18, 442), - (4, 1102, 2, CURDATE(), 18, 18, 567), - (5, 1102, 3, CURDATE(), 19, 19, 567); + (1, 1101, 1, util.VN_CURDATE(), 18, 18, 442), + (2, 1101, 1, util.VN_CURDATE(), 18, 18, 442), + (3, 1101, 2, util.VN_CURDATE(), 18, 18, 442), + (4, 1102, 2, util.VN_CURDATE(), 18, 18, 567), + (5, 1102, 3, util.VN_CURDATE(), 19, 19, 567); INSERT INTO `vn`.`claimState`(`id`, `code`, `description`, `roleFk`, `priority`, `hasToNotify`) VALUES @@ -1739,10 +1739,10 @@ INSERT INTO `vn`.`claimState`(`id`, `code`, `description`, `roleFk`, `priority`, INSERT INTO `vn`.`claim`(`id`, `ticketCreated`, `claimStateFk`, `observation`, `clientFk`, `workerFk`, `responsibility`, `isChargedToMana`, `created`, `packages`) VALUES - (1, CURDATE(), 1, 'Cu nam labores lobortis definiebas, ei aliquyam salutatus persequeris quo, cum eu nemore fierent dissentiunt. Per vero dolor id, vide democritum scribentur eu vim, pri erroribus temporibus ex.', 1101, 18, 3, 0, CURDATE(), 0), - (2, CURDATE(), 2, 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.', 1101, 18, 3, 0, CURDATE(), 1), - (3, CURDATE(), 3, 'An vim commodo dolorem volutpat, cu expetendis voluptatum usu, et mutat consul adversarium his. His natum numquam legimus an, diam fabulas mei ut. Melius fabellas sadipscing vel id. Partem diceret mandamus mea ne, has te tempor nostrud. Aeque nostro eum no.', 1101, 18, 1, 1, CURDATE(), 5), - (4, CURDATE(), 3, 'Wisi forensibus mnesarchum in cum. Per id impetus abhorreant, his no magna definiebas, inani rationibus in quo. Ut vidisse dolores est, ut quis nominavi mel. Ad pri quod apeirian concludaturque.', 1104, 18, 5, 0, CURDATE(), 10); + (1, util.VN_CURDATE(), 1, 'Cu nam labores lobortis definiebas, ei aliquyam salutatus persequeris quo, cum eu nemore fierent dissentiunt. Per vero dolor id, vide democritum scribentur eu vim, pri erroribus temporibus ex.', 1101, 18, 3, 0, util.VN_CURDATE(), 0), + (2, util.VN_CURDATE(), 2, 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.', 1101, 18, 3, 0, util.VN_CURDATE(), 1), + (3, util.VN_CURDATE(), 3, 'An vim commodo dolorem volutpat, cu expetendis voluptatum usu, et mutat consul adversarium his. His natum numquam legimus an, diam fabulas mei ut. Melius fabellas sadipscing vel id. Partem diceret mandamus mea ne, has te tempor nostrud. Aeque nostro eum no.', 1101, 18, 1, 1, util.VN_CURDATE(), 5), + (4, util.VN_CURDATE(), 3, 'Wisi forensibus mnesarchum in cum. Per id impetus abhorreant, his no magna definiebas, inani rationibus in quo. Ut vidisse dolores est, ut quis nominavi mel. Ad pri quod apeirian concludaturque.', 1104, 18, 5, 0, util.VN_CURDATE(), 10); INSERT INTO `vn`.`claimBeginning`(`id`, `claimFk`, `saleFk`, `quantity`) VALUES @@ -1779,12 +1779,12 @@ INSERT INTO `hedera`.`tpvMerchant`(`id`, `description`, `companyFk`, `bankFk`, ` INSERT INTO `hedera`.`tpvTransaction`(`id`,`merchantFk`, `clientFk`,`receiptFk`, `amount`, `response`, `errorCode`, `status`, `created`) VALUES - (1, 1, 1101, NULL, 2000, NULL, 'SIS0042', 'ok', CURDATE()), - (2, 1, 1101, NULL, 1000, NULL, 'SIS0051', 'started', CURDATE()), - (3, 2, 1101, NULL, 7268, NULL, NULL, 'ok', CURDATE()), - (4, 2, 1101, NULL, 4698, NULL, NULL, 'started', CURDATE()), - (5, 1, 1104, NULL, 2000, NULL, 'SIS0043', 'ok', CURDATE()), - (6, 2, 1104, NULL, 4000, NULL, 'SIS0044', 'started', CURDATE()); + (1, 1, 1101, NULL, 2000, NULL, 'SIS0042', 'ok', util.VN_CURDATE()), + (2, 1, 1101, NULL, 1000, NULL, 'SIS0051', 'started', util.VN_CURDATE()), + (3, 2, 1101, NULL, 7268, NULL, NULL, 'ok', util.VN_CURDATE()), + (4, 2, 1101, NULL, 4698, NULL, NULL, 'started', util.VN_CURDATE()), + (5, 1, 1104, NULL, 2000, NULL, 'SIS0043', 'ok', util.VN_CURDATE()), + (6, 2, 1104, NULL, 4000, NULL, 'SIS0044', 'started', util.VN_CURDATE()); INSERT INTO `vn`.`orderTicket`(`orderFk`, `ticketFk`) VALUES @@ -1820,10 +1820,10 @@ INSERT INTO `vn`.`userConfig` (`userFk`, `warehouseFk`, `companyFk`) INSERT INTO `vn`.`receipt`(`id`, `invoiceFk`, `amountPaid`, `payed`, `workerFk`, `bankFk`, `clientFk`, `created`, `companyFk`, `isConciliate`) VALUES - (1, 'Cobro web', 100.50, CURDATE(), 9, 1, 1101, CURDATE(), 442, 1), - (2, 'Cobro web', 200.50, DATE_ADD(CURDATE(), INTERVAL -5 DAY), 9, 1, 1101, DATE_ADD(CURDATE(), INTERVAL -5 DAY), 442, 1), - (3, 'Cobro en efectivo', 300.00, DATE_ADD(CURDATE(), INTERVAL -10 DAY), 9, 1, 1102, DATE_ADD(CURDATE(), INTERVAL -10 DAY), 442, 0), - (4, 'Cobro en efectivo', 400.00, DATE_ADD(CURDATE(), INTERVAL -15 DAY), 9, 1, 1103, DATE_ADD(CURDATE(), INTERVAL -15 DAY), 442, 0); + (1, 'Cobro web', 100.50, util.VN_CURDATE(), 9, 1, 1101, util.VN_CURDATE(), 442, 1), + (2, 'Cobro web', 200.50, DATE_ADD(util.VN_CURDATE(), INTERVAL -5 DAY), 9, 1, 1101, DATE_ADD(util.VN_CURDATE(), INTERVAL -5 DAY), 442, 1), + (3, 'Cobro en efectivo', 300.00, DATE_ADD(util.VN_CURDATE(), INTERVAL -10 DAY), 9, 1, 1102, DATE_ADD(util.VN_CURDATE(), INTERVAL -10 DAY), 442, 0), + (4, 'Cobro en efectivo', 400.00, DATE_ADD(util.VN_CURDATE(), INTERVAL -15 DAY), 9, 1, 1103, DATE_ADD(util.VN_CURDATE(), INTERVAL -15 DAY), 442, 0); INSERT INTO `vn`.`workerTeam`(`id`, `team`, `workerFk`) VALUES @@ -1837,11 +1837,11 @@ INSERT INTO `vn`.`workerTeam`(`id`, `team`, `workerFk`) INSERT INTO `vn`.`ticketRequest`(`id`, `description`, `requesterFk`, `attenderFk`, `quantity`, `itemFk`, `price`, `isOk`, `saleFk`, `ticketFk`, `created`) VALUES - (1, 'Ranged weapon longbow 2m', 18, 35, 5, 1, 9.10, 1, 1, 1, DATE_ADD(CURDATE(), INTERVAL -15 DAY)), - (2, 'Melee weapon combat first 15cm', 18, 35, 10, 2, 1.07, 0, NULL, 1, DATE_ADD(CURDATE(), INTERVAL -15 DAY)), - (3, 'Melee weapon heavy shield 1x0.5m', 18, 35, 20, NULL, 3.06, NULL, NULL, 23, CURDATE()), - (4, 'Melee weapon combat first 15cm', 18, 35, 15, NULL, 1.30, NULL, NULL, 11, CURDATE()), - (5, 'Melee weapon combat first 15cm', 18, 35, 15, 4, 1.30, 0, NULL, 18, CURDATE()); + (1, 'Ranged weapon longbow 2m', 18, 35, 5, 1, 9.10, 1, 1, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -15 DAY)), + (2, 'Melee weapon combat first 15cm', 18, 35, 10, 2, 1.07, 0, NULL, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -15 DAY)), + (3, 'Melee weapon heavy shield 1x0.5m', 18, 35, 20, NULL, 3.06, NULL, NULL, 23, util.VN_CURDATE()), + (4, 'Melee weapon combat first 15cm', 18, 35, 15, NULL, 1.30, NULL, NULL, 11, util.VN_CURDATE()), + (5, 'Melee weapon combat first 15cm', 18, 35, 15, 4, 1.30, 0, NULL, 18, util.VN_CURDATE()); INSERT INTO `vn`.`ticketServiceType`(`id`, `name`, `expenceFk`) VALUES @@ -1880,7 +1880,7 @@ INSERT INTO `postgresql`.`profile`(`profile_id`, `person_id`, `profile_type_id`) FROM `postgresql`.`person` `p`; INSERT INTO `postgresql`.`business`(`business_id`, `client_id`, `provider_id`, `date_start`, `date_end`, `workerBusiness`, `reasonEndFk`) - SELECT p.profile_id, p.profile_id, 1000, CONCAT(YEAR(DATE_ADD(CURDATE(), INTERVAL -1 YEAR)), '-12-25'), CONCAT(YEAR(DATE_ADD(CURDATE(), INTERVAL +1 YEAR)), '-01-25'), CONCAT('E-46-',RPAD(CONCAT(p.profile_id,9),8,p.profile_id)), NULL + SELECT p.profile_id, p.profile_id, 1000, CONCAT(YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 YEAR)), '-12-25'), CONCAT(YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL +1 YEAR)), '-01-25'), CONCAT('E-46-',RPAD(CONCAT(p.profile_id,9),8,p.profile_id)), NULL FROM `postgresql`.`profile` `p`; INSERT INTO `postgresql`.`business_labour`(`business_id`, `notes`, `department_id`, `professional_category_id`, `incentivo`, `calendar_labour_type_id`, `porhoras`, `labour_agreement_id`, `workcenter_id`) @@ -1888,10 +1888,14 @@ INSERT INTO `postgresql`.`business_labour`(`business_id`, `notes`, `department_i FROM `postgresql`.`business` `b`; INSERT INTO `postgresql`.`business` (`client_id`, `provider_id`, `date_start`, `date_end`, `workerBusiness`, `reasonEndFk`) - SELECT p.profile_id, 1000, CONCAT(YEAR(DATE_ADD(CURDATE(), INTERVAL -2 YEAR)), '-12-25'), CONCAT(YEAR(DATE_ADD(CURDATE(), INTERVAL -1 YEAR)), '-12-24'), CONCAT('E-46-',RPAD(CONCAT(p.profile_id,9),8,p.profile_id)), NULL + SELECT p.profile_id, 1000, CONCAT(YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -2 YEAR)), '-12-25'), CONCAT(YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 YEAR)), '-12-24'), CONCAT('E-46-',RPAD(CONCAT(p.profile_id,9),8,p.profile_id)), NULL FROM `postgresql`.`profile` `p` WHERE `p`.`profile_id` = 1109; +UPDATE `postgresql`.`business` + SET `payedHolidays`= 8 + WHERE `business_id`= 1106; + INSERT INTO `postgresql`.`business_labour` (`business_id`, `notes`, `department_id`, `professional_category_id`, `incentivo`, `calendar_labour_type_id`, `porhoras`, `labour_agreement_id`, `workcenter_id`) VALUES (1111, NULL, 23, 1, 0.0, 1, 1, 1, 1); @@ -1919,15 +1923,15 @@ INSERT INTO `postgresql`.`profile_media`(`profile_media_id`, `profile_id`, `medi INSERT INTO `vn`.`workCenter` (`id`, `name`, `warehouseFk`) VALUES - ('1', 'Silla', '1'), + ('1', 'Gotham', '1'), ('5', 'Madrid', '5'); INSERT INTO `vn`.`workCenterHoliday` (`workCenterFk`, `days`, `year`) VALUES - ('1', '27.5', YEAR(CURDATE())), - ('5', '22', YEAR(CURDATE())), - ('1', '24.5', YEAR(DATE_ADD(CURDATE(), INTERVAL -1 YEAR))), - ('5', '23', YEAR(DATE_ADD(CURDATE(), INTERVAL -1 YEAR))); + ('1', '27.5', YEAR(util.VN_CURDATE())), + ('5', '22', YEAR(util.VN_CURDATE())), + ('1', '24.5', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 YEAR))), + ('5', '23', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 YEAR))); INSERT INTO `postgresql`.`calendar_state` (`calendar_state_id`, `type`, `rgb`, `code`, `holidayEntitlementRate`, `discountRate`) VALUES @@ -1955,21 +1959,21 @@ INSERT INTO `postgresql`.`business_labour_payroll` (`business_id`, `cod_tarifa`, INSERT INTO `postgresql`.`calendar_employee` (`business_id`, `calendar_state_id`, `date`) VALUES - (1, 6, IF(MONTH(CURDATE()) = 12 AND DAY(CURDATE()) > 10, DATE_ADD(CURDATE(), INTERVAL -10 DAY), DATE_ADD(CURDATE(), INTERVAL 10 DAY))), - (1106, 1, IF(MONTH(CURDATE()) = 12 AND DAY(CURDATE()) > 10, DATE_ADD(CURDATE(), INTERVAL -10 DAY), DATE_ADD(CURDATE(), INTERVAL 10 DAY))), - (1106, 1, IF(MONTH(CURDATE()) = 12 AND DAY(CURDATE()) > 10, DATE_ADD(CURDATE(), INTERVAL -11 DAY), DATE_ADD(CURDATE(), INTERVAL 11 DAY))), - (1106, 1, IF(MONTH(CURDATE()) = 12 AND DAY(CURDATE()) > 10, DATE_ADD(CURDATE(), INTERVAL -12 DAY), DATE_ADD(CURDATE(), INTERVAL 12 DAY))), - (1106, 1, IF(MONTH(CURDATE()) = 12 AND DAY(CURDATE()) > 10, DATE_ADD(CURDATE(), INTERVAL -20 DAY), DATE_ADD(CURDATE(), INTERVAL 20 DAY))), - (1106, 2, IF(MONTH(CURDATE()) >= 1 AND DAY(CURDATE()) > 20, DATE_ADD(CURDATE(), INTERVAL -13 DAY), DATE_ADD(CURDATE(), INTERVAL 8 DAY))), - (1106, 1, IF(MONTH(CURDATE()) >= 1 AND DAY(CURDATE()) > 20, DATE_ADD(CURDATE(), INTERVAL -14 DAY), DATE_ADD(CURDATE(), INTERVAL 9 DAY))), - (1106, 2, IF(MONTH(CURDATE()) >= 1 AND DAY(CURDATE()) > 20, DATE_ADD(CURDATE(), INTERVAL -15 DAY), DATE_ADD(CURDATE(), INTERVAL 7 DAY))), - (1107, 1, IF(MONTH(CURDATE()) = 12 AND DAY(CURDATE()) > 10, DATE_ADD(CURDATE(), INTERVAL -10 DAY), DATE_ADD(CURDATE(), INTERVAL 10 DAY))), - (1107, 1, IF(MONTH(CURDATE()) = 12 AND DAY(CURDATE()) > 10, DATE_ADD(CURDATE(), INTERVAL -11 DAY), DATE_ADD(CURDATE(), INTERVAL 11 DAY))), - (1107, 1, IF(MONTH(CURDATE()) = 12 AND DAY(CURDATE()) > 10, DATE_ADD(CURDATE(), INTERVAL -12 DAY), DATE_ADD(CURDATE(), INTERVAL 12 DAY))), - (1107, 1, IF(MONTH(CURDATE()) = 12 AND DAY(CURDATE()) > 10, DATE_ADD(CURDATE(), INTERVAL -20 DAY), DATE_ADD(CURDATE(), INTERVAL 20 DAY))), - (1107, 2, IF(MONTH(CURDATE()) >= 1 AND DAY(CURDATE()) > 20, DATE_ADD(CURDATE(), INTERVAL -13 DAY), DATE_ADD(CURDATE(), INTERVAL 8 DAY))), - (1107, 1, IF(MONTH(CURDATE()) >= 1 AND DAY(CURDATE()) > 20, DATE_ADD(CURDATE(), INTERVAL -14 DAY), DATE_ADD(CURDATE(), INTERVAL 9 DAY))), - (1107, 2, IF(MONTH(CURDATE()) >= 1 AND DAY(CURDATE()) > 20, DATE_ADD(CURDATE(), INTERVAL -15 DAY), DATE_ADD(CURDATE(), INTERVAL 7 DAY))); + (1, 6, IF(MONTH(util.VN_CURDATE()) = 12 AND DAY(util.VN_CURDATE()) > 10, DATE_ADD(util.VN_CURDATE(), INTERVAL -10 DAY), DATE_ADD(util.VN_CURDATE(), INTERVAL 10 DAY))), + (1106, 1, IF(MONTH(util.VN_CURDATE()) = 12 AND DAY(util.VN_CURDATE()) > 10, DATE_ADD(util.VN_CURDATE(), INTERVAL -10 DAY), DATE_ADD(util.VN_CURDATE(), INTERVAL 10 DAY))), + (1106, 1, IF(MONTH(util.VN_CURDATE()) = 12 AND DAY(util.VN_CURDATE()) > 10, DATE_ADD(util.VN_CURDATE(), INTERVAL -11 DAY), DATE_ADD(util.VN_CURDATE(), INTERVAL 11 DAY))), + (1106, 1, IF(MONTH(util.VN_CURDATE()) = 12 AND DAY(util.VN_CURDATE()) > 10, DATE_ADD(util.VN_CURDATE(), INTERVAL -12 DAY), DATE_ADD(util.VN_CURDATE(), INTERVAL 12 DAY))), + (1106, 1, IF(MONTH(util.VN_CURDATE()) = 12 AND DAY(util.VN_CURDATE()) > 10, DATE_ADD(util.VN_CURDATE(), INTERVAL -20 DAY), DATE_ADD(util.VN_CURDATE(), INTERVAL 20 DAY))), + (1106, 2, IF(MONTH(util.VN_CURDATE()) >= 1 AND DAY(util.VN_CURDATE()) > 20, DATE_ADD(util.VN_CURDATE(), INTERVAL -13 DAY), DATE_ADD(util.VN_CURDATE(), INTERVAL 8 DAY))), + (1106, 1, IF(MONTH(util.VN_CURDATE()) >= 1 AND DAY(util.VN_CURDATE()) > 20, DATE_ADD(util.VN_CURDATE(), INTERVAL -14 DAY), DATE_ADD(util.VN_CURDATE(), INTERVAL 9 DAY))), + (1106, 2, IF(MONTH(util.VN_CURDATE()) >= 1 AND DAY(util.VN_CURDATE()) > 20, DATE_ADD(util.VN_CURDATE(), INTERVAL -15 DAY), DATE_ADD(util.VN_CURDATE(), INTERVAL 7 DAY))), + (1107, 1, IF(MONTH(util.VN_CURDATE()) = 12 AND DAY(util.VN_CURDATE()) > 10, DATE_ADD(util.VN_CURDATE(), INTERVAL -10 DAY), DATE_ADD(util.VN_CURDATE(), INTERVAL 10 DAY))), + (1107, 1, IF(MONTH(util.VN_CURDATE()) = 12 AND DAY(util.VN_CURDATE()) > 10, DATE_ADD(util.VN_CURDATE(), INTERVAL -11 DAY), DATE_ADD(util.VN_CURDATE(), INTERVAL 11 DAY))), + (1107, 1, IF(MONTH(util.VN_CURDATE()) = 12 AND DAY(util.VN_CURDATE()) > 10, DATE_ADD(util.VN_CURDATE(), INTERVAL -12 DAY), DATE_ADD(util.VN_CURDATE(), INTERVAL 12 DAY))), + (1107, 1, IF(MONTH(util.VN_CURDATE()) = 12 AND DAY(util.VN_CURDATE()) > 10, DATE_ADD(util.VN_CURDATE(), INTERVAL -20 DAY), DATE_ADD(util.VN_CURDATE(), INTERVAL 20 DAY))), + (1107, 2, IF(MONTH(util.VN_CURDATE()) >= 1 AND DAY(util.VN_CURDATE()) > 20, DATE_ADD(util.VN_CURDATE(), INTERVAL -13 DAY), DATE_ADD(util.VN_CURDATE(), INTERVAL 8 DAY))), + (1107, 1, IF(MONTH(util.VN_CURDATE()) >= 1 AND DAY(util.VN_CURDATE()) > 20, DATE_ADD(util.VN_CURDATE(), INTERVAL -14 DAY), DATE_ADD(util.VN_CURDATE(), INTERVAL 9 DAY))), + (1107, 2, IF(MONTH(util.VN_CURDATE()) >= 1 AND DAY(util.VN_CURDATE()) > 20, DATE_ADD(util.VN_CURDATE(), INTERVAL -15 DAY), DATE_ADD(util.VN_CURDATE(), INTERVAL 7 DAY))); INSERT INTO `vn`.`smsConfig` (`id`, `uri`, `title`, `apiKey`) VALUES @@ -1977,12 +1981,12 @@ INSERT INTO `vn`.`smsConfig` (`id`, `uri`, `title`, `apiKey`) INSERT INTO `vn`.`sharingClient`(`id`, `workerFk`, `started`, `ended`, `clientFk`) VALUES - (1, 19, DATE_ADD(CURDATE(), INTERVAL -5 DAY), DATE_ADD(CURDATE(), INTERVAL +15 DAY), 1101), - (2, 18, DATE_ADD(CURDATE(), INTERVAL -5 DAY), DATE_ADD(CURDATE(), INTERVAL +15 DAY), 1106); + (1, 19, DATE_ADD(util.VN_CURDATE(), INTERVAL -5 DAY), DATE_ADD(util.VN_CURDATE(), INTERVAL +15 DAY), 1101), + (2, 18, DATE_ADD(util.VN_CURDATE(), INTERVAL -5 DAY), DATE_ADD(util.VN_CURDATE(), INTERVAL +15 DAY), 1106); INSERT INTO `vn`.`sharingCart`(`id`, `workerFk`, `started`, `ended`, `workerSubstitute`, `created`) VALUES - (1, 18, DATE_ADD(CURDATE(), INTERVAL -5 DAY), DATE_ADD(CURDATE(), INTERVAL +15 DAY), 19, DATE_ADD(CURDATE(), INTERVAL -5 DAY)); + (1, 18, DATE_ADD(util.VN_CURDATE(), INTERVAL -5 DAY), DATE_ADD(util.VN_CURDATE(), INTERVAL +15 DAY), 19, DATE_ADD(util.VN_CURDATE(), INTERVAL -5 DAY)); CALL `vn`.zoneGeo_calcTree(); -- this is an auto calculate for table vn.zoneGeo, columns: path,lft,rgt,depth,sons @@ -2024,211 +2028,211 @@ INSERT INTO `vn`.`zoneIncluded` (`zoneFk`, `geoFk`, `isIncluded`) INSERT INTO `vn`.`zoneEvent`(`zoneFk`, `type`, `dated`) VALUES - (1, 'day', DATE_ADD(CURDATE(), INTERVAL (IF(DAYOFWEEK(CURDATE())<=2, 2, 9) - DAYOFWEEK(CURDATE())) DAY)), - (1, 'day', DATE_ADD(CURDATE(), INTERVAL (IF(DAYOFWEEK(CURDATE())<=3, 3, 10) - DAYOFWEEK(CURDATE())) DAY)), - (1, 'day', DATE_ADD(CURDATE(), INTERVAL (IF(DAYOFWEEK(CURDATE())<=4, 4, 11) - DAYOFWEEK(CURDATE())) DAY)), - (1, 'day', DATE_ADD(CURDATE(), INTERVAL (IF(DAYOFWEEK(CURDATE())<=5, 5, 12) - DAYOFWEEK(CURDATE())) DAY)), - (1, 'day', DATE_ADD(CURDATE(), INTERVAL (IF(DAYOFWEEK(CURDATE())<=6, 6, 13) - DAYOFWEEK(CURDATE())) DAY)), - (2, 'day', DATE_ADD(CURDATE(), INTERVAL (IF(DAYOFWEEK(CURDATE())<=2, 2, 9) - DAYOFWEEK(CURDATE())) DAY)), - (2, 'day', DATE_ADD(CURDATE(), INTERVAL (IF(DAYOFWEEK(CURDATE())<=3, 3, 10) - DAYOFWEEK(CURDATE())) DAY)), - (2, 'day', DATE_ADD(CURDATE(), INTERVAL (IF(DAYOFWEEK(CURDATE())<=4, 4, 11) - DAYOFWEEK(CURDATE())) DAY)), - (2, 'day', DATE_ADD(CURDATE(), INTERVAL (IF(DAYOFWEEK(CURDATE())<=5, 5, 12) - DAYOFWEEK(CURDATE())) DAY)), - (2, 'day', DATE_ADD(CURDATE(), INTERVAL (IF(DAYOFWEEK(CURDATE())<=6, 6, 13) - DAYOFWEEK(CURDATE())) DAY)), - (3, 'day', CURDATE()), - (3, 'day', DATE_ADD(CURDATE(), INTERVAL +1 DAY)), - (3, 'day', DATE_ADD(CURDATE(), INTERVAL +2 DAY)), - (3, 'day', DATE_ADD(CURDATE(), INTERVAL +3 DAY)), - (3, 'day', DATE_ADD(CURDATE(), INTERVAL +4 DAY)), - (3, 'day', DATE_ADD(CURDATE(), INTERVAL +5 DAY)), - (3, 'day', DATE_ADD(CURDATE(), INTERVAL +6 DAY)), - (3, 'day', DATE_ADD(CURDATE(), INTERVAL +7 DAY)), - (3, 'day', DATE_ADD(CURDATE(), INTERVAL +8 DAY)), - (3, 'day', DATE_ADD(CURDATE(), INTERVAL +9 DAY)), - (3, 'day', DATE_ADD(CURDATE(), INTERVAL +10 DAY)), - (3, 'day', DATE_ADD(CURDATE(), INTERVAL +11 DAY)), - (3, 'day', DATE_ADD(CURDATE(), INTERVAL +12 DAY)), - (3, 'day', DATE_ADD(CURDATE(), INTERVAL +13 DAY)), - (3, 'day', DATE_ADD(CURDATE(), INTERVAL +14 DAY)), - (3, 'day', DATE_ADD(CURDATE(), INTERVAL +15 DAY)), - (3, 'day', DATE_ADD(CURDATE(), INTERVAL +16 DAY)), - (3, 'day', DATE_ADD(CURDATE(), INTERVAL +17 DAY)), - (3, 'day', DATE_ADD(CURDATE(), INTERVAL +18 DAY)), - (3, 'day', DATE_ADD(CURDATE(), INTERVAL +19 DAY)), - (3, 'day', DATE_ADD(CURDATE(), INTERVAL +20 DAY)), - (3, 'day', DATE_ADD(CURDATE(), INTERVAL +21 DAY)), - (3, 'day', DATE_ADD(CURDATE(), INTERVAL +22 DAY)), - (3, 'day', DATE_ADD(CURDATE(), INTERVAL +23 DAY)), - (3, 'day', DATE_ADD(CURDATE(), INTERVAL +24 DAY)), - (3, 'day', DATE_ADD(CURDATE(), INTERVAL +25 DAY)), - (3, 'day', DATE_ADD(CURDATE(), INTERVAL +26 DAY)), - (3, 'day', DATE_ADD(CURDATE(), INTERVAL +27 DAY)), - (3, 'day', DATE_ADD(CURDATE(), INTERVAL +28 DAY)), - (3, 'day', DATE_ADD(CURDATE(), INTERVAL +29 DAY)), - (3, 'day', DATE_ADD(CURDATE(), INTERVAL +30 DAY)), - (3, 'day', DATE_ADD(CURDATE(), INTERVAL +31 DAY)), - (3, 'day', DATE_ADD(CURDATE(), INTERVAL +32 DAY)), - (3, 'day', DATE_ADD(CURDATE(), INTERVAL +33 DAY)), - (3, 'day', DATE_ADD(CURDATE(), INTERVAL +34 DAY)), - (3, 'day', DATE_ADD(CURDATE(), INTERVAL +35 DAY)), - (3, 'day', DATE_ADD(CURDATE(), INTERVAL +36 DAY)), - (3, 'day', DATE_ADD(CURDATE(), INTERVAL +37 DAY)), - (3, 'day', DATE_ADD(CURDATE(), INTERVAL +38 DAY)), - (3, 'day', DATE_ADD(CURDATE(), INTERVAL +39 DAY)), - (3, 'day', DATE_ADD(CURDATE(), INTERVAL +40 DAY)), - (3, 'day', DATE_ADD(CURDATE(), INTERVAL +41 DAY)), - (3, 'day', DATE_ADD(CURDATE(), INTERVAL +42 DAY)), - (3, 'day', DATE_ADD(CURDATE(), INTERVAL +43 DAY)), - (3, 'day', DATE_ADD(CURDATE(), INTERVAL +44 DAY)), - (3, 'day', DATE_ADD(CURDATE(), INTERVAL +45 DAY)), - (3, 'day', DATE_ADD(CURDATE(), INTERVAL +46 DAY)), - (4, 'day', CURDATE()), - (4, 'day', DATE_ADD(CURDATE(), INTERVAL +1 DAY)), - (4, 'day', DATE_ADD(CURDATE(), INTERVAL +2 DAY)), - (4, 'day', DATE_ADD(CURDATE(), INTERVAL +3 DAY)), - (4, 'day', DATE_ADD(CURDATE(), INTERVAL +4 DAY)), - (4, 'day', DATE_ADD(CURDATE(), INTERVAL +5 DAY)), - (4, 'day', DATE_ADD(CURDATE(), INTERVAL +6 DAY)), - (4, 'day', DATE_ADD(CURDATE(), INTERVAL +7 DAY)), - (4, 'day', DATE_ADD(CURDATE(), INTERVAL +8 DAY)), - (4, 'day', DATE_ADD(CURDATE(), INTERVAL +9 DAY)), - (4, 'day', DATE_ADD(CURDATE(), INTERVAL +10 DAY)), - (4, 'day', DATE_ADD(CURDATE(), INTERVAL +11 DAY)), - (4, 'day', DATE_ADD(CURDATE(), INTERVAL +12 DAY)), - (4, 'day', DATE_ADD(CURDATE(), INTERVAL +13 DAY)), - (4, 'day', DATE_ADD(CURDATE(), INTERVAL +14 DAY)), - (4, 'day', DATE_ADD(CURDATE(), INTERVAL +15 DAY)), - (4, 'day', DATE_ADD(CURDATE(), INTERVAL +16 DAY)), - (4, 'day', DATE_ADD(CURDATE(), INTERVAL +17 DAY)), - (4, 'day', DATE_ADD(CURDATE(), INTERVAL +18 DAY)), - (4, 'day', DATE_ADD(CURDATE(), INTERVAL +19 DAY)), - (4, 'day', DATE_ADD(CURDATE(), INTERVAL +20 DAY)), - (4, 'day', DATE_ADD(CURDATE(), INTERVAL +21 DAY)), - (4, 'day', DATE_ADD(CURDATE(), INTERVAL +22 DAY)), - (4, 'day', DATE_ADD(CURDATE(), INTERVAL +23 DAY)), - (4, 'day', DATE_ADD(CURDATE(), INTERVAL +24 DAY)), - (4, 'day', DATE_ADD(CURDATE(), INTERVAL +25 DAY)), - (4, 'day', DATE_ADD(CURDATE(), INTERVAL +26 DAY)), - (4, 'day', DATE_ADD(CURDATE(), INTERVAL +27 DAY)), - (4, 'day', DATE_ADD(CURDATE(), INTERVAL +28 DAY)), - (4, 'day', DATE_ADD(CURDATE(), INTERVAL +29 DAY)), - (4, 'day', DATE_ADD(CURDATE(), INTERVAL +30 DAY)), - (4, 'day', DATE_ADD(CURDATE(), INTERVAL +31 DAY)), - (4, 'day', DATE_ADD(CURDATE(), INTERVAL +32 DAY)), - (4, 'day', DATE_ADD(CURDATE(), INTERVAL +33 DAY)), - (4, 'day', DATE_ADD(CURDATE(), INTERVAL +34 DAY)), - (4, 'day', DATE_ADD(CURDATE(), INTERVAL +35 DAY)), - (4, 'day', DATE_ADD(CURDATE(), INTERVAL +36 DAY)), - (4, 'day', DATE_ADD(CURDATE(), INTERVAL +37 DAY)), - (4, 'day', DATE_ADD(CURDATE(), INTERVAL +38 DAY)), - (4, 'day', DATE_ADD(CURDATE(), INTERVAL +39 DAY)), - (4, 'day', DATE_ADD(CURDATE(), INTERVAL +40 DAY)), - (4, 'day', DATE_ADD(CURDATE(), INTERVAL +41 DAY)), - (4, 'day', DATE_ADD(CURDATE(), INTERVAL +42 DAY)), - (4, 'day', DATE_ADD(CURDATE(), INTERVAL +43 DAY)), - (4, 'day', DATE_ADD(CURDATE(), INTERVAL +44 DAY)), - (4, 'day', DATE_ADD(CURDATE(), INTERVAL +45 DAY)), - (4, 'day', DATE_ADD(CURDATE(), INTERVAL +46 DAY)), - (5, 'day', CURDATE()), - (5, 'day', DATE_ADD(CURDATE(), INTERVAL +1 DAY)), - (5, 'day', DATE_ADD(CURDATE(), INTERVAL +2 DAY)), - (5, 'day', DATE_ADD(CURDATE(), INTERVAL +3 DAY)), - (5, 'day', DATE_ADD(CURDATE(), INTERVAL +4 DAY)), - (5, 'day', DATE_ADD(CURDATE(), INTERVAL +5 DAY)), - (5, 'day', DATE_ADD(CURDATE(), INTERVAL +6 DAY)), - (5, 'day', DATE_ADD(CURDATE(), INTERVAL +7 DAY)), - (5, 'day', DATE_ADD(CURDATE(), INTERVAL +8 DAY)), - (5, 'day', DATE_ADD(CURDATE(), INTERVAL +9 DAY)), - (5, 'day', DATE_ADD(CURDATE(), INTERVAL +10 DAY)), - (5, 'day', DATE_ADD(CURDATE(), INTERVAL +11 DAY)), - (5, 'day', DATE_ADD(CURDATE(), INTERVAL +12 DAY)), - (5, 'day', DATE_ADD(CURDATE(), INTERVAL +13 DAY)), - (5, 'day', DATE_ADD(CURDATE(), INTERVAL +14 DAY)), - (5, 'day', DATE_ADD(CURDATE(), INTERVAL +15 DAY)), - (5, 'day', DATE_ADD(CURDATE(), INTERVAL +16 DAY)), - (5, 'day', DATE_ADD(CURDATE(), INTERVAL +17 DAY)), - (5, 'day', DATE_ADD(CURDATE(), INTERVAL +18 DAY)), - (5, 'day', DATE_ADD(CURDATE(), INTERVAL +19 DAY)), - (5, 'day', DATE_ADD(CURDATE(), INTERVAL +20 DAY)), - (5, 'day', DATE_ADD(CURDATE(), INTERVAL +21 DAY)), - (5, 'day', DATE_ADD(CURDATE(), INTERVAL +22 DAY)), - (5, 'day', DATE_ADD(CURDATE(), INTERVAL +23 DAY)), - (5, 'day', DATE_ADD(CURDATE(), INTERVAL +24 DAY)), - (5, 'day', DATE_ADD(CURDATE(), INTERVAL +25 DAY)), - (5, 'day', DATE_ADD(CURDATE(), INTERVAL +26 DAY)), - (5, 'day', DATE_ADD(CURDATE(), INTERVAL +27 DAY)), - (5, 'day', DATE_ADD(CURDATE(), INTERVAL +28 DAY)), - (5, 'day', DATE_ADD(CURDATE(), INTERVAL +29 DAY)), - (5, 'day', DATE_ADD(CURDATE(), INTERVAL +30 DAY)), - (5, 'day', DATE_ADD(CURDATE(), INTERVAL +31 DAY)), - (5, 'day', DATE_ADD(CURDATE(), INTERVAL +32 DAY)), - (5, 'day', DATE_ADD(CURDATE(), INTERVAL +33 DAY)), - (5, 'day', DATE_ADD(CURDATE(), INTERVAL +34 DAY)), - (5, 'day', DATE_ADD(CURDATE(), INTERVAL +35 DAY)), - (5, 'day', DATE_ADD(CURDATE(), INTERVAL +36 DAY)), - (5, 'day', DATE_ADD(CURDATE(), INTERVAL +37 DAY)), - (5, 'day', DATE_ADD(CURDATE(), INTERVAL +38 DAY)), - (5, 'day', DATE_ADD(CURDATE(), INTERVAL +39 DAY)), - (5, 'day', DATE_ADD(CURDATE(), INTERVAL +40 DAY)), - (5, 'day', DATE_ADD(CURDATE(), INTERVAL +41 DAY)), - (5, 'day', DATE_ADD(CURDATE(), INTERVAL +42 DAY)), - (5, 'day', DATE_ADD(CURDATE(), INTERVAL +43 DAY)), - (5, 'day', DATE_ADD(CURDATE(), INTERVAL +44 DAY)), - (5, 'day', DATE_ADD(CURDATE(), INTERVAL +45 DAY)), - (5, 'day', DATE_ADD(CURDATE(), INTERVAL +46 DAY)), - (6, 'day', CURDATE()), - (6, 'day', DATE_ADD(CURDATE(), INTERVAL +1 DAY)), - (6, 'day', DATE_ADD(CURDATE(), INTERVAL +2 DAY)), - (6, 'day', DATE_ADD(CURDATE(), INTERVAL +3 DAY)), - (6, 'day', DATE_ADD(CURDATE(), INTERVAL +4 DAY)), - (6, 'day', DATE_ADD(CURDATE(), INTERVAL +5 DAY)), - (6, 'day', DATE_ADD(CURDATE(), INTERVAL +6 DAY)), - (6, 'day', DATE_ADD(CURDATE(), INTERVAL +7 DAY)), - (6, 'day', DATE_ADD(CURDATE(), INTERVAL +8 DAY)), - (6, 'day', DATE_ADD(CURDATE(), INTERVAL +9 DAY)), - (6, 'day', DATE_ADD(CURDATE(), INTERVAL +10 DAY)), - (6, 'day', DATE_ADD(CURDATE(), INTERVAL +11 DAY)), - (6, 'day', DATE_ADD(CURDATE(), INTERVAL +12 DAY)), - (6, 'day', DATE_ADD(CURDATE(), INTERVAL +13 DAY)), - (6, 'day', DATE_ADD(CURDATE(), INTERVAL +14 DAY)), - (6, 'day', DATE_ADD(CURDATE(), INTERVAL +15 DAY)), - (6, 'day', DATE_ADD(CURDATE(), INTERVAL +16 DAY)), - (6, 'day', DATE_ADD(CURDATE(), INTERVAL +17 DAY)), - (6, 'day', DATE_ADD(CURDATE(), INTERVAL +18 DAY)), - (6, 'day', DATE_ADD(CURDATE(), INTERVAL +19 DAY)), - (6, 'day', DATE_ADD(CURDATE(), INTERVAL +20 DAY)), - (6, 'day', DATE_ADD(CURDATE(), INTERVAL +21 DAY)), - (6, 'day', DATE_ADD(CURDATE(), INTERVAL +22 DAY)), - (6, 'day', DATE_ADD(CURDATE(), INTERVAL +23 DAY)), - (6, 'day', DATE_ADD(CURDATE(), INTERVAL +24 DAY)), - (6, 'day', DATE_ADD(CURDATE(), INTERVAL +25 DAY)), - (6, 'day', DATE_ADD(CURDATE(), INTERVAL +26 DAY)), - (6, 'day', DATE_ADD(CURDATE(), INTERVAL +27 DAY)), - (6, 'day', DATE_ADD(CURDATE(), INTERVAL +28 DAY)), - (6, 'day', DATE_ADD(CURDATE(), INTERVAL +29 DAY)), - (6, 'day', DATE_ADD(CURDATE(), INTERVAL +30 DAY)), - (6, 'day', DATE_ADD(CURDATE(), INTERVAL +31 DAY)), - (6, 'day', DATE_ADD(CURDATE(), INTERVAL +32 DAY)), - (6, 'day', DATE_ADD(CURDATE(), INTERVAL +33 DAY)), - (6, 'day', DATE_ADD(CURDATE(), INTERVAL +34 DAY)), - (6, 'day', DATE_ADD(CURDATE(), INTERVAL +35 DAY)), - (6, 'day', DATE_ADD(CURDATE(), INTERVAL +36 DAY)), - (6, 'day', DATE_ADD(CURDATE(), INTERVAL +37 DAY)), - (6, 'day', DATE_ADD(CURDATE(), INTERVAL +38 DAY)), - (6, 'day', DATE_ADD(CURDATE(), INTERVAL +39 DAY)), - (6, 'day', DATE_ADD(CURDATE(), INTERVAL +40 DAY)), - (6, 'day', DATE_ADD(CURDATE(), INTERVAL +41 DAY)), - (6, 'day', DATE_ADD(CURDATE(), INTERVAL +42 DAY)), - (6, 'day', DATE_ADD(CURDATE(), INTERVAL +43 DAY)), - (6, 'day', DATE_ADD(CURDATE(), INTERVAL +44 DAY)), - (6, 'day', DATE_ADD(CURDATE(), INTERVAL +45 DAY)), - (6, 'day', DATE_ADD(CURDATE(), INTERVAL +46 DAY)), - (7, 'day', CURDATE()), - (7, 'day', DATE_ADD(CURDATE(), INTERVAL +1 DAY)), - (7, 'day', DATE_ADD(CURDATE(), INTERVAL +2 DAY)), - (7, 'day', DATE_ADD(CURDATE(), INTERVAL +3 DAY)), - (7, 'day', DATE_ADD(CURDATE(), INTERVAL +4 DAY)), - (7, 'day', DATE_ADD(CURDATE(), INTERVAL +5 DAY)), - (7, 'day', DATE_ADD(CURDATE(), INTERVAL +6 DAY)); + (1, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL (IF(DAYOFWEEK(util.VN_CURDATE())<=2, 2, 9) - DAYOFWEEK(util.VN_CURDATE())) DAY)), + (1, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL (IF(DAYOFWEEK(util.VN_CURDATE())<=3, 3, 10) - DAYOFWEEK(util.VN_CURDATE())) DAY)), + (1, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL (IF(DAYOFWEEK(util.VN_CURDATE())<=4, 4, 11) - DAYOFWEEK(util.VN_CURDATE())) DAY)), + (1, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL (IF(DAYOFWEEK(util.VN_CURDATE())<=5, 5, 12) - DAYOFWEEK(util.VN_CURDATE())) DAY)), + (1, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL (IF(DAYOFWEEK(util.VN_CURDATE())<=6, 6, 13) - DAYOFWEEK(util.VN_CURDATE())) DAY)), + (2, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL (IF(DAYOFWEEK(util.VN_CURDATE())<=2, 2, 9) - DAYOFWEEK(util.VN_CURDATE())) DAY)), + (2, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL (IF(DAYOFWEEK(util.VN_CURDATE())<=3, 3, 10) - DAYOFWEEK(util.VN_CURDATE())) DAY)), + (2, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL (IF(DAYOFWEEK(util.VN_CURDATE())<=4, 4, 11) - DAYOFWEEK(util.VN_CURDATE())) DAY)), + (2, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL (IF(DAYOFWEEK(util.VN_CURDATE())<=5, 5, 12) - DAYOFWEEK(util.VN_CURDATE())) DAY)), + (2, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL (IF(DAYOFWEEK(util.VN_CURDATE())<=6, 6, 13) - DAYOFWEEK(util.VN_CURDATE())) DAY)), + (3, 'day', util.VN_CURDATE()), + (3, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +1 DAY)), + (3, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +2 DAY)), + (3, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +3 DAY)), + (3, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +4 DAY)), + (3, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +5 DAY)), + (3, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +6 DAY)), + (3, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +7 DAY)), + (3, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +8 DAY)), + (3, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +9 DAY)), + (3, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +10 DAY)), + (3, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +11 DAY)), + (3, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +12 DAY)), + (3, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +13 DAY)), + (3, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +14 DAY)), + (3, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +15 DAY)), + (3, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +16 DAY)), + (3, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +17 DAY)), + (3, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +18 DAY)), + (3, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +19 DAY)), + (3, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +20 DAY)), + (3, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +21 DAY)), + (3, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +22 DAY)), + (3, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +23 DAY)), + (3, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +24 DAY)), + (3, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +25 DAY)), + (3, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +26 DAY)), + (3, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +27 DAY)), + (3, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +28 DAY)), + (3, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +29 DAY)), + (3, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +30 DAY)), + (3, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +31 DAY)), + (3, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +32 DAY)), + (3, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +33 DAY)), + (3, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +34 DAY)), + (3, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +35 DAY)), + (3, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +36 DAY)), + (3, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +37 DAY)), + (3, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +38 DAY)), + (3, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +39 DAY)), + (3, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +40 DAY)), + (3, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +41 DAY)), + (3, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +42 DAY)), + (3, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +43 DAY)), + (3, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +44 DAY)), + (3, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +45 DAY)), + (3, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +46 DAY)), + (4, 'day', util.VN_CURDATE()), + (4, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +1 DAY)), + (4, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +2 DAY)), + (4, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +3 DAY)), + (4, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +4 DAY)), + (4, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +5 DAY)), + (4, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +6 DAY)), + (4, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +7 DAY)), + (4, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +8 DAY)), + (4, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +9 DAY)), + (4, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +10 DAY)), + (4, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +11 DAY)), + (4, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +12 DAY)), + (4, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +13 DAY)), + (4, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +14 DAY)), + (4, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +15 DAY)), + (4, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +16 DAY)), + (4, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +17 DAY)), + (4, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +18 DAY)), + (4, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +19 DAY)), + (4, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +20 DAY)), + (4, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +21 DAY)), + (4, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +22 DAY)), + (4, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +23 DAY)), + (4, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +24 DAY)), + (4, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +25 DAY)), + (4, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +26 DAY)), + (4, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +27 DAY)), + (4, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +28 DAY)), + (4, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +29 DAY)), + (4, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +30 DAY)), + (4, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +31 DAY)), + (4, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +32 DAY)), + (4, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +33 DAY)), + (4, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +34 DAY)), + (4, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +35 DAY)), + (4, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +36 DAY)), + (4, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +37 DAY)), + (4, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +38 DAY)), + (4, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +39 DAY)), + (4, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +40 DAY)), + (4, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +41 DAY)), + (4, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +42 DAY)), + (4, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +43 DAY)), + (4, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +44 DAY)), + (4, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +45 DAY)), + (4, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +46 DAY)), + (5, 'day', util.VN_CURDATE()), + (5, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +1 DAY)), + (5, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +2 DAY)), + (5, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +3 DAY)), + (5, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +4 DAY)), + (5, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +5 DAY)), + (5, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +6 DAY)), + (5, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +7 DAY)), + (5, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +8 DAY)), + (5, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +9 DAY)), + (5, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +10 DAY)), + (5, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +11 DAY)), + (5, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +12 DAY)), + (5, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +13 DAY)), + (5, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +14 DAY)), + (5, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +15 DAY)), + (5, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +16 DAY)), + (5, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +17 DAY)), + (5, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +18 DAY)), + (5, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +19 DAY)), + (5, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +20 DAY)), + (5, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +21 DAY)), + (5, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +22 DAY)), + (5, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +23 DAY)), + (5, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +24 DAY)), + (5, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +25 DAY)), + (5, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +26 DAY)), + (5, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +27 DAY)), + (5, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +28 DAY)), + (5, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +29 DAY)), + (5, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +30 DAY)), + (5, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +31 DAY)), + (5, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +32 DAY)), + (5, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +33 DAY)), + (5, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +34 DAY)), + (5, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +35 DAY)), + (5, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +36 DAY)), + (5, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +37 DAY)), + (5, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +38 DAY)), + (5, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +39 DAY)), + (5, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +40 DAY)), + (5, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +41 DAY)), + (5, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +42 DAY)), + (5, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +43 DAY)), + (5, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +44 DAY)), + (5, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +45 DAY)), + (5, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +46 DAY)), + (6, 'day', util.VN_CURDATE()), + (6, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +1 DAY)), + (6, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +2 DAY)), + (6, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +3 DAY)), + (6, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +4 DAY)), + (6, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +5 DAY)), + (6, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +6 DAY)), + (6, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +7 DAY)), + (6, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +8 DAY)), + (6, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +9 DAY)), + (6, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +10 DAY)), + (6, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +11 DAY)), + (6, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +12 DAY)), + (6, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +13 DAY)), + (6, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +14 DAY)), + (6, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +15 DAY)), + (6, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +16 DAY)), + (6, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +17 DAY)), + (6, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +18 DAY)), + (6, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +19 DAY)), + (6, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +20 DAY)), + (6, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +21 DAY)), + (6, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +22 DAY)), + (6, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +23 DAY)), + (6, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +24 DAY)), + (6, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +25 DAY)), + (6, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +26 DAY)), + (6, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +27 DAY)), + (6, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +28 DAY)), + (6, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +29 DAY)), + (6, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +30 DAY)), + (6, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +31 DAY)), + (6, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +32 DAY)), + (6, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +33 DAY)), + (6, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +34 DAY)), + (6, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +35 DAY)), + (6, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +36 DAY)), + (6, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +37 DAY)), + (6, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +38 DAY)), + (6, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +39 DAY)), + (6, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +40 DAY)), + (6, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +41 DAY)), + (6, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +42 DAY)), + (6, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +43 DAY)), + (6, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +44 DAY)), + (6, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +45 DAY)), + (6, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +46 DAY)), + (7, 'day', util.VN_CURDATE()), + (7, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +1 DAY)), + (7, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +2 DAY)), + (7, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +3 DAY)), + (7, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +4 DAY)), + (7, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +5 DAY)), + (7, 'day', DATE_ADD(util.VN_CURDATE(), INTERVAL +6 DAY)); INSERT INTO `vn`.`zoneEvent`(`zoneFk`, `type`, `weekDays`) VALUES @@ -2237,10 +2241,10 @@ INSERT INTO `vn`.`zoneEvent`(`zoneFk`, `type`, `weekDays`) INSERT INTO `vn`.`workerTimeControl`(`userFk`, `timed`, `manual`, `direction`) VALUES - (1106, CONCAT(CURDATE(), ' 07:00'), TRUE, 'in'), - (1106, CONCAT(CURDATE(), ' 10:00'), TRUE, 'middle'), - (1106, CONCAT(CURDATE(), ' 10:10'), TRUE, 'middle'), - (1106, CONCAT(CURDATE(), ' 15:00'), TRUE, 'out'); + (1106, CONCAT(util.VN_CURDATE(), ' 07:00'), TRUE, 'in'), + (1106, CONCAT(util.VN_CURDATE(), ' 10:00'), TRUE, 'middle'), + (1106, CONCAT(util.VN_CURDATE(), ' 10:10'), TRUE, 'middle'), + (1106, CONCAT(util.VN_CURDATE(), ' 15:00'), TRUE, 'out'); INSERT INTO `vn`.`dmsType`(`id`, `name`, `path`, `readRoleFk`, `writeRoleFk`, `code`) VALUES @@ -2267,14 +2271,14 @@ INSERT INTO `vn`.`dmsType`(`id`, `name`, `path`, `readRoleFk`, `writeRoleFk`, `c INSERT INTO `vn`.`dms`(`id`, `dmsTypeFk`, `file`, `contentType`, `workerFk`, `warehouseFk`, `companyFk`, `hardCopyNumber`, `hasFile`, `reference`, `description`, `created`) VALUES - (1, 14, '1.txt', 'text/plain', 5, 1, 442, NULL, FALSE, 'Ticket:11', 'Ticket:11 dms for the ticket', CURDATE()), - (2, 5, '2.txt', 'text/plain', 5, 1, 442, 1, TRUE, 'Client:104', 'Client:104 dms for the client', CURDATE()), - (3, 5, '3.txt', 'text/plain', 5, 1, 442, NULL, TRUE, 'Client: 104', 'Client:104 readme', CURDATE()), - (4, 3, '4.txt', 'text/plain', 5, 1, 442, NULL, TRUE, 'Worker: 106', 'Worker:106 readme', CURDATE()), - (5, 5, '5.txt', 'text/plain', 5, 1, 442, NULL, TRUE, 'travel: 1', 'dmsForThermograph', CURDATE()), - (6, 5, '6.txt', 'text/plain', 5, 1, 442, NULL, TRUE, 'NotExists', 'DoesNotExists', CURDATE()), - (7, 20, '7.jpg', 'image/jpeg', 9, 1, 442, NULL, FALSE, '1', 'TICKET ID DEL CLIENTE BRUCE WAYNE ID 1101', CURDATE()), - (8, 20, '8.mp4', 'video/mp4', 9, 1, 442, NULL, FALSE, '1', 'TICKET ID DEL CLIENTE BRUCE WAYNE ID 1101', CURDATE()); + (1, 14, '1.txt', 'text/plain', 5, 1, 442, NULL, FALSE, 'Ticket:11', 'Ticket:11 dms for the ticket', util.VN_CURDATE()), + (2, 5, '2.txt', 'text/plain', 5, 1, 442, 1, TRUE, 'Client:104', 'Client:104 dms for the client', util.VN_CURDATE()), + (3, 5, '3.txt', 'text/plain', 5, 1, 442, NULL, TRUE, 'Client: 104', 'Client:104 readme', util.VN_CURDATE()), + (4, 3, '4.txt', 'text/plain', 5, 1, 442, NULL, TRUE, 'Worker: 106', 'Worker:106 readme', util.VN_CURDATE()), + (5, 5, '5.txt', 'text/plain', 5, 1, 442, NULL, TRUE, 'travel: 1', 'dmsForThermograph', util.VN_CURDATE()), + (6, 5, '6.txt', 'text/plain', 5, 1, 442, NULL, TRUE, 'NotExists', 'DoesNotExists', util.VN_CURDATE()), + (7, 20, '7.jpg', 'image/jpeg', 9, 1, 442, NULL, FALSE, '1', 'TICKET ID DEL CLIENTE BRUCE WAYNE ID 1101', util.VN_CURDATE()), + (8, 20, '8.mp4', 'video/mp4', 9, 1, 442, NULL, FALSE, '1', 'TICKET ID DEL CLIENTE BRUCE WAYNE ID 1101', util.VN_CURDATE()); INSERT INTO `vn`.`claimDms`(`claimFk`, `dmsFk`) VALUES @@ -2321,12 +2325,12 @@ INSERT INTO `vn`.`thermograph`(`id`, `model`) INSERT INTO `vn`.`travelThermograph`(`thermographFk`, `created`, `warehouseFk`, `travelFk`, `temperatureFk`, `result`, `dmsFk`) VALUES - ('TMM190901395', CURDATE(), 1, 1, 'WARM', 'Ok', NULL), - ('TL.BBA85422', DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 2, 2, 'COOL', 'Ok', NULL), - ('TL.BBA85422', CURDATE(), 2, 1, 'COOL', 'can not read the temperature', NULL), - ('TZ1905012010', CURDATE(), 1, 1, 'WARM', 'Temperature in range', 5), - ('138350-0', DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 1, 1, 'WARM', NULL, 5), - ('138350-0', CURDATE(), 1, NULL, 'COOL', NULL, NULL); + ('TMM190901395', util.VN_CURDATE(), 1, 1, 'WARM', 'Ok', NULL), + ('TL.BBA85422', DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 2, 2, 'COOL', 'Ok', NULL), + ('TL.BBA85422', util.VN_CURDATE(), 2, 1, 'COOL', 'can not read the temperature', NULL), + ('TZ1905012010', util.VN_CURDATE(), 1, 1, 'WARM', 'Temperature in range', 5), + ('138350-0', DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 1, 1, 'WARM', NULL, 5), + ('138350-0', util.VN_CURDATE(), 1, NULL, 'COOL', NULL, NULL); REPLACE INTO `vn`.`incoterms`(`code`, `name`) VALUES @@ -2349,18 +2353,18 @@ INSERT INTO `vn`.`tabletDepartment`(`tabletFk`, `departmentFk`) INSERT INTO `vn`.`campaign`(`code`, `dated`) VALUES - ('valentinesDay', CONCAT(YEAR(CURDATE()), '-02-14')), - ('valentinesDay', CONCAT(YEAR(DATE_ADD(CURDATE(), INTERVAL -1 YEAR)), '-02-14')), - ('valentinesDay', CONCAT(YEAR(DATE_ADD(CURDATE(), INTERVAL -2 YEAR)), '-02-14')), - ('valentinesDay', CONCAT(YEAR(DATE_ADD(CURDATE(), INTERVAL -3 YEAR)), '-02-14')), - ('mothersDay', CONCAT(YEAR(CURDATE()), '-05-05')), - ('mothersDay', CONCAT(YEAR(DATE_ADD(CURDATE(), INTERVAL -1 YEAR)), '-05-05')), - ('mothersDay', CONCAT(YEAR(DATE_ADD(CURDATE(), INTERVAL -2 YEAR)), '-05-05')), - ('mothersDay', CONCAT(YEAR(DATE_ADD(CURDATE(), INTERVAL -3 YEAR)), '-05-05')), - ('allSaints', CONCAT(YEAR(CURDATE()), '-11-01')), - ('allSaints', CONCAT(YEAR(DATE_ADD(CURDATE(), INTERVAL -1 YEAR)), '-11-01')), - ('allSaints', CONCAT(YEAR(DATE_ADD(CURDATE(), INTERVAL -2 YEAR)), '-11-01')), - ('allSaints', CONCAT(YEAR(DATE_ADD(CURDATE(), INTERVAL -3 YEAR)), '-11-01')); + ('valentinesDay', CONCAT(YEAR(util.VN_CURDATE()), '-02-14')), + ('valentinesDay', CONCAT(YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 YEAR)), '-02-14')), + ('valentinesDay', CONCAT(YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -2 YEAR)), '-02-14')), + ('valentinesDay', CONCAT(YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -3 YEAR)), '-02-14')), + ('mothersDay', CONCAT(YEAR(util.VN_CURDATE()), '-05-05')), + ('mothersDay', CONCAT(YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 YEAR)), '-05-05')), + ('mothersDay', CONCAT(YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -2 YEAR)), '-05-05')), + ('mothersDay', CONCAT(YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -3 YEAR)), '-05-05')), + ('allSaints', CONCAT(YEAR(util.VN_CURDATE()), '-11-01')), + ('allSaints', CONCAT(YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 YEAR)), '-11-01')), + ('allSaints', CONCAT(YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -2 YEAR)), '-11-01')), + ('allSaints', CONCAT(YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -3 YEAR)), '-11-01')); INSERT INTO `hedera`.`imageCollectionSize`(`id`, `collectionFk`,`width`, `height`) VALUES @@ -2372,61 +2376,61 @@ INSERT INTO `vn`.`rateConfig`(`rate0`, `rate1`, `rate2`, `rate3`) INSERT INTO `vn`.`rate`(`dated`, `warehouseFk`, `rate0`, `rate1`, `rate2`, `rate3`) VALUES - (DATE_ADD(CURDATE(), INTERVAL -1 YEAR), 1, 10, 15, 20, 25), - (CURDATE(), 1, 12, 17, 22, 27); + (DATE_ADD(util.VN_CURDATE(), INTERVAL -1 YEAR), 1, 10, 15, 20, 25), + (util.VN_CURDATE(), 1, 12, 17, 22, 27); INSERT INTO `vn`.`awb` (id, code, package, weight, created, amount, transitoryFk, taxFk) VALUES - (1, '07546501420', 67, 671, CURDATE(), 1761, 1, 1), - (2, '07546491421', 252, 2769, CURDATE(), 5231, 1, 1), - (3, '07546500823', 102, 1495, CURDATE(), 3221, 1, 1), - (4, '99610288821', 252, 2777, CURDATE(), 3641, 1, 1), - (5, '07546500834', 229, 3292, CURDATE(), 6601, 2, 1), - (6, '22101929561', 37, 458, CURDATE(), 441, 2, 1), - (7, '07546491432', 258, 3034, CURDATE(), 6441, 2, 1), - (8, '99610288644', 476, 4461, CURDATE(), 5751, 442, 1), - (9, '99610289193', 302, 2972, CURDATE(), 3871, 442, 1), - (10, '07546500856', 185, 2364, CURDATE(), 5321, 442, 1); + (1, '07546501420', 67, 671, util.VN_CURDATE(), 1761, 1, 1), + (2, '07546491421', 252, 2769, util.VN_CURDATE(), 5231, 1, 1), + (3, '07546500823', 102, 1495, util.VN_CURDATE(), 3221, 1, 1), + (4, '99610288821', 252, 2777, util.VN_CURDATE(), 3641, 1, 1), + (5, '07546500834', 229, 3292, util.VN_CURDATE(), 6601, 2, 1), + (6, '22101929561', 37, 458, util.VN_CURDATE(), 441, 2, 1), + (7, '07546491432', 258, 3034, util.VN_CURDATE(), 6441, 2, 1), + (8, '99610288644', 476, 4461, util.VN_CURDATE(), 5751, 442, 1), + (9, '99610289193', 302, 2972, util.VN_CURDATE(), 3871, 442, 1), + (10, '07546500856', 185, 2364, util.VN_CURDATE(), 5321, 442, 1); INSERT INTO `vn`.`dua` (id, code, awbFk, issued, operated, booked, bookEntried, gestdocFk, customsValue, companyFk) VALUES - (1, '19ES0028013A481523', 1, CURDATE(), CURDATE(), CURDATE(), CURDATE(), 1, 11276.95, 442), - (2, '21ES00280136115760', 2, CURDATE(), CURDATE(), CURDATE(), CURDATE(), 2, 1376.20, 442), - (3, '19ES00280131956004', 3, CURDATE(), CURDATE(), CURDATE(), CURDATE(), 3, 14268.50, 442), - (4, '19ES00280131955995', 4, CURDATE(), CURDATE(), CURDATE(), CURDATE(), 1, 8242.50, 442), - (5, '19ES00280132022070', 5, CURDATE(), CURDATE(), CURDATE(), CURDATE(), 2, 10012.49, 442), - (6, '19ES00280132032308', 6, CURDATE(), CURDATE(), CURDATE(), CURDATE(), 2, 19914.25, 442), - (7, '19ES00280132025489', 7, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), CURDATE(), CURDATE(), CURDATE(), 2, 1934.06, 442), - (8, '19ES00280132025490', 8, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), CURDATE(), CURDATE(), CURDATE(), 2, 3618.52, 442), - (9, '19ES00280132025491', 9, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), CURDATE(), CURDATE(), CURDATE(), 2, 7126.23, 442), - (10, '19ES00280132025492', 10, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), CURDATE(), CURDATE(), CURDATE(), 2, 4631.45, 442); + (1, '19ES0028013A481523', 1, util.VN_CURDATE(), util.VN_CURDATE(), util.VN_CURDATE(), util.VN_CURDATE(), 1, 11276.95, 442), + (2, '21ES00280136115760', 2, util.VN_CURDATE(), util.VN_CURDATE(), util.VN_CURDATE(), util.VN_CURDATE(), 2, 1376.20, 442), + (3, '19ES00280131956004', 3, util.VN_CURDATE(), util.VN_CURDATE(), util.VN_CURDATE(), util.VN_CURDATE(), 3, 14268.50, 442), + (4, '19ES00280131955995', 4, util.VN_CURDATE(), util.VN_CURDATE(), util.VN_CURDATE(), util.VN_CURDATE(), 1, 8242.50, 442), + (5, '19ES00280132022070', 5, util.VN_CURDATE(), util.VN_CURDATE(), util.VN_CURDATE(), util.VN_CURDATE(), 2, 10012.49, 442), + (6, '19ES00280132032308', 6, util.VN_CURDATE(), util.VN_CURDATE(), util.VN_CURDATE(), util.VN_CURDATE(), 2, 19914.25, 442), + (7, '19ES00280132025489', 7, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), util.VN_CURDATE(), util.VN_CURDATE(), util.VN_CURDATE(), 2, 1934.06, 442), + (8, '19ES00280132025490', 8, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), util.VN_CURDATE(), util.VN_CURDATE(), util.VN_CURDATE(), 2, 3618.52, 442), + (9, '19ES00280132025491', 9, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), util.VN_CURDATE(), util.VN_CURDATE(), util.VN_CURDATE(), 2, 7126.23, 442), + (10, '19ES00280132025492', 10, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), util.VN_CURDATE(), util.VN_CURDATE(), util.VN_CURDATE(), 2, 4631.45, 442); REPLACE INTO `vn`.`invoiceIn`(`id`, `serialNumber`,`serial`, `supplierFk`, `issued`, `created`, `supplierRef`, `isBooked`, `companyFk`, `docFk`) VALUES - (1, 1001, 'R', 1, CURDATE(), CURDATE(), 1234, 0, 442, 1), - (2, 1002, 'R', 1, CURDATE(), CURDATE(), 1235, 1, 442, 1), - (3, 1003, 'R', 1, CURDATE(), CURDATE(), 1236, 0, 442, 1), - (4, 1004, 'R', 1, CURDATE(), CURDATE(), 1237, 0, 442, 1), - (5, 1005, 'R', 1, CURDATE(), CURDATE(), 1238, 1, 442, 1), - (6, 1006, 'R', 2, CURDATE(), CURDATE(), 1239, 0, 442, 1), - (7, 1007, 'R', 2, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 1240, 1, 442, 1), - (8, 1008, 'R', 2, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 1241, 1, 442, 1), - (9, 1009, 'R', 2, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 1242, 1, 442, 1), - (10, 1010, 'R', 2, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 1243, 1, 442, 1); + (1, 1001, 'R', 1, util.VN_CURDATE(), util.VN_CURDATE(), 1234, 0, 442, 1), + (2, 1002, 'R', 1, util.VN_CURDATE(), util.VN_CURDATE(), 1235, 1, 442, 1), + (3, 1003, 'R', 1, util.VN_CURDATE(), util.VN_CURDATE(), 1236, 0, 442, 1), + (4, 1004, 'R', 1, util.VN_CURDATE(), util.VN_CURDATE(), 1237, 0, 442, 1), + (5, 1005, 'R', 1, util.VN_CURDATE(), util.VN_CURDATE(), 1238, 1, 442, 1), + (6, 1006, 'R', 2, util.VN_CURDATE(), util.VN_CURDATE(), 1239, 0, 442, 1), + (7, 1007, 'R', 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 1240, 1, 442, 1), + (8, 1008, 'R', 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 1241, 1, 442, 1), + (9, 1009, 'R', 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 1242, 1, 442, 1), + (10, 1010, 'R', 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 1243, 1, 442, 1); INSERT INTO `vn`.`invoiceInDueDay`(`invoiceInFk`, `dueDated`, `bankFk`, `amount`) VALUES - (1, CURDATE(), 1, 336.99), - (1, CURDATE(), 1, 15.25), - (2, CURDATE(), 1, 168), - (2, CURDATE(), 1, 55.17), - (3, CURDATE(), 1, 87.95), - (3, CURDATE(), 1, 7.65), - (4, CURDATE(), 1, 373.27), - (4, CURDATE(), 1, 73.36), - (5, CURDATE(), 1, 64.23), - (6, CURDATE(), 1, 32.95), - (7, CURDATE(), 1, 58.64); + (1, util.VN_CURDATE(), 1, 336.99), + (1, util.VN_CURDATE(), 1, 15.25), + (2, util.VN_CURDATE(), 1, 168), + (2, util.VN_CURDATE(), 1, 55.17), + (3, util.VN_CURDATE(), 1, 87.95), + (3, util.VN_CURDATE(), 1, 7.65), + (4, util.VN_CURDATE(), 1, 373.27), + (4, util.VN_CURDATE(), 1, 73.36), + (5, util.VN_CURDATE(), 1, 64.23), + (6, util.VN_CURDATE(), 1, 32.95), + (7, util.VN_CURDATE(), 1, 58.64); INSERT INTO `vn`.`duaInvoiceIn`(`id`, `duaFk`, `invoiceInFk`) VALUES @@ -2480,24 +2484,24 @@ INSERT INTO `vn`.`zoneAgencyMode`(`id`, `agencyModeFk`, `zoneFk`) INSERT INTO `vn`.`expeditionTruck` (`id`, `ETD`, `description`) VALUES - (1, CONCAT(YEAR(DATE_ADD(CURDATE(), INTERVAL +3 YEAR))), 'Best truck in fleet'); + (1, CONCAT(YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL +3 YEAR))), 'Best truck in fleet'); INSERT INTO `vn`.`expeditionPallet` (`id`, `truckFk`, `built`, `position`, `isPrint`) VALUES - (1, 1, CURDATE(), 1, 1); + (1, 1, util.VN_CURDATE(), 1, 1); INSERT INTO `vn`.`expeditionScan` (`id`, `expeditionFk`, `scanned`, `palletFk`) VALUES - (1, 1, CURDATE(), 1), - (2, 2, CURDATE(), 1), - (3, 3, CURDATE(), 1), - (4, 4, CURDATE(), 1), - (5, 5, CURDATE(), 1), - (6, 6, CURDATE(), 1), - (7, 7, CURDATE(), 1), - (8, 8, CURDATE(), 1), - (9, 9, CURDATE(), 1), - (10, 10, CURDATE(), 1); + (1, 1, util.VN_CURDATE(), 1), + (2, 2, util.VN_CURDATE(), 1), + (3, 3, util.VN_CURDATE(), 1), + (4, 4, util.VN_CURDATE(), 1), + (5, 5, util.VN_CURDATE(), 1), + (6, 6, util.VN_CURDATE(), 1), + (7, 7, util.VN_CURDATE(), 1), + (8, 8, util.VN_CURDATE(), 1), + (9, 9, util.VN_CURDATE(), 1), + (10, 10, util.VN_CURDATE(), 1); CALL `cache`.`last_buy_refresh`(FALSE); @@ -2506,11 +2510,11 @@ UPDATE `vn`.`item` SET `genericFk` = 9 INSERT INTO `bs`.`defaulter` (`clientFk`, `amount`, `created`, `defaulterSinced`) VALUES - (1101, 500, CURDATE(), CURDATE()), - (1102, 500, CURDATE(), CURDATE()), - (1103, 500, CURDATE(), CURDATE()), - (1107, 500, CURDATE(), CURDATE()), - (1109, 500, CURDATE(), CURDATE()); + (1101, 500, util.VN_CURDATE(), util.VN_CURDATE()), + (1102, 500, util.VN_CURDATE(), util.VN_CURDATE()), + (1103, 500, util.VN_CURDATE(), util.VN_CURDATE()), + (1107, 500, util.VN_CURDATE(), util.VN_CURDATE()), + (1109, 500, util.VN_CURDATE(), util.VN_CURDATE()); UPDATE `vn`.`route` SET `invoiceInFk`=1 @@ -2521,16 +2525,16 @@ UPDATE `vn`.`route` WHERE `id`=2; INSERT INTO `bs`.`salesPerson` (`workerFk`, `year`, `month`, `portfolioWeight`) VALUES - (18, YEAR(CURDATE()), MONTH(CURDATE()), 807.23), - (19, YEAR(CURDATE()), MONTH(CURDATE()), 34.40); + (18, YEAR(util.VN_CURDATE()), MONTH(util.VN_CURDATE()), 807.23), + (19, YEAR(util.VN_CURDATE()), MONTH(util.VN_CURDATE()), 34.40); INSERT INTO `bs`.`sale` (`saleFk`, `amount`, `dated`, `typeFk`, `clientFk`) VALUES - (1, 501.95, CURDATE(), 2, 1101), - (2, 70.7, CURDATE(), 2, 1101), - (3, 200.78, CURDATE(), 2, 1101), - (4, 33.8, CURDATE(), 1, 1101), - (30, 34.4, CURDATE(), 1, 1108); + (1, 501.95, util.VN_CURDATE(), 2, 1101), + (2, 70.7, util.VN_CURDATE(), 2, 1101), + (3, 200.78, util.VN_CURDATE(), 2, 1101), + (4, 33.8, util.VN_CURDATE(), 1, 1101), + (30, 34.4, util.VN_CURDATE(), 1, 1108); INSERT INTO `vn`.`docuware` (`code`, `fileCabinetName`, `dialogName` , `find`) VALUES @@ -2550,7 +2554,7 @@ INSERT INTO `vn`.`calendarHolidaysType` (`id`, `name`, `hexColour`) INSERT INTO `vn`.`calendarHolidays` (`id`, `calendarHolidaysTypeFk`, `dated`, `calendarHolidaysNameFk`, `workCenterFk`) VALUES - (1, 1, CONCAT(YEAR(CURDATE()), '-12-09'), 1, 1); + (1, 1, CONCAT(YEAR(util.VN_CURDATE()), '-12-09'), 1, 1); INSERT INTO `vn`.`supplierAgencyTerm` (`agencyFk`, `supplierFk`, `minimumPackages`, `kmPrice`, `packagePrice`, `routePrice`, `minimumKm`, `minimumM3`, `m3Price`) VALUES @@ -2578,10 +2582,10 @@ INSERT INTO `vn`.`machine` (`plate`, `maker`, `model`, `warehouseFk`, `departmen INSERT INTO `vn`.`machineWorker` (`workerFk`, `machineFk`, `inTimed`, `outTimed`) VALUES - (1106, 1, CURDATE(), CURDATE()), - (1106, 1, DATE_ADD(CURDATE(), INTERVAL + 1 DAY), DATE_ADD(CURDATE(), INTERVAL +1 DAY)), - (1106, 2, CURDATE(), NULL), - (1106, 2, DATE_ADD(CURDATE(), INTERVAL + 1 DAY), DATE_ADD(CURDATE(), INTERVAL +1 DAY)); + (1106, 1, util.VN_CURDATE(), util.VN_CURDATE()), + (1106, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), DATE_ADD(util.VN_CURDATE(), INTERVAL +1 DAY)), + (1106, 2, util.VN_CURDATE(), NULL), + (1106, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), DATE_ADD(util.VN_CURDATE(), INTERVAL +1 DAY)); INSERT INTO `vn`.`mdbBranch` (`name`) VALUES @@ -2591,4 +2595,20 @@ INSERT INTO `vn`.`mdbBranch` (`name`) INSERT INTO `vn`.`mdbVersion` (`app`, `branchFk`, `version`) VALUES ('tpv', 'test', '1'), - ('lab', 'master', '1'); \ No newline at end of file + ('lab', 'master', '1'); + +INSERT INTO `vn`.`saleGroup` (`userFk`, `parkingFk`, `sectorFk`) + VALUES + (1, 1, 1); + +INSERT INTO `vn`.`saleGroupDetail` (`saleFk`, `saleGroupFk`) + VALUES + (31, 1); + +INSERT INTO `vn`.`sectorCollection` (`userFk`, `sectorFk`) + VALUES + (1, 1); + +INSERT INTO `vn`.`sectorCollectionSaleGroup` (`sectorCollectionFk`, `saleGroupFk`) + VALUES + (1, 1); diff --git a/db/dump/mockDate.sql b/db/dump/mockDate.sql new file mode 100644 index 000000000..c63c2d76c --- /dev/null +++ b/db/dump/mockDate.sql @@ -0,0 +1,43 @@ +CREATE SCHEMA IF NOT EXISTS `util`; +USE `util`; + +DELIMITER ;; +DROP FUNCTION IF EXISTS `util`.`mockedDate`; +CREATE FUNCTION `util`.`mockedDate`() +RETURNS DATETIME +DETERMINISTIC +BEGIN + RETURN NOW(); + -- '2022-01-19 08:00:00' +END ;; +DELIMITER ; + +DELIMITER ;; +DROP FUNCTION IF EXISTS `util`.`VN_CURDATE`; +CREATE FUNCTION `util`.`VN_CURDATE`() +RETURNS DATE +DETERMINISTIC +BEGIN + RETURN DATE(mockedDate()); +END ;; +DELIMITER ; + +DELIMITER ;; +DROP FUNCTION IF EXISTS `util`.`VN_CURTIME`; +CREATE FUNCTION `util`.`VN_CURTIME`() +RETURNS TIME +DETERMINISTIC +BEGIN + RETURN TIME(mockedDate()); +END ;; +DELIMITER ; + +DELIMITER ;; +DROP FUNCTION IF EXISTS `util`.`VN_NOW`; +CREATE FUNCTION `util`.`VN_NOW`() +RETURNS DATETIME +DETERMINISTIC +BEGIN + RETURN mockedDate(); +END ;; +DELIMITER ; \ No newline at end of file diff --git a/db/dump/structure.sql b/db/dump/structure.sql index 21ef7758c..cc0ee4785 100644 --- a/db/dump/structure.sql +++ b/db/dump/structure.sql @@ -1,8 +1,8 @@ --- MariaDB dump 10.19 Distrib 10.6.7-MariaDB, for debian-linux-gnu (x86_64) +-- MariaDB dump 10.19 Distrib 10.5.12-MariaDB, for debian-linux-gnu (x86_64) -- --- Host: db.verdnatura.es Database: account +-- Host: 127.0.0.1 Database: account -- ------------------------------------------------------ --- Server version 5.6.25-4-log +-- Server version 10.4.13-MariaDB-1:10.4.13+maria~focal /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -161,7 +161,7 @@ CREATE TABLE `ldapConfig` ( `userDn` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'The base DN for users', `groupDn` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'The base DN for groups', PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='LDAP server configuration parameters'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='LDAP server configuration parameters'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -175,7 +175,7 @@ CREATE TABLE `mailAlias` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `alias` varchar(50) CHARACTER SET utf8 NOT NULL, `description` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, - `isPublic` tinyint(4) NOT NULL DEFAULT '1', + `isPublic` tinyint(4) NOT NULL DEFAULT 1, PRIMARY KEY (`id`), UNIQUE KEY `alias` (`alias`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Mail aliases'; @@ -214,7 +214,7 @@ CREATE TABLE `mailClientAccess` ( `description` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `mailFrom` (`client`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -260,7 +260,7 @@ CREATE TABLE `mailSenderAccess` ( `description` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `mailFrom` (`sender`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -307,9 +307,9 @@ CREATE TABLE `role` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(14) COLLATE utf8_unicode_ci NOT NULL COMMENT 'MySQL doesn''t support more than 14 chars for proxied user names', `description` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, - `hasLogin` tinyint(3) unsigned NOT NULL DEFAULT '1', - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - `modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `hasLogin` tinyint(3) unsigned NOT NULL DEFAULT 1, + `created` timestamp NOT NULL DEFAULT current_timestamp(), + `modified` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), PRIMARY KEY (`id`), UNIQUE KEY `name` (`name`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Roles'; @@ -423,9 +423,9 @@ CREATE TABLE `sambaConfig` ( `adController` varchar(255) COLLATE utf8_unicode_ci NOT NULL COMMENT 'The hosname of domain controller', `adUser` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'Active directory user', `adPassword` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'Active directory password', - `verifyCert` tinyint(3) unsigned NOT NULL DEFAULT '1' COMMENT 'Whether to verify server certificate', + `verifyCert` tinyint(3) unsigned NOT NULL DEFAULT 1 COMMENT 'Whether to verify server certificate', PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Global configuration parameters for accounts'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Global configuration parameters for accounts'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -441,19 +441,19 @@ CREATE TABLE `user` ( `name` varchar(30) CHARACTER SET utf8 NOT NULL, `nickname` varchar(127) COLLATE utf8_unicode_ci NOT NULL, `bcryptPassword` varchar(512) COLLATE utf8_unicode_ci DEFAULT NULL, - `role` int(10) unsigned NOT NULL DEFAULT '2', - `active` tinyint(1) NOT NULL DEFAULT '1', + `role` int(10) unsigned NOT NULL DEFAULT 2, + `active` tinyint(1) NOT NULL DEFAULT 1, `email` varchar(255) CHARACTER SET utf8 DEFAULT NULL, `emailVerified` tinyint(1) DEFAULT NULL, `verificationToken` varchar(512) CHARACTER SET utf8 DEFAULT NULL, `lang` char(2) CHARACTER SET utf8 DEFAULT NULL, `lastPassChange` datetime DEFAULT NULL, - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - `updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `created` timestamp NOT NULL DEFAULT current_timestamp(), + `updated` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `image` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `password` char(64) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Deprecated', - `recoverPass` tinyint(3) unsigned NOT NULL DEFAULT '1' COMMENT 'Deprecated', - `sync` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'Deprecated', + `recoverPass` tinyint(3) unsigned NOT NULL DEFAULT 1 COMMENT 'Deprecated', + `sync` tinyint(4) NOT NULL DEFAULT 0 COMMENT 'Deprecated', PRIMARY KEY (`id`), UNIQUE KEY `name` (`name`), KEY `role` (`role`), @@ -528,7 +528,7 @@ BEGIN IF !(NEW.`password` <=> OLD.`password`) THEN SET NEW.bcryptPassword = NULL; - SET NEW.lastPassChange = NOW(); + SET NEW.lastPassChange = util.VN_NOW(); END IF; END */;; DELIMITER ; @@ -611,7 +611,7 @@ CREATE TABLE `userConfig` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `loginKey` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -2524,12 +2524,12 @@ DROP TABLE IF EXISTS `bancos_evolution`; CREATE TABLE `bancos_evolution` ( `Fecha` date NOT NULL, `Id_Banco` int(11) NOT NULL, - `saldo` decimal(10,2) NOT NULL DEFAULT '0.00', - `quilla` decimal(10,2) NOT NULL DEFAULT '0.00', - `deuda` decimal(10,2) NOT NULL DEFAULT '0.00', - `liquidez` decimal(10,2) NOT NULL DEFAULT '0.00', - `disponibilidad ajena` decimal(10,2) NOT NULL DEFAULT '0.00', - `saldo_aux` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT 'Saldo auxiliar para el calculo de lo dispuesto en las polizas', + `saldo` decimal(10,2) NOT NULL DEFAULT 0.00, + `quilla` decimal(10,2) NOT NULL DEFAULT 0.00, + `deuda` decimal(10,2) NOT NULL DEFAULT 0.00, + `liquidez` decimal(10,2) NOT NULL DEFAULT 0.00, + `disponibilidad ajena` decimal(10,2) NOT NULL DEFAULT 0.00, + `saldo_aux` decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT 'Saldo auxiliar para el calculo de lo dispuesto en las polizas', PRIMARY KEY (`Fecha`,`Id_Banco`), KEY `fk_banco_evolution_idx` (`Id_Banco`), CONSTRAINT `fk_banco_evolution` FOREIGN KEY (`Id_Banco`) REFERENCES `vn`.`accounting` (`id`) ON DELETE CASCADE ON UPDATE CASCADE @@ -2575,7 +2575,7 @@ DROP TABLE IF EXISTS `clientDied`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `clientDied` ( - `id` int(11) NOT NULL DEFAULT '0', + `id` int(11) NOT NULL DEFAULT 0, `clientName` varchar(50) COLLATE utf8_unicode_ci NOT NULL, `lastInvoiced` date DEFAULT NULL, `workerCode` varchar(3) COLLATE utf8_unicode_ci NOT NULL, @@ -2596,8 +2596,8 @@ CREATE TABLE `clientNewBorn` ( `clientFk` int(11) NOT NULL, `firstShipped` date NOT NULL COMMENT 'Primer pedido o de la relacion comercial, o después de un año de inactividad', `lastShipped` date NOT NULL COMMENT 'último pedido del cliente', - `isModified` tinyint(4) DEFAULT '0', - `isRookie` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'define un cliente que ha de ser cuidado por ser nuevo o recuperado', + `isModified` tinyint(4) DEFAULT 0, + `isRookie` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'define un cliente que ha de ser cuidado por ser nuevo o recuperado', PRIMARY KEY (`clientFk`), CONSTRAINT `clientNewBorn_fk1` FOREIGN KEY (`clientFk`) REFERENCES `vn`.`client` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Listado de clientes que se consideran nuevos a efectos de cobrar la comision adicional del comercial'; @@ -2698,7 +2698,7 @@ DROP TABLE IF EXISTS `defaulter`; CREATE TABLE `defaulter` ( `clientFk` int(11) NOT NULL, `created` date NOT NULL, - `amount` double NOT NULL DEFAULT '0', + `amount` double NOT NULL DEFAULT 0, `defaulterSinced` date DEFAULT NULL, `hasChanged` tinyint(1) DEFAULT NULL, `frozened` date DEFAULT NULL, @@ -2717,7 +2717,7 @@ DROP TABLE IF EXISTS `experienceIberflora2016`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `experienceIberflora2016` ( `Id_Cliente` int(11) NOT NULL, - `isVisitor` tinyint(4) NOT NULL DEFAULT '0', + `isVisitor` tinyint(4) NOT NULL DEFAULT 0, PRIMARY KEY (`Id_Cliente`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Lista de clientes que participan en el estudio sobre la mejora del consumo tras la visita a las instalaciones de Silla'; /*!40101 SET character_set_client = @saved_cs_client */; @@ -2783,7 +2783,7 @@ DROP TABLE IF EXISTS `inspeccionSS_2021`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `inspeccionSS_2021` ( `business_id` int(11) DEFAULT NULL, - `id` int(11) NOT NULL DEFAULT '0', + `id` int(11) NOT NULL DEFAULT 0, `firstName` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, `lastName` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, `name` varchar(45) COLLATE utf8_unicode_ci NOT NULL, @@ -2850,16 +2850,16 @@ CREATE TABLE `m3` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `fecha` date NOT NULL, `provinceFk` smallint(5) unsigned DEFAULT NULL, - `warehouseFk` smallint(6) unsigned NOT NULL DEFAULT '0', + `warehouseFk` smallint(6) unsigned NOT NULL DEFAULT 0, `m3` decimal(10,2) DEFAULT NULL, `year` int(11) DEFAULT NULL, `month` int(11) DEFAULT NULL, `week` int(11) DEFAULT NULL, `day` int(11) DEFAULT NULL, `dayName` varchar(12) COLLATE utf8_unicode_ci DEFAULT NULL, - `euros` decimal(10,2) DEFAULT '0.00', + `euros` decimal(10,2) DEFAULT 0.00, PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -2977,7 +2977,7 @@ CREATE TABLE `nightTask` ( `error` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `errorCode` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -3043,7 +3043,7 @@ CREATE TABLE `nightTaskConfig` ( `id` int(11) NOT NULL AUTO_INCREMENT, `logMail` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -3073,15 +3073,15 @@ DROP TABLE IF EXISTS `payMethodClient`; CREATE TABLE `payMethodClient` ( `id` int(11) NOT NULL AUTO_INCREMENT, `dated` date NOT NULL, - `payMethodFk` tinyint(3) unsigned NOT NULL DEFAULT '0', - `clientFk` int(11) NOT NULL DEFAULT '0', + `payMethodFk` tinyint(3) unsigned NOT NULL DEFAULT 0, + `clientFk` int(11) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), KEY `FkPayMethod_idx` (`payMethodFk`), KEY `FkClientPayMethod_idx` (`clientFk`), KEY `FkDateClientPayMethod` (`dated`,`clientFk`), CONSTRAINT `FkClientPayMethod` FOREIGN KEY (`clientFk`) REFERENCES `vn`.`client` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `FkPayMethodClient` FOREIGN KEY (`payMethodFk`) REFERENCES `vn`.`payMethod` (`id`) ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_bin; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -3099,7 +3099,7 @@ CREATE TABLE `payMethodClientEvolution` ( `amount` decimal(10,2) NOT NULL, `equalizationTax` decimal(10,2) NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -3111,9 +3111,9 @@ DROP TABLE IF EXISTS `produccion`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `produccion` ( `dated` date NOT NULL, - `m3` int(11) NOT NULL DEFAULT '0', - `cost` int(11) NOT NULL DEFAULT '0', - `eurosM3` decimal(10,2) NOT NULL DEFAULT '0.00', + `m3` int(11) NOT NULL DEFAULT 0, + `cost` int(11) NOT NULL DEFAULT 0, + `eurosM3` decimal(10,2) NOT NULL DEFAULT 0.00, PRIMARY KEY (`dated`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -3168,13 +3168,13 @@ DROP TABLE IF EXISTS `sale`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `sale` ( `saleFk` int(11) NOT NULL, - `amount` decimal(10,3) NOT NULL DEFAULT '0.000', - `surcharge` decimal(10,3) NOT NULL DEFAULT '0.000', + `amount` decimal(10,3) NOT NULL DEFAULT 0.000, + `surcharge` decimal(10,3) NOT NULL DEFAULT 0.000, `dated` date NOT NULL, `typeFk` smallint(5) unsigned NOT NULL, - `clientFk` int(11) NOT NULL DEFAULT '1', - `companyFk` smallint(5) unsigned NOT NULL DEFAULT '442', - `margin` decimal(10,3) NOT NULL DEFAULT '0.000', + `clientFk` int(11) NOT NULL DEFAULT 1, + `companyFk` smallint(5) unsigned NOT NULL DEFAULT 442, + `margin` decimal(10,3) NOT NULL DEFAULT 0.000, PRIMARY KEY (`saleFk`), KEY `tip_to_tip_idx` (`typeFk`), KEY `clientes_bs_ventas_idx` (`clientFk`), @@ -3196,9 +3196,9 @@ DROP TABLE IF EXISTS `salePersonEvolution__`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `salePersonEvolution__` ( `dated` date NOT NULL DEFAULT '0000-00-00', - `amount` decimal(10,2) NOT NULL DEFAULT '0.00', - `equalizationTax` decimal(10,2) NOT NULL DEFAULT '0.00', - `salesPersonFk` int(11) NOT NULL DEFAULT '0', + `amount` decimal(10,2) NOT NULL DEFAULT 0.00, + `equalizationTax` decimal(10,2) NOT NULL DEFAULT 0.00, + `salesPersonFk` int(11) NOT NULL DEFAULT 0, PRIMARY KEY (`dated`,`salesPersonFk`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -3249,9 +3249,9 @@ CREATE TABLE `salesByclientSalesPerson` ( `dated` date NOT NULL DEFAULT '0000-00-00', `salesPersonFk` int(10) unsigned DEFAULT NULL, `clientFk` int(11) NOT NULL, - `amount` decimal(10,3) NOT NULL DEFAULT '0.000', - `equalizationTax` decimal(10,3) NOT NULL DEFAULT '0.000', - `amountNewBorn` decimal(10,3) NOT NULL DEFAULT '0.000', + `amount` decimal(10,3) NOT NULL DEFAULT 0.000, + `equalizationTax` decimal(10,3) NOT NULL DEFAULT 0.000, + `amountNewBorn` decimal(10,3) NOT NULL DEFAULT 0.000, PRIMARY KEY (`dated`,`clientFk`), KEY `clientSalePersonEvolution_clientFk` (`clientFk`), KEY `salesByclientSalesPerson_salesPerson` (`salesPersonFk`), @@ -3283,7 +3283,7 @@ CREATE TABLE `salesMonthlySnapshot` ( `newClientScore` decimal(10,3) DEFAULT NULL, `teamBossPlus` decimal(10,3) DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -3299,7 +3299,7 @@ CREATE TABLE `salesMonthlySnapshot__` ( `year` int(4) NOT NULL, `month` int(2) NOT NULL, `departmentFk` int(11) NOT NULL, - `ownSalesAmount` decimal(10,2) DEFAULT '0.00', + `ownSalesAmount` decimal(10,2) DEFAULT 0.00, `ownSalesPosition` int(11) DEFAULT NULL, `ownSalesBonus` int(11) DEFAULT NULL, `ownSalesScore` int(11) DEFAULT NULL, @@ -3313,7 +3313,7 @@ CREATE TABLE `salesMonthlySnapshot__` ( `teamSalesScore` int(11) DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `workerFk_UNIQUE` (`workerFk`,`year`,`month`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='cada mes se guardan aqui los datos de forma estática, para consulta en grafana.'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='cada mes se guardan aqui los datos de forma estática, para consulta en grafana.'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -3335,7 +3335,7 @@ CREATE TABLE `salesPerson` ( `leasedReplacement` decimal(10,2) DEFAULT NULL, `itemTypeBorrowed` decimal(10,2) DEFAULT NULL, `portfolioWeight` decimal(10,2) DEFAULT NULL COMMENT 'Pero de la cartera del comercial a fecha vendedores.updated', - `updated` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `updated` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), PRIMARY KEY (`workerFk`,`year`,`month`), CONSTRAINT `salesPerson_FK` FOREIGN KEY (`workerFk`) REFERENCES `vn`.`worker` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; @@ -3375,13 +3375,13 @@ CREATE TABLE `salesPersonEvolution` ( `id` int(11) NOT NULL AUTO_INCREMENT, `dated` date NOT NULL DEFAULT '0000-00-00', `salesPersonFk` int(10) unsigned DEFAULT NULL, - `amount` decimal(10,3) NOT NULL DEFAULT '0.000', - `equalizationTax` decimal(10,3) NOT NULL DEFAULT '0.000', - `amountNewBorn` decimal(10,3) NOT NULL DEFAULT '0.000', + `amount` decimal(10,3) NOT NULL DEFAULT 0.000, + `equalizationTax` decimal(10,3) NOT NULL DEFAULT 0.000, + `amountNewBorn` decimal(10,3) NOT NULL DEFAULT 0.000, PRIMARY KEY (`id`), KEY `salesPersonEvolution_salesPerson` (`salesPersonFk`), CONSTRAINT `salesPersonEvolution_salesPerson` FOREIGN KEY (`salesPersonFk`) REFERENCES `vn`.`worker` (`id`) ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Evolución Comerciales'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Evolución Comerciales'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -3408,24 +3408,6 @@ SET character_set_client = utf8; ) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; --- --- Temporary table structure for view `v_ventas__` --- - -DROP TABLE IF EXISTS `v_ventas__`; -/*!50001 DROP VIEW IF EXISTS `v_ventas__`*/; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; -/*!50001 CREATE TABLE `v_ventas__` ( - `importe` tinyint NOT NULL, - `recargo` tinyint NOT NULL, - `year` tinyint NOT NULL, - `month` tinyint NOT NULL, - `week` tinyint NOT NULL, - `day` tinyint NOT NULL -) ENGINE=MyISAM */; -SET character_set_client = @saved_cs_client; - -- -- Temporary table structure for view `vendedores` -- @@ -3519,7 +3501,7 @@ CREATE TABLE `waste` ( `year` int(4) NOT NULL, `week` int(2) NOT NULL, `family` varchar(30) COLLATE utf8_unicode_ci NOT NULL, - `itemFk` int(11) NOT NULL DEFAULT '0', + `itemFk` int(11) NOT NULL DEFAULT 0, `itemTypeFk` smallint(5) unsigned DEFAULT NULL, `saleTotal` decimal(16,0) DEFAULT NULL, `saleWaste` decimal(16,0) DEFAULT NULL, @@ -3548,7 +3530,7 @@ CREATE TABLE `workerLabourDataByMonth` ( `permanent` int(5) NOT NULL COMMENT 'Número de empleados fijos', PRIMARY KEY (`id`), KEY `workerLabourDataByMonth_graph_idx` (`code`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -3587,7 +3569,7 @@ CREATE TABLE `workerProductivity` ( CONSTRAINT `workerProductivity_FK` FOREIGN KEY (`actionFk`) REFERENCES `vncontrol`.`accion` (`accion_id`) ON UPDATE CASCADE, CONSTRAINT `workerProductivity_warehouseFk` FOREIGN KEY (`warehouseFk`) REFERENCES `vn`.`warehouse` (`id`) ON UPDATE CASCADE, CONSTRAINT `workerProductivity_workerFk` FOREIGN KEY (`workerFk`) REFERENCES `vn`.`worker` (`id`) ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -3602,7 +3584,7 @@ CREATE TABLE `workerProductivityConfig` ( `minSeconsPackager` int(11) DEFAULT NULL, `minSeconsItemPicker` int(11) DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -3615,7 +3597,7 @@ DROP TABLE IF EXISTS `workerSpeed__`; CREATE TABLE `workerSpeed__` ( `workerCode` varchar(3) COLLATE utf8_unicode_ci NOT NULL, `accion` varchar(15) COLLATE utf8_unicode_ci NOT NULL, - `warehouseFk` smallint(6) unsigned NOT NULL DEFAULT '1', + `warehouseFk` smallint(6) unsigned NOT NULL DEFAULT 1, `LitrosMinuto` decimal(10,1) DEFAULT NULL, `LitrosMinutoLastHour` decimal(10,1) DEFAULT NULL, `lastUpdated` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', @@ -3634,7 +3616,7 @@ CREATE TABLE `zone_ETD__` ( `zoneFk` int(11) DEFAULT NULL, `totalVolume` decimal(5,1) DEFAULT NULL, `remainingVolume` decimal(5,1) DEFAULT NULL, - `speed` decimal(10,2) NOT NULL DEFAULT '0.00', + `speed` decimal(10,2) NOT NULL DEFAULT 0.00, `hourTheoretical` time DEFAULT NULL, `hourPractical` varchar(10) CHARACTER SET utf8 NOT NULL DEFAULT '' ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; @@ -3650,7 +3632,7 @@ DROP TABLE IF EXISTS `zone_ETD_byTime`; CREATE TABLE `zone_ETD_byTime` ( `theorical` time NOT NULL, `practical` time NOT NULL DEFAULT '00:00:00', - `m3` decimal(10,1) NOT NULL DEFAULT '0.0', + `m3` decimal(10,1) NOT NULL DEFAULT 0.0, PRIMARY KEY (`theorical`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -3802,8 +3784,8 @@ BEGIN * @param vStartingDate Fecha desde la cual se recalculan la tabla bs.bancos_evolution */ DECLARE vCurrentDate DATE; - DECLARE vMaxDate DATE DEFAULT TIMESTAMPADD(MONTH, 7, CURDATE()); - IF IFNULL(vStartingDate,0) < TIMESTAMPADD(YEAR, -5, CURDATE()) THEN + DECLARE vMaxDate DATE DEFAULT TIMESTAMPADD(MONTH, 7, util.VN_CURDATE()); + IF IFNULL(vStartingDate,0) < TIMESTAMPADD(YEAR, -5, util.VN_CURDATE()) THEN CALL util.throw('invalid date'); END IF; DELETE FROM bs.bancos_evolution WHERE Fecha >= vStartingDate; @@ -3858,8 +3840,8 @@ BEGIN SELECT t.dated, p.id_banco, - importe FROM vn.time t join vn2008.pago p ON p.fecha <= t.dated - WHERE t.dated BETWEEN CURDATE() AND vMaxDate - AND p.fecha BETWEEN CURDATE() AND vMaxDate + WHERE t.dated BETWEEN util.VN_CURDATE() AND vMaxDate + AND p.fecha BETWEEN util.VN_CURDATE() AND vMaxDate AND NOT conciliado ON DUPLICATE KEY UPDATE saldo = saldo + VALUES(saldo); @@ -3868,8 +3850,8 @@ BEGIN SELECT t.dated, r.Id_Banco, SUM(Entregado) FROM vn.time t JOIN vn2008.Recibos r ON r.Fechacobro <= t.dated - WHERE r.Fechacobro > CURDATE() AND r.Fechacobro <= vMaxDate - AND t.dated BETWEEN CURDATE() AND vMaxDate + WHERE r.Fechacobro > util.VN_CURDATE() AND r.Fechacobro <= vMaxDate + AND t.dated BETWEEN util.VN_CURDATE() AND vMaxDate GROUP BY t.dated, r.Id_Banco ON DUPLICATE KEY UPDATE saldo = saldo + VALUES(saldo); @@ -3926,7 +3908,7 @@ BEGIN */ DECLARE vCurrentDate DATE; DECLARE vStartingDate DATE DEFAULT '2016-01-01'; - DECLARE vMaxDate DATE DEFAULT TIMESTAMPADD(MONTH, 7, CURDATE()); + DECLARE vMaxDate DATE DEFAULT TIMESTAMPADD(MONTH, 7, util.VN_CURDATE()); DELETE FROM bs.bancos_evolution WHERE Fecha > vStartingDate; @@ -3979,7 +3961,7 @@ BEGIN SELECT t.dated, p.id_banco, - importe FROM vn.time t join vn2008.pago p ON p.fecha <= t.dated - WHERE p.fecha >= CURDATE() + WHERE p.fecha >= util.VN_CURDATE() AND NOT conciliado ON DUPLICATE KEY UPDATE saldo = saldo - VALUES(saldo); @@ -3988,7 +3970,7 @@ BEGIN SELECT t.dated, r.Id_Banco, SUM(Entregado) FROM vn.time t JOIN vn2008.Recibos r ON r.Fechacobro <= t.dated - WHERE r.Fechacobro > CURDATE() + WHERE r.Fechacobro > util.VN_CURDATE() GROUP BY t.dated, r.Id_Banco ON DUPLICATE KEY UPDATE saldo = saldo + VALUES(saldo); @@ -4096,7 +4078,7 @@ BEGIN * Inserta en @bs.carteras. */ DELETE FROM bs.carteras - WHERE Año >= YEAR(CURDATE()) - 1; + WHERE Año >= YEAR(util.VN_CURDATE()) - 1; INSERT INTO bs.carteras(Año,Mes,CodigoTrabajador,Peso) SELECT t.year AS Año, t.month AS Mes, w.code AS CodigoTrabajador, SUM(v.importe) AS Peso @@ -4104,7 +4086,7 @@ BEGIN JOIN bs.ventas v on t.dated = v.fecha JOIN vn.client c on c.id = v.Id_Cliente JOIN vn.worker w ON w.id = c.salesPersonFk - WHERE t.year >= YEAR(CURDATE()) - 1 + WHERE t.year >= YEAR(util.VN_CURDATE()) - 1 GROUP BY w.code, t.year , t.month; END ;; DELIMITER ; @@ -4128,9 +4110,9 @@ BEGIN DECLARE vOneYearAgo DATETIME; DECLARE vTwoYearAgo DATETIME; - SET vOneYearAgo = TIMESTAMPADD(YEAR, -1,CURDATE()); - SET vTwoYearAgo = TIMESTAMPADD(YEAR, -2,CURDATE()); - SET vFourYearsAgo = TIMESTAMPADD(YEAR, -4,CURDATE()); + SET vOneYearAgo = TIMESTAMPADD(YEAR, -1,util.VN_CURDATE()); + SET vTwoYearAgo = TIMESTAMPADD(YEAR, -2,util.VN_CURDATE()); + SET vFourYearsAgo = TIMESTAMPADD(YEAR, -4,util.VN_CURDATE()); DELETE FROM bs.clientNewBorn WHERE lastShipped < vOneYearAgo; @@ -4167,9 +4149,9 @@ DELIMITER ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `clientDied_recalc`() BEGIN - SET @primerAviso := TIMESTAMPADD(MONTH,-1,CURDATE()); - SET @segundoAviso := TIMESTAMPADD(MONTH,-2,CURDATE()); - SET @tercerAviso := TIMESTAMPADD(MONTH,-3,CURDATE()); + SET @primerAviso := TIMESTAMPADD(MONTH,-1,util.VN_CURDATE()); + SET @segundoAviso := TIMESTAMPADD(MONTH,-2,util.VN_CURDATE()); + SET @tercerAviso := TIMESTAMPADD(MONTH,-3,util.VN_CURDATE()); TRUNCATE TABLE bs.clientDied; @@ -4194,7 +4176,7 @@ BEGIN DELETE cd.* FROM bs.clientDied cd JOIN vn.ticket t ON t.clientFk = cd.id - WHERE t.refFk IS NULL AND t.shipped >=TIMESTAMPADD(MONTH,-1,CURDATE()); + WHERE t.refFk IS NULL AND t.shipped >=TIMESTAMPADD(MONTH,-1,util.VN_CURDATE()); END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -4233,7 +4215,7 @@ BLOCK1: BEGIN FROM vn.client c JOIN vn.ticket t on t.clientFk = c.id LEFT JOIN clientNewBorn cb on cb.clientFk = c.id - WHERE t.shipped BETWEEN TIMESTAMPADD(YEAR, -1, CURDATE()) AND CURDATE() AND cb.isModified is null + WHERE t.shipped BETWEEN TIMESTAMPADD(YEAR, -1, util.VN_CURDATE()) AND util.VN_CURDATE() AND cb.isModified is null GROUP BY c.id; OPEN cur; @@ -4252,7 +4234,7 @@ BLOCK1: BEGIN DECLARE cur2 CURSOR FOR SELECT shipped FROM vn.ticket - WHERE clientFk = vClientFk AND shipped <= CURDATE() + WHERE clientFk = vClientFk AND shipped <= util.VN_CURDATE() ORDER BY shipped DESC; DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone2 = TRUE; @@ -4291,8 +4273,8 @@ BLOCK1: BEGIN LEFT JOIN (SELECT DISTINCT t.clientFk FROM vn.ticket t JOIN vn.productionConfig pc - WHERE t.shipped BETWEEN curdate() + INTERVAL -(`notBuyingMonths`) MONTH - AND curdate() + INTERVAL -(`pc`.`rookieDays`) DAY) notRookie ON notRookie.clientFk = cnb.clientFk + WHERE t.shipped BETWEEN util.VN_CURDATE() + INTERVAL -(`notBuyingMonths`) MONTH + AND util.VN_CURDATE() + INTERVAL -(`pc`.`rookieDays`) DAY) notRookie ON notRookie.clientFk = cnb.clientFk SET cnd.isRookie = ISNULL(notRookie.clientFk); END BLOCK1 ;; @@ -4681,7 +4663,7 @@ SELECT TIMESTAMPADD(DAY,1,MAX(fecha)) INTO datFEC FROM bs.compradores_evolution; END IF; - WHILE datFEC < CURDATE() DO + WHILE datFEC < util.VN_CURDATE() DO IF i mod 150 = 0 THEN SELECT datFEC; @@ -4749,7 +4731,7 @@ BEGIN INTO datFEC FROM bs.fondo_maniobra; - WHILE datFEC < CURDATE() DO + WHILE datFEC < util.VN_CURDATE() DO IF DAY(datFEC) MOD 28 = 0 THEN -- esto solo sirve para no aburrirse mientras esperamos... SELECT datFEC; @@ -5041,7 +5023,7 @@ BEGIN INTO vDated FROM bs.indicators; - WHILE vDated < CURDATE() DO + WHILE vDated < util.VN_CURDATE() DO CALL indicatorsUpdate(vDated); @@ -5130,7 +5112,7 @@ BEGIN SELECT TIMESTAMPADD(WEEK, -1,MAX(fecha)) INTO datSTART FROM bs.m3; - SET datEND = TIMESTAMPADD(DAY,-1,CURDATE()); + SET datEND = TIMESTAMPADD(DAY,-1,util.VN_CURDATE()); DELETE FROM bs.m3 WHERE fecha >= datSTART; @@ -5204,7 +5186,7 @@ BEGIN INTO vFromDated FROM vn.clientManaCache; - WHILE timestampadd(DAY,30,vFromDated) < CURDATE() DO + WHILE timestampadd(DAY,30,vFromDated) < util.VN_CURDATE() DO SELECT timestampadd(DAY,30,vFromDated), @@ -5286,7 +5268,7 @@ BEGIN JOIN (SELECT Id_Trabajador, FLOOR(SUM(importe)/12) as pesoCarteraMensual FROM bs.vendedores - WHERE año * 100 + mes >= (YEAR(CURDATE()) -1) * 100 + MONTH(CURDATE()) + WHERE año * 100 + mes >= (YEAR(util.VN_CURDATE()) -1) * 100 + MONTH(util.VN_CURDATE()) GROUP BY Id_Trabajador ) lastYearSales USING(Id_Trabajador) SET me.prices_modifier_rate = GREATEST(me.minRate,LEAST(me.maxRate,ROUND(- me.used/lastYearSales.pesoCarteraMensual,3))) ; @@ -5311,14 +5293,14 @@ CREATE DEFINER=`root`@`localhost` PROCEDURE `mermasCacheUpdate__`() BEGIN DECLARE vTimeRange INT DEFAULT 30; - DECLARE vCurYearStarted DATE DEFAULT TIMESTAMPADD(DAY, - vTimeRange, CURDATE()); - DECLARE vCurYearFinished DATE DEFAULT CURDATE(); + DECLARE vCurYearStarted DATE DEFAULT TIMESTAMPADD(DAY, - vTimeRange, util.VN_CURDATE()); + DECLARE vCurYearFinished DATE DEFAULT util.VN_CURDATE(); DECLARE vLastYearStarted DATE DEFAULT TIMESTAMPADD(YEAR, -1 , vCurYearStarted); DECLARE vLastYearFinished DATE DEFAULT TIMESTAMPADD(YEAR, -1 , vCurYearFinished); REPLACE bs.mermasCache SELECT Comprador, - IF(Fecha < vCurYearStarted, year(CURDATE()) - 1,year(CURDATE())) año, + IF(Fecha < vCurYearStarted, year(util.VN_CURDATE()) - 1,year(util.VN_CURDATE())) año, CAST(sum(Importe) as DECIMAL(10,0)) as Valor_Compra, CAST(sum(IF(Cliente LIKE 'FALTAS',Importe,0)) as DECIMAL(10,0)) as Faltas, CAST(sum(IF(Cliente LIKE 'BASURA',Importe,0)) as DECIMAL(10,0)) as Basura @@ -5361,7 +5343,7 @@ BEGIN DECLARE rs CURSOR FOR SELECT id, `schema`, `procedure` FROM nightTask - WHERE finished <= CURDATE() + WHERE finished <= util.VN_CURDATE() OR finished IS NULL ORDER BY `order`; @@ -5380,7 +5362,7 @@ BEGIN END IF; UPDATE nightTask - SET `started` = NOW(), + SET `started` = util.VN_NOW(), `finished` = NULL, `error` = NULL, `errorCode` = NULL @@ -5403,8 +5385,8 @@ BEGIN WHERE id = vId; ELSE UPDATE nightTask - SET finished = NOW(), - lastFinished = NOW() + SET finished = util.VN_NOW(), + lastFinished = util.VN_NOW() WHERE id = vId; END IF; END LOOP; @@ -5483,7 +5465,7 @@ DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `payMethodClientAdd`() BEGIN INSERT IGNORE INTO `bs`.`payMethodClient` (dated, payMethodFk, clientFk) - SELECT CURDATE(), c.payMethodFk, c.id + SELECT util.VN_CURDATE(), c.payMethodFk, c.id FROM vn.client c JOIN vn.payMethod p ON c.payMethodFk = p.id; @@ -5630,9 +5612,9 @@ DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `produccion_launcher_auto`() BEGIN - DECLARE vDate DATE DEFAULT TIMESTAMPADD(WEEK, -1, CURDATE()); + DECLARE vDate DATE DEFAULT TIMESTAMPADD(WEEK, -1, util.VN_CURDATE()); - WHILE vDate <= CURDATE() DO + WHILE vDate <= util.VN_CURDATE() DO CALL bs.produccionAdd(vDate); @@ -5640,9 +5622,9 @@ BEGIN END WHILE; - SET vDate = TIMESTAMPADD(DAY,-372, CURDATE()); + SET vDate = TIMESTAMPADD(DAY,-372, util.VN_CURDATE()); - WHILE vDate <= TIMESTAMPADD(YEAR,-1, CURDATE()) DO + WHILE vDate <= TIMESTAMPADD(YEAR,-1, util.VN_CURDATE()) DO CALL bs.produccionAdd(vDate); @@ -5718,8 +5700,8 @@ BEGIN SET vItemFk = IFNULL(vItemFk,0); SET vTypeFk = IFNULL(vTypeFk, 0); SET vCategoryFk = IFNULL(vCategoryFk,0); - SET vFromDate = IFNULL(vFromDate,CURDATE()); - SET vToDate = IFNULL(vToDate,CURDATE()); + SET vFromDate = IFNULL(vFromDate,util.VN_CURDATE()); + SET vToDate = IFNULL(vToDate,util.VN_CURDATE()); SET vProducerFk = IFNULL(vProducerFk,0); SET vFromDateLastYear = TIMESTAMPADD(YEAR,-1,vFromDate); @@ -5761,7 +5743,7 @@ DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `salePersonEvolutionAdd`(IN vDateStart DATETIME) BEGIN DELETE FROM bs.salePersonEvolution - WHERE dated <= DATE_SUB(CURDATE(), INTERVAL 1 YEAR); + WHERE dated <= DATE_SUB(util.VN_CURDATE(), INTERVAL 1 YEAR); INSERT INTO bs.salePersonEvolution (dated, amount, equalizationTax, salesPersonFk) @@ -5795,7 +5777,7 @@ CREATE DEFINER=`root`@`localhost` PROCEDURE `salesByclientSalesPerson_add`(vDate BEGIN IF vDatedFrom IS NULL THEN - SELECT CURDATE() - INTERVAL DAY(CURDATE())-1 DAY - INTERVAL 1 MONTH INTO vDatedFrom; + SELECT util.VN_CURDATE() - INTERVAL DAY(util.VN_CURDATE())-1 DAY - INTERVAL 1 MONTH INTO vDatedFrom; END IF; INSERT INTO salesByclientSalesPerson( dated, salesPersonFk, clientFk, amount, equalizationTax) @@ -5839,7 +5821,7 @@ BEGIN DECLARE vRowCount INT DEFAULT 1; DECLARE vMaxRow INT; - IF(DAY(CURDATE()) = 5) THEN + IF(DAY(util.VN_CURDATE()) = 5) THEN -- COMERCIAL Y EQUIPO DROP TEMPORARY TABLE IF EXISTS tmp.salesPersons; CREATE TEMPORARY TABLE tmp.salesPersons @@ -5868,7 +5850,7 @@ BEGIN JOIN vn.client c ON c.id = s.salesPersonFk JOIN account.user u ON u.id = s.salesPersonFk JOIN vn.commissionConfig cc - WHERE dated BETWEEN util.firstDayOfMonth(DATE_SUB(CURDATE(), INTERVAL 1 MONTH)) AND LAST_DAY(DATE_SUB(CURDATE(), INTERVAL 1 MONTH)) + WHERE dated BETWEEN util.firstDayOfMonth(DATE_SUB(util.VN_CURDATE(), INTERVAL 1 MONTH)) AND LAST_DAY(DATE_SUB(util.VN_CURDATE(), INTERVAL 1 MONTH)) GROUP BY year, month, workerFk; -- OBJETIVO EVALUABLE (GRUPO) Y OBJETIVO INCENTIVO (INDIVIDUAL) @@ -5901,16 +5883,16 @@ BEGIN IFNULL(v.portfolioWeight,0) AS walletWeigth FROM bs.vendedores v JOIN account.`user` u ON u.id = v.Id_Trabajador - JOIN vn.saleGoal sg1 ON sg1.`rank` = 1 AND sg1.`year` = YEAR(DATE_SUB(CURDATE(), INTERVAL 1 MONTH)) AND sg1.`month` = MONTH(DATE_SUB(CURDATE(), INTERVAL 1 MONTH)) - JOIN vn.saleGoal sg2 ON sg2.`rank` = 2 AND sg2.`year` = YEAR(DATE_SUB(CURDATE(), INTERVAL 1 MONTH)) AND sg2.`month` = MONTH(DATE_SUB(CURDATE(), INTERVAL 1 MONTH)) - JOIN vn.saleGoal sg3 ON sg3.`rank` = 3 AND sg3.`year` = YEAR(DATE_SUB(CURDATE(), INTERVAL 1 MONTH)) AND sg3.`month` = MONTH(DATE_SUB(CURDATE(), INTERVAL 1 MONTH)) - JOIN vn.saleGoal sg4 ON sg4.`rank` = 4 AND sg4.`year` = YEAR(DATE_SUB(CURDATE(), INTERVAL 1 MONTH)) AND sg4.`month` = MONTH(DATE_SUB(CURDATE(), INTERVAL 1 MONTH)) - JOIN vn.saleGoal sg5 ON sg5.`rank` = 5 AND sg5.`year` = YEAR(DATE_SUB(CURDATE(), INTERVAL 1 MONTH)) AND sg5.`month` = MONTH(DATE_SUB(CURDATE(), INTERVAL 1 MONTH)) - WHERE v.año = YEAR(DATE_SUB(CURDATE(), INTERVAL 1 MONTH))-1 AND v.mes = MONTH(DATE_SUB(CURDATE(), INTERVAL 1 MONTH)) + JOIN vn.saleGoal sg1 ON sg1.`rank` = 1 AND sg1.`year` = YEAR(DATE_SUB(util.VN_CURDATE(), INTERVAL 1 MONTH)) AND sg1.`month` = MONTH(DATE_SUB(util.VN_CURDATE(), INTERVAL 1 MONTH)) + JOIN vn.saleGoal sg2 ON sg2.`rank` = 2 AND sg2.`year` = YEAR(DATE_SUB(util.VN_CURDATE(), INTERVAL 1 MONTH)) AND sg2.`month` = MONTH(DATE_SUB(util.VN_CURDATE(), INTERVAL 1 MONTH)) + JOIN vn.saleGoal sg3 ON sg3.`rank` = 3 AND sg3.`year` = YEAR(DATE_SUB(util.VN_CURDATE(), INTERVAL 1 MONTH)) AND sg3.`month` = MONTH(DATE_SUB(util.VN_CURDATE(), INTERVAL 1 MONTH)) + JOIN vn.saleGoal sg4 ON sg4.`rank` = 4 AND sg4.`year` = YEAR(DATE_SUB(util.VN_CURDATE(), INTERVAL 1 MONTH)) AND sg4.`month` = MONTH(DATE_SUB(util.VN_CURDATE(), INTERVAL 1 MONTH)) + JOIN vn.saleGoal sg5 ON sg5.`rank` = 5 AND sg5.`year` = YEAR(DATE_SUB(util.VN_CURDATE(), INTERVAL 1 MONTH)) AND sg5.`month` = MONTH(DATE_SUB(util.VN_CURDATE(), INTERVAL 1 MONTH)) + WHERE v.año = YEAR(DATE_SUB(util.VN_CURDATE(), INTERVAL 1 MONTH))-1 AND v.mes = MONTH(DATE_SUB(util.VN_CURDATE(), INTERVAL 1 MONTH)) GROUP BY u.id ) sub - JOIN vn.saleGoal sg ON sg.`rank` = sub.rank AND sg.goalType = 'grupo' AND sg.`year` = YEAR(DATE_SUB(CURDATE(), INTERVAL 1 MONTH)) AND sg.`month` = MONTH(DATE_SUB(CURDATE(), INTERVAL 1 MONTH)) - JOIN vn.saleGoal sg2 ON sg2.`rank` = sub.rank AND sg2.goalType = 'individual' AND sg2.`year` = YEAR(DATE_SUB(CURDATE(), INTERVAL 1 MONTH)) AND sg2.`month` = MONTH(DATE_SUB(CURDATE(), INTERVAL 1 MONTH)) + JOIN vn.saleGoal sg ON sg.`rank` = sub.rank AND sg.goalType = 'grupo' AND sg.`year` = YEAR(DATE_SUB(util.VN_CURDATE(), INTERVAL 1 MONTH)) AND sg.`month` = MONTH(DATE_SUB(util.VN_CURDATE(), INTERVAL 1 MONTH)) + JOIN vn.saleGoal sg2 ON sg2.`rank` = sub.rank AND sg2.goalType = 'individual' AND sg2.`year` = YEAR(DATE_SUB(util.VN_CURDATE(), INTERVAL 1 MONTH)) AND sg2.`month` = MONTH(DATE_SUB(util.VN_CURDATE(), INTERVAL 1 MONTH)) JOIN vn.rankBonus rb ON rb.`rank` = sub.`rank`; -- PUNTUACIÓN EQUIPO, PLUS OBJETIVO EQUIPO Y PLUS VARIABLE JEFE DE EQUIPO @@ -5963,8 +5945,8 @@ BEGIN JOIN account.user u ON u.id = c.salesPersonFk JOIN vn.workerDepartment wd ON wd.workerFk = u.id JOIN vn.department d On d.id = wd.departmentFk - WHERE v.fecha >= util.firstDayOfMonth(DATE_SUB(CURDATE(), INTERVAL 1 MONTH)) - AND cn.firstShipped >= util.firstDayOfMonth(DATE_ADD(DATE_SUB(CURDATE(), INTERVAL 1 MONTH), INTERVAL -1 year)) + WHERE v.fecha >= util.firstDayOfMonth(DATE_SUB(util.VN_CURDATE(), INTERVAL 1 MONTH)) + AND cn.firstShipped >= util.firstDayOfMonth(DATE_ADD(DATE_SUB(util.VN_CURDATE(), INTERVAL 1 MONTH), INTERVAL -1 year)) AND d.name LIKE 'EQUIPO%' GROUP BY u.id ORDER BY total DESC; @@ -6058,7 +6040,7 @@ BEGIN SET vDated = TIMESTAMPADD(DAY, 1, vDated); END IF; - WHILE vDated < CURDATE() DO + WHILE vDated < util.VN_CURDATE() DO SET vCont = vCont + 1; @@ -6099,12 +6081,12 @@ BEGIN * Actualiza el campo portfolioWeight que indica el peso de la cartera del comercial * */ - DECLARE vStarted DATE DEFAULT DATE_FORMAT(DATE_ADD(CURDATE(), INTERVAL -17 MONTH), '%Y-%m-01'); + DECLARE vStarted DATE DEFAULT DATE_FORMAT(DATE_ADD(util.VN_CURDATE(), INTERVAL -17 MONTH), '%Y-%m-01'); UPDATE vendedores v JOIN vn.`time` t ON t.`year` = v.año AND t.`month` = v.mes SET v.portfolioWeight = NULL - WHERE t.dated BETWEEN vStarted AND CURDATE(); + WHERE t.dated BETWEEN vStarted AND util.VN_CURDATE(); UPDATE vendedores v JOIN ( @@ -6116,7 +6098,7 @@ BEGIN STRAIGHT_JOIN bs.ventas v ON t.dated = v.fecha JOIN vn.`client` c ON c.id = v.Id_Cliente WHERE c.lastSalesPersonFk IS NOT NULL - AND v.fecha BETWEEN vStarted AND CURDATE() + AND v.fecha BETWEEN vStarted AND util.VN_CURDATE() GROUP BY c.lastSalesPersonFk, t.`year`, t.`month` ) sub ON sub.lastSalesPersonFk = v.Id_Trabajador AND sub.`year` = v.año AND sub.`month`= v.mes SET v.portfolioWeight = sub.importe; @@ -6217,9 +6199,9 @@ CREATE DEFINER=`root`@`localhost` PROCEDURE `vendedores_add_launcher`() BEGIN DECLARE vDatedFrom DATE; - CALL bs.vendedores_add(YEAR(CURDATE()),QUARTER(CURDATE())); + CALL bs.vendedores_add(YEAR(util.VN_CURDATE()),QUARTER(util.VN_CURDATE())); CALL bs.vendedores_evolution_add; - SELECT util.firstDayOfMonth(CURDATE())- INTERVAL 1 MONTH INTO vDatedFrom; + SELECT util.firstDayOfMonth(util.VN_CURDATE())- INTERVAL 1 MONTH INTO vDatedFrom; CALL bs.salesByclientSalesPerson_add(vDatedFrom); END ;; @@ -6241,9 +6223,9 @@ DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `vendedores_add_launcher__`() BEGIN - CALL bs.vendedores_add(YEAR(CURDATE()),QUARTER(CURDATE())); + CALL bs.vendedores_add(YEAR(util.VN_CURDATE()),QUARTER(util.VN_CURDATE())); CALL bs.vendedores_evolution_add; - CALL bs.salesPersonClient_add(YEAR(CURDATE()), QUARTER(CURDATE())); + CALL bs.salesPersonClient_add(YEAR(util.VN_CURDATE()), QUARTER(util.VN_CURDATE())); END ;; DELIMITER ; @@ -6272,8 +6254,8 @@ Inserta en la tabla compradores_evolution las ventas acumuladas en el ultimo mes DECLARE vDateFrom DATE; DECLARE vDateTo DATE; - SET vCurYear = year(CURDATE()); - SET vCurMonth = month(CURDATE()); + SET vCurYear = year(util.VN_CURDATE()); + SET vCurMonth = month(util.VN_CURDATE()); SELECT IFNULL(max(year),vCurYear-1), IFNULL(max(month),1) INTO vYear, vMonth @@ -6340,8 +6322,8 @@ BEGIN DECLARE vEndingDate DATETIME; DECLARE TIPO_PATRIMONIAL INT DEFAULT 188; - IF datSTART < TIMESTAMPADD(YEAR,-5,CURDATE()) - OR datEND < TIMESTAMPADD(YEAR,-5,CURDATE()) THEN + IF datSTART < TIMESTAMPADD(YEAR,-5,util.VN_CURDATE()) + OR datEND < TIMESTAMPADD(YEAR,-5,util.VN_CURDATE()) THEN CALL util.throw('fechaDemasiadoAntigua'); END IF; @@ -6425,7 +6407,7 @@ BEGIN * **/ - CALL bs.ventas_add(timestampadd(week,-1,curdate()),curdate()); + CALL bs.ventas_add(timestampadd(week,-1,util.VN_CURDATE()),util.VN_CURDATE()); END ;; DELIMITER ; @@ -6567,7 +6549,7 @@ BEGIN * **/ - CALL bs.ventas_contables_add(YEAR(TIMESTAMPADD(MONTH,-1,CURDATE())), MONTH(TIMESTAMPADD(MONTH,-1,CURDATE()))); + CALL bs.ventas_contables_add(YEAR(TIMESTAMPADD(MONTH,-1,util.VN_CURDATE())), MONTH(TIMESTAMPADD(MONTH,-1,util.VN_CURDATE()))); END ;; DELIMITER ; @@ -6742,8 +6724,8 @@ BEGIN * @param @datEND Fecha de finalización a buscar */ - SET @datSTART = TIMESTAMPADD(YEAR,-2,CURDATE()); - SET @datEND = TIMESTAMPADD(DAY,-DAY(CURDATE()),CURDATE()); + SET @datSTART = TIMESTAMPADD(YEAR,-2,util.VN_CURDATE()); + SET @datEND = TIMESTAMPADD(DAY,-DAY(util.VN_CURDATE()),util.VN_CURDATE()); DROP TEMPORARY TABLE IF EXISTS tmp.VivosMuertos; @@ -6815,7 +6797,7 @@ BEGIN SELECT week, year INTO vWeek, vYear FROM vn.time - WHERE dated = CURDATE(); + WHERE dated = util.VN_CURDATE(); REPLACE bs.waste SELECT *, 100 * mermas / total as porcentaje @@ -6859,7 +6841,7 @@ BEGIN SELECT week, year INTO vWeek, vYear FROM vn.time - WHERE dated = TIMESTAMPADD(WEEK, -1, CURDATE()); + WHERE dated = TIMESTAMPADD(WEEK, -1, util.VN_CURDATE()); REPLACE bs.waste SELECT *, 100 * mermas / total as porcentaje @@ -6916,10 +6898,10 @@ BEGIN DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE; - IF DAY(CURDATE()) = 21 THEN + IF DAY(util.VN_CURDATE()) = 21 THEN - SELECT util.firstDayOfMonth(DATE_SUB(CURDATE(), INTERVAL 12 MONTH)), - LAST_DAY(DATE_SUB(CURDATE(), INTERVAL 1 MONTH)) + SELECT util.firstDayOfMonth(DATE_SUB(util.VN_CURDATE(), INTERVAL 12 MONTH)), + LAST_DAY(DATE_SUB(util.VN_CURDATE(), INTERVAL 1 MONTH)) INTO vDateStarted, vDateEnded; @@ -7039,10 +7021,10 @@ BEGIN DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE; - IF DAY(CURDATE()) = 21 THEN + IF DAY(util.VN_CURDATE()) = 21 THEN - SELECT util.firstDayOfMonth(DATE_SUB(CURDATE(), INTERVAL 12 MONTH)), - LAST_DAY(DATE_SUB(CURDATE(), INTERVAL 1 MONTH)) + SELECT util.firstDayOfMonth(DATE_SUB(util.VN_CURDATE(), INTERVAL 12 MONTH)), + LAST_DAY(DATE_SUB(util.VN_CURDATE(), INTERVAL 1 MONTH)) INTO vDateStarted, vDateEnded; @@ -7144,7 +7126,7 @@ DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `workerProductivity_add`() BEGIN DECLARE vDateFrom DATE; - SELECT DATE_SUB(CURDATE(),INTERVAL 30 DAY) INTO vDateFrom; + SELECT DATE_SUB(util.VN_CURDATE(),INTERVAL 30 DAY) INTO vDateFrom; DELETE FROM workerProductivity WHERE dated >= vDateFrom; @@ -7308,9 +7290,9 @@ DROP TABLE IF EXISTS `addressFriendship`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `addressFriendship` ( - `addressFk1` int(11) NOT NULL DEFAULT '0', - `addressFk2` int(11) NOT NULL DEFAULT '0', - `friendship` int(11) NOT NULL DEFAULT '0', + `addressFk1` int(11) NOT NULL DEFAULT 0, + `addressFk2` int(11) NOT NULL DEFAULT 0, + `friendship` int(11) NOT NULL DEFAULT 0, PRIMARY KEY (`addressFk1`,`addressFk2`), KEY `addressFriendship_fk2_idx` (`addressFk2`), CONSTRAINT `addressFriendship_fk1` FOREIGN KEY (`addressFk1`) REFERENCES `vn`.`address` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, @@ -7380,7 +7362,7 @@ CREATE TABLE `cache_calc` ( `params` varchar(100) CHARACTER SET utf8 NOT NULL DEFAULT '', `last_refresh` datetime DEFAULT NULL, `expires` datetime DEFAULT NULL, - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created` timestamp NOT NULL DEFAULT current_timestamp(), `connection_id` int(10) unsigned DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `cache_name` (`cache_id`,`params`), @@ -7401,7 +7383,7 @@ CREATE TABLE `cache_valid` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `valid` tinyint(3) unsigned NOT NULL, PRIMARY KEY (`id`) -) ENGINE=MEMORYDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -7414,8 +7396,8 @@ DROP TABLE IF EXISTS `departure_limit`; CREATE TABLE `departure_limit` ( `warehouse_id` smallint(6) unsigned NOT NULL, `fecha` date NOT NULL, - `hora` int(11) NOT NULL DEFAULT '0', - `minSpeed` decimal(10,2) NOT NULL DEFAULT '0.00', + `hora` int(11) NOT NULL DEFAULT 0, + `minSpeed` decimal(10,2) NOT NULL DEFAULT 0.00, PRIMARY KEY (`warehouse_id`,`fecha`), CONSTRAINT `warehouse_departure` FOREIGN KEY (`warehouse_id`) REFERENCES `vn`.`warehouse` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; @@ -7448,14 +7430,14 @@ DROP TABLE IF EXISTS `prod_graphic_source`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `prod_graphic_source` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `m3` double NOT NULL DEFAULT '0', + `m3` double NOT NULL DEFAULT 0, `warehouse_id` int(11) NOT NULL, `hora` int(11) NOT NULL, - `order` int(11) NOT NULL DEFAULT '0', - `graphCategory` int(11) NOT NULL DEFAULT '0', + `order` int(11) NOT NULL DEFAULT 0, + `graphCategory` int(11) NOT NULL DEFAULT 0, `Agencia` varchar(45) CHARACTER SET utf8 NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -7500,7 +7482,7 @@ DROP TABLE IF EXISTS `zoneAgencyFriendship`; CREATE TABLE `zoneAgencyFriendship` ( `agencyModeFk` int(11) NOT NULL, `zoneFk` int(11) NOT NULL, - `friendship` bigint(21) NOT NULL DEFAULT '0', + `friendship` bigint(21) NOT NULL DEFAULT 0, PRIMARY KEY (`agencyModeFk`,`zoneFk`), KEY `zoneAgencyFriendship_fk1_idx` (`zoneFk`), CONSTRAINT `zoneAgencyFriendship` FOREIGN KEY (`agencyModeFk`) REFERENCES `vn`.`agencyMode` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, @@ -7574,8 +7556,8 @@ BEGIN SELECT t.routeFk, t.zoneFk, t.addressFk addressFk1, t2.addressFk addressFk2 FROM vn.ticket t JOIN vn.ticket t2 USING(routeFk, zoneFk) - WHERE t.shipped >= TIMESTAMPADD(MONTH,-3,CURDATE()) - AND t2.shipped >= TIMESTAMPADD(MONTH,-3,CURDATE()) + WHERE t.shipped >= TIMESTAMPADD(MONTH,-3,util.VN_CURDATE()) + AND t2.shipped >= TIMESTAMPADD(MONTH,-3,util.VN_CURDATE()) AND t.addressFk != t2.addressFk) sub GROUP BY addressFk1, addressFk2; @@ -7583,7 +7565,7 @@ BEGIN SELECT r.agencyModeFk, t.zoneFk, count(*) friendship FROM vn.route r JOIN vn.ticket t ON t.routeFk = r.id - WHERE t.shipped >= TIMESTAMPADD(MONTH,-3,CURDATE()) + WHERE t.shipped >= TIMESTAMPADD(MONTH,-3,util.VN_CURDATE()) AND r.agencyModeFk AND t.routeFk AND t.zoneFk @@ -7618,7 +7600,7 @@ proc: BEGIN RESIGNAL; END; - IF vDate < CURDATE() THEN + IF vDate < util.VN_CURDATE() THEN LEAVE proc; END IF; @@ -7638,7 +7620,7 @@ proc: BEGIN SELECT inventoried INTO vInventoryDate FROM vn.config; - SELECT SUBTIME(NOW(), reserveTime) INTO vReserveDate + SELECT SUBTIME(util.VN_NOW(), reserveTime) INTO vReserveDate FROM hedera.orderConfig; -- Calcula el ultimo dia de vida para cada producto @@ -7812,7 +7794,7 @@ proc: BEGIN RESIGNAL; END; - IF vDate < CURDATE() THEN + IF vDate < util.VN_CURDATE() THEN LEAVE proc; END IF; @@ -7844,7 +7826,7 @@ proc: BEGIN SELECT inventoried INTO vInventoryDate FROM vn.config; - SELECT SUBTIME(NOW(), reserveTime) INTO vReserveDate + SELECT SUBTIME(util.VN_NOW(), reserveTime) INTO vReserveDate FROM hedera.orderConfig; -- Calcula el ultimo dia de vida para cada producto @@ -7970,7 +7952,7 @@ DELIMITER ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `cacheCalc_clean`() BEGIN - DECLARE vCleanTime DATETIME DEFAULT TIMESTAMPADD(MINUTE, -5, NOW()); + DECLARE vCleanTime DATETIME DEFAULT TIMESTAMPADD(MINUTE, -5, util.VN_NOW()); DELETE FROM cache_calc WHERE expires < vCleanTime; END ;; DELIMITER ; @@ -7997,8 +7979,8 @@ BEGIN UPDATE cache_calc cc JOIN cache c ON c.id = cc.cache_id SET - cc.last_refresh = NOW(), - cc.expires = LEAST(ADDTIME(NOW(), c.lifetime), util.midNight()), + cc.last_refresh = util.VN_NOW(), + cc.expires = LEAST(ADDTIME(util.VN_NOW(), c.lifetime), util.midNight()), cc.connection_id = NULL WHERE cc.id = v_calc; @@ -8077,7 +8059,7 @@ proc: BEGIN -- Si existe una calculo valido libera el bloqueo y devuelve su identificador. - IF !v_refresh AND NOW() < v_expires + IF !v_refresh AND util.VN_NOW() < v_expires THEN DO RELEASE_LOCK(v_lock_id); SET v_refresh = FALSE; @@ -8186,7 +8168,7 @@ BEGIN DECLARE vDateShort DATETIME; - SET vDateShort = TIMESTAMPADD(MONTH, -1, CURDATE()); + SET vDateShort = TIMESTAMPADD(MONTH, -1, util.VN_CURDATE()); DELETE FROM cache.departure_limit WHERE Fecha < vDateShort; END ;; @@ -8223,11 +8205,11 @@ DECLARE vLoadingDelay DECIMAL(5) DEFAULT 2; DECLARE rs CURSOR FOR SELECT Departure , Sum(pb.m3)/(GREATEST(IFNULL(lhp.m3,0),IFNULL(dp.minSpeed,0))) AS Horas - , curDate()+(Departure + vLoadingDelay -(Sum(pb.m3)/(GREATEST(IFNULL(lhp.m3,0),IFNULL(minSpeed,0))))/24) AS InicioPreparacion + , util.VN_CURDATE()+(Departure + vLoadingDelay -(Sum(pb.m3)/(GREATEST(IFNULL(lhp.m3,0),IFNULL(minSpeed,0))))/24) AS InicioPreparacion FROM tmp.production_buffer pb LEFT JOIN vn.lastHourProduction lhp ON lhp.warehouseFk = pb.warehouse_id - LEFT JOIN cache.departure_limit dp ON dp.warehouse_id = pb.warehouse_id AND dp.fecha = CURDATE() - WHERE pb.Fecha = CURDATE() + LEFT JOIN cache.departure_limit dp ON dp.warehouse_id = pb.warehouse_id AND dp.fecha = util.VN_CURDATE() + WHERE pb.Fecha = util.VN_CURDATE() AND pb.graphCategory > 1 AND IFNULL(Departure,0) > 0 GROUP BY Departure @@ -8235,7 +8217,7 @@ DECLARE rs CURSOR FOR DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE; - SET myTime = HOUR(now()) + MINUTE(now()) / 60; + SET myTime = HOUR(util.VN_NOW()) + MINUTE(util.VN_NOW()) / 60; OPEN rs; @@ -8269,10 +8251,10 @@ DECLARE rs CURSOR FOR SELECT minSpeed INTO myMinSpeed FROM cache.departure_limit WHERE warehouse_id = vWarehouseId - AND fecha = CURDATE(); + AND fecha = util.VN_CURDATE(); REPLACE cache.departure_limit(warehouse_id, fecha, hora, minSpeed) - VALUES (vWarehouseId, CURDATE(), departureLimit, IFNULL(myMinSpeed,0)); + VALUES (vWarehouseId, util.VN_CURDATE(), departureLimit, IFNULL(myMinSpeed,0)); CLOSE rs; @@ -8308,11 +8290,11 @@ DECLARE departureLimit INT; DECLARE rs CURSOR FOR SELECT Departure , Sum(pb.m3)/GREATEST(v.m3,IFNULL(minSpeed,0)) AS Horas - , curDate()+(Departure-(Sum(pb.m3)/GREATEST(v.m3,IFNULL(minSpeed,0)))/24) AS InicioPreparacion + , util.VN_CURDATE()+(Departure-(Sum(pb.m3)/GREATEST(v.m3,IFNULL(minSpeed,0)))/24) AS InicioPreparacion FROM tmp.production_buffer pb JOIN vn2008.v_encajado_ultima_hora v ON v.warehouse_id = pb.warehouse_id - LEFT JOIN cache.departure_limit dp ON dp.warehouse_id = pb.warehouse_id AND dp.fecha = CURDATE() - WHERE pb.Fecha = CURDATE() + LEFT JOIN cache.departure_limit dp ON dp.warehouse_id = pb.warehouse_id AND dp.fecha = util.VN_CURDATE() + WHERE pb.Fecha = util.VN_CURDATE() AND alert_level < 2 AND IFNULL(Departure,0) > 0 GROUP BY Departure @@ -8320,7 +8302,7 @@ DECLARE rs CURSOR FOR DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE; -SET myTime = HOUR(now()) + MINUTE(now()) / 60; +SET myTime = HOUR(util.VN_NOW()) + MINUTE(util.VN_NOW()) / 60; OPEN rs; @@ -8358,7 +8340,7 @@ SET departureLimit = IFNULL(departureLimit,24); IF departureLimit > 0 THEN REPLACE cache.departure_limit(warehouse_id, fecha, hora, minSpeed) - VALUES (vWarehouseId, CURDATE(), departureLimit, myMinSpeed); + VALUES (vWarehouseId, util.VN_CURDATE(), departureLimit, myMinSpeed); END IF; @@ -8410,7 +8392,7 @@ proc: BEGIN -- TODO: ¿Se puede usar la fecha del ultimo inventario? SELECT inventoried INTO started FROM vn.config LIMIT 1; - SET ended = CURDATE(); -- TIMESTAMPADD(DAY, -1, CURDATE()); + SET ended = util.VN_CURDATE(); -- TIMESTAMPADD(DAY, -1, util.VN_CURDATE()); CALL vn.buyUltimateFromInterval(NULL, started, ended); @@ -8466,7 +8448,7 @@ proc: BEGIN pb.Agencia FROM tmp.production_buffer pb JOIN vn.state st ON st.id = pb.state - WHERE Fecha = CURDATE() + WHERE Fecha = util.VN_CURDATE() GROUP BY wh_id, graphCategory ; @@ -8516,7 +8498,7 @@ proc: BEGIN END IF; SET v_date_inv = (SELECT inventoried FROM vn.config LIMIT 1); - SET v_curdate = CURDATE(); + SET v_curdate = util.VN_CURDATE(); DELETE FROM stock; @@ -8583,7 +8565,7 @@ proc: BEGIN END IF; SET v_date_inv = (SELECT FechaInventario FROM vn2008.tblContadores LIMIT 1); - SET v_curdate = CURDATE(); + SET v_curdate = util.VN_CURDATE(); DELETE FROM stock; @@ -8791,7 +8773,7 @@ DROP TABLE IF EXISTS `VMPSettings`; CREATE TABLE `VMPSettings` ( `VMPID` int(11) NOT NULL, `name` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, - `isEktSender` tinyint(4) NOT NULL DEFAULT '0', + `isEktSender` tinyint(4) NOT NULL DEFAULT 0, `MessageID` int(11) NOT NULL, `dateTimeTry` timestamp NULL DEFAULT NULL, `isVmpBA` tinyint(4) DEFAULT NULL COMMENT 'Basic authentication', @@ -8807,12 +8789,12 @@ CREATE TABLE `VMPSettings` ( `closedFrom` int(11) DEFAULT NULL, `closedTo` int(11) DEFAULT NULL, `totalRefreshHours` int(11) DEFAULT NULL COMMENT 'Numero > 4 para no saturar, no repetir para que no solapen las actualizaciones', - `UseSupplierEmbalageCode` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'vmp you want to see their embalage code', + `UseSupplierEmbalageCode` tinyint(4) NOT NULL DEFAULT 0 COMMENT 'vmp you want to see their embalage code', `firstSupplyResponseId` int(11) DEFAULT NULL, `ApiId` int(11) DEFAULT NULL, `ApiKey` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, - `isBlocked` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'product source not allowed', - `isVNHSupplier` tinyint(1) DEFAULT '0' COMMENT 'The account belongs to VNH', + `isBlocked` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'product source not allowed', + `isVNHSupplier` tinyint(1) DEFAULT 0 COMMENT 'The account belongs to VNH', PRIMARY KEY (`VMPID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -8894,7 +8876,7 @@ CREATE TABLE `deliveryInformation` ( `FirstOrderDateTime` datetime DEFAULT NULL, `LatestOrderDateTime` datetime DEFAULT NULL, `supplyResponseID` int(11) DEFAULT NULL, - `updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `updated` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), PRIMARY KEY (`ID`), UNIQUE KEY `deliveryInformation_UN` (`Location`,`LatestDeliveryDateTime`,`FirstOrderDateTime`,`LatestOrderDateTime`,`supplyResponseID`), KEY `fgbSupplyResponse_idx` (`supplyResponseID`), @@ -8902,7 +8884,7 @@ CREATE TABLE `deliveryInformation` ( KEY `fgbSupplyResponse_idx3` (`LatestOrderDateTime`) USING BTREE, KEY `deliveryInformation_updated_IDX` (`updated`) USING BTREE, CONSTRAINT `fgbSupplyResponse` FOREIGN KEY (`supplyResponseID`) REFERENCES `supplyResponse` (`ID`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -8913,7 +8895,7 @@ DROP TABLE IF EXISTS `di`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `di` ( - `ID` int(11) NOT NULL DEFAULT '0', + `ID` int(11) NOT NULL DEFAULT 0, `Location` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `LatestDeliveryDateTime` datetime DEFAULT NULL, `FirstOrderDateTime` datetime DEFAULT NULL, @@ -8938,11 +8920,11 @@ CREATE TABLE `ekt` ( `deliveryNumber` bigint(20) unsigned DEFAULT NULL, `fec` date DEFAULT NULL, `hor` time DEFAULT NULL, - `now` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + `util.VN_NOW` timestamp NULL DEFAULT current_timestamp(), `ptj` mediumint(8) unsigned DEFAULT NULL, `ref` int(11) NOT NULL, `item` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, - `pac` int(11) DEFAULT '0', + `pac` int(11) DEFAULT 0, `qty` int(10) NOT NULL, `ori` varchar(3) COLLATE utf8_unicode_ci DEFAULT 'NL', `cat` varchar(2) COLLATE utf8_unicode_ci DEFAULT NULL, @@ -8965,10 +8947,10 @@ CREATE TABLE `ekt` ( `s4` varchar(4) COLLATE utf8_unicode_ci DEFAULT NULL, `s5` varchar(3) COLLATE utf8_unicode_ci DEFAULT NULL, `s6` varchar(3) COLLATE utf8_unicode_ci DEFAULT NULL, - `ok` tinyint(4) NOT NULL DEFAULT '0', + `ok` tinyint(4) NOT NULL DEFAULT 0, `trolleyFk` int(11) DEFAULT NULL, `putOrderFk` bigint(20) unsigned DEFAULT NULL, - `scanned` tinyint(1) NOT NULL DEFAULT '0', + `scanned` tinyint(1) NOT NULL DEFAULT 0, PRIMARY KEY (`id`) USING BTREE, UNIQUE KEY `barcode_year` (`barcode`,`entryYear`), UNIQUE KEY `entry_year` (`deliveryNumber`,`entryYear`) USING BTREE, @@ -8979,7 +8961,7 @@ CREATE TABLE `ekt` ( KEY `barcode` (`barcode`), KEY `fec` (`fec`), KEY `putOrderFk` (`putOrderFk`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -8999,7 +8981,7 @@ CREATE TABLE `ektEntryAssign__` ( `supplierFk` int(11) DEFAULT NULL, `entryFk` int(11) DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='define las condiciones para asignar entradas a los ekt'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='define las condiciones para asignar entradas a los ekt'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -9042,7 +9024,7 @@ CREATE TABLE `exchange` ( KEY `buy_edi_id` (`ektFk`), CONSTRAINT `exchange_ibfk_1` FOREIGN KEY (`mailFk`) REFERENCES `mail` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `exchange_ibfk_2` FOREIGN KEY (`ektFk`) REFERENCES `ekt` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -9061,7 +9043,7 @@ CREATE TABLE `exchangeConfig` ( PRIMARY KEY (`id`), KEY `presale_id` (`presaleFk`), CONSTRAINT `exchangeConfig_ibfk_1` FOREIGN KEY (`presaleFk`) REFERENCES `exchangeType` (`id`) ON DELETE SET NULL ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Configuration parameters'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Configuration parameters'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -9122,8 +9104,8 @@ DROP TABLE IF EXISTS `floraHollandConfig`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `floraHollandConfig` ( - `defaultAdminNumber` int(11) NOT NULL DEFAULT '66011', - `floramondoMargin` decimal(10,2) NOT NULL DEFAULT '0.17' + `defaultAdminNumber` int(11) NOT NULL DEFAULT 66011, + `floramondoMargin` decimal(10,2) NOT NULL DEFAULT 0.17 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -9140,7 +9122,7 @@ CREATE TABLE `ftpConfig` ( `user` varchar(50) CHARACTER SET utf8 NOT NULL, `password` varchar(50) CHARACTER SET utf8 NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Configuration parameters'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Configuration parameters'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -9156,7 +9138,7 @@ CREATE TABLE `genus` ( `entry_date` date DEFAULT NULL, `expiry_date` date DEFAULT NULL, `change_date_time` datetime DEFAULT NULL, - `isHazard` tinyint(1) NOT NULL DEFAULT '0', + `isHazard` tinyint(1) NOT NULL DEFAULT 0, PRIMARY KEY (`genus_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='/tmp/floricode/florecompc2/FG130916.txt'; /*!40101 SET character_set_client = @saved_cs_client */; @@ -9315,7 +9297,7 @@ CREATE TABLE `item_groupToOffer` ( `group_code` int(11) unsigned NOT NULL, `itemTypeFk` smallint(5) unsigned NOT NULL, `intrastatFk` int(8) unsigned zerofill NOT NULL, - `originFk` tinyint(2) unsigned NOT NULL DEFAULT '17', + `originFk` tinyint(2) unsigned NOT NULL DEFAULT 17, `expenseFk` varchar(10) COLLATE utf8_unicode_ci DEFAULT '7001000000', PRIMARY KEY (`group_code`), KEY `item_groupToOffer_fk2_idx` (`itemTypeFk`), @@ -9336,20 +9318,20 @@ DROP TABLE IF EXISTS `item_track`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `item_track` ( `item_id` int(10) unsigned NOT NULL, - `s1` tinyint(3) NOT NULL DEFAULT '0', - `s2` tinyint(3) NOT NULL DEFAULT '0', - `s3` tinyint(3) NOT NULL DEFAULT '0', - `s4` tinyint(3) NOT NULL DEFAULT '0', - `pac` tinyint(3) NOT NULL DEFAULT '0', - `cat` tinyint(3) NOT NULL DEFAULT '0', - `ori` tinyint(3) NOT NULL DEFAULT '0', - `pro` tinyint(3) NOT NULL DEFAULT '0', - `package` tinyint(3) NOT NULL DEFAULT '0', - `s5` tinyint(3) NOT NULL DEFAULT '0', - `s6` tinyint(3) NOT NULL DEFAULT '0', - `kop` tinyint(3) NOT NULL DEFAULT '0', - `sub` tinyint(3) NOT NULL DEFAULT '0', - `item` tinyint(3) NOT NULL DEFAULT '0', + `s1` tinyint(3) NOT NULL DEFAULT 0, + `s2` tinyint(3) NOT NULL DEFAULT 0, + `s3` tinyint(3) NOT NULL DEFAULT 0, + `s4` tinyint(3) NOT NULL DEFAULT 0, + `pac` tinyint(3) NOT NULL DEFAULT 0, + `cat` tinyint(3) NOT NULL DEFAULT 0, + `ori` tinyint(3) NOT NULL DEFAULT 0, + `pro` tinyint(3) NOT NULL DEFAULT 0, + `package` tinyint(3) NOT NULL DEFAULT 0, + `s5` tinyint(3) NOT NULL DEFAULT 0, + `s6` tinyint(3) NOT NULL DEFAULT 0, + `kop` tinyint(3) NOT NULL DEFAULT 0, + `sub` tinyint(3) NOT NULL DEFAULT 0, + `item` tinyint(3) NOT NULL DEFAULT 0, PRIMARY KEY (`item_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -9366,9 +9348,9 @@ CREATE TABLE `log` ( `tableName` varchar(100) COLLATE utf8_unicode_ci NOT NULL, `fieldName` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `fieldValue` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created` timestamp NOT NULL DEFAULT current_timestamp(), PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -9385,12 +9367,12 @@ CREATE TABLE `mail` ( `messageId` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `nExchanges` int(10) unsigned NOT NULL, `error` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created` timestamp NOT NULL DEFAULT current_timestamp(), PRIMARY KEY (`id`), UNIQUE KEY `mail_id` (`messageId`), KEY `sender_id` (`senderFk`), CONSTRAINT `mail_ibfk_2` FOREIGN KEY (`senderFk`) REFERENCES `mailSender` (`id`) ON DELETE NO ACTION ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -9406,7 +9388,7 @@ CREATE TABLE `mailSender` ( `kop` int(10) unsigned DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `mail` (`mail`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='List of allowed mailers'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='List of allowed mailers'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -9419,11 +9401,11 @@ DROP TABLE IF EXISTS `marketPlace`; CREATE TABLE `marketPlace` ( `id` varchar(13) COLLATE utf8_unicode_ci NOT NULL, `name` varchar(45) COLLATE utf8_unicode_ci NOT NULL, - `supplierFk` int(11) NOT NULL DEFAULT '1433', - `isOffered` tinyint(2) NOT NULL DEFAULT '0', + `supplierFk` int(11) NOT NULL DEFAULT 1433, + `isOffered` tinyint(2) NOT NULL DEFAULT 0, `MaxLatestDeliveryHour` int(11) DEFAULT NULL COMMENT 'Maxima hora para tener en cuenta la oferta', - `isLatestOrderDateTimeRelevant` tinyint(2) DEFAULT '0' COMMENT 'Se tiene en cuenta para calcular el próximo travel posible', - `isEarlyBird` tinyint(4) NOT NULL DEFAULT '0', + `isLatestOrderDateTimeRelevant` tinyint(2) DEFAULT 0 COMMENT 'Se tiene en cuenta para calcular el próximo travel posible', + `isEarlyBird` tinyint(4) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), KEY `marketPlaceisOfferedIdx` (`isOffered`), KEY `marketPlaceMaxLatestIdx` (`MaxLatestDeliveryHour`), @@ -9460,12 +9442,12 @@ CREATE TABLE `param` ( `code` varchar(30) COLLATE utf8_unicode_ci NOT NULL, `name` varchar(5) COLLATE utf8_unicode_ci NOT NULL, `subname` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, - `position` tinyint(3) unsigned NOT NULL DEFAULT '1', + `position` tinyint(3) unsigned NOT NULL DEFAULT 1, `type` enum('INTEGER','DOUBLE','STRING','DATE','TIME') COLLATE utf8_unicode_ci NOT NULL, - `required` tinyint(3) unsigned NOT NULL DEFAULT '1', + `required` tinyint(3) unsigned NOT NULL DEFAULT 1, PRIMARY KEY (`id`), UNIQUE KEY `name` (`name`,`subname`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Parameters to capture of every exchange'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Parameters to capture of every exchange'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -9498,16 +9480,16 @@ CREATE TABLE `putOrder` ( `deliveryInformationID` int(11) DEFAULT NULL, `supplyResponseID` int(11) DEFAULT NULL, `orderTradelineItemID` int(11) DEFAULT NULL COMMENT 'ticketFk or EntryFk?', - `OrderTradeLineDateTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'fecha de creacion en la tabla', + `OrderTradeLineDateTime` timestamp NOT NULL DEFAULT current_timestamp() COMMENT 'fecha de creacion en la tabla', `quantity` int(11) DEFAULT NULL, `EndUserPartyID` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `EndUserPartyGLN` varchar(13) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'The grower can use this reference in his EKT in the NAD (MA) segment.', - `OrderStatus` int(11) DEFAULT '0' COMMENT '1 pending\n2 confirmed\n3 canceled', + `OrderStatus` int(11) DEFAULT 0 COMMENT '1 pending\n2 confirmed\n3 canceled', `isOrderProcessed` tinyint(4) DEFAULT NULL, `error` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `barcode` varchar(25) COLLATE utf8_unicode_ci DEFAULT NULL, - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - `FHAdminNumber` int(11) DEFAULT '66011', + `created` timestamp NOT NULL DEFAULT current_timestamp(), + `FHAdminNumber` int(11) DEFAULT 66011, `saleFk` int(11) DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `orderTradelineItemID_UNIQUE` (`orderTradelineItemID`), @@ -9515,7 +9497,7 @@ CREATE TABLE `putOrder` ( KEY `supplyResponseID_idx` (`supplyResponseID`), KEY `putOrder_FK` (`saleFk`), CONSTRAINT `putOrder_FK` FOREIGN KEY (`saleFk`) REFERENCES `vn`.`sale` (`id`) ON DELETE SET NULL ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -9618,7 +9600,7 @@ BEGIN JOIN vn.ticket t ON s.ticketFk = t.id JOIN vn.item i ON i.id = s.itemFk JOIN deliveryInformation di ON di.ID = NEW.deliveryInformationID - WHERE t.clientFk = NEW.EndUserPartyGLN AND t.shipped >= CURDATE() + WHERE t.clientFk = NEW.EndUserPartyGLN AND t.shipped >= util.VN_CURDATE() AND i.supplyResponseFk = NEW.supplyResponseID LIMIT 1; @@ -9627,7 +9609,7 @@ BEGIN JOIN vn.item i ON i.id = s.itemFk JOIN deliveryInformation di ON di.ID = NEW.deliveryInformationID SET s.quantity = 0 - WHERE t.clientFk = NEW.EndUserPartyGLN AND t.shipped >= CURDATE() + WHERE t.clientFk = NEW.EndUserPartyGLN AND t.shipped >= util.VN_CURDATE() AND i.supplyResponseFk = NEW.supplyResponseID; INSERT INTO vn.mail (sender, `subject`, body) @@ -9713,8 +9695,8 @@ CREATE TABLE `supplier` ( `entry_date` date NOT NULL, `expiry_date` date NOT NULL, `change_date_time` datetime NOT NULL, - `isAllowedDirectSales` tinyint(1) NOT NULL DEFAULT '0', - `isBanned` tinyint(1) NOT NULL DEFAULT '0', + `isAllowedDirectSales` tinyint(1) NOT NULL DEFAULT 0, + `isBanned` tinyint(1) NOT NULL DEFAULT 0, PRIMARY KEY (`supplier_id`), UNIQUE KEY `supplier_UN` (`glnAddressCode`), KEY `glnaddressCodeidx` (`glnAddressCode`) @@ -9837,9 +9819,9 @@ CREATE TABLE `supplyResponse` ( `widthMeasure` int(11) DEFAULT NULL COMMENT 'mm Embalage Width', `lengthMeasure` int(11) DEFAULT NULL COMMENT 'mm Embalage Length', `heightMeasure` int(11) DEFAULT NULL COMMENT 'mm Embalage Height', - `created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created` datetime NOT NULL DEFAULT current_timestamp(), `EmbalageCodeSupplier` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, - `updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `updated` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), PRIMARY KEY (`ID`), KEY `IX_TransNumber` (`TransactionNumber`) COMMENT 'Agregado por Ernesto 11.6.2019\nSe ejecutaba 1 consulta por segundo desde MAIL y consumia un 20% de CPU de todo el servidor !!!!!\nCPU usada es mas estable que Indice en SendererID, cpu vs espacio que ocupa?\n', KEY `supplyResponse_Ix1` (`Item_ArticleCode`), @@ -9850,7 +9832,7 @@ CREATE TABLE `supplyResponse` ( KEY `supplyResponse_updated_IDX` (`updated`) USING BTREE, CONSTRAINT `supplyResponse_fk2` FOREIGN KEY (`MarketPlaceID`) REFERENCES `marketPlace` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `supplyResponseputOrder_FK` FOREIGN KEY (`vmpID`) REFERENCES `VMPSettings` (`VMPID`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -9877,7 +9859,7 @@ BEGIN WHERE i.supplyResponseFk = NEW.ID AND am.name = 'LOGIFLORA' AND e.isRaid - AND tr.landed >= CURDATE(); + AND tr.landed >= util.VN_CURDATE(); END */;; DELIMITER ; @@ -9896,14 +9878,14 @@ DROP TABLE IF EXISTS `supplyResponseLog`; CREATE TABLE `supplyResponseLog` ( `id` int(11) NOT NULL AUTO_INCREMENT, `supplyResponseFk` int(11) NOT NULL, - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created` timestamp NOT NULL DEFAULT current_timestamp(), `NumberOfUnitsOld` int(11) DEFAULT NULL, `NumberOfUnitsNew` int(11) DEFAULT NULL, `lastVMPUpdate` datetime DEFAULT NULL, PRIMARY KEY (`id`), KEY `supplyResponseLog_FK` (`supplyResponseFk`), CONSTRAINT `supplyResponseLog_FK` FOREIGN KEY (`supplyResponseFk`) REFERENCES `supplyResponse` (`ID`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Esta tabla la utiliza la empresa LOGIFLORA. No kkear.'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Esta tabla la utiliza la empresa LOGIFLORA. No kkear.'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -9951,10 +9933,10 @@ DROP TABLE IF EXISTS `warehouseFloramondo`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `warehouseFloramondo` ( `warehouseFk` smallint(6) unsigned NOT NULL, - `travellingDays` int(11) NOT NULL DEFAULT '1', + `travellingDays` int(11) NOT NULL DEFAULT 1, `entryFk` int(11) DEFAULT NULL, `isFV` int(11) DEFAULT NULL COMMENT 'NULL indiferente\n0 no\n1 si\n', - `dayRange` int(11) NOT NULL DEFAULT '0' COMMENT 'dias de margen a futuro', + `dayRange` int(11) NOT NULL DEFAULT 0 COMMENT 'dias de margen a futuro', PRIMARY KEY (`warehouseFk`), KEY `warehouseFloramondo_FK2_idx` (`entryFk`), CONSTRAINT `warehouseFloramondo_FK2` FOREIGN KEY (`entryFk`) REFERENCES `vn`.`entry` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, @@ -10037,8 +10019,8 @@ DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `clean`() BEGIN - DECLARE vFourYearsAgo DATE DEFAULT TIMESTAMPADD(YEAR,-4,CURDATE()); - DECLARE vOneWeekAgo DATE DEFAULT TIMESTAMPADD(WEEK,-1,CURDATE()); + DECLARE vFourYearsAgo DATE DEFAULT TIMESTAMPADD(YEAR,-4,util.VN_CURDATE()); + DECLARE vOneWeekAgo DATE DEFAULT TIMESTAMPADD(WEEK,-1,util.VN_CURDATE()); DELETE FROM ekt WHERE fec < vFourYearsAgo; @@ -10048,7 +10030,7 @@ BEGIN WHERE di.LatestOrderDateTime < vOneWeekAgo OR di.ID IS NULL; DELETE FROM putOrder - WHERE created < TIMESTAMPADD(MONTH,-1,CURDATE()); + WHERE created < TIMESTAMPADD(MONTH,-1,util.VN_CURDATE()); END ;; DELIMITER ; @@ -10135,7 +10117,7 @@ BEGIN putOrderFk, `ref`, kop) - SELECT year(curdate()) entryYear, + SELECT year(util.VN_CURDATE()) entryYear, p.id deliveryNumber , DATE(di.LatestDeliveryDateTime) fec, HOUR(di.LatestDeliveryDateTime) hor, @@ -10304,7 +10286,7 @@ proc:BEGIN AND IF(t.package, l.package = e.package, TRUE) AND IF(t.item, l.item = e.item, TRUE) AND i.isFloramondo = vIsFloramondoDirect - ORDER BY l.now DESC, b.id ASC + ORDER BY l.util.VN_NOW DESC, b.id ASC LIMIT 1; END IF; @@ -10486,7 +10468,7 @@ BEGIN DECLARE cursor1 CURSOR FOR SELECT e.id FROM edi.ekt e LEFT JOIN vn.buy b ON b.ektFk = e.id - WHERE e.fec >= CURDATE() + WHERE e.fec >= util.VN_CURDATE() AND ISNULL(b.ektFk); DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = 1; @@ -10765,7 +10747,7 @@ proc: BEGIN RESIGNAL; END; - SET vStartingTime = NOW(); + SET vStartingTime = util.VN_NOW(); TRUNCATE edi.offerList ; @@ -10881,19 +10863,19 @@ proc: BEGIN AND i.quality <=> o.Quality JOIN vn.itemType it ON it.id = i.typeFk LEFT JOIN vn.sale s ON s.itemFk = i.id - LEFT JOIN vn.ticket t ON t.id = s.ticketFk AND t.shipped > TIMESTAMPADD(WEEK, -1, CURDATE()) + LEFT JOIN vn.ticket t ON t.id = s.ticketFk AND t.shipped > TIMESTAMPADD(WEEK, -1, util.VN_CURDATE()) LEFT JOIN edi.supplyResponse sr ON sr.ID = i.supplyResponseFk LEFT JOIN edi.deliveryInformation di ON di.supplyResponseID = sr.ID - LEFT JOIN edi.putOrder po ON po.supplyResponseID = i.supplyResponseFk AND po.OrderTradeLineDateTime > TIMESTAMPADD(WEEK, -1, CURDATE()) + LEFT JOIN edi.putOrder po ON po.supplyResponseID = i.supplyResponseFk AND po.OrderTradeLineDateTime > TIMESTAMPADD(WEEK, -1, util.VN_CURDATE()) SET i.supplyResponseFk = o.srID WHERE ( sr.ID IS NULL OR sr.NumberOfUnits = 0 - OR di.LatestOrderDateTime < NOW() + OR di.LatestOrderDateTime < util.VN_NOW() OR di.ID IS NULL) AND it.isInventory AND t.id IS NULL AND po.id IS NULL; - -- select now(),'Antes de crear ITO'; + -- select util.VN_NOW(),'Antes de crear ITO'; DROP TEMPORARY TABLE IF EXISTS itemToInsert; CREATE TEMPORARY TABLE itemToInsert ENGINE = MEMORY SELECT o.*, CAST(NULL AS DECIMAL(6,0)) as itemFk @@ -11074,7 +11056,7 @@ proc: BEGIN JOIN edi.marketPlace mp ON mp.id = sr.MarketPlaceID JOIN vn.floramondoConfig fc WHERE mp.isLatestOrderDateTimeRelevant - AND di.LatestOrderDateTime > IF(fc.MaxLatestOrderHour > HOUR(NOW()), CURDATE(), TIMESTAMPADD(DAY,1,CURDATE())); + AND di.LatestOrderDateTime > IF(fc.MaxLatestOrderHour > HOUR(util.VN_NOW()), util.VN_CURDATE(), TIMESTAMPADD(DAY,1,util.VN_CURDATE())); UPDATE vn.floramondoConfig SET nextLanded = vLanded @@ -11089,7 +11071,7 @@ proc: BEGIN LEFT JOIN edi.supplyResponse sr ON i.supplyResponseFk = sr.ID LEFT JOIN edi.deliveryInformation di ON di.ID = b.deliveryFk SET b.quantity = 0 - WHERE (IFNULL(di.LatestOrderDateTime,NOW()) <= NOW() + WHERE (IFNULL(di.LatestOrderDateTime,util.VN_NOW()) <= util.VN_NOW() OR i.supplyResponseFk IS NULL OR sr.NumberOfUnits = 0) AND am.name = 'LOGIFLORA' @@ -11118,7 +11100,7 @@ proc: BEGIN JOIN edi.warehouseFloramondo wf ON wf.entryFk = b.entryFk; */ -- Se inserta el resto - SET vLastInserted := NOW(); + SET vLastInserted := util.VN_NOW(); -- Inserta la oferta INSERT INTO vn.buy( entryFk, @@ -11208,7 +11190,7 @@ proc: BEGIN AND typeFk = 17; INSERT INTO edi.log(tableName, fieldName,fieldValue) - VALUES('floramondo_offerRefresh','Tiempo de proceso',TIMEDIFF(NOW(),vStartingTime)); + VALUES('floramondo_offerRefresh','Tiempo de proceso',TIMEDIFF(util.VN_NOW(),vStartingTime)); @@ -11256,7 +11238,7 @@ proc: BEGIN RESIGNAL; END; - SET vStartingTime = NOW(); + SET vStartingTime = util.VN_NOW(); TRUNCATE edi.offerList ; @@ -11372,19 +11354,19 @@ proc: BEGIN AND i.quality <=> o.Quality JOIN vn.itemType it ON it.id = i.typeFk LEFT JOIN vn.sale s ON s.itemFk = i.id - LEFT JOIN vn.ticket t ON t.id = s.ticketFk AND t.shipped > TIMESTAMPADD(WEEK, -1, CURDATE()) + LEFT JOIN vn.ticket t ON t.id = s.ticketFk AND t.shipped > TIMESTAMPADD(WEEK, -1, util.VN_CURDATE()) LEFT JOIN edi.supplyResponse sr ON sr.ID = i.supplyResponseFk LEFT JOIN edi.deliveryInformation di ON di.supplyResponseID = sr.ID - LEFT JOIN edi.putOrder po ON po.supplyResponseID = i.supplyResponseFk AND po.OrderTradeLineDateTime > TIMESTAMPADD(WEEK, -1, CURDATE()) + LEFT JOIN edi.putOrder po ON po.supplyResponseID = i.supplyResponseFk AND po.OrderTradeLineDateTime > TIMESTAMPADD(WEEK, -1, util.VN_CURDATE()) SET i.supplyResponseFk = o.srID WHERE ( sr.ID IS NULL OR sr.NumberOfUnits = 0 - OR di.LatestOrderDateTime < NOW() + OR di.LatestOrderDateTime < util.VN_NOW() OR di.ID IS NULL) AND it.isInventory AND t.id IS NULL AND po.id IS NULL; - -- select now(),'Antes de crear ITO'; + -- select util.VN_NOW(),'Antes de crear ITO'; DROP TEMPORARY TABLE IF EXISTS itemToInsert; CREATE TEMPORARY TABLE itemToInsert ENGINE = MEMORY SELECT o.*, CAST(NULL AS DECIMAL(6,0)) as itemFk @@ -11567,7 +11549,7 @@ proc: BEGIN JOIN edi.marketPlace mp ON mp.id = sr.MarketPlaceID JOIN vn.floramondoConfig fc WHERE mp.isLatestOrderDateTimeRelevant - AND di.LatestOrderDateTime > IF(fc.MaxLatestOrderHour > HOUR(NOW()), CURDATE(), TIMESTAMPADD(DAY,1,CURDATE())); + AND di.LatestOrderDateTime > IF(fc.MaxLatestOrderHour > HOUR(util.VN_NOW()), util.VN_CURDATE(), TIMESTAMPADD(DAY,1,util.VN_CURDATE())); UPDATE vn.floramondoConfig SET nextLanded = vLanded @@ -11582,7 +11564,7 @@ proc: BEGIN LEFT JOIN edi.supplyResponse sr ON i.supplyResponseFk = sr.ID LEFT JOIN edi.deliveryInformation di ON di.ID = b.deliveryFk SET b.quantity = 0 - WHERE (IFNULL(di.LatestOrderDateTime,NOW()) <= NOW() + WHERE (IFNULL(di.LatestOrderDateTime,util.VN_NOW()) <= util.VN_NOW() OR i.supplyResponseFk IS NULL OR sr.NumberOfUnits = 0) AND am.name = 'LOGIFLORA' @@ -11611,7 +11593,7 @@ proc: BEGIN JOIN edi.warehouseFloramondo wf ON wf.entryFk = b.entryFk; */ -- Se inserta el resto - SET vLastInserted := NOW(); + SET vLastInserted := util.VN_NOW(); -- Inserta la oferta INSERT INTO vn.buy( entryFk, @@ -11701,7 +11683,7 @@ proc: BEGIN AND typeFk = 17; INSERT INTO edi.log(tableName, fieldName,fieldValue) - VALUES('floramondo_offerRefresh','Tiempo de proceso',TIMEDIFF(NOW(),vStartingTime)); + VALUES('floramondo_offerRefresh','Tiempo de proceso',TIMEDIFF(util.VN_NOW(),vStartingTime)); @@ -11749,7 +11731,7 @@ proc: BEGIN RESIGNAL; END; - SET vStartingTime = NOW(); + SET vStartingTime = util.VN_NOW(); CALL util.debugAdd('edi.floramondo_offerRefresh',CONCAT('MaxItemId:' ,(SELECT MAX(id) FROM vn.item))); @@ -11785,7 +11767,7 @@ proc: BEGIN -- GROUP BY Item_ArticleCode, s1, s2, s3, s4, s5, s6, company_name, Quality, NumberOfItemsPerCask, EmbalageCode, Price, PictureReference ; - -- select now(),'Antes de crear edi.offer'; + -- select util.VN_NOW(),'Antes de crear edi.offer'; DROP TEMPORARY TABLE IF EXISTS edi.offer; CREATE TEMPORARY TABLE edi.offer (INDEX (`srID`), INDEX (`EmbalageCode`), @@ -11852,19 +11834,19 @@ proc: BEGIN AND i.quality <=> o.Quality JOIN vn.itemType it ON it.id = i.typeFk LEFT JOIN vn.sale s ON s.itemFk = i.id - LEFT JOIN vn.ticket t ON t.id = s.ticketFk AND t.shipped > TIMESTAMPADD(WEEK, -1, CURDATE()) + LEFT JOIN vn.ticket t ON t.id = s.ticketFk AND t.shipped > TIMESTAMPADD(WEEK, -1, util.VN_CURDATE()) LEFT JOIN edi.supplyResponse sr ON sr.ID = i.supplyResponseFk LEFT JOIN edi.deliveryInformation di ON di.supplyResponseID = sr.ID - LEFT JOIN edi.putOrder po ON po.supplyResponseID = i.supplyResponseFk AND po.OrderTradeLineDateTime > TIMESTAMPADD(WEEK, -1, CURDATE()) + LEFT JOIN edi.putOrder po ON po.supplyResponseID = i.supplyResponseFk AND po.OrderTradeLineDateTime > TIMESTAMPADD(WEEK, -1, util.VN_CURDATE()) SET i.supplyResponseFk = o.srID WHERE ( sr.ID IS NULL OR sr.NumberOfUnits = 0 - OR di.LatestOrderDateTime < NOW() + OR di.LatestOrderDateTime < util.VN_NOW() OR di.ID IS NULL) AND it.isInventory AND t.id IS NULL AND po.id IS NULL; - -- select now(),'Antes de crear ITO'; + -- select util.VN_NOW(),'Antes de crear ITO'; DROP TEMPORARY TABLE IF EXISTS itemToInsert; CREATE TEMPORARY TABLE itemToInsert ENGINE = MEMORY SELECT o.*, CAST(NULL AS DECIMAL(6,0)) as itemFk @@ -12044,7 +12026,7 @@ proc: BEGIN JOIN edi.marketPlace mp ON mp.id = sr.MarketPlaceID JOIN vn.floramondoConfig fc WHERE mp.isLatestOrderDateTimeRelevant - AND di.LatestOrderDateTime > IF(fc.MaxLatestOrderHour > HOUR(NOW()), CURDATE(), TIMESTAMPADD(DAY,1,CURDATE())); + AND di.LatestOrderDateTime > IF(fc.MaxLatestOrderHour > HOUR(util.VN_NOW()), util.VN_CURDATE(), TIMESTAMPADD(DAY,1,util.VN_CURDATE())); UPDATE vn.floramondoConfig SET nextLanded = vLanded @@ -12059,7 +12041,7 @@ proc: BEGIN LEFT JOIN edi.supplyResponse sr ON i.supplyResponseFk = sr.ID LEFT JOIN edi.deliveryInformation di ON di.ID = b.deliveryFk SET b.quantity = 0 - WHERE (IFNULL(di.LatestOrderDateTime,NOW()) <= NOW() + WHERE (IFNULL(di.LatestOrderDateTime,util.VN_NOW()) <= util.VN_NOW() OR i.supplyResponseFk IS NULL OR sr.NumberOfUnits = 0) AND am.name = 'LOGIFLORA' @@ -12087,7 +12069,7 @@ proc: BEGIN JOIN edi.warehouseFloramondo wf ON wf.entryFk = b.entryFk; -- Se inserta el resto - SET vLastInserted := NOW(); + SET vLastInserted := util.VN_NOW(); -- Inserta la oferta INSERT INTO vn.buy(entryFk, @@ -12149,7 +12131,7 @@ proc: BEGIN AND typeFk = 17; INSERT INTO edi.log(tableName, fieldName,fieldValue) - VALUES('floramondo_offerRefresh','Tiempo de proceso',TIMEDIFF(NOW(),vStartingTime)); + VALUES('floramondo_offerRefresh','Tiempo de proceso',TIMEDIFF(util.VN_NOW(),vStartingTime)); END ;; DELIMITER ; @@ -12674,7 +12656,7 @@ CREATE TABLE `config` ( `dmsDir` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'Directory where documents are allocated', PRIMARY KEY (`id`), KEY `jwtkey_IX` (`jwtKey`) COMMENT 'Prueba de Ernesto 3.8.2020. MySQL se queja de no tener indices. Si, se que solo tiene un registro pero molesta para depurar otros.' -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Global configuration parameters'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Global configuration parameters'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -12688,7 +12670,7 @@ CREATE TABLE `contact` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `recipient` varchar(255) COLLATE utf8_unicode_ci NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -12703,7 +12685,7 @@ CREATE TABLE `image` ( `collectionFk` varchar(50) COLLATE utf8_unicode_ci NOT NULL, `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `updated` int(11) DEFAULT NULL, - `nRefs` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Number of references, don''t modify this column manually', + `nRefs` int(10) unsigned NOT NULL DEFAULT 0 COMMENT 'Number of references, don''t modify this column manually', PRIMARY KEY (`id`), UNIQUE KEY `collection` (`collectionFk`,`name`), CONSTRAINT `image_ibfk_1` FOREIGN KEY (`collectionFk`) REFERENCES `imageCollection` (`name`) ON UPDATE CASCADE @@ -12728,8 +12710,8 @@ CREATE TABLE `imageCollection` ( `schema` varchar(50) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Deprecated', `table` varchar(50) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Deprecated', `column` varchar(50) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Deprecated', - `readRoleFk` int(10) unsigned DEFAULT '1', - `writeRoleFk` int(10) unsigned DEFAULT '1', + `readRoleFk` int(10) unsigned DEFAULT 1, + `writeRoleFk` int(10) unsigned DEFAULT 1, PRIMARY KEY (`id`), UNIQUE KEY `name` (`name`), KEY `role_id_writeRoleFk` (`writeRoleFk`), @@ -12751,7 +12733,7 @@ CREATE TABLE `imageCollectionSize` ( `collectionFk` int(10) unsigned NOT NULL, `width` int(10) unsigned NOT NULL, `height` int(10) unsigned NOT NULL, - `crop` tinyint(3) unsigned NOT NULL DEFAULT '0', + `crop` tinyint(3) unsigned NOT NULL DEFAULT 0, PRIMARY KEY (`id`), KEY `image_schema_id` (`collectionFk`), CONSTRAINT `imageCollectionSize_ibfk_1` FOREIGN KEY (`collectionFk`) REFERENCES `imageCollection` (`id`) ON UPDATE CASCADE @@ -12771,7 +12753,7 @@ CREATE TABLE `imageConfig` ( `useXsendfile` tinyint(4) NOT NULL COMMENT 'Whether to use the apache module XSendfile', `url` varchar(255) NOT NULL COMMENT 'Public URL where image are hosted', PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COMMENT='Global image parameters'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Global image parameters'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -12785,7 +12767,7 @@ CREATE TABLE `language` ( `code` varchar(10) CHARACTER SET utf8 NOT NULL, `name` varchar(20) COLLATE utf8_unicode_ci NOT NULL, `orgName` varchar(255) COLLATE utf8_unicode_ci NOT NULL, - `isActive` tinyint(1) NOT NULL DEFAULT '0', + `isActive` tinyint(1) NOT NULL DEFAULT 0, PRIMARY KEY (`code`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -12804,7 +12786,7 @@ CREATE TABLE `link` ( `link` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `image` varchar(30) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -12889,7 +12871,7 @@ CREATE TABLE `location` ( `phone` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `language` char(2) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -12902,14 +12884,14 @@ DROP TABLE IF EXISTS `mailConfig`; CREATE TABLE `mailConfig` ( `id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Identifier', `host` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'localhost' COMMENT 'SMTP host', - `port` smallint(6) NOT NULL DEFAULT '465' COMMENT 'SMTP port', - `secure` tinyint(1) NOT NULL DEFAULT '1' COMMENT 'Wether to use a secure connection', + `port` smallint(6) NOT NULL DEFAULT 465 COMMENT 'SMTP port', + `secure` tinyint(1) NOT NULL DEFAULT 1 COMMENT 'Wether to use a secure connection', `sender` varchar(255) COLLATE utf8_unicode_ci NOT NULL COMMENT 'The sender mail address', `senderName` varchar(75) CHARACTER SET utf8 NOT NULL COMMENT 'The sender name', `user` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'SMTP user', `password` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'SMTP password, base64 encoded', PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -12952,12 +12934,12 @@ CREATE TABLE `menu` ( `path` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, `roleFk` int(10) unsigned NOT NULL, `parentFk` int(10) unsigned DEFAULT NULL, - `displayOrder` tinyint(4) unsigned NOT NULL DEFAULT '1', + `displayOrder` tinyint(4) unsigned NOT NULL DEFAULT 1, PRIMARY KEY (`id`), KEY `group_id` (`roleFk`), KEY `parent` (`parentFk`), CONSTRAINT `menu_ibfk_1` FOREIGN KEY (`roleFk`) REFERENCES `account`.`role` (`id`) ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -12973,7 +12955,7 @@ CREATE TABLE `message` ( `description` varchar(255) COLLATE utf8_unicode_ci NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `code` (`code`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -13302,15 +13284,15 @@ CREATE TABLE `news` ( `text` text COLLATE utf8_unicode_ci NOT NULL, `image` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `userFk` int(10) unsigned NOT NULL, - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - `priority` tinyint(3) unsigned NOT NULL DEFAULT '3', + `created` timestamp NOT NULL DEFAULT current_timestamp(), + `priority` tinyint(3) unsigned NOT NULL DEFAULT 3, `tag` varchar(15) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'new', PRIMARY KEY (`id`), KEY `user` (`userFk`), KEY `tag` (`tag`), CONSTRAINT `news_ibfk_1` FOREIGN KEY (`userFk`) REFERENCES `account`.`account` (`id`) ON UPDATE CASCADE, CONSTRAINT `news_ibfk_2` FOREIGN KEY (`tag`) REFERENCES `newsTag` (`name`) ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -13401,15 +13383,15 @@ CREATE TABLE `order` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `date_send` date NOT NULL DEFAULT '0000-00-00', `customer_id` int(11) NOT NULL, - `delivery_method_id` int(11) DEFAULT '3', - `agency_id` int(11) DEFAULT '2', + `delivery_method_id` int(11) DEFAULT 3, + `agency_id` int(11) DEFAULT 2, `address_id` int(11) DEFAULT NULL, - `company_id` smallint(5) unsigned NOT NULL DEFAULT '442', + `company_id` smallint(5) unsigned NOT NULL DEFAULT 442, `note` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `source_app` set('WEB','ANDROID','IOS','SALIX','TPV','TABLET_VN','') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'TPV', - `is_bionic` tinyint(1) NOT NULL DEFAULT '1', - `confirmed` tinyint(1) NOT NULL DEFAULT '0', - `date_make` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `is_bionic` tinyint(1) NOT NULL DEFAULT 1, + `confirmed` tinyint(1) NOT NULL DEFAULT 0, + `date_make` timestamp NOT NULL DEFAULT current_timestamp(), `first_row_stamp` datetime DEFAULT NULL, `confirm_date` datetime DEFAULT NULL, `taxableBase` decimal(10,2) NOT NULL, @@ -13543,7 +13525,7 @@ CREATE TABLE `orderConfig` ( CONSTRAINT `orderConfig_ibfk_3` FOREIGN KEY (`guestAgencyFk`) REFERENCES `vn`.`agencyMode` (`id`) ON UPDATE CASCADE, CONSTRAINT `orderConfig_ibfk_4` FOREIGN KEY (`defaultAgencyFk`) REFERENCES `vn`.`agencyMode` (`id`), CONSTRAINT `orderConfig_ibfk_5` FOREIGN KEY (`guestAddressFk`) REFERENCES `vn`.`address` (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -13569,14 +13551,14 @@ DROP TABLE IF EXISTS `orderRow`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `orderRow` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `orderFk` int(10) unsigned NOT NULL DEFAULT '0', - `itemFk` int(11) NOT NULL DEFAULT '0', + `orderFk` int(10) unsigned NOT NULL DEFAULT 0, + `itemFk` int(11) NOT NULL DEFAULT 0, `warehouseFk` int(11) DEFAULT NULL, `shipment` date DEFAULT NULL, - `amount` smallint(6) unsigned NOT NULL DEFAULT '0', + `amount` smallint(6) unsigned NOT NULL DEFAULT 0, `price` decimal(10,2) DEFAULT NULL, `rate` smallint(5) unsigned DEFAULT NULL, - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created` timestamp NOT NULL DEFAULT current_timestamp(), `saleFk` int(11) DEFAULT NULL, PRIMARY KEY (`id`), KEY `item` (`itemFk`), @@ -13607,7 +13589,7 @@ BEGIN WHERE id = NEW.orderFk; IF vIsFirst THEN - UPDATE `order` SET first_row_stamp = NOW() + UPDATE `order` SET first_row_stamp = util.VN_NOW() WHERE id = NEW.orderFk; END IF; END */;; @@ -13763,7 +13745,7 @@ CREATE TABLE `restPriv` ( PRIMARY KEY (`id`), KEY `role` (`role`), CONSTRAINT `restPriv_ibfk_1` FOREIGN KEY (`role`) REFERENCES `account`.`role` (`id`) ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -13801,7 +13783,7 @@ CREATE TABLE `shelfConfig` ( `shelf` int(10) unsigned NOT NULL, `maxAmount` smallint(5) unsigned DEFAULT NULL, `showPacking` tinyint(4) NOT NULL, - `stack` tinyint(4) NOT NULL DEFAULT '0', + `stack` tinyint(4) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), KEY `shelf_id` (`shelf`), KEY `family_id` (`family`), @@ -13809,7 +13791,7 @@ CREATE TABLE `shelfConfig` ( CONSTRAINT `shelfConfig_ibfk_1` FOREIGN KEY (`family`) REFERENCES `vn`.`itemType` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `shelfConfig_ibfk_2` FOREIGN KEY (`shelf`) REFERENCES `shelf` (`id`) ON UPDATE CASCADE, CONSTRAINT `shelfConfig_ibfk_3` FOREIGN KEY (`warehouse`) REFERENCES `vn`.`warehouse` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -13827,7 +13809,7 @@ CREATE TABLE `social` ( `priority` tinyint(3) unsigned NOT NULL, PRIMARY KEY (`id`), KEY `priority` (`priority`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -13841,7 +13823,7 @@ CREATE TABLE `survey` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `question` varchar(255) COLLATE utf8_unicode_ci NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -13855,7 +13837,7 @@ CREATE TABLE `surveyAnswer` ( `id` int(10) unsigned NOT NULL, `surveyFk` int(10) unsigned NOT NULL, `answer` varchar(30) COLLATE utf8_unicode_ci NOT NULL, - `votes` int(10) unsigned NOT NULL DEFAULT '0', + `votes` int(10) unsigned NOT NULL DEFAULT 0, PRIMARY KEY (`id`), KEY `survey` (`surveyFk`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; @@ -13893,7 +13875,7 @@ CREATE TABLE `tpvConfig` ( `maxAmount` int(10) unsigned DEFAULT NULL, `employeeFk` int(10) unsigned NOT NULL, `url` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'The bank web service URL for production environment', - `testMode` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT 'Whether test mode is enabled', + `testMode` tinyint(3) unsigned NOT NULL DEFAULT 0 COMMENT 'Whether test mode is enabled', `testUrl` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT 'The bank web service URL for test environment', `testKey` varchar(50) CHARACTER SET utf8 DEFAULT NULL COMMENT 'The bank secret key for test environment', `merchantUrl` varchar(255) CHARACTER SET utf8 DEFAULT NULL, @@ -13933,7 +13915,7 @@ CREATE TABLE `tpvImapConfig` ( `successFolder` varchar(150) CHARACTER SET utf8 DEFAULT NULL, `errorFolder` varchar(150) CHARACTER SET utf8 DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='IMAP configuration parameters for virtual TPV'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='IMAP configuration parameters for virtual TPV'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -13964,7 +13946,7 @@ DROP TABLE IF EXISTS `tpvMerchantEnable`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `tpvMerchantEnable` ( - `merchantFk` int(10) unsigned NOT NULL DEFAULT '0', + `merchantFk` int(10) unsigned NOT NULL DEFAULT 0, `companyFk` smallint(6) unsigned NOT NULL, PRIMARY KEY (`merchantFk`,`companyFk`), UNIQUE KEY `company_id` (`companyFk`), @@ -14002,7 +13984,7 @@ CREATE TABLE `tpvTransaction` ( `response` smallint(5) unsigned DEFAULT NULL COMMENT 'Status notified by bank: NULL if no notification, 0 if success, error otherwise', `errorCode` char(7) COLLATE utf8_unicode_ci DEFAULT NULL, `status` enum('started','ok','ko') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'started', - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created` timestamp NOT NULL DEFAULT current_timestamp(), PRIMARY KEY (`id`), KEY `merchant_id` (`merchantFk`), KEY `receipt_id` (`receiptFk`), @@ -14023,10 +14005,10 @@ DROP TABLE IF EXISTS `userSession`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `userSession` ( - `created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, - `lastUpdate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `created` datetime NOT NULL DEFAULT current_timestamp(), + `lastUpdate` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `ssid` char(64) COLLATE utf8_unicode_ci NOT NULL, - `data` text COLLATE utf8_unicode_ci, + `data` text COLLATE utf8_unicode_ci DEFAULT NULL, `userVisitFk` int(10) unsigned DEFAULT NULL, UNIQUE KEY `ssid` (`ssid`), KEY `userVisit` (`userVisitFk`), @@ -14060,7 +14042,7 @@ DROP TABLE IF EXISTS `visitAccess`; CREATE TABLE `visitAccess` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `agentFk` int(10) unsigned NOT NULL, - `stamp` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, + `stamp` datetime NOT NULL DEFAULT current_timestamp(), `ip` int(10) unsigned DEFAULT NULL, `referer` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), @@ -14106,7 +14088,7 @@ CREATE TABLE `visitUser` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `accessFk` int(10) unsigned NOT NULL, `userFk` int(10) unsigned DEFAULT NULL, - `stamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `stamp` timestamp NOT NULL DEFAULT current_timestamp(), PRIMARY KEY (`id`), KEY `access_id` (`accessFk`), KEY `date_time` (`stamp`), @@ -14143,7 +14125,7 @@ DELIMITER ; -- -- Dumping routines for database 'hedera' -- -/*!50003 DROP FUNCTION IF EXISTS `myBasket_getId` */; +/*!50003 DROP FUNCTION IF EXISTS `MYBASKET_GETID` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; /*!50003 SET @saved_col_connection = @@collation_connection */ ; @@ -14689,7 +14671,7 @@ BEGIN FROM vn.buy b JOIN vn.entry e ON e.id = b.entryFk JOIN vn.travel t ON t.id = e.travelFk - WHERE t.shipped BETWEEN vDateInv AND CURDATE() + WHERE t.shipped BETWEEN vDateInv AND util.VN_CURDATE() AND t.warehouseOutFk = vWarehouse AND NOT e.isRaid AND t.isDelivered @@ -14698,7 +14680,7 @@ BEGIN FROM vn.sale m JOIN vn.ticket t ON t.id = m.ticketFk JOIN vn.ticketState s ON s.ticket = t.id - WHERE t.shipped BETWEEN vDateInv AND CURDATE() + WHERE t.shipped BETWEEN vDateInv AND util.VN_CURDATE() AND t.warehouseFk = vWarehouse AND s.alertLevel = 3 ) t @@ -14737,7 +14719,7 @@ BEGIN LEFT JOIN vn.packaging p ON p.id = t.packageFk WHERE CEIL(s.quantity / t.packing) > 0 -- FIXME: Column Cubos.box not included in view vn.packaging - /* AND p.box */; + /* AND p.box */ ; DROP TEMPORARY TABLE `filter`, @@ -14810,7 +14792,7 @@ BEGIN FROM vn.buy b JOIN vn.entry e ON e.id = b.entryFk JOIN vn.travel t ON t.id = e.travelFk - WHERE t.shipped BETWEEN vDateInv AND CURDATE() + WHERE t.shipped BETWEEN vDateInv AND util.VN_CURDATE() AND t.warehouseOutFk = vWarehouse AND NOT e.isRaid AND t.isDelivered @@ -14819,7 +14801,7 @@ BEGIN FROM vn.sale m JOIN vn.ticket t ON t.id = m.ticketFk JOIN vn.ticketState s ON s.ticket = t.id - WHERE t.shipped BETWEEN vDateInv AND CURDATE() + WHERE t.shipped BETWEEN vDateInv AND util.VN_CURDATE() AND t.warehouseFk = vWarehouse AND s.alertLevel = 3 ) t @@ -14858,7 +14840,7 @@ BEGIN LEFT JOIN vn.packaging p ON p.id = t.packageFk WHERE CEIL(s.quantity / t.packing) > 0 -- FIXME: Column Cubos.box not included in view vn.packaging - /* AND p.box */; + /* AND p.box */ ; DROP TEMPORARY TABLE filter, @@ -15027,7 +15009,7 @@ BEGIN THEN CALL order_checkConfig(vSelf); - IF vStatus = 'OK' AND vCreated < TIMESTAMPADD(DAY, -1, NOW()) + IF vStatus = 'OK' AND vCreated < TIMESTAMPADD(DAY, -1, util.VN_NOW()) THEN CALL order_update(vSelf); SET vStatus = 'UPDATED'; @@ -15155,7 +15137,7 @@ BEGIN FROM orderConfig LIMIT 1; - SET vDate = TIMESTAMPADD(DAY, 1, CURDATE()); + SET vDate = TIMESTAMPADD(DAY, 1, util.VN_CURDATE()); IF WEEKDAY(vDate) BETWEEN 5 AND 6 THEN SET vDate = TIMESTAMPADD(DAY, 7 - WEEKDAY(vDate), vDate); @@ -15648,8 +15630,8 @@ BEGIN * @param vTo To date, if %NULL current date * @select The tickets list */ - SET vFrom = IFNULL(vFrom, DATE_FORMAT(TIMESTAMPADD(MONTH, -3, CURDATE()), '%Y-%m-01')); - SET vTo = IFNULL(vTo, TIMESTAMPADD(YEAR, 1, CURDATE())); + SET vFrom = IFNULL(vFrom, DATE_FORMAT(TIMESTAMPADD(MONTH, -3, util.VN_CURDATE()), '%Y-%m-01')); + SET vTo = IFNULL(vTo, TIMESTAMPADD(YEAR, 1, util.VN_CURDATE())); DROP TEMPORARY TABLE IF EXISTS tmp.ticket; CREATE TEMPORARY TABLE tmp.ticket @@ -16292,7 +16274,7 @@ BEGIN IF vTicket IS NULL THEN - SET vShipment = IFNULL(vShipment, CURDATE()); + SET vShipment = IFNULL(vShipment, util.VN_CURDATE()); CALL vn.ticket_add( vClientId, @@ -16324,7 +16306,7 @@ BEGIN THEN INSERT INTO vn.ticketObservation SET ticketFk = vTicket, - observationTypeFk = 4 /* salesperson */, + observationTypeFk = 4 /* salesperson */ , `description` = vNotes ON DUPLICATE KEY UPDATE `description` = CONCAT(VALUES(`description`),'. ', `description`); @@ -16416,7 +16398,7 @@ BEGIN JOIN edi.floraHollandConfig fhc JOIN hedera.`order` o ON o.id = vOrder WHERE i.id = vItem - AND di.LatestOrderDateTime > NOW() + AND di.LatestOrderDateTime > util.VN_NOW() AND vAmount > @available LIMIT 1; @@ -16461,7 +16443,7 @@ BEGIN CALL util.throw ('ORDER_ALREADY_CONFIRMED'); END IF; - UPDATE `order` SET confirmed = TRUE, confirm_date = NOW() + UPDATE `order` SET confirmed = TRUE, confirm_date = util.VN_NOW() WHERE id = vOrder; COMMIT; @@ -16835,7 +16817,7 @@ proc: BEGIN CALL vn.ticketCalculatePurge; END IF; - UPDATE `order` SET date_make = NOW() + UPDATE `order` SET date_make = util.VN_NOW() WHERE id = vSelf; COMMIT; @@ -17216,7 +17198,7 @@ BEGIN WHERE ssid = vSsid; DELETE FROM userSession - WHERE lastUpdate < TIMESTAMPADD(HOUR, -1, NOW()); + WHERE lastUpdate < TIMESTAMPADD(HOUR, -1, util.VN_NOW()); END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -17407,11 +17389,11 @@ CREATE TABLE `labourTree` ( `id` int(11) NOT NULL AUTO_INCREMENT, `lft` int(11) NOT NULL, `rgt` int(11) NOT NULL, - `depth` int(11) NOT NULL DEFAULT '0', - `sons` int(11) NOT NULL DEFAULT '0', + `depth` int(11) NOT NULL DEFAULT 0, + `sons` int(11) NOT NULL DEFAULT 0, `name` varchar(45) COLLATE utf8_unicode_ci NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -17428,7 +17410,7 @@ CREATE TABLE `nst` ( PRIMARY KEY (`id`), UNIQUE KEY `lft_UNIQUE` (`lft`), UNIQUE KEY `rgt_UNIQUE` (`rgt`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -17829,7 +17811,7 @@ DROP TABLE IF EXISTS `cdr`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `cdr` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `call_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, + `call_date` datetime NOT NULL DEFAULT current_timestamp(), `clid` varchar(80) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `src` varchar(80) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `dst` varchar(80) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', @@ -17838,10 +17820,10 @@ CREATE TABLE `cdr` ( `dst_channel` varchar(80) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `last_app` varchar(80) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `last_data` varchar(80) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', - `duration` int(11) NOT NULL DEFAULT '0', - `billsec` int(11) NOT NULL DEFAULT '0', + `duration` int(11) NOT NULL DEFAULT 0, + `billsec` int(11) NOT NULL DEFAULT 0, `disposition` varchar(45) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', - `ama_flags` int(11) NOT NULL DEFAULT '0', + `ama_flags` int(11) NOT NULL DEFAULT 0, `account_code` varchar(20) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `unique_id` varchar(32) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `user_field` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', @@ -17852,7 +17834,7 @@ CREATE TABLE `cdr` ( KEY `dstchannel` (`dst_channel`), KEY `disposition` (`disposition`), KEY `src` (`src`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -17895,7 +17877,7 @@ CREATE TABLE `config` ( `sundayFestive` tinyint(4) NOT NULL, `countryPrefix` varchar(20) CHARACTER SET utf8 DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Global configuration'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Global configuration'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -17985,7 +17967,7 @@ CREATE TABLE `followmeConfig` ( `declineCall` char(1) CHARACTER SET utf8 NOT NULL, `timeout` int(11) NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -18021,7 +18003,7 @@ CREATE TABLE `queue` ( UNIQUE KEY `description` (`description`), KEY `config` (`config`), CONSTRAINT `queue_ibfk_1` FOREIGN KEY (`config`) REFERENCES `queueConfig` (`id`) ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Queues'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Queues'; /*!40101 SET character_set_client = @saved_cs_client */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -18099,7 +18081,7 @@ CREATE TABLE `queueConfig` ( `maxLen` int(10) unsigned NOT NULL, `ringInUse` tinyint(4) NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Default values for queues configuration'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Default values for queues configuration'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -18118,7 +18100,7 @@ CREATE TABLE `queueMember` ( KEY `extension` (`extension`), CONSTRAINT `queueMember_ibfk_1` FOREIGN KEY (`queue`) REFERENCES `queue` (`name`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `queueMember_ibfk_2` FOREIGN KEY (`extension`) REFERENCES `sip` (`extension`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Queue members'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Queue members'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -18151,7 +18133,7 @@ CREATE TABLE `queuePhone` ( PRIMARY KEY (`id`), UNIQUE KEY `queue` (`queue`,`phone`), CONSTRAINT `queuePhone_ibfk_1` FOREIGN KEY (`queue`) REFERENCES `queue` (`name`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -18210,7 +18192,7 @@ CREATE TABLE `schedule` ( PRIMARY KEY (`id`), KEY `queue` (`queue`), CONSTRAINT `schedule_ibfk_1` FOREIGN KEY (`queue`) REFERENCES `queue` (`name`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -18221,7 +18203,7 @@ DROP TABLE IF EXISTS `sip`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `sip` ( - `user_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'The user id', + `user_id` int(10) unsigned NOT NULL DEFAULT 0 COMMENT 'The user id', `extension` varchar(128) CHARACTER SET utf8 NOT NULL COMMENT 'The softphone extension', `md5Secret` varchar(80) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'MD5 hash of extension and password', `secret` varchar(80) CHARACTER SET utf8 DEFAULT NULL COMMENT 'Deprecated', @@ -18387,7 +18369,7 @@ CREATE TABLE `sipConfig` ( `dtlssetup` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `nat` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Default values for SIP accounts'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Default values for SIP accounts'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -18675,7 +18657,7 @@ CREATE TABLE `address` ( KEY `address_town_id_idx` (`town_id`), CONSTRAINT `address_ibfk_1` FOREIGN KEY (`address_type_id`) REFERENCES `address_type` (`address_type_id`) ON DELETE NO ACTION ON UPDATE CASCADE, CONSTRAINT `address_ibfk_2` FOREIGN KEY (`town_id`) REFERENCES `townKk` (`town_id`) ON DELETE NO ACTION ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -18689,7 +18671,7 @@ CREATE TABLE `address_type` ( `address_type_id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(20) NOT NULL, PRIMARY KEY (`address_type_id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -18723,7 +18705,7 @@ CREATE TABLE `bank_account` ( CONSTRAINT `bank_account_client_id` FOREIGN KEY (`client_id`) REFERENCES `profile` (`profile_id`) ON UPDATE CASCADE, CONSTRAINT `bank_account_nation_id` FOREIGN KEY (`nation_id`) REFERENCES `vn`.`country` (`id`) ON UPDATE CASCADE, CONSTRAINT `bank_account_workerFk` FOREIGN KEY (`workerFk`) REFERENCES `vn`.`worker` (`id`) ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -18737,7 +18719,7 @@ CREATE TABLE `bank_account_type` ( `bank_account_type_id` int(11) NOT NULL AUTO_INCREMENT, `name` char(15) DEFAULT NULL, PRIMARY KEY (`bank_account_type_id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -18771,7 +18753,7 @@ CREATE TABLE `business` ( `provider_id` int(11) DEFAULT NULL, `date_start` date DEFAULT NULL, `date_end` date DEFAULT NULL, - `workerBusiness` longtext, + `workerBusiness` longtext DEFAULT NULL, `reasonEndFk` int(11) DEFAULT NULL, `payedHolidays` int(11) DEFAULT NULL, `occupationCodeFk` varchar(1) DEFAULT NULL, @@ -18835,12 +18817,12 @@ DROP TABLE IF EXISTS `business_labour`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `business_labour` ( `business_id` int(11) NOT NULL, - `notes` longtext, + `notes` longtext DEFAULT NULL, `department_id` int(11) NOT NULL, - `professional_category_id` int(11) DEFAULT '0', - `incentivo` double DEFAULT '0', - `calendar_labour_type_id` int(11) DEFAULT '1', - `porhoras` smallint(6) NOT NULL DEFAULT '0', + `professional_category_id` int(11) DEFAULT 0, + `incentivo` double DEFAULT 0, + `calendar_labour_type_id` int(11) DEFAULT 1, + `porhoras` smallint(6) NOT NULL DEFAULT 0, `labour_agreement_id` int(11) DEFAULT NULL, `workcenter_id` int(11) NOT NULL, PRIMARY KEY (`business_id`), @@ -18868,7 +18850,7 @@ CREATE TABLE `business_labour_payroll` ( `cod_tarifa` int(11) DEFAULT NULL, `cod_categoria` int(11) DEFAULT NULL, `cod_contrato` int(11) DEFAULT NULL, - `importepactado` decimal(10,2) NOT NULL DEFAULT '0.00', + `importepactado` decimal(10,2) NOT NULL DEFAULT 0.00, PRIMARY KEY (`business_id`), KEY `business_labour_payroll_cod_categoria_idx` (`cod_categoria`), KEY `business_labour_payroll_FK` (`cod_contrato`), @@ -18906,7 +18888,7 @@ CREATE TABLE `calendar_free__` ( `type` varchar(20) NOT NULL, `rgb` varchar(7) DEFAULT NULL, PRIMARY KEY (`calendar_free_id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -18932,7 +18914,7 @@ CREATE TABLE `calendar_labour__` ( CONSTRAINT `fk_calendar_labour_calendar_free1` FOREIGN KEY (`calendar_free_id`) REFERENCES `calendar_free__` (`calendar_free_id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_calendar_labour_legend_id` FOREIGN KEY (`calendar_labour_legend_id`) REFERENCES `calendar_labour_legend__` (`calendar_labour_legend_id`) ON DELETE NO ACTION ON UPDATE CASCADE, CONSTRAINT `workcenter_calendar` FOREIGN KEY (`workcenter_id`) REFERENCES `workcenter` (`workcenter_id`) ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -18944,10 +18926,10 @@ DROP TABLE IF EXISTS `calendar_labour_legend__`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `calendar_labour_legend__` ( `calendar_labour_legend_id` int(11) NOT NULL AUTO_INCREMENT, - `descripcion` longtext, + `descripcion` longtext DEFAULT NULL, PRIMARY KEY (`calendar_labour_legend_id`), UNIQUE KEY `calendar_labour_legend_calendar_labour_legend_id_key` (`calendar_labour_legend_id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -18962,7 +18944,7 @@ CREATE TABLE `calendar_labour_type` ( `descripcion` varchar(50) DEFAULT NULL, `pausa_remunerada` time DEFAULT NULL, `hours_week` smallint(6) DEFAULT NULL, - `isPartial` tinyint(1) NOT NULL DEFAULT '0', + `isPartial` tinyint(1) NOT NULL DEFAULT 0, PRIMARY KEY (`calendar_labour_type_id`), UNIQUE KEY `hours_labour_hours_labour_id_key` (`calendar_labour_type_id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8; @@ -18979,13 +18961,13 @@ CREATE TABLE `calendar_state` ( `calendar_state_id` int(11) NOT NULL AUTO_INCREMENT, `type` varchar(30) NOT NULL, `rgb` varchar(7) NOT NULL, - `color` bigint(20) DEFAULT '0', + `color` bigint(20) DEFAULT 0, `permissionRate` decimal(3,2) DEFAULT NULL, `code` varchar(45) DEFAULT NULL, - `isAllowedToWork` tinyint(4) NOT NULL DEFAULT '0', - `isPrintable` tinyint(1) NOT NULL DEFAULT '0', + `isAllowedToWork` tinyint(4) NOT NULL DEFAULT 0, + `isPrintable` tinyint(1) NOT NULL DEFAULT 0, `discountRate` decimal(3,2) DEFAULT NULL, - `holidayEntitlementRate` decimal(3,2) DEFAULT '1.00', + `holidayEntitlementRate` decimal(3,2) DEFAULT 1.00, PRIMARY KEY (`calendar_state_id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; @@ -19001,7 +18983,7 @@ CREATE TABLE `currency__` ( `currency_id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(15) NOT NULL, PRIMARY KEY (`currency_id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -19028,18 +19010,18 @@ DROP TABLE IF EXISTS `income_employee`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `income_employee` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `debe` decimal(10,2) NOT NULL DEFAULT '0.00', - `haber` decimal(10,2) NOT NULL DEFAULT '0.00', + `debe` decimal(10,2) NOT NULL DEFAULT 0.00, + `haber` decimal(10,2) NOT NULL DEFAULT 0.00, `id_incomeType` int(11) DEFAULT NULL, `odbc_date` date DEFAULT NULL, `person_id` int(11) DEFAULT NULL, - `concepto` longtext, + `concepto` longtext DEFAULT NULL, PRIMARY KEY (`id`), KEY `fperson_id` (`person_id`), KEY `income_employeeId_incomeType_idx` (`id_incomeType`), CONSTRAINT `income_employeeId_incomeType` FOREIGN KEY (`id_incomeType`) REFERENCES `vn2008`.`payroll_conceptos` (`conceptoid`) ON UPDATE CASCADE, CONSTRAINT `income_employee_FK` FOREIGN KEY (`person_id`) REFERENCES `vn`.`person` (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -19052,8 +19034,8 @@ DROP TABLE IF EXISTS `incometype_employee`; CREATE TABLE `incometype_employee` ( `id_incometype` int(11) NOT NULL, `descripcion` varchar(255) DEFAULT NULL, - `nomina` smallint(6) DEFAULT '0', - `isExtraSalarial` tinyint(4) NOT NULL DEFAULT '0', + `nomina` smallint(6) DEFAULT 0, + `isExtraSalarial` tinyint(4) NOT NULL DEFAULT 0, PRIMARY KEY (`id_incometype`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; @@ -19067,7 +19049,7 @@ DROP TABLE IF EXISTS `journey`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `journey` ( `journey_id` int(11) NOT NULL AUTO_INCREMENT, - `day_id` smallint(6) NOT NULL DEFAULT '1' COMMENT 'Lunes = 1 \nDomingo = 7', + `day_id` smallint(6) NOT NULL DEFAULT 1 COMMENT 'Lunes = 1 \nDomingo = 7', `start` time DEFAULT NULL, `end` time DEFAULT NULL, `business_id` int(11) NOT NULL, @@ -19075,7 +19057,7 @@ CREATE TABLE `journey` ( UNIQUE KEY `day_id` (`day_id`,`start`,`end`,`business_id`), KEY `fki_business_journey` (`business_id`), CONSTRAINT `business_journey` FOREIGN KEY (`business_id`) REFERENCES `business` (`business_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -19138,15 +19120,15 @@ DROP TABLE IF EXISTS `nation__`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `nation__` ( `nation_id` int(11) NOT NULL AUTO_INCREMENT, - `currency_id` int(11) NOT NULL DEFAULT '1', + `currency_id` int(11) NOT NULL DEFAULT 1, `name` varchar(20) NOT NULL, `brief` char(3) NOT NULL, - `flag` longblob, + `flag` longblob DEFAULT NULL, PRIMARY KEY (`nation_id`), UNIQUE KEY `nation_name_key` (`name`), KEY `nation_currency_id_idx` (`currency_id`), CONSTRAINT `nation___ibfk_1` FOREIGN KEY (`currency_id`) REFERENCES `currency__` (`currency_id`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDBDEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -19202,12 +19184,12 @@ CREATE TABLE `person__` ( `nif` varchar(15) DEFAULT NULL, `birth` date DEFAULT NULL, `firstname` varchar(20) DEFAULT NULL, - `p2` longtext, + `p2` longtext DEFAULT NULL, `nis` int(11) DEFAULT NULL, `id_trabajador` int(10) unsigned DEFAULT NULL, - `isDisable` smallint(6) NOT NULL DEFAULT '0', - `isFreelance` smallint(6) NOT NULL DEFAULT '0' COMMENT 'M Male\nF Female', - `isSsDiscounted` smallint(6) NOT NULL DEFAULT '0', + `isDisable` smallint(6) NOT NULL DEFAULT 0, + `isFreelance` smallint(6) NOT NULL DEFAULT 0 COMMENT 'M Male\nF Female', + `isSsDiscounted` smallint(6) NOT NULL DEFAULT 0, `sex` enum('M','F') NOT NULL DEFAULT 'F' COMMENT 'M Masculino F Femenino', PRIMARY KEY (`person_id`), UNIQUE KEY `person_nis` (`person_id`), @@ -19217,7 +19199,7 @@ CREATE TABLE `person__` ( KEY `index1` (`person_id`,`name`,`nickname`,`firstname`), KEY `person_worker` (`id_trabajador`), CONSTRAINT `Person_ibfk_1` FOREIGN KEY (`id_trabajador`) REFERENCES `vn`.`worker` (`id`) ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -19231,7 +19213,7 @@ CREATE TABLE `professional_category` ( `professional_category_id` int(11) NOT NULL AUTO_INCREMENT, `category_name` varchar(50) NOT NULL, `professional_levels_id` int(11) DEFAULT NULL, - `fichajes` tinyint(4) NOT NULL DEFAULT '1', + `fichajes` tinyint(4) NOT NULL DEFAULT 1, `holiday_days` decimal(3,1) DEFAULT NULL, `dayBreak` int(11) DEFAULT NULL, PRIMARY KEY (`professional_category_id`), @@ -19251,7 +19233,7 @@ CREATE TABLE `professional_levels` ( `level_name` varchar(5) DEFAULT NULL, `price_overtime` double DEFAULT NULL, PRIMARY KEY (`professional_levels_id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -19264,7 +19246,7 @@ DROP TABLE IF EXISTS `profile`; CREATE TABLE `profile` ( `profile_id` int(11) NOT NULL AUTO_INCREMENT, `person_id` int(11) NOT NULL, - `profile_type_id` int(11) NOT NULL DEFAULT '1', + `profile_type_id` int(11) NOT NULL DEFAULT 1, PRIMARY KEY (`profile_id`), KEY `profile_person_id_idx` (`person_id`), KEY `profile_profile_type_id_idx` (`profile_type_id`), @@ -19286,7 +19268,7 @@ CREATE TABLE `profile_address` ( PRIMARY KEY (`profile_address_id`), KEY `profile_address_address_id_idx` (`address_id`), KEY `profile_address_profile_id_idx` (`profile_id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -19337,7 +19319,7 @@ CREATE TABLE `province` ( UNIQUE KEY `province_name_key` (`name`), KEY `province_nation_id_idx` (`nation_id`), CONSTRAINT `fk_province_nation1` FOREIGN KEY (`nation_id`) REFERENCES `nation__` (`nation_id`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDBDEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -19355,7 +19337,7 @@ CREATE TABLE `townKk` ( PRIMARY KEY (`town_id`), KEY `town_province_id_idx` (`province_id`), CONSTRAINT `townKk_ibfk_1` FOREIGN KEY (`province_id`) REFERENCES `province` (`province_id`) ON DELETE NO ACTION ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -19367,7 +19349,7 @@ DROP TABLE IF EXISTS `workcenter`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `workcenter` ( `workcenter_id` int(11) NOT NULL AUTO_INCREMENT, - `name` longtext, + `name` longtext DEFAULT NULL, `center_id` int(11) DEFAULT NULL, `counter` bigint(20) DEFAULT NULL, `warehouseFk` smallint(6) DEFAULT NULL, @@ -19404,7 +19386,7 @@ DROP TABLE IF EXISTS `workers20190711_FichadasAbril`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `workers20190711_FichadasAbril` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `person_id` int(11) NOT NULL DEFAULT '0', + `person_id` int(11) NOT NULL DEFAULT 0, `nif` varchar(15) CHARACTER SET utf8 DEFAULT NULL, `Apellidos` varchar(60) CHARACTER SET utf8 NOT NULL, `Nombre` varchar(20) CHARACTER SET utf8 DEFAULT NULL, @@ -19412,7 +19394,7 @@ CREATE TABLE `workers20190711_FichadasAbril` ( `Hora` int(2) DEFAULT NULL, `Minuto` int(2) DEFAULT NULL, `sumable` double DEFAULT NULL, - `jornada` decimal(5,2) NOT NULL DEFAULT '8.00', + `jornada` decimal(5,2) NOT NULL DEFAULT 8.00, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -19477,16 +19459,16 @@ DROP TABLE IF EXISTS `Naciones`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `Naciones` ( `countryFk` mediumint(8) NOT NULL, - `CodigoNacion` smallint(6) NOT NULL DEFAULT '108', - `CodigoNacion347` smallint(6) NOT NULL DEFAULT '108', + `CodigoNacion` smallint(6) NOT NULL DEFAULT 108, + `CodigoNacion347` smallint(6) NOT NULL DEFAULT 108, `Nacion` varchar(25) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `SiglaNacion` varchar(2) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'ES', `TipoCodigo` varchar(1) CHARACTER SET utf8 NOT NULL DEFAULT 'A', - `Longitud1` tinyint(4) NOT NULL DEFAULT '0', - `Longitud2` tinyint(4) NOT NULL DEFAULT '0', - `Longitud3` tinyint(4) NOT NULL DEFAULT '0', - `Longitud4` tinyint(4) NOT NULL DEFAULT '0', - `NacionCEE` smallint(6) NOT NULL DEFAULT '0', + `Longitud1` tinyint(4) NOT NULL DEFAULT 0, + `Longitud2` tinyint(4) NOT NULL DEFAULT 0, + `Longitud3` tinyint(4) NOT NULL DEFAULT 0, + `Longitud4` tinyint(4) NOT NULL DEFAULT 0, + `NacionCEE` smallint(6) NOT NULL DEFAULT 0, `FechaCEE` datetime DEFAULT NULL, `NacionISO` varchar(3) CHARACTER SET utf8 NOT NULL DEFAULT '', PRIMARY KEY (`countryFk`,`CodigoNacion`) @@ -19505,7 +19487,7 @@ CREATE TABLE `Provincias` ( `CodigoProvincia` varchar(5) NOT NULL DEFAULT '', `CodigoMatricula` varchar(2) NOT NULL DEFAULT '', `Provincia` varchar(20) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '', - `RecargoProvincial` decimal(28,10) NOT NULL DEFAULT '0.0000000000', + `RecargoProvincial` decimal(28,10) NOT NULL DEFAULT 0.0000000000, PRIMARY KEY (`CodigoProvincia`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; @@ -19518,12 +19500,12 @@ DROP TABLE IF EXISTS `TiposIva`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `TiposIva` ( - `CodigoIva` smallint(6) NOT NULL DEFAULT '0', - `CodigoTerritorio` smallint(6) NOT NULL DEFAULT '0', + `CodigoIva` smallint(6) NOT NULL DEFAULT 0, + `CodigoTerritorio` smallint(6) NOT NULL DEFAULT 0, `Iva` varchar(30) NOT NULL DEFAULT '', - `BaseCorrectora` decimal(28,10) NOT NULL DEFAULT '0.0000000000', - `PorcentajeIva` decimal(28,10) NOT NULL DEFAULT '0.0000000000', - `RecargoEquivalencia` decimal(28,10) NOT NULL DEFAULT '0.0000000000', + `BaseCorrectora` decimal(28,10) NOT NULL DEFAULT 0.0000000000, + `PorcentajeIva` decimal(28,10) NOT NULL DEFAULT 0.0000000000, + `RecargoEquivalencia` decimal(28,10) NOT NULL DEFAULT 0.0000000000, `CuentaIvaSoportado` varchar(15) NOT NULL DEFAULT '', `CuentaIvaRepercutido` varchar(15) NOT NULL DEFAULT '', `CuentaRecargo` varchar(15) NOT NULL DEFAULT '', @@ -19542,8 +19524,8 @@ CREATE TABLE `TiposIva` ( `CuentaIVARecCaja` varchar(15) NOT NULL DEFAULT '', `CuentaIVARecCajaPu` varchar(15) NOT NULL DEFAULT '', `CuentaIVARecCajaVen` varchar(15) NOT NULL DEFAULT '', - `IGICImplicito` smallint(6) NOT NULL DEFAULT '0', - `isIntracommunity` tinyint(2) NOT NULL DEFAULT '0', + `IGICImplicito` smallint(6) NOT NULL DEFAULT 0, + `isIntracommunity` tinyint(2) NOT NULL DEFAULT 0, PRIMARY KEY (`CodigoIva`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; @@ -19556,9 +19538,9 @@ DROP TABLE IF EXISTS `TiposRetencion`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `TiposRetencion` ( - `CodigoRetencion` smallint(6) NOT NULL DEFAULT '0', + `CodigoRetencion` smallint(6) NOT NULL DEFAULT 0, `Retencion` varchar(50) NOT NULL DEFAULT '', - `PorcentajeRetencion` decimal(28,10) NOT NULL DEFAULT '0.0000000000', + `PorcentajeRetencion` decimal(28,10) NOT NULL DEFAULT 0.0000000000, `CuentaCargo` varchar(15) DEFAULT NULL, `CuentaAbono` varchar(15) DEFAULT NULL, `ClaveIrpf` varchar(2) DEFAULT NULL, @@ -19577,10 +19559,10 @@ DROP TABLE IF EXISTS `TiposTransacciones`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `TiposTransacciones` ( - `CodigoTransaccion` tinyint(4) NOT NULL DEFAULT '0', + `CodigoTransaccion` tinyint(4) NOT NULL DEFAULT 0, `Transaccion` varchar(50) NOT NULL DEFAULT '', `TipoFactura` varchar(1) NOT NULL DEFAULT '', - `Autofactura` smallint(6) NOT NULL DEFAULT '0', + `Autofactura` smallint(6) NOT NULL DEFAULT 0, `ClaveOperacionDefecto` varchar(1) NOT NULL DEFAULT '', PRIMARY KEY (`CodigoTransaccion`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; @@ -19636,31 +19618,31 @@ CREATE TABLE `clientesProveedores` ( `ColaMunicipio` varchar(15) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `CodigoProvincia` varchar(5) COLLATE utf8_unicode_ci NOT NULL, `Provincia` varchar(20) COLLATE utf8_unicode_ci NOT NULL, - `CodigoNacion` smallint(6) NOT NULL DEFAULT '0', + `CodigoNacion` smallint(6) NOT NULL DEFAULT 0, `Nacion` varchar(25) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `Telefono` varchar(15) COLLATE utf8_unicode_ci NOT NULL, `Telefono2` varchar(15) COLLATE utf8_unicode_ci NOT NULL, `Telefono3` varchar(15) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `Fax` varchar(15) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', - `CodigoTransaccion` tinyint(4) NOT NULL DEFAULT '0', + `CodigoTransaccion` tinyint(4) NOT NULL DEFAULT 0, `CodigoRetencion` smallint(6) NOT NULL, - `Deducible` smallint(6) NOT NULL DEFAULT '0', - `CodigoIva` smallint(6) NOT NULL DEFAULT '0', - `Mediacion` smallint(6) NOT NULL DEFAULT '0', - `Exclusion347` smallint(6) NOT NULL DEFAULT '0', - `NumeroPlazos` tinyint(4) NOT NULL DEFAULT '1', - `DiasPrimerPlazo` smallint(6) NOT NULL DEFAULT '0', - `DiasEntrePlazos` smallint(6) NOT NULL DEFAULT '0', - `DiasFijos1` tinyint(4) NOT NULL DEFAULT '0', - `DiasFijos2` tinyint(4) NOT NULL DEFAULT '0', - `DiasFijos3` tinyint(4) NOT NULL DEFAULT '0', - `InicioNoPago` smallint(6) NOT NULL DEFAULT '0', - `FinNoPago` smallint(6) NOT NULL DEFAULT '0', - `ControlarFestivos` smallint(6) NOT NULL DEFAULT '0', - `DiasRetroceso` tinyint(4) NOT NULL DEFAULT '0', - `MesesComerciales` smallint(6) NOT NULL DEFAULT '0', + `Deducible` smallint(6) NOT NULL DEFAULT 0, + `CodigoIva` smallint(6) NOT NULL DEFAULT 0, + `Mediacion` smallint(6) NOT NULL DEFAULT 0, + `Exclusion347` smallint(6) NOT NULL DEFAULT 0, + `NumeroPlazos` tinyint(4) NOT NULL DEFAULT 1, + `DiasPrimerPlazo` smallint(6) NOT NULL DEFAULT 0, + `DiasEntrePlazos` smallint(6) NOT NULL DEFAULT 0, + `DiasFijos1` tinyint(4) NOT NULL DEFAULT 0, + `DiasFijos2` tinyint(4) NOT NULL DEFAULT 0, + `DiasFijos3` tinyint(4) NOT NULL DEFAULT 0, + `InicioNoPago` smallint(6) NOT NULL DEFAULT 0, + `FinNoPago` smallint(6) NOT NULL DEFAULT 0, + `ControlarFestivos` smallint(6) NOT NULL DEFAULT 0, + `DiasRetroceso` tinyint(4) NOT NULL DEFAULT 0, + `MesesComerciales` smallint(6) NOT NULL DEFAULT 0, `RemesaHabitual` varchar(15) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', - `CodigoTipoEfecto` smallint(6) NOT NULL DEFAULT '0', + `CodigoTipoEfecto` smallint(6) NOT NULL DEFAULT 0, `Email1` varchar(250) COLLATE utf8_unicode_ci NOT NULL, `Email2` varchar(250) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `CodigoCategoriaCliente_` varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'CLI', @@ -19673,25 +19655,25 @@ CREATE TABLE `clientesProveedores` ( `DC` varchar(2) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `CCC` varchar(15) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `IBAN` varchar(34) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', - `CodigoCondiciones` smallint(6) NOT NULL DEFAULT '0', - `StatusTraspasadoIME` tinyint(4) NOT NULL DEFAULT '0', - `TipoImportacionIME` tinyint(4) NOT NULL DEFAULT '2', - `TipoPlanCuentaIME` smallint(6) NOT NULL DEFAULT '2', + `CodigoCondiciones` smallint(6) NOT NULL DEFAULT 0, + `StatusTraspasadoIME` tinyint(4) NOT NULL DEFAULT 0, + `TipoImportacionIME` tinyint(4) NOT NULL DEFAULT 2, + `TipoPlanCuentaIME` smallint(6) NOT NULL DEFAULT 2, `Contrapartida` varchar(15) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `CodigoCuentaImpagado` varchar(15) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `CodigoCuentaEfecto` varchar(15) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `Comentarios` text COLLATE utf8_unicode_ci NOT NULL, - `CodigoTerritorio` smallint(6) NOT NULL DEFAULT '0', + `CodigoTerritorio` smallint(6) NOT NULL DEFAULT 0, `CodigoIdioma_` varchar(3) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', - `TarifaPrecio` smallint(6) NOT NULL DEFAULT '0', - `%Descuento` decimal(28,10) NOT NULL DEFAULT '0.0000000000', - `%Rappel` decimal(28,10) NOT NULL DEFAULT '0.0000000000', - `%ProntoPago` decimal(28,10) NOT NULL DEFAULT '0.0000000000', - `%Financiacion` decimal(28,10) NOT NULL DEFAULT '0.0000000000', - `CodigoComisionista` int(11) NOT NULL DEFAULT '0', - `TarifaDescuento` smallint(6) NOT NULL DEFAULT '0', + `TarifaPrecio` smallint(6) NOT NULL DEFAULT 0, + `%Descuento` decimal(28,10) NOT NULL DEFAULT 0.0000000000, + `%Rappel` decimal(28,10) NOT NULL DEFAULT 0.0000000000, + `%ProntoPago` decimal(28,10) NOT NULL DEFAULT 0.0000000000, + `%Financiacion` decimal(28,10) NOT NULL DEFAULT 0.0000000000, + `CodigoComisionista` int(11) NOT NULL DEFAULT 0, + `TarifaDescuento` smallint(6) NOT NULL DEFAULT 0, `SiglaNacion` varchar(2) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', - `MarcaMenorSinNif` smallint(6) NOT NULL DEFAULT '0', + `MarcaMenorSinNif` smallint(6) NOT NULL DEFAULT 0, `PersonaFisicaJuridica` varchar(1) COLLATE utf8_unicode_ci NOT NULL, `SiglaNacionRepresentante` varchar(2) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `CifDniRepresentante` varchar(13) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', @@ -19699,12 +19681,12 @@ CREATE TABLE `clientesProveedores` ( `TipoDocumentoPersona` smallint(6) NOT NULL, `TipoCif` varchar(1) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `MotivoBajaClienteLc` varchar(30) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', - `PuntosSR` decimal(28,10) NOT NULL DEFAULT '0.0000000000', + `PuntosSR` decimal(28,10) NOT NULL DEFAULT 0.0000000000, `TarjetaSR` varchar(100) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `FechaNacimiento` datetime DEFAULT NULL, `Domicilio2` varchar(40) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `CuentaProvision` varchar(15) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', - `CodigoTransportista` int(11) NOT NULL DEFAULT '0', + `CodigoTransportista` int(11) NOT NULL DEFAULT 0, `FormadePago` varchar(35) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `ObservacionesCliente` varchar(50) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `CodigoTipoClienteLc` varchar(3) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', @@ -19716,14 +19698,14 @@ CREATE TABLE `clientesProveedores` ( `NombreEmpleado` varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `PrimerApellidoEmpleado` varchar(15) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `SegundoApellidoEmpleado` varchar(15) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', - `sysTick` int(11) NOT NULL DEFAULT '0', - `RiesgoMaximo` decimal(28,10) NOT NULL DEFAULT '0.0000000000', - `PlazoMedioPCMA` smallint(6) NOT NULL DEFAULT '0', - `CriterioIvaIME` smallint(6) NOT NULL DEFAULT '0', + `sysTick` int(11) NOT NULL DEFAULT 0, + `RiesgoMaximo` decimal(28,10) NOT NULL DEFAULT 0.0000000000, + `PlazoMedioPCMA` smallint(6) NOT NULL DEFAULT 0, + `CriterioIvaIME` smallint(6) NOT NULL DEFAULT 0, `ReferenciaMandato` varchar(35) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', - `%Comision` decimal(28,10) NOT NULL DEFAULT '0.0000000000', - `CodigoZona` int(11) NOT NULL DEFAULT '0', - `BloqueoAlbaran` smallint(6) NOT NULL DEFAULT '0', + `%Comision` decimal(28,10) NOT NULL DEFAULT 0.0000000000, + `CodigoZona` int(11) NOT NULL DEFAULT 0, + `BloqueoAlbaran` smallint(6) NOT NULL DEFAULT 0, `CodigoSeccion` varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `CodigoSector_` varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `CodigoProyecto` varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', @@ -19783,7 +19765,7 @@ CREATE TABLE `movContaIVA` ( `CuotaIva1` double DEFAULT NULL, `PorRecargoEquivalencia1` double DEFAULT NULL, `RecargoEquivalencia1` double DEFAULT NULL, - `CodigoTransaccion1` double NOT NULL DEFAULT '0', + `CodigoTransaccion1` double NOT NULL DEFAULT 0, `CodigoIva1` smallint(6) NOT NULL, `BaseIva2` double DEFAULT NULL, `PorBaseCorrectora2` double DEFAULT NULL, @@ -19791,7 +19773,7 @@ CREATE TABLE `movContaIVA` ( `CuotaIva2` double DEFAULT NULL, `PorRecargoEquivalencia2` double DEFAULT NULL, `RecargoEquivalencia2` double DEFAULT NULL, - `CodigoTransaccion2` double NOT NULL DEFAULT '0', + `CodigoTransaccion2` double NOT NULL DEFAULT 0, `CodigoIva2` smallint(6) NOT NULL, `BaseIva3` double DEFAULT NULL, `PorBaseCorrectora3` double DEFAULT NULL, @@ -19799,7 +19781,7 @@ CREATE TABLE `movContaIVA` ( `CuotaIva3` double DEFAULT NULL, `PorRecargoEquivalencia3` double DEFAULT NULL, `RecargoEquivalencia3` double DEFAULT NULL, - `CodigoTransaccion3` double NOT NULL DEFAULT '0', + `CodigoTransaccion3` double NOT NULL DEFAULT 0, `CodigoIva3` smallint(6) NOT NULL, `BaseIva4` double DEFAULT NULL, `PorBaseCorrectora4` double DEFAULT NULL, @@ -19807,7 +19789,7 @@ CREATE TABLE `movContaIVA` ( `CuotaIva4` double DEFAULT NULL, `PorRecargoEquivalencia4` double DEFAULT NULL, `RecargoEquivalencia4` double DEFAULT NULL, - `CodigoTransaccion4` double NOT NULL DEFAULT '0', + `CodigoTransaccion4` double NOT NULL DEFAULT 0, `CodigoIva4` smallint(6) NOT NULL, `Año` int(11) DEFAULT NULL, `Serie` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, @@ -19827,7 +19809,7 @@ CREATE TABLE `movContaIVA` ( `EjercicioFactura` int(2) DEFAULT NULL, `FechaOperacion` date DEFAULT NULL, `Exclusion347` int(2) DEFAULT NULL, - `MantenerAsiento` int(2) DEFAULT '-1', + `MantenerAsiento` int(2) DEFAULT -1, `Metalico347` int(2) DEFAULT NULL, `ClaveOperacionFactura` varchar(1) COLLATE utf8_unicode_ci DEFAULT NULL, `TipoRectificativa` int(2) DEFAULT NULL, @@ -19837,13 +19819,13 @@ CREATE TABLE `movContaIVA` ( `ClaseAbonoRectificativas` int(2) DEFAULT NULL, `RecargoEquivalenciaOriginal` double DEFAULT NULL, `LibreA1` varchar(15) COLLATE utf8_unicode_ci DEFAULT NULL, - `IvaDeducible1` int(2) NOT NULL DEFAULT '-1', - `IvaDeducible2` int(2) NOT NULL DEFAULT '-1', - `IvaDeducible3` int(2) NOT NULL DEFAULT '-1', - `IvaDeducible4` int(2) NOT NULL DEFAULT '-1', + `IvaDeducible1` int(2) NOT NULL DEFAULT -1, + `IvaDeducible2` int(2) NOT NULL DEFAULT -1, + `IvaDeducible3` int(2) NOT NULL DEFAULT -1, + `IvaDeducible4` int(2) NOT NULL DEFAULT -1, `FechaGrabacion` date DEFAULT NULL, - `Intracomunitaria` tinyint(1) DEFAULT '0', - `moveData` tinyint(1) DEFAULT '1', + `Intracomunitaria` tinyint(1) DEFAULT 0, + `moveData` tinyint(1) DEFAULT 1, PRIMARY KEY (`id`), CONSTRAINT `movContaIVA_fk1` FOREIGN KEY (`id`) REFERENCES `vn`.`XDiario` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Informa del valor de los campos de IVA para enlazar en la tabla vn.movConta'; @@ -19863,7 +19845,7 @@ CREATE TABLE `pgcToSage` ( `accountTaxInput` varchar(10) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, `accountTaxOutput` varchar(10) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COMMENT='Tabla relaciona cuentas pgc con Código de IVA y Código de Transacción en Sage'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Tabla relaciona cuentas pgc con Código de IVA y Código de Transacción en Sage'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -19879,16 +19861,16 @@ CREATE TABLE `planCuentasPGC` ( `Cuenta` varchar(50) COLLATE utf8_unicode_ci NOT NULL, `ClienteOProveedor` varchar(1) COLLATE utf8_unicode_ci NOT NULL, `CodigoDivisa` varchar(3) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', - `IndicadorProrrata` smallint(6) NOT NULL DEFAULT '0', - `TipoPlanCuentaIME` smallint(6) NOT NULL DEFAULT '2', - `StatusAnalitica` smallint(6) NOT NULL DEFAULT '0', + `IndicadorProrrata` smallint(6) NOT NULL DEFAULT 0, + `TipoPlanCuentaIME` smallint(6) NOT NULL DEFAULT 2, + `StatusAnalitica` smallint(6) NOT NULL DEFAULT 0, `AnaCodigoCuenta` varchar(15) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', - `StatusTraspasadoIME` tinyint(4) NOT NULL DEFAULT '0', - `TipoImportacionIME` tinyint(4) NOT NULL DEFAULT '0', - `CierrePatrimonio_` smallint(6) NOT NULL DEFAULT '0', + `StatusTraspasadoIME` tinyint(4) NOT NULL DEFAULT 0, + `TipoImportacionIME` tinyint(4) NOT NULL DEFAULT 0, + `CierrePatrimonio_` smallint(6) NOT NULL DEFAULT 0, `CuentaPatrimonio_` varchar(15) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', - `CuentaVarios` smallint(6) NOT NULL DEFAULT '0', - `TodasLasActividades` smallint(6) NOT NULL DEFAULT '0', + `CuentaVarios` smallint(6) NOT NULL DEFAULT 0, + `TodasLasActividades` smallint(6) NOT NULL DEFAULT 0, `ValorDelegacion` varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `ValorDepartamento` varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `ValorProyecto` varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', @@ -21971,7 +21953,7 @@ BEGIN /* Copia en movConta los asientos de XDiario para que luego los importe el proceso automático que hay en SQL Server */ DECLARE vDated DATE; - SELECT CONCAT(YEAR(CURDATE()), "-01-01") INTO vDated; + SELECT CONCAT(YEAR(util.VN_CURDATE()), "-01-01") INTO vDated; SELECT "2021-01-01" INTO vDated; TRUNCATE XDiario_movConta_IVA; DELETE FROM movConta WHERE enlazadoSage = FALSE AND Asiento <> 1 ; @@ -22663,7 +22645,7 @@ BEGIN DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE; - SELECT CONCAT(YEAR(CURDATE()), "-01-01") INTO vDated; + SELECT CONCAT(YEAR(util.VN_CURDATE()), "-01-01") INTO vDated; SELECT "2021-01-01" INTO vDated; DROP TEMPORARY TABLE IF EXISTS tmp.invoiceDua; CREATE TEMPORARY TABLE tmp.invoiceDua @@ -23113,7 +23095,7 @@ BEGIN ) x ON x.refFk = io.ref; DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE; - SELECT CONCAT(YEAR(CURDATE()), "-01-01") INTO vDated; + SELECT CONCAT(YEAR(util.VN_CURDATE()), "-01-01") INTO vDated; SELECT "2021-01-01" INTO vDated; OPEN rs; FETCH rs INTO vInvoiceFk, vXDiarioFk; @@ -23526,10 +23508,10 @@ CREATE TABLE `userConfigView` ( `id` int(11) NOT NULL AUTO_INCREMENT, `userFk` int(10) unsigned NOT NULL, `tableCode` varchar(255) COLLATE utf8_unicode_ci NOT NULL, - `configuration` text COLLATE utf8_unicode_ci, + `configuration` text COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `uniqueUser_TableCode` (`userFk`,`tableCode`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -23560,7 +23542,7 @@ CREATE TABLE `inbound` ( `tableName` set('buy','sale') NOT NULL, `tableId` int(10) unsigned NOT NULL, `isSync` tinyint(4) NOT NULL, - `isPicked` tinyint(4) NOT NULL DEFAULT '0', + `isPicked` tinyint(4) NOT NULL DEFAULT 0, `warehouseFk` int(10) unsigned NOT NULL, `itemFk` int(10) unsigned NOT NULL, `dated` datetime NOT NULL, @@ -23586,7 +23568,7 @@ DELIMITER ;; BEFORE INSERT ON `inbound` FOR EACH ROW BEGIN - SET NEW.isPicked = NEW.isPicked OR NEW.dated < CURDATE(); + SET NEW.isPicked = NEW.isPicked OR NEW.dated < util.VN_CURDATE(); CALL visible_log( NEW.isPicked, @@ -23681,7 +23663,7 @@ CREATE TABLE `outbound` ( `tableName` set('sale','buy','orderRow') NOT NULL, `tableId` int(10) unsigned NOT NULL, `isSync` tinyint(3) unsigned NOT NULL, - `isPicked` tinyint(4) NOT NULL DEFAULT '0', + `isPicked` tinyint(4) NOT NULL DEFAULT 0, `warehouseFk` int(10) unsigned NOT NULL, `itemFk` int(10) unsigned NOT NULL, `dated` datetime NOT NULL, @@ -23710,7 +23692,7 @@ DELIMITER ;; FOR EACH ROW BEGIN SET NEW.lack = NEW.quantity; - SET NEW.isPicked = NEW.isPicked OR NEW.dated < CURDATE(); + SET NEW.isPicked = NEW.isPicked OR NEW.dated < util.VN_CURDATE(); CALL visible_log( NEW.isPicked, @@ -24134,7 +24116,7 @@ proc: BEGIN WHERE b.id = vNewId AND w.isBuyerToBeEmailed; - IF vLanded = CURDATE() THEN + IF vLanded = util.VN_CURDATE() THEN SELECT it.workerFk, b.entryFk, i.id, i.longName INTO vBuyerFk, vEntryFk, vItemFk, vItemName @@ -24357,7 +24339,7 @@ CREATE DEFINER=`root`@`localhost` PROCEDURE `log_refreshOrder`( `vTableId` INT) BEGIN DECLARE vExpireTime INT DEFAULT 20; - DECLARE vExpired DATETIME DEFAULT TIMESTAMPADD(MINUTE, -vExpireTime, NOW()); + DECLARE vExpired DATETIME DEFAULT TIMESTAMPADD(MINUTE, -vExpireTime, util.VN_NOW()); DROP TEMPORARY TABLE IF EXISTS tValues; CREATE TEMPORARY TABLE tValues @@ -24561,7 +24543,7 @@ proc: BEGIN -- Deletes expired outbounds - DELETE FROM outbound WHERE expired <= NOW(); + DELETE FROM outbound WHERE expired <= util.VN_NOW(); -- Attaches desync inbounds @@ -24848,7 +24830,8 @@ DELIMITER ; -- Current Database: `util` -- -CREATE DATABASE /*!32312 IF NOT EXISTS*/ `util` /*!40100 DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci */; + +CREATE SCHEMA IF NOT EXISTS `util`; USE `util`; @@ -24862,7 +24845,7 @@ DROP TABLE IF EXISTS `config`; CREATE TABLE `config` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `dbVersion` char(11) CHARACTER SET utf8 DEFAULT NULL COMMENT 'The current database version', - `hasTriggersDisabled` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Defines if triggers are disabled', + `hasTriggersDisabled` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'Defines if triggers are disabled', `environment` varchar(45) CHARACTER SET utf8 DEFAULT NULL COMMENT 'The current Database environment', `lastDump` datetime DEFAULT NULL COMMENT 'Timestamp of the last data dump', PRIMARY KEY (`id`) @@ -24878,7 +24861,7 @@ DROP TABLE IF EXISTS `debug`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `debug` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `created` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `connectionId` int(10) unsigned DEFAULT NULL, `user` varchar(255) CHARACTER SET utf8 DEFAULT NULL, `host` varchar(255) CHARACTER SET utf8 DEFAULT NULL, @@ -24886,7 +24869,7 @@ CREATE TABLE `debug` ( `value` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), KEY `created` (`created`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Log de depuración'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Log de depuración'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -25079,7 +25062,7 @@ DELIMITER ; /*!50003 SET character_set_client = @saved_cs_client */ ; /*!50003 SET character_set_results = @saved_cs_results */ ; /*!50003 SET collation_connection = @saved_col_connection */ ; -/*!50003 DROP FUNCTION IF EXISTS `dayEnd` */; +/*!50003 DROP FUNCTION IF EXISTS `dayend` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; /*!50003 SET @saved_col_connection = @@collation_connection */ ; @@ -25315,7 +25298,7 @@ CREATE DEFINER=`root`@`localhost` FUNCTION `midnight`() RETURNS datetime READS SQL DATA BEGIN - RETURN TIMESTAMP(CURDATE(), '23:59:59'); + RETURN TIMESTAMP(util.VN_CURDATE(), '23:59:59'); END ;; DELIMITER ; @@ -25425,12 +25408,12 @@ CREATE DEFINER=`root`@`localhost` FUNCTION `today`() RETURNS date BEGIN /** * Devuelve la fecha actual. Usar en lugar de la función nativa - * CURDATE() en aquellos que se necesite rendimiento ya que la + * util.VN_CURDATE() en aquellos que se necesite rendimiento ya que la * la última no es determinista. * * @return La fecha actual */ - RETURN CURDATE(); + RETURN util.VN_CURDATE(); END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -25455,7 +25438,7 @@ BEGIN * * @return La fecha de mañana */ - RETURN TIMESTAMPADD(DAY, 1, CURDATE()); + RETURN TIMESTAMPADD(DAY, 1, util.VN_CURDATE()); END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -25480,7 +25463,7 @@ BEGIN * * @return La fecha de antes de ayer */ - RETURN TIMESTAMPADD(DAY, -2, CURDATE()); + RETURN TIMESTAMPADD(DAY, -2, util.VN_CURDATE()); END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -25507,7 +25490,7 @@ BEGIN * @param vYear Año a evaluar * @return La posicion relativa del año */ - DECLARE vCurYear INT DEFAULT YEAR(CURDATE()); + DECLARE vCurYear INT DEFAULT YEAR(util.VN_CURDATE()); IF vYear = vCurYear THEN RETURN 'curYear'; @@ -25546,7 +25529,7 @@ BEGIN * * @return La fecha de ayer */ - RETURN TIMESTAMPADD(DAY, -1, CURDATE()); + RETURN TIMESTAMPADD(DAY, -1, util.VN_CURDATE()); END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -25945,7 +25928,7 @@ BEGIN RENAME TABLE `mysql`.`slow_log` TO `mysql`.`slow_log_temp`; DELETE FROM `mysql`.`slow_log_temp` - WHERE start_time < TIMESTAMPADD(WEEK, -1, NOW()); + WHERE start_time < TIMESTAMPADD(WEEK, -1, util.VN_NOW()); RENAME TABLE `mysql`.`slow_log_temp` TO `mysql`.`slow_log`; SET GLOBAL slow_query_log = vSlowQueryLog; @@ -26073,7 +26056,7 @@ CREATE TABLE `XDiario` ( `FACTURA` varchar(8) COLLATE utf8_unicode_ci DEFAULT '0', `BASEIMPO` decimal(10,2) DEFAULT NULL, `IVA` decimal(10,2) DEFAULT NULL, - `RECEQUIV` decimal(10,2) DEFAULT '0.00', + `RECEQUIV` decimal(10,2) DEFAULT 0.00, `DOCUMENTO` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, `DEPARTA` varchar(3) COLLATE utf8_unicode_ci DEFAULT NULL, `CLAVE` int(11) DEFAULT NULL, @@ -26091,24 +26074,24 @@ CREATE TABLE `XDiario` ( `CODDIVISA` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, `IMPAUXME` decimal(10,2) DEFAULT NULL, `MONEDAUSO` varchar(1) COLLATE utf8_unicode_ci DEFAULT '2', - `NOCONV` tinyint(1) NOT NULL DEFAULT '0', + `NOCONV` tinyint(1) NOT NULL DEFAULT 0, `NUMEROINV` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, `TIPOOPE` varchar(1) COLLATE utf8_unicode_ci DEFAULT NULL, - `NFACTICK` tinyint(1) NOT NULL DEFAULT '1', - `TERIDNIF` tinyint(1) NOT NULL DEFAULT '2', + `NFACTICK` tinyint(1) NOT NULL DEFAULT 1, + `TERIDNIF` tinyint(1) NOT NULL DEFAULT 2, `TERNIF` varchar(20) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'I.F.', `TERNOM` varchar(50) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'Nombre Importador', - `OPBIENES` tinyint(1) NOT NULL DEFAULT '1', + `OPBIENES` tinyint(1) NOT NULL DEFAULT 1, `TIPOFAC` varchar(1) COLLATE utf8_unicode_ci DEFAULT NULL, `TIPOIVA` varchar(1) COLLATE utf8_unicode_ci DEFAULT NULL, - `L340` tinyint(2) NOT NULL DEFAULT '0', - `enlazado` tinyint(1) NOT NULL DEFAULT '0', + `L340` tinyint(2) NOT NULL DEFAULT 0, + `enlazado` tinyint(1) NOT NULL DEFAULT 0, `FECHA_EX` date DEFAULT NULL COMMENT 'FEcha de expedicion de la factura', - `LRECT349` tinyint(1) NOT NULL DEFAULT '0', - `empresa_id` smallint(5) unsigned NOT NULL DEFAULT '442', - `LDIFADUAN` tinyint(4) NOT NULL DEFAULT '0', - `METAL` tinyint(1) NOT NULL DEFAULT '0', - `METALIMP` decimal(10,2) NOT NULL DEFAULT '0.00', + `LRECT349` tinyint(1) NOT NULL DEFAULT 0, + `empresa_id` smallint(5) unsigned NOT NULL DEFAULT 442, + `LDIFADUAN` tinyint(4) NOT NULL DEFAULT 0, + `METAL` tinyint(1) NOT NULL DEFAULT 0, + `METALIMP` decimal(10,2) NOT NULL DEFAULT 0.00, `CLIENTE` varchar(12) COLLATE utf8_unicode_ci DEFAULT NULL, `METALEJE` varchar(4) COLLATE utf8_unicode_ci DEFAULT NULL, `FECHA_OP` date DEFAULT NULL COMMENT 'FEcha de operacion', @@ -26122,12 +26105,12 @@ CREATE TABLE `XDiario` ( `FACTU_RT` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, `BASEIMP_RT` decimal(10,2) DEFAULT NULL, `BASEIMP_RF` decimal(10,2) DEFAULT NULL, - `RECTIFICA` int(1) NOT NULL DEFAULT '0', + `RECTIFICA` int(1) NOT NULL DEFAULT 0, `FECHA_RT` date DEFAULT NULL, - `created` timestamp NULL DEFAULT CURRENT_TIMESTAMP, - `updated` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `created` timestamp NULL DEFAULT current_timestamp(), + `updated` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `FECREGCON` date DEFAULT NULL, - `enlazadoSage` tinyint(1) NOT NULL DEFAULT '0', + `enlazadoSage` tinyint(1) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), KEY `empresa_id` (`empresa_id`), KEY `ASIENidx` (`id`,`ASIEN`), @@ -26135,7 +26118,7 @@ CREATE TABLE `XDiario` ( KEY `XDiario` (`enlazado`), KEY `enlazadoSage` (`enlazadoSage`), CONSTRAINT `XDiario_ibfk_1` FOREIGN KEY (`empresa_id`) REFERENCES `company` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -26185,21 +26168,6 @@ DELIMITER ; /*!50003 SET character_set_results = @saved_cs_results */ ; /*!50003 SET collation_connection = @saved_col_connection */ ; --- --- Temporary table structure for view `__coolerPathDetail` --- - -DROP TABLE IF EXISTS `__coolerPathDetail`; -/*!50001 DROP VIEW IF EXISTS `__coolerPathDetail`*/; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; -/*!50001 CREATE TABLE `__coolerPathDetail` ( - `id` tinyint NOT NULL, - `coolerPathFk` tinyint NOT NULL, - `hallway` tinyint NOT NULL -) ENGINE=MyISAM */; -SET character_set_client = @saved_cs_client; - -- -- Temporary table structure for view `absenceType` -- @@ -26227,13 +26195,13 @@ DROP TABLE IF EXISTS `accounting`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `accounting` ( - `id` int(11) NOT NULL DEFAULT '0', + `id` int(11) NOT NULL DEFAULT 0, `bank` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, `account` varchar(10) CHARACTER SET utf8 DEFAULT NULL, - `accountingTypeFk` smallint(6) NOT NULL DEFAULT '0', + `accountingTypeFk` smallint(6) NOT NULL DEFAULT 0, `entityFk` int(10) unsigned NOT NULL, - `isActive` tinyint(4) NOT NULL DEFAULT '1', - `currencyFk` tinyint(3) unsigned DEFAULT '1', + `isActive` tinyint(4) NOT NULL DEFAULT 1, + `currencyFk` tinyint(3) unsigned DEFAULT 1, `code` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), KEY `BancosBanco` (`bank`), @@ -26253,11 +26221,11 @@ DROP TABLE IF EXISTS `accountingType`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `accountingType` ( - `id` smallint(6) NOT NULL DEFAULT '0', + `id` smallint(6) NOT NULL DEFAULT 0, `description` varchar(100) COLLATE utf8_unicode_ci NOT NULL, `receiptDescription` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'Descripción por defecto al crear nuevo recibo', `code` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, - `isAutoConciliated` tinyint(1) DEFAULT '1' COMMENT 'Si hay que marcar como conciliado el recibo al usar este tipo', + `isAutoConciliated` tinyint(1) DEFAULT 1 COMMENT 'Si hay que marcar como conciliado el recibo al usar este tipo', `maxAmount` int(11) DEFAULT NULL, PRIMARY KEY (`id`), KEY `accountingType_code_IDX` (`code`) USING BTREE @@ -26287,9 +26255,9 @@ DROP TABLE IF EXISTS `activityTaxDismissed`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `activityTaxDismissed` ( `clientFk` int(11) NOT NULL, - `isNotified` tinyint(1) DEFAULT '0', - `isDismissed` tinyint(1) DEFAULT '0', - `notified` int(11) DEFAULT '0', + `isNotified` tinyint(1) DEFAULT 0, + `isDismissed` tinyint(1) DEFAULT 0, + `notified` int(11) DEFAULT 0, PRIMARY KEY (`clientFk`), CONSTRAINT `clientFk` FOREIGN KEY (`clientFk`) REFERENCES `client` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; @@ -26304,8 +26272,8 @@ DROP TABLE IF EXISTS `address`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `address` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `clientFk` int(11) NOT NULL DEFAULT '0', - `warehouseFk__` smallint(6) unsigned DEFAULT '1', + `clientFk` int(11) NOT NULL DEFAULT 0, + `warehouseFk__` smallint(6) unsigned DEFAULT 1, `street` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `city` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, `provinceFk` smallint(5) unsigned DEFAULT NULL, @@ -26313,12 +26281,12 @@ CREATE TABLE `address` ( `phone` varchar(15) COLLATE utf8_unicode_ci DEFAULT NULL, `mobile` varchar(15) COLLATE utf8_unicode_ci DEFAULT NULL, `nickname` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL, - `isDefaultAddress` tinyint(1) NOT NULL DEFAULT '0', - `agencyModeFk` int(11) NOT NULL DEFAULT '2', + `isDefaultAddress` tinyint(1) NOT NULL DEFAULT 0, + `agencyModeFk` int(11) NOT NULL DEFAULT 2, `notes__` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, - `hasInsurance__` tinyint(1) NOT NULL DEFAULT '0', + `hasInsurance__` tinyint(1) NOT NULL DEFAULT 0, `porte__` double DEFAULT NULL, - `isActive` tinyint(4) NOT NULL DEFAULT '1', + `isActive` tinyint(4) NOT NULL DEFAULT 1, `postcodeOLD__` int(11) unsigned DEFAULT NULL, `longitude` decimal(11,7) DEFAULT NULL, `latitude` decimal(11,7) DEFAULT NULL, @@ -26326,8 +26294,8 @@ CREATE TABLE `address` ( `isEqualizated` tinyint(1) DEFAULT NULL, `customsAgentFk` int(11) DEFAULT NULL, `incotermsFk` varchar(3) COLLATE utf8_unicode_ci DEFAULT NULL, - `isVilassarBuyer__` tinyint(4) NOT NULL DEFAULT '0', - `isLogifloraAllowed` tinyint(4) NOT NULL DEFAULT '0', + `isVilassarBuyer__` tinyint(4) NOT NULL DEFAULT 0, + `isLogifloraAllowed` tinyint(4) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), KEY `Id_Agencia` (`agencyModeFk`), KEY `Id_cliente` (`clientFk`), @@ -26466,12 +26434,12 @@ DROP TABLE IF EXISTS `addressFilter`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `addressFilter` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created` timestamp NOT NULL DEFAULT current_timestamp(), `provinceFk` smallint(5) unsigned DEFAULT NULL, `countryFk` mediumint(8) unsigned DEFAULT NULL, - `isLogifloraAllowed` tinyint(1) DEFAULT '0', - `isVNHSupplier` tinyint(1) DEFAULT '0' COMMENT 'corresponde al campo edi.VMPSettings.isVNHSupplier', - `isEarlyBird` tinyint(1) DEFAULT '0' COMMENT 'corresponde al campo edi.marketPlace.isEarlybird', + `isLogifloraAllowed` tinyint(1) DEFAULT 0, + `isVNHSupplier` tinyint(1) DEFAULT 0 COMMENT 'corresponde al campo edi.VMPSettings.isVNHSupplier', + `isEarlyBird` tinyint(1) DEFAULT 0 COMMENT 'corresponde al campo edi.marketPlace.isEarlybird', `warehouseFk` smallint(5) unsigned DEFAULT NULL, `beforeDated` date DEFAULT NULL, `afterDated` date DEFAULT NULL, @@ -26482,7 +26450,7 @@ CREATE TABLE `addressFilter` ( CONSTRAINT `addressFilter_FK` FOREIGN KEY (`provinceFk`) REFERENCES `province` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `addressFilter_FK_1` FOREIGN KEY (`countryFk`) REFERENCES `country` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `addressFilter_FK_2` FOREIGN KEY (`warehouseFk`) REFERENCES `warehouse` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Establece los criterios para habilitar las compras directas a Logiflora'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Establece los criterios para habilitar las compras directas a Logiflora'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -26494,7 +26462,7 @@ DROP TABLE IF EXISTS `addressForPackaging`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `addressForPackaging` ( `addressFk` int(11) NOT NULL, - `packagingValue` decimal(10,2) NOT NULL DEFAULT '0.04', + `packagingValue` decimal(10,2) NOT NULL DEFAULT 0.04, PRIMARY KEY (`addressFk`), CONSTRAINT `addresForPackaging_fk1` FOREIGN KEY (`addressFk`) REFERENCES `address` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; @@ -26531,11 +26499,11 @@ CREATE TABLE `agency` ( `id` smallint(5) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(25) COLLATE utf8_unicode_ci NOT NULL, `warehouseFk` smallint(5) unsigned DEFAULT NULL COMMENT 'A nulo si se puede enrutar desde todos los almacenes', - `isVolumetric` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'Si el calculo del porte se hacer por volumen', - `bankFk` int(11) NOT NULL DEFAULT '8' COMMENT 'para realizar los reembolsos', + `isVolumetric` tinyint(4) NOT NULL DEFAULT 0 COMMENT 'Si el calculo del porte se hacer por volumen', + `bankFk` int(11) NOT NULL DEFAULT 8 COMMENT 'para realizar los reembolsos', `warehouseAliasFk` smallint(5) unsigned DEFAULT NULL, - `isOwn` tinyint(1) NOT NULL DEFAULT '0', - `labelZone` tinyint(4) NOT NULL DEFAULT '0', + `isOwn` tinyint(1) NOT NULL DEFAULT 0, + `labelZone` tinyint(4) NOT NULL DEFAULT 0, `workCenterFk` int(11) DEFAULT NULL, `supplierFk__` int(11) DEFAULT NULL, `isAnyVolumeAllowed` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Permite vender productos que tengan vn.itemType.IsUnconventionalSize = TRUE', @@ -26603,19 +26571,19 @@ CREATE TABLE `agencyMode` ( `name` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, `description` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, `deliveryMethodFk` int(11) DEFAULT NULL, - `m3` double DEFAULT '0', - `cod71__` tinyint(3) unsigned DEFAULT '0', - `web` smallint(1) unsigned zerofill NOT NULL DEFAULT '0', + `m3` double DEFAULT 0, + `cod71__` tinyint(3) unsigned DEFAULT 0, + `web` smallint(1) unsigned zerofill NOT NULL DEFAULT 0, `agencyFk` smallint(5) unsigned NOT NULL, - `inflation` decimal(5,2) NOT NULL DEFAULT '0.00' COMMENT 'Este valor se utiliza para aumentar el valor del componente porte.', - `isVolumetric` tinyint(1) NOT NULL DEFAULT '0', + `inflation` decimal(5,2) NOT NULL DEFAULT 0.00 COMMENT 'Este valor se utiliza para aumentar el valor del componente porte.', + `isVolumetric` tinyint(1) NOT NULL DEFAULT 0, `reportMail` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, - `showAgencyName` tinyint(1) DEFAULT '1' COMMENT 'obsoleta', - `isActive` tinyint(1) NOT NULL DEFAULT '1', - `isExternalAgency` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'obsoleta', - `flag` blob COMMENT 'obsoleta', + `showAgencyName` tinyint(1) DEFAULT 1 COMMENT 'obsoleta', + `isActive` tinyint(1) NOT NULL DEFAULT 1, + `isExternalAgency` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'obsoleta', + `flag` blob DEFAULT NULL COMMENT 'obsoleta', `code` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, - `isRiskFree` tinyint(1) NOT NULL DEFAULT '0', + `isRiskFree` tinyint(1) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), KEY `Agencias` (`name`), KEY `Vista` (`deliveryMethodFk`), @@ -26627,19 +26595,22 @@ CREATE TABLE `agencyMode` ( /*!40101 SET character_set_client = @saved_cs_client */; -- --- Temporary table structure for view `agencyProvince__` +-- Temporary table structure for view `agencyTerm` -- -DROP TABLE IF EXISTS `agencyProvince__`; -/*!50001 DROP VIEW IF EXISTS `agencyProvince__`*/; +DROP TABLE IF EXISTS `agencyTerm`; +/*!50001 DROP VIEW IF EXISTS `agencyTerm`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE TABLE `agencyProvince__` ( - `provinceFk` tinyint NOT NULL, +/*!50001 CREATE TABLE `agencyTerm` ( `agencyFk` tinyint NOT NULL, - `zone` tinyint NOT NULL, - `warehouseFk` tinyint NOT NULL, - `isVolumetric` tinyint NOT NULL + `minimumPackages` tinyint NOT NULL, + `kmPrice` tinyint NOT NULL, + `packagePrice` tinyint NOT NULL, + `routePrice` tinyint NOT NULL, + `minimumKm` tinyint NOT NULL, + `minimumM3` tinyint NOT NULL, + `m3Price` tinyint NOT NULL ) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; @@ -26734,7 +26705,7 @@ CREATE TABLE `assignedTicketToWorker` ( PRIMARY KEY (`id`), UNIQUE KEY `idWorker_UNIQUE` (`idWorker`), UNIQUE KEY `idTicket_UNIQUE` (`idTicket`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Tabla para relacionar un ticket con el sacador del altillo '; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Tabla para relacionar un ticket con el sacador del altillo '; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -26765,12 +26736,12 @@ DROP TABLE IF EXISTS `autoRadioLogCall`; CREATE TABLE `autoRadioLogCall` ( `id` int(11) NOT NULL AUTO_INCREMENT, `ticketFk` int(11) NOT NULL, - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created` timestamp NOT NULL DEFAULT current_timestamp(), `response` longtext COLLATE utf8_unicode_ci NOT NULL, PRIMARY KEY (`id`), KEY `ticket_idx` (`ticketFk`), CONSTRAINT `ticket` FOREIGN KEY (`ticketFk`) REFERENCES `ticket` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -26788,7 +26759,7 @@ CREATE TABLE `autonomousRegion__` ( PRIMARY KEY (`id`), KEY `countryFk` (`countryFk`), CONSTRAINT `countryFk` FOREIGN KEY (`countryFk`) REFERENCES `country` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -26893,12 +26864,12 @@ CREATE TABLE `awb` ( `code` varchar(18) COLLATE utf8_unicode_ci NOT NULL, `package` float unsigned NOT NULL, `weight` float unsigned DEFAULT NULL, - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created` timestamp NOT NULL DEFAULT current_timestamp(), `transitoryFk` int(11) DEFAULT NULL, - `taxFk` int(10) unsigned DEFAULT '62', + `taxFk` int(10) unsigned DEFAULT 62, `duakk` varchar(18) COLLATE utf8_unicode_ci DEFAULT NULL, `docFk` int(11) DEFAULT NULL, - `amount` double NOT NULL DEFAULT '0', + `amount` double NOT NULL DEFAULT 0, `freightFk` int(11) DEFAULT NULL, `m3` double unsigned DEFAULT NULL, `stems` int(10) unsigned DEFAULT NULL, @@ -26911,11 +26882,11 @@ CREATE TABLE `awb` ( `operated` datetime DEFAULT NULL, `bookEntried` date DEFAULT NULL, `invoiceInFk` mediumint(8) unsigned DEFAULT NULL, - `isChecked` tinyint(3) DEFAULT '0', - `isTransitoryChecked` tinyint(3) DEFAULT '0', + `isChecked` tinyint(3) DEFAULT 0, + `isTransitoryChecked` tinyint(3) DEFAULT 0, `year` int(4) DEFAULT NULL, `observation` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, - `hasFreightPrepaid` tinyint(3) DEFAULT '0', + `hasFreightPrepaid` tinyint(3) DEFAULT 0, PRIMARY KEY (`id`), UNIQUE KEY `codigo_UNIQUE` (`code`,`year`), KEY `proveedor_id` (`transitoryFk`), @@ -26942,7 +26913,7 @@ DELIMITER ;; FOR EACH ROW BEGIN - SET NEW.year= year(CURDATE()); + SET NEW.year= year(util.VN_CURDATE()); END */;; @@ -26976,40 +26947,6 @@ DELIMITER ; /*!50003 SET character_set_results = @saved_cs_results */ ; /*!50003 SET collation_connection = @saved_col_connection */ ; --- --- Temporary table structure for view `awb__` --- - -DROP TABLE IF EXISTS `awb__`; -/*!50001 DROP VIEW IF EXISTS `awb__`*/; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; -/*!50001 CREATE TABLE `awb__` ( - `id` tinyint NOT NULL, - `code` tinyint NOT NULL, - `package` tinyint NOT NULL, - `weight` tinyint NOT NULL, - `created` tinyint NOT NULL, - `transitoryFk` tinyint NOT NULL, - `taxFk` tinyint NOT NULL, - `docFk` tinyint NOT NULL, - `amount` tinyint NOT NULL, - `freightFk` tinyint NOT NULL, - `m3` tinyint NOT NULL, - `stems` tinyint NOT NULL, - `flightFk` tinyint NOT NULL, - `volumeWeight` tinyint NOT NULL, - `hb` tinyint NOT NULL, - `rate` tinyint NOT NULL, - `booked` tinyint NOT NULL, - `issued` tinyint NOT NULL, - `operated` tinyint NOT NULL, - `bookEntried` tinyint NOT NULL, - `invoiceInFk` tinyint NOT NULL, - `isChecked` tinyint NOT NULL -) ENGINE=MyISAM */; -SET character_set_client = @saved_cs_client; - -- -- Temporary table structure for view `bank` -- @@ -27038,7 +26975,7 @@ DROP TABLE IF EXISTS `bankEntity`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `bankEntity` ( - `countryFk` mediumint(8) unsigned NOT NULL DEFAULT '1', + `countryFk` mediumint(8) unsigned NOT NULL DEFAULT 1, `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(45) COLLATE utf8_unicode_ci NOT NULL, `bic` varchar(11) CHARACTER SET utf8 DEFAULT NULL, @@ -27049,37 +26986,6 @@ CREATE TABLE `bankEntity` ( ) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Entidades bancarias '; /*!40101 SET character_set_client = @saved_cs_client */; --- --- Temporary table structure for view `bankPolicy` --- - -DROP TABLE IF EXISTS `bankPolicy`; -/*!50001 DROP VIEW IF EXISTS `bankPolicy`*/; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; -/*!50001 CREATE TABLE `bankPolicy` ( - `id` tinyint NOT NULL, - `ref` tinyint NOT NULL, - `amount` tinyint NOT NULL, - `balanceInterestDrawn` tinyint NOT NULL, - `commissionAvailableBalances` tinyint NOT NULL, - `openingCommission` tinyint NOT NULL, - `started` tinyint NOT NULL, - `ended` tinyint NOT NULL, - `bankFk` tinyint NOT NULL, - `companyFk` tinyint NOT NULL, - `supplierFk` tinyint NOT NULL, - `description` tinyint NOT NULL, - `hasGuarantee` tinyint NOT NULL, - `dmsFk` tinyint NOT NULL, - `notaryFk` tinyint NOT NULL, - `currencyFk` tinyint NOT NULL, - `amortizationTypeFk` tinyint NOT NULL, - `periodicityTypeFk` tinyint NOT NULL, - `insuranceExpired` tinyint NOT NULL -) ENGINE=MyISAM */; -SET character_set_client = @saved_cs_client; - -- -- Table structure for table `beach` -- @@ -27093,9 +26999,9 @@ CREATE TABLE `beach` ( `x` int(11) NOT NULL, `y` int(11) NOT NULL, `name` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, - `isShowed` tinyint(1) DEFAULT '0', + `isShowed` tinyint(1) DEFAULT 0, PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Ubicaciones respecto a la playa del almacén'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Ubicaciones respecto a la playa del almacén'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -27124,12 +27030,12 @@ DROP TABLE IF EXISTS `bookingPlanner`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `bookingPlanner` ( `id` int(10) NOT NULL AUTO_INCREMENT, - `effectived` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `effectived` timestamp NOT NULL DEFAULT current_timestamp(), `pgcFk` varchar(10) COLLATE utf8_unicode_ci NOT NULL, `taxAreaFk` varchar(15) CHARACTER SET utf8 NOT NULL DEFAULT 'SPAIN', `priority` int(2) unsigned DEFAULT NULL, - `taxClassFk` tinyint(3) unsigned NOT NULL DEFAULT '1', - `countryFk` mediumint(8) unsigned NOT NULL DEFAULT '1', + `taxClassFk` tinyint(3) unsigned NOT NULL DEFAULT 1, + `countryFk` mediumint(8) unsigned NOT NULL DEFAULT 1, PRIMARY KEY (`id`), KEY `pgcFk_bookingPlanner_idx` (`pgcFk`), KEY `taxClassFk` (`taxClassFk`), @@ -27156,14 +27062,14 @@ CREATE TABLE `botanicExport` ( `countryFk` mediumint(8) unsigned DEFAULT NULL, `restriction` enum('Sin restriccion','Importacion Prohibida','pasaporte fitosanitario','pasaporte individual','declaracion origen') CHARACTER SET utf8 NOT NULL, `description` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, - `isProtectedZone` tinyint(1) NOT NULL DEFAULT '0', + `isProtectedZone` tinyint(1) NOT NULL DEFAULT 0, `code` enum('importProhibited','phytosanitaryPassport','individualPassport') COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), KEY `Id_Paises` (`countryFk`), KEY `botanicExport_ibfk_2_idx` (`ediGenusFk`), KEY `botanicExport_ibfk_3_idx` (`ediSpecieFk`), CONSTRAINT `botanicExport_ibfk_1` FOREIGN KEY (`countryFk`) REFERENCES `country` (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Especifica los generos y especies prohibidos en paises'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Especifica los generos y especies prohibidos en paises'; /*!40101 SET character_set_client = @saved_cs_client */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -27197,14 +27103,14 @@ DROP TABLE IF EXISTS `budget`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `budget` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created` timestamp NOT NULL DEFAULT current_timestamp(), `name` varchar(100) COLLATE utf8_unicode_ci NOT NULL, `started` date DEFAULT NULL, `finished` date DEFAULT NULL, `userFk` int(10) unsigned DEFAULT NULL, `departmentFk` int(11) DEFAULT NULL, `supplierFk` int(11) DEFAULT NULL, - `photo` blob, + `photo` blob DEFAULT NULL, `amount` decimal(10,2) DEFAULT NULL, `projectFk` int(11) NOT NULL, PRIMARY KEY (`id`), @@ -27216,7 +27122,7 @@ CREATE TABLE `budget` ( CONSTRAINT `budget_FK_1` FOREIGN KEY (`userFk`) REFERENCES `account`.`user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `budget_FK_2` FOREIGN KEY (`departmentFk`) REFERENCES `department` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `budget_FK_3` FOREIGN KEY (`supplierFk`) REFERENCES `supplier` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Master de presupuestos de project'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Master de presupuestos de project'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -27235,7 +27141,7 @@ CREATE TABLE `budgetDms` ( KEY `budgetDms_FK_1` (`dmsFk`), CONSTRAINT `budgetDms_FK` FOREIGN KEY (`budgetFk`) REFERENCES `budget` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `budgetDms_FK_1` FOREIGN KEY (`dmsFk`) REFERENCES `dms` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Gestion documental de budget'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Gestion documental de budget'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -27248,7 +27154,7 @@ DROP TABLE IF EXISTS `budgetInvoiceIn`; CREATE TABLE `budgetInvoiceIn` ( `id` int(11) NOT NULL AUTO_INCREMENT, `budgetFk` int(11) NOT NULL, - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created` timestamp NOT NULL DEFAULT current_timestamp(), `invoiceInFk` mediumint(8) unsigned NOT NULL, `amount` decimal(10,2) NOT NULL, PRIMARY KEY (`id`), @@ -27256,7 +27162,7 @@ CREATE TABLE `budgetInvoiceIn` ( KEY `budgetInvoiceIn_FK_1` (`invoiceInFk`), CONSTRAINT `budgetInvoiceIn_FK` FOREIGN KEY (`budgetFk`) REFERENCES `budget` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `budgetInvoiceIn_FK_1` FOREIGN KEY (`invoiceInFk`) REFERENCES `invoiceIn` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Facturas relativas al presupuesto'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Facturas relativas al presupuesto'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -27269,7 +27175,7 @@ DROP TABLE IF EXISTS `budgetNotes`; CREATE TABLE `budgetNotes` ( `id` int(11) NOT NULL AUTO_INCREMENT, `budgetFk` int(11) NOT NULL, - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created` timestamp NOT NULL DEFAULT current_timestamp(), `txt` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `userFk` int(10) unsigned DEFAULT NULL, PRIMARY KEY (`id`), @@ -27277,7 +27183,7 @@ CREATE TABLE `budgetNotes` ( KEY `budgetNotes_FK_2` (`userFk`), CONSTRAINT `budgetNotes_FK` FOREIGN KEY (`budgetFk`) REFERENCES `budget` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `budgetNotes_FK_2` FOREIGN KEY (`userFk`) REFERENCES `account`.`user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Historico de budget'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Historico de budget'; /*!40101 SET character_set_client = @saved_cs_client */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -27333,7 +27239,7 @@ CREATE TABLE `businessReasonEnd` ( `id` tinyint(3) NOT NULL AUTO_INCREMENT, `reason` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -27359,33 +27265,33 @@ DROP TABLE IF EXISTS `buy`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `buy` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `entryFk` int(11) NOT NULL DEFAULT '0', - `itemFk` int(11) NOT NULL DEFAULT '90', - `quantity` int(11) DEFAULT '0', - `dispatched` int(11) NOT NULL DEFAULT '0', - `buyingValue` decimal(10,3) DEFAULT '0.000', - `freightValue` decimal(10,3) DEFAULT '0.000', - `isIgnored` tinyint(1) NOT NULL DEFAULT '0', - `stickers` int(11) DEFAULT '0', - `packing` int(11) DEFAULT '0', - `grouping` smallint(5) unsigned NOT NULL DEFAULT '1', - `groupingMode` tinyint(4) NOT NULL DEFAULT '0' COMMENT '0=sin obligar 1=groping 2=packing', + `entryFk` int(11) NOT NULL DEFAULT 0, + `itemFk` int(11) NOT NULL DEFAULT 90, + `quantity` int(11) DEFAULT 0, + `dispatched` int(11) NOT NULL DEFAULT 0, + `buyingValue` decimal(10,3) DEFAULT 0.000, + `freightValue` decimal(10,3) DEFAULT 0.000, + `isIgnored` tinyint(1) NOT NULL DEFAULT 0, + `stickers` int(11) DEFAULT 0, + `packing` int(11) DEFAULT 0, + `grouping` smallint(5) unsigned NOT NULL DEFAULT 1, + `groupingMode` tinyint(4) NOT NULL DEFAULT 0 COMMENT '0=sin obligar 1=groping 2=packing', `containerFk` smallint(5) unsigned DEFAULT NULL, - `comissionValue` decimal(10,3) DEFAULT '0.000', - `packageValue` decimal(10,3) DEFAULT '0.000', + `comissionValue` decimal(10,3) DEFAULT 0.000, + `packageValue` decimal(10,3) DEFAULT 0.000, `location` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, `packageFk` varchar(10) COLLATE utf8_unicode_ci DEFAULT '--', - `price1` decimal(10,2) DEFAULT '0.00', - `price2` decimal(10,2) DEFAULT '0.00', - `price3` decimal(10,2) DEFAULT '0.00', - `minPrice` decimal(10,2) DEFAULT '0.00', + `price1` decimal(10,2) DEFAULT 0.00, + `price2` decimal(10,2) DEFAULT 0.00, + `price3` decimal(10,2) DEFAULT 0.00, + `minPrice` decimal(10,2) DEFAULT 0.00, `producer` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, - `printedStickers` int(11) DEFAULT '0', - `workerFk` int(11) DEFAULT '0', - `isChecked` tinyint(1) NOT NULL DEFAULT '0', - `isPickedOff` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Esta mercancia no va a la zona de picking.', - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - `__cm2` int(10) unsigned NOT NULL DEFAULT '0', + `printedStickers` int(11) DEFAULT 0, + `workerFk` int(11) DEFAULT 0, + `isChecked` tinyint(1) NOT NULL DEFAULT 0, + `isPickedOff` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'Esta mercancia no va a la zona de picking.', + `created` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), + `__cm2` int(10) unsigned NOT NULL DEFAULT 0, `ektFk` int(11) DEFAULT NULL, `weight` decimal(10,2) unsigned DEFAULT NULL, `deliveryFk` int(11) DEFAULT NULL, @@ -27626,7 +27532,7 @@ trig: BEGIN IF vIsBuyerToBeEmailed AND vBuyerFk != account.myUser_getId() AND - vLanded = CURDATE() THEN + vLanded = util.VN_CURDATE() THEN IF !(NEW.itemFk <=> OLD.itemFk) OR !(NEW.quantity <=> OLD.quantity) OR !(NEW.packing <=> OLD.packing) OR @@ -27706,7 +27612,7 @@ CREATE TABLE `buyMark` ( `id` int(11) NOT NULL, `comment` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `mark` tinyint(1) DEFAULT NULL, - `odbcDate` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + `odbcDate` timestamp NULL DEFAULT current_timestamp(), PRIMARY KEY (`id`), CONSTRAINT `Compres_mark_ibfk_1` FOREIGN KEY (`id`) REFERENCES `buy` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; @@ -27843,8 +27749,8 @@ DROP TABLE IF EXISTS `campaign`; CREATE TABLE `campaign` ( `id` int(11) NOT NULL AUTO_INCREMENT, `code` enum('mothersDay','allSaints','valentinesDay') COLLATE utf8_unicode_ci NOT NULL, - `dated` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, - `scopeDays` int(11) NOT NULL DEFAULT '15', + `dated` datetime NOT NULL DEFAULT current_timestamp(), + `scopeDays` int(11) NOT NULL DEFAULT 15, PRIMARY KEY (`id`), UNIQUE KEY `campaign_dated_uindex` (`dated`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; @@ -27862,7 +27768,7 @@ CREATE TABLE `category` ( `description` varchar(45) COLLATE utf8_unicode_ci NOT NULL, `nick` varchar(3) COLLATE utf8_unicode_ci NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -27875,12 +27781,12 @@ DROP TABLE IF EXISTS `chain`; CREATE TABLE `chain` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(45) COLLATE utf8_unicode_ci NOT NULL, - `rappel` decimal(5,2) NOT NULL DEFAULT '0.00', + `rappel` decimal(5,2) NOT NULL DEFAULT 0.00, `componentFk` int(11) DEFAULT NULL, PRIMARY KEY (`id`), KEY `chain_FK` (`componentFk`), CONSTRAINT `chain_FK` FOREIGN KEY (`componentFk`) REFERENCES `component` (`id`) ON DELETE SET NULL ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Grupos de clientes'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Grupos de clientes'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -27911,13 +27817,13 @@ CREATE TABLE `claim` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `ticketCreated` date NOT NULL, `claimDepartmentFk__` tinyint(3) unsigned DEFAULT NULL, - `claimStateFk` int(10) unsigned NOT NULL DEFAULT '1', - `observation` text COLLATE utf8_unicode_ci, + `claimStateFk` int(10) unsigned NOT NULL DEFAULT 1, + `observation` text COLLATE utf8_unicode_ci DEFAULT NULL, `clientFk` int(11) NOT NULL, `workerFk` int(11) NOT NULL, - `responsibility` int(1) unsigned NOT NULL DEFAULT '3', - `isChargedToMana` tinyint(1) NOT NULL DEFAULT '0', - `created` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + `responsibility` int(1) unsigned NOT NULL DEFAULT 3, + `isChargedToMana` tinyint(1) NOT NULL DEFAULT 0, + `created` timestamp NULL DEFAULT current_timestamp(), `ticketFk` int(11) DEFAULT NULL, `hasToPickUp` tinyint(1) NOT NULL, `packages` smallint(10) unsigned DEFAULT '0' COMMENT 'packages received by the client', @@ -27945,8 +27851,8 @@ CREATE TABLE `claimBeginning` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `claimFk` int(10) unsigned NOT NULL, `saleFk` int(11) DEFAULT NULL, - `claimComplaintFk__` int(10) unsigned NOT NULL DEFAULT '1', - `claimRequestFk__` int(1) unsigned NOT NULL DEFAULT '1', + `claimComplaintFk__` int(10) unsigned NOT NULL DEFAULT 1, + `claimRequestFk__` int(1) unsigned NOT NULL DEFAULT 1, `quantity` double DEFAULT NULL, PRIMARY KEY (`id`), KEY `Id_Movimiento` (`saleFk`), @@ -28025,12 +27931,12 @@ DROP TABLE IF EXISTS `claimDevelopment`; CREATE TABLE `claimDevelopment` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `claimFk` int(10) unsigned NOT NULL, - `claimResponsibleFk` int(10) unsigned NOT NULL DEFAULT '1', + `claimResponsibleFk` int(10) unsigned NOT NULL DEFAULT 1, `workerFk` int(10) unsigned DEFAULT NULL, - `claimReasonFk` int(10) unsigned NOT NULL DEFAULT '1', - `claimResultFk` int(10) unsigned NOT NULL DEFAULT '1', - `claimRedeliveryFk` tinyint(3) unsigned NOT NULL DEFAULT '1', - `claimDestinationFk` tinyint(3) unsigned NOT NULL DEFAULT '2', + `claimReasonFk` int(10) unsigned NOT NULL DEFAULT 1, + `claimResultFk` int(10) unsigned NOT NULL DEFAULT 1, + `claimRedeliveryFk` tinyint(3) unsigned NOT NULL DEFAULT 1, + `claimDestinationFk` tinyint(3) unsigned NOT NULL DEFAULT 2, PRIMARY KEY (`id`), KEY `cl_main_id` (`claimFk`), KEY `cl_res_id` (`claimResponsibleFk`), @@ -28077,9 +27983,9 @@ CREATE TABLE `claimEnd` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `saleFk` int(11) DEFAULT NULL, `claimFk` int(10) unsigned NOT NULL, - `workerFk` int(10) unsigned NOT NULL DEFAULT '20', + `workerFk` int(10) unsigned NOT NULL DEFAULT 20, `claimDestinationFk` tinyint(4) DEFAULT NULL, - `isGreuge` tinyint(4) NOT NULL DEFAULT '0', + `isGreuge` tinyint(4) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), KEY `cl_main_id` (`claimFk`), KEY `Id_Trabajador` (`workerFk`), @@ -28103,11 +28009,11 @@ CREATE TABLE `claimLog` ( `originFk` int(10) unsigned NOT NULL, `userFk` int(10) unsigned DEFAULT NULL, `action` set('insert','update','delete') COLLATE utf8_unicode_ci NOT NULL, - `creationDate` timestamp NULL DEFAULT CURRENT_TIMESTAMP, - `description` text CHARACTER SET utf8, + `creationDate` timestamp NULL DEFAULT current_timestamp(), + `description` text CHARACTER SET utf8 DEFAULT NULL, `changedModel` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, - `oldInstance` text COLLATE utf8_unicode_ci, - `newInstance` text COLLATE utf8_unicode_ci, + `oldInstance` text COLLATE utf8_unicode_ci DEFAULT NULL, + `newInstance` text COLLATE utf8_unicode_ci DEFAULT NULL, `changedModelId` int(11) DEFAULT NULL, `changedModelValue` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), @@ -28115,7 +28021,7 @@ CREATE TABLE `claimLog` ( KEY `userFk` (`userFk`), CONSTRAINT `claimOriginFk` FOREIGN KEY (`originFk`) REFERENCES `claim` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `claimUserFk` FOREIGN KEY (`userFk`) REFERENCES `account`.`user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -28126,35 +28032,17 @@ DROP TABLE IF EXISTS `claimRatio`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `claimRatio` ( - `clientFk` int(11) NOT NULL DEFAULT '0', + `clientFk` int(11) NOT NULL DEFAULT 0, `yearSale` decimal(10,2) DEFAULT NULL, `claimAmount` decimal(10,2) DEFAULT NULL, `claimingRate` decimal(5,2) DEFAULT NULL, `priceIncreasing` decimal(5,2) DEFAULT NULL, - `packingRate` decimal(5,2) NOT NULL DEFAULT '1.00', + `packingRate` decimal(5,2) NOT NULL DEFAULT 1.00, PRIMARY KEY (`clientFk`), CONSTRAINT `claimRatio_ibfk_1` FOREIGN KEY (`clientFk`) REFERENCES `client` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; --- --- Temporary table structure for view `claimRatio__` --- - -DROP TABLE IF EXISTS `claimRatio__`; -/*!50001 DROP VIEW IF EXISTS `claimRatio__`*/; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; -/*!50001 CREATE TABLE `claimRatio__` ( - `clientFk` tinyint NOT NULL, - `yearSale` tinyint NOT NULL, - `claimAmount` tinyint NOT NULL, - `claimingRate` tinyint NOT NULL, - `priceIncreasing` tinyint NOT NULL, - `packingRate` tinyint NOT NULL -) ENGINE=MyISAM */; -SET character_set_client = @saved_cs_client; - -- -- Table structure for table `claimReason` -- @@ -28165,7 +28053,7 @@ DROP TABLE IF EXISTS `claimReason`; CREATE TABLE `claimReason` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `description` varchar(45) COLLATE utf8_unicode_ci NOT NULL, - `isTired` tinyint(1) NOT NULL DEFAULT '0', + `isTired` tinyint(1) NOT NULL DEFAULT 0, PRIMARY KEY (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Motivos de las fallos'; /*!40101 SET character_set_client = @saved_cs_client */; @@ -28194,7 +28082,7 @@ DROP TABLE IF EXISTS `claimResponsible`; CREATE TABLE `claimResponsible` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `description` varchar(45) COLLATE utf8_unicode_ci NOT NULL, - `responsability` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'if=1 >sensib >culpa', + `responsability` tinyint(4) NOT NULL DEFAULT 0 COMMENT 'if=1 >sensib >culpa', PRIMARY KEY (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Responsables de las causas'; /*!40101 SET character_set_client = @saved_cs_client */; @@ -28243,66 +28131,66 @@ DROP TABLE IF EXISTS `client`; CREATE TABLE `client` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(50) COLLATE utf8_unicode_ci NOT NULL, - `discount` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT 'obsoleta (comprobar)', + `discount` tinyint(3) unsigned NOT NULL DEFAULT 0 COMMENT 'obsoleta (comprobar)', `defaultAddressFk` int(11) DEFAULT NULL, - `street` longtext COLLATE utf8_unicode_ci, + `street` longtext COLLATE utf8_unicode_ci DEFAULT NULL, `fi` varchar(14) COLLATE utf8_unicode_ci DEFAULT NULL, `phone` varchar(15) COLLATE utf8_unicode_ci DEFAULT NULL, `fax__` varchar(11) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'obsoleta (comprobar)', `email` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `cc` varchar(23) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'obsoleta (comprobar)', - `dueDay` smallint(6) NOT NULL DEFAULT '5', - `receipt__` int(11) DEFAULT '1' COMMENT 'obsoleta', - `isOfficial__` tinyint(1) NOT NULL DEFAULT '1' COMMENT 'obsoleta (comprobar)', - `isTaxDataChecked` tinyint(1) NOT NULL DEFAULT '0', + `dueDay` smallint(6) NOT NULL DEFAULT 5, + `receipt__` int(11) DEFAULT 1 COMMENT 'obsoleta', + `isOfficial__` tinyint(1) NOT NULL DEFAULT 1 COMMENT 'obsoleta (comprobar)', + `isTaxDataChecked` tinyint(1) NOT NULL DEFAULT 0, `mobile` varchar(15) COLLATE utf8_unicode_ci DEFAULT NULL, `accountingAccount` varchar(10) CHARACTER SET utf8 NOT NULL, - `isEqualizated` tinyint(1) NOT NULL DEFAULT '0', + `isEqualizated` tinyint(1) NOT NULL DEFAULT 0, `city` varchar(25) COLLATE utf8_unicode_ci DEFAULT NULL, `provinceFk` smallint(5) unsigned DEFAULT NULL, `postcode` varchar(8) COLLATE utf8_unicode_ci DEFAULT NULL, `socialName` varchar(60) COLLATE utf8_unicode_ci DEFAULT NULL, `contact` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, - `wholesaler__` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'obsoleta (comprobar)', - `isReExpedition__` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'obsoleta (comprobar)', - `hasToInvoice` tinyint(1) NOT NULL DEFAULT '1', - `notes` text COLLATE utf8_unicode_ci COMMENT 'obsoleta (comprobar)', + `wholesaler__` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'obsoleta (comprobar)', + `isReExpedition__` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'obsoleta (comprobar)', + `hasToInvoice` tinyint(1) NOT NULL DEFAULT 1, + `notes` text COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'obsoleta (comprobar)', `administrativeNotes__` text COLLATE utf8_unicode_ci NOT NULL COMMENT 'obsoleta (comprobar)', - `invoiceCopy__` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'obsoleta (comprobar)', - `hold__` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'obsoleta (comprobar)', - `isFreezed` tinyint(1) NOT NULL DEFAULT '0', + `invoiceCopy__` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'obsoleta (comprobar)', + `hold__` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'obsoleta (comprobar)', + `isFreezed` tinyint(1) NOT NULL DEFAULT 0, `salesPersonFk` int(10) unsigned DEFAULT NULL, - `credit` decimal(10,2) NOT NULL DEFAULT '0.00', + `credit` decimal(10,2) NOT NULL DEFAULT 0.00, `cyc` double DEFAULT NULL COMMENT 'obsoleta (comprobar)', - `countryFk` mediumint(8) unsigned NOT NULL DEFAULT '1', - `isActive` tinyint(1) NOT NULL DEFAULT '1', + `countryFk` mediumint(8) unsigned NOT NULL DEFAULT 1, + `isActive` tinyint(1) NOT NULL DEFAULT 1, `gestdocFk` int(11) DEFAULT NULL, - `quality` int(2) DEFAULT '11', - `payMethodFk` tinyint(3) unsigned NOT NULL DEFAULT '5', - `created` timestamp NULL DEFAULT CURRENT_TIMESTAMP, - `isToBeMailed` tinyint(1) NOT NULL DEFAULT '1', + `quality` int(2) DEFAULT 11, + `payMethodFk` tinyint(3) unsigned NOT NULL DEFAULT 5, + `created` timestamp NULL DEFAULT current_timestamp(), + `isToBeMailed` tinyint(1) NOT NULL DEFAULT 1, `contactChannelFk` smallint(6) DEFAULT NULL, - `isVies` tinyint(4) NOT NULL DEFAULT '0', - `splitHolland__` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'obsoleta (comprobar)', - `sepaFth__` tinyint(1) DEFAULT '0' COMMENT 'campo para recibir los escritos de los clientes para el sepaobsoleta (comprobar)', - `hasSepaVnl` tinyint(1) DEFAULT '0', - `coreFth__` tinyint(1) DEFAULT '0' COMMENT 'obsoleta (comprobar)', - `hasCoreVnl` tinyint(1) DEFAULT '0', + `isVies` tinyint(4) NOT NULL DEFAULT 0, + `splitHolland__` tinyint(4) NOT NULL DEFAULT 0 COMMENT 'obsoleta (comprobar)', + `sepaFth__` tinyint(1) DEFAULT 0 COMMENT 'campo para recibir los escritos de los clientes para el sepaobsoleta (comprobar)', + `hasSepaVnl` tinyint(1) DEFAULT 0, + `coreFth__` tinyint(1) DEFAULT 0 COMMENT 'obsoleta (comprobar)', + `hasCoreVnl` tinyint(1) DEFAULT 0, `riskCalculated` date NOT NULL, - `hasCoreVnh` tinyint(1) DEFAULT '0', - `isRelevant` tinyint(1) NOT NULL DEFAULT '1' COMMENT 'Define los clientes cuyas ventas hay que tener en cuenta en los calculos estadisticos.', - `clientTypeFk` int(11) NOT NULL DEFAULT '1', + `hasCoreVnh` tinyint(1) DEFAULT 0, + `isRelevant` tinyint(1) NOT NULL DEFAULT 1 COMMENT 'Define los clientes cuyas ventas hay que tener en cuenta en los calculos estadisticos.', + `clientTypeFk` int(11) NOT NULL DEFAULT 1, `postcodeOld__` int(11) unsigned DEFAULT NULL COMMENT 'obsoleta (comprobar)', `mailAddress` int(11) DEFAULT NULL, `codposOLD__` char(5) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'obsoleta (comprobar)', `creditInsurance` int(11) DEFAULT NULL, - `eypbc` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Email\\nYesterday\\nPurchases\\nBy\\nConsigna', - `hasToInvoiceByAddress` tinyint(1) DEFAULT '0', - `cplusTerIdNifFk__` int(11) NOT NULL DEFAULT '1' COMMENT 'OBSOLETO', - `isCreatedAsServed` tinyint(1) DEFAULT '0', - `hasInvoiceSimplified` tinyint(1) NOT NULL DEFAULT '0', + `eypbc` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'Email\\nYesterday\\nPurchases\\nBy\\nConsigna', + `hasToInvoiceByAddress` tinyint(1) DEFAULT 0, + `cplusTerIdNifFk__` int(11) NOT NULL DEFAULT 1 COMMENT 'OBSOLETO', + `isCreatedAsServed` tinyint(1) DEFAULT 0, + `hasInvoiceSimplified` tinyint(1) NOT NULL DEFAULT 0, `iban` varchar(45) CHARACTER SET utf8 DEFAULT NULL, - `hasLcr` tinyint(1) NOT NULL DEFAULT '0', + `hasLcr` tinyint(1) NOT NULL DEFAULT 0, `bankEntityFk` int(10) DEFAULT NULL, `typeFk` varchar(20) CHARACTER SET utf8 NOT NULL DEFAULT 'normal', `taxTypeSageFk` smallint(6) DEFAULT NULL COMMENT 'Tipo de Iva por defecto asociado al cliente en SAGE', @@ -28498,7 +28386,7 @@ CREATE TABLE `clientChain` ( KEY `clientChain_fk2_idx` (`chainFk`), CONSTRAINT `clientChain_fk1` FOREIGN KEY (`clientFk`) REFERENCES `client` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `clientChain_fk2` FOREIGN KEY (`chainFk`) REFERENCES `chain` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -28542,7 +28430,7 @@ CREATE TABLE `clientCredit` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `clientFk` int(11) NOT NULL, `amount` double unsigned NOT NULL, - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created` timestamp NOT NULL DEFAULT current_timestamp(), `workerFk` int(10) unsigned DEFAULT NULL, PRIMARY KEY (`id`), KEY `workers_fk_idx` (`workerFk`), @@ -28674,11 +28562,11 @@ CREATE TABLE `clientLog` ( `originFk` int(11) NOT NULL, `userFk` int(10) unsigned DEFAULT NULL, `action` set('insert','update','delete') COLLATE utf8_unicode_ci NOT NULL, - `creationDate` timestamp NULL DEFAULT CURRENT_TIMESTAMP, - `description` text CHARACTER SET utf8, + `creationDate` timestamp NULL DEFAULT current_timestamp(), + `description` text CHARACTER SET utf8 DEFAULT NULL, `changedModel` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, - `oldInstance` text COLLATE utf8_unicode_ci, - `newInstance` text COLLATE utf8_unicode_ci, + `oldInstance` text COLLATE utf8_unicode_ci DEFAULT NULL, + `newInstance` text COLLATE utf8_unicode_ci DEFAULT NULL, `changedModelId` int(11) DEFAULT NULL, `changedModelValue` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), @@ -28686,7 +28574,7 @@ CREATE TABLE `clientLog` ( KEY `userFk` (`userFk`), CONSTRAINT `clientLog_ibfk_1` FOREIGN KEY (`originFk`) REFERENCES `client` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `clientLog_ibfk_2` FOREIGN KEY (`userFk`) REFERENCES `account`.`user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -28713,7 +28601,7 @@ DROP TABLE IF EXISTS `clientManaCache`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `clientManaCache` ( `clientFk` int(11) NOT NULL, - `mana` decimal(10,0) NOT NULL DEFAULT '0', + `mana` decimal(10,0) NOT NULL DEFAULT 0, `dated` date NOT NULL, PRIMARY KEY (`clientFk`,`dated`), KEY `manaCustomerIdx1` (`dated`), @@ -28748,7 +28636,7 @@ CREATE TABLE `clientObservation` ( `clientFk` int(11) NOT NULL, `workerFk` int(10) unsigned DEFAULT NULL, `text` text COLLATE utf8_unicode_ci NOT NULL, - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created` timestamp NOT NULL DEFAULT current_timestamp(), PRIMARY KEY (`id`), KEY `Id_Trabajador` (`workerFk`), KEY `Id_Cliente` (`clientFk`), @@ -28811,7 +28699,7 @@ DROP TABLE IF EXISTS `clientPackagingGifts`; CREATE TABLE `clientPackagingGifts` ( `clientFk` int(11) NOT NULL, `giftFk` int(11) NOT NULL, - `added` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `added` timestamp NOT NULL DEFAULT current_timestamp(), PRIMARY KEY (`clientFk`,`giftFk`), KEY `clientPackagingGifts_FK_1` (`giftFk`), CONSTRAINT `clientPackagingGifts_FK` FOREIGN KEY (`clientFk`) REFERENCES `client` (`id`), @@ -28843,7 +28731,7 @@ DROP TABLE IF EXISTS `clientProtected`; CREATE TABLE `clientProtected` ( `clientFk` int(11) NOT NULL, `workerFk` int(10) unsigned NOT NULL, - `isValidated__` tinyint(1) NOT NULL DEFAULT '0', + `isValidated__` tinyint(1) NOT NULL DEFAULT 0, PRIMARY KEY (`clientFk`), KEY `clientProtected_fk2_idx` (`workerFk`), CONSTRAINT `clientProtected_fk1` FOREIGN KEY (`clientFk`) REFERENCES `client` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, @@ -28859,8 +28747,8 @@ DROP TABLE IF EXISTS `clientRisk`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `clientRisk` ( - `clientFk` int(11) NOT NULL DEFAULT '0', - `companyFk` smallint(6) unsigned NOT NULL DEFAULT '0', + `clientFk` int(11) NOT NULL DEFAULT 0, + `companyFk` smallint(6) unsigned NOT NULL DEFAULT 0, `amount` decimal(10,2) DEFAULT NULL, PRIMARY KEY (`clientFk`,`companyFk`), KEY `company_id` (`companyFk`), @@ -28869,21 +28757,6 @@ CREATE TABLE `clientRisk` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Saldo de apertura < 2015-01-01'; /*!40101 SET character_set_client = @saved_cs_client */; --- --- Temporary table structure for view `clientRisk__` --- - -DROP TABLE IF EXISTS `clientRisk__`; -/*!50001 DROP VIEW IF EXISTS `clientRisk__`*/; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; -/*!50001 CREATE TABLE `clientRisk__` ( - `clientFk` tinyint NOT NULL, - `companyFk` tinyint NOT NULL, - `amount` tinyint NOT NULL -) ENGINE=MyISAM */; -SET character_set_client = @saved_cs_client; - -- -- Table structure for table `clientSample` -- @@ -28895,7 +28768,7 @@ CREATE TABLE `clientSample` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `clientFk` int(10) unsigned NOT NULL, `typeFk` int(10) unsigned NOT NULL, - `created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created` datetime NOT NULL DEFAULT current_timestamp(), `workerFk` int(10) unsigned NOT NULL, `balance` float NOT NULL, `companyFk` smallint(5) unsigned DEFAULT NULL, @@ -28917,7 +28790,7 @@ CREATE TABLE `clientType` ( `id` int(11) NOT NULL AUTO_INCREMENT, `code` varchar(20) CHARACTER SET utf8 NOT NULL, `type` varchar(45) COLLATE utf8_unicode_ci NOT NULL, - `isCreatedAsServed` tinyint(1) DEFAULT '0', + `isCreatedAsServed` tinyint(1) DEFAULT 0, PRIMARY KEY (`id`), UNIQUE KEY `code_UNIQUE` (`code`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Establece categorias para poder agrupar las ventas'; @@ -28955,7 +28828,7 @@ CREATE TABLE `cmr` ( `senderInstruccions` varchar(255) COLLATE utf8_unicode_ci DEFAULT 'Flowers 4º C. Plants 14º C', `paymentInstruccions` varchar(255) COLLATE utf8_unicode_ci DEFAULT 'Carriage paid', `specialAgreements` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, - `created` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + `created` timestamp NULL DEFAULT current_timestamp(), `companyFk` smallint(5) unsigned DEFAULT NULL, `addressToFk` int(11) DEFAULT NULL, `addressFromFk` int(11) DEFAULT NULL, @@ -28974,7 +28847,7 @@ CREATE TABLE `cmr` ( CONSTRAINT `cmr_fk1` FOREIGN KEY (`ticketFk`) REFERENCES `ticket` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `cmr_fk2` FOREIGN KEY (`companyFk`) REFERENCES `company` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `cmr_fk3` FOREIGN KEY (`addressToFk`) REFERENCES `address` (`id`) ON DELETE SET NULL ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -29043,7 +28916,7 @@ CREATE TABLE `cmr_expeditionPallet` ( `id` int(11) NOT NULL AUTO_INCREMENT, `cmrFk` int(11) NOT NULL, `expeditionPalletFk` int(11) NOT NULL, - `scanned` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `scanned` timestamp NOT NULL DEFAULT current_timestamp(), PRIMARY KEY (`id`), KEY `cmr_expeditionPallet_fk1_idx` (`cmrFk`), KEY `cmr_expeditionPallet_fk2_idx` (`expeditionPalletFk`), @@ -29107,13 +28980,13 @@ DROP TABLE IF EXISTS `collection`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `collection` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created` timestamp NOT NULL DEFAULT current_timestamp(), `workerFk` int(10) unsigned DEFAULT NULL, `stateFk` tinyint(3) unsigned DEFAULT NULL, `itemPackingTypeFk` varchar(1) COLLATE utf8_unicode_ci DEFAULT NULL, - `saleTotalCount` int(11) NOT NULL DEFAULT '0', - `salePickedCount` int(11) NOT NULL DEFAULT '0', - `trainFk` int(11) NOT NULL DEFAULT '1', + `saleTotalCount` int(11) NOT NULL DEFAULT 0, + `salePickedCount` int(11) NOT NULL DEFAULT 0, + `trainFk` int(11) NOT NULL DEFAULT 1, PRIMARY KEY (`id`), KEY `ticketCollection_idx` (`workerFk`), KEY `collection_id2_idx` (`stateFk`), @@ -29183,13 +29056,13 @@ DROP TABLE IF EXISTS `collectionColors`; CREATE TABLE `collectionColors` ( `id` int(11) NOT NULL AUTO_INCREMENT, `code` varchar(20) COLLATE utf8_unicode_ci NOT NULL, - `shelve` int(11) NOT NULL DEFAULT '1', - `wagon` int(11) NOT NULL DEFAULT '1', - `trainFk` int(11) NOT NULL DEFAULT '1', + `shelve` int(11) NOT NULL DEFAULT 1, + `wagon` int(11) NOT NULL DEFAULT 1, + `trainFk` int(11) NOT NULL DEFAULT 1, PRIMARY KEY (`id`), KEY `collectionColors_FK` (`trainFk`), CONSTRAINT `collectionColors_FK` FOREIGN KEY (`trainFk`) REFERENCES `train` (`id`) ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Recoge los colores para las baldas de las colecciones'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Recoge los colores para las baldas de las colecciones'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -29264,18 +29137,18 @@ DROP TABLE IF EXISTS `collectionVolumetry`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `collectionVolumetry` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `level` int(10) unsigned NOT NULL DEFAULT '0', - `lines` int(10) unsigned NOT NULL DEFAULT '1', - `liters` int(10) unsigned NOT NULL DEFAULT '0', - `height` int(10) unsigned NOT NULL DEFAULT '20', + `level` int(10) unsigned NOT NULL DEFAULT 0, + `lines` int(10) unsigned NOT NULL DEFAULT 1, + `liters` int(10) unsigned NOT NULL DEFAULT 0, + `height` int(10) unsigned NOT NULL DEFAULT 20, `itemPackingTypeFk` varchar(1) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'H', - `trainFk` int(11) NOT NULL DEFAULT '1', + `trainFk` int(11) NOT NULL DEFAULT 1, PRIMARY KEY (`id`), KEY `collectionVolumetry_FK` (`itemPackingTypeFk`), KEY `collectionVolumetry_FK_1` (`trainFk`), CONSTRAINT `collectionVolumetry_FK` FOREIGN KEY (`itemPackingTypeFk`) REFERENCES `itemPackingType` (`code`) ON UPDATE CASCADE, CONSTRAINT `collectionVolumetry_FK_1` FOREIGN KEY (`trainFk`) REFERENCES `train` (`id`) ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -29286,7 +29159,7 @@ DROP TABLE IF EXISTS `commissionConfig`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `commissionConfig` ( - `rate` decimal(5,4) NOT NULL DEFAULT '0.0000', + `rate` decimal(5,4) NOT NULL DEFAULT 0.0000, `plusTeamAmount` int(11) DEFAULT NULL, `plusNewBornAmount` int(11) DEFAULT NULL, `plusSalesAmount` int(11) DEFAULT NULL, @@ -29316,22 +29189,22 @@ CREATE TABLE `company` ( `workerManagerFk` int(10) unsigned NOT NULL, `registered` date NOT NULL, `expired` date DEFAULT NULL, - `logo` longblob, - `isOfficial` tinyint(1) unsigned NOT NULL DEFAULT '1', - `hasCyc` tinyint(1) unsigned zerofill NOT NULL DEFAULT '0', + `logo` longblob DEFAULT NULL, + `isOfficial` tinyint(1) unsigned NOT NULL DEFAULT 1, + `hasCyc` tinyint(1) unsigned zerofill NOT NULL DEFAULT 0, `rgb` varchar(6) COLLATE utf8_unicode_ci NOT NULL, `email` varchar(30) COLLATE utf8_unicode_ci NOT NULL, - `stamp` blob, - `created` timestamp NOT NULL ON UPDATE CURRENT_TIMESTAMP, + `stamp` blob DEFAULT NULL, + `created` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE current_timestamp(), `clientFk` int(11) DEFAULT NULL, `sage200Company` int(2) DEFAULT NULL, `supplierAccountFk` mediumint(8) unsigned DEFAULT NULL, - `isDefaulter` tinyint(4) NOT NULL DEFAULT '0', - `companyGroupFk` int(11) NOT NULL DEFAULT '1' COMMENT 'usado para calcular los greuges ', + `isDefaulter` tinyint(4) NOT NULL DEFAULT 0, + `companyGroupFk` int(11) NOT NULL DEFAULT 1 COMMENT 'usado para calcular los greuges ', `companyCode` int(2) DEFAULT NULL COMMENT 'Campo para movConta', `companyCodeTest` int(2) DEFAULT NULL, - `footnotes` longtext COLLATE utf8_unicode_ci COMMENT 'pie de paginas en las facturas', - `phytosanitary` longtext COLLATE utf8_unicode_ci, + `footnotes` longtext COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'pie de paginas en las facturas', + `phytosanitary` longtext COLLATE utf8_unicode_ci DEFAULT NULL, `fhAdminNumber` int(11) DEFAULT NULL COMMENT 'número de cliente en FloraHolland', PRIMARY KEY (`id`), KEY `gerente_id` (`workerManagerFk`), @@ -29373,9 +29246,9 @@ CREATE TABLE `component` ( `typeFk` int(11) NOT NULL, `classRate` smallint(6) DEFAULT NULL, `tax` double DEFAULT NULL, - `isRenewable` tinyint(2) NOT NULL DEFAULT '1', + `isRenewable` tinyint(2) NOT NULL DEFAULT 1, `code` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, - `isRequired` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Son componentes imprescindibles en toda venta', + `isRequired` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'Son componentes imprescindibles en toda venta', PRIMARY KEY (`id`), KEY `series_componentes_idx` (`typeFk`), KEY `comp` (`classRate`), @@ -29383,25 +29256,6 @@ CREATE TABLE `component` ( ) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; --- --- Temporary table structure for view `componentRate__` --- - -DROP TABLE IF EXISTS `componentRate__`; -/*!50001 DROP VIEW IF EXISTS `componentRate__`*/; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; -/*!50001 CREATE TABLE `componentRate__` ( - `id` tinyint NOT NULL, - `name` tinyint NOT NULL, - `componentTypeRate` tinyint NOT NULL, - `classRate` tinyint NOT NULL, - `tax` tinyint NOT NULL, - `isRenewable` tinyint NOT NULL, - `code` tinyint NOT NULL -) ENGINE=MyISAM */; -SET character_set_client = @saved_cs_client; - -- -- Table structure for table `componentType` -- @@ -29412,64 +29266,14 @@ DROP TABLE IF EXISTS `componentType`; CREATE TABLE `componentType` ( `id` int(11) NOT NULL AUTO_INCREMENT, `type` varchar(45) COLLATE utf8_unicode_ci NOT NULL, - `isBase` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'Marca aquellas series que se utilizan para calcular el precio base de las ventas, a efectos estadisticos', - `isMargin` tinyint(4) NOT NULL DEFAULT '0', + `isBase` tinyint(4) NOT NULL DEFAULT 0 COMMENT 'Marca aquellas series que se utilizan para calcular el precio base de las ventas, a efectos estadisticos', + `isMargin` tinyint(4) NOT NULL DEFAULT 0, `code` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `Serie_UNIQUE` (`type`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Permite organizar de forma ordenada los distintos componentes'; /*!40101 SET character_set_client = @saved_cs_client */; --- --- Temporary table structure for view `componentTypeRate__` --- - -DROP TABLE IF EXISTS `componentTypeRate__`; -/*!50001 DROP VIEW IF EXISTS `componentTypeRate__`*/; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; -/*!50001 CREATE TABLE `componentTypeRate__` ( - `id` tinyint NOT NULL, - `type` tinyint NOT NULL, - `base` tinyint NOT NULL -) ENGINE=MyISAM */; -SET character_set_client = @saved_cs_client; - --- --- Temporary table structure for view `componentType__` --- - -DROP TABLE IF EXISTS `componentType__`; -/*!50001 DROP VIEW IF EXISTS `componentType__`*/; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; -/*!50001 CREATE TABLE `componentType__` ( - `id` tinyint NOT NULL, - `type` tinyint NOT NULL, - `isBase` tinyint NOT NULL, - `isMargin` tinyint NOT NULL -) ENGINE=MyISAM */; -SET character_set_client = @saved_cs_client; - --- --- Temporary table structure for view `component__` --- - -DROP TABLE IF EXISTS `component__`; -/*!50001 DROP VIEW IF EXISTS `component__`*/; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; -/*!50001 CREATE TABLE `component__` ( - `id` tinyint NOT NULL, - `name` tinyint NOT NULL, - `typeFk` tinyint NOT NULL, - `classRate` tinyint NOT NULL, - `tax` tinyint NOT NULL, - `isRenewable` tinyint NOT NULL, - `code` tinyint NOT NULL -) ENGINE=MyISAM */; -SET character_set_client = @saved_cs_client; - -- -- Table structure for table `confectionType` -- @@ -29481,7 +29285,7 @@ CREATE TABLE `confectionType` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `description` varchar(45) COLLATE utf8_unicode_ci NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -29494,49 +29298,49 @@ DROP TABLE IF EXISTS `config`; CREATE TABLE `config` ( `id` int(11) NOT NULL AUTO_INCREMENT, `ochoa` int(10) unsigned NOT NULL, - `invoiceOutFk` int(11) DEFAULT '0', - `bookFk` int(11) DEFAULT '0', - `serialAFk` int(11) DEFAULT '0', - `serialEFk` int(11) DEFAULT '0', - `serialRFk` int(11) DEFAULT '0', - `serialCFk` int(11) DEFAULT '0', + `invoiceOutFk` int(11) DEFAULT 0, + `bookFk` int(11) DEFAULT 0, + `serialAFk` int(11) DEFAULT 0, + `serialEFk` int(11) DEFAULT 0, + `serialRFk` int(11) DEFAULT 0, + `serialCFk` int(11) DEFAULT 0, `serialHFk` int(11) NOT NULL, - `serialPFk` int(11) DEFAULT '0', - `serialTFk` int(11) DEFAULT '0', + `serialPFk` int(11) DEFAULT 0, + `serialTFk` int(11) DEFAULT 0, `inventoried` datetime DEFAULT NULL, - `serialMFk` int(11) DEFAULT '0', - `itemLog` int(11) DEFAULT '0', + `serialMFk` int(11) DEFAULT 0, + `itemLog` int(11) DEFAULT 0, `weekGoal` int(11) DEFAULT NULL, `photosPath` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, - `cashBoxNumber` int(11) DEFAULT '0', + `cashBoxNumber` int(11) DEFAULT 0, `redCode` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, `TabletTime` datetime DEFAULT NULL, - `t0` int(11) NOT NULL DEFAULT '0', - `t1` int(11) NOT NULL DEFAULT '0', - `t2` int(11) NOT NULL DEFAULT '0', - `t3` int(11) NOT NULL DEFAULT '0', - `cc` double NOT NULL DEFAULT '0', - `palet` double NOT NULL DEFAULT '0', + `t0` int(11) NOT NULL DEFAULT 0, + `t1` int(11) NOT NULL DEFAULT 0, + `t2` int(11) NOT NULL DEFAULT 0, + `t3` int(11) NOT NULL DEFAULT 0, + `cc` double NOT NULL DEFAULT 0, + `palet` double NOT NULL DEFAULT 0, `campaign` datetime NOT NULL, `campaignLife` tinyint(3) unsigned NOT NULL, `truckDays` tinyint(3) unsigned NOT NULL, `transportCharges` double NOT NULL, `escanerPath` varchar(50) COLLATE utf8_unicode_ci NOT NULL, `printedTurn` int(4) DEFAULT NULL, - `truckLength` int(11) DEFAULT '24', + `truckLength` int(11) DEFAULT 24, `fuelConsumption` int(11) DEFAULT NULL, `petrol` decimal(10,1) DEFAULT NULL, `maintenance` decimal(10,1) DEFAULT NULL, `hourPrice` decimal(10,1) DEFAULT NULL, `meterPrice` decimal(10,1) DEFAULT NULL, `kmPrice` decimal(10,1) DEFAULT NULL, - `routeOption` int(11) DEFAULT '1', - `dbproduccion` tinyint(1) NOT NULL DEFAULT '1', + `routeOption` int(11) DEFAULT 1, + `dbproduccion` tinyint(1) NOT NULL DEFAULT 1, `mdbServer` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `fakeEmail` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, - `defaultersMaxAmount` int(10) DEFAULT '200' COMMENT 'maxima deuda permitida a partir de la cual se bloquea a un usuario', + `defaultersMaxAmount` int(10) DEFAULT 200 COMMENT 'maxima deuda permitida a partir de la cual se bloquea a un usuario', `ASIEN` bigint(20) DEFAULT NULL, - `dayStartingHour` int(11) NOT NULL DEFAULT '3' COMMENT 'Hora a la que empieza una nueva jornada de producción', + `dayStartingHour` int(11) NOT NULL DEFAULT 3 COMMENT 'Hora a la que empieza una nueva jornada de producción', PRIMARY KEY (`id`), KEY `fechainv_idx` (`inventoried`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; @@ -29584,7 +29388,7 @@ CREATE TABLE `contratos_subvencion_270619` ( `workerFk` int(10) unsigned NOT NULL, `cod_centroFk` int(11) NOT NULL, `CodContratoFk` int(11) NOT NULL, - `journey` decimal(5,2) NOT NULL DEFAULT '8.00', + `journey` decimal(5,2) NOT NULL DEFAULT 8.00, `name` varchar(50) COLLATE utf8_unicode_ci NOT NULL, `nif` varchar(12) COLLATE utf8_unicode_ci NOT NULL, PRIMARY KEY (`id`), @@ -29594,7 +29398,7 @@ CREATE TABLE `contratos_subvencion_270619` ( CONSTRAINT `contratos_subvencion_270619_fk1` FOREIGN KEY (`workerFk`) REFERENCES `worker` (`id`) ON UPDATE CASCADE, CONSTRAINT `contratos_subvencion_270619_fk2` FOREIGN KEY (`cod_centroFk`) REFERENCES `vn2008`.`payroll_centros` (`cod_centro`) ON UPDATE CASCADE, CONSTRAINT `contratos_subvencion_270619_fk3` FOREIGN KEY (`CodContratoFk`) REFERENCES `vn2008`.`payroll_contratos__` (`CodContrato`) ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Segun los informes de vida laboral aportados por la SS'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Segun los informes de vida laboral aportados por la SS'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -29607,20 +29411,20 @@ DROP TABLE IF EXISTS `conveyor`; CREATE TABLE `conveyor` ( `id` int(11) NOT NULL AUTO_INCREMENT, `typeFk` int(11) NOT NULL, - `stratum` int(11) NOT NULL DEFAULT '0', + `stratum` int(11) NOT NULL DEFAULT 0, `length` int(11) DEFAULT NULL, `width` int(11) DEFAULT NULL, `height` int(11) DEFAULT NULL, `x` int(11) DEFAULT NULL, `y` int(11) DEFAULT NULL, - `freeSpace` int(11) NOT NULL DEFAULT '0', - `isBusy` tinyint(1) NOT NULL DEFAULT '0', + `freeSpace` int(11) NOT NULL DEFAULT 0, + `isBusy` tinyint(1) NOT NULL DEFAULT 0, `tandem` int(11) DEFAULT NULL COMMENT 'agrupa conveyors para dividir las cajas por tipo en una misma ruta', `conveyorBuildingClassFk` int(11) NOT NULL, PRIMARY KEY (`id`), KEY `conveyor_fk1_idx` (`typeFk`), CONSTRAINT `conveyor_fk1` FOREIGN KEY (`typeFk`) REFERENCES `conveyorType` (`id`) ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -29633,10 +29437,10 @@ DROP TABLE IF EXISTS `conveyorBuildingClass`; CREATE TABLE `conveyorBuildingClass` ( `id` int(11) NOT NULL AUTO_INCREMENT, `description` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, - `priority` int(11) NOT NULL DEFAULT '0', + `priority` int(11) NOT NULL DEFAULT 0, `weightThreshold` int(11) NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Tipo de caja para el montaje de pallets'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Tipo de caja para el montaje de pallets'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -29654,7 +29458,7 @@ CREATE TABLE `conveyorConfig` ( `height` int(11) DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `itemName_UNIQUE` (`itemName`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -29667,20 +29471,20 @@ DROP TABLE IF EXISTS `conveyorExpedition`; CREATE TABLE `conveyorExpedition` ( `expeditionFk` int(11) NOT NULL, `conveyorFk` int(11) DEFAULT NULL, - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - `conveyorBuildingClassFk` int(11) NOT NULL DEFAULT '1', - `length` int(11) NOT NULL DEFAULT '1', - `width` int(11) NOT NULL DEFAULT '1', - `height` int(11) NOT NULL DEFAULT '1', - `x` int(11) NOT NULL DEFAULT '18100', - `y` int(11) NOT NULL DEFAULT '1', + `created` timestamp NOT NULL DEFAULT current_timestamp(), + `conveyorBuildingClassFk` int(11) NOT NULL DEFAULT 1, + `length` int(11) NOT NULL DEFAULT 1, + `width` int(11) NOT NULL DEFAULT 1, + `height` int(11) NOT NULL DEFAULT 1, + `x` int(11) NOT NULL DEFAULT 18100, + `y` int(11) NOT NULL DEFAULT 1, `routeFk` int(11) NOT NULL, - `isIn` tinyint(4) NOT NULL DEFAULT '0', + `isIn` tinyint(4) NOT NULL DEFAULT 0, `productionMinute` int(11) DEFAULT NULL, - `isOut` tinyint(4) NOT NULL DEFAULT '0', + `isOut` tinyint(4) NOT NULL DEFAULT 0, `truck` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `criterion` int(11) DEFAULT NULL, - `isHeavy` tinyint(1) NOT NULL DEFAULT '1', + `isHeavy` tinyint(1) NOT NULL DEFAULT 1, PRIMARY KEY (`expeditionFk`), KEY `conveyorExpedition_fk1_idx` (`conveyorFk`), KEY `conveyorExpedition_fk2_idx` (`conveyorBuildingClassFk`), @@ -29700,7 +29504,7 @@ CREATE TABLE `conveyorMode` ( `code` varchar(20) COLLATE utf8_unicode_ci NOT NULL, `saturacion` int(11) NOT NULL, `gap` int(11) NOT NULL, - `isActive` tinyint(4) NOT NULL DEFAULT '0', + `isActive` tinyint(4) NOT NULL DEFAULT 0, PRIMARY KEY (`code`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -29717,7 +29521,7 @@ CREATE TABLE `conveyorType` ( `description` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, `color` int(11) NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -29729,7 +29533,7 @@ DROP TABLE IF EXISTS `corridor`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `corridor` ( `code` varchar(1) COLLATE utf8_unicode_ci NOT NULL COMMENT 'letra que da nombre al pasillo', - `isAscendent` tinyint(1) NOT NULL DEFAULT '1' COMMENT 'TRUE cuando se prepara de menor a mayor, FALSE cuando es a la inversa', + `isAscendent` tinyint(1) NOT NULL DEFAULT 1 COMMENT 'TRUE cuando se prepara de menor a mayor, FALSE cuando es a la inversa', `prepOrder` int(10) unsigned NOT NULL COMMENT 'orden de preparacion de los pasillos', PRIMARY KEY (`code`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='establece el orden y sentido de preparacion de los pasillos del parking'; @@ -29745,13 +29549,13 @@ DROP TABLE IF EXISTS `country`; CREATE TABLE `country` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, `country` varchar(25) COLLATE utf8_unicode_ci NOT NULL, - `CEE` tinyint(1) NOT NULL DEFAULT '1', + `CEE` tinyint(1) NOT NULL DEFAULT 1, `code` varchar(2) COLLATE utf8_unicode_ci DEFAULT NULL, - `currencyFk` tinyint(3) unsigned NOT NULL DEFAULT '1', + `currencyFk` tinyint(3) unsigned NOT NULL DEFAULT 1, `politicalCountryFk` mediumint(8) unsigned NOT NULL COMMENT 'Pais Real(apaño por culpa del España Exento)', `geoFk` int(11) DEFAULT NULL, - `hasDailyInvoice` tinyint(4) NOT NULL DEFAULT '0', - `isUeeMember` tinyint(4) NOT NULL DEFAULT '0', + `hasDailyInvoice` tinyint(4) NOT NULL DEFAULT 0, + `isUeeMember` tinyint(4) NOT NULL DEFAULT 0, `ibanLength` tinyint(4) DEFAULT NULL, `continentFk` tinyint(4) DEFAULT NULL, `a3Code` int(11) DEFAULT NULL COMMENT 'Código país para a3', @@ -29896,7 +29700,7 @@ CREATE TABLE `cplusCorrectingType` ( `id` int(11) NOT NULL AUTO_INCREMENT, `description` varchar(45) COLLATE utf8_unicode_ci NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -30067,7 +29871,7 @@ CREATE TABLE `creditInsurance` ( `id` int(11) NOT NULL AUTO_INCREMENT, `creditClassification` int(11) DEFAULT NULL, `credit` int(11) DEFAULT NULL, - `creationDate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `creationDate` timestamp NOT NULL DEFAULT current_timestamp(), `grade` tinyint(1) DEFAULT NULL, PRIMARY KEY (`id`), KEY `CreditInsurance_Fk1_idx` (`creditClassification`), @@ -30109,7 +29913,7 @@ CREATE TABLE `currency` ( `id` tinyint(3) unsigned NOT NULL, `code` varchar(3) COLLATE utf8_unicode_ci NOT NULL, `name` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, - `ratio` double NOT NULL DEFAULT '1', + `ratio` double NOT NULL DEFAULT 1, PRIMARY KEY (`id`), UNIQUE KEY `Moneda_UNIQUE` (`code`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; @@ -30177,7 +29981,7 @@ DROP TABLE IF EXISTS `delivery`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `delivery` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created` timestamp NOT NULL DEFAULT current_timestamp(), `longitude` decimal(11,7) DEFAULT NULL, `latitude` decimal(11,7) DEFAULT NULL, `dated` datetime DEFAULT NULL, @@ -30185,7 +29989,7 @@ CREATE TABLE `delivery` ( PRIMARY KEY (`id`), KEY `delivery_FK` (`addressFk`), CONSTRAINT `delivery_FK` FOREIGN KEY (`addressFk`) REFERENCES `address` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Informa de los datos geográficos y temporales de las entregas de los repartidores'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Informa de los datos geográficos y temporales de las entregas de los repartidores'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -30246,7 +30050,7 @@ CREATE TABLE `delivery_zip` ( KEY `postal_code_idx` (`postal_code`), KEY `admin_name3_idx` (`admin_name3`), KEY `admin_name2_idx` (`admin_name2`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -30267,14 +30071,14 @@ CREATE TABLE `department` ( `bossFk__` int(11) DEFAULT NULL, `x__` int(11) DEFAULT NULL, `y__` int(11) DEFAULT NULL, - `isProduction` tinyint(4) NOT NULL DEFAULT '0', - `isSelected` tinyint(1) NOT NULL DEFAULT '0', - `depth` int(11) NOT NULL DEFAULT '0', - `sons` decimal(10,0) NOT NULL DEFAULT '0', - `parentFk` int(10) unsigned DEFAULT '1', + `isProduction` tinyint(4) NOT NULL DEFAULT 0, + `isSelected` tinyint(1) NOT NULL DEFAULT 0, + `depth` int(11) NOT NULL DEFAULT 0, + `sons` decimal(10,0) NOT NULL DEFAULT 0, + `parentFk` int(10) unsigned DEFAULT 1, `path` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `chatName` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, - `isTeleworking` tinyint(1) DEFAULT '0', + `isTeleworking` tinyint(1) DEFAULT 0, `notificationEmail` varchar(150) COLLATE utf8_unicode_ci DEFAULT NULL, `hasToRefill` tinyint(1) DEFAULT '0' COMMENT 'Rellenar días sin fichadas presenciales', `hasToSendMail` tinyint(1) DEFAULT '0' COMMENT 'Para el envio de mail en el procedimiento workerTimeControl_sendMail()', @@ -30410,7 +30214,7 @@ CREATE TABLE `department_recalc` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `isChanged` tinyint(4) NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -30442,11 +30246,11 @@ CREATE TABLE `deviceLog` ( `id` int(11) NOT NULL AUTO_INCREMENT, `android_id` varchar(100) COLLATE utf8_unicode_ci NOT NULL, `userFk` int(11) DEFAULT NULL, - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created` timestamp NOT NULL DEFAULT current_timestamp(), `nameApp` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, `versionApp` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -30463,7 +30267,7 @@ CREATE TABLE `deviceProduction` ( `macWifi` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, `serialNumber` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, `departmentFk` int(11) DEFAULT NULL, - `isOutOfService` tinyint(1) NOT NULL DEFAULT '0' COMMENT '0: Ok - 1: No disponible - 2: Sat', + `isOutOfService` tinyint(1) NOT NULL DEFAULT 0 COMMENT '0: Ok - 1: No disponible - 2: Sat', `android_id` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, `purchased` date NOT NULL DEFAULT '1900-01-01' COMMENT 'Fecha de compra', PRIMARY KEY (`id`), @@ -30474,7 +30278,7 @@ CREATE TABLE `deviceProduction` ( KEY `departmentFgn` (`departmentFk`), CONSTRAINT `departmentFgn` FOREIGN KEY (`departmentFk`) REFERENCES `department` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `deviceProductionModelsFgn` FOREIGN KEY (`modelFk`) REFERENCES `deviceProductionModels` (`code`) ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -30486,10 +30290,10 @@ DROP TABLE IF EXISTS `deviceProductionConfig`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `deviceProductionConfig` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `isAllUsersallowed` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Permite que cualquier usuario pueda loguearse', - `isTractorHuntingMode` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Habilita el modo cazador para usuarios que no se han logeado un tractor para sacar', + `isAllUsersallowed` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'Permite que cualquier usuario pueda loguearse', + `isTractorHuntingMode` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'Habilita el modo cazador para usuarios que no se han logeado un tractor para sacar', PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -30558,7 +30362,7 @@ CREATE TABLE `disabilityGrade` ( `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Grados de discapacidad Modelo 145 IRPF', `description` varchar(45) COLLATE utf8_unicode_ci NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -30570,17 +30374,17 @@ DROP TABLE IF EXISTS `dms`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `dms` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `dmsTypeFk` int(11) NOT NULL DEFAULT '1', + `dmsTypeFk` int(11) NOT NULL DEFAULT 1, `reference` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, `description` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL, - `companyFk` smallint(5) unsigned NOT NULL DEFAULT '442', + `companyFk` smallint(5) unsigned NOT NULL DEFAULT 442, `hardCopyNumber` mediumint(8) unsigned DEFAULT NULL, `contentType` varchar(150) COLLATE utf8_unicode_ci DEFAULT NULL, `file` varchar(30) COLLATE utf8_unicode_ci DEFAULT NULL, - `hasFile` tinyint(4) NOT NULL DEFAULT '0', + `hasFile` tinyint(4) NOT NULL DEFAULT 0, `workerFk` int(10) unsigned DEFAULT NULL, - `created` timestamp NULL DEFAULT CURRENT_TIMESTAMP, - `warehouseFk` smallint(5) unsigned DEFAULT '60', + `created` timestamp NULL DEFAULT current_timestamp(), + `warehouseFk` smallint(5) unsigned DEFAULT 60, PRIMARY KEY (`id`), UNIQUE KEY `emp_id` (`companyFk`,`hardCopyNumber`,`warehouseFk`), UNIQUE KEY `dms_hardCopyNumber_IDX` (`hardCopyNumber`,`warehouseFk`) USING BTREE, @@ -30683,12 +30487,12 @@ DROP TABLE IF EXISTS `dmsRecover`; CREATE TABLE `dmsRecover` ( `id` int(11) NOT NULL AUTO_INCREMENT, `ticketFk` int(11) DEFAULT NULL, - `sign` text COLLATE utf8_unicode_ci, - `created` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + `sign` text COLLATE utf8_unicode_ci DEFAULT NULL, + `created` timestamp NULL DEFAULT current_timestamp(), PRIMARY KEY (`id`), KEY `ticketFk_idx` (`ticketFk`), CONSTRAINT `ticketFk` FOREIGN KEY (`ticketFk`) REFERENCES `ticket` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -30776,7 +30580,7 @@ CREATE TABLE `dua` ( `bookEntried` date DEFAULT NULL, `gestdocFk` int(11) DEFAULT NULL, `customsValue` decimal(10,2) DEFAULT NULL, - `companyFk` smallint(5) unsigned NOT NULL DEFAULT '442', + `companyFk` smallint(5) unsigned NOT NULL DEFAULT 442, `ASIEN` double DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `code_UNIQUE` (`code`), @@ -30821,13 +30625,13 @@ CREATE TABLE `duaIntrastat` ( `id` int(11) NOT NULL AUTO_INCREMENT, `duaFk` int(11) NOT NULL, `intrastatFk` int(8) unsigned NOT NULL, - `amount` decimal(10,2) NOT NULL DEFAULT '0.00', + `amount` decimal(10,2) NOT NULL DEFAULT 0.00, PRIMARY KEY (`id`), KEY `duaIntrastat_fk1_idx` (`intrastatFk`), KEY `duaIntrastat_fk2_idx` (`duaFk`), CONSTRAINT `duaIntrastat_fk1` FOREIGN KEY (`intrastatFk`) REFERENCES `intrastat` (`id`) ON UPDATE CASCADE, CONSTRAINT `duaIntrastat_fk2` FOREIGN KEY (`duaFk`) REFERENCES `dua` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -30872,7 +30676,7 @@ CREATE TABLE `duaTax` ( CONSTRAINT `duaTax_fk1` FOREIGN KEY (`duaFk`) REFERENCES `dua` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `duaTax_fk2` FOREIGN KEY (`supplierFk`) REFERENCES `supplier` (`id`) ON UPDATE CASCADE, CONSTRAINT `duaTax_fk3` FOREIGN KEY (`taxClassFk`) REFERENCES `taxClass` (`id`) ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -30989,7 +30793,7 @@ CREATE TABLE `ektEntryAssign` ( UNIQUE KEY `ektEntryAssign_ix1` (`kop`,`sub`,`pro`), KEY `ektEntryAssign_FK` (`addressFk`), CONSTRAINT `ektEntryAssign_FK` FOREIGN KEY (`addressFk`) REFERENCES `address` (`id`) ON DELETE SET NULL ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='define las condiciones para asignar entradas a los ekt'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='define las condiciones para asignar entradas a los ekt'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -31020,7 +30824,7 @@ CREATE TABLE `emergencyMedia` ( `name` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, `value` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'Table to save all emergency phones', PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -31063,24 +30867,24 @@ DROP TABLE IF EXISTS `entry`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `entry` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `supplierFk` int(11) NOT NULL DEFAULT '644', + `supplierFk` int(11) NOT NULL DEFAULT 644, `dated` datetime NOT NULL, `ref` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, - `isBooked` tinyint(1) NOT NULL DEFAULT '0', - `isInventory` tinyint(1) NOT NULL DEFAULT '0', - `notes` longtext COLLATE utf8_unicode_ci, - `isConfirmed` tinyint(1) NOT NULL DEFAULT '0', - `isOrdered` tinyint(1) NOT NULL DEFAULT '0', - `isRaid` tinyint(1) NOT NULL DEFAULT '0', - `commission` float DEFAULT '0', - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `isBooked` tinyint(1) NOT NULL DEFAULT 0, + `isInventory` tinyint(1) NOT NULL DEFAULT 0, + `notes` longtext COLLATE utf8_unicode_ci DEFAULT NULL, + `isConfirmed` tinyint(1) NOT NULL DEFAULT 0, + `isOrdered` tinyint(1) NOT NULL DEFAULT 0, + `isRaid` tinyint(1) NOT NULL DEFAULT 0, + `commission` float DEFAULT 0, + `created` timestamp NOT NULL DEFAULT current_timestamp(), `evaNotes` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, `travelFk` int(11) unsigned DEFAULT NULL, - `currencyFk` tinyint(3) unsigned DEFAULT '1', - `companyFk` smallint(5) unsigned NOT NULL DEFAULT '442', + `currencyFk` tinyint(3) unsigned DEFAULT 1, + `companyFk` smallint(5) unsigned NOT NULL DEFAULT 442, `gestDocFk` int(11) DEFAULT NULL, `invoiceInFk` mediumint(8) unsigned DEFAULT NULL, - `isBlocked` tinyint(4) NOT NULL DEFAULT '0', + `isBlocked` tinyint(4) NOT NULL DEFAULT 0, `loadPriority` int(11) DEFAULT NULL, `kop` int(11) DEFAULT NULL, `sub` mediumint(8) unsigned DEFAULT NULL, @@ -31325,11 +31129,11 @@ CREATE TABLE `entryLog` ( `originFk` int(11) NOT NULL, `userFk` int(10) unsigned NOT NULL, `action` set('insert','update','delete') COLLATE utf8_unicode_ci NOT NULL, - `creationDate` timestamp NULL DEFAULT CURRENT_TIMESTAMP, - `description` text CHARACTER SET utf8, + `creationDate` timestamp NULL DEFAULT current_timestamp(), + `description` text CHARACTER SET utf8 DEFAULT NULL, `changedModel` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, - `oldInstance` text COLLATE utf8_unicode_ci, - `newInstance` text COLLATE utf8_unicode_ci, + `oldInstance` text COLLATE utf8_unicode_ci DEFAULT NULL, + `newInstance` text COLLATE utf8_unicode_ci DEFAULT NULL, `changedModelId` int(11) DEFAULT NULL, `changedModelValue` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), @@ -31337,7 +31141,7 @@ CREATE TABLE `entryLog` ( KEY `entryLog_ibfk_2` (`userFk`), CONSTRAINT `entryLog_ibfk_1` FOREIGN KEY (`originFk`) REFERENCES `entry` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `entryLog_ibfk_2` FOREIGN KEY (`userFk`) REFERENCES `account`.`user` (`id`) ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -31351,13 +31155,13 @@ CREATE TABLE `entryObservation` ( `id` int(11) NOT NULL AUTO_INCREMENT, `entryFk` int(11) NOT NULL, `observationTypeFk` tinyint(3) unsigned DEFAULT NULL, - `description` text COLLATE utf8_unicode_ci, + `description` text COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `entryFk_observationTypeFk_UNIQUE` (`entryFk`,`observationTypeFk`), KEY `observationType_id_observationTypeFk` (`observationTypeFk`), CONSTRAINT `entry_id_entryFk` FOREIGN KEY (`entryFk`) REFERENCES `entry` (`id`), CONSTRAINT `observationType_id_observationTypeFk` FOREIGN KEY (`observationTypeFk`) REFERENCES `observationType` (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -31442,7 +31246,7 @@ CREATE TABLE `envialiaCity` ( PRIMARY KEY (`id`), KEY `agencyFk` (`agencyFk`), KEY `postalCode` (`postalCode`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -31479,7 +31283,7 @@ CREATE TABLE `envialiaConfig` ( `endRange` bigint(25) DEFAULT NULL COMMENT 'limite del rango que nos proporciona enviaría', `cargoAgency` varchar(25) COLLATE utf8_unicode_ci DEFAULT '004666' COMMENT 'numero de verdnatura dado por enviaría', `actualNumber` bigint(25) DEFAULT NULL COMMENT 'Numero actual de etiquetas imprimidas , comprimido entre startRange y endRange, ', - `isAlreadyNotified` int(1) NOT NULL DEFAULT '0' COMMENT 'Booleano para que el evento vn.envialiaRangeChecker compruebe si se a enviado una notificación\n', + `isAlreadyNotified` int(1) NOT NULL DEFAULT 0 COMMENT 'Booleano para que el evento vn.envialiaRangeChecker compruebe si se a enviado una notificación\n', `notificationThrehold` int(11) DEFAULT NULL COMMENT 'Umbral para avisar a enviaría de reseetar el startRange y endRange\nSe avisara a enviaría si el umbral + el actualNumber es superior a endRange\n', PRIMARY KEY (`serviceType`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; @@ -31498,7 +31302,7 @@ CREATE TABLE `errorLogApp` ( `date` datetime DEFAULT NULL, `workerFk` int(11) DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Guarda un registro de errores e la app de almacén'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Guarda un registro de errores e la app de almacén'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -31523,7 +31327,7 @@ CREATE TABLE `errorProduction` ( `hourWorked` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `dated` date DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -31546,7 +31350,7 @@ CREATE TABLE `errorProduction__` ( `month` int(11) DEFAULT NULL, `year` int(11) DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -31561,7 +31365,7 @@ CREATE TABLE `erte` ( `workerFk` int(11) NOT NULL, `started` date DEFAULT NULL, `ended` date DEFAULT NULL, - `reduction` int(3) NOT NULL DEFAULT '1', + `reduction` int(3) NOT NULL DEFAULT 1, `monday` tinyint(1) DEFAULT NULL, `tuesday` tinyint(1) DEFAULT NULL, `wednesday` tinyint(1) DEFAULT NULL, @@ -31570,7 +31374,7 @@ CREATE TABLE `erte` ( `saturday` tinyint(1) DEFAULT NULL, `sunday` tinyint(1) DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -31588,21 +31392,6 @@ SET character_set_client = utf8; ) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; --- --- Temporary table structure for view `exchangeInsuranceIn` --- - -DROP TABLE IF EXISTS `exchangeInsuranceIn`; -/*!50001 DROP VIEW IF EXISTS `exchangeInsuranceIn`*/; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; -/*!50001 CREATE TABLE `exchangeInsuranceIn` ( - `dated` tinyint NOT NULL, - `amount` tinyint NOT NULL, - `rate` tinyint NOT NULL -) ENGINE=MyISAM */; -SET character_set_client = @saved_cs_client; - -- -- Temporary table structure for view `exchangeInsuranceOut` -- @@ -31618,25 +31407,6 @@ SET character_set_client = utf8; ) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; --- --- Temporary table structure for view `exchangeReportSourcePrevious` --- - -DROP TABLE IF EXISTS `exchangeReportSourcePrevious`; -/*!50001 DROP VIEW IF EXISTS `exchangeReportSourcePrevious`*/; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; -/*!50001 CREATE TABLE `exchangeReportSourcePrevious` ( - `dated` tinyint NOT NULL, - `amountIn` tinyint NOT NULL, - `rateIn` tinyint NOT NULL, - `amountOut` tinyint NOT NULL, - `rateOut` tinyint NOT NULL, - `amountEntry` tinyint NOT NULL, - `rateEntry` tinyint NOT NULL -) ENGINE=MyISAM */; -SET character_set_client = @saved_cs_client; - -- -- Table structure for table `excuse` -- @@ -31647,9 +31417,9 @@ DROP TABLE IF EXISTS `excuse`; CREATE TABLE `excuse` ( `id` int(11) NOT NULL AUTO_INCREMENT, `txt` varchar(255) CHARACTER SET latin1 NOT NULL, - `date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, + `date` datetime NOT NULL DEFAULT current_timestamp(), PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -31663,13 +31433,13 @@ CREATE TABLE `expedition` ( `id` int(11) NOT NULL AUTO_INCREMENT, `agencyModeFk` int(11) NOT NULL, `ticketFk` int(10) NOT NULL, - `isBox` int(11) DEFAULT '1' COMMENT 'Este campo realmente en un campo itemFk, haciendo referencia al artículo que nos va a facturar el proveedor de transporte.\nSe debería llamar freightItemFk', - `created` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + `isBox` int(11) DEFAULT 1 COMMENT 'Este campo realmente en un campo itemFk, haciendo referencia al artículo que nos va a facturar el proveedor de transporte.\nSe debería llamar freightItemFk', + `created` timestamp NULL DEFAULT current_timestamp(), `isRefund` bit(1) DEFAULT b'0', `isPickUp` bit(1) DEFAULT b'0', `itemFk` int(11) DEFAULT NULL COMMENT 'Este campo hace referencia al artículo que habria que facturar si las cajas no fueran incluidos.\\nSe debería llamar packageItemFk', `counter` smallint(5) unsigned NOT NULL, - `checked` tinyint(4) NOT NULL DEFAULT '0', + `checked` tinyint(4) NOT NULL DEFAULT 0, `workerFk` int(10) unsigned DEFAULT NULL, `externalId` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `packagingFk` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, @@ -31840,9 +31610,9 @@ DROP TABLE IF EXISTS `expeditionPallet`; CREATE TABLE `expeditionPallet` ( `id` int(11) NOT NULL AUTO_INCREMENT, `truckFk` int(11) NOT NULL, - `built` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, + `built` datetime NOT NULL DEFAULT current_timestamp(), `position` int(11) DEFAULT NULL, - `isPrint` tinyint(4) NOT NULL DEFAULT '2', + `isPrint` tinyint(4) NOT NULL DEFAULT 2, PRIMARY KEY (`id`), KEY `expeditionPallet_fk1_idx` (`truckFk`), CONSTRAINT `expeditionPallet_fk1` FOREIGN KEY (`truckFk`) REFERENCES `expeditionTruck` (`id`) ON DELETE CASCADE ON UPDATE CASCADE @@ -31877,26 +31647,6 @@ DELIMITER ; /*!50003 SET character_set_results = @saved_cs_results */ ; /*!50003 SET collation_connection = @saved_col_connection */ ; --- --- Temporary table structure for view `expeditionPallet_Print` --- - -DROP TABLE IF EXISTS `expeditionPallet_Print`; -/*!50001 DROP VIEW IF EXISTS `expeditionPallet_Print`*/; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; -/*!50001 CREATE TABLE `expeditionPallet_Print` ( - `truck` tinyint NOT NULL, - `routeFk` tinyint NOT NULL, - `zone` tinyint NOT NULL, - `eti` tinyint NOT NULL, - `palletFk` tinyint NOT NULL, - `isMatch` tinyint NOT NULL, - `warehouseFk` tinyint NOT NULL, - `nombreDia` tinyint NOT NULL -) ENGINE=MyISAM */; -SET character_set_client = @saved_cs_client; - -- -- Temporary table structure for view `expeditionRoute_Monitor` -- @@ -31943,7 +31693,7 @@ DROP TABLE IF EXISTS `expeditionScan`; CREATE TABLE `expeditionScan` ( `id` int(11) NOT NULL AUTO_INCREMENT, `expeditionFk` int(11) NOT NULL, - `scanned` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, + `scanned` datetime NOT NULL DEFAULT current_timestamp(), `palletFk` int(11) NOT NULL, `workerFk` int(10) unsigned DEFAULT NULL, PRIMARY KEY (`id`), @@ -32009,7 +31759,7 @@ DROP TABLE IF EXISTS `expeditionState`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `expeditionState` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created` timestamp NOT NULL DEFAULT current_timestamp(), `expeditionFk` int(11) NOT NULL, `typeFk` int(11) NOT NULL, `userFk` int(11) DEFAULT NULL, @@ -32018,7 +31768,7 @@ CREATE TABLE `expeditionState` ( KEY `expeditionState_FK_1` (`typeFk`), CONSTRAINT `expeditionState_FK` FOREIGN KEY (`expeditionFk`) REFERENCES `expedition` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `expeditionState_FK_1` FOREIGN KEY (`typeFk`) REFERENCES `expeditionStateType` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Historico de estados de las expediciones'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Historico de estados de las expediciones'; /*!40101 SET character_set_client = @saved_cs_client */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -32079,7 +31829,7 @@ CREATE TABLE `expeditionStateType` ( `description` varchar(100) COLLATE utf8_unicode_ci NOT NULL, `code` varchar(100) COLLATE utf8_unicode_ci NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Posibles estados de una expedición'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Posibles estados de una expedición'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -32306,9 +32056,9 @@ CREATE TABLE `expence` ( `id` varchar(10) NOT NULL, `taxTypeFk` tinyint(4) NOT NULL, `name` varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL, - `isConbase` tinyint(4) NOT NULL DEFAULT '1', - `isWithheld` tinyint(4) NOT NULL DEFAULT '0', - `isForSale` tinyint(4) NOT NULL DEFAULT '0', + `isConbase` tinyint(4) NOT NULL DEFAULT 1, + `isWithheld` tinyint(4) NOT NULL DEFAULT 0, + `isForSale` tinyint(4) NOT NULL DEFAULT 0, PRIMARY KEY (`id`,`taxTypeFk`), KEY `iva_tipo_id` (`taxTypeFk`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; @@ -32360,7 +32110,7 @@ CREATE TABLE `floramondoConfig` ( `warehouseOutFk__` smallint(6) unsigned DEFAULT NULL, `agencyModeFk__` int(11) DEFAULT NULL, `MaxLatestDeliveryHour` int(11) DEFAULT NULL, - `MaxLatestOrderHour` int(11) DEFAULT '12' COMMENT 'Hora máxima para aceptar pedidos hoy', + `MaxLatestOrderHour` int(11) DEFAULT 12 COMMENT 'Hora máxima para aceptar pedidos hoy', `LastUpdated` datetime DEFAULT NULL, `itemMaxSize` int(11) DEFAULT NULL COMMENT 'tamaño maximo de los articulos a mostrar', PRIMARY KEY (`id`), @@ -32370,7 +32120,7 @@ CREATE TABLE `floramondoConfig` ( CONSTRAINT `floramondoConfigAgencyModeFk` FOREIGN KEY (`agencyModeFk__`) REFERENCES `agencyMode` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `floramondoConfigWarehouseInFk` FOREIGN KEY (`warehouseInFk`) REFERENCES `warehouse` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `floramondoConfigWarehouseOutFk` FOREIGN KEY (`warehouseOutFk__`) REFERENCES `warehouse` (`id`) ON DELETE SET NULL ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -32402,7 +32152,7 @@ DROP TABLE IF EXISTS `floramondoNotOfferDay__`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `floramondoNotOfferDay__` ( `dated` date NOT NULL, - `warehouseFk` int(11) NOT NULL DEFAULT '60', + `warehouseFk` int(11) NOT NULL DEFAULT 60, PRIMARY KEY (`dated`,`warehouseFk`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='no muestra oferta en floramondo para ese dia y almacen'; /*!40101 SET character_set_client = @saved_cs_client */; @@ -32420,7 +32170,7 @@ CREATE TABLE `fuelType` ( `code` varchar(45) COLLATE utf8_unicode_ci NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `code_UNIQUE` (`code`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -32435,7 +32185,7 @@ CREATE TABLE `gateArea` ( `name` varchar(45) COLLATE utf8_unicode_ci NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `name_UNIQUE` (`name`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -32471,7 +32221,7 @@ CREATE TABLE `genericAllocation` ( KEY `genericAllocation_longName_IDX` (`longName`) USING BTREE, KEY `genericAllocation_size_IDX` (`size`) USING BTREE, CONSTRAINT `genericAllocation_FK` FOREIGN KEY (`itemFk`) REFERENCES `item` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Almacena los filtros para asignar códigos genéricos a los items'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Almacena los filtros para asignar códigos genéricos a los items'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -32507,7 +32257,7 @@ CREATE TABLE `glsConfig` ( `refund` int(1) DEFAULT NULL, `weight` int(1) DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -32522,7 +32272,7 @@ CREATE TABLE `glsExpedition__` ( `barcode` bigint(20) unsigned DEFAULT NULL, `uid` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, `codexp` int(11) DEFAULT NULL, - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created` timestamp NOT NULL DEFAULT current_timestamp(), PRIMARY KEY (`expeditionFk`), CONSTRAINT `glsInfo_FK` FOREIGN KEY (`expeditionFk`) REFERENCES `expedition` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; @@ -32540,8 +32290,8 @@ CREATE TABLE `greuge` ( `clientFk` int(10) unsigned NOT NULL, `description` varchar(45) COLLATE utf8_unicode_ci NOT NULL, `amount` decimal(10,2) NOT NULL, - `shipped` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `shipped` datetime NOT NULL DEFAULT current_timestamp(), + `created` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `greugeTypeFk` int(11) DEFAULT NULL, `ticketFk` int(11) DEFAULT NULL, PRIMARY KEY (`Id`), @@ -32565,7 +32315,7 @@ DELIMITER ;; BEFORE UPDATE ON `greuge` FOR EACH ROW BEGIN - DECLARE vMaxDate DATETIME DEFAULT TIMESTAMPADD(YEAR,1,CURDATE()); + DECLARE vMaxDate DATETIME DEFAULT TIMESTAMPADD(YEAR,1,util.VN_CURDATE()); IF NEW.shipped > vMaxDate THEN SET NEW.shipped = vMaxDate; @@ -32716,7 +32466,7 @@ DELIMITER ;; BEFORE UPDATE ON `host` FOR EACH ROW BEGIN - SET new.updated = NOW(); + SET new.updated = util.VN_NOW(); END */;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -32750,11 +32500,11 @@ CREATE TABLE `ink` ( `name` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, `picture` blob NOT NULL, `showOrder` int(11) NOT NULL, - `ball` blob, - `isCargex` tinyint(4) NOT NULL DEFAULT '0', + `ball` blob DEFAULT NULL, + `isCargex` tinyint(4) NOT NULL DEFAULT 0, `dutchCode` varchar(3) COLLATE utf8_unicode_ci DEFAULT NULL, `hex` varchar(6) COLLATE utf8_unicode_ci DEFAULT NULL, - `isRealColor` tinyint(1) NOT NULL DEFAULT '1', + `isRealColor` tinyint(1) NOT NULL DEFAULT 1, PRIMARY KEY (`id`), UNIQUE KEY `dutchCode_UNIQUE` (`dutchCode`), CONSTRAINT `ink_fk1` FOREIGN KEY (`dutchCode`) REFERENCES `edi`.`feature` (`feature_value`) ON DELETE SET NULL ON UPDATE CASCADE @@ -32800,9 +32550,9 @@ DROP TABLE IF EXISTS `intrastat`; CREATE TABLE `intrastat` ( `id` int(8) unsigned zerofill NOT NULL, `description` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, - `import__` tinyint(4) NOT NULL DEFAULT '0', - `taxClassFk` tinyint(3) unsigned NOT NULL DEFAULT '2', - `taxCodeFk` tinyint(2) unsigned NOT NULL DEFAULT '64', + `import__` tinyint(4) NOT NULL DEFAULT 0, + `taxClassFk` tinyint(3) unsigned NOT NULL DEFAULT 2, + `taxCodeFk` tinyint(2) unsigned NOT NULL DEFAULT 64, PRIMARY KEY (`id`), KEY `iva_group_id` (`taxClassFk`), CONSTRAINT `intrastat_ibfk_1` FOREIGN KEY (`taxClassFk`) REFERENCES `taxClass` (`id`) ON UPDATE CASCADE @@ -32838,7 +32588,7 @@ CREATE TABLE `inventoryFailure` ( CONSTRAINT `inventoryFailure_fk3` FOREIGN KEY (`guiltyFk`) REFERENCES `worker` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `inventoryFailure_fk4` FOREIGN KEY (`warehouseFk`) REFERENCES `warehouse` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `inventoryFailure_fk5` FOREIGN KEY (`causeFk`) REFERENCES `inventoryFailureCause` (`id`) ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -32852,7 +32602,7 @@ CREATE TABLE `inventoryFailureCause` ( `id` int(11) NOT NULL AUTO_INCREMENT, `description` varchar(100) COLLATE utf8_unicode_ci NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -32867,7 +32617,7 @@ CREATE TABLE `invoiceCorrection` ( `correctedFk` int(10) unsigned NOT NULL COMMENT 'Factura rectificada', `cplusRectificationTypeFk` int(10) unsigned NOT NULL, `cplusInvoiceType477Fk` int(10) unsigned NOT NULL, - `invoiceCorrectionTypeFk` int(11) NOT NULL DEFAULT '3', + `invoiceCorrectionTypeFk` int(11) NOT NULL DEFAULT 3, PRIMARY KEY (`correctingFk`), KEY `correctedFk_idx` (`correctedFk`), KEY `invoiceCorrection_ibfk_1_idx` (`cplusRectificationTypeFk`), @@ -32913,7 +32663,7 @@ CREATE TABLE `invoiceCorrectionType` ( `description` varchar(100) COLLATE utf8_unicode_ci NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `description_UNIQUE` (`description`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -32930,20 +32680,20 @@ CREATE TABLE `invoiceIn` ( `supplierFk` int(11) NOT NULL, `issued` date DEFAULT NULL COMMENT 'Fecha de emision de la factura', `supplierRef` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, - `isBooked` tinyint(1) NOT NULL DEFAULT '0', - `currencyFk` tinyint(3) unsigned NOT NULL DEFAULT '1', - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - `companyFk` smallint(5) unsigned NOT NULL DEFAULT '442', + `isBooked` tinyint(1) NOT NULL DEFAULT 0, + `currencyFk` tinyint(3) unsigned NOT NULL DEFAULT 1, + `created` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), + `companyFk` smallint(5) unsigned NOT NULL DEFAULT 442, `docFk` int(11) DEFAULT NULL, `booked` date DEFAULT NULL COMMENT 'Fecha de contabilizacion', `operated` date DEFAULT NULL COMMENT 'Fecha de entrega de la mercancia o el suministro', - `cplusInvoiceType472Fk` int(10) unsigned DEFAULT '1', - `cplusRectificationTypeFk` int(10) unsigned DEFAULT '1', - `cplusSubjectOpFk` int(10) unsigned DEFAULT '1', - `cplusTaxBreakFk` int(10) unsigned DEFAULT '1', - `cplusTrascendency472Fk` int(10) unsigned DEFAULT '1', + `cplusInvoiceType472Fk` int(10) unsigned DEFAULT 1, + `cplusRectificationTypeFk` int(10) unsigned DEFAULT 1, + `cplusSubjectOpFk` int(10) unsigned DEFAULT 1, + `cplusTaxBreakFk` int(10) unsigned DEFAULT 1, + `cplusTrascendency472Fk` int(10) unsigned DEFAULT 1, `bookEntried` date DEFAULT NULL COMMENT 'Fecha Asiento', - `isVatDeductible` tinyint(1) NOT NULL DEFAULT '1', + `isVatDeductible` tinyint(1) NOT NULL DEFAULT 1, `withholdingSageFk` smallint(6) DEFAULT NULL COMMENT 'Tipos de retención SAGE', `expenceFkDeductible` varchar(10) CHARACTER SET utf8 DEFAULT NULL, PRIMARY KEY (`id`), @@ -33119,21 +32869,6 @@ DELIMITER ; /*!50003 SET character_set_results = @saved_cs_results */ ; /*!50003 SET collation_connection = @saved_col_connection */ ; --- --- Temporary table structure for view `invoiceInAwb__` --- - -DROP TABLE IF EXISTS `invoiceInAwb__`; -/*!50001 DROP VIEW IF EXISTS `invoiceInAwb__`*/; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; -/*!50001 CREATE TABLE `invoiceInAwb__` ( - `invoiceInFk` tinyint NOT NULL, - `awbFk` tinyint NOT NULL, - `dua` tinyint NOT NULL -) ENGINE=MyISAM */; -SET character_set_client = @saved_cs_client; - -- -- Table structure for table `invoiceInDueDay` -- @@ -33145,10 +32880,10 @@ CREATE TABLE `invoiceInDueDay` ( `id` int(11) NOT NULL AUTO_INCREMENT, `invoiceInFk` mediumint(8) unsigned NOT NULL, `dueDated` date NOT NULL, - `bankFk` int(11) NOT NULL DEFAULT '3117', - `amount` decimal(10,2) NOT NULL DEFAULT '0.00', + `bankFk` int(11) NOT NULL DEFAULT 3117, + `amount` decimal(10,2) NOT NULL DEFAULT 0.00, `foreignValue` decimal(10,2) DEFAULT NULL, - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created` timestamp NOT NULL DEFAULT current_timestamp(), PRIMARY KEY (`id`), KEY `recibida_id` (`invoiceInFk`), KEY `banco_id` (`bankFk`), @@ -33177,7 +32912,7 @@ BEGIN JOIN vn.payMethod pm ON pm.id = s.payMethodFk WHERE ii.id = NEW.invoiceInFk; - IF (NEW.dueDated <= CURDATE() AND vIsNotified) + IF (NEW.dueDated <= util.VN_CURDATE() AND vIsNotified) THEN CALL mail_insert( 'begonya@verdnatura.es', @@ -33217,7 +32952,7 @@ BEGIN JOIN vn.payMethod pm ON pm.id = s.payMethodFk WHERE ii.id = NEW.invoiceInFk; - IF (NEW.dueDated <= CURDATE() AND vIsNotified) + IF (NEW.dueDated <= util.VN_CURDATE() AND vIsNotified) THEN CALL mail_insert( 'begonya@verdnatura.es', @@ -33237,25 +32972,6 @@ DELIMITER ; /*!50003 SET character_set_results = @saved_cs_results */ ; /*!50003 SET collation_connection = @saved_col_connection */ ; --- --- Temporary table structure for view `invoiceInDueDay__` --- - -DROP TABLE IF EXISTS `invoiceInDueDay__`; -/*!50001 DROP VIEW IF EXISTS `invoiceInDueDay__`*/; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; -/*!50001 CREATE TABLE `invoiceInDueDay__` ( - `id` tinyint NOT NULL, - `invoiceInFk` tinyint NOT NULL, - `dueDated` tinyint NOT NULL, - `bankFk` tinyint NOT NULL, - `amount` tinyint NOT NULL, - `foreignValue` tinyint NOT NULL, - `created` tinyint NOT NULL -) ENGINE=MyISAM */; -SET character_set_client = @saved_cs_client; - -- -- Table structure for table `invoiceInIntrastat` -- @@ -33267,41 +32983,20 @@ CREATE TABLE `invoiceInIntrastat` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, `invoiceInFk` mediumint(8) unsigned NOT NULL, `net` decimal(10,2) DEFAULT NULL, - `intrastatFk` int(8) unsigned zerofill NOT NULL DEFAULT '06049190', + `intrastatFk` int(8) unsigned zerofill NOT NULL DEFAULT 06049190, `amount` double NOT NULL, `stems` int(11) NOT NULL, `countryFk` mediumint(8) unsigned DEFAULT NULL, - `dated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - `statisticalValue` double NOT NULL DEFAULT '0', + `dated` timestamp NOT NULL DEFAULT current_timestamp(), + `statisticalValue` double NOT NULL DEFAULT 0, PRIMARY KEY (`id`), KEY `intrastat_id` (`intrastatFk`), KEY `invoiceInIntrastat_FK` (`invoiceInFk`), CONSTRAINT `invoiceInIntrastat_FK` FOREIGN KEY (`invoiceInFk`) REFERENCES `invoiceIn` (`id`) ON DELETE CASCADE, CONSTRAINT `invoiceInIntrastat_ibfk_1` FOREIGN KEY (`intrastatFk`) REFERENCES `intrastat` (`id`) ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; --- --- Temporary table structure for view `invoiceInIntrastat2__` --- - -DROP TABLE IF EXISTS `invoiceInIntrastat2__`; -/*!50001 DROP VIEW IF EXISTS `invoiceInIntrastat2__`*/; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; -/*!50001 CREATE TABLE `invoiceInIntrastat2__` ( - `id` tinyint NOT NULL, - `invoiceInFk` tinyint NOT NULL, - `net` tinyint NOT NULL, - `intrastatFk` tinyint NOT NULL, - `amount` tinyint NOT NULL, - `stems` tinyint NOT NULL, - `countryFk` tinyint NOT NULL, - `dated` tinyint NOT NULL, - `statisticalValue` tinyint NOT NULL -) ENGINE=MyISAM */; -SET character_set_client = @saved_cs_client; - -- -- Table structure for table `invoiceInIntrastat__` -- @@ -33333,11 +33028,11 @@ CREATE TABLE `invoiceInLog` ( `originFk` mediumint(8) unsigned NOT NULL, `userFk` int(10) unsigned DEFAULT NULL, `action` set('insert','update','delete') COLLATE utf8_unicode_ci NOT NULL, - `creationDate` timestamp NULL DEFAULT CURRENT_TIMESTAMP, - `description` text CHARACTER SET utf8, + `creationDate` timestamp NULL DEFAULT current_timestamp(), + `description` text CHARACTER SET utf8 DEFAULT NULL, `changedModel` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, - `oldInstance` text COLLATE utf8_unicode_ci, - `newInstance` text COLLATE utf8_unicode_ci, + `oldInstance` text COLLATE utf8_unicode_ci DEFAULT NULL, + `newInstance` text COLLATE utf8_unicode_ci DEFAULT NULL, `changedModelId` int(11) DEFAULT NULL, `changedModelValue` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), @@ -33361,7 +33056,7 @@ CREATE TABLE `invoiceInSage` ( `invoiceInSerialFk` varchar(2) COLLATE utf8_unicode_ci NOT NULL, `taxTypeSageFk` smallint(6) NOT NULL, `transactionTypeSageFk` tinyint(4) NOT NULL, - `isService` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Para diferenciar producto de servicio', + `isService` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'Para diferenciar producto de servicio', `expenceFk` varchar(10) CHARACTER SET utf8 NOT NULL, `withholdingSageFk` smallint(6) DEFAULT NULL, PRIMARY KEY (`id`), @@ -33378,7 +33073,7 @@ CREATE TABLE `invoiceInSage` ( CONSTRAINT `invoiceInSage_taxTypeSageFk` FOREIGN KEY (`taxTypeSageFk`) REFERENCES `sage`.`TiposIva` (`CodigoIva`) ON UPDATE CASCADE, CONSTRAINT `invoiceInSage_transactionTypeSageFk` FOREIGN KEY (`transactionTypeSageFk`) REFERENCES `sage`.`TiposTransacciones` (`CodigoTransaccion`) ON UPDATE CASCADE, CONSTRAINT `invoiceInSage_withholdingSageFk` FOREIGN KEY (`withholdingSageFk`) REFERENCES `sage`.`TiposRetencion` (`CodigoRetencion`) ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Relaciones de entrelas series de facturas recibidas y sus tipo de IVA con código Iva y codigo de Transación en Sage. Para precontabilizadar facturas recibidas'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Relaciones de entrelas series de facturas recibidas y sus tipo de IVA con código Iva y codigo de Transación en Sage. Para precontabilizadar facturas recibidas'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -33391,7 +33086,7 @@ DROP TABLE IF EXISTS `invoiceInSerial`; CREATE TABLE `invoiceInSerial` ( `code` varchar(2) COLLATE utf8_unicode_ci NOT NULL, `description` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, - `cplusTerIdNifFk` int(11) NOT NULL DEFAULT '1', + `cplusTerIdNifFk` int(11) NOT NULL DEFAULT 1, `taxAreaFk` varchar(15) CHARACTER SET utf8 DEFAULT NULL, PRIMARY KEY (`code`), KEY `InvoiceInSerial_Fk1_idx` (`cplusTerIdNifFk`), @@ -33417,7 +33112,7 @@ CREATE TABLE `invoiceInTax` ( `foreignValue` decimal(10,2) DEFAULT NULL, `taxTypeSageFk` smallint(6) DEFAULT NULL COMMENT 'Tipo de IVA SAGE', `transactionTypeSageFk` tinyint(4) DEFAULT NULL COMMENT 'Tipo de transacción SAGE', - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `created` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), PRIMARY KEY (`id`), KEY `recibida_id` (`invoiceInFk`), KEY `recibida_iva_ibfk_2` (`taxCodeFk`), @@ -33440,13 +33135,13 @@ DROP TABLE IF EXISTS `invoiceInTaxBookingAccount`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `invoiceInTaxBookingAccount` ( `id` int(10) NOT NULL AUTO_INCREMENT, - `effectived` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `effectived` timestamp NOT NULL DEFAULT current_timestamp(), `account` varchar(10) COLLATE utf8_unicode_ci NOT NULL, `taxAreaFk` varchar(15) CHARACTER SET utf8 NOT NULL, `priority` int(2) unsigned DEFAULT NULL, - `taxClassFk` tinyint(3) unsigned NOT NULL DEFAULT '1', - `countryFk` mediumint(8) unsigned NOT NULL DEFAULT '1', - `rate` decimal(5,2) NOT NULL DEFAULT '0.00', + `taxClassFk` tinyint(3) unsigned NOT NULL DEFAULT 1, + `countryFk` mediumint(8) unsigned NOT NULL DEFAULT 1, + `rate` decimal(5,2) NOT NULL DEFAULT 0.00, PRIMARY KEY (`id`), KEY `invoiceInTaxBookingAccount_fk1_idx` (`taxAreaFk`), KEY `invoiceInTaxBookingAccount_fk2_idx` (`taxClassFk`), @@ -33454,42 +33149,9 @@ CREATE TABLE `invoiceInTaxBookingAccount` ( CONSTRAINT `invoiceInTaxBookingAccount_fk1` FOREIGN KEY (`taxAreaFk`) REFERENCES `taxArea` (`code`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `invoiceInTaxBookingAccount_fk2` FOREIGN KEY (`taxClassFk`) REFERENCES `taxClass` (`id`) ON UPDATE CASCADE, CONSTRAINT `invoiceInTaxBookingAccount_fk3` FOREIGN KEY (`countryFk`) REFERENCES `country` (`id`) ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; --- --- Temporary table structure for view `invoiceIn__` --- - -DROP TABLE IF EXISTS `invoiceIn__`; -/*!50001 DROP VIEW IF EXISTS `invoiceIn__`*/; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; -/*!50001 CREATE TABLE `invoiceIn__` ( - `id` tinyint NOT NULL, - `serialNumber` tinyint NOT NULL, - `serial` tinyint NOT NULL, - `supplierFk` tinyint NOT NULL, - `issued` tinyint NOT NULL, - `supplierRef` tinyint NOT NULL, - `isBooked` tinyint NOT NULL, - `currencyFk` tinyint NOT NULL, - `created` tinyint NOT NULL, - `companyFk` tinyint NOT NULL, - `docFk` tinyint NOT NULL, - `booked` tinyint NOT NULL, - `operated` tinyint NOT NULL, - `cplusInvoiceType472Fk` tinyint NOT NULL, - `cplusRectificationTypeFk` tinyint NOT NULL, - `cplusSubjectOpFk` tinyint NOT NULL, - `cplusTaxBreakFk` tinyint NOT NULL, - `cplusTrascendency472Fk` tinyint NOT NULL, - `bookEntried` tinyint NOT NULL, - `isVatDeductible` tinyint NOT NULL, - `withholdingSageFk` tinyint NOT NULL -) ENGINE=MyISAM */; -SET character_set_client = @saved_cs_client; - -- -- Table structure for table `invoiceOut` -- @@ -33502,25 +33164,25 @@ CREATE TABLE `invoiceOut` ( `ref` varchar(20) COLLATE utf8_unicode_ci NOT NULL, `serial` varchar(2) COLLATE utf8_unicode_ci DEFAULT NULL, `issued` date DEFAULT NULL, - `amount` decimal(12,2) DEFAULT '0.00', + `amount` decimal(12,2) DEFAULT 0.00, `dued` datetime DEFAULT NULL, `bankFk` int(11) DEFAULT NULL, - `clientFk` int(11) DEFAULT '0', - `taxableBase7__` decimal(12,2) DEFAULT '0.00', - `taxableBase16__` decimal(12,2) DEFAULT '0.00', - `equ1__` decimal(12,2) DEFAULT '0.00', - `equ4__` decimal(12,2) DEFAULT '0.00', - `vat7__` decimal(12,2) DEFAULT '0.00', - `vat16__` decimal(12,2) DEFAULT '0.00', - `workerFk__` int(11) DEFAULT '0', - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - `companyFk` smallint(5) unsigned NOT NULL DEFAULT '442', - `hasPdf` tinyint(3) unsigned NOT NULL DEFAULT '0', + `clientFk` int(11) DEFAULT 0, + `taxableBase7__` decimal(12,2) DEFAULT 0.00, + `taxableBase16__` decimal(12,2) DEFAULT 0.00, + `equ1__` decimal(12,2) DEFAULT 0.00, + `equ4__` decimal(12,2) DEFAULT 0.00, + `vat7__` decimal(12,2) DEFAULT 0.00, + `vat16__` decimal(12,2) DEFAULT 0.00, + `workerFk__` int(11) DEFAULT 0, + `created` timestamp NOT NULL DEFAULT current_timestamp(), + `companyFk` smallint(5) unsigned NOT NULL DEFAULT 442, + `hasPdf` tinyint(3) unsigned NOT NULL DEFAULT 0, `booked` date DEFAULT NULL, - `cplusInvoiceType477Fk` int(10) unsigned NOT NULL DEFAULT '1', - `cplusTaxBreakFk` int(10) unsigned NOT NULL DEFAULT '1', - `cplusSubjectOpFk` int(10) unsigned NOT NULL DEFAULT '1', - `cplusTrascendency477Fk` int(10) unsigned NOT NULL DEFAULT '1', + `cplusInvoiceType477Fk` int(10) unsigned NOT NULL DEFAULT 1, + `cplusTaxBreakFk` int(10) unsigned NOT NULL DEFAULT 1, + `cplusSubjectOpFk` int(10) unsigned NOT NULL DEFAULT 1, + `cplusTrascendency477Fk` int(10) unsigned NOT NULL DEFAULT 1, PRIMARY KEY (`id`,`ref`), UNIQUE KEY `Id_Factura` (`ref`), KEY `Id_Banco` (`bankFk`), @@ -33563,7 +33225,7 @@ BEGIN SELECT CONCAT(NEW.serial, IFNULL(RIGHT(MAX(i.ref), LENGTH(i.ref)-1) , - RPAD(CONCAT(c.sage200Company, RIGHT(YEAR(CURDATE()), 2)), 7,'0')) + 1) INTO vRef + RPAD(CONCAT(c.sage200Company, RIGHT(YEAR(util.VN_CURDATE()), 2)), 7,'0')) + 1) INTO vRef FROM invoiceOut i LEFT JOIN company c ON c.id = i.companyFk WHERE i.serial = NEW.serial @@ -33573,7 +33235,7 @@ BEGIN SELECT CONCAT(NEW.serial, IFNULL(RIGHT(MAX(i.ref), LENGTH(i.ref)-1) , - RPAD(CONCAT(c.sage200Company, RIGHT(YEAR(CURDATE()), 2)), 8,'0')) + 1) INTO vRef + RPAD(CONCAT(c.sage200Company, RIGHT(YEAR(util.VN_CURDATE()), 2)), 8,'0')) + 1) INTO vRef FROM invoiceOut i LEFT JOIN company c ON c.id = i.companyFk WHERE i.serial = NEW.serial @@ -33673,9 +33335,9 @@ DROP TABLE IF EXISTS `invoiceOutExpence`; CREATE TABLE `invoiceOutExpence` ( `id` int(11) NOT NULL AUTO_INCREMENT, `invoiceOutFk` int(10) unsigned NOT NULL, - `amount` decimal(10,2) NOT NULL DEFAULT '0.00', + `amount` decimal(10,2) NOT NULL DEFAULT 0.00, `expenceFk` varchar(10) CHARACTER SET utf8 NOT NULL, - `created` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + `created` timestamp NULL DEFAULT current_timestamp(), PRIMARY KEY (`id`), KEY `invoiceOutExpence_FK_1_idx` (`invoiceOutFk`), KEY `invoiceOutExpence_FK_2_idx` (`expenceFk`), @@ -33694,12 +33356,12 @@ DROP TABLE IF EXISTS `invoiceOutSerial`; CREATE TABLE `invoiceOutSerial` ( `code` varchar(2) COLLATE utf8_unicode_ci NOT NULL, `description` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, - `isTaxed` tinyint(1) NOT NULL DEFAULT '1', + `isTaxed` tinyint(1) NOT NULL DEFAULT 1, `taxAreaFk` varchar(15) CHARACTER SET utf8 NOT NULL DEFAULT 'NATIONAL', - `isCEE` tinyint(1) NOT NULL DEFAULT '0', - `cplusInvoiceType477Fk` int(10) unsigned DEFAULT '1', - `footNotes` longtext COLLATE utf8_unicode_ci, - `isRefEditable` tinyint(4) NOT NULL DEFAULT '0', + `isCEE` tinyint(1) NOT NULL DEFAULT 0, + `cplusInvoiceType477Fk` int(10) unsigned DEFAULT 1, + `footNotes` longtext COLLATE utf8_unicode_ci DEFAULT NULL, + `isRefEditable` tinyint(4) NOT NULL DEFAULT 0, PRIMARY KEY (`code`), KEY `taxAreaFk_idx` (`taxAreaFk`), CONSTRAINT `invoiceOutSeriaTaxArea` FOREIGN KEY (`taxAreaFk`) REFERENCES `taxArea` (`code`) ON UPDATE CASCADE @@ -33717,8 +33379,8 @@ CREATE TABLE `invoiceOutTax` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `invoiceOutFk` int(10) unsigned NOT NULL, `taxableBase` decimal(10,2) NOT NULL, - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - `vat` decimal(10,2) NOT NULL DEFAULT '0.00', + `created` timestamp NOT NULL DEFAULT current_timestamp(), + `vat` decimal(10,2) NOT NULL DEFAULT 0.00, `pgcFk` varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0000000000', PRIMARY KEY (`id`), UNIQUE KEY `invoiceOutTax_Resctriccion` (`invoiceOutFk`,`pgcFk`), @@ -33741,7 +33403,7 @@ CREATE TABLE `invoiceOutTaxConfig` ( `taxClassCodeFk` varchar(1) COLLATE utf8_unicode_ci DEFAULT NULL, `taxTypeSageFk` smallint(6) DEFAULT NULL, `transactionTypeSageFk` tinyint(4) DEFAULT NULL, - `isService` tinyint(1) DEFAULT '0', + `isService` tinyint(1) DEFAULT 0, `expenceFk` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), KEY `invoiceOutTaxConfig_FK` (`taxClassCodeFk`), @@ -33750,7 +33412,7 @@ CREATE TABLE `invoiceOutTaxConfig` ( CONSTRAINT `invoiceOutTaxConfig_FK` FOREIGN KEY (`taxClassCodeFk`) REFERENCES `taxClass` (`code`), CONSTRAINT `invoiceOutTaxConfig_FK_1` FOREIGN KEY (`taxTypeSageFk`) REFERENCES `sage`.`TiposIva` (`CodigoIva`), CONSTRAINT `invoiceOutTaxConfig_FK_2` FOREIGN KEY (`transactionTypeSageFk`) REFERENCES `sage`.`TiposTransacciones` (`CodigoTransaccion`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -33765,33 +33427,33 @@ CREATE TABLE `item` ( `equivalent` int(11) unsigned DEFAULT NULL, `name` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, `size` int(10) unsigned DEFAULT NULL, - `stems` int(11) DEFAULT '1', - `minPrice` double DEFAULT '0', - `isToPrint` tinyint(1) NOT NULL DEFAULT '0', - `isDeliveryNote__` tinyint(1) NOT NULL DEFAULT '0', - `taxClassFk__` tinyint(4) unsigned NOT NULL DEFAULT '1', + `stems` int(11) DEFAULT 1, + `minPrice` double DEFAULT 0, + `isToPrint` tinyint(1) NOT NULL DEFAULT 0, + `isDeliveryNote__` tinyint(1) NOT NULL DEFAULT 0, + `taxClassFk__` tinyint(4) unsigned NOT NULL DEFAULT 1, `family` varchar(3) CHARACTER SET utf8 NOT NULL DEFAULT 'VT', - `box` tinyint(1) NOT NULL DEFAULT '0', + `box` tinyint(1) NOT NULL DEFAULT 0, `category` varchar(3) COLLATE utf8_unicode_ci DEFAULT NULL, `originFk` tinyint(2) unsigned NOT NULL, - `doPhoto` tinyint(4) NOT NULL DEFAULT '0', + `doPhoto` tinyint(4) NOT NULL DEFAULT 0, `image` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `inkFk` varchar(3) COLLATE utf8_unicode_ci DEFAULT NULL, `niche__` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, - `intrastatFk` int(8) unsigned zerofill NOT NULL DEFAULT '06039010', - `hasMinPrice` tinyint(1) NOT NULL DEFAULT '0', - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - `isOnOffer__` tinyint(4) NOT NULL DEFAULT '0', - `isBargain__` tinyint(4) NOT NULL DEFAULT '0', + `intrastatFk` int(8) unsigned zerofill NOT NULL DEFAULT 06039010, + `hasMinPrice` tinyint(1) NOT NULL DEFAULT 0, + `created` timestamp NOT NULL DEFAULT current_timestamp(), + `isOnOffer__` tinyint(4) NOT NULL DEFAULT 0, + `isBargain__` tinyint(4) NOT NULL DEFAULT 0, `comment` varchar(150) COLLATE utf8_unicode_ci DEFAULT NULL, `typeFk` smallint(5) unsigned NOT NULL, - `generic` tinyint(1) unsigned zerofill NOT NULL DEFAULT '0', + `generic` tinyint(1) unsigned zerofill NOT NULL DEFAULT 0, `producerFk` mediumint(3) unsigned DEFAULT NULL, `description` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, - `density` int(11) NOT NULL DEFAULT '167' COMMENT 'Almacena la densidad en kg/m3 para el calculo de los portes, si no se especifica se pone por defecto la del tipo en un trigger', - `relevancy` tinyint(1) NOT NULL DEFAULT '0', + `density` int(11) NOT NULL DEFAULT 167 COMMENT 'Almacena la densidad en kg/m3 para el calculo de los portes, si no se especifica se pone por defecto la del tipo en un trigger', + `relevancy` tinyint(1) NOT NULL DEFAULT 0, `expenceFk` varchar(10) CHARACTER SET utf8 NOT NULL DEFAULT '7001000000', - `isActive` tinyint(1) NOT NULL DEFAULT '1', + `isActive` tinyint(1) NOT NULL DEFAULT 1, `longName` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, `subName` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, `tag5` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, @@ -33806,9 +33468,9 @@ CREATE TABLE `item` ( `value9` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, `tag10` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `value10` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, - `compression` decimal(5,2) NOT NULL DEFAULT '1.00' COMMENT 'Relacion de compresividad entre el volumen de las entradas en Silla y el empaquetado en los envios a clientes.\n\nMenor que 1 significa que se puede comprimir más que el volumen original.', - `minimum` decimal(10,0) unsigned NOT NULL DEFAULT '3' COMMENT 'Cantidad máxima de cajas / cubos que cabe en un nicho', - `upToDown` decimal(10,0) unsigned NOT NULL DEFAULT '0' COMMENT 'Se muestra el precio por kilo ', + `compression` decimal(5,2) NOT NULL DEFAULT 1.00 COMMENT 'Relacion de compresividad entre el volumen de las entradas en Silla y el empaquetado en los envios a clientes.\n\nMenor que 1 significa que se puede comprimir más que el volumen original.', + `minimum` decimal(10,0) unsigned NOT NULL DEFAULT 3 COMMENT 'Cantidad máxima de cajas / cubos que cabe en un nicho', + `upToDown` decimal(10,0) unsigned NOT NULL DEFAULT 0 COMMENT 'Se muestra el precio por kilo ', `supplyResponseFk` int(11) DEFAULT NULL, `hasKgPrice` tinyint(1) NOT NULL DEFAULT '0', `sectorFk` int(11) DEFAULT NULL, @@ -33818,7 +33480,7 @@ CREATE TABLE `item` ( `embalageCode` int(11) DEFAULT NULL COMMENT 'Campo para Floramondo', `quality` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'Campo para Floramondo', `stars` int(11) DEFAULT NULL, - `stemMultiplier` double NOT NULL DEFAULT '1' COMMENT 'este valor multiplica las unidades y divide los precios en el procedimiento edi.ekt_load', + `stemMultiplier` double NOT NULL DEFAULT 1 COMMENT 'este valor multiplica las unidades y divide los precios en el procedimiento edi.ekt_load', `itemPackingTypeFk` varchar(1) COLLATE utf8_unicode_ci DEFAULT NULL, `packingOut` decimal(10,2) DEFAULT NULL COMMENT 'cantidad que cabe en una caja de verdnatura', `genericFk` int(11) DEFAULT NULL COMMENT 'Item genérico', @@ -34086,10 +33748,10 @@ CREATE TABLE `itemCategory` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(45) COLLATE utf8_unicode_ci NOT NULL, `order` int(10) unsigned DEFAULT NULL, - `display` tinyint(4) NOT NULL DEFAULT '1', + `display` tinyint(4) NOT NULL DEFAULT 1, `color` char(6) COLLATE utf8_unicode_ci DEFAULT NULL, - `shortLife` int(11) NOT NULL DEFAULT '0' COMMENT 'Sirve para filtrar aquellos reinos que tienen precios estables', - `merchandise` tinyint(1) NOT NULL DEFAULT '1', + `shortLife` int(11) NOT NULL DEFAULT 0 COMMENT 'Sirve para filtrar aquellos reinos que tienen precios estables', + `merchandise` tinyint(1) NOT NULL DEFAULT 1, `icon` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, `code` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, `isReclining` tinyint(4) NOT NULL DEFAULT '1', @@ -34208,15 +33870,15 @@ DROP TABLE IF EXISTS `itemCost`; CREATE TABLE `itemCost` ( `itemFk` int(11) NOT NULL, `warehouseFk` smallint(6) unsigned NOT NULL, - `quantity` int(10) NOT NULL DEFAULT '0', - `rotation` decimal(10,4) NOT NULL DEFAULT '0.0000', - `cm3` int(11) NOT NULL DEFAULT '0', - `storage` decimal(10,4) NOT NULL DEFAULT '0.0000', - `handling` decimal(10,4) NOT NULL DEFAULT '0.0000', - `extraCharge` decimal(10,4) NOT NULL DEFAULT '0.0000', - `wasted` decimal(10,4) NOT NULL DEFAULT '0.0000', - `cm3delivery` int(11) NOT NULL DEFAULT '0', - `grams` int(11) NOT NULL DEFAULT '0' COMMENT 'peso en gramos de una unidad de venta', + `quantity` int(10) NOT NULL DEFAULT 0, + `rotation` decimal(10,4) NOT NULL DEFAULT 0.0000, + `cm3` int(11) NOT NULL DEFAULT 0, + `storage` decimal(10,4) NOT NULL DEFAULT 0.0000, + `handling` decimal(10,4) NOT NULL DEFAULT 0.0000, + `extraCharge` decimal(10,4) NOT NULL DEFAULT 0.0000, + `wasted` decimal(10,4) NOT NULL DEFAULT 0.0000, + `cm3delivery` int(11) NOT NULL DEFAULT 0, + `grams` int(11) NOT NULL DEFAULT 0 COMMENT 'peso en gramos de una unidad de venta', PRIMARY KEY (`itemFk`,`warehouseFk`), KEY `warehouse_id_rotacion_idx` (`warehouseFk`), CONSTRAINT `id_article_rotaci` FOREIGN KEY (`itemFk`) REFERENCES `item` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, @@ -34272,7 +33934,7 @@ BEGIN JOIN vn.route r ON r.id = t.routeFk WHERE r.isOk = FALSE AND ic.itemFk = NEW.itemFk - AND r.created >= CURDATE() + AND r.created >= util.VN_CURDATE() GROUP BY r.id; IF NEW.cm3Delivery = 0 AND NEW.warehouseFk = 60 THEN CALL mail_insert( @@ -34350,11 +34012,11 @@ DROP TABLE IF EXISTS `itemImageQueue`; CREATE TABLE `itemImageQueue` ( `itemFk` int(11) NOT NULL, `url` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, - `error` text COLLATE utf8_unicode_ci, - `attempts` int(11) DEFAULT '0', - `created` timestamp NULL DEFAULT CURRENT_TIMESTAMP, - `updated` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - `priority` int(11) DEFAULT '99', + `error` text COLLATE utf8_unicode_ci DEFAULT NULL, + `attempts` int(11) DEFAULT 0, + `created` timestamp NULL DEFAULT current_timestamp(), + `updated` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), + `priority` int(11) DEFAULT 99, PRIMARY KEY (`itemFk`), CONSTRAINT `itemImageQueueItemIdx` FOREIGN KEY (`itemFk`) REFERENCES `item` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Cola para añadir las imagenes al campo vn.item.image a partir de una url'; @@ -34389,7 +34051,7 @@ CREATE TABLE `itemLabel` ( `price` decimal(10,2) DEFAULT NULL, `labels` int(11) DEFAULT NULL COMMENT 'Tabla hecha para Ruben Espinosa, para sacar etiquetas en Holanda para un cliente.', PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -34404,11 +34066,11 @@ CREATE TABLE `itemLog` ( `originFk` int(11) NOT NULL, `userFk` int(10) unsigned DEFAULT NULL, `action` set('insert','update','delete') COLLATE utf8_unicode_ci NOT NULL, - `creationDate` timestamp NULL DEFAULT CURRENT_TIMESTAMP, - `description` text CHARACTER SET utf8, + `creationDate` timestamp NULL DEFAULT current_timestamp(), + `description` text CHARACTER SET utf8 DEFAULT NULL, `changedModel` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, - `oldInstance` text COLLATE utf8_unicode_ci, - `newInstance` text COLLATE utf8_unicode_ci, + `oldInstance` text COLLATE utf8_unicode_ci DEFAULT NULL, + `newInstance` text COLLATE utf8_unicode_ci DEFAULT NULL, `changedModelId` int(11) DEFAULT NULL, `changedModelValue` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), @@ -34460,11 +34122,11 @@ DROP TABLE IF EXISTS `itemPlacement`; CREATE TABLE `itemPlacement` ( `id` int(11) NOT NULL AUTO_INCREMENT, `itemFk` int(11) NOT NULL, - `warehouseFk` smallint(6) unsigned NOT NULL DEFAULT '1', + `warehouseFk` smallint(6) unsigned NOT NULL DEFAULT 1, `code` varchar(10) COLLATE utf8_unicode_ci NOT NULL, - `modificationDate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `modificationDate` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `reserve` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, - `pickable` int(11) unsigned NOT NULL DEFAULT '0', + `pickable` int(11) unsigned NOT NULL DEFAULT 0, `sectorFk` int(11) DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `Id_Article_UNIQUE` (`itemFk`,`warehouseFk`), @@ -34531,9 +34193,9 @@ DROP TABLE IF EXISTS `itemPlacementSupply`; CREATE TABLE `itemPlacementSupply` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `itemFk` int(11) NOT NULL, - `quantity` decimal(10,0) NOT NULL DEFAULT '0', - `priority` int(10) unsigned NOT NULL DEFAULT '0', - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `quantity` decimal(10,0) NOT NULL DEFAULT 0, + `priority` int(10) unsigned NOT NULL DEFAULT 0, + `created` timestamp NOT NULL DEFAULT current_timestamp(), `userFk` int(10) unsigned NOT NULL COMMENT 'Persona que crea la orden', `repoUserFk` int(10) unsigned DEFAULT NULL COMMENT 'Reponedor que la tiene asignada', `sectorFk` int(11) DEFAULT NULL, @@ -34546,7 +34208,7 @@ CREATE TABLE `itemPlacementSupply` ( CONSTRAINT `itemPlacementSupply_fk2` FOREIGN KEY (`userFk`) REFERENCES `account`.`user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `itemPlacementSupply_fk3` FOREIGN KEY (`repoUserFk`) REFERENCES `account`.`user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `itemPlacementSupply_fk4` FOREIGN KEY (`sectorFk`) REFERENCES `sector` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Lista de nichos de picking que hay que reponer'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Lista de nichos de picking que hay que reponer'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -34599,7 +34261,7 @@ DROP TABLE IF EXISTS `itemProposal`; CREATE TABLE `itemProposal` ( `itemFk` int(11) NOT NULL, `mateFk` int(11) NOT NULL, - `counter` int(11) NOT NULL DEFAULT '0', + `counter` int(11) NOT NULL DEFAULT 0, PRIMARY KEY (`itemFk`,`mateFk`), KEY `itemProposal_fk2_idx` (`mateFk`), CONSTRAINT `itemProposal_fk1` FOREIGN KEY (`itemFk`) REFERENCES `item` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, @@ -34616,7 +34278,7 @@ DROP TABLE IF EXISTS `itemRepo__`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `itemRepo__` ( `itemFk` int(11) NOT NULL, - `quantity` int(10) unsigned NOT NULL DEFAULT '0', + `quantity` int(10) unsigned NOT NULL DEFAULT 0, PRIMARY KEY (`itemFk`), CONSTRAINT `itemRepo_fk1` FOREIGN KEY (`itemFk`) REFERENCES `item` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; @@ -34884,7 +34546,7 @@ CREATE TABLE `itemShelvingLog` ( `id` int(11) NOT NULL AUTO_INCREMENT, `itemShelvingFk` int(10) unsigned DEFAULT NULL, `workerFk` int(11) DEFAULT NULL, - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created` timestamp NOT NULL DEFAULT current_timestamp(), `accion` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `itemFk` int(11) DEFAULT NULL, `shelvingFk` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, @@ -34910,17 +34572,17 @@ CREATE TABLE `itemShelvingPlacementSupply` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `itemShelvingFk` int(10) unsigned NOT NULL, `itemPlacementSupplyFk` int(10) unsigned NOT NULL, - `quantity` decimal(10,0) NOT NULL DEFAULT '0', - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `quantity` decimal(10,0) NOT NULL DEFAULT 0, + `created` timestamp NOT NULL DEFAULT current_timestamp(), `userFk` int(10) unsigned NOT NULL, - `isPicked` tinyint(4) NOT NULL DEFAULT '0', + `isPicked` tinyint(4) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), KEY `itemShelvingPlacementSupply_fk1_idx` (`itemShelvingFk`), KEY `itemShelvingPlacementSupply_fk2_idx` (`itemPlacementSupplyFk`), KEY `itemShelvingPlacementSupply_fk3_idx` (`userFk`), CONSTRAINT `itemShelvingPlacementSupply_fk1` FOREIGN KEY (`itemShelvingFk`) REFERENCES `itemShelving` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `itemShelvingPlacementSupply_fk2` FOREIGN KEY (`itemPlacementSupplyFk`) REFERENCES `itemPlacementSupply` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Detalle de los itemShelving afectados por las ordenes de reposicion de nicho'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Detalle de los itemShelving afectados por las ordenes de reposicion de nicho'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -34959,8 +34621,8 @@ CREATE TABLE `itemShelvingSale` ( `id` int(11) NOT NULL AUTO_INCREMENT, `itemShelvingFk` int(10) unsigned NOT NULL, `saleFk` int(11) NOT NULL, - `quantity` decimal(10,0) NOT NULL DEFAULT '0', - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `quantity` decimal(10,0) NOT NULL DEFAULT 0, + `created` timestamp NOT NULL DEFAULT current_timestamp(), `userFk` int(11) unsigned NOT NULL, PRIMARY KEY (`id`), KEY `itemShelvingSale_fk1_idx` (`itemShelvingFk`), @@ -35109,7 +34771,7 @@ CREATE TABLE `itemTag` ( `tagFk` int(11) NOT NULL, `value` varchar(50) COLLATE utf8_unicode_ci NOT NULL, `intValue` int(11) DEFAULT NULL, - `priority` int(2) NOT NULL DEFAULT '0', + `priority` int(2) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), UNIQUE KEY `itemTagItemUq` (`itemFk`,`tagFk`), KEY `tagFk` (`tagFk`,`value`), @@ -35294,8 +34956,8 @@ CREATE TABLE `itemTaxCountry` ( `id` int(11) NOT NULL AUTO_INCREMENT, `itemFk` int(11) DEFAULT NULL, `countryFk` mediumint(8) unsigned DEFAULT NULL, - `taxClassFk` tinyint(3) unsigned NOT NULL DEFAULT '1', - `effectived` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `taxClassFk` tinyint(3) unsigned NOT NULL DEFAULT 1, + `effectived` timestamp NOT NULL DEFAULT current_timestamp(), PRIMARY KEY (`id`), UNIQUE KEY `itemFk_UNIQUE` (`itemFk`,`countryFk`), KEY `taxClassFK_idx` (`taxClassFk`), @@ -35340,29 +35002,29 @@ CREATE TABLE `itemType` ( `name` varchar(30) COLLATE utf8_unicode_ci NOT NULL, `gramsMin` int(11) DEFAULT NULL, `gramsMax` int(11) DEFAULT NULL, - `order` int(11) DEFAULT '0', + `order` int(11) DEFAULT 0, `categoryFk` int(10) unsigned NOT NULL, `workerFk` int(10) unsigned NOT NULL, - `isInventory` tinyint(4) NOT NULL DEFAULT '1' COMMENT 'Se utiliza tanto en el cálculo del inventario, como en el del informe del inventario valorado', - `created` timestamp NULL DEFAULT CURRENT_TIMESTAMP, - `f11` tinyint(4) NOT NULL DEFAULT '0', - `transaction` tinyint(4) NOT NULL DEFAULT '0', + `isInventory` tinyint(4) NOT NULL DEFAULT 1 COMMENT 'Se utiliza tanto en el cálculo del inventario, como en el del informe del inventario valorado', + `created` timestamp NULL DEFAULT current_timestamp(), + `f11` tinyint(4) NOT NULL DEFAULT 0, + `transaction` tinyint(4) NOT NULL DEFAULT 0, `making` int(10) unsigned DEFAULT NULL COMMENT 'Son productos de confección propia', `location` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, `life` smallint(5) unsigned DEFAULT NULL, - `maneuver` double NOT NULL DEFAULT '0.21', - `target` double NOT NULL DEFAULT '0.15', - `topMargin` double NOT NULL DEFAULT '0.3', - `profit` double NOT NULL DEFAULT '0.02', - `density` double NOT NULL DEFAULT '167' COMMENT 'Almacena el valor por defecto de la densidad en kg/m3 para el calculo de los portes aereos, en articulos se guarda la correcta', - `promo` double NOT NULL DEFAULT '0', - `isPackaging` tinyint(1) NOT NULL DEFAULT '0', - `hasComponents` tinyint(1) NOT NULL DEFAULT '1', - `warehouseFk` smallint(6) unsigned NOT NULL DEFAULT '60', - `compression` decimal(5,2) DEFAULT '1.00', + `maneuver` double NOT NULL DEFAULT 0.21, + `target` double NOT NULL DEFAULT 0.15, + `topMargin` double NOT NULL DEFAULT 0.3, + `profit` double NOT NULL DEFAULT 0.02, + `density` double NOT NULL DEFAULT 167 COMMENT 'Almacena el valor por defecto de la densidad en kg/m3 para el calculo de los portes aereos, en articulos se guarda la correcta', + `promo` double NOT NULL DEFAULT 0, + `isPackaging` tinyint(1) NOT NULL DEFAULT 0, + `hasComponents` tinyint(1) NOT NULL DEFAULT 1, + `warehouseFk` smallint(6) unsigned NOT NULL DEFAULT 60, + `compression` decimal(5,2) DEFAULT 1.00, `itemPackingTypeFk` varchar(1) COLLATE utf8_unicode_ci DEFAULT NULL, `temperatureFk` varchar(10) CHARACTER SET utf8 DEFAULT NULL, - `isUnconventionalSize` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'familia con productos cuyas medidas no son aptas para la cinta transportadora o paletizar', + `isUnconventionalSize` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'familia con productos cuyas medidas no son aptas para la cinta transportadora o paletizar', PRIMARY KEY (`code`), UNIQUE KEY `tipo_id_UNIQUE` (`id`), UNIQUE KEY `Tipo_UNIQUE` (`name`,`categoryFk`), @@ -35458,7 +35120,7 @@ CREATE TABLE `itemTypeRestriction` ( UNIQUE KEY `itemTypeRestriction_UN` (`itemTypeFk`,`dated`), KEY `itemTypeRestriction_dated_IDX` (`dated`,`itemTypeFk`) USING BTREE, CONSTRAINT `itemTypeRestriction_itemType_id_fk` FOREIGN KEY (`itemTypeFk`) REFERENCES `itemType` (`id`) ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -35472,7 +35134,7 @@ CREATE TABLE `itemTypeTag` ( `id` int(11) NOT NULL AUTO_INCREMENT, `itemTypeFk` smallint(5) unsigned NOT NULL, `tagFk` int(11) NOT NULL, - `priority` int(2) unsigned NOT NULL DEFAULT '0', + `priority` int(2) unsigned NOT NULL DEFAULT 0, PRIMARY KEY (`id`), UNIQUE KEY `itemTypeFk_UNIQUE` (`itemTypeFk`,`tagFk`), KEY `itemTypeTagTipo_idx` (`itemTypeFk`), @@ -35560,11 +35222,11 @@ DROP TABLE IF EXISTS `labourTree`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `labourTree` ( - `id` int(11) NOT NULL DEFAULT '0', + `id` int(11) NOT NULL DEFAULT 0, `name` varchar(45) COLLATE utf8_unicode_ci NOT NULL, `lft` int(11) NOT NULL, `rgt` int(11) NOT NULL, - `depth` bigint(22) NOT NULL DEFAULT '0', + `depth` bigint(22) NOT NULL DEFAULT 0, `sons` decimal(10,0) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; @@ -35674,9 +35336,9 @@ CREATE TABLE `machine` ( `type` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `use` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `productionYear` int(11) DEFAULT NULL, - `photo` blob, + `photo` blob DEFAULT NULL, `workerFk` int(10) unsigned DEFAULT NULL, - `companyFk` smallint(5) unsigned NOT NULL DEFAULT '442', + `companyFk` smallint(5) unsigned NOT NULL DEFAULT 442, `ppeFk` int(11) DEFAULT NULL, `supplierFk` int(11) DEFAULT NULL, PRIMARY KEY (`id`), @@ -35688,7 +35350,7 @@ CREATE TABLE `machine` ( CONSTRAINT `machine_FK` FOREIGN KEY (`ppeFk`) REFERENCES `ppe` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `machine_FK_1` FOREIGN KEY (`workerFk`) REFERENCES `worker` (`id`) ON UPDATE CASCADE, CONSTRAINT `machine_FK_2` FOREIGN KEY (`supplierFk`) REFERENCES `supplier` (`id`) ON DELETE SET NULL ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Maquinaria industrial, vehículos y demás elementos amortizables'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Maquinaria industrial, vehículos y demás elementos amortizables'; /*!40101 SET character_set_client = @saved_cs_client */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -35735,7 +35397,7 @@ CREATE TABLE `machineDetail` ( CONSTRAINT `machineDetail_FK` FOREIGN KEY (`machineFk`) REFERENCES `machine` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `machineDetail_FK_1` FOREIGN KEY (`workerFk`) REFERENCES `worker` (`id`) ON UPDATE CASCADE, CONSTRAINT `machineDetail_FK_2` FOREIGN KEY (`dmsFk`) REFERENCES `dms` (`id`) ON DELETE SET NULL ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -35754,7 +35416,7 @@ CREATE TABLE `machineDms` ( KEY `machineDms_FK` (`dmsFk`), CONSTRAINT `machineDms_FK` FOREIGN KEY (`dmsFk`) REFERENCES `dms` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `machineDms_FK_1` FOREIGN KEY (`machineFk`) REFERENCES `machine` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -35768,14 +35430,14 @@ CREATE TABLE `machineWorker` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `workerFk` int(10) unsigned NOT NULL, `machineFk` int(11) NOT NULL, - `inTimed` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, + `inTimed` datetime NOT NULL DEFAULT current_timestamp(), `outTimed` datetime DEFAULT NULL, PRIMARY KEY (`id`), KEY `machineWorker_FK_1` (`machineFk`), KEY `machineWorker_FK` (`workerFk`), CONSTRAINT `machineWorker_FK` FOREIGN KEY (`workerFk`) REFERENCES `worker` (`id`) ON UPDATE CASCADE, CONSTRAINT `machineWorker_FK_1` FOREIGN KEY (`machineFk`) REFERENCES `machine` (`id`) ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Registros horarios de vehículos de almacén por empleado'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Registros horarios de vehículos de almacén por empleado'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -35789,7 +35451,7 @@ CREATE TABLE `machineWorkerConfig` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `maxHours` smallint(5) unsigned NOT NULL COMMENT 'Indicates how many hours a user record is reviewed to update or insert', PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -35806,13 +35468,13 @@ CREATE TABLE `mail` ( `replyTo` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, `subject` varchar(100) COLLATE utf8_unicode_ci NOT NULL, `body` text COLLATE utf8_unicode_ci NOT NULL, - `sent` tinyint(2) NOT NULL DEFAULT '0', - `creationDate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `sent` tinyint(2) NOT NULL DEFAULT 0, + `creationDate` timestamp NOT NULL DEFAULT current_timestamp(), `attachment` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `status` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'OK', `senderFk` int(11) DEFAULT NULL, `recipientFk` int(11) DEFAULT NULL, - `plainTextBody` text COLLATE utf8_unicode_ci, + `plainTextBody` text COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), KEY `sent_idx` (`sent`), KEY `creation_idx` (`creationDate`) @@ -35857,7 +35519,7 @@ CREATE TABLE `mailTemplates` ( `name` varchar(50) CHARACTER SET utf8 NOT NULL, `attachmentPath` text CHARACTER SET utf8 NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -35872,7 +35534,7 @@ CREATE TABLE `mandate` ( `clientFk` int(11) NOT NULL, `companyFk` smallint(5) unsigned NOT NULL, `code` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, - `created` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + `created` timestamp NULL DEFAULT current_timestamp(), `finished` timestamp NULL DEFAULT NULL, `mandateTypeFk` smallint(5) NOT NULL, PRIMARY KEY (`id`), @@ -35933,11 +35595,11 @@ DROP TABLE IF EXISTS `manuscript`; CREATE TABLE `manuscript` ( `id` int(11) NOT NULL AUTO_INCREMENT, `code` varchar(45) CHARACTER SET utf8 NOT NULL, - `description` text COLLATE utf8_unicode_ci, - `enabled` tinyint(1) NOT NULL DEFAULT '1', + `description` text COLLATE utf8_unicode_ci DEFAULT NULL, + `enabled` tinyint(1) NOT NULL DEFAULT 1, PRIMARY KEY (`id`), UNIQUE KEY `code_UNIQUE` (`code`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -35951,7 +35613,7 @@ CREATE TABLE `medicalCenter` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(45) COLLATE utf8_unicode_ci NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -35970,13 +35632,13 @@ CREATE TABLE `medicalReview` ( `isFit` tinyint(1) DEFAULT NULL, `amount` double DEFAULT NULL, `invoice` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, - `remark` longtext COLLATE utf8_unicode_ci, + `remark` longtext COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), KEY `frgcenter_idx` (`centerFk`), KEY `frgnkWorker_idx` (`workerFk`), CONSTRAINT `frgcenter` FOREIGN KEY (`centerFk`) REFERENCES `medicalCenter` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `frgnkWorker` FOREIGN KEY (`workerFk`) REFERENCES `worker` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -35991,13 +35653,13 @@ CREATE TABLE `message` ( `uuid` varchar(50) CHARACTER SET utf8 NOT NULL, `sender` varchar(50) CHARACTER SET utf8 NOT NULL, `recipient` varchar(50) CHARACTER SET utf8 NOT NULL, - `message` longtext CHARACTER SET utf8, - `sendDate` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + `message` longtext CHARACTER SET utf8 DEFAULT NULL, + `sendDate` timestamp NULL DEFAULT current_timestamp(), PRIMARY KEY (`id`), KEY `sender` (`sender`), KEY `recipient` (`recipient`), KEY `uuid` (`uuid`(8)) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -36013,13 +35675,13 @@ CREATE TABLE `messageInbox` ( `sender` varchar(50) CHARACTER SET utf8 NOT NULL, `recipient` varchar(45) CHARACTER SET utf8 NOT NULL, `finalRecipient` varchar(50) CHARACTER SET utf8 NOT NULL, - `message` longtext CHARACTER SET utf8, - `sendDate` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + `message` longtext CHARACTER SET utf8 DEFAULT NULL, + `sendDate` timestamp NULL DEFAULT current_timestamp(), `read` varchar(45) CHARACTER SET utf8 NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `uuid` (`uuid`(8)), KEY `finalRecipient` (`finalRecipient`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -36073,7 +35735,7 @@ CREATE TABLE `mistakeType` ( `id` int(11) NOT NULL AUTO_INCREMENT, `description` varchar(45) COLLATE utf8_unicode_ci NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -36087,9 +35749,9 @@ CREATE TABLE `mobileAppVersionControl` ( `id` int(11) NOT NULL AUTO_INCREMENT, `appName` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, `version` varchar(45) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', - `IsVersionCritical` tinyint(1) DEFAULT '0', + `IsVersionCritical` tinyint(1) DEFAULT 0, PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Tabla para llevar el control de las Versions de las aplicaciones móvil '; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Tabla para llevar el control de las Versions de las aplicaciones móvil '; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -36155,12 +35817,12 @@ CREATE TABLE `noticeCategory` ( `keyName` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, `name` varchar(50) COLLATE utf8_unicode_ci NOT NULL, `subject` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, - `description` text COLLATE utf8_unicode_ci, - `isEnabled` tinyint(1) NOT NULL DEFAULT '1', - `requiredRole` int(11) NOT NULL DEFAULT '1', + `description` text COLLATE utf8_unicode_ci DEFAULT NULL, + `isEnabled` tinyint(1) NOT NULL DEFAULT 1, + `requiredRole` int(11) NOT NULL DEFAULT 1, PRIMARY KEY (`id`), UNIQUE KEY `keyName_UNIQUE` (`keyName`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -36171,8 +35833,8 @@ DROP TABLE IF EXISTS `noticeSubscription`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `noticeSubscription` ( - `noticeCategoryFk` int(11) NOT NULL DEFAULT '0', - `userFk` int(10) unsigned NOT NULL DEFAULT '0', + `noticeCategoryFk` int(11) NOT NULL DEFAULT 0, + `userFk` int(10) unsigned NOT NULL DEFAULT 0, PRIMARY KEY (`noticeCategoryFk`,`userFk`), KEY `noticeSubscription_ibfk_2` (`userFk`), CONSTRAINT `noticeSubscription_ibfk_1` FOREIGN KEY (`noticeCategoryFk`) REFERENCES `noticeCategory` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, @@ -36191,7 +35853,7 @@ CREATE TABLE `observationType` ( `id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT, `description` varchar(15) COLLATE utf8_unicode_ci NOT NULL, `code` varchar(45) COLLATE utf8_unicode_ci NOT NULL, - `hasNewBornMessage` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Indica aquellos que deben de recibir un mensaje advirtiendo de un cliente nuevo', + `hasNewBornMessage` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'Indica aquellos que deben de recibir un mensaje advirtiendo de un cliente nuevo', PRIMARY KEY (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -36219,7 +35881,7 @@ DROP TABLE IF EXISTS `orderTicket`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `orderTicket` ( `orderFk` int(10) unsigned NOT NULL, - `ticketFk` int(11) NOT NULL DEFAULT '0', + `ticketFk` int(11) NOT NULL DEFAULT 0, PRIMARY KEY (`ticketFk`,`orderFk`), KEY `order_id` (`orderFk`), CONSTRAINT `hedera_id` FOREIGN KEY (`orderFk`) REFERENCES `hedera`.`order` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, @@ -36238,10 +35900,10 @@ CREATE TABLE `origin` ( `id` tinyint(2) unsigned NOT NULL AUTO_INCREMENT, `code` varchar(3) COLLATE utf8_unicode_ci NOT NULL, `name` varchar(20) COLLATE utf8_unicode_ci NOT NULL, - `warehouseFk` smallint(5) unsigned DEFAULT '4', - `flag` blob, - `nl` tinyint(4) NOT NULL DEFAULT '0', - `countryFk` mediumint(8) unsigned NOT NULL DEFAULT '1', + `warehouseFk` smallint(5) unsigned DEFAULT 4, + `flag` blob DEFAULT NULL, + `nl` tinyint(4) NOT NULL DEFAULT 0, + `countryFk` mediumint(8) unsigned NOT NULL DEFAULT 1, PRIMARY KEY (`id`), UNIQUE KEY `Abreviatura` (`code`), KEY `warehouse_id` (`warehouseFk`), @@ -36308,7 +35970,7 @@ CREATE TABLE `packageChecked` ( PRIMARY KEY (`id`), UNIQUE KEY `entryFk_UNIQUE` (`itemFk`), KEY `fkItem_idx` (`itemFk`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -36351,28 +36013,28 @@ DROP TABLE IF EXISTS `packaging`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `packaging` ( `id` varchar(10) COLLATE utf8_unicode_ci NOT NULL, - `volume` decimal(10,2) DEFAULT '0.00', - `width` decimal(10,2) DEFAULT '0.00', - `depth` decimal(10,2) DEFAULT '0.00', - `height` decimal(10,2) DEFAULT '0.00', - `value` decimal(10,2) DEFAULT '0.00', - `isPackageReturnable` tinyint(1) NOT NULL DEFAULT '0', - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `volume` decimal(10,2) DEFAULT 0.00, + `width` decimal(10,2) DEFAULT 0.00, + `depth` decimal(10,2) DEFAULT 0.00, + `height` decimal(10,2) DEFAULT 0.00, + `value` decimal(10,2) DEFAULT 0.00, + `isPackageReturnable` tinyint(1) NOT NULL DEFAULT 0, + `created` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `packagingReturnFk` int(11) DEFAULT NULL, `lower` int(11) DEFAULT NULL, `upload` int(11) DEFAULT NULL, `base` decimal(10,2) DEFAULT NULL, `itemFk` int(11) DEFAULT NULL, `price` decimal(10,2) NOT NULL, - `isBox` tinyint(1) NOT NULL DEFAULT '0', + `isBox` tinyint(1) NOT NULL DEFAULT 0, `cubicPackage` decimal(10,2) DEFAULT NULL, - `returnCost` decimal(10,2) NOT NULL DEFAULT '0.00', + `returnCost` decimal(10,2) NOT NULL DEFAULT 0.00, `cmrName` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, `freightItemFk` int(11) DEFAULT NULL, - `hasCompressionVariations` tinyint(1) DEFAULT '0' COMMENT 'Floramondo puede servirlos no llenos del todo', + `hasCompressionVariations` tinyint(1) DEFAULT 0 COMMENT 'Floramondo puede servirlos no llenos del todo', `conveyorBuildingClassFk` int(11) DEFAULT NULL, - `isTrolley` tinyint(1) NOT NULL DEFAULT '0', - `isPallet` tinyint(1) NOT NULL DEFAULT '0', + `isTrolley` tinyint(1) NOT NULL DEFAULT 0, + `isPallet` tinyint(1) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), KEY `packaging_fk1` (`itemFk`), KEY `packaging_fk2_idx` (`freightItemFk`), @@ -36409,7 +36071,7 @@ DROP TABLE IF EXISTS `packagingGifts`; CREATE TABLE `packagingGifts` ( `id` int(11) NOT NULL AUTO_INCREMENT, `description` varchar(255) COLLATE utf8_unicode_ci NOT NULL, - `photo` blob, + `photo` blob DEFAULT NULL, `started` date NOT NULL, `ended` date NOT NULL, `warehouseFk` smallint(5) unsigned DEFAULT NULL, @@ -36422,7 +36084,7 @@ CREATE TABLE `packagingGifts` ( CONSTRAINT `PackagingGifts_FK` FOREIGN KEY (`provinceFk`) REFERENCES `province` (`id`), CONSTRAINT `PackagingGifts_FK_1` FOREIGN KEY (`warehouseFk`) REFERENCES `warehouse` (`id`), CONSTRAINT `PackagingGifts_FK_2` FOREIGN KEY (`countryFk`) REFERENCES `country` (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -36460,8 +36122,8 @@ CREATE TABLE `packingSiteLog` ( `workerFk` int(10) unsigned NOT NULL, `printerModelFk` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, `typeErrorFk` varchar(30) COLLATE utf8_unicode_ci DEFAULT NULL, - `creationDate` timestamp NULL DEFAULT CURRENT_TIMESTAMP, - `description` text COLLATE utf8_unicode_ci, + `creationDate` timestamp NULL DEFAULT current_timestamp(), + `description` text COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `packingSiteLog_UN` (`id`), KEY `packingSiteLog_FK` (`workerFk`), @@ -36472,7 +36134,7 @@ CREATE TABLE `packingSiteLog` ( CONSTRAINT `packingSiteLog_FK_1` FOREIGN KEY (`printerModelFk`) REFERENCES `printerModel` (`code`) ON UPDATE CASCADE, CONSTRAINT `packingSiteLog_FK_2` FOREIGN KEY (`packingSiteFk`) REFERENCES `packingSite` (`code`) ON UPDATE CASCADE, CONSTRAINT `packingSiteLog_FK_4` FOREIGN KEY (`typeErrorFk`) REFERENCES `packingSiteTypeError` (`code`) ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -36500,7 +36162,7 @@ CREATE TABLE `parking` ( `id` int(11) NOT NULL AUTO_INCREMENT, `column` varchar(5) CHARACTER SET utf8 DEFAULT '--', `row` varchar(5) CHARACTER SET utf8 DEFAULT '--', - `sectorFk` int(11) NOT NULL DEFAULT '2', + `sectorFk` int(11) NOT NULL DEFAULT 2, `code` varchar(8) CHARACTER SET utf8 DEFAULT NULL, `pickingOrder` int(11) DEFAULT NULL, PRIMARY KEY (`id`), @@ -36582,20 +36244,6 @@ CREATE TABLE `payDemDetail` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; --- --- Temporary table structure for view `payDemDetail__` --- - -DROP TABLE IF EXISTS `payDemDetail__`; -/*!50001 DROP VIEW IF EXISTS `payDemDetail__`*/; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; -/*!50001 CREATE TABLE `payDemDetail__` ( - `id` tinyint NOT NULL, - `detail` tinyint NOT NULL -) ENGINE=MyISAM */; -SET character_set_client = @saved_cs_client; - -- -- Table structure for table `payMethod` -- @@ -36608,13 +36256,13 @@ CREATE TABLE `payMethod` ( `code` varchar(50) CHARACTER SET utf8 DEFAULT NULL, `name` varchar(20) COLLATE utf8_unicode_ci NOT NULL, `solution` varchar(1) COLLATE utf8_unicode_ci DEFAULT NULL, - `outstandingDebt` tinyint(3) unsigned zerofill NOT NULL DEFAULT '000', - `graceDays` int(11) unsigned NOT NULL DEFAULT '0', - `isIbanRequiredForClients` tinyint(3) DEFAULT '0', - `isIbanRequiredForSuppliers` tinyint(3) DEFAULT '0', - `isNotified` tinyint(3) NOT NULL DEFAULT '1', - `hasVerified` tinyint(1) DEFAULT '0', - `graceMonthsDisableChecked` int(11) unsigned NOT NULL DEFAULT '0' COMMENT 'Deshabilita la comprobación de los datos bancarios de todos aquellos proveedores que no hayan recibido un pago en los meses especificados', + `outstandingDebt` tinyint(3) unsigned zerofill NOT NULL DEFAULT 000, + `graceDays` int(11) unsigned NOT NULL DEFAULT 0, + `isIbanRequiredForClients` tinyint(3) DEFAULT 0, + `isIbanRequiredForSuppliers` tinyint(3) DEFAULT 0, + `isNotified` tinyint(3) NOT NULL DEFAULT 1, + `hasVerified` tinyint(1) DEFAULT 0, + `graceMonthsDisableChecked` int(11) unsigned NOT NULL DEFAULT 0 COMMENT 'Deshabilita la comprobación de los datos bancarios de todos aquellos proveedores que no hayan recibido un pago en los meses especificados', PRIMARY KEY (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -36630,16 +36278,16 @@ CREATE TABLE `payment` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `received` date NOT NULL, `supplierFk` int(11) NOT NULL, - `amount` decimal(10,2) NOT NULL DEFAULT '0.00', - `currencyFk` tinyint(3) unsigned NOT NULL DEFAULT '1', + `amount` decimal(10,2) NOT NULL DEFAULT 0.00, + `currencyFk` tinyint(3) unsigned NOT NULL DEFAULT 1, `divisa` decimal(10,2) DEFAULT NULL, - `bankFk` int(11) NOT NULL DEFAULT '0', + `bankFk` int(11) NOT NULL DEFAULT 0, `payMethodFk` tinyint(3) unsigned NOT NULL, - `bankingFees` double(6,2) unsigned NOT NULL DEFAULT '0.00', + `bankingFees` double(6,2) unsigned NOT NULL DEFAULT 0.00, `concept` varchar(30) COLLATE utf8_unicode_ci DEFAULT NULL, - `companyFk` smallint(5) unsigned NOT NULL DEFAULT '442', - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - `isConciliated` tinyint(1) unsigned zerofill NOT NULL DEFAULT '0', + `companyFk` smallint(5) unsigned NOT NULL DEFAULT 442, + `created` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), + `isConciliated` tinyint(1) unsigned zerofill NOT NULL DEFAULT 0, `exchangeInsuranceFk` int(11) DEFAULT NULL, `dueDated` date DEFAULT NULL, `workerFk` int(10) unsigned DEFAULT NULL, @@ -36658,7 +36306,7 @@ CREATE TABLE `payment` ( CONSTRAINT `payment_FK` FOREIGN KEY (`workerFk`) REFERENCES `worker` (`id`), CONSTRAINT `payment_ibfk_1` FOREIGN KEY (`companyFk`) REFERENCES `company` (`id`) ON UPDATE CASCADE, CONSTRAINT `payment_ibfk_2` FOREIGN KEY (`bankFk`) REFERENCES `accounting` (`id`) ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -36831,30 +36479,6 @@ DELIMITER ; /*!50003 SET character_set_results = @saved_cs_results */ ; /*!50003 SET collation_connection = @saved_col_connection */ ; --- --- Temporary table structure for view `payment__` --- - -DROP TABLE IF EXISTS `payment__`; -/*!50001 DROP VIEW IF EXISTS `payment__`*/; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; -/*!50001 CREATE TABLE `payment__` ( - `id` tinyint NOT NULL, - `received` tinyint NOT NULL, - `dueDated` tinyint NOT NULL, - `supplierFk` tinyint NOT NULL, - `amount` tinyint NOT NULL, - `currencyFk` tinyint NOT NULL, - `divisa` tinyint NOT NULL, - `bankFk` tinyint NOT NULL, - `payMethodFk` tinyint NOT NULL, - `companyFk` tinyint NOT NULL, - `exchangeInsuranceFk` tinyint NOT NULL, - `isConciliated` tinyint NOT NULL -) ENGINE=MyISAM */; -SET character_set_client = @saved_cs_client; - -- -- Table structure for table `pcs` -- @@ -36863,13 +36487,13 @@ DROP TABLE IF EXISTS `pcs`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `pcs` ( - `created` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + `created` timestamp NULL DEFAULT current_timestamp(), `routeFk` int(10) unsigned DEFAULT NULL, `id` int(11) NOT NULL AUTO_INCREMENT, `pallet` int(11) DEFAULT NULL, `box` int(11) DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -36880,7 +36504,7 @@ DROP TABLE IF EXISTS `pcs_graf`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `pcs_graf` ( - `id` int(11) NOT NULL DEFAULT '0', + `id` int(11) NOT NULL DEFAULT 0, `dia` date DEFAULT NULL, `created` datetime DEFAULT NULL, `box` decimal(4,0) DEFAULT NULL, @@ -36906,7 +36530,7 @@ CREATE TABLE `pedidosInternos` ( `idArticle` int(11) DEFAULT NULL, `quantity` int(11) DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -36938,11 +36562,11 @@ CREATE TABLE `person` ( `birth` date DEFAULT NULL, `readerId` int(11) DEFAULT NULL, `workerFk` int(10) unsigned DEFAULT NULL, - `isDisable` tinyint(1) NOT NULL DEFAULT '0', - `isFreelance` tinyint(1) NOT NULL DEFAULT '0', - `isSsDiscounted` tinyint(1) NOT NULL DEFAULT '0', + `isDisable` tinyint(1) NOT NULL DEFAULT 0, + `isFreelance` tinyint(1) NOT NULL DEFAULT 0, + `isSsDiscounted` tinyint(1) NOT NULL DEFAULT 0, `nickname` varchar(15) COLLATE utf8_unicode_ci DEFAULT NULL, - `p2` longtext COLLATE utf8_unicode_ci, + `p2` longtext COLLATE utf8_unicode_ci DEFAULT NULL, `sex` enum('M','F') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'F' COMMENT 'M Masculino F Femenino', PRIMARY KEY (`id`), UNIQUE KEY `nif` (`fi`), @@ -36978,11 +36602,11 @@ CREATE TABLE `pgc` ( `code` varchar(10) COLLATE utf8_unicode_ci NOT NULL, `rate` decimal(10,2) NOT NULL, `name` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, - `cplusTaxBreakFk` int(10) unsigned DEFAULT '1', - `mod340` tinyint(1) NOT NULL DEFAULT '0', - `mod347` tinyint(1) NOT NULL DEFAULT '0', - `cplusTrascendency477Fk` int(10) unsigned DEFAULT '1', - `isEqualizated` tinyint(1) DEFAULT '0', + `cplusTaxBreakFk` int(10) unsigned DEFAULT 1, + `mod340` tinyint(1) NOT NULL DEFAULT 0, + `mod347` tinyint(1) NOT NULL DEFAULT 0, + `cplusTrascendency477Fk` int(10) unsigned DEFAULT 1, + `isEqualizated` tinyint(1) DEFAULT 0, PRIMARY KEY (`code`), KEY `pgc_fk1_idx` (`cplusTaxBreakFk`), KEY `pgc_fk2_idx` (`cplusTrascendency477Fk`), @@ -37033,7 +36657,7 @@ CREATE TABLE `plantpassport` ( `producerFk` mediumint(3) unsigned NOT NULL, `plantpassportAuthorityFk` mediumint(3) unsigned NOT NULL, `number` varchar(25) CHARACTER SET utf8 DEFAULT NULL, - `isRequested` tinyint(2) NOT NULL DEFAULT '0', + `isRequested` tinyint(2) NOT NULL DEFAULT 0, PRIMARY KEY (`producerFk`,`plantpassportAuthorityFk`), KEY `plantpassport_authority_idx` (`plantpassportAuthorityFk`), KEY `producer_id_idx` (`producerFk`), @@ -37177,11 +36801,11 @@ DROP TABLE IF EXISTS `ppe`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `ppe` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `amortization` decimal(10,2) NOT NULL DEFAULT '0.00', + `amortization` decimal(10,2) NOT NULL DEFAULT 0.00, `firstAmortizated` date DEFAULT NULL, `lastAmortizated` date DEFAULT NULL, `finished` date DEFAULT NULL, - `value` decimal(10,2) NOT NULL DEFAULT '0.00', + `value` decimal(10,2) NOT NULL DEFAULT 0.00, `planFk` int(11) NOT NULL, `groupFk` int(11) DEFAULT NULL, `account` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, @@ -37191,10 +36815,10 @@ CREATE TABLE `ppe` ( `location` varchar(30) COLLATE utf8_unicode_ci DEFAULT NULL, `discharged` date DEFAULT NULL, `cause` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, - `photo` blob, - `isInvestmentAsset` tinyint(4) NOT NULL DEFAULT '0', + `photo` blob DEFAULT NULL, + `isInvestmentAsset` tinyint(4) NOT NULL DEFAULT 0, `workerFk` int(10) unsigned DEFAULT NULL, - `companyFk` smallint(5) unsigned NOT NULL DEFAULT '442', + `companyFk` smallint(5) unsigned NOT NULL DEFAULT 442, `description` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), KEY `ppe_fk1_idx` (`workerFk`), @@ -37211,7 +36835,7 @@ CREATE TABLE `ppe` ( CONSTRAINT `ppe_fk5` FOREIGN KEY (`account`) REFERENCES `pgcMaster` (`code`) ON UPDATE CASCADE, CONSTRAINT `ppe_fk6` FOREIGN KEY (`endowment`) REFERENCES `pgcMaster` (`code`) ON UPDATE CASCADE, CONSTRAINT `ppe_fk7` FOREIGN KEY (`elementAccount`) REFERENCES `pgcMaster` (`code`) ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Property, plant & equipment\nInmvolizado, en español'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Property, plant & equipment\nInmvolizado, en español'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -37225,13 +36849,13 @@ CREATE TABLE `ppeComponent` ( `id` int(11) NOT NULL AUTO_INCREMENT, `ppeFk` int(11) NOT NULL, `invoiceInFk` mediumint(8) unsigned NOT NULL, - `amount` decimal(10,2) NOT NULL DEFAULT '0.00', + `amount` decimal(10,2) NOT NULL DEFAULT 0.00, PRIMARY KEY (`id`), KEY `ppeComponent_fk1_idx` (`ppeFk`), KEY `ppeComponent_fk2_idx` (`invoiceInFk`), CONSTRAINT `ppeComponent_fk1` FOREIGN KEY (`ppeFk`) REFERENCES `ppe` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `ppeComponent_fk2` FOREIGN KEY (`invoiceInFk`) REFERENCES `invoiceIn` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -37250,7 +36874,7 @@ CREATE TABLE `ppeDMS` ( KEY `ppeDMS_fk2_idx` (`ppeFk`), CONSTRAINT `ppeDMS_fk1` FOREIGN KEY (`dmsFk`) REFERENCES `dms` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `ppeDMS_fk2` FOREIGN KEY (`ppeFk`) REFERENCES `ppe` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -37264,7 +36888,7 @@ CREATE TABLE `ppeGroup` ( `id` int(11) NOT NULL AUTO_INCREMENT, `description` varchar(45) COLLATE utf8_unicode_ci NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Tipo de inmovilizado'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Tipo de inmovilizado'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -37276,10 +36900,10 @@ DROP TABLE IF EXISTS `ppePlan`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `ppePlan` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `rate` decimal(3,2) NOT NULL DEFAULT '1.00', - `days` int(11) NOT NULL DEFAULT '365', + `rate` decimal(3,2) NOT NULL DEFAULT 1.00, + `days` int(11) NOT NULL DEFAULT 365, PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Plan de amortizacion para la tabla ppe'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Plan de amortizacion para la tabla ppe'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -37297,9 +36921,9 @@ CREATE TABLE `priceFixed` ( `rate3` double NOT NULL, `started` date NOT NULL, `ended` date NOT NULL, - `bonus` double NOT NULL DEFAULT '0', - `warehouseFk` smallint(5) unsigned NOT NULL DEFAULT '0', - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `bonus` double NOT NULL DEFAULT 0, + `warehouseFk` smallint(5) unsigned NOT NULL DEFAULT 0, + `created` timestamp NOT NULL DEFAULT current_timestamp(), `id` int(11) NOT NULL AUTO_INCREMENT, `grouping` smallint(5) DEFAULT NULL, `packing` int(11) DEFAULT NULL, @@ -37377,15 +37001,15 @@ CREATE TABLE `printServerQueue` ( `printerFk` tinyint(3) unsigned DEFAULT NULL, `priorityFk` tinyint(3) unsigned DEFAULT NULL, `labelReportFk` tinyint(3) unsigned DEFAULT NULL, - `statusFk` tinyint(3) unsigned DEFAULT '1', + `statusFk` tinyint(3) unsigned DEFAULT 1, `started` datetime DEFAULT NULL, `finished` datetime DEFAULT NULL, `param1` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, `workerFk` int(11) DEFAULT NULL, `param2` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, - `param3` text COLLATE utf8_unicode_ci, - `error` text COLLATE utf8_unicode_ci, - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `param3` text COLLATE utf8_unicode_ci DEFAULT NULL, + `error` text COLLATE utf8_unicode_ci DEFAULT NULL, + `created` timestamp NOT NULL DEFAULT current_timestamp(), `reportFk__` tinyint(3) unsigned DEFAULT NULL, PRIMARY KEY (`id`), KEY `Id_estado` (`statusFk`), @@ -37410,15 +37034,15 @@ CREATE TABLE `printServerQueue2` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `printerFk` tinyint(3) unsigned DEFAULT NULL, `priorityFk` tinyint(3) unsigned DEFAULT NULL, - `reportFk` tinyint(3) unsigned DEFAULT '0', - `statusFk` tinyint(3) unsigned DEFAULT '1', + `reportFk` tinyint(3) unsigned DEFAULT 0, + `statusFk` tinyint(3) unsigned DEFAULT 1, `started` datetime DEFAULT NULL, `finished` datetime DEFAULT NULL, `param1` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, `workerFk` int(11) DEFAULT NULL, `param2` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, - `param3` text COLLATE utf8_unicode_ci, - `error` text COLLATE utf8_unicode_ci, + `param3` text COLLATE utf8_unicode_ci DEFAULT NULL, + `error` text COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `Id_Impresora_2` (`printerFk`,`priorityFk`,`reportFk`,`statusFk`,`param1`,`workerFk`,`param2`), KEY `Id_estado` (`statusFk`), @@ -37493,9 +37117,9 @@ DROP TABLE IF EXISTS `printingQueueCheck`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `printingQueueCheck` ( - `lastCount` int(11) unsigned NOT NULL DEFAULT '0', - `lastCheckSum` int(11) unsigned NOT NULL DEFAULT '0', - `isAlreadyNotified` tinyint(2) NOT NULL DEFAULT '0', + `lastCount` int(11) unsigned NOT NULL DEFAULT 0, + `lastCheckSum` int(11) unsigned NOT NULL DEFAULT 0, + `isAlreadyNotified` tinyint(2) NOT NULL DEFAULT 0, PRIMARY KEY (`lastCount`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Comprueba que el servidor de impresion no esta parado'; /*!40101 SET character_set_client = @saved_cs_client */; @@ -37510,8 +37134,8 @@ DROP TABLE IF EXISTS `producer`; CREATE TABLE `producer` ( `id` mediumint(3) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, - `isVisible` tinyint(1) NOT NULL DEFAULT '1', - `created` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + `isVisible` tinyint(1) NOT NULL DEFAULT 1, + `created` timestamp NULL DEFAULT current_timestamp(), PRIMARY KEY (`id`), UNIQUE KEY `name_UNIQUE` (`name`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; @@ -37586,7 +37210,7 @@ CREATE TABLE `professionalCategory` ( `salaryorSeniority` decimal(10,2) DEFAULT NULL, `year` int(2) DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -37599,7 +37223,7 @@ DROP TABLE IF EXISTS `profile`; CREATE TABLE `profile` ( `id` int(11) NOT NULL AUTO_INCREMENT, `personFk` int(11) DEFAULT NULL, - `profileTypeFk` int(11) NOT NULL DEFAULT '1', + `profileTypeFk` int(11) NOT NULL DEFAULT 1, PRIMARY KEY (`id`), KEY `personFk` (`personFk`), KEY `profileTypeFk` (`profileTypeFk`), @@ -37619,7 +37243,7 @@ CREATE TABLE `profileType` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(15) COLLATE utf8_unicode_ci NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -37631,14 +37255,14 @@ DROP TABLE IF EXISTS `project`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `project` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created` timestamp NOT NULL DEFAULT current_timestamp(), `name` varchar(100) COLLATE utf8_unicode_ci NOT NULL, - `photo` blob, + `photo` blob DEFAULT NULL, `started` date DEFAULT NULL, `finished` date DEFAULT NULL, `userFk` int(11) unsigned NOT NULL, `departmentFk` int(11) DEFAULT NULL, - `companyFk` smallint(5) unsigned NOT NULL DEFAULT '442', + `companyFk` smallint(5) unsigned NOT NULL DEFAULT 442, `location` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `amount` decimal(15,2) DEFAULT NULL, PRIMARY KEY (`id`), @@ -37648,7 +37272,7 @@ CREATE TABLE `project` ( CONSTRAINT `project_FK` FOREIGN KEY (`userFk`) REFERENCES `account`.`user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `project_FK_1` FOREIGN KEY (`departmentFk`) REFERENCES `department` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `project_FK_2` FOREIGN KEY (`companyFk`) REFERENCES `company` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Tabla master de proyectos'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Tabla master de proyectos'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -37660,7 +37284,7 @@ DROP TABLE IF EXISTS `projectNotes`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `projectNotes` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created` timestamp NOT NULL DEFAULT current_timestamp(), `txt` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `userFk` int(10) unsigned DEFAULT NULL, `projectFk` int(11) NOT NULL, @@ -37669,7 +37293,7 @@ CREATE TABLE `projectNotes` ( KEY `projectNotes_FK_1` (`userFk`), CONSTRAINT `projectNotes_FK` FOREIGN KEY (`projectFk`) REFERENCES `project` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `projectNotes_FK_1` FOREIGN KEY (`userFk`) REFERENCES `account`.`user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Historico de notas para project'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Historico de notas para project'; /*!40101 SET character_set_client = @saved_cs_client */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -37721,7 +37345,7 @@ CREATE TABLE `property` ( `value` int(11) DEFAULT NULL, `propertyGroupFk` int(11) NOT NULL, `companyFk` smallint(5) unsigned NOT NULL, - `photo` blob, + `photo` blob DEFAULT NULL, `allocation` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL, `m2` decimal(10,2) DEFAULT NULL, `tome` int(11) DEFAULT NULL, @@ -37734,7 +37358,7 @@ CREATE TABLE `property` ( CONSTRAINT `property_FK` FOREIGN KEY (`propertyGroupFk`) REFERENCES `propertyGroup` (`id`) ON UPDATE CASCADE, CONSTRAINT `property_FK_1` FOREIGN KEY (`townFk`) REFERENCES `town` (`id`) ON UPDATE CASCADE, CONSTRAINT `property_company` FOREIGN KEY (`companyFk`) REFERENCES `company` (`id`) ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -37753,7 +37377,7 @@ CREATE TABLE `propertyDms` ( KEY `propertyDms_FK_1` (`propertyFk`), CONSTRAINT `propertyDms_FK` FOREIGN KEY (`dmsFk`) REFERENCES `dms` (`id`) ON UPDATE CASCADE, CONSTRAINT `propertyDms_FK_1` FOREIGN KEY (`propertyFk`) REFERENCES `property` (`id`) ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -37767,7 +37391,7 @@ CREATE TABLE `propertyGroup` ( `id` int(11) NOT NULL AUTO_INCREMENT, `description` varchar(100) COLLATE utf8_unicode_ci NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -37788,7 +37412,7 @@ CREATE TABLE `propertyNotes` ( KEY `propertyNotes_FK` (`propertyFk`), CONSTRAINT `propertyNotes_FK` FOREIGN KEY (`propertyFk`) REFERENCES `property` (`id`), CONSTRAINT `propertyNotes_FK_1` FOREIGN KEY (`userFk`) REFERENCES `account`.`user` (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -37926,7 +37550,7 @@ DROP TABLE IF EXISTS `punchState`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `punchState` ( `workerFk` int(11) NOT NULL, - `state` tinyint(4) DEFAULT '1', + `state` tinyint(4) DEFAULT 1, `created` datetime DEFAULT NULL, PRIMARY KEY (`workerFk`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Table for storing punches that have cars with errors'; @@ -37940,7 +37564,7 @@ DROP TABLE IF EXISTS `queuePriority`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `queuePriority` ( - `id` tinyint(3) unsigned NOT NULL DEFAULT '0', + `id` tinyint(3) unsigned NOT NULL DEFAULT 0, `priority` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; @@ -38029,25 +37653,6 @@ CREATE TABLE `rateConfig` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; --- --- Temporary table structure for view `rate__` --- - -DROP TABLE IF EXISTS `rate__`; -/*!50001 DROP VIEW IF EXISTS `rate__`*/; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; -/*!50001 CREATE TABLE `rate__` ( - `id` tinyint NOT NULL, - `dated` tinyint NOT NULL, - `warehouseFk` tinyint NOT NULL, - `rate0` tinyint NOT NULL, - `rate1` tinyint NOT NULL, - `rate2` tinyint NOT NULL, - `rate3` tinyint NOT NULL -) ENGINE=MyISAM */; -SET character_set_client = @saved_cs_client; - -- -- Table structure for table `receipt` -- @@ -38058,15 +37663,15 @@ DROP TABLE IF EXISTS `receipt`; CREATE TABLE `receipt` ( `Id` int(11) NOT NULL AUTO_INCREMENT, `invoiceFk` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'nombre incorrecto, renombrar a description', - `amountPaid` decimal(10,2) NOT NULL DEFAULT '0.00', - `amountUnpaid__` decimal(10,2) NOT NULL DEFAULT '0.00', + `amountPaid` decimal(10,2) NOT NULL DEFAULT 0.00, + `amountUnpaid__` decimal(10,2) NOT NULL DEFAULT 0.00, `payed` datetime DEFAULT NULL, `workerFk` int(10) unsigned DEFAULT NULL, - `bankFk` int(11) DEFAULT '0', - `clientFk` int(11) DEFAULT '0', - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - `companyFk` smallint(5) unsigned NOT NULL DEFAULT '442', - `isConciliate` tinyint(1) unsigned zerofill NOT NULL DEFAULT '0', + `bankFk` int(11) DEFAULT 0, + `clientFk` int(11) DEFAULT 0, + `created` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), + `companyFk` smallint(5) unsigned NOT NULL DEFAULT 442, + `isConciliate` tinyint(1) unsigned zerofill NOT NULL DEFAULT 0, PRIMARY KEY (`Id`), KEY `Id_Banco` (`bankFk`), KEY `Id_Trabajador` (`workerFk`), @@ -38210,13 +37815,13 @@ CREATE TABLE `recipe` ( `originFk` tinyint(2) unsigned DEFAULT NULL, `typeFk` smallint(5) unsigned DEFAULT NULL, `longName` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, - `quantity` int(11) NOT NULL DEFAULT '1', + `quantity` int(11) NOT NULL DEFAULT 1, `element` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, `inkFk` varchar(3) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), KEY `recipe_ix_1` (`element`), KEY `recipe_ix_2` (`itemFk`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -38235,7 +37840,7 @@ CREATE TABLE `recipe_log` ( KEY `recipe_log_ix1` (`recipe_ItemFk`), KEY `recipe_log_ix2` (`element`), KEY `recipe_log_ix3` (`selected_ItemFk`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Almacena las decisiones tomadas al generar recetas'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Almacena las decisiones tomadas al generar recetas'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -38247,11 +37852,11 @@ DROP TABLE IF EXISTS `recovery`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `recovery` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `clientFk` int(11) NOT NULL DEFAULT '0', + `clientFk` int(11) NOT NULL DEFAULT 0, `started` date NOT NULL COMMENT 'Fecha a partir de la que comienza el recobro', `finished` date DEFAULT NULL COMMENT 'Fecha en la que acaba', `amount` double NOT NULL, - `period` tinyint(3) unsigned NOT NULL DEFAULT '7' COMMENT 'numero de dias que indica cada cuanto hare el recobro', + `period` tinyint(3) unsigned NOT NULL DEFAULT 7 COMMENT 'numero de dias que indica cada cuanto hare el recobro', PRIMARY KEY (`id`), KEY `cliente_idx` (`clientFk`), CONSTRAINT `cliente333` FOREIGN KEY (`clientFk`) REFERENCES `client` (`id`) ON UPDATE CASCADE, @@ -38300,7 +37905,7 @@ DROP TABLE IF EXISTS `referenceRateConfig`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `referenceRateConfig` ( - `simulatedValue` float unsigned NOT NULL DEFAULT '1.2309', + `simulatedValue` float unsigned NOT NULL DEFAULT 1.2309, PRIMARY KEY (`simulatedValue`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -38335,7 +37940,7 @@ CREATE TABLE `route` ( `vehicleFk` int(10) unsigned DEFAULT NULL, `agencyModeFk` int(11) DEFAULT NULL, `time` datetime DEFAULT NULL, - `isOk` tinyint(1) unsigned NOT NULL DEFAULT '0', + `isOk` tinyint(1) unsigned NOT NULL DEFAULT 0, `kmStart` mediumint(9) NOT NULL, `kmEnd` mediumint(9) NOT NULL, `started` datetime NOT NULL, @@ -38343,9 +37948,9 @@ CREATE TABLE `route` ( `gestdocFk` int(11) DEFAULT NULL, `cost` double unsigned DEFAULT NULL, `m3` decimal(10,1) unsigned DEFAULT NULL, - `description` text COLLATE utf8_unicode_ci, + `description` text COLLATE utf8_unicode_ci DEFAULT NULL, `zoneFk` int(11) DEFAULT NULL, - `priority` int(11) NOT NULL DEFAULT '0', + `priority` int(11) NOT NULL DEFAULT 0, `invoiceInFk` mediumint(8) unsigned DEFAULT NULL, `beachFk` int(11) DEFAULT NULL, PRIMARY KEY (`id`), @@ -38459,7 +38064,7 @@ CREATE TABLE `routeAction` ( `name` varchar(45) COLLATE utf8_unicode_ci NOT NULL, `price` decimal(10,2) DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -38480,7 +38085,7 @@ CREATE TABLE `routeComplement` ( KEY `fgn_routeActionFk_idx` (`routeActionFk`), CONSTRAINT `fgn_routeActionFk` FOREIGN KEY (`routeActionFk`) REFERENCES `routeAction` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `fgn_workerFk` FOREIGN KEY (`workerFk`) REFERENCES `worker` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -38512,7 +38117,7 @@ CREATE TABLE `routeConfig` ( `distributionM3Category2` decimal(5,2) DEFAULT NULL, `plusCategory1Concept` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, `plusCategory2Concept` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, - `defaultCompanyFk` smallint(5) unsigned DEFAULT '442', + `defaultCompanyFk` smallint(5) unsigned DEFAULT 442, PRIMARY KEY (`id`), KEY `routeConfig_FK` (`defaultCompanyFk`), CONSTRAINT `routeConfig_FK` FOREIGN KEY (`defaultCompanyFk`) REFERENCES `company` (`id`) @@ -38530,20 +38135,20 @@ CREATE TABLE `routeGate` ( `deviceId` varchar(30) CHARACTER SET utf8 NOT NULL, `displayText` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `status` set('idle','doing','done','') CHARACTER SET utf8 DEFAULT 'idle', - `gateAreaFk` int(11) NOT NULL DEFAULT '1', + `gateAreaFk` int(11) NOT NULL DEFAULT 1, `routeFk` int(11) NOT NULL, `freeTickets` int(11) DEFAULT NULL, `expeditions` int(11) DEFAULT NULL, `scanned` int(11) DEFAULT NULL, - `flag` blob, + `flag` blob DEFAULT NULL, `pallets` int(11) DEFAULT NULL, `lastScanned` datetime DEFAULT NULL, - `ready` tinyint(4) NOT NULL DEFAULT '0', + `ready` tinyint(4) NOT NULL DEFAULT 0, `id` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`id`), UNIQUE KEY `routeFk_UNIQUE` (`routeFk`), KEY `routeGate_fk1_idx` (`gateAreaFk`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -38608,11 +38213,11 @@ CREATE TABLE `routeLog` ( `originFk` int(10) unsigned NOT NULL, `userFk` int(10) unsigned DEFAULT NULL, `action` set('insert','update','delete') COLLATE utf8_unicode_ci NOT NULL, - `creationDate` timestamp NULL DEFAULT CURRENT_TIMESTAMP, - `description` text CHARACTER SET utf8, + `creationDate` timestamp NULL DEFAULT current_timestamp(), + `description` text CHARACTER SET utf8 DEFAULT NULL, `changedModel` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, - `oldInstance` text COLLATE utf8_unicode_ci, - `newInstance` text COLLATE utf8_unicode_ci, + `oldInstance` text COLLATE utf8_unicode_ci DEFAULT NULL, + `newInstance` text COLLATE utf8_unicode_ci DEFAULT NULL, `changedModelId` int(11) DEFAULT NULL, `changedModelValue` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), @@ -38620,7 +38225,7 @@ CREATE TABLE `routeLog` ( KEY `userFk` (`userFk`), CONSTRAINT `routeLog_ibfk_1` FOREIGN KEY (`originFk`) REFERENCES `route` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `routeLog_ibfk_2` FOREIGN KEY (`userFk`) REFERENCES `account`.`user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -38651,7 +38256,7 @@ CREATE TABLE `routeUserPercentage` ( PRIMARY KEY (`id`), KEY `routeUserPercentageFk_idx` (`workerFk`), CONSTRAINT `routeUserPercentageFk` FOREIGN KEY (`workerFk`) REFERENCES `worker` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -38673,12 +38278,12 @@ CREATE TABLE `routesMonitor` ( `dated` date DEFAULT NULL, `dockFk` int(11) DEFAULT NULL, `m3` decimal(10,1) DEFAULT NULL, - `priority` int(11) NOT NULL DEFAULT '0', + `priority` int(11) NOT NULL DEFAULT 0, `etd` time DEFAULT NULL, `expeditionTruckFk` int(11) DEFAULT NULL, `m3boxes` decimal(10,1) DEFAULT NULL, `bufferFk` int(11) DEFAULT NULL COMMENT 'Buffer del sorter por el que se quiere sacar esa ruta', - `isPickingAllowed` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Los tickets de esta ruta se pueden preparar', + `isPickingAllowed` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'Los tickets de esta ruta se pueden preparar', PRIMARY KEY (`routeFk`), KEY `routesMonitor_FK` (`bufferFk`), CONSTRAINT `routesMonitor_FK` FOREIGN KEY (`bufferFk`) REFERENCES `srt`.`buffer` (`id`) ON DELETE SET NULL ON UPDATE CASCADE @@ -38697,16 +38302,16 @@ CREATE TABLE `sale` ( `itemFk` int(11) NOT NULL, `ticketFk` int(11) NOT NULL, `concept` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, - `quantity` decimal(10,2) NOT NULL DEFAULT '0.00', + `quantity` decimal(10,2) NOT NULL DEFAULT 0.00, `originalQuantity` double(9,1) DEFAULT NULL, - `price` decimal(10,2) DEFAULT '0.00', - `discount` tinyint(2) unsigned NOT NULL DEFAULT '0', - `priceFixed` decimal(10,2) NOT NULL DEFAULT '0.00', - `reserved` tinyint(1) NOT NULL DEFAULT '0', - `isPicked` tinyint(1) NOT NULL DEFAULT '0', - `isPriceFixed` tinyint(1) NOT NULL DEFAULT '0', - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - `isAdded` tinyint(1) NOT NULL DEFAULT '0', + `price` decimal(10,2) DEFAULT 0.00, + `discount` tinyint(2) unsigned NOT NULL DEFAULT 0, + `priceFixed` decimal(10,2) NOT NULL DEFAULT 0.00, + `reserved` tinyint(1) NOT NULL DEFAULT 0, + `isPicked` tinyint(1) NOT NULL DEFAULT 0, + `isPriceFixed` tinyint(1) NOT NULL DEFAULT 0, + `created` timestamp NOT NULL DEFAULT current_timestamp(), + `isAdded` tinyint(1) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), KEY `Id_Ticket` (`ticketFk`), KEY `itemFk_ticketFk` (`itemFk`,`ticketFk`), @@ -38751,7 +38356,7 @@ BEGIN JOIN vn.route r ON r.id = t.routeFk WHERE r.isOk = FALSE AND s.id = NEW.id - AND r.created >= CURDATE() + AND r.created >= util.VN_CURDATE() GROUP BY r.id; END IF; @@ -38878,7 +38483,7 @@ BEGIN JOIN vn.route r ON r.id = t.routeFk WHERE r.isOk = FALSE AND s.id = NEW.id - AND r.created >= CURDATE() + AND r.created >= util.VN_CURDATE() GROUP BY r.id; END IF; @@ -38924,7 +38529,7 @@ BEGIN JOIN vn.route r ON r.id = t.routeFk WHERE r.isOk = FALSE AND s.id = OLD.id - AND r.created >= CURDATE() + AND r.created >= util.VN_CURDATE() GROUP BY r.id; END IF; END */;; @@ -39000,7 +38605,7 @@ DROP TABLE IF EXISTS `saleBuy`; CREATE TABLE `saleBuy` ( `saleFk` int(11) NOT NULL, `buyFk` int(11) NOT NULL, - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created` timestamp NOT NULL DEFAULT current_timestamp(), `workerFk` int(11) DEFAULT NULL, PRIMARY KEY (`saleFk`), KEY `saleBuy_FK` (`buyFk`), @@ -39065,7 +38670,7 @@ DROP TABLE IF EXISTS `saleChecked`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `saleChecked` ( `saleFk` int(11) NOT NULL, - `isChecked` int(11) NOT NULL DEFAULT '0', + `isChecked` int(11) NOT NULL DEFAULT 0, PRIMARY KEY (`saleFk`), CONSTRAINT `fk_Movimientos_checked_1` FOREIGN KEY (`saleFk`) REFERENCES `sale` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; @@ -39099,8 +38704,8 @@ CREATE TABLE `saleComponent` ( `saleFk` int(11) NOT NULL, `componentFk` int(11) NOT NULL, `value` double NOT NULL, - `isGreuge` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'Indica si ya se ha tenido en cuenta para calcular el greuge', - `created` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `isGreuge` tinyint(4) NOT NULL DEFAULT 0 COMMENT 'Indica si ya se ha tenido en cuenta para calcular el greuge', + `created` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), PRIMARY KEY (`saleFk`,`componentFk`), KEY `fk_mov_comp_idx` (`componentFk`), CONSTRAINT `mc_fk1` FOREIGN KEY (`saleFk`) REFERENCES `sale` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, @@ -39145,7 +38750,7 @@ CREATE TABLE `saleGoal` ( `goal` decimal(10,2) DEFAULT NULL, `goalType` smallint(6) DEFAULT NULL COMMENT 'grado', PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -39157,12 +38762,12 @@ DROP TABLE IF EXISTS `saleGroup`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `saleGroup` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created` timestamp NOT NULL DEFAULT current_timestamp(), `userFk` int(11) DEFAULT NULL, `parkingFk` int(11) DEFAULT NULL, `sectorFk` int(11) DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='agrupa lineas de venta'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='agrupa lineas de venta'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -39174,7 +38779,7 @@ DROP TABLE IF EXISTS `saleGroupDetail`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `saleGroupDetail` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created` timestamp NOT NULL DEFAULT current_timestamp(), `saleFk` int(11) NOT NULL, `saleGroupFk` int(11) NOT NULL, PRIMARY KEY (`id`), @@ -39182,7 +38787,7 @@ CREATE TABLE `saleGroupDetail` ( KEY `saleGroupDetail_FK_1` (`saleGroupFk`), CONSTRAINT `saleGroupDetail_FK` FOREIGN KEY (`saleFk`) REFERENCES `sale` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `saleGroupDetail_FK_1` FOREIGN KEY (`saleGroupFk`) REFERENCES `saleGroup` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='relaciona sale y saleGroup'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='relaciona sale y saleGroup'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -39196,12 +38801,12 @@ CREATE TABLE `saleItemShelving__` ( `id` int(11) NOT NULL AUTO_INCREMENT, `saleFk` int(11) NOT NULL, `itemShelvingFk` int(10) unsigned NOT NULL, - `quantity` int(11) NOT NULL DEFAULT '0', - `isPicked` tinyint(4) NOT NULL DEFAULT '0', + `quantity` int(11) NOT NULL DEFAULT 0, + `isPicked` tinyint(4) NOT NULL DEFAULT 0, `ubication` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), KEY `saleItemShelving_fk1_idx` (`itemShelvingFk`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -39216,7 +38821,7 @@ CREATE TABLE `saleMistake` ( `saleFk` int(11) NOT NULL, `userFk` int(10) unsigned NOT NULL COMMENT 'Controlador', `typeFk` int(11) NOT NULL, - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created` timestamp NOT NULL DEFAULT current_timestamp(), PRIMARY KEY (`id`), KEY `saleMistake_fk1_idx` (`saleFk`), KEY `saleMistake_fk2_idx` (`userFk`), @@ -39224,7 +38829,7 @@ CREATE TABLE `saleMistake` ( CONSTRAINT `saleMistake_fk1` FOREIGN KEY (`saleFk`) REFERENCES `sale` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `saleMistake_fk2` FOREIGN KEY (`userFk`) REFERENCES `worker` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `saleMistake_fk3` FOREIGN KEY (`typeFk`) REFERENCES `mistakeType` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -39294,14 +38899,14 @@ CREATE TABLE `saleParking__` ( `id` int(11) NOT NULL AUTO_INCREMENT, `saleFk` int(11) NOT NULL, `parkingFk` int(11) NOT NULL, - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created` timestamp NOT NULL DEFAULT current_timestamp(), `userFk` int(11) DEFAULT NULL, PRIMARY KEY (`id`), KEY `saleParking_FK` (`saleFk`), KEY `saleParking_FK_1` (`parkingFk`), CONSTRAINT `saleParking_FK` FOREIGN KEY (`saleFk`) REFERENCES `sale` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `saleParking_FK_1` FOREIGN KEY (`parkingFk`) REFERENCES `parking` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='ubica las lineas de venta preparadas previamente'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='ubica las lineas de venta preparadas previamente'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -39343,8 +38948,8 @@ DROP TABLE IF EXISTS `saleTracking`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `saleTracking` ( `saleFk` int(11) NOT NULL, - `isChecked` tinyint(3) unsigned NOT NULL DEFAULT '0', - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `isChecked` tinyint(3) unsigned NOT NULL DEFAULT 0, + `created` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `originalQuantity` double DEFAULT NULL, `workerFk` int(11) NOT NULL, `actionFk` int(11) NOT NULL, @@ -39569,39 +39174,6 @@ SET character_set_client = utf8; ) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; --- --- Temporary table structure for view `salesToPrePrepare__` --- - -DROP TABLE IF EXISTS `salesToPrePrepare__`; -/*!50001 DROP VIEW IF EXISTS `salesToPrePrepare__`*/; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; -/*!50001 CREATE TABLE `salesToPrePrepare__` ( - `Id_Ticket` tinyint NOT NULL, - `Id_Movimiento` tinyint NOT NULL, - `Id_Movimiento_mark` tinyint NOT NULL, - `Id_Trabjador` tinyint NOT NULL, - `isChecked` tinyint NOT NULL, - `created` tinyint NOT NULL, - `Id_Article` tinyint NOT NULL, - `Concepte` tinyint NOT NULL, - `subName` tinyint NOT NULL, - `Cantidad` tinyint NOT NULL, - `original_quantity` tinyint NOT NULL, - `Hora` tinyint NOT NULL, - `Departure` tinyint NOT NULL, - `Minuto` tinyint NOT NULL, - `agency_id` tinyint NOT NULL, - `warehouse_id` tinyint NOT NULL, - `province_id` tinyint NOT NULL, - `picked` tinyint NOT NULL, - `trabajador` tinyint NOT NULL, - `sectorFk` tinyint NOT NULL, - `stateFk` tinyint NOT NULL -) ENGINE=MyISAM */; -SET character_set_client = @saved_cs_client; - -- -- Table structure for table `sample` -- @@ -39613,10 +39185,10 @@ CREATE TABLE `sample` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `code` varchar(25) CHARACTER SET utf8 NOT NULL, `description` varchar(105) COLLATE utf8_unicode_ci NOT NULL, - `isVisible` tinyint(1) unsigned NOT NULL DEFAULT '1', - `hasCompany` tinyint(1) unsigned NOT NULL DEFAULT '0', - `hasPreview` tinyint(1) unsigned NOT NULL DEFAULT '1', - `datepickerEnabled` tinyint(1) NOT NULL DEFAULT '0', + `isVisible` tinyint(1) unsigned NOT NULL DEFAULT 1, + `hasCompany` tinyint(1) unsigned NOT NULL DEFAULT 0, + `hasPreview` tinyint(1) unsigned NOT NULL DEFAULT 1, + `datepickerEnabled` tinyint(1) NOT NULL DEFAULT 0, PRIMARY KEY (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -39631,22 +39203,22 @@ DROP TABLE IF EXISTS `sector`; CREATE TABLE `sector` ( `id` int(11) NOT NULL AUTO_INCREMENT, `description` varchar(45) COLLATE utf8_unicode_ci NOT NULL, - `warehouseFk` smallint(6) unsigned NOT NULL DEFAULT '1', - `isPreviousPreparedByPacking` tinyint(4) NOT NULL DEFAULT '1', + `warehouseFk` smallint(6) unsigned NOT NULL DEFAULT 1, + `isPreviousPreparedByPacking` tinyint(4) NOT NULL DEFAULT 1, `code` varchar(15) COLLATE utf8_unicode_ci DEFAULT NULL, `pickingPlacement` varchar(15) COLLATE utf8_unicode_ci DEFAULT NULL, `path` int(11) DEFAULT NULL, - `isPreviousPrepared` tinyint(1) NOT NULL DEFAULT '0', - `isPackagingArea` tinyint(1) NOT NULL DEFAULT '0', + `isPreviousPrepared` tinyint(1) NOT NULL DEFAULT 0, + `isPackagingArea` tinyint(1) NOT NULL DEFAULT 0, `labelReportFk` tinyint(3) unsigned DEFAULT NULL, `sonFk` int(11) DEFAULT NULL, - `isMain` tinyint(1) NOT NULL DEFAULT '0', + `isMain` tinyint(1) NOT NULL DEFAULT 0, `itemPackingTypeFk` varchar(1) COLLATE utf8_unicode_ci DEFAULT NULL, `workerFk` int(11) DEFAULT NULL, `labelReport__` tinyint(3) DEFAULT NULL, `printerFk` tinyint(3) unsigned DEFAULT NULL, - `isHideForPickers` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'sector a ocultar a los sacadores', - `isReserve` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Sectores de reserva, como Albenfruit o Fuentes', + `isHideForPickers` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'sector a ocultar a los sacadores', + `isReserve` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'Sectores de reserva, como Albenfruit o Fuentes', PRIMARY KEY (`id`,`warehouseFk`), UNIQUE KEY `code_UNIQUE` (`code`), KEY `sector_fk1_idx` (`warehouseFk`), @@ -39665,7 +39237,7 @@ DROP TABLE IF EXISTS `sectorCollection`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `sectorCollection` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created` timestamp NOT NULL DEFAULT current_timestamp(), `userFk` int(10) unsigned NOT NULL, `sectorFk` int(11) NOT NULL, PRIMARY KEY (`id`), @@ -39673,7 +39245,7 @@ CREATE TABLE `sectorCollection` ( KEY `sectorCollection_FK_2` (`sectorFk`), CONSTRAINT `sectorCollection_FK` FOREIGN KEY (`userFk`) REFERENCES `account`.`user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `sectorCollection_FK_1` FOREIGN KEY (`sectorFk`) REFERENCES `sector` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Las lineas de preparacion de pedidos por sectores se agrupan bajo el identificador de esta tabla'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Las lineas de preparacion de pedidos por sectores se agrupan bajo el identificador de esta tabla'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -39685,7 +39257,7 @@ DROP TABLE IF EXISTS `sectorCollectionSaleGroup`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `sectorCollectionSaleGroup` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created` timestamp NOT NULL DEFAULT current_timestamp(), `sectorCollectionFk` int(11) NOT NULL, `saleGroupFk` int(11) NOT NULL, PRIMARY KEY (`id`), @@ -39693,7 +39265,7 @@ CREATE TABLE `sectorCollectionSaleGroup` ( KEY `sectorCollectionSaleGroup_FK_1` (`saleGroupFk`), CONSTRAINT `sectorCollectionSaleGroup_FK` FOREIGN KEY (`sectorCollectionFk`) REFERENCES `sectorCollection` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `sectorCollectionSaleGroup_FK_1` FOREIGN KEY (`saleGroupFk`) REFERENCES `saleGroup` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Relaciona las lineas de venta con la coleccion del sector'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Relaciona las lineas de venta con la coleccion del sector'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -39716,7 +39288,7 @@ CREATE TABLE `sectorProductivity` ( `hourWorked` decimal(10,2) DEFAULT NULL, `dated` date DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -39732,13 +39304,13 @@ CREATE TABLE `sharingCart` ( `started` date NOT NULL, `ended` date NOT NULL, `workerSubstitute` int(10) unsigned NOT NULL, - `created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `created` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), PRIMARY KEY (`id`), UNIQUE KEY `workerFk_UNIQUE` (`workerFk`,`started`,`ended`,`workerSubstitute`), KEY `Suplent` (`workerSubstitute`), CONSTRAINT `Suplent_key` FOREIGN KEY (`workerSubstitute`) REFERENCES `worker` (`id`) ON UPDATE CASCADE, CONSTRAINT `Trabajador_key` FOREIGN KEY (`workerFk`) REFERENCES `worker` (`id`) ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -39836,7 +39408,7 @@ CREATE TABLE `sharingCartDaily` ( `ownerFk` int(10) unsigned NOT NULL, `substituteFk` int(10) unsigned NOT NULL, `dated` date NOT NULL, - `created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `created` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), PRIMARY KEY (`id`), UNIQUE KEY `sharingCartDailyWorker_idx` (`ownerFk`,`dated`), KEY `sharingCartDailySubstitute_idx` (`substituteFk`), @@ -39863,7 +39435,7 @@ CREATE TABLE `sharingClient` ( KEY `Client` (`clientFk`), CONSTRAINT `Clients_key` FOREIGN KEY (`clientFk`) REFERENCES `client` (`id`) ON UPDATE CASCADE, CONSTRAINT `Trabajadores_key` FOREIGN KEY (`workerFk`) REFERENCES `worker` (`id`) ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -39878,8 +39450,8 @@ DELIMITER ;; BEFORE INSERT ON `sharingClient` FOR EACH ROW BEGIN - SET NEW.ended = GREATEST(CURDATE(),NEW.ended); - SET NEW.started = GREATEST(CURDATE(),NEW.started); + SET NEW.ended = GREATEST(util.VN_CURDATE(),NEW.ended); + SET NEW.started = GREATEST(util.VN_CURDATE(),NEW.started); END */;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -39899,8 +39471,8 @@ DELIMITER ;; BEFORE UPDATE ON `sharingClient` FOR EACH ROW BEGIN - SET NEW.ended = GREATEST(CURDATE(),NEW.ended); - SET NEW.started = GREATEST(CURDATE(),NEW.started); + SET NEW.ended = GREATEST(util.VN_CURDATE(),NEW.ended); + SET NEW.started = GREATEST(util.VN_CURDATE(),NEW.started); END */;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -39918,12 +39490,12 @@ DROP TABLE IF EXISTS `shelving`; CREATE TABLE `shelving` ( `code` varchar(10) CHARACTER SET utf8 NOT NULL, `parkingFk` int(11) DEFAULT NULL, - `isPrinted` tinyint(4) NOT NULL DEFAULT '0', - `priority` int(11) NOT NULL DEFAULT '0', - `parked` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `isPrinted` tinyint(4) NOT NULL DEFAULT 0, + `priority` int(11) NOT NULL DEFAULT 0, + `parked` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `userFk` int(10) unsigned DEFAULT NULL, - `isSpam` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'señala las matrículas con producto que se puede llevar a la reserva', - `isRecyclable` tinyint(1) NOT NULL DEFAULT '1' COMMENT 'las matrículas marcadas como reciclables se liberan cada noche desde vn.shelving_clean para poder volver a utilizarlas', + `isSpam` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'señala las matrículas con producto que se puede llevar a la reserva', + `isRecyclable` tinyint(1) NOT NULL DEFAULT 1 COMMENT 'las matrículas marcadas como reciclables se liberan cada noche desde vn.shelving_clean para poder volver a utilizarlas', PRIMARY KEY (`code`), KEY `shelving_fk1_idx` (`parkingFk`), KEY `shelving_fk2_idx` (`userFk`), @@ -40007,11 +39579,11 @@ CREATE TABLE `shelvingLog` ( `originFk` varchar(10) CHARACTER SET utf8 NOT NULL, `userFk` int(10) unsigned DEFAULT NULL, `action` set('insert','update','delete') COLLATE utf8_unicode_ci NOT NULL, - `creationDate` timestamp NULL DEFAULT CURRENT_TIMESTAMP, - `description` text CHARACTER SET utf8, + `creationDate` timestamp NULL DEFAULT current_timestamp(), + `description` text CHARACTER SET utf8 DEFAULT NULL, `changedModel` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, - `oldInstance` text COLLATE utf8_unicode_ci, - `newInstance` text COLLATE utf8_unicode_ci, + `oldInstance` text COLLATE utf8_unicode_ci DEFAULT NULL, + `newInstance` text COLLATE utf8_unicode_ci DEFAULT NULL, `changedModelId` int(11) DEFAULT NULL, `changedModelValue` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), @@ -40019,7 +39591,7 @@ CREATE TABLE `shelvingLog` ( KEY `originFk` (`originFk`), CONSTRAINT `shelvingLog_FK_ibfk_1` FOREIGN KEY (`originFk`) REFERENCES `shelving` (`code`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `shelvingLog_ibfk_2` FOREIGN KEY (`userFk`) REFERENCES `account`.`user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -40036,7 +39608,7 @@ CREATE TABLE `silexACL` ( `role` varchar(20) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `module_UNIQUE` (`module`,`method`,`role`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -40051,9 +39623,9 @@ CREATE TABLE `sinister` ( `supplierFk` int(11) NOT NULL, `clientFk` int(11) NOT NULL, `amount` decimal(10,2) NOT NULL, - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - `insureRate` decimal(3,2) NOT NULL DEFAULT '0.75', - `isBooked` tinyint(4) NOT NULL DEFAULT '0', + `created` timestamp NOT NULL DEFAULT current_timestamp(), + `insureRate` decimal(3,2) NOT NULL DEFAULT 0.75, + `isBooked` tinyint(4) NOT NULL DEFAULT 0, `workerFk` int(10) unsigned NOT NULL, `companyFk` smallint(5) unsigned NOT NULL, PRIMARY KEY (`id`), @@ -40078,10 +39650,10 @@ DROP TABLE IF EXISTS `sinisterDetail`; CREATE TABLE `sinisterDetail` ( `id` int(11) NOT NULL, `sinisterFk` int(11) NOT NULL, - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created` timestamp NOT NULL DEFAULT current_timestamp(), `amountIn` decimal(10,2) DEFAULT NULL, `amountOut` decimal(10,2) DEFAULT NULL, - `isConciliated` tinyint(1) NOT NULL DEFAULT '0', + `isConciliated` tinyint(1) NOT NULL DEFAULT 0, `workerFk` int(10) unsigned NOT NULL, `bankFk` int(11) DEFAULT NULL, PRIMARY KEY (`id`), @@ -40125,11 +39697,11 @@ CREATE TABLE `sms` ( `sender` varchar(15) CHARACTER SET utf8 NOT NULL DEFAULT '693474205', `destination` varchar(15) CHARACTER SET utf8 NOT NULL, `message` varchar(160) COLLATE utf8_unicode_ci NOT NULL, - `statusCode` smallint(9) DEFAULT '0', + `statusCode` smallint(9) DEFAULT 0, `status` varchar(255) COLLATE utf8_unicode_ci DEFAULT 'OK', - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created` timestamp NOT NULL DEFAULT current_timestamp(), PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -40252,21 +39824,21 @@ DROP TABLE IF EXISTS `sorter`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `sorter` ( - `id` int(11) NOT NULL DEFAULT '0', + `id` int(11) NOT NULL DEFAULT 0, `created` datetime NOT NULL, `routeFk` int(10) unsigned NOT NULL, `ticketFk` int(10) NOT NULL, - `isBox` int(11) DEFAULT '1', + `isBox` int(11) DEFAULT 1, `itemFk` int(11) DEFAULT NULL, - `width` decimal(10,2) DEFAULT '0.00', - `depth` decimal(10,2) DEFAULT '0.00', - `height` decimal(10,2) DEFAULT '0.00', - `warehouseFk` smallint(6) unsigned NOT NULL DEFAULT '1', - `weight` decimal(5,2) NOT NULL DEFAULT '0.00', - `buildingOrder` int(5) NOT NULL DEFAULT '0', + `width` decimal(10,2) DEFAULT 0.00, + `depth` decimal(10,2) DEFAULT 0.00, + `height` decimal(10,2) DEFAULT 0.00, + `warehouseFk` smallint(6) unsigned NOT NULL DEFAULT 1, + `weight` decimal(5,2) NOT NULL DEFAULT 0.00, + `buildingOrder` int(5) NOT NULL DEFAULT 0, `ETD` time NOT NULL DEFAULT '23:59:00', `palletOrder` int(5) DEFAULT NULL, - `lungGrow` int(11) DEFAULT '0', + `lungGrow` int(11) DEFAULT 0, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -40280,9 +39852,9 @@ DROP TABLE IF EXISTS `specialPrice`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `specialPrice` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `clientFk` int(11) NOT NULL DEFAULT '0', - `itemFk` int(11) NOT NULL DEFAULT '0', - `value` double NOT NULL DEFAULT '0', + `clientFk` int(11) NOT NULL DEFAULT 0, + `itemFk` int(11) NOT NULL DEFAULT 0, + `value` double NOT NULL DEFAULT 0, PRIMARY KEY (`id`), UNIQUE KEY `Id_Cliente_2` (`clientFk`,`itemFk`), KEY `Id_Article` (`itemFk`), @@ -40291,7 +39863,7 @@ CREATE TABLE `specialPrice` ( CONSTRAINT `sp_customer_id` FOREIGN KEY (`clientFk`) REFERENCES `client` (`id`) ON UPDATE CASCADE, CONSTRAINT `{01A99AF1-3D3F-4B15-AC0C-C7A834F319A3}` FOREIGN KEY (`clientFk`) REFERENCES `client` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `{EE4ADEF6-0AC6-401F-B7C4-D797972FC065}` FOREIGN KEY (`itemFk`) REFERENCES `item` (`id`) ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -40361,7 +39933,7 @@ CREATE TABLE `specieGeoInvasive` ( `genusFk` int(11) NOT NULL, `specieFk` int(11) NOT NULL, `zoneGeofk` int(11) NOT NULL, - `isForbidden` tinyint(1) NOT NULL DEFAULT '1', + `isForbidden` tinyint(1) NOT NULL DEFAULT 1, PRIMARY KEY (`id`), KEY `specieGeoInvasive_FK` (`genusFk`), KEY `specieGeoInvasive_FK_1` (`specieFk`), @@ -40369,7 +39941,7 @@ CREATE TABLE `specieGeoInvasive` ( CONSTRAINT `specieGeoInvasive_FK` FOREIGN KEY (`genusFk`) REFERENCES `genus` (`id`) ON UPDATE CASCADE, CONSTRAINT `specieGeoInvasive_FK_1` FOREIGN KEY (`specieFk`) REFERENCES `specie` (`id`) ON UPDATE CASCADE, CONSTRAINT `specieGeoInvasive_FK_2` FOREIGN KEY (`zoneGeofk`) REFERENCES `zoneGeo` (`id`) ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Esta tabla recoge las prohibiciones de comerciar con especies invasoras de acuerdo con el Catálogo de Especies Exóticas Invasoras publicado por el Estado Español'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Esta tabla recoge las prohibiciones de comerciar con especies invasoras de acuerdo con el Catálogo de Especies Exóticas Invasoras publicado por el Estado Español'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -40389,7 +39961,7 @@ CREATE TABLE `starredModule` ( KEY `starred_moduleFk` (`moduleFk`), CONSTRAINT `starred_moduleFk` FOREIGN KEY (`moduleFk`) REFERENCES `salix`.`module` (`code`) ON UPDATE CASCADE, CONSTRAINT `starred_workerFk` FOREIGN KEY (`workerFk`) REFERENCES `worker` (`id`) ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -40403,7 +39975,7 @@ CREATE TABLE `state` ( `id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(15) COLLATE utf8_unicode_ci NOT NULL, `order` tinyint(3) unsigned DEFAULT NULL, - `alertLevel` int(11) NOT NULL DEFAULT '0', + `alertLevel` int(11) NOT NULL DEFAULT 0, `code` varchar(45) CHARACTER SET utf8 NOT NULL, `sectorProdPriority` tinyint(3) DEFAULT NULL, `nextStateFk` tinyint(4) NOT NULL COMMENT 'Estado al que tiene que cambiar el ticket despues de preparacion previa', @@ -40436,14 +40008,14 @@ CREATE TABLE `stockBuyed` ( `user` int(10) unsigned DEFAULT NULL, `buyed` decimal(10,2) DEFAULT NULL, `date` date DEFAULT NULL, - `creationDate` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + `creationDate` timestamp NULL DEFAULT current_timestamp(), `reserved` decimal(10,2) DEFAULT NULL, `requested` decimal(10,2) DEFAULT NULL, `description` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), KEY `stockBuyed_user_idx` (`user`), CONSTRAINT `stockBuyedUserFk` FOREIGN KEY (`user`) REFERENCES `account`.`user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -40456,7 +40028,7 @@ DROP TABLE IF EXISTS `stowaway`; CREATE TABLE `stowaway` ( `id` int(11) NOT NULL COMMENT 'ticket pequeño', `shipFk` int(11) NOT NULL COMMENT 'ticket grande', - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created` timestamp NOT NULL DEFAULT current_timestamp(), PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Tickets polizones y sus naves de embarque'; /*!40101 SET character_set_client = @saved_cs_client */; @@ -40477,30 +40049,30 @@ CREATE TABLE `supplier` ( `provinceFk` smallint(5) unsigned DEFAULT NULL, `countryFk` mediumint(8) unsigned DEFAULT NULL, `nif` varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL, - `isOfficial` tinyint(1) NOT NULL DEFAULT '1', - `isFarmer` tinyint(1) NOT NULL DEFAULT '0', + `isOfficial` tinyint(1) NOT NULL DEFAULT 1, + `isFarmer` tinyint(1) NOT NULL DEFAULT 0, `retAccount` varchar(10) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL, `phone` varchar(16) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL, `Fax__` varchar(16) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL, - `commission` float NOT NULL DEFAULT '0', + `commission` float NOT NULL DEFAULT 0, `nickname` varchar(45) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL, `payMethodFk` tinyint(3) unsigned NOT NULL, `payDay` tinyint(4) unsigned DEFAULT NULL, - `payDemFk` tinyint(3) unsigned NOT NULL DEFAULT '7', - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - `isSerious` tinyint(1) unsigned NOT NULL DEFAULT '1', - `note` text CHARACTER SET utf8 COLLATE utf8_unicode_ci, + `payDemFk` tinyint(3) unsigned NOT NULL DEFAULT 7, + `created` timestamp NOT NULL DEFAULT current_timestamp(), + `isSerious` tinyint(1) unsigned NOT NULL DEFAULT 1, + `note` text CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL, `postcodeFk` int(11) unsigned DEFAULT NULL, `postCode` char(5) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL, - `isActive` tinyint(4) DEFAULT '1', + `isActive` tinyint(4) DEFAULT 1, `taxTypeSageFk` smallint(6) DEFAULT NULL COMMENT 'Tipo de IVA SAGE', `withholdingSageFk` smallint(6) DEFAULT NULL COMMENT 'Tipos de retención SAGE', `transactionTypeSageFk` tinyint(4) DEFAULT NULL COMMENT 'Ti po de transacción SAGE', - `isTrucker` tinyint(1) NOT NULL DEFAULT '0', + `isTrucker` tinyint(1) NOT NULL DEFAULT 0, `workerFk` int(10) unsigned DEFAULT NULL COMMENT 'Responsible for approving invoices', `supplierActivityFk` varchar(45) NOT NULL DEFAULT 'flowersPlants', `healthRegister` varchar(45) DEFAULT NULL, - `isPayMethodChecked` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'Se ha validado la forma de pago', + `isPayMethodChecked` tinyint(4) NOT NULL DEFAULT 0 COMMENT 'Se ha validado la forma de pago', PRIMARY KEY (`id`), UNIQUE KEY `cuenta` (`account`), UNIQUE KEY `NIF` (`nif`), @@ -40654,6 +40226,30 @@ CREATE TABLE `supplierAddress` ( PRIMARY KEY (`id`), KEY `supplierAddress_province_fk` (`provinceFk`), CONSTRAINT `supplierAddress_province_fk` FOREIGN KEY (`provinceFk`) REFERENCES `province` (`id`) ON UPDATE CASCADE +) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `supplierAgencyTerm` +-- + +DROP TABLE IF EXISTS `supplierAgencyTerm`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `supplierAgencyTerm` ( + `agencyFk` smallint(5) unsigned NOT NULL, + `supplierFk` int(11) DEFAULT NULL, + `minimumPackages` int(11) NOT NULL DEFAULT 0 COMMENT 'numero minimo de bultos', + `kmPrice` decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT 'precio extra por km', + `packagePrice` decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT 'precio extra por bulto', + `routePrice` decimal(10,2) DEFAULT NULL COMMENT 'precio fijo por ruta', + `minimumKm` int(11) NOT NULL DEFAULT 0, + `minimumM3` decimal(10,2) NOT NULL DEFAULT 0.00, + `m3Price` decimal(10,2) NOT NULL DEFAULT 0.00, + PRIMARY KEY (`agencyFk`), + KEY `agencyTerm_FK_1` (`supplierFk`), + CONSTRAINT `agencyTerm_FK` FOREIGN KEY (`agencyFk`) REFERENCES `agency` (`id`) ON UPDATE CASCADE, + CONSTRAINT `agencyTerm_FK_1` FOREIGN KEY (`supplierFk`) REFERENCES `supplier` (`id`) ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -40694,7 +40290,7 @@ CREATE TABLE `supplierContact` ( `phone` varchar(16) COLLATE utf8_unicode_ci DEFAULT NULL, `mobile` varchar(16) COLLATE utf8_unicode_ci DEFAULT NULL, `email` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, - `observation` text COLLATE utf8_unicode_ci, + `observation` text COLLATE utf8_unicode_ci DEFAULT NULL, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), KEY `supplier_id` (`supplierFk`), @@ -40713,13 +40309,13 @@ CREATE TABLE `supplierExpense` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `dated` date NOT NULL, `supplierFk` int(11) NOT NULL, - `currencyFk` tinyint(3) unsigned NOT NULL DEFAULT '2', - `amount` decimal(10,2) NOT NULL DEFAULT '0.00', + `currencyFk` tinyint(3) unsigned NOT NULL DEFAULT 2, + `amount` decimal(10,2) NOT NULL DEFAULT 0.00, `description` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, - `companyFk` smallint(5) unsigned NOT NULL DEFAULT '442', + `companyFk` smallint(5) unsigned NOT NULL DEFAULT 442, `dmsFk` int(11) DEFAULT NULL, - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - `isConciliated` tinyint(1) unsigned zerofill NOT NULL DEFAULT '0', + `created` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), + `isConciliated` tinyint(1) unsigned zerofill NOT NULL DEFAULT 0, `dueDated` date NOT NULL, PRIMARY KEY (`id`), KEY `empresa_id` (`companyFk`), @@ -40732,7 +40328,7 @@ CREATE TABLE `supplierExpense` ( CONSTRAINT `pago_ibfk_1` FOREIGN KEY (`companyFk`) REFERENCES `company` (`id`) ON UPDATE CASCADE, CONSTRAINT `pago_moneda` FOREIGN KEY (`currencyFk`) REFERENCES `currency` (`id`) ON UPDATE CASCADE, CONSTRAINT `proveedor_pago` FOREIGN KEY (`supplierFk`) REFERENCES `supplier` (`id`) ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -40747,11 +40343,11 @@ CREATE TABLE `supplierLog` ( `originFk` int(11) NOT NULL, `userFk` int(10) unsigned NOT NULL, `action` set('insert','update','delete') COLLATE utf8_unicode_ci NOT NULL, - `creationDate` timestamp NULL DEFAULT CURRENT_TIMESTAMP, - `description` text CHARACTER SET utf8, + `creationDate` timestamp NULL DEFAULT current_timestamp(), + `description` text CHARACTER SET utf8 DEFAULT NULL, `changedModel` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, - `oldInstance` text COLLATE utf8_unicode_ci, - `newInstance` text COLLATE utf8_unicode_ci, + `oldInstance` text COLLATE utf8_unicode_ci DEFAULT NULL, + `newInstance` text COLLATE utf8_unicode_ci DEFAULT NULL, `changedModelId` int(11) DEFAULT NULL, `changedModelValue` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), @@ -40759,7 +40355,7 @@ CREATE TABLE `supplierLog` ( KEY `supplierLog_ibfk_2` (`userFk`), CONSTRAINT `supplierLog_ibfk_1` FOREIGN KEY (`originFk`) REFERENCES `supplier` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `supplierLog_ibfk_2` FOREIGN KEY (`userFk`) REFERENCES `account`.`user` (`id`) ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -40828,8 +40424,8 @@ CREATE TABLE `tag` ( `id` int(11) NOT NULL AUTO_INCREMENT, `code` varchar(45) CHARACTER SET utf8 DEFAULT NULL, `name` varchar(25) COLLATE utf8_unicode_ci NOT NULL, - `isFree` tinyint(1) NOT NULL DEFAULT '1', - `isQuantitatif` tinyint(4) NOT NULL DEFAULT '0', + `isFree` tinyint(1) NOT NULL DEFAULT 1, + `isQuantitatif` tinyint(4) NOT NULL DEFAULT 0, `sourceTable` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `unit` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, `ediTypeFk` varchar(3) COLLATE utf8_unicode_ci DEFAULT NULL, @@ -40967,16 +40563,16 @@ CREATE TABLE `taxCode` ( `dated` date NOT NULL, `code` varchar(10) CHARACTER SET utf8 NOT NULL, `taxTypeFk` tinyint(2) NOT NULL, - `rate` decimal(4,1) NOT NULL DEFAULT '0.0', - `equalizationTax` decimal(4,1) NOT NULL DEFAULT '0.0', + `rate` decimal(4,1) NOT NULL DEFAULT 0.0, + `equalizationTax` decimal(4,1) NOT NULL DEFAULT 0.0, `type` char(1) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Solo rellenar si en el asiento ira en el DEBE', - `link` tinyint(4) unsigned DEFAULT '0' COMMENT 'las que tienen el mismo valor se contabilizan emparejadas', - `isActive` tinyint(2) NOT NULL DEFAULT '1', - `updated` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `link` tinyint(4) unsigned DEFAULT 0 COMMENT 'las que tienen el mismo valor se contabilizan emparejadas', + `isActive` tinyint(2) NOT NULL DEFAULT 1, + `updated` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `transactionCode` varchar(2) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'Código de Transacción de SAGE', `operationCode` varchar(1) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'Código de operaciones de SAGE', `taxCode` int(4) DEFAULT NULL COMMENT 'Código de IVA SAGE', - `isIntracommunity` tinyint(2) DEFAULT '0', + `isIntracommunity` tinyint(2) DEFAULT 0, PRIMARY KEY (`id`), UNIQUE KEY `taxCode_dated_IDX` (`dated`,`taxTypeFk`,`type`,`link`) USING BTREE, KEY `iva_tipo_id` (`taxTypeFk`), @@ -40996,7 +40592,7 @@ DROP TABLE IF EXISTS `taxType`; CREATE TABLE `taxType` ( `id` tinyint(2) NOT NULL AUTO_INCREMENT, `nickname` varchar(6) COLLATE utf8_unicode_ci NOT NULL, - `isAccrued` tinyint(4) NOT NULL DEFAULT '0', + `isAccrued` tinyint(4) NOT NULL DEFAULT 0, `serial` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `TIPOOPE` varchar(1) COLLATE utf8_unicode_ci NOT NULL DEFAULT ' ' COMMENT 'respetar el nombre de la columna, se utiliza en contaplus', `description` varchar(100) COLLATE utf8_unicode_ci NOT NULL, @@ -41017,7 +40613,7 @@ DROP TABLE IF EXISTS `temperature`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `temperature` ( `code` varchar(10) CHARACTER SET utf8 NOT NULL, - `description` text COLLATE utf8_unicode_ci, + `description` text COLLATE utf8_unicode_ci DEFAULT NULL, `name` varchar(10) COLLATE utf8_unicode_ci NOT NULL, PRIMARY KEY (`code`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; @@ -41046,34 +40642,34 @@ DROP TABLE IF EXISTS `ticket`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `ticket` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `clientFk` int(11) NOT NULL DEFAULT '0', - `warehouseFk` smallint(6) unsigned NOT NULL DEFAULT '1', + `clientFk` int(11) NOT NULL DEFAULT 0, + `warehouseFk` smallint(6) unsigned NOT NULL DEFAULT 1, `shipped` datetime NOT NULL, `nickname` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, - `notes` longtext COLLATE utf8_unicode_ci, + `notes` longtext COLLATE utf8_unicode_ci DEFAULT NULL, `refFk` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `invoiceOutFk` int(10) unsigned DEFAULT NULL COMMENT 'eliminar', - `isBooked` tinyint(1) NOT NULL DEFAULT '0', - `addressFk` int(11) NOT NULL DEFAULT '0', + `isBooked` tinyint(1) NOT NULL DEFAULT 0, + `addressFk` int(11) NOT NULL DEFAULT 0, `workerFk` int(11) DEFAULT NULL, `observations` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'eliminar', - `isSigned` tinyint(1) NOT NULL DEFAULT '0', - `isLabeled` tinyint(1) NOT NULL DEFAULT '0', - `isPrinted` tinyint(1) NOT NULL DEFAULT '0', - `packages` smallint(10) unsigned DEFAULT '0', + `isSigned` tinyint(1) NOT NULL DEFAULT 0, + `isLabeled` tinyint(1) NOT NULL DEFAULT 0, + `isPrinted` tinyint(1) NOT NULL DEFAULT 0, + `packages` smallint(10) unsigned DEFAULT 0, `location` varchar(15) COLLATE utf8_unicode_ci DEFAULT NULL, - `hour` int(11) DEFAULT '0', - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - `isBlocked` tinyint(1) NOT NULL DEFAULT '1', + `hour` int(11) DEFAULT 0, + `created` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), + `isBlocked` tinyint(1) NOT NULL DEFAULT 1, `solution` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, `routeFk` int(10) unsigned DEFAULT NULL, `priority` tinyint(3) unsigned DEFAULT NULL, - `hasPriority` tinyint(1) unsigned NOT NULL DEFAULT '1', - `companyFk` smallint(5) unsigned NOT NULL DEFAULT '442', + `hasPriority` tinyint(1) unsigned NOT NULL DEFAULT 1, + `companyFk` smallint(5) unsigned NOT NULL DEFAULT 442, `agencyModeFk` int(11) DEFAULT NULL, `landed` date DEFAULT NULL, - `isBoxed` tinyint(2) NOT NULL DEFAULT '0', - `isDeleted` tinyint(2) NOT NULL DEFAULT '0', + `isBoxed` tinyint(2) NOT NULL DEFAULT 0, + `isDeleted` tinyint(2) NOT NULL DEFAULT 0, `zoneFk` int(11) DEFAULT NULL, `collectionFk__` int(11) DEFAULT NULL, `zonePrice` decimal(10,2) DEFAULT NULL, @@ -41146,8 +40742,8 @@ BEGIN WHERE c.id = NEW.clientFk; INSERT INTO bs.clientNewBorn(clientFk, firstShipped, lastShipped) - VALUES(NEW.clientFk, IFNULL(vTransferorFirstShipped, CURDATE()), CURDATE()) - ON DUPLICATE KEY UPDATE lastShipped = CURDATE(); + VALUES(NEW.clientFk, IFNULL(vTransferorFirstShipped, util.VN_CURDATE()), util.VN_CURDATE()) + ON DUPLICATE KEY UPDATE lastShipped = util.VN_CURDATE(); END IF; @@ -41178,7 +40774,7 @@ BEGIN FROM vn.route r WHERE r.isOk = FALSE AND r.id IN (OLD.routeFk,NEW.routeFk) - AND r.created >= CURDATE() + AND r.created >= util.VN_CURDATE() GROUP BY r.id; call util.debugAdd(NEW.id,CONCAT(OLD.routeFk,' ',NEW.routeFk)); END IF; @@ -41202,7 +40798,7 @@ BEGIN JOIN vn.route r ON r.id = t.routeFk WHERE r.isOk = FALSE AND t.id = NEW.id - AND r.created >= CURDATE() + AND r.created >= util.VN_CURDATE() GROUP BY r.id; SET NEW.shipped = DATE_FORMAT(NEW.shipped, '2000-%m-%d %T'); SET NEW.landed = DATE_FORMAT(NEW.landed, '2000-%m-%d %T'); @@ -41303,7 +40899,7 @@ BEGIN FROM vn.route r WHERE r.isOk = FALSE AND r.id = OLD.routeFk - AND r.created >= CURDATE() + AND r.created >= util.VN_CURDATE() GROUP BY r.id; DELETE FROM sale WHERE ticketFk = OLD.id; @@ -41327,9 +40923,9 @@ CREATE TABLE `ticketCollection` ( `id` int(11) NOT NULL AUTO_INCREMENT, `ticketFk` int(11) NOT NULL, `collectionFk` int(11) NOT NULL, - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created` timestamp NOT NULL DEFAULT current_timestamp(), `level` int(11) DEFAULT NULL, - `wagon` int(11) NOT NULL DEFAULT '0', + `wagon` int(11) NOT NULL DEFAULT 0, `smartTagFk` varchar(12) COLLATE utf8_unicode_ci DEFAULT NULL, `usedShelves` int(11) DEFAULT NULL COMMENT 'número de bandejas que ocupa un ticket en el carro', `itemCount` int(11) DEFAULT NULL COMMENT 'número de productos distintos en el pedido', @@ -41395,7 +40991,7 @@ DROP TABLE IF EXISTS `ticketConfig`; CREATE TABLE `ticketConfig` ( `id` int(11) NOT NULL AUTO_INCREMENT, `scopeDays` tinyint(3) DEFAULT NULL, - `pickingDelay` int(11) NOT NULL DEFAULT '10' COMMENT 'minutos de cortesia desde que se crea un ticket hasta que se puede preparar', + `pickingDelay` int(11) NOT NULL DEFAULT 10 COMMENT 'minutos de cortesia desde que se crea un ticket hasta que se puede preparar', PRIMARY KEY (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -41467,8 +41063,8 @@ DROP TABLE IF EXISTS `ticketDown`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `ticketDown` ( `ticketFk` int(11) NOT NULL, - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - `selected` int(11) NOT NULL DEFAULT '0', + `created` timestamp NOT NULL DEFAULT current_timestamp(), + `selected` int(11) NOT NULL DEFAULT 0, `collectionFk` int(11) NOT NULL, `id` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`id`), @@ -41477,7 +41073,7 @@ CREATE TABLE `ticketDown` ( KEY `ticketDown_FK` (`collectionFk`), CONSTRAINT `ticketDown_FK` FOREIGN KEY (`collectionFk`) REFERENCES `collection` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `ticketDown_fk1` FOREIGN KEY (`selected`) REFERENCES `ticketDown_SelectionType` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Cola de impresion para los tickets que se van a solicitar al altillo'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Cola de impresion para los tickets que se van a solicitar al altillo'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -41525,7 +41121,7 @@ DROP TABLE IF EXISTS `ticketLastState`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `ticketLastState` ( - `ticketFk` int(11) NOT NULL DEFAULT '0', + `ticketFk` int(11) NOT NULL DEFAULT 0, `ticketTrackingFk` int(11) NOT NULL, `name` varchar(15) COLLATE utf8_unicode_ci NOT NULL, PRIMARY KEY (`ticketFk`), @@ -41563,21 +41159,6 @@ SET character_set_client = utf8; ) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; --- --- Temporary table structure for view `ticketLocation` --- - -DROP TABLE IF EXISTS `ticketLocation`; -/*!50001 DROP VIEW IF EXISTS `ticketLocation`*/; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; -/*!50001 CREATE TABLE `ticketLocation` ( - `ticketFk` tinyint NOT NULL, - `longitude` tinyint NOT NULL, - `latitude` tinyint NOT NULL -) ENGINE=MyISAM */; -SET character_set_client = @saved_cs_client; - -- -- Table structure for table `ticketLog` -- @@ -41590,11 +41171,11 @@ CREATE TABLE `ticketLog` ( `originFk` int(11) NOT NULL, `userFk` int(10) unsigned DEFAULT NULL, `action` set('insert','update','delete','select') COLLATE utf8_unicode_ci NOT NULL, - `creationDate` timestamp NULL DEFAULT CURRENT_TIMESTAMP, - `description` text CHARACTER SET utf8, + `creationDate` timestamp NULL DEFAULT current_timestamp(), + `description` text CHARACTER SET utf8 DEFAULT NULL, `changedModel` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, - `oldInstance` text COLLATE utf8_unicode_ci, - `newInstance` text COLLATE utf8_unicode_ci, + `oldInstance` text COLLATE utf8_unicode_ci DEFAULT NULL, + `newInstance` text COLLATE utf8_unicode_ci DEFAULT NULL, `changedModelId` int(11) DEFAULT NULL, `changedModelValue` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), @@ -41602,37 +41183,9 @@ CREATE TABLE `ticketLog` ( KEY `logTicketuserFk` (`userFk`), CONSTRAINT `ticketLog_ibfk_1` FOREIGN KEY (`originFk`) REFERENCES `ticket` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `ticketLog_user` FOREIGN KEY (`userFk`) REFERENCES `account`.`user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; --- --- Temporary table structure for view `ticketMRW` --- - -DROP TABLE IF EXISTS `ticketMRW`; -/*!50001 DROP VIEW IF EXISTS `ticketMRW`*/; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; -/*!50001 CREATE TABLE `ticketMRW` ( - `id_Agencia` tinyint NOT NULL, - `empresa_id` tinyint NOT NULL, - `Consignatario` tinyint NOT NULL, - `DOMICILIO` tinyint NOT NULL, - `POBLACION` tinyint NOT NULL, - `CODPOSTAL` tinyint NOT NULL, - `telefono` tinyint NOT NULL, - `movil` tinyint NOT NULL, - `IF` tinyint NOT NULL, - `Id_Ticket` tinyint NOT NULL, - `warehouse_id` tinyint NOT NULL, - `Id_Consigna` tinyint NOT NULL, - `CodigoPais` tinyint NOT NULL, - `Fecha` tinyint NOT NULL, - `province_id` tinyint NOT NULL, - `landing` tinyint NOT NULL -) ENGINE=MyISAM */; -SET character_set_client = @saved_cs_client; - -- -- Temporary table structure for view `ticketNotInvoiced` -- @@ -41680,7 +41233,7 @@ DROP TABLE IF EXISTS `ticketPackage`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `ticketPackage` ( `ticket` int(11) NOT NULL, - `counter` int(10) unsigned NOT NULL DEFAULT '0', + `counter` int(10) unsigned NOT NULL DEFAULT 0, PRIMARY KEY (`ticket`), CONSTRAINT `ticketPackage_ticketFk` FOREIGN KEY (`ticket`) REFERENCES `ticket` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; @@ -41697,8 +41250,8 @@ CREATE TABLE `ticketPackaging` ( `id` int(11) NOT NULL AUTO_INCREMENT, `ticketFk` int(11) NOT NULL, `packagingFk` varchar(10) COLLATE utf8_unicode_ci NOT NULL, - `quantity` int(10) DEFAULT '0', - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `quantity` int(10) DEFAULT 0, + `created` timestamp NOT NULL DEFAULT current_timestamp(), `pvp` double DEFAULT NULL, `workerFk` int(10) unsigned DEFAULT NULL, PRIMARY KEY (`id`), @@ -41746,7 +41299,7 @@ CREATE TABLE `ticketPackagingStartingStock` ( `itemFk` int(11) NOT NULL, `sent` int(11) DEFAULT NULL, `returned` int(11) DEFAULT NULL, - `isForgetable` tinyint(1) NOT NULL DEFAULT '0', + `isForgetable` tinyint(1) NOT NULL DEFAULT 0, PRIMARY KEY (`clientFk`,`packagingFk`), KEY `ticketPackagingStartingStock_fk2_idx` (`packagingFk`), KEY `ticketPackagingStartingStock_fk3_idx` (`itemFk`), @@ -41789,7 +41342,7 @@ CREATE TABLE `ticketParking` ( `id` int(11) NOT NULL AUTO_INCREMENT, `ticketFk` int(11) NOT NULL, `parkingFk` int(11) NOT NULL, - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created` timestamp NOT NULL DEFAULT current_timestamp(), `workerFk` int(11) DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `ticketParking_idx1` (`ticketFk`,`parkingFk`), @@ -41797,7 +41350,7 @@ CREATE TABLE `ticketParking` ( KEY `ticketParking_fk1_idx` (`parkingFk`), CONSTRAINT `ticketParking_fk1` FOREIGN KEY (`ticketFk`) REFERENCES `ticket` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `ticketParking_fk2` FOREIGN KEY (`parkingFk`) REFERENCES `parking` (`id`) ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Almacena los distintos lugares donde puede estar aparcado cada uno de los prepedidos'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Almacena los distintos lugares donde puede estar aparcado cada uno de los prepedidos'; /*!40101 SET character_set_client = @saved_cs_client */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -41959,13 +41512,13 @@ CREATE TABLE `ticketRequest` ( `price__` double DEFAULT NULL, `itemFk` double DEFAULT NULL, `clientFk` int(11) DEFAULT NULL, - `response` longtext COLLATE utf8_unicode_ci, - `ok__` tinyint(1) NOT NULL DEFAULT '0', + `response` longtext COLLATE utf8_unicode_ci DEFAULT NULL, + `ok__` tinyint(1) NOT NULL DEFAULT 0, `total` int(11) DEFAULT NULL, `buyed` datetime DEFAULT NULL, - `ko__` tinyint(1) NOT NULL DEFAULT '0', + `ko__` tinyint(1) NOT NULL DEFAULT 0, `saleFk` int(11) DEFAULT NULL, - `created` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + `created` timestamp NULL DEFAULT current_timestamp(), `isOk` tinyint(1) DEFAULT NULL, `requesterFk` int(10) unsigned DEFAULT NULL, `attenderFk` int(10) unsigned DEFAULT NULL, @@ -42057,9 +41610,9 @@ DROP TABLE IF EXISTS `ticketService`; CREATE TABLE `ticketService` ( `id` int(11) NOT NULL AUTO_INCREMENT, `description` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, - `quantity` int(11) NOT NULL DEFAULT '0', - `price` decimal(10,2) NOT NULL DEFAULT '0.00', - `taxClassFk` tinyint(3) unsigned NOT NULL DEFAULT '2', + `quantity` int(11) NOT NULL DEFAULT 0, + `price` decimal(10,2) NOT NULL DEFAULT 0.00, + `taxClassFk` tinyint(3) unsigned NOT NULL DEFAULT 2, `ticketFk` int(11) NOT NULL, `ticketServiceTypeFk` int(11) NOT NULL, PRIMARY KEY (`id`), @@ -42228,7 +41781,7 @@ DROP TABLE IF EXISTS `ticketTrolley`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `ticketTrolley` ( `ticket` int(11) NOT NULL, - `labelCount` int(11) NOT NULL DEFAULT '0', + `labelCount` int(11) NOT NULL DEFAULT 0, PRIMARY KEY (`ticket`), CONSTRAINT `fk_ticketTrolley_vs_ticket` FOREIGN KEY (`ticket`) REFERENCES `ticket` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; @@ -42277,20 +41830,20 @@ DROP TABLE IF EXISTS `till`; CREATE TABLE `till` ( `id` int(11) NOT NULL AUTO_INCREMENT, `dated` date NOT NULL, - `isAccountable` tinyint(1) NOT NULL DEFAULT '0', + `isAccountable` tinyint(1) NOT NULL DEFAULT 0, `serie` varchar(2) COLLATE utf8_unicode_ci DEFAULT NULL, `number` int(11) DEFAULT NULL, `concept` varchar(50) COLLATE utf8_unicode_ci NOT NULL, `in` decimal(10,2) DEFAULT NULL, `out` decimal(10,2) DEFAULT NULL, - `bankFk` int(11) DEFAULT '1', + `bankFk` int(11) DEFAULT 1, `workerFk` int(10) unsigned DEFAULT NULL, - `companyFk` smallint(5) unsigned DEFAULT '442' COMMENT 'kakear', - `isLinked` tinyint(4) DEFAULT '0', - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - `isOk` tinyint(4) NOT NULL DEFAULT '0', - `warehouseFk` smallint(5) unsigned NOT NULL DEFAULT '1' COMMENT 'to kak\\n', - `isConciliate` tinyint(4) NOT NULL DEFAULT '0', + `companyFk` smallint(5) unsigned DEFAULT 442 COMMENT 'kakear', + `isLinked` tinyint(4) DEFAULT 0, + `created` timestamp NOT NULL DEFAULT current_timestamp(), + `isOk` tinyint(4) NOT NULL DEFAULT 0, + `warehouseFk` smallint(5) unsigned NOT NULL DEFAULT 1 COMMENT 'to kak\\n', + `isConciliate` tinyint(4) NOT NULL DEFAULT 0, `supplierAccountFk` mediumint(8) unsigned NOT NULL, `calculatedCode` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `InForeignValue` decimal(10,2) DEFAULT NULL, @@ -42305,7 +41858,7 @@ CREATE TABLE `till` ( KEY `fk_Cajas_Proveedores_account1_idx` (`supplierAccountFk`), CONSTRAINT `till_ibfk_2` FOREIGN KEY (`bankFk`) REFERENCES `accounting` (`id`) ON UPDATE CASCADE, CONSTRAINT `till_ibfk_3` FOREIGN KEY (`workerFk`) REFERENCES `worker` (`id`) ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -42340,7 +41893,7 @@ DROP TABLE IF EXISTS `tillConfig`; CREATE TABLE `tillConfig` ( `id` int(11) NOT NULL, `openingBalance` decimal(10,2) NOT NULL, - `updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `updated` timestamp NOT NULL DEFAULT current_timestamp(), PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -42396,25 +41949,6 @@ DELIMITER ; /*!50003 SET character_set_results = @saved_cs_results */ ; /*!50003 SET collation_connection = @saved_col_connection */ ; --- --- Temporary table structure for view `time__` --- - -DROP TABLE IF EXISTS `time__`; -/*!50001 DROP VIEW IF EXISTS `time__`*/; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; -/*!50001 CREATE TABLE `time__` ( - `dated` tinyint NOT NULL, - `period` tinyint NOT NULL, - `month` tinyint NOT NULL, - `year` tinyint NOT NULL, - `day` tinyint NOT NULL, - `week` tinyint NOT NULL, - `yearMonth` tinyint NOT NULL -) ENGINE=MyISAM */; -SET character_set_client = @saved_cs_client; - -- -- Table structure for table `town` -- @@ -42614,7 +42148,7 @@ CREATE TABLE `trainingCenter` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(45) COLLATE utf8_unicode_ci NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -42633,9 +42167,9 @@ CREATE TABLE `trainingCourse` ( `ended` datetime NOT NULL, `invoice` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, `amount` double DEFAULT NULL, - `remark` longtext COLLATE utf8_unicode_ci, - `hasDiscount` tinyint(1) NOT NULL DEFAULT '0', - `hasDiploma` tinyint(1) NOT NULL DEFAULT '0', + `remark` longtext COLLATE utf8_unicode_ci DEFAULT NULL, + `hasDiscount` tinyint(1) NOT NULL DEFAULT 0, + `hasDiploma` tinyint(1) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), KEY `frgnWorker_idx` (`workerFk`), KEY `frgnCenter_idx` (`centerFk`), @@ -42643,7 +42177,7 @@ CREATE TABLE `trainingCourse` ( CONSTRAINT `frgnCenter` FOREIGN KEY (`centerFk`) REFERENCES `trainingCenter` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `frgnTrainingCourseType` FOREIGN KEY (`trainingCourseTypeFk`) REFERENCES `trainingCourseType` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `frgnWorker` FOREIGN KEY (`workerFk`) REFERENCES `worker` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Lista de trabajadores que han realizado una formación'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Lista de trabajadores que han realizado una formación'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -42657,7 +42191,7 @@ CREATE TABLE `trainingCourseType` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Lista de las formaciones'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Lista de las formaciones'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -42677,12 +42211,12 @@ CREATE TABLE `travel` ( `warehouseOutFk` smallint(6) unsigned DEFAULT NULL, `agencyFk` int(11) DEFAULT NULL, `ref` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, - `isDelivered` tinyint(1) NOT NULL DEFAULT '0', - `isReceived` tinyint(1) NOT NULL DEFAULT '0', + `isDelivered` tinyint(1) NOT NULL DEFAULT 0, + `isReceived` tinyint(1) NOT NULL DEFAULT 0, `m3` decimal(10,2) unsigned DEFAULT NULL, `kg` decimal(10,0) unsigned DEFAULT NULL, `cargoSupplierFk` int(11) DEFAULT NULL, - `totalEntries` tinyint(4) unsigned DEFAULT '0', + `totalEntries` tinyint(4) unsigned DEFAULT 0, `appointment` datetime DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `shipment_2` (`shipped`,`landed`,`warehouseInFk`,`warehouseOutFk`,`agencyFk`,`ref`), @@ -42808,7 +42342,7 @@ CREATE TABLE `travelClonedWeekly` ( CONSTRAINT `travelClonedWeekly_FK_2` FOREIGN KEY (`agencyModeFk`) REFERENCES `agencyMode` (`id`) ON UPDATE CASCADE, CONSTRAINT `travelClonedWeekly_FK_3` FOREIGN KEY (`supplierFk`) REFERENCES `supplier` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `travelClonedWeekly_FK_4` FOREIGN KEY (`travelFk`) REFERENCES `travel` (`id`) ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -42823,11 +42357,11 @@ CREATE TABLE `travelLog` ( `originFk` int(10) unsigned NOT NULL, `userFk` int(10) unsigned DEFAULT NULL, `action` set('insert','update','delete') COLLATE utf8_unicode_ci NOT NULL, - `creationDate` timestamp NULL DEFAULT CURRENT_TIMESTAMP, - `description` text CHARACTER SET utf8, + `creationDate` timestamp NULL DEFAULT current_timestamp(), + `description` text CHARACTER SET utf8 DEFAULT NULL, `changedModel` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, - `oldInstance` text COLLATE utf8_unicode_ci, - `newInstance` text COLLATE utf8_unicode_ci, + `oldInstance` text COLLATE utf8_unicode_ci DEFAULT NULL, + `newInstance` text COLLATE utf8_unicode_ci DEFAULT NULL, `changedModelId` int(11) DEFAULT NULL, `changedModelValue` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), @@ -42835,7 +42369,7 @@ CREATE TABLE `travelLog` ( KEY `userFk` (`userFk`), CONSTRAINT `travelLog_ibfk_1` FOREIGN KEY (`originFk`) REFERENCES `travel` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `travelLog_ibfk_2` FOREIGN KEY (`userFk`) REFERENCES `account`.`user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -42850,9 +42384,9 @@ CREATE TABLE `travelObservation` ( `originFk` int(11) NOT NULL, `userFk` int(11) NOT NULL, `description` text COLLATE utf8_unicode_ci NOT NULL, - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created` timestamp NOT NULL DEFAULT current_timestamp(), PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Observaciones de travel'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Observaciones de travel'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -42909,11 +42443,11 @@ DROP TABLE IF EXISTS `trolley`; CREATE TABLE `trolley` ( `id` int(11) NOT NULL AUTO_INCREMENT, `workerFk` int(10) unsigned DEFAULT NULL, - `coupled` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `coupled` timestamp NOT NULL DEFAULT current_timestamp(), PRIMARY KEY (`id`), KEY `trolley_FK` (`workerFk`), CONSTRAINT `trolley_FK` FOREIGN KEY (`workerFk`) REFERENCES `worker` (`id`) ON DELETE SET NULL ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -42946,8 +42480,8 @@ CREATE TABLE `userConfig` ( `userFk` int(10) unsigned NOT NULL, `warehouseFk` smallint(6) DEFAULT NULL, `companyFk` smallint(5) unsigned DEFAULT NULL, - `created` timestamp NULL DEFAULT CURRENT_TIMESTAMP, - `updated` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `created` timestamp NULL DEFAULT current_timestamp(), + `updated` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), PRIMARY KEY (`userFk`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Configuración de usuario en Salix'; /*!40101 SET character_set_client = @saved_cs_client */; @@ -42964,11 +42498,11 @@ CREATE TABLE `userLog` ( `originFk` int(10) unsigned NOT NULL, `userFk` int(10) unsigned DEFAULT NULL, `action` set('insert','update','delete') COLLATE utf8_unicode_ci NOT NULL, - `creationDate` timestamp NULL DEFAULT CURRENT_TIMESTAMP, - `description` text CHARACTER SET utf8, + `creationDate` timestamp NULL DEFAULT current_timestamp(), + `description` text CHARACTER SET utf8 DEFAULT NULL, `changedModel` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, - `oldInstance` text COLLATE utf8_unicode_ci, - `newInstance` text COLLATE utf8_unicode_ci, + `oldInstance` text COLLATE utf8_unicode_ci DEFAULT NULL, + `newInstance` text COLLATE utf8_unicode_ci DEFAULT NULL, `changedModelId` int(11) DEFAULT NULL, `changedModelValue` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), @@ -43025,9 +42559,9 @@ CREATE TABLE `vehicle` ( `numberPlate` varchar(10) COLLATE utf8_unicode_ci NOT NULL, `model` varchar(20) COLLATE utf8_unicode_ci NOT NULL, `tradeMark` varchar(20) COLLATE utf8_unicode_ci NOT NULL, - `companyFk` smallint(5) unsigned NOT NULL DEFAULT '442', + `companyFk` smallint(5) unsigned NOT NULL DEFAULT 442, `m3` double DEFAULT NULL, - `isActive` tinyint(4) NOT NULL DEFAULT '1', + `isActive` tinyint(4) NOT NULL DEFAULT 1, `warehouseFk` smallint(6) unsigned DEFAULT NULL, `description` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, `deliveryPointFk` int(11) DEFAULT '6' COMMENT 'Direccion para Buscaman', @@ -43066,7 +42600,7 @@ CREATE TABLE `vehicleDms` ( KEY `vehicleDms_FK_1` (`dmsFk`), CONSTRAINT `vehicleDms_FK` FOREIGN KEY (`vehicleFk`) REFERENCES `vehicle` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `vehicleDms_FK_1` FOREIGN KEY (`dmsFk`) REFERENCES `dms` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Gestion documental de vehicle'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Gestion documental de vehicle'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -43089,7 +42623,7 @@ CREATE TABLE `vehicleEvent` ( KEY `vehicleEvent_FK_1` (`userFk`), CONSTRAINT `vehicleEvent_FK` FOREIGN KEY (`vehicleStateFk`) REFERENCES `vehicleState` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `vehicleEvent_FK_1` FOREIGN KEY (`userFk`) REFERENCES `account`.`user` (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -43109,7 +42643,7 @@ CREATE TABLE `vehicleInvoiceIn` ( KEY `vehicleInvoiceIn_FK_1` (`invoiceInFk`), CONSTRAINT `vehicleInvoiceIn_FK` FOREIGN KEY (`vehicleFk`) REFERENCES `vehicle` (`id`), CONSTRAINT `vehicleInvoiceIn_FK_1` FOREIGN KEY (`invoiceInFk`) REFERENCES `invoiceIn` (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -43122,7 +42656,7 @@ DROP TABLE IF EXISTS `vehicleNotes`; CREATE TABLE `vehicleNotes` ( `id` int(11) NOT NULL AUTO_INCREMENT, `vehicleFk` int(10) unsigned NOT NULL, - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `created` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `note` text COLLATE utf8_unicode_ci NOT NULL, `userFk` int(10) unsigned DEFAULT NULL, PRIMARY KEY (`id`), @@ -43157,15 +42691,15 @@ DROP TABLE IF EXISTS `volumeConfig`; CREATE TABLE `volumeConfig` ( `palletM3` decimal(10,2) DEFAULT NULL COMMENT 'metros cúbicos', `trolleyM3` decimal(10,2) DEFAULT NULL COMMENT 'metros cúbicos', - `dutchCompressionRate` double NOT NULL DEFAULT '1', + `dutchCompressionRate` double NOT NULL DEFAULT 1, `standardFlowerBox` int(11) NOT NULL COMMENT 'en litros', - `minCompressionRate` decimal(10,2) DEFAULT '0.30' COMMENT 'minimo permitido por la empresa', - `ccLength` int(11) NOT NULL DEFAULT '130' COMMENT 'longitud útil para la carga de un CC, en cm', - `ccWidth` int(11) NOT NULL DEFAULT '60' COMMENT 'ancho útil para la carga en un CC, en cm', - `sorterPallet_m3` decimal(5,1) NOT NULL DEFAULT '2.0' COMMENT 'volumen minimo para extraer pallet del sorter', - `minTicketVolume` int(11) NOT NULL DEFAULT '75' COMMENT 'volumen mínimo, en litros, para que un pedido sea preparable', - `shelveVolume` int(11) DEFAULT '200' COMMENT 'volumen en litros de una bandeja standard, a efectos de los sacadores', - `minTicketValue` int(11) NOT NULL DEFAULT '50' + `minCompressionRate` decimal(10,2) DEFAULT 0.30 COMMENT 'minimo permitido por la empresa', + `ccLength` int(11) NOT NULL DEFAULT 130 COMMENT 'longitud útil para la carga de un CC, en cm', + `ccWidth` int(11) NOT NULL DEFAULT 60 COMMENT 'ancho útil para la carga en un CC, en cm', + `sorterPallet_m3` decimal(5,1) NOT NULL DEFAULT 2.0 COMMENT 'volumen minimo para extraer pallet del sorter', + `minTicketVolume` int(11) NOT NULL DEFAULT 75 COMMENT 'volumen mínimo, en litros, para que un pedido sea preparable', + `shelveVolume` int(11) DEFAULT 200 COMMENT 'volumen en litros de una bandeja standard, a efectos de los sacadores', + `minTicketValue` int(11) NOT NULL DEFAULT 50 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='almacena el valor standard para volumenes convencionales de Verdnatura, en metros cúbicos'; /*!40101 SET character_set_client = @saved_cs_client */; @@ -43178,10 +42712,10 @@ DROP TABLE IF EXISTS `wagon`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `wagon` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `volume` int(11) NOT NULL DEFAULT '150' COMMENT 'Volumen en litros', + `volume` int(11) NOT NULL DEFAULT 150 COMMENT 'Volumen en litros', `plate` varchar(10) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Matrícula', PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -43193,15 +42727,15 @@ DROP TABLE IF EXISTS `wagonVolumetry`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `wagonVolumetry` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `level` int(10) unsigned NOT NULL DEFAULT '0', - `lines` int(10) unsigned NOT NULL DEFAULT '1', - `liters` int(10) unsigned NOT NULL DEFAULT '0', - `height` int(10) unsigned NOT NULL DEFAULT '20', + `level` int(10) unsigned NOT NULL DEFAULT 0, + `lines` int(10) unsigned NOT NULL DEFAULT 1, + `liters` int(10) unsigned NOT NULL DEFAULT 0, + `height` int(10) unsigned NOT NULL DEFAULT 20, `wagonFk` int(11) NOT NULL, PRIMARY KEY (`id`), KEY `wagonVolumetry_FK` (`wagonFk`), CONSTRAINT `wagonVolumetry_FK` FOREIGN KEY (`wagonFk`) REFERENCES `wagon` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -43215,31 +42749,31 @@ CREATE TABLE `warehouse` ( `id` smallint(6) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(20) COLLATE utf8_unicode_ci NOT NULL, `code` varchar(3) COLLATE utf8_unicode_ci DEFAULT NULL, - `isFeedStock` tinyint(1) unsigned NOT NULL DEFAULT '0', + `isFeedStock` tinyint(1) unsigned NOT NULL DEFAULT 0, `addressName` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, - `delay` double NOT NULL DEFAULT '0.004', - `hasAvailable` tinyint(4) NOT NULL DEFAULT '0', - `isForTicket` tinyint(2) unsigned zerofill NOT NULL DEFAULT '00', - `countryFk` mediumint(8) unsigned NOT NULL DEFAULT '1', - `labelZone` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'almacenes donde hay produccion', - `hasComission` tinyint(4) NOT NULL DEFAULT '0', - `isInventory` tinyint(2) NOT NULL DEFAULT '0', - `isComparative` tinyint(2) NOT NULL DEFAULT '0' COMMENT 'Si esta a true,en la comparativa muestra el stock de este almacen, cuando no se especifica almacen.', - `valuatedInventory` tinyint(2) NOT NULL DEFAULT '0' COMMENT 'Determina si se incluye en el informe de inventario valorado', - `isManaged` tinyint(2) NOT NULL DEFAULT '0' COMMENT 'Se añaden los cubos de expedition a la tabla ticketPackaging', - `hasConfectionTeam` tinyint(1) unsigned NOT NULL DEFAULT '0', - `hasStowaway` tinyint(1) NOT NULL DEFAULT '0', - `hasDms` tinyint(1) NOT NULL DEFAULT '0', + `delay` double NOT NULL DEFAULT 0.004, + `hasAvailable` tinyint(4) NOT NULL DEFAULT 0, + `isForTicket` tinyint(2) unsigned zerofill NOT NULL DEFAULT 00, + `countryFk` mediumint(8) unsigned NOT NULL DEFAULT 1, + `labelZone` tinyint(4) NOT NULL DEFAULT 0 COMMENT 'almacenes donde hay produccion', + `hasComission` tinyint(4) NOT NULL DEFAULT 0, + `isInventory` tinyint(2) NOT NULL DEFAULT 0, + `isComparative` tinyint(2) NOT NULL DEFAULT 0 COMMENT 'Si esta a true,en la comparativa muestra el stock de este almacen, cuando no se especifica almacen.', + `valuatedInventory` tinyint(2) NOT NULL DEFAULT 0 COMMENT 'Determina si se incluye en el informe de inventario valorado', + `isManaged` tinyint(2) NOT NULL DEFAULT 0 COMMENT 'Se añaden los cubos de expedition a la tabla ticketPackaging', + `hasConfectionTeam` tinyint(1) unsigned NOT NULL DEFAULT 0, + `hasStowaway` tinyint(1) NOT NULL DEFAULT 0, + `hasDms` tinyint(1) NOT NULL DEFAULT 0, `pickUpAgencyModeFk` int(11) DEFAULT NULL, - `isBuyerToBeEmailed` tinyint(2) NOT NULL DEFAULT '0', + `isBuyerToBeEmailed` tinyint(2) NOT NULL DEFAULT 0, `aliasFk` smallint(5) unsigned DEFAULT NULL, `labelReport` int(11) DEFAULT NULL, - `hasUbications` tinyint(1) NOT NULL DEFAULT '1', - `hasProduction` tinyint(1) NOT NULL DEFAULT '0', + `hasUbications` tinyint(1) NOT NULL DEFAULT 1, + `hasProduction` tinyint(1) NOT NULL DEFAULT 0, `addressFk` int(11) DEFAULT NULL, - `hasMachine` tinyint(1) NOT NULL DEFAULT '0', - `isLogiflora` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Este almacén acepta productos de Logiflora', - `isBionic` tinyint(1) NOT NULL DEFAULT '1', + `hasMachine` tinyint(1) NOT NULL DEFAULT 0, + `isLogiflora` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'Este almacén acepta productos de Logiflora', + `isBionic` tinyint(1) NOT NULL DEFAULT 1, PRIMARY KEY (`id`), UNIQUE KEY `name_UNIQUE` (`name`), KEY `Id_Paises` (`countryFk`), @@ -43323,7 +42857,7 @@ DROP TABLE IF EXISTS `workCenter`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `workCenter` ( - `id` int(11) NOT NULL DEFAULT '0', + `id` int(11) NOT NULL DEFAULT 0, `name` varchar(255) DEFAULT NULL, `payrollCenterFk` int(11) DEFAULT NULL, `counter` bigint(20) DEFAULT NULL, @@ -43373,19 +42907,19 @@ CREATE TABLE `worker` ( `started__` datetime DEFAULT NULL, `ended__` datetime DEFAULT NULL, `notes__` varchar(254) COLLATE utf8_unicode_ci DEFAULT NULL, - `photo` blob, + `photo` blob DEFAULT NULL, `fi__` varchar(9) COLLATE utf8_unicode_ci DEFAULT NULL, `address__` varchar(50) COLLATE utf8_unicode_ci NOT NULL, `birthed__` date NOT NULL, `phone` varchar(9) COLLATE utf8_unicode_ci NOT NULL, `clientFk__` int(11) DEFAULT NULL, `userFk` int(10) unsigned DEFAULT NULL, - `bossFk` int(11) NOT NULL DEFAULT '103', + `bossFk` int(11) NOT NULL DEFAULT 103, `fiDueDate` datetime DEFAULT NULL, - `hasMachineryAuthorized` tinyint(2) DEFAULT '0', + `hasMachineryAuthorized` tinyint(2) DEFAULT 0, `seniority` date DEFAULT NULL, - `isTodayRelative` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Para el F11. Calcula los problemas de visiblidad en funcion del dia actual', - `isF11Allowed` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Usuario autorizado para abrir el F11', + `isTodayRelative` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'Para el F11. Calcula los problemas de visiblidad en funcion del dia actual', + `isF11Allowed` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'Usuario autorizado para abrir el F11', `sectorFk` int(11) DEFAULT NULL COMMENT 'Sector que tiene asociado el trabajador.', `maritalStatus` enum('S','M') COLLATE utf8_unicode_ci NOT NULL, `labelerFk` tinyint(3) unsigned DEFAULT NULL, @@ -43427,7 +42961,7 @@ CREATE TABLE `workerBosses` ( KEY `fg_bossFk_worker_idx` (`bossFk`), CONSTRAINT `fg_bossFk_worker` FOREIGN KEY (`bossFk`) REFERENCES `worker` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `fg_workerFk_worker` FOREIGN KEY (`workerFk`) REFERENCES `worker` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -43455,9 +42989,9 @@ DROP TABLE IF EXISTS `workerBusinessType`; CREATE TABLE `workerBusinessType` ( `id` int(11) NOT NULL, `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, - `isFullTime` tinyint(1) NOT NULL DEFAULT '1', - `isPermanent` tinyint(1) NOT NULL DEFAULT '1' COMMENT 'Contrato fijo', - `hasHolidayEntitlement` tinyint(1) DEFAULT '1' COMMENT 'Tiene derecho a vacaciones', + `isFullTime` tinyint(1) NOT NULL DEFAULT 1, + `isPermanent` tinyint(1) NOT NULL DEFAULT 1 COMMENT 'Contrato fijo', + `hasHolidayEntitlement` tinyint(1) DEFAULT 1 COMMENT 'Tiene derecho a vacaciones', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -43490,7 +43024,7 @@ CREATE TABLE `workerClockLog` ( `originFk` int(11) NOT NULL, `userFk` int(10) unsigned NOT NULL, `action` set('insert','update','delete','select') COLLATE utf8_unicode_ci NOT NULL, - `creationDate` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + `creationDate` timestamp NULL DEFAULT current_timestamp(), `description` text COLLATE utf8_unicode_ci NOT NULL, PRIMARY KEY (`id`), KEY `logWorkerClockoriginFk` (`originFk`), @@ -43571,7 +43105,7 @@ CREATE TABLE `workerDistributionCategory` ( PRIMARY KEY (`id`), KEY `workerDistributionCategory_workerFk_idx` (`workerFk`), CONSTRAINT `workerDistributionCategory_workerFk` FOREIGN KEY (`workerFk`) REFERENCES `worker` (`id`) ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -43585,7 +43119,7 @@ CREATE TABLE `workerDocument` ( `id` int(11) NOT NULL AUTO_INCREMENT, `worker` int(10) unsigned DEFAULT NULL, `document` int(11) DEFAULT NULL, - `isReadableByWorker` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Indica si el empleado tiene permiso para acceder al documento', + `isReadableByWorker` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'Indica si el empleado tiene permiso para acceder al documento', PRIMARY KEY (`id`), KEY `workerDocument_ibfk_1` (`worker`), KEY `workerDocument_ibfk_2` (`document`), @@ -43606,7 +43140,7 @@ CREATE TABLE `workerEmergencyBoss` ( `name` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, `value` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'Table to save all responsible people phones', PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -43623,7 +43157,7 @@ CREATE TABLE `workerHourPrice` ( `nightInc` decimal(4,2) DEFAULT NULL, `extraInc` decimal(4,2) DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Recoge los acuerdos de los distintos convenios'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Recoge los acuerdos de los distintos convenios'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -43638,14 +43172,14 @@ CREATE TABLE `workerIrpf` ( `spouseNif` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, `geographicMobilityDate` date DEFAULT NULL, `disabilityGradeFk` int(11) DEFAULT NULL, - `isDependend` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Acredita la necesidad de ayuda de terceras personas o movilidad reducida', + `isDependend` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'Acredita la necesidad de ayuda de terceras personas o movilidad reducida', `familySituation` enum('1','2','3') COLLATE utf8_unicode_ci DEFAULT '1', `spousePension` decimal(10,2) DEFAULT NULL COMMENT 'Apartado 4 - Pensión compensatoria en favor del conyuge ', `childPension` decimal(10,2) DEFAULT NULL COMMENT 'Apartado 4 - Anualidades por alimentos en favor de los hijos', - `hasHousingPaymentBefore` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Apartado 5 - Pagos por adquisición o rehabilitación de la vivienda habitual utilizando financiación ajena, con derecho a deducción del IRPF', - `hasHousingPaymentAfter` tinyint(1) NOT NULL DEFAULT '0', - `hasExtendedWorking` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Aprtado 1 - prolongar la actividad laboral', - `updated` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + `hasHousingPaymentBefore` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'Apartado 5 - Pagos por adquisición o rehabilitación de la vivienda habitual utilizando financiación ajena, con derecho a deducción del IRPF', + `hasHousingPaymentAfter` tinyint(1) NOT NULL DEFAULT 0, + `hasExtendedWorking` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'Aprtado 1 - prolongar la actividad laboral', + `updated` timestamp NULL DEFAULT current_timestamp(), PRIMARY KEY (`workerFk`), KEY `workerIrpf_disabilityGradeFk` (`disabilityGradeFk`), CONSTRAINT `workerIrpf_disabilityGradeFk` FOREIGN KEY (`disabilityGradeFk`) REFERENCES `disabilityGrade` (`id`) ON UPDATE CASCADE, @@ -43664,21 +43198,21 @@ CREATE TABLE `workerJourney` ( `id` int(11) NOT NULL AUTO_INCREMENT, `userFk` int(10) unsigned NOT NULL, `dated` date NOT NULL, - `total` decimal(5,2) NOT NULL DEFAULT '0.00', - `priceOrdinaryHour` decimal(5,2) NOT NULL DEFAULT '0.00', - `nocturn` decimal(5,2) NOT NULL DEFAULT '0.00', - `priceNocturnHour` decimal(5,2) NOT NULL DEFAULT '0.00', - `holiday` decimal(5,2) NOT NULL DEFAULT '0.00', - `priceHolidayHour` decimal(5,2) NOT NULL DEFAULT '0.00', - `lunch` decimal(5,2) NOT NULL DEFAULT '0.00', - `priceExtraHour` decimal(5,2) NOT NULL DEFAULT '0.00', - `extra` decimal(5,2) NOT NULL DEFAULT '0.00', - `contractJourney` decimal(5,2) NOT NULL DEFAULT '0.00', - `priceExtraHoliday` decimal(5,2) NOT NULL DEFAULT '0.00', + `total` decimal(5,2) NOT NULL DEFAULT 0.00, + `priceOrdinaryHour` decimal(5,2) NOT NULL DEFAULT 0.00, + `nocturn` decimal(5,2) NOT NULL DEFAULT 0.00, + `priceNocturnHour` decimal(5,2) NOT NULL DEFAULT 0.00, + `holiday` decimal(5,2) NOT NULL DEFAULT 0.00, + `priceHolidayHour` decimal(5,2) NOT NULL DEFAULT 0.00, + `lunch` decimal(5,2) NOT NULL DEFAULT 0.00, + `priceExtraHour` decimal(5,2) NOT NULL DEFAULT 0.00, + `extra` decimal(5,2) NOT NULL DEFAULT 0.00, + `contractJourney` decimal(5,2) NOT NULL DEFAULT 0.00, + `priceExtraHoliday` decimal(5,2) NOT NULL DEFAULT 0.00, `businessFk` int(11) DEFAULT NULL, - `isPaid` tinyint(1) NOT NULL DEFAULT '0', - `isUpdated` tinyint(1) NOT NULL DEFAULT '0', - `permission` decimal(5,2) NOT NULL DEFAULT '0.00', + `isPaid` tinyint(1) NOT NULL DEFAULT 0, + `isUpdated` tinyint(1) NOT NULL DEFAULT 0, + `permission` decimal(5,2) NOT NULL DEFAULT 0.00, PRIMARY KEY (`id`), UNIQUE KEY `userFk_UNIQUE` (`userFk`,`dated`), KEY `fk_workerJourney_user_idx` (`userFk`), @@ -43686,7 +43220,7 @@ CREATE TABLE `workerJourney` ( KEY `workerJourney_dated_idx` (`dated`), CONSTRAINT `fk_workerJourney_user` FOREIGN KEY (`userFk`) REFERENCES `account`.`user` (`id`) ON UPDATE CASCADE, CONSTRAINT `workerJourney_businessFk` FOREIGN KEY (`businessFk`) REFERENCES `postgresql`.`business` (`business_id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -43720,11 +43254,11 @@ CREATE TABLE `workerLog` ( `originFk` int(10) unsigned NOT NULL, `userFk` int(10) unsigned NOT NULL, `action` set('insert','update','delete') COLLATE utf8_unicode_ci NOT NULL, - `creationDate` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + `creationDate` timestamp NULL DEFAULT current_timestamp(), `description` text COLLATE utf8_unicode_ci NOT NULL, `changedModel` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, - `oldInstance` text COLLATE utf8_unicode_ci, - `newInstance` text COLLATE utf8_unicode_ci, + `oldInstance` text COLLATE utf8_unicode_ci DEFAULT NULL, + `newInstance` text COLLATE utf8_unicode_ci DEFAULT NULL, `changedModelId` int(11) DEFAULT NULL, `changedModelValue` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), @@ -43732,7 +43266,7 @@ CREATE TABLE `workerLog` ( KEY `userFk_idx` (`userFk`), CONSTRAINT `userFk` FOREIGN KEY (`userFk`) REFERENCES `account`.`user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `workerFk` FOREIGN KEY (`originFk`) REFERENCES `worker` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -43744,12 +43278,12 @@ DROP TABLE IF EXISTS `workerMana`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `workerMana` ( `workerFk` int(10) unsigned NOT NULL, - `size` int(11) NOT NULL DEFAULT '300', - `amount` int(11) NOT NULL DEFAULT '0', - `pricesModifierRate` double NOT NULL DEFAULT '0', - `isPricesModifierActivated` tinyint(1) NOT NULL DEFAULT '1', - `minRate` decimal(3,2) NOT NULL DEFAULT '-0.05', - `maxRate` decimal(3,2) NOT NULL DEFAULT '0.05', + `size` int(11) NOT NULL DEFAULT 300, + `amount` int(11) NOT NULL DEFAULT 0, + `pricesModifierRate` double NOT NULL DEFAULT 0, + `isPricesModifierActivated` tinyint(1) NOT NULL DEFAULT 1, + `minRate` decimal(3,2) NOT NULL DEFAULT -0.05, + `maxRate` decimal(3,2) NOT NULL DEFAULT 0.05, PRIMARY KEY (`workerFk`), KEY `fk_mana_spellers_Trabajadores_idx` (`workerFk`), CONSTRAINT `fk_mana_spellers_Trabajadores` FOREIGN KEY (`workerFk`) REFERENCES `worker` (`id`) ON DELETE CASCADE ON UPDATE CASCADE @@ -43814,13 +43348,13 @@ CREATE TABLE `workerMistake` ( `id` int(11) NOT NULL AUTO_INCREMENT, `userFk` int(10) unsigned NOT NULL, `workerMistakeTypeFk` varchar(10) COLLATE utf8_unicode_ci NOT NULL, - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created` timestamp NOT NULL DEFAULT current_timestamp(), PRIMARY KEY (`id`), KEY `workerMistake_fk1_idx` (`userFk`), KEY `workerMistake_fk2_idx` (`workerMistakeTypeFk`), CONSTRAINT `workerMistake_fk1` FOREIGN KEY (`userFk`) REFERENCES `worker` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `workerMistake_fk2` FOREIGN KEY (`workerMistakeTypeFk`) REFERENCES `workerMistakeType` (`code`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -43847,19 +43381,19 @@ DROP TABLE IF EXISTS `workerRelatives`; CREATE TABLE `workerRelatives` ( `id` int(11) NOT NULL AUTO_INCREMENT, `workerFk` int(10) unsigned NOT NULL, - `isDescendant` tinyint(1) DEFAULT '1' COMMENT 'Descendientes - Ascendientes', + `isDescendant` tinyint(1) DEFAULT 1 COMMENT 'Descendientes - Ascendientes', `disabilityGradeFk` int(11) DEFAULT NULL, `birthed` int(4) NOT NULL, `adoptionYear` int(4) DEFAULT NULL COMMENT 'Solo en el caso de descendientes', - `isDependend` tinyint(1) DEFAULT '0', - `isJointCustody` tinyint(1) DEFAULT '0' COMMENT 'Solo en el caso de descendientes', - `updated` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + `isDependend` tinyint(1) DEFAULT 0, + `isJointCustody` tinyint(1) DEFAULT 0 COMMENT 'Solo en el caso de descendientes', + `updated` timestamp NULL DEFAULT current_timestamp(), PRIMARY KEY (`id`), KEY `workerRelatives_disabilityGradeFk` (`disabilityGradeFk`), KEY `workerRelatives_workerFk` (`workerFk`), CONSTRAINT `workerRelatives_disabilityGradeFk` FOREIGN KEY (`disabilityGradeFk`) REFERENCES `disabilityGrade` (`id`) ON UPDATE CASCADE, CONSTRAINT `workerRelatives_workerFk` FOREIGN KEY (`workerFk`) REFERENCES `workerIrpf` (`workerFk`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Modelo 145 IRPF apartado 2 y 3'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Modelo 145 IRPF apartado 2 y 3'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -43874,7 +43408,7 @@ CREATE TABLE `workerShelving` ( `workerFk` int(10) unsigned NOT NULL, `shelvingFk` varchar(10) CHARACTER SET utf8 NOT NULL, `collectionFk` int(11) DEFAULT NULL, - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created` timestamp NOT NULL DEFAULT current_timestamp(), PRIMARY KEY (`id`), KEY `workerShelving_shelving_fk` (`shelvingFk`), KEY `workerShelving_FK` (`workerFk`), @@ -43882,7 +43416,7 @@ CREATE TABLE `workerShelving` ( CONSTRAINT `workerShelving_FK` FOREIGN KEY (`collectionFk`) REFERENCES `collection` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `workerShelving_shelving_fk` FOREIGN KEY (`shelvingFk`) REFERENCES `shelving` (`code`) ON UPDATE CASCADE, CONSTRAINT `workerShelving_worker_fk` FOREIGN KEY (`workerFk`) REFERENCES `worker` (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='utilizaremos el id para establecer la prioridad de los carros a asignar'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='utilizaremos el id para establecer la prioridad de los carros a asignar'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -43968,11 +43502,11 @@ CREATE TABLE `workerTimeControl` ( `id` int(11) NOT NULL AUTO_INCREMENT, `userFk` int(10) unsigned NOT NULL, `timed` datetime NOT NULL, - `manual` tinyint(4) NOT NULL DEFAULT '0', + `manual` tinyint(4) NOT NULL DEFAULT 0, `order` int(11) DEFAULT NULL, `warehouseFk` smallint(6) unsigned DEFAULT NULL, `direction` enum('in','out','middle') COLLATE utf8_unicode_ci DEFAULT 'middle', - `isSendMail` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'Fichadas generadas autómaticamente con el procedimiento vn.workerTimeControl_sendMail', + `isSendMail` tinyint(4) NOT NULL DEFAULT 0 COMMENT 'Fichadas generadas autómaticamente con el procedimiento vn.workerTimeControl_sendMail', PRIMARY KEY (`id`), UNIQUE KEY `userFk_Timed_uniq` (`userFk`,`timed`), KEY `warehouseFkfk1_idx` (`warehouseFk`), @@ -43993,7 +43527,7 @@ DELIMITER ;; AFTER INSERT ON `workerTimeControl` FOR EACH ROW BEGIN - IF NEW.timed > DATE_ADD(NOW(), INTERVAL 1 DAY) THEN + IF NEW.timed > DATE_ADD(util.VN_NOW(), INTERVAL 1 DAY) THEN CALL util.throw('date in the future'); END IF; END */;; @@ -44032,7 +43566,7 @@ CREATE TABLE `workerTimeControlConfig` ( `timeToBreakTime` int(11) DEFAULT NULL COMMENT 'Tiempo mínimo que se debe trabajar para añadir descanso, expresado en segundos', `dayMaxTime` int(11) DEFAULT NULL COMMENT 'Tiempo máximo desde la entrada hasta la salida, expresado en segundos', PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='All values in seconds'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='All values in seconds'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -44049,7 +43583,7 @@ CREATE TABLE `workerTimeControlConfig_` ( PRIMARY KEY (`id`), KEY `warehouseFk_1_idx` (`warehouseFk`), CONSTRAINT `warehouseFk_2` FOREIGN KEY (`warehouseFk`) REFERENCES `warehouse` (`id`) ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -44062,7 +43596,7 @@ DROP TABLE IF EXISTS `workerTimeControlLog`; CREATE TABLE `workerTimeControlLog` ( `id` int(11) NOT NULL AUTO_INCREMENT, `userFk` int(10) NOT NULL, - `created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created` datetime NOT NULL DEFAULT current_timestamp(), `description` varchar(45) COLLATE utf8_unicode_ci NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Log de fichadas, se rellena cuando el fichador(tablet) no autoriza el fichaje (PROC:vn.workerTimeControl_check)'; @@ -44081,14 +43615,14 @@ CREATE TABLE `workerTimeControlMail` ( `year` int(4) NOT NULL, `week` int(2) NOT NULL, `state` enum('SENDED','CONFIRMED','REVISE') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'SENDED', - `updated` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Fecha/hora último cambio de estado', - `sendedCounter` int(3) NOT NULL DEFAULT '1' COMMENT 'Número de veces que se ha enviado el correo', - `emailResponse` text COLLATE utf8_unicode_ci, + `updated` datetime NOT NULL DEFAULT current_timestamp() COMMENT 'Fecha/hora último cambio de estado', + `sendedCounter` int(3) NOT NULL DEFAULT 1 COMMENT 'Número de veces que se ha enviado el correo', + `emailResponse` text COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `workerFk_UNIQUE` (`workerFk`,`year`,`week`), KEY `workerFk_idx` (`workerFk`), CONSTRAINT `workerTimeControlMail_workerFk` FOREIGN KEY (`workerFk`) REFERENCES `worker` (`id`) ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Guarda las respuestas de mail de los correos generados automáticamente por la procedimiento workerTimeControl_sendMail'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Guarda las respuestas de mail de los correos generados automáticamente por la procedimiento workerTimeControl_sendMail'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -44144,7 +43678,7 @@ CREATE TABLE `workerTimeControlSchedule` ( `time` time DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `punique_trhf` (`time`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -44263,8 +43797,8 @@ DROP TABLE IF EXISTS `workers20190711`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `workers20190711` ( - `person_id` int(11) NOT NULL DEFAULT '0', - `business_id` int(11) NOT NULL DEFAULT '0', + `person_id` int(11) NOT NULL DEFAULT 0, + `business_id` int(11) NOT NULL DEFAULT 0, `Apellidos` varchar(60) CHARACTER SET utf8 NOT NULL, `Nombre` varchar(20) CHARACTER SET utf8 DEFAULT NULL, `nif` varchar(15) CHARACTER SET utf8 DEFAULT NULL, @@ -44289,7 +43823,7 @@ DROP TABLE IF EXISTS `workers20190711_FichadasAbril`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `workers20190711_FichadasAbril` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `person_id` int(11) NOT NULL DEFAULT '0', + `person_id` int(11) NOT NULL DEFAULT 0, `nif` varchar(15) CHARACTER SET utf8 DEFAULT NULL, `Apellidos` varchar(60) CHARACTER SET utf8 NOT NULL, `Nombre` varchar(20) CHARACTER SET utf8 DEFAULT NULL, @@ -44297,9 +43831,9 @@ CREATE TABLE `workers20190711_FichadasAbril` ( `Hora` int(2) DEFAULT NULL, `Minuto` int(2) DEFAULT NULL, `sumable` double DEFAULT NULL, - `jornada` decimal(5,2) NOT NULL DEFAULT '8.00', + `jornada` decimal(5,2) NOT NULL DEFAULT 8.00, PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -44311,7 +43845,7 @@ DROP TABLE IF EXISTS `workers20190711_FichadasJulio11`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `workers20190711_FichadasJulio11` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `person_id` int(11) NOT NULL DEFAULT '0', + `person_id` int(11) NOT NULL DEFAULT 0, `nif` varchar(15) CHARACTER SET utf8 DEFAULT NULL, `Apellidos` varchar(60) CHARACTER SET utf8 NOT NULL, `Nombre` varchar(20) CHARACTER SET utf8 DEFAULT NULL, @@ -44319,9 +43853,9 @@ CREATE TABLE `workers20190711_FichadasJulio11` ( `Hora` int(2) DEFAULT NULL, `Minuto` int(2) DEFAULT NULL, `sumable` double DEFAULT NULL, - `jornada` decimal(5,2) NOT NULL DEFAULT '8.00', + `jornada` decimal(5,2) NOT NULL DEFAULT 8.00, PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -44333,7 +43867,7 @@ DROP TABLE IF EXISTS `workers20190711_FichadasJunio`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `workers20190711_FichadasJunio` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `person_id` int(11) NOT NULL DEFAULT '0', + `person_id` int(11) NOT NULL DEFAULT 0, `nif` varchar(15) CHARACTER SET utf8 DEFAULT NULL, `Apellidos` varchar(60) CHARACTER SET utf8 NOT NULL, `Nombre` varchar(20) CHARACTER SET utf8 DEFAULT NULL, @@ -44341,9 +43875,9 @@ CREATE TABLE `workers20190711_FichadasJunio` ( `Hora` int(2) DEFAULT NULL, `Minuto` int(2) DEFAULT NULL, `sumable` double DEFAULT NULL, - `jornada` decimal(5,2) NOT NULL DEFAULT '8.00', + `jornada` decimal(5,2) NOT NULL DEFAULT 8.00, PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -44355,7 +43889,7 @@ DROP TABLE IF EXISTS `workers20190711_FichadasMayo`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `workers20190711_FichadasMayo` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `person_id` int(11) NOT NULL DEFAULT '0', + `person_id` int(11) NOT NULL DEFAULT 0, `nif` varchar(15) CHARACTER SET utf8 DEFAULT NULL, `Apellidos` varchar(60) CHARACTER SET utf8 NOT NULL, `Nombre` varchar(20) CHARACTER SET utf8 DEFAULT NULL, @@ -44363,9 +43897,9 @@ CREATE TABLE `workers20190711_FichadasMayo` ( `Hora` int(2) DEFAULT NULL, `Minuto` int(2) DEFAULT NULL, `sumable` double DEFAULT NULL, - `jornada` decimal(5,2) NOT NULL DEFAULT '8.00', + `jornada` decimal(5,2) NOT NULL DEFAULT 8.00, PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -44377,7 +43911,7 @@ DROP TABLE IF EXISTS `workers20190711_FichadasOctubre`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `workers20190711_FichadasOctubre` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `person_id` int(11) NOT NULL DEFAULT '0', + `person_id` int(11) NOT NULL DEFAULT 0, `nif` varchar(15) CHARACTER SET utf8 DEFAULT NULL, `Apellidos` varchar(60) CHARACTER SET utf8 NOT NULL, `Nombre` varchar(20) CHARACTER SET utf8 DEFAULT NULL, @@ -44385,9 +43919,9 @@ CREATE TABLE `workers20190711_FichadasOctubre` ( `Hora` int(2) DEFAULT NULL, `Minuto` int(2) DEFAULT NULL, `sumable` double DEFAULT NULL, - `jornada` decimal(5,2) NOT NULL DEFAULT '8.00', + `jornada` decimal(5,2) NOT NULL DEFAULT 8.00, PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -44399,7 +43933,7 @@ DROP TABLE IF EXISTS `workers20190711_Garrote`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `workers20190711_Garrote` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `person_id` int(11) NOT NULL DEFAULT '0', + `person_id` int(11) NOT NULL DEFAULT 0, `nif` varchar(15) CHARACTER SET utf8 DEFAULT NULL, `Apellidos` varchar(60) CHARACTER SET utf8 NOT NULL, `Nombre` varchar(20) CHARACTER SET utf8 DEFAULT NULL, @@ -44407,9 +43941,9 @@ CREATE TABLE `workers20190711_Garrote` ( `Hora` int(2) DEFAULT NULL, `Minuto` int(2) DEFAULT NULL, `sumable` double DEFAULT NULL, - `jornada` decimal(5,2) NOT NULL DEFAULT '8.00', + `jornada` decimal(5,2) NOT NULL DEFAULT 8.00, PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -44427,7 +43961,7 @@ CREATE TABLE `workingHours` ( PRIMARY KEY (`id`), KEY `user_working_hour_idx` (`userId`), CONSTRAINT `user_working_hour` FOREIGN KEY (`userId`) REFERENCES `account`.`user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Almacena horas de Entrada y de Salida del personal'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Almacena horas de Entrada y de Salida del personal'; /*!40101 SET character_set_client = @saved_cs_client */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -44442,7 +43976,7 @@ DELIMITER ;; BEFORE INSERT ON `workingHours` FOR EACH ROW BEGIN - IF (SELECT COUNT(*) FROM workingHours WHERE userId = NEW.userId AND DATE(timeIn) = CURDATE()) > 0 THEN + IF (SELECT COUNT(*) FROM workingHours WHERE userId = NEW.userId AND DATE(timeIn) = util.VN_CURDATE()) > 0 THEN CALL util.throw ('ALREADY_LOGGED'); END IF; END */;; @@ -44465,11 +43999,11 @@ CREATE TABLE `zone` ( `hour` datetime NOT NULL, `warehouseFk__` smallint(6) unsigned DEFAULT NULL, `agencyModeFk` int(11) NOT NULL, - `travelingDays` int(11) NOT NULL DEFAULT '1', - `price` double NOT NULL DEFAULT '0', - `bonus` double NOT NULL DEFAULT '0', - `isVolumetric` tinyint(1) NOT NULL DEFAULT '0', - `inflation` decimal(5,2) NOT NULL DEFAULT '1.00', + `travelingDays` int(11) NOT NULL DEFAULT 1, + `price` double NOT NULL DEFAULT 0, + `bonus` double NOT NULL DEFAULT 0, + `isVolumetric` tinyint(1) NOT NULL DEFAULT 0, + `inflation` decimal(5,2) NOT NULL DEFAULT 1.00, `m3Max` decimal(10,2) unsigned DEFAULT NULL, `itemMaxSize` int(11) DEFAULT NULL COMMENT 'tamaño maximo de los articulos que esa ruta puede transportar', `code` varchar(45) DEFAULT NULL, @@ -44526,7 +44060,7 @@ DROP TABLE IF EXISTS `zoneConfig`; CREATE TABLE `zoneConfig` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `scope` int(10) unsigned NOT NULL, - `forwardDays` int(10) NOT NULL DEFAULT '7' COMMENT 'days forward to show zone_upcomingDeliveries', + `forwardDays` int(10) NOT NULL DEFAULT 7 COMMENT 'days forward to show zone_upcomingDeliveries', PRIMARY KEY (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -44588,13 +44122,13 @@ CREATE TABLE `zoneExclusion` ( `id` int(11) NOT NULL AUTO_INCREMENT, `zoneFk` int(11) NOT NULL, `dated` date NOT NULL, - `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created` timestamp NOT NULL DEFAULT current_timestamp(), `userFk` int(11) DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `zoneFk_2` (`zoneFk`,`dated`), KEY `zoneFk` (`zoneFk`), CONSTRAINT `zoneExclusion_ibfk_1` FOREIGN KEY (`zoneFk`) REFERENCES `zone` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -44658,7 +44192,7 @@ CREATE TABLE `zoneFilter` ( KEY `zoneFilter_FK_1` (`itemTypeFk`), CONSTRAINT `zoneFilter_FK` FOREIGN KEY (`zoneFk`) REFERENCES `zone` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `zoneFilter_FK_1` FOREIGN KEY (`itemTypeFk`) REFERENCES `itemType` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='recoge los parámetros para filtrar determinados productos según la zona'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='recoge los parámetros para filtrar determinados productos según la zona'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -44676,7 +44210,7 @@ CREATE TABLE `zoneGeo` ( `path` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `lft` int(11) DEFAULT NULL, `rgt` int(11) DEFAULT NULL, - `depth` bigint(22) NOT NULL DEFAULT '0', + `depth` bigint(22) NOT NULL DEFAULT 0, `sons` decimal(10,0) DEFAULT NULL, PRIMARY KEY (`id`), KEY `lft_rgt_depth_idx` (`lft`,`rgt`,`depth`), @@ -44739,7 +44273,7 @@ CREATE TABLE `zoneGeoRecalc` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `isChanged` tinyint(4) NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -44772,11 +44306,11 @@ CREATE TABLE `zoneLog` ( `originFk` int(10) NOT NULL, `userFk` int(10) unsigned DEFAULT NULL, `action` set('insert','update','delete') COLLATE utf8_unicode_ci NOT NULL, - `creationDate` timestamp NULL DEFAULT CURRENT_TIMESTAMP, - `description` text CHARACTER SET utf8, + `creationDate` timestamp NULL DEFAULT current_timestamp(), + `description` text CHARACTER SET utf8 DEFAULT NULL, `changedModel` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, - `oldInstance` text COLLATE utf8_unicode_ci, - `newInstance` text COLLATE utf8_unicode_ci, + `oldInstance` text COLLATE utf8_unicode_ci DEFAULT NULL, + `newInstance` text COLLATE utf8_unicode_ci DEFAULT NULL, `changedModelId` int(11) DEFAULT NULL, `changedModelValue` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), @@ -44784,7 +44318,7 @@ CREATE TABLE `zoneLog` ( KEY `userFk` (`userFk`), CONSTRAINT `zoneLog_ibfk_1` FOREIGN KEY (`originFk`) REFERENCES `zone` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `zoneLog_ibfk_2` FOREIGN KEY (`userFk`) REFERENCES `account`.`user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -44799,11 +44333,11 @@ CREATE TABLE `zonePromo__` ( `zoneFk` int(11) NOT NULL, `dated` date NOT NULL, `amount` decimal(10,2) NOT NULL, - `isDone` tinyint(4) NOT NULL DEFAULT '0', + `isDone` tinyint(4) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), KEY `zonePromo_fk1_idx` (`zoneFk`), CONSTRAINT `zonePromo_fk1` FOREIGN KEY (`zoneFk`) REFERENCES `zone` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -45065,7 +44599,7 @@ DELIMITER ;; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;; /*!50003 SET @saved_time_zone = @@time_zone */ ;; /*!50003 SET time_zone = 'SYSTEM' */ ;; -/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `sale_checkWithoutComponents` ON SCHEDULE EVERY 10 MINUTE STARTS '2020-05-04 11:56:23' ON COMPLETION PRESERVE DISABLE DO call sale_checkNoComponents(DATE_ADD(NOW(), INTERVAL -10 MINUTE),DATE_ADD(NOW(), INTERVAL -1 MINUTE)) */ ;; +/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `sale_checkWithoutComponents` ON SCHEDULE EVERY 10 MINUTE STARTS '2020-05-04 11:56:23' ON COMPLETION PRESERVE DISABLE DO call sale_checkNoComponents(DATE_ADD(util.VN_NOW(), INTERVAL -10 MINUTE),DATE_ADD(util.VN_NOW(), INTERVAL -1 MINUTE)) */ ;; /*!50003 SET time_zone = @saved_time_zone */ ;; /*!50003 SET sql_mode = @saved_sql_mode */ ;; /*!50003 SET character_set_client = @saved_cs_client */ ;; @@ -45083,7 +44617,7 @@ DELIMITER ;; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;; /*!50003 SET @saved_time_zone = @@time_zone */ ;; /*!50003 SET time_zone = 'SYSTEM' */ ;; -/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `ticketClosure` ON SCHEDULE EVERY 1 DAY STARTS '2017-09-18 00:30:00' ON COMPLETION NOT PRESERVE DISABLE COMMENT 'Realiza el cierre de todos los almacenes del dia actual' DO CALL ticketClosureMultiWarehouse(DATE_ADD(CURDATE(), INTERVAL -1 DAY)) */ ;; +/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `ticketClosure` ON SCHEDULE EVERY 1 DAY STARTS '2017-09-18 00:30:00' ON COMPLETION NOT PRESERVE DISABLE COMMENT 'Realiza el cierre de todos los almacenes del dia actual' DO CALL ticketClosureMultiWarehouse(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 DAY)) */ ;; /*!50003 SET time_zone = @saved_time_zone */ ;; /*!50003 SET sql_mode = @saved_sql_mode */ ;; /*!50003 SET character_set_client = @saved_cs_client */ ;; @@ -45142,7 +44676,7 @@ DELIMITER ;; SELECT week,year INTO vWeek,vYear FROM vn.time - WHERE dated IN (DATE_ADD(CURDATE(), INTERVAL -10 DAY), DATE_ADD(CURDATE(), INTERVAL -4 DAY)) + WHERE dated IN (DATE_ADD(util.VN_CURDATE(), INTERVAL -10 DAY), DATE_ADD(util.VN_CURDATE(), INTERVAL -4 DAY)) GROUP BY year,week LIMIT 1; @@ -45635,7 +45169,7 @@ BEGIN INSERT INTO tmp.catalog_component (warehouseFk, itemFk, componentFk, cost) SELECT vWarehouse, vItem, vComponentCost, vCost FROM vn.rate - WHERE dated <= CURDATE() + WHERE dated <= util.VN_CURDATE() AND warehouseFk = vWarehouse ORDER BY dated DESC LIMIT 1; @@ -45645,7 +45179,7 @@ BEGIN /* INSERT INTO tmp.catalog_component (warehouseFk, itemFk, componentFk, cost) SELECT vWarehouse, vItem, vComponentMargin, (vCost / ((100 - rate2) / 100)) - vCost FROM vn.rate - WHERE dated <= CURDATE() + WHERE dated <= util.VN_CURDATE() AND warehouseFk = vWarehouse ORDER BY dated DESC LIMIT 1; @@ -45720,9 +45254,9 @@ BEGIN RETURN 0; END IF; - SET vDate = IFNULL(vDate, CURDATE()); + SET vDate = IFNULL(vDate, util.VN_CURDATE()); - SET vDateIni = TIMESTAMPADD(MONTH, -2, CURDATE()); + SET vDateIni = TIMESTAMPADD(MONTH, -2, util.VN_CURDATE()); SET vDateEnd = TIMESTAMP(vDate, '23:59:59'); SELECT IFNULL(SUM(t.amount), 0) INTO vDebt @@ -45814,7 +45348,7 @@ BEGIN JOIN saleComponent sc on sc.saleFk = s.id WHERE sc.componentFk IN (vManaComponent, vAutoManaComponent) AND t.shipped > vFromDated - AND t.shipped < TIMESTAMPADD(DAY,1,CURDATE()) + AND t.shipped < TIMESTAMPADD(DAY,1,util.VN_CURDATE()) AND a.clientFk = vClient UNION ALL SELECT - amountPaid @@ -45822,7 +45356,7 @@ BEGIN JOIN `client` c ON c.id = r.clientFk WHERE r.bankFk = vManaBank AND r.payed > vFromDated - AND r.payed <= CURDATE() + AND r.payed <= util.VN_CURDATE() AND c.id = vClient UNION ALL SELECT g.amount @@ -45830,7 +45364,7 @@ BEGIN JOIN `client` c ON c.id = g.clientFk WHERE g.greugeTypeFk = vManaGreugeType AND g.shipped > vFromDated - AND g.shipped <= CURDATE() + AND g.shipped <= util.VN_CURDATE() AND c.id = vClient ) sub; RETURN IFNULL(vMana,0); @@ -46022,7 +45556,7 @@ BEGIN l: LOOP SELECT workerSubstitute INTO vWorkerSubstituteFk FROM sharingCart - WHERE curdate() BETWEEN started AND ended + WHERE util.VN_CURDATE() BETWEEN started AND ended AND workerFk = vSalesPersonFk ORDER BY id LIMIT 1; @@ -46299,7 +45833,7 @@ BEGIN FROM (SELECT taxClassFk, rate FROM invoiceInTaxBookingAccount - WHERE effectived <= CURDATE() + WHERE effectived <= util.VN_CURDATE() AND countryFk = vCountryFk AND taxClassFk = vTaxClass ORDER BY effectived DESC @@ -46511,8 +46045,7 @@ DELIMITER ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; -CREATE DEFINER=`root`@`localhost` FUNCTION `entry_calcCommission__`( - vCurrentCommission INT, +CREATE DEFINER=`root`@`localhost` FUNCTION `entry_calcCommission__`(vCurrentCommission INT, vTravelFk INT, vCurrencyFk INT ) RETURNS int(11) @@ -46552,8 +46085,7 @@ DELIMITER ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; -CREATE DEFINER=`root`@`localhost` FUNCTION `entry_getCommission`( - vTravelFk INT, +CREATE DEFINER=`root`@`localhost` FUNCTION `entry_getCommission`(vTravelFk INT, vCurrencyFk INT, vSupplierFk INT ) RETURNS int(11) @@ -46622,8 +46154,7 @@ DELIMITER ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; -CREATE DEFINER=`root`@`localhost` FUNCTION `entry_getCommission__`( - vTravelFk INT, +CREATE DEFINER=`root`@`localhost` FUNCTION `entry_getCommission__`(vTravelFk INT, vCurrencyFk INT, vSupplierFk INT ) RETURNS int(11) @@ -46669,8 +46200,7 @@ DELIMITER ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; -CREATE DEFINER=`root`@`localhost` FUNCTION `entry_getCurrency`( - vCurrency INT, +CREATE DEFINER=`root`@`localhost` FUNCTION `entry_getCurrency`(vCurrency INT, vSupplierFk INT ) RETURNS int(11) READS SQL DATA @@ -47021,6 +46551,19 @@ DELIMITER ; /*!50003 SET character_set_client = @saved_cs_client */ ; /*!50003 SET character_set_results = @saved_cs_results */ ; /*!50003 SET collation_connection = @saved_col_connection */ ; +/*!50003 DROP FUNCTION IF EXISTS `getEnvironment` */; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8 */ ; +/*!50003 SET character_set_results = utf8 */ ; +/*!50003 SET collation_connection = utf8_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; /*!50003 DROP FUNCTION IF EXISTS `getInventoryDate` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -47202,7 +46745,7 @@ BEGIN SELECT rate3 INTO price FROM vn.priceFixed WHERE itemFk = vItemFk - AND CURDATE() BETWEEN started AND ended ORDER BY created DESC LIMIT 1; + AND util.VN_CURDATE() BETWEEN started AND ended ORDER BY created DESC LIMIT 1; SELECT `value` INTO price FROM vn.specialPrice @@ -47239,7 +46782,7 @@ BEGIN * #PENDING REVIEW **/ - DECLARE vToday DATETIME DEFAULT CURDATE(); + DECLARE vToday DATETIME DEFAULT util.VN_CURDATE(); DECLARE vYesterday DATETIME; DECLARE vTodayvMidniight DATETIME DEFAULT midnight(vToday); DECLARE vTicket INT DEFAULT NULL; @@ -47256,10 +46799,10 @@ BEGIN FROM vn.sale s JOIN vn.saleTracking st ON st.saleFk = s.id JOIN vn.ticketStateToday tst ON tst.ticket = s.ticketFk - WHERE st.created > CURDATE() + WHERE st.created > util.VN_CURDATE() -- AND tst.`code` = 'ON_PREPARATION' ) sub ON sub.ticketFk = i.Id_Ticket - WHERE odbc_date > CURDATE() + WHERE odbc_date > util.VN_CURDATE() AND s.`code` = 'ON_PREPARATION' AND i.Id_Trabajador = vWorker AND sub.ticketFk IS NULL @@ -48280,7 +47823,7 @@ BEGIN IF (SELECT COUNT(*) FROM machineWorker m WHERE m.workerFk = vWorkerFk - AND m.inTimed >= TIMESTAMPADD(HOUR , -12,NOW()) AND ISNULL(m.outTimed)) + AND m.inTimed >= TIMESTAMPADD(HOUR , -12,util.VN_NOW()) AND ISNULL(m.outTimed)) THEN RETURN "REGISTERED"; ELSE @@ -48369,7 +47912,7 @@ BEGIN DECLARE vCount INT; DECLARE vUuid VARCHAR(255); - DECLARE vSendDate DATETIME DEFAULT NOW(); + DECLARE vSendDate DATETIME DEFAULT util.VN_NOW(); DECLARE vSender VARCHAR(255) CHARSET utf8; SELECT `name` INTO vSender @@ -49341,7 +48884,7 @@ proc:BEGIN JOIN vn.saleGroupDetail sgd ON sgd.saleFk = s.id JOIN vn.saleGroup sg ON sg.id = sgd.saleGroupFk WHERE sg.id = vParamFk - AND sg.created > TIMESTAMPADD(WEEK,-1, CURDATE()) + AND sg.created > TIMESTAMPADD(WEEK,-1, util.VN_CURDATE()) LIMIT 1; IF vValidFk THEN @@ -49356,7 +48899,7 @@ proc:BEGIN SELECT c.id INTO vValidFk FROM vn.collection c WHERE c.id = vParamFk - AND c.created > TIMESTAMPADD(WEEK,-1, CURDATE()); + AND c.created > TIMESTAMPADD(WEEK,-1, util.VN_CURDATE()); IF vValidFk THEN @@ -49370,7 +48913,7 @@ proc:BEGIN SELECT t.id INTO vValidFk FROM vn.ticket t WHERE t.id = vParamFk - AND t.shipped > TIMESTAMPADD(WEEK,-1, CURDATE()); + AND t.shipped > TIMESTAMPADD(WEEK,-1, util.VN_CURDATE()); IF vValidFk THEN @@ -49500,7 +49043,7 @@ BEGIN IF vTicket IS NULL THEN CALL vn.ticket_add( vClientFk, - IFNULL(vShipped, CURDATE()), + IFNULL(vShipped, util.VN_CURDATE()), vWarehouseFk, vCompanyFk, vAddressFk, @@ -49560,8 +49103,7 @@ DELIMITER ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; -CREATE DEFINER=`root`@`localhost` FUNCTION `till_new`( - vClient INT +CREATE DEFINER=`root`@`localhost` FUNCTION `till_new`(vClient INT ,vBank INT ,vAmount DOUBLE ,vConcept VARCHAR(25) @@ -49782,7 +49324,7 @@ BEGIN IF NOT vTravelFk THEN INSERT INTO vn.travel(landed, shipped, warehouseInFk, warehouseOutFk, agencyFk) - SELECT vLanded, curdate(), vWarehouseFk, wOut.id, am.id + SELECT vLanded, util.VN_CURDATE(), vWarehouseFk, wOut.id, am.id FROM vn.warehouse wOut JOIN vn.agencyMode am ON am.name = 'LOGIFLORA' WHERE wOut.name = 'Holanda'; @@ -49888,6 +49430,45 @@ DELIMITER ; /*!50003 SET character_set_client = @saved_cs_client */ ; /*!50003 SET character_set_results = @saved_cs_results */ ; /*!50003 SET collation_connection = @saved_col_connection */ ; +/*!50003 DROP FUNCTION IF EXISTS `VN_CURDATE` */; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8 */ ; +/*!50003 SET character_set_results = utf8 */ ; +/*!50003 SET collation_connection = utf8_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +/*!50003 DROP FUNCTION IF EXISTS `VN_CURTIME` */; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8 */ ; +/*!50003 SET character_set_results = utf8 */ ; +/*!50003 SET collation_connection = utf8_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +/*!50003 DROP FUNCTION IF EXISTS `VN_NOW` */; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8 */ ; +/*!50003 SET character_set_results = utf8 */ ; +/*!50003 SET collation_connection = utf8_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; /*!50003 DROP FUNCTION IF EXISTS `workerIsBoss` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -49970,7 +49551,7 @@ BEGIN IF (SELECT COUNT(*) FROM machineWorker m WHERE m.workerFk = vWorkerFk - AND m.inTimed >= TIMESTAMPADD(HOUR , -(SELECT maxHours from machineWorkerConfig), NOW()) AND ISNULL(m.outTimed)) + AND m.inTimed >= TIMESTAMPADD(HOUR , -(SELECT maxHours from machineWorkerConfig), util.VN_NOW()) AND ISNULL(m.outTimed)) THEN RETURN TRUE; ELSE @@ -50032,7 +49613,7 @@ DELIMITER ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; -CREATE DEFINER=`root`@`localhost` FUNCTION `workerTimeControl_add`( vUserFk INT, vWarehouseFk INT, vTimed DATETIME, vIsManual BOOL) RETURNS int(11) +CREATE DEFINER=`root`@`localhost` FUNCTION `workerTimeControl_add`(vUserFk INT, vWarehouseFk INT, vTimed DATETIME, vIsManual BOOL) RETURNS int(11) DETERMINISTIC BEGIN DECLARE vDirection VARCHAR(6); @@ -50101,7 +49682,7 @@ DELIMITER ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; -CREATE DEFINER=`root`@`localhost` FUNCTION `workerTimeControl_addDirection`( vUserFk INT, vWarehouseFk INT, vTimed DATETIME, vIsManual BOOL) RETURNS int(11) +CREATE DEFINER=`root`@`localhost` FUNCTION `workerTimeControl_addDirection`(vUserFk INT, vWarehouseFk INT, vTimed DATETIME, vIsManual BOOL) RETURNS int(11) DETERMINISTIC BEGIN DECLARE vDirection VARCHAR(6); @@ -50209,8 +49790,7 @@ DELIMITER ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; -CREATE DEFINER=`root`@`localhost` FUNCTION `xdiario_new`( - vAsiento INT, +CREATE DEFINER=`root`@`localhost` FUNCTION `xdiario_new`(vAsiento INT, vDated DATE, vSubaccount VARCHAR(12), vAccount VARCHAR(12), @@ -50392,7 +49972,7 @@ BEGIN */ DECLARE vAgency INT; DECLARE vShipped DATE; -DECLARE vLanded DATE DEFAULT CURDATE(); +DECLARE vLanded DATE DEFAULT util.VN_CURDATE(); SELECT agencyFk INTO vAgency FROM agencyMode WHERE id= vAgencyMode; l: LOOP @@ -50459,7 +50039,7 @@ BEGIN ) t LIMIT 1 ) t - WHERE IF(vDated = CURDATE(), t.maxHour > HOUR(NOW()), TRUE) AND t.substractDay < 225; + WHERE IF(vDated = util.VN_CURDATE(), t.maxHour > HOUR(util.VN_NOW()), TRUE) AND t.substractDay < 225; END ;; DELIMITER ; @@ -50535,8 +50115,8 @@ BEGIN AND (ah.provinceFk = a.provinceFk OR ah.provinceFk IS NULL OR vAddress IS NULL) - AND TIMESTAMPADD(DAY, -ah.substractDay, vDate) >= CURDATE() - AND IF(TIMESTAMPADD(DAY, -ah.substractDay, vDate) = CURDATE(), ah.maxHour > HOUR(NOW()), TRUE) + AND TIMESTAMPADD(DAY, -ah.substractDay, vDate) >= util.VN_CURDATE() + AND IF(TIMESTAMPADD(DAY, -ah.substractDay, vDate) = util.VN_CURDATE(), ah.maxHour > HOUR(util.VN_NOW()), TRUE) ORDER BY ( (ah.weekDay IS NOT NULL) + (ah.agencyFk IS NOT NULL) + @@ -50786,7 +50366,7 @@ BEGIN ON s.id = bp.supplierFk LEFT JOIN vn.bank b ON b.id = bp.bankFk - WHERE bp.insuranceExpired = CURDATE(); + WHERE bp.insuranceExpired = util.VN_CURDATE(); END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -50823,7 +50403,7 @@ BEGIN FROM cache.last_buy WHERE warehouse_id = vWarehouseFk OR vWarehouseFk IS NULL; - CALL buyUltimateFromInterval(vWarehouseFk, CURDATE(), vDated); + CALL buyUltimateFromInterval(vWarehouseFk, util.VN_CURDATE(), vDated); REPLACE INTO tmp.buyUltimate SELECT itemFk, buyFk, warehouseFk, landed landing @@ -51010,7 +50590,7 @@ BEGIN FROM cache.last_buy WHERE warehouse_id = vWarehouseFk OR vWarehouseFk IS NULL; - CALL buyUltimateFromInterval(vWarehouseFk, CURDATE(), vDated); + CALL buyUltimateFromInterval(vWarehouseFk, util.VN_CURDATE(), vDated); REPLACE INTO tmp.buyUltimate SELECT itemFk, buyFk, warehouseFk @@ -51377,7 +50957,7 @@ BEGIN * @param vGrouping Cantidad de grouping */ - CALL vn.buyUltimate(vWarehouseFk, CURDATE()); + CALL vn.buyUltimate(vWarehouseFk, util.VN_CURDATE()); UPDATE vn.buy b JOIN tmp.buyUltimate bu ON b.id = bu.buyFk @@ -51411,7 +50991,7 @@ BEGIN * @param vItemFk id del item * @param vPacking packing a actualizar */ - CALL buyUltimate(vWarehouseFk, CURDATE()); + CALL buyUltimate(vWarehouseFk, util.VN_CURDATE()); UPDATE buy b JOIN tmp.buyUltimate bu ON b.id = bu.buyFk @@ -51449,7 +51029,7 @@ BEGIN DROP TEMPORARY TABLE IF EXISTS tmp.camara; - IF vDateStart = CURDATE() THEN + IF vDateStart = util.VN_CURDATE() THEN CREATE TEMPORARY TABLE tmp.camara SELECT vDated as dated, @@ -52380,7 +51960,7 @@ proc: BEGIN * @return tmp.ticketComponentPrice * @return tmp.zoneGetShipped */ - DECLARE vLanded DATE DEFAULT DATE_ADD(CURDATE(),INTERVAL 2 DAY); + DECLARE vLanded DATE DEFAULT DATE_ADD(util.VN_CURDATE(),INTERVAL 2 DAY); DECLARE vAddressFk INT DEFAULT 24526; DECLARE vAgencyModeFk INT DEFAULT 639; DECLARE vAvailableCalc INT; @@ -52537,12 +52117,12 @@ BEGIN DECLARE v3Month DATE; DECLARE vTrashId varchar(15); - SET vDateShort = TIMESTAMPADD(MONTH, -2, CURDATE()); - SET vOneYearAgo = TIMESTAMPADD(YEAR,-1,CURDATE()); - SET vFourYearsAgo = TIMESTAMPADD(YEAR,-4,CURDATE()); - SET v18Month = TIMESTAMPADD(MONTH, -18,CURDATE()); - SET v26Month = TIMESTAMPADD(MONTH, -26,CURDATE()); - SET v3Month = TIMESTAMPADD(MONTH, -3, CURDATE()); + SET vDateShort = TIMESTAMPADD(MONTH, -2, util.VN_CURDATE()); + SET vOneYearAgo = TIMESTAMPADD(YEAR,-1,util.VN_CURDATE()); + SET vFourYearsAgo = TIMESTAMPADD(YEAR,-4,util.VN_CURDATE()); + SET v18Month = TIMESTAMPADD(MONTH, -18,util.VN_CURDATE()); + SET v26Month = TIMESTAMPADD(MONTH, -26,util.VN_CURDATE()); + SET v3Month = TIMESTAMPADD(MONTH, -3, util.VN_CURDATE()); DELETE FROM ticketParking WHERE created < vDateShort; DELETE FROM routesMonitor WHERE dated < vDateShort; @@ -52551,14 +52131,14 @@ BEGIN DELETE FROM messageInbox WHERE sendDate < vDateShort; DELETE FROM messageInbox WHERE sendDate < vDateShort; DELETE FROM workerTimeControl WHERE timed < vFourYearsAgo; - DELETE FROM itemShelving WHERE created < CURDATE() AND visible = 0; - DELETE FROM ticketDown WHERE created < TIMESTAMPADD(DAY,-1,CURDATE()); + DELETE FROM itemShelving WHERE created < util.VN_CURDATE() AND visible = 0; + DELETE FROM ticketDown WHERE created < TIMESTAMPADD(DAY,-1,util.VN_CURDATE()); DELETE FROM entryLog WHERE creationDate < vDateShort; DELETE IGNORE FROM expedition WHERE created < v26Month; DELETE FROM sms WHERE created < v18Month; DELETE FROM saleTracking WHERE created < vOneYearAgo; DELETE tobs FROM ticketObservation tobs - JOIN ticket t ON tobs.ticketFk = t.id WHERE t.shipped < TIMESTAMPADD(YEAR,-2,CURDATE()); + JOIN ticket t ON tobs.ticketFk = t.id WHERE t.shipped < TIMESTAMPADD(YEAR,-2,util.VN_CURDATE()); DELETE sc.* FROM saleCloned sc JOIN sale s ON s.id = sc.saleClonedFk JOIN ticket t ON t.id = s.ticketFk WHERE t.shipped < vOneYearAgo; DELETE FROM sharingCart where ended < vDateShort; DELETE FROM sharingClient where ended < vDateShort; @@ -52612,7 +52192,7 @@ BEGIN FROM vn.travel t LEFT JOIN vn.entry e ON e.travelFk = t.id JOIN vn.travelThermograph th ON th.travelFk = t.id - WHERE t.shipped < TIMESTAMPADD(MONTH, -3, CURDATE()) AND e.travelFk IS NULL; + WHERE t.shipped < TIMESTAMPADD(MONTH, -3, util.VN_CURDATE()) AND e.travelFk IS NULL; SELECT dt.id into vTrashId FROM vn.dmsType dt @@ -52629,7 +52209,7 @@ BEGIN DELETE t FROM vn.travel t LEFT JOIN vn.entry e ON e.travelFk = t.id - WHERE t.shipped < TIMESTAMPADD(MONTH, -3, CURDATE()) AND e.travelFk IS NULL; + WHERE t.shipped < TIMESTAMPADD(MONTH, -3, util.VN_CURDATE()) AND e.travelFk IS NULL; -- borrar entradas sin compras DROP TEMPORARY TABLE IF EXISTS tmp.entryToDelete; @@ -52638,7 +52218,7 @@ BEGIN FROM vn.entry e LEFT JOIN vn.buy b ON b.entryFk = e.id JOIN vn.entryConfig ec ON e.id != ec.defaultEntry - WHERE e.dated < TIMESTAMPADD(MONTH, -3, CURDATE()) AND b.entryFK IS NULL; + WHERE e.dated < TIMESTAMPADD(MONTH, -3, util.VN_CURDATE()) AND b.entryFK IS NULL; DELETE e FROM vn.entry e @@ -52649,7 +52229,7 @@ BEGIN CREATE TEMPORARY TABLE tmp.routeToDelete SELECT * FROM vn.route r - WHERE created < TIMESTAMPADD(YEAR,-4,CURDATE()); + WHERE created < TIMESTAMPADD(YEAR,-4,util.VN_CURDATE()); UPDATE tmp.routeToDelete tmp JOIN vn.dms d ON d.id = tmp.gestdocFk @@ -52664,7 +52244,7 @@ BEGIN CREATE TEMPORARY TABLE tmp.duaToDelete SELECT * FROM vn.dua - WHERE operated < TIMESTAMPADD(YEAR,-2,CURDATE()); + WHERE operated < TIMESTAMPADD(YEAR,-2,util.VN_CURDATE()); UPDATE tmp.duaToDelete tm JOIN vn.dms d ON d.id = tm.gestdocFk @@ -52674,7 +52254,7 @@ BEGIN FROM tmp.duaToDelete tmp JOIN vn.dua d ON d.id = tmp.id; - DELETE FROM vn.awb WHERE created < TIMESTAMPADD(YEAR,-2,CURDATE()); + DELETE FROM vn.awb WHERE created < TIMESTAMPADD(YEAR,-2,util.VN_CURDATE()); -- Borra los ficheros gestDoc INSERT INTO vn.printServerQueue(priorityFk, labelReportFk)VALUES(1,11); @@ -52712,7 +52292,7 @@ BEGIN * item_clean, buy_clean * */ - DECLARE vMaxDated DATE DEFAULT TIMESTAMPADD(DAY, - 7, CURDATE()); + DECLARE vMaxDated DATE DEFAULT TIMESTAMPADD(DAY, - 7, util.VN_CURDATE()); DECLARE vDone INT DEFAULT FALSE; DECLARE vBuyFk INT; DECLARE cur1 CURSOR FOR SELECT id FROM tmp.buy; @@ -52923,15 +52503,15 @@ BEGIN DECLARE vClientDebt DOUBLE; - SELECT vn.clientGetDebt(vClientFk, CURDATE()) INTO vClientDebt; + SELECT vn.clientGetDebt(vClientFk, util.VN_CURDATE()) INTO vClientDebt; INSERT INTO vn.greuge(clientFk, description, amount, shipped, greugeTypeFk) - VALUES (vClientFk, 'Saldo pendiente', vClientDebt, CURDATE(), 5); + VALUES (vClientFk, 'Saldo pendiente', vClientDebt, util.VN_CURDATE(), 5); CALL vn.clientGreugeSpray(vClientFk, TRUE, '', TRUE); INSERT INTO vn.greuge(clientFk, description, amount, shipped, greugeTypeFk) - SELECT vClientFk, 'Liquidación cliente', sum(amount), CURDATE(), 5 + SELECT vClientFk, 'Liquidación cliente', sum(amount), util.VN_CURDATE(), 5 FROM vn.greuge WHERE clientFk = vClientFk; @@ -52969,20 +52549,20 @@ BEGIN SELECT id into vIsRemittanced FROM receipt WHERE invoiceFk LIKE 'REMESA%' - AND payed > util.firstDayOfMonth(CURDATE()) + AND payed > util.firstDayOfMonth(util.VN_CURDATE()) limit 1; DROP TEMPORARY TABLE IF EXISTS tmp.clientGetDebt; CREATE TEMPORARY TABLE tmp.clientGetDebt SELECT clientFk FROM bs.defaulter - WHERE created = CURDATE() + WHERE created = util.VN_CURDATE() AND amount; - CALL clientGetDebt(CURDATE()); + CALL clientGetDebt(util.VN_CURDATE()); UPDATE client c - JOIN bi.defaulters d ON d.client = c.id AND d.date = CURDATE() + JOIN bi.defaulters d ON d.client = c.id AND d.date = util.VN_CURDATE() JOIN config ON TRUE LEFT JOIN account.`user` u ON u.id = c.id AND u.active LEFT JOIN worker w ON w.id = u.id @@ -52990,7 +52570,7 @@ BEGIN LEFT JOIN payMethod pm ON pm.id = c.payMethodFk LEFT JOIN tmp.risk rk ON rk.clientFk = c.id SET c.isFreezed = TRUE, - d.frozened = CURDATE(), + d.frozened = util.VN_CURDATE(), u.active = FALSE WHERE (d.amount > config.defaultersMaxAmount AND rk.risk > 0) @@ -53025,10 +52605,10 @@ BEGIN * @param vDate Fecha maxima de los registros * @return tmp.risk */ - DECLARE vStarted DATETIME DEFAULT TIMESTAMPADD(DAY, -35, CURDATE()); + DECLARE vStarted DATETIME DEFAULT TIMESTAMPADD(DAY, -35, util.VN_CURDATE()); DECLARE vEnded DATETIME; - SET vEnded = TIMESTAMP(IFNULL(vDate, CURDATE()), '23:59:59'); + SET vEnded = TIMESTAMP(IFNULL(vDate, util.VN_CURDATE()), '23:59:59'); DROP TEMPORARY TABLE IF EXISTS tClientRisk; CREATE TEMPORARY TABLE tClientRisk @@ -53238,7 +52818,7 @@ BEGIN VALUES( vClientFk, 'Desasignación', -1 * vMana, - CURDATE(), + util.VN_CURDATE(), vGreugeTypeMana); END IF; @@ -53271,7 +52851,7 @@ BEGIN JOIN vn.manaSpellers ms ON ms.worker = c.salesPersonFk JOIN vn.claimRatio cr ON cr.clientFk = c.id WHERE ms.worker = IF(onlyForHisOwner, vOwner, ms.worker) - AND t.shipped >= TIMESTAMPADD(MONTH,-1,CURDATE()) + AND t.shipped >= TIMESTAMPADD(MONTH,-1,util.VN_CURDATE()) AND c.id != vClientFk HAVING monthSale > 100; @@ -53279,10 +52859,10 @@ BEGIN FROM tmp.clientList; INSERT INTO vn.greuge(clientFk, description, amount, shipped, greugeTypeFk) - SELECT clientFk, CONCAT('Cliente: ',vClientFk), vGreuge * monthSale / vTotalSale, CURDATE(), vGreugeTypeFk + SELECT clientFk, CONCAT('Cliente: ',vClientFk), vGreuge * monthSale / vTotalSale, util.VN_CURDATE(), vGreugeTypeFk FROM tmp.clientList UNION ALL - SELECT vClientFk, 'Reparto greuge', -vGreuge, CURDATE(), vGreugeTypeFk; + SELECT vClientFk, 'Reparto greuge', -vGreuge, util.VN_CURDATE(), vGreugeTypeFk; END IF; @@ -53373,7 +52953,7 @@ BEGIN IFNULL(pe.equivalentFk, p.itemFk) itemFk, NULL, NULL, - IF(tp.quantity > 0 AND t.shipped <= TIMESTAMPADD(DAY, - vGraceDays, CURDATE()), tp.quantity, NULL) SenttoClient, + IF(tp.quantity > 0 AND t.shipped <= TIMESTAMPADD(DAY, - vGraceDays, util.VN_CURDATE()), tp.quantity, NULL) SenttoClient, IF(tp.quantity < 0, -tp.quantity, NULL) GotfromClient, NULL AS refFk, NULL, @@ -53422,13 +53002,13 @@ BEGIN CALL vn.ticket_add( vClientFk - ,CURDATE() + ,util.VN_CURDATE() ,vWarehouseFk -- Algemesi ,442 -- Verdnatura ,NULL -- address ,NULL -- agencia ,NULL -- route - ,CURDATE() + ,util.VN_CURDATE() ,account.myUser_getId() ,TRUE ,vNewTicket); @@ -53671,7 +53251,7 @@ BEGIN INSERT INTO tmp.client(clientFk) SELECT DISTINCT clientFk FROM vn.invoiceOut - WHERE issued > TIMESTAMPADD(MONTH, -2, CURDATE()); + WHERE issued > TIMESTAMPADD(MONTH, -2, util.VN_CURDATE()); SELECT max(id) INTO maxClientFk FROM tmp.client; @@ -53900,7 +53480,7 @@ BEGIN ELSE - INSERT INTO vn.cmr(created, ead) VALUES(NOW(), NOW() + INTERVAL vLandingDays DAY); + INSERT INTO vn.cmr(created, ead) VALUES(util.VN_NOW(), util.VN_NOW() + INTERVAL vLandingDays DAY); SELECT LAST_INSERT_ID(); @@ -53948,7 +53528,7 @@ BEGIN ELSE - INSERT INTO vn.cmr(created) VALUES(NOW()); + INSERT INTO vn.cmr(created) VALUES(util.VN_NOW()); SELECT LAST_INSERT_ID(); @@ -53977,7 +53557,7 @@ BEGIN */ SET SESSION group_concat_max_len = 1000000; --- IF (DAY(CURDATE()) = 5) THEN +-- IF (DAY(util.VN_CURDATE()) = 5) THEN INSERT INTO vn.mail (receiver, replyTo, @@ -53994,7 +53574,7 @@ BEGIN