diff --git a/back/methods/image/download.js b/back/methods/image/download.js index bbfe8e41a..3a8bcf30e 100644 --- a/back/methods/image/download.js +++ b/back/methods/image/download.js @@ -74,10 +74,13 @@ module.exports = Self => { const container = await models.ImageContainer.getContainer(collection); const rootPath = container.client.root; const fileSrc = path.join(rootPath, collection, size); + + const ext = image.name.substring((image.name.length - 4)); + const fileName = ext !== '.png' ? `${image.name}.png` : image.name; const file = { - path: `${fileSrc}/${image.name}.png`, + path: `${fileSrc}/${fileName}`, contentType: 'image/png', - name: `${image.name}.png` + name: image.name }; if (!fs.existsSync(file.path)) return []; diff --git a/back/methods/image/upload.js b/back/methods/image/upload.js index 676a4b5fb..143da275e 100644 --- a/back/methods/image/upload.js +++ b/back/methods/image/upload.js @@ -1,6 +1,7 @@ const UserError = require('vn-loopback/util/user-error'); const fs = require('fs-extra'); const path = require('path'); +const uuid = require('uuid'); module.exports = Self => { Self.remoteMethodCtx('upload', { @@ -18,12 +19,6 @@ module.exports = Self => { type: 'string', description: 'The collection name', required: true - }, - { - arg: 'fileName', - type: 'string', - description: 'The file name', - required: true }], returns: { type: 'Object', @@ -56,10 +51,12 @@ module.exports = Self => { const [uploadedFile] = Object.values(uploaded.files).map(file => { return file[0]; }); + const file = await TempContainer.getFile(tempContainer.name, uploadedFile.name); srcFile = path.join(file.client.root, file.container, file.name); - await models.Image.registerImage(args.collection, srcFile, args.fileName, args.id); + const fileName = `${uuid.v4()}.png`; + await models.Image.registerImage(args.collection, srcFile, fileName, args.id); } catch (e) { if (fs.existsSync(srcFile)) await fs.unlink(srcFile); diff --git a/back/models/image.js b/back/models/image.js index 37f4ec20d..3d3b03879 100644 --- a/back/models/image.js +++ b/back/models/image.js @@ -84,9 +84,8 @@ module.exports = Self => { const container = await models.ImageContainer.container(collectionName); const rootPath = container.client.root; const collectionDir = path.join(rootPath, collectionName); - const file = `${fileName}.png`; const dstDir = path.join(collectionDir, 'full'); - const dstFile = path.join(dstDir, file); + const dstFile = path.join(dstDir, fileName); const buffer = readChunk.sync(srcFilePath, 0, 12); const type = imageType(buffer); @@ -102,7 +101,8 @@ module.exports = Self => { width: bmpData.width, height: bmpData.height, channels: 4 - } + }, + failOn: 'none' }; } @@ -120,7 +120,7 @@ module.exports = Self => { const sizes = collection.sizes(); for (let size of sizes) { const dstDir = path.join(collectionDir, `${size.width}x${size.height}`); - const dstFile = path.join(dstDir, file); + const dstFile = path.join(dstDir, fileName); const resizeOpts = { withoutEnlargement: true, fit: size.crop ? 'cover' : 'inside' diff --git a/db/changes/224701/00-ACL.sql b/db/.archive/224701/00-ACL.sql similarity index 100% rename from db/changes/224701/00-ACL.sql rename to db/.archive/224701/00-ACL.sql diff --git a/db/changes/224701/00-acl_receiptPdf.sql b/db/.archive/224701/00-acl_receiptPdf.sql similarity index 100% rename from db/changes/224701/00-acl_receiptPdf.sql rename to db/.archive/224701/00-acl_receiptPdf.sql diff --git a/db/changes/224701/00-clientConsumptionQueue.sql b/db/.archive/224701/00-clientConsumptionQueue.sql similarity index 100% rename from db/changes/224701/00-clientConsumptionQueue.sql rename to db/.archive/224701/00-clientConsumptionQueue.sql diff --git a/db/changes/224701/00-invoiceOutQueue.sql b/db/.archive/224701/00-invoiceOutQueue.sql similarity index 100% rename from db/changes/224701/00-invoiceOutQueue.sql rename to db/.archive/224701/00-invoiceOutQueue.sql diff --git a/db/changes/224701/00-itemConfig.sql b/db/.archive/224701/00-itemConfig.sql similarity index 100% rename from db/changes/224701/00-itemConfig.sql rename to db/.archive/224701/00-itemConfig.sql diff --git a/db/changes/224701/00-printConfig.sql b/db/.archive/224701/00-printConfig.sql similarity index 100% rename from db/changes/224701/00-printConfig.sql rename to db/.archive/224701/00-printConfig.sql diff --git a/db/changes/224701/00-sale_afterUpdate.sql b/db/.archive/224701/00-sale_afterUpdate.sql similarity index 100% rename from db/changes/224701/00-sale_afterUpdate.sql rename to db/.archive/224701/00-sale_afterUpdate.sql diff --git a/db/changes/224701/00-sample.sql b/db/.archive/224701/00-sample.sql similarity index 100% rename from db/changes/224701/00-sample.sql rename to db/.archive/224701/00-sample.sql diff --git a/db/changes/224701/00-user_hasGrant.sql b/db/.archive/224701/00-user_hasGrant.sql similarity index 100% rename from db/changes/224701/00-user_hasGrant.sql rename to db/.archive/224701/00-user_hasGrant.sql diff --git a/db/changes/224702/00-ACL_workerDisableExcluded.sql b/db/.archive/224702/00-ACL_workerDisableExcluded.sql similarity index 100% rename from db/changes/224702/00-ACL_workerDisableExcluded.sql rename to db/.archive/224702/00-ACL_workerDisableExcluded.sql diff --git a/db/changes/224702/00-aclBusiness.sql b/db/.archive/224702/00-aclBusiness.sql similarity index 100% rename from db/changes/224702/00-aclBusiness.sql rename to db/.archive/224702/00-aclBusiness.sql diff --git a/db/changes/224702/00-aclUsesMana.sql b/db/.archive/224702/00-aclUsesMana.sql similarity index 100% rename from db/changes/224702/00-aclUsesMana.sql rename to db/.archive/224702/00-aclUsesMana.sql diff --git a/db/changes/224702/00-defaultPayDem_sameAs_production.sql b/db/.archive/224702/00-defaultPayDem_sameAs_production.sql similarity index 100% rename from db/changes/224702/00-defaultPayDem_sameAs_production.sql rename to db/.archive/224702/00-defaultPayDem_sameAs_production.sql diff --git a/db/changes/224702/00-invoiceInPdf.sql b/db/.archive/224702/00-invoiceInPdf.sql similarity index 100% rename from db/changes/224702/00-invoiceInPdf.sql rename to db/.archive/224702/00-invoiceInPdf.sql diff --git a/db/changes/224702/00-newSupplier_ACL.sql b/db/.archive/224702/00-newSupplier_ACL.sql similarity index 100% rename from db/changes/224702/00-newSupplier_ACL.sql rename to db/.archive/224702/00-newSupplier_ACL.sql diff --git a/db/changes/224702/00-notificationProc.sql b/db/.archive/224702/00-notificationProc.sql similarity index 100% rename from db/changes/224702/00-notificationProc.sql rename to db/.archive/224702/00-notificationProc.sql diff --git a/db/changes/224702/00-notificationTables.sql b/db/.archive/224702/00-notificationTables.sql similarity index 100% rename from db/changes/224702/00-notificationTables.sql rename to db/.archive/224702/00-notificationTables.sql diff --git a/db/changes/224702/00-payMethodFk_Allow_Null.sql b/db/.archive/224702/00-payMethodFk_Allow_Null.sql similarity index 100% rename from db/changes/224702/00-payMethodFk_Allow_Null.sql rename to db/.archive/224702/00-payMethodFk_Allow_Null.sql diff --git a/db/changes/224702/00-supplierActivityFk_Allow_Null.sql b/db/.archive/224702/00-supplierActivityFk_Allow_Null.sql similarity index 100% rename from db/changes/224702/00-supplierActivityFk_Allow_Null.sql rename to db/.archive/224702/00-supplierActivityFk_Allow_Null.sql diff --git a/db/changes/224702/00-ticket_closeByTicket.sql b/db/.archive/224702/00-ticket_closeByTicket.sql similarity index 100% rename from db/changes/224702/00-ticket_closeByTicket.sql rename to db/.archive/224702/00-ticket_closeByTicket.sql diff --git a/db/changes/224702/00-zipConfig.sql b/db/.archive/224702/00-zipConfig.sql similarity index 100% rename from db/changes/224702/00-zipConfig.sql rename to db/.archive/224702/00-zipConfig.sql diff --git a/db/changes/224801/00-ACL.sql b/db/.archive/224801/00-ACL.sql similarity index 100% rename from db/changes/224801/00-ACL.sql rename to db/.archive/224801/00-ACL.sql diff --git a/db/changes/224801/00-claim.sql b/db/.archive/224801/00-claim.sql similarity index 100% rename from db/changes/224801/00-claim.sql rename to db/.archive/224801/00-claim.sql diff --git a/db/changes/224801/00-claimRma.sql b/db/.archive/224801/00-claimRma.sql similarity index 100% rename from db/changes/224801/00-claimRma.sql rename to db/.archive/224801/00-claimRma.sql diff --git a/db/changes/224901/00-aclNotification.sql b/db/.archive/224901/00-aclNotification.sql similarity index 100% rename from db/changes/224901/00-aclNotification.sql rename to db/.archive/224901/00-aclNotification.sql diff --git a/db/changes/224901/00-packingSiteConfig.sql b/db/.archive/224901/00-packingSiteConfig.sql similarity index 100% rename from db/changes/224901/00-packingSiteConfig.sql rename to db/.archive/224901/00-packingSiteConfig.sql diff --git a/db/changes/224901/00-packingSiteUpdate.sql b/db/.archive/224901/00-packingSiteUpdate.sql similarity index 100% rename from db/changes/224901/00-packingSiteUpdate.sql rename to db/.archive/224901/00-packingSiteUpdate.sql diff --git a/db/changes/224901/00-salix_url.sql b/db/.archive/224901/00-salix_url.sql similarity index 100% rename from db/changes/224901/00-salix_url.sql rename to db/.archive/224901/00-salix_url.sql diff --git a/db/changes/224902/00-aclUserPassword.sql b/db/.archive/224902/00-aclUserPassword.sql similarity index 100% rename from db/changes/224902/00-aclUserPassword.sql rename to db/.archive/224902/00-aclUserPassword.sql diff --git a/db/changes/224902/00-deletePickupContact.sql b/db/.archive/224902/00-deletePickupContact.sql similarity index 100% rename from db/changes/224902/00-deletePickupContact.sql rename to db/.archive/224902/00-deletePickupContact.sql diff --git a/db/changes/224902/00-itemShelvingACL.sql b/db/.archive/224902/00-itemShelvingACL.sql similarity index 100% rename from db/changes/224902/00-itemShelvingACL.sql rename to db/.archive/224902/00-itemShelvingACL.sql diff --git a/db/changes/224902/00-itemShelvingPlacementSupplyStockACL.sql b/db/.archive/224902/00-itemShelvingPlacementSupplyStockACL.sql similarity index 100% rename from db/changes/224902/00-itemShelvingPlacementSupplyStockACL.sql rename to db/.archive/224902/00-itemShelvingPlacementSupplyStockACL.sql diff --git a/db/changes/224902/00-workerTimeControlMail.sql b/db/.archive/224902/00-workerTimeControlMail.sql similarity index 100% rename from db/changes/224902/00-workerTimeControlMail.sql rename to db/.archive/224902/00-workerTimeControlMail.sql diff --git a/db/changes/224902/00-zone_getPostalCode.sql b/db/.archive/224902/00-zone_getPostalCode.sql similarity index 100% rename from db/changes/224902/00-zone_getPostalCode.sql rename to db/.archive/224902/00-zone_getPostalCode.sql diff --git a/db/changes/224903/00-ACL_notification_InvoiceE.sql b/db/.archive/224903/00-ACL_notification_InvoiceE.sql similarity index 100% rename from db/changes/224903/00-ACL_notification_InvoiceE.sql rename to db/.archive/224903/00-ACL_notification_InvoiceE.sql diff --git a/db/changes/224903/00-aclInvoiceOut.sql b/db/.archive/224903/00-aclInvoiceOut.sql similarity index 100% rename from db/changes/224903/00-aclInvoiceOut.sql rename to db/.archive/224903/00-aclInvoiceOut.sql diff --git a/db/changes/224903/00-alter_expedition_itemFk.sql b/db/.archive/224903/00-alter_expedition_itemFk.sql similarity index 100% rename from db/changes/224903/00-alter_expedition_itemFk.sql rename to db/.archive/224903/00-alter_expedition_itemFk.sql diff --git a/db/changes/224903/00-clientHasInvoiceElectronic.sql b/db/.archive/224903/00-clientHasInvoiceElectronic.sql similarity index 100% rename from db/changes/224903/00-clientHasInvoiceElectronic.sql rename to db/.archive/224903/00-clientHasInvoiceElectronic.sql diff --git a/db/changes/224903/00-collection_missingTrash.sql b/db/.archive/224903/00-collection_missingTrash.sql similarity index 100% rename from db/changes/224903/00-collection_missingTrash.sql rename to db/.archive/224903/00-collection_missingTrash.sql diff --git a/db/changes/224903/00-deleteInvoiceOutQueue.sql b/db/.archive/224903/00-deleteInvoiceOutQueue.sql similarity index 100% rename from db/changes/224903/00-deleteInvoiceOutQueue.sql rename to db/.archive/224903/00-deleteInvoiceOutQueue.sql diff --git a/db/changes/224903/00-editTrackedACL.sql b/db/.archive/224903/00-editTrackedACL.sql similarity index 100% rename from db/changes/224903/00-editTrackedACL.sql rename to db/.archive/224903/00-editTrackedACL.sql diff --git a/db/changes/224903/00-greuge.sql b/db/.archive/224903/00-greuge.sql similarity index 100% rename from db/changes/224903/00-greuge.sql rename to db/.archive/224903/00-greuge.sql diff --git a/db/changes/224903/00-isCompensationACL.sql b/db/.archive/224903/00-isCompensationACL.sql similarity index 100% rename from db/changes/224903/00-isCompensationACL.sql rename to db/.archive/224903/00-isCompensationACL.sql diff --git a/db/changes/224903/00-osTicketConfig.sql b/db/.archive/224903/00-osTicketConfig.sql similarity index 100% rename from db/changes/224903/00-osTicketConfig.sql rename to db/.archive/224903/00-osTicketConfig.sql diff --git a/db/changes/224903/00-ticket_canMerge.sql b/db/.archive/224903/00-ticket_canMerge.sql similarity index 100% rename from db/changes/224903/00-ticket_canMerge.sql rename to db/.archive/224903/00-ticket_canMerge.sql diff --git a/db/changes/224903/00-ticket_canbePostponed.sql b/db/.archive/224903/00-ticket_canbePostponed.sql similarity index 100% rename from db/changes/224903/00-ticket_canbePostponed.sql rename to db/.archive/224903/00-ticket_canbePostponed.sql diff --git a/db/changes/224903/00-timeBusiness_calculate.sql b/db/.archive/224903/00-timeBusiness_calculate.sql similarity index 100% rename from db/changes/224903/00-timeBusiness_calculate.sql rename to db/.archive/224903/00-timeBusiness_calculate.sql diff --git a/db/changes/224903/01-updateClientHasInvoiceElectronic.sql b/db/.archive/224903/01-updateClientHasInvoiceElectronic.sql similarity index 100% rename from db/changes/224903/01-updateClientHasInvoiceElectronic.sql rename to db/.archive/224903/01-updateClientHasInvoiceElectronic.sql diff --git a/db/changes/225001/00-aclMdbApp.sql b/db/.archive/225001/00-aclMdbApp.sql similarity index 100% rename from db/changes/225001/00-aclMdbApp.sql rename to db/.archive/225001/00-aclMdbApp.sql diff --git a/db/changes/225001/00-updateCollection.sql b/db/.archive/225001/00-updateCollection.sql similarity index 100% rename from db/changes/225001/00-updateCollection.sql rename to db/.archive/225001/00-updateCollection.sql diff --git a/db/changes/225201/00-ACL_saveSign.sql b/db/.archive/225201/00-ACL_saveSign.sql similarity index 100% rename from db/changes/225201/00-ACL_saveSign.sql rename to db/.archive/225201/00-ACL_saveSign.sql diff --git a/db/changes/225201/00-accountingMovements_add.sql b/db/.archive/225201/00-accountingMovements_add.sql similarity index 100% rename from db/changes/225201/00-accountingMovements_add.sql rename to db/.archive/225201/00-accountingMovements_add.sql diff --git a/db/changes/225201/00-aclTicketLog.sql b/db/.archive/225201/00-aclTicketLog.sql similarity index 100% rename from db/changes/225201/00-aclTicketLog.sql rename to db/.archive/225201/00-aclTicketLog.sql diff --git a/db/changes/225201/00-entryDeleteRef.sql b/db/.archive/225201/00-entryDeleteRef.sql similarity index 100% rename from db/changes/225201/00-entryDeleteRef.sql rename to db/.archive/225201/00-entryDeleteRef.sql diff --git a/db/changes/225201/00-invoiceInConfig.sql b/db/.archive/225201/00-invoiceInConfig.sql similarity index 100% rename from db/changes/225201/00-invoiceInConfig.sql rename to db/.archive/225201/00-invoiceInConfig.sql diff --git a/db/changes/225201/00-invoiceOut_new.sql b/db/.archive/225201/00-invoiceOut_new.sql similarity index 100% rename from db/changes/225201/00-invoiceOut_new.sql rename to db/.archive/225201/00-invoiceOut_new.sql diff --git a/db/changes/225201/00-mdbApp.sql b/db/.archive/225201/00-mdbApp.sql similarity index 100% rename from db/changes/225201/00-mdbApp.sql rename to db/.archive/225201/00-mdbApp.sql diff --git a/db/changes/225201/00-notification_send.sql b/db/.archive/225201/00-notification_send.sql similarity index 100% rename from db/changes/225201/00-notification_send.sql rename to db/.archive/225201/00-notification_send.sql diff --git a/db/changes/225201/00-supplier_beforeUpdate.sql b/db/.archive/225201/00-supplier_beforeUpdate.sql similarity index 100% rename from db/changes/225201/00-supplier_beforeUpdate.sql rename to db/.archive/225201/00-supplier_beforeUpdate.sql diff --git a/db/changes/225201/00-ticketSms.sql b/db/.archive/225201/00-ticketSms.sql similarity index 100% rename from db/changes/225201/00-ticketSms.sql rename to db/.archive/225201/00-ticketSms.sql diff --git a/db/changes/225201/00-ticket_canAdvance.sql b/db/.archive/225201/00-ticket_canAdvance.sql similarity index 100% rename from db/changes/225201/00-ticket_canAdvance.sql rename to db/.archive/225201/00-ticket_canAdvance.sql diff --git a/db/changes/225201/00-ticket_canbePostponed.sql b/db/.archive/225201/00-ticket_canbePostponed.sql similarity index 100% rename from db/changes/225201/00-ticket_canbePostponed.sql rename to db/.archive/225201/00-ticket_canbePostponed.sql diff --git a/db/changes/225201/00-ticket_split_merge.sql b/db/.archive/225201/00-ticket_split_merge.sql similarity index 100% rename from db/changes/225201/00-ticket_split_merge.sql rename to db/.archive/225201/00-ticket_split_merge.sql diff --git a/db/changes/225201/00-utilNotification.sql b/db/.archive/225201/00-utilNotification.sql similarity index 100% rename from db/changes/225201/00-utilNotification.sql rename to db/.archive/225201/00-utilNotification.sql diff --git a/db/changes/225201/01-create_stateI18n.sql b/db/.archive/225201/01-create_stateI18n.sql similarity index 100% rename from db/changes/225201/01-create_stateI18n.sql rename to db/.archive/225201/01-create_stateI18n.sql diff --git a/db/changes/225201/01-modules.sql b/db/.archive/225201/01-modules.sql similarity index 100% rename from db/changes/225201/01-modules.sql rename to db/.archive/225201/01-modules.sql diff --git a/db/changes/225201/02-insert_stateI18n.sql b/db/.archive/225201/02-insert_stateI18n.sql similarity index 100% rename from db/changes/225201/02-insert_stateI18n.sql rename to db/.archive/225201/02-insert_stateI18n.sql diff --git a/db/changes/225201/02-starredModule.sql b/db/.archive/225201/02-starredModule.sql similarity index 100% rename from db/changes/225201/02-starredModule.sql rename to db/.archive/225201/02-starredModule.sql diff --git a/db/changes/225202/00-mdbApp.sql b/db/.archive/225202/00-mdbApp.sql similarity index 100% rename from db/changes/225202/00-mdbApp.sql rename to db/.archive/225202/00-mdbApp.sql diff --git a/db/changes/225203/00-mdbApp.sql b/db/.archive/225203/00-mdbApp.sql similarity index 100% rename from db/changes/225203/00-mdbApp.sql rename to db/.archive/225203/00-mdbApp.sql diff --git a/db/changes/230201/00-ACL_ItemShelvingSale.sql b/db/.archive/230201/00-ACL_ItemShelvingSale.sql similarity index 100% rename from db/changes/230201/00-ACL_ItemShelvingSale.sql rename to db/.archive/230201/00-ACL_ItemShelvingSale.sql diff --git a/db/changes/230201/00-SupplierUniqueKey.sql b/db/.archive/230201/00-SupplierUniqueKey.sql similarity index 100% rename from db/changes/230201/00-SupplierUniqueKey.sql rename to db/.archive/230201/00-SupplierUniqueKey.sql diff --git a/db/changes/230201/00-autoincrement_VnReport_VnPrinter.sql b/db/.archive/230201/00-autoincrement_VnReport_VnPrinter.sql similarity index 100% rename from db/changes/230201/00-autoincrement_VnReport_VnPrinter.sql rename to db/.archive/230201/00-autoincrement_VnReport_VnPrinter.sql diff --git a/db/changes/230201/00-borradoLogicoIPT.sql b/db/.archive/230201/00-borradoLogicoIPT.sql similarity index 100% rename from db/changes/230201/00-borradoLogicoIPT.sql rename to db/.archive/230201/00-borradoLogicoIPT.sql diff --git a/db/changes/230201/00-docuwareStore.sql b/db/.archive/230201/00-docuwareStore.sql similarity index 100% rename from db/changes/230201/00-docuwareStore.sql rename to db/.archive/230201/00-docuwareStore.sql diff --git a/db/changes/230201/00-kkearSaleChecked.sql b/db/.archive/230201/00-kkearSaleChecked.sql similarity index 100% rename from db/changes/230201/00-kkearSaleChecked.sql rename to db/.archive/230201/00-kkearSaleChecked.sql diff --git a/db/changes/230201/00-priceFixed_getRate2.sql b/db/.archive/230201/00-priceFixed_getRate2.sql similarity index 100% rename from db/changes/230201/00-priceFixed_getRate2.sql rename to db/.archive/230201/00-priceFixed_getRate2.sql diff --git a/db/changes/230201/00-triggersXDiario.sql b/db/.archive/230201/00-triggersXDiario.sql similarity index 100% rename from db/changes/230201/00-triggersXDiario.sql rename to db/.archive/230201/00-triggersXDiario.sql diff --git a/db/changes/230201/00-validPriorities_ItemConfig.sql b/db/.archive/230201/00-validPriorities_ItemConfig.sql similarity index 100% rename from db/changes/230201/00-validPriorities_ItemConfig.sql rename to db/.archive/230201/00-validPriorities_ItemConfig.sql diff --git a/db/changes/230201/00-workerTimeControlConfig.sql b/db/.archive/230201/00-workerTimeControlConfig.sql similarity index 100% rename from db/changes/230201/00-workerTimeControlConfig.sql rename to db/.archive/230201/00-workerTimeControlConfig.sql diff --git a/db/dump/dumpedFixtures.sql b/db/dump/dumpedFixtures.sql index 77dd8c1f7..39388e140 100644 --- a/db/dump/dumpedFixtures.sql +++ b/db/dump/dumpedFixtures.sql @@ -1,10 +1,10 @@ USE `util`; --- MariaDB dump 10.19 Distrib 10.9.4-MariaDB, for Linux (x86_64) +-- MariaDB dump 10.19 Distrib 10.5.18-MariaDB, for debian-linux-gnu (x86_64) -- --- Host: db.verdnatura.es Database: util +-- Host: db-proxy.verdnatura.es Database: util -- ------------------------------------------------------ --- Server version 10.7.6-MariaDB-1:10.7.6+maria~deb11-log +-- Server version 10.7.7-MariaDB-1:10.7.7+maria~deb11-log /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -22,7 +22,7 @@ USE `util`; LOCK TABLES `config` WRITE; /*!40000 ALTER TABLE `config` DISABLE KEYS */; -INSERT INTO `config` VALUES (1,'224602',0,'production',NULL); +INSERT INTO `config` VALUES (1,'230404',0,'production',NULL); /*!40000 ALTER TABLE `config` ENABLE KEYS */; UNLOCK TABLES; @@ -32,9 +32,7 @@ UNLOCK TABLES; LOCK TABLES `version` WRITE; /*!40000 ALTER TABLE `version` DISABLE KEYS */; -INSERT INTO `version` VALUES -('salix','10230','53f69ae8e526a4a5d827c237a5b076d38507b392','2020-11-09 11:06:43',NULL), -('vn-database','10396','79ff2f97f529169a98ae52193298df320158ca11','2022-11-17 15:36:38','10399'); +INSERT INTO `version` VALUES ('salix','10230','53f69ae8e526a4a5d827c237a5b076d38507b392','2020-11-09 11:06:43',NULL),('vn-database','10481','0b4092f49d8b8b4f50623246cbbcad53ed0eb057','2023-02-20 08:46:42','10481'); /*!40000 ALTER TABLE `version` ENABLE KEYS */; UNLOCK TABLES; @@ -44,257 +42,7 @@ UNLOCK TABLES; LOCK TABLES `versionLog` WRITE; /*!40000 ALTER TABLE `versionLog` DISABLE KEYS */; -INSERT INTO `versionLog` VALUES -('vn-database','00001','00-test.sql','juan@10.5.1.3','2022-01-31 10:12:26',NULL,NULL), -('vn-database','00003','00-sage.sql','juan@10.5.1.3','2022-01-31 10:12:26',NULL,NULL), -('vn-database','10008','00-alterRoleConfig.sql','juan@10.5.1.3','2022-01-31 10:12:26',NULL,NULL), -('vn-database','10014','00-rolePrefix.sql','jenkins@10.0.2.68','2022-02-11 00:13:25',NULL,NULL), -('vn-database','10017','01-firstScript.sql','jenkins@10.0.2.70','2022-03-09 11:36:54',NULL,NULL), -('vn-database','10021','00-bankAccount.sql','jenkins@10.0.2.69','2022-03-16 14:11:22',NULL,NULL), -('vn-database','10023','00-firstScript.sql','jenkins@10.0.2.69','2022-03-16 15:05:29',NULL,NULL), -('vn-database','10026','00-invoiceInIntrastat.sql','jenkins@10.0.2.69','2022-03-21 15:10:53',NULL,NULL), -('vn-database','10027','00-Clientes_cedidos.sql','jenkins@10.0.2.69','2022-03-22 15:58:12',NULL,NULL), -('vn-database','10028','00-item_last_buy_.sql','jenkins@10.0.2.69','2022-03-22 15:58:12',NULL,NULL), -('vn-database','10029','00-bankToViewAccountingToTable.sql','jenkins@10.0.2.69','2022-03-22 15:58:12',NULL,NULL), -('vn-database','10030','00-KkejarNiche.sql','jenkins@10.0.2.69','2022-03-22 15:58:12',NULL,NULL), -('vn-database','10036','00-updateBuyConfig.sql','jenkins@10.0.2.69','2022-03-29 12:36:54',NULL,NULL), -('vn-database','10037','00-firstScript.sql','jenkins@10.0.2.69','2022-03-28 11:14:26',NULL,NULL), -('vn-database','10038','00-printServerQueue.sql','jenkins@10.0.2.69','2022-03-29 08:13:24',NULL,NULL), -('vn-database','10048','00-firstScript.sql','jenkins@10.0.2.69','2022-03-30 12:29:06',NULL,NULL), -('vn-database','10058','00-vehicleAddFields.sql','jenkins@10.0.2.69','2022-04-06 08:48:34',NULL,NULL), -('vn-database','10060','00-firstScript.sql','jenkins@10.0.2.69','2022-04-07 08:50:11',NULL,NULL), -('vn-database','10062','00-firstScript.sql','jenkins@10.0.2.69','2022-04-06 10:51:45',NULL,NULL), -('vn-database','10064','00-firstScript.sql','jenkins@10.0.2.69','2022-04-06 13:57:11',NULL,NULL), -('vn-database','10066','00-firstScript.sql','jenkins@10.0.2.69','2022-04-07 08:50:12',NULL,NULL), -('vn-database','10067','00-firstScript.sql','jenkins@10.0.2.69','2022-04-08 10:18:20',NULL,NULL), -('vn-database','10071','00-packingSiteLog.sql','jenkins@10.0.2.69','2022-04-08 09:37:30',NULL,NULL), -('vn-database','10072','00-firstScript.sql','jenkins@10.0.2.69','2022-04-08 11:01:46',NULL,NULL), -('vn-database','10073','00-firstScript.sql','jenkins@10.0.2.69','2022-04-08 13:40:56',NULL,NULL), -('vn-database','10074','00-firstScript.sql','jenkins@10.0.2.69','2022-04-10 13:15:05',NULL,NULL), -('vn-database','10077','00-firstScript.sql','jenkins@10.0.2.69','2022-04-12 08:07:15',NULL,NULL), -('vn-database','10078','00-firstScript.sql','jenkins@10.0.2.69','2022-04-13 07:44:21',NULL,NULL), -('vn-database','10079','00-firstScript.sql','jenkins@10.0.2.69','2022-04-12 12:01:37',NULL,NULL), -('vn-database','10086','00-firstScript.sql','jenkins@10.0.2.69','2022-04-13 08:58:34',NULL,NULL), -('vn-database','10087','00-firstScript.sql','jenkins@10.0.2.69','2022-04-13 09:39:49',NULL,NULL), -('vn-database','10088','00-firstScript.sql','jenkins@10.0.2.69','2022-04-13 15:05:12',NULL,NULL), -('vn-database','10089','00-firstScript.sql','jenkins@10.0.2.69','2022-04-18 14:12:52',NULL,NULL), -('vn-database','10090','00-firstScript.sql','jenkins@10.0.2.69','2022-04-18 14:34:46',NULL,NULL), -('vn-database','10092','00-firstScript.sql','jenkins@10.0.2.69','2022-04-19 14:45:46',NULL,NULL), -('vn-database','10093','00-autoradioConfig.sql','jenkins@10.0.2.69','2022-05-03 09:16:47',NULL,NULL), -('vn-database','10094','00-firstScript.sql','jenkins@10.0.2.69','2022-04-20 10:57:30',NULL,NULL), -('vn-database','10097','00-firstScript.sql','jenkins@10.0.2.69','2022-05-05 10:12:59',NULL,NULL), -('vn-database','10099','00-firstScript.sql','jenkins@10.0.2.69','2022-04-20 14:35:27',NULL,NULL), -('vn-database','10100','00-firstScript.sql','jenkins@10.0.2.69','2022-04-20 14:35:27',NULL,NULL), -('vn-database','10101','00-firstScript.sql','jenkins@10.0.2.69','2022-04-21 14:59:31',NULL,NULL), -('vn-database','10103','00-awbVolume.sql','jenkins@10.0.2.69','2022-05-05 10:12:59',NULL,NULL), -('vn-database','10104','00-firstScript.sql','jenkins@10.0.2.69','2022-05-05 10:12:59',NULL,NULL), -('vn-database','10105','00-firstScript.sql','jenkins@10.0.2.69','2022-05-05 10:13:00',NULL,NULL), -('vn-database','10107','00-firstScript.sql','jenkins@10.0.2.69','2022-04-23 10:53:53',NULL,NULL), -('vn-database','10112','00-firstScript.sql','jenkins@10.0.2.69','2022-05-09 09:14:53',NULL,NULL), -('vn-database','10113','00-firstScript.sql','jenkins@10.0.2.69','2022-05-05 10:13:00',NULL,NULL), -('vn-database','10114','00-updateConfig.sql','jenkins@10.0.2.69','2022-04-27 13:37:25',NULL,NULL), -('vn-database','10116','00-firstScript.sql','jenkins@10.0.2.69','2022-04-28 11:10:14',NULL,NULL), -('vn-database','10118','00-firstScript.sql','jenkins@10.0.2.69','2022-04-29 08:10:15',NULL,NULL), -('vn-database','10119','00-AfegirFKPart1.sql','jenkins@10.0.2.69','2022-05-05 10:13:00',NULL,NULL), -('vn-database','10119','01-AfegirFkPart2.sql','jenkins@10.0.2.69','2022-05-05 10:22:25',NULL,NULL), -('vn-database','10125','00-firstScript.sql','jenkins@10.0.2.68','2022-05-18 18:44:30',NULL,NULL), -('vn-database','10127','00-firstScript.sql','jenkins@10.0.2.69','2022-05-02 11:04:46',NULL,NULL), -('vn-database','10128','00-firstScript.sql','jenkins@10.0.2.69','2022-05-02 13:04:31',NULL,NULL), -('vn-database','10129','00-firstScript.sql','jenkins@10.0.2.69','2022-05-03 08:21:01',NULL,NULL), -('vn-database','10132','00-firstScript.sql','jenkins@10.0.2.69','2022-05-05 10:22:25',NULL,NULL), -('vn-database','10133','00-firstScript.sql','jenkins@10.0.2.69','2022-05-05 14:32:30',NULL,NULL), -('vn-database','10134','00-firstScript.sql','jenkins@10.0.2.69','2022-05-06 07:45:25',NULL,NULL), -('vn-database','10135','00-firstScript.sql','jenkins@10.0.2.69','2022-06-17 08:46:17',NULL,NULL), -('vn-database','10136','00-workerTimeControl.sql','jenkins@10.0.2.69','2022-05-09 13:51:12',NULL,NULL), -('vn-database','10138','00-firstScript.sql','jenkins@10.0.2.69','2022-05-10 13:58:05',NULL,NULL), -('vn-database','10139','00-firstScript.sql','jenkins@10.0.2.68','2022-05-16 14:32:37',NULL,NULL), -('vn-database','10139','01-secondScript.sql','jenkins@10.0.2.68','2022-05-17 12:16:13',NULL,NULL), -('vn-database','10141','00-firstScript.sql','jenkins@10.0.2.70','2022-05-12 08:27:31',NULL,NULL), -('vn-database','10142','00-firstScript.sql','jenkins@10.0.2.68','2022-05-20 09:20:31',NULL,NULL), -('vn-database','10143','00-firstScript.sql','jenkins@10.0.2.68','2022-05-20 09:20:31',NULL,NULL), -('vn-database','10144','00-AfegirFKPArt1.sql','jenkins@10.0.2.68','2022-05-20 09:22:33',NULL,NULL), -('vn-database','10144','00-firstScript.sql','jenkins@10.0.2.68','2022-05-13 09:44:25',NULL,NULL), -('vn-database','10147','00-firstScript.sql','jenkins@10.0.2.68','2022-05-20 09:22:33',NULL,NULL), -('vn-database','10149','00-firstScript.sql','jenkins@10.0.2.68','2022-05-20 09:22:33',NULL,NULL), -('vn-database','10150','00-firstScript.sql','jenkins@10.0.2.68','2022-05-17 09:57:16',NULL,NULL), -('vn-database','10152','00-firstScript.sql','jenkins@10.0.2.68','2022-05-20 09:22:34',NULL,NULL), -('vn-database','10153','00-firstScript.sql','jenkins@10.0.2.68','2022-05-20 09:22:34',NULL,NULL), -('vn-database','10154','00-compressionKk.sql','jenkins@10.0.2.68','2022-05-20 09:22:34',NULL,NULL), -('vn-database','10157','00-firstScript.sql','jenkins@10.0.2.68','2022-05-20 09:22:35',NULL,NULL), -('vn-database','10158','00-firstScript.sql','jenkins@10.0.2.68','2022-06-02 12:47:21',NULL,NULL), -('vn-database','10160','00-firstScript.sql','jenkins@10.0.2.69','2022-06-30 09:30:50',NULL,NULL), -('vn-database','10163','00-firstScript.sql','jenkins@10.0.2.68','2022-05-23 08:17:14',NULL,NULL), -('vn-database','10164','00-borrarSectorsDesus.sql','jenkins@10.0.2.68','2022-06-02 12:47:21',NULL,NULL), -('vn-database','10165','00-firstScript.sql','jenkins@10.0.2.68','2022-06-02 12:47:22',NULL,NULL), -('vn-database','10166','00-firstScript.sql','jenkins@10.0.2.68','2022-05-24 16:11:21',NULL,NULL), -('vn-database','10167','00-renameVnActiveContrat.sql','jenkins@10.0.2.68','2022-06-02 12:47:22',NULL,NULL), -('vn-database','10168','00-firstScript.sql','jenkins@10.0.2.68','2022-06-02 12:47:22',NULL,NULL), -('vn-database','10169','00-createTableBankEntityConfig.sql','jenkins@10.0.2.68','2022-06-02 12:47:22',NULL,NULL), -('vn-database','10169','02-addNotNullToBankEntityBic.sql','jenkins@10.0.2.68','2022-06-02 12:47:22',NULL,NULL), -('vn-database','10171','00-volumeConfig.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-08-18 14:11:11',NULL,NULL), -('vn-database','10171','01-itemWeight.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-08-18 16:01:34',NULL,NULL), -('vn-database','10171','02-agencymode.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-08-18 16:01:34',NULL,NULL), -('vn-database','10172','00-firstScript.sql','jenkins@10.0.2.68','2022-06-02 12:47:22',NULL,NULL), -('vn-database','10174','00-firstScript.sql','jenkins@10.0.2.69','2022-06-17 08:46:17',NULL,NULL), -('vn-database','10175','00-firstScript.sql','jenkins@10.0.2.69','2022-06-17 09:03:41',NULL,NULL), -('vn-database','10177','00-crearTablaSpecialLabels.sql','jenkins@10.0.2.68','2022-06-02 12:47:22',NULL,NULL), -('vn-database','10178','00-firstScript.sql','jenkins@10.0.2.68','2022-06-02 12:47:24',NULL,NULL), -('vn-database','10179','00-firstScript.sql','jenkins@10.0.2.68','2022-06-02 12:47:24',NULL,NULL), -('vn-database','10183','00-firstScript.sql','jenkins@10.0.2.68','2022-06-02 12:47:24',NULL,NULL), -('vn-database','10184','00-firstScript.sql','jenkins@10.0.2.68','2022-06-03 08:05:34',NULL,NULL), -('vn-database','10185','00-firstScript.sql','jenkins@10.0.2.68','2022-06-06 09:07:45',NULL,NULL), -('vn-database','10186','00-desactivar_trigger.sql','jenkins@10.0.2.68','2022-06-07 09:31:23',NULL,NULL), -('vn-database','10186','01-alter_Table_buy.sql','jenkins@10.0.2.68','2022-06-07 09:34:47',NULL,NULL), -('vn-database','10186','02-alter_table_entryConfig.sql','jenkins@10.0.2.68','2022-06-07 09:34:47',NULL,NULL), -('vn-database','10186','04-regularizar_Sticker_Inventario.sql','jenkins@10.0.2.68','2022-06-07 09:34:51',NULL,NULL), -('vn-database','10186','09-reactivar_trigger.sql','jenkins@10.0.2.68','2022-06-07 09:34:51',NULL,NULL), -('vn-database','10187','00-firstScript.sql','jenkins@10.0.2.68','2022-06-06 12:37:31',NULL,NULL), -('vn-database','10188','00-firstScript.sql','jenkins@10.0.2.68','2022-06-06 14:03:36',NULL,NULL), -('vn-database','10189','00-firstScript.sql','jenkins@10.0.2.69','2022-06-17 09:03:41',NULL,NULL), -('vn-database','10191','00-firstScript.sql','jenkins@10.0.2.69','2022-06-17 09:03:41',NULL,NULL), -('vn-database','10194','00-firstScript.sql','jenkins@10.0.2.69','2022-06-17 09:03:41',NULL,NULL), -('vn-database','10195','00-firstScript.sql','jenkins@10.0.2.69','2022-06-17 09:03:41',NULL,NULL), -('vn-database','10200','00-firstScript.sql','jenkins@10.0.2.69','2022-06-17 09:04:00',NULL,NULL), -('vn-database','10201','00-firstScript.sql','jenkins@10.0.2.69','2022-06-17 09:04:00',NULL,NULL), -('vn-database','10202','00-Remove_FK_to_ediGenus.sql','jenkins@10.0.2.69','2022-06-17 09:04:00',NULL,NULL), -('vn-database','10203','00-firstScript.sql','jenkins@10.0.2.69','2022-06-17 09:04:01',NULL,NULL), -('vn-database','10204','00-firstScript.sql','jenkins@10.0.2.69','2022-06-17 09:04:01',NULL,NULL), -('vn-database','10205','00-firstScript.sql','jenkins@10.0.2.69','2022-06-17 09:04:21',NULL,NULL), -('vn-database','10207','00-Alter_table_entry.sql','jenkins@10.0.2.69','2022-06-16 07:22:50',NULL,NULL), -('vn-database','10207','01-Update_invoiceAmount.sql','jenkins@10.0.2.69','2022-06-16 07:23:00',NULL,NULL), -('vn-database','10208','00-firstScript.sql','jenkins@10.0.2.69','2022-06-30 09:31:26',NULL,NULL), -('vn-database','10209','00-firstScript.sql','jenkins@10.0.2.69','2022-06-16 08:47:40',NULL,NULL), -('vn-database','10210','00-firstScript.sql','jenkins@10.0.2.69','2022-06-16 17:39:17',1046,'Base de datos no seleccionada'), -('vn-database','10211','01-firstScript.sql','jenkins@10.0.2.69','2022-06-17 07:11:27',NULL,NULL), -('vn-database','10215','00-renameIsInventory.sql','jenkins@10.0.2.69','2022-06-30 09:31:26',NULL,NULL), -('vn-database','10216','00-firstScript.sql','jenkins@10.0.2.69','2022-06-23 11:15:28',NULL,NULL), -('vn-database','10216','01-batchIndex.sql','jenkins@10.0.2.70','2022-06-27 18:10:55',NULL,NULL), -('vn-database','10219','00-AddCollectionFkOnPackingSite.sql','jenkins@10.0.2.70','2022-06-29 09:23:42',NULL,NULL), -('vn-database','10219','01-AddFkToCollectionFk.sql','jenkins@10.0.2.70','2022-06-29 09:23:43',NULL,NULL), -('vn-database','10220','00-createPersonalProtectionEquipment.sql','jenkins@10.0.2.69','2022-06-30 09:31:26',NULL,NULL), -('vn-database','10222','00-firstScript.sql','jenkins@10.0.2.69','2022-07-14 09:12:40',NULL,NULL), -('vn-database','10223','00-firstScript.sql','jenkins@10.0.2.69','2022-07-14 09:13:52',NULL,NULL), -('vn-database','10224','00-cosetes.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-07-21 12:03:45',NULL,NULL), -('vn-database','10229','00-firstScript.sql','jenkins@10.0.2.69','2022-07-01 11:59:34',NULL,NULL), -('vn-database','10231','01-tablaEktConfig.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-08-11 09:25:39',NULL,NULL), -('vn-database','10233','00-firstScript.sql','jenkins@10.0.2.69','2022-07-14 09:13:53',NULL,NULL), -('vn-database','10235','00-firstScript.sql','jenkins@10.0.2.69','2022-07-14 09:13:53',NULL,NULL), -('vn-database','10236','00-firstScript.sql','jenkins@10.0.2.69','2022-07-05 12:11:40',NULL,NULL), -('vn-database','10237','00-firstScript.sql','jenkins@10.0.2.69','2022-07-14 09:13:53',NULL,NULL), -('vn-database','10238','00-worker_mobileExtension.sql','jenkins@10.0.2.69','2022-07-14 09:14:09',NULL,NULL), -('vn-database','10239','00-firstScript.sql','jenkins@10.0.2.69','2022-07-07 21:51:58',NULL,NULL), -('vn-database','10241','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-07-29 08:14:01',NULL,NULL), -('vn-database','10242','00-firstScript.sql','jenkins@10.0.2.69','2022-07-14 09:14:32',NULL,NULL), -('vn-database','10243','00-firstScript.sql','jenkins@10.0.2.69','2022-07-14 09:14:32',NULL,NULL), -('vn-database','10245','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-07-28 08:34:51',NULL,NULL), -('vn-database','10247','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-07-28 08:34:51',NULL,NULL), -('vn-database','10248','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-07-20 17:27:51',NULL,NULL), -('vn-database','10250','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-07-28 08:36:40',NULL,NULL), -('vn-database','10253','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-07-28 08:36:57',NULL,NULL), -('vn-database','10254','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-07-28 08:38:48',NULL,NULL), -('vn-database','10256','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-07-28 08:38:48',NULL,NULL), -('vn-database','10259','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-08-02 08:54:56',NULL,NULL), -('vn-database','10261','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-07-22 08:42:20',NULL,NULL), -('vn-database','10262','00-createTablepackagingWithFreight.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-02 17:22:13',NULL,NULL), -('vn-database','10262','01-alterTablePackagingConfig.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-02 17:22:13',NULL,NULL), -('vn-database','10262','02-insertsInicials.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-02 17:22:13',NULL,NULL), -('vn-database','10262','03-createTablepackingWithoutFreight.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-02 17:22:14',NULL,NULL), -('vn-database','10263','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-07-28 08:38:48',NULL,NULL), -('vn-database','10265','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-07-28 08:38:48',NULL,NULL), -('vn-database','10267','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-08-11 09:34:17',NULL,NULL), -('vn-database','10267','01-fixMerge.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-08-11 09:34:17',NULL,NULL), -('vn-database','10275','00-improvedGeneralLog.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-08-01 09:55:56',NULL,NULL), -('vn-database','10277','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-08 10:26:32',NULL,NULL), -('vn-database','10278','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-08-01 17:51:41',NULL,NULL), -('vn-database','10279','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-08-11 09:34:17',NULL,NULL), -('vn-database','10281','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-08-11 09:34:18',NULL,NULL), -('vn-database','10282','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-08-11 09:34:18',NULL,NULL), -('vn-database','10283','00-alterTable.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-08-11 09:34:18',NULL,NULL), -('vn-database','10284','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-08-04 16:59:08',NULL,NULL), -('vn-database','10285','00-firstScript.sql','jenkins@swarm-worker3.static.verdnatura.es','2022-08-05 09:19:33',NULL,NULL), -('vn-database','10287','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-08-11 09:35:24',NULL,NULL), -('vn-database','10288','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-08-11 09:35:24',NULL,NULL), -('vn-database','10289','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-22 08:29:36',NULL,NULL), -('vn-database','10291','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-08-10 14:19:34',NULL,NULL), -('vn-database','10293','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-08 10:26:32',NULL,NULL), -('vn-database','10297','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-08-16 12:43:36',NULL,NULL), -('vn-database','10298','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-08-13 21:04:13',NULL,NULL), -('vn-database','10299','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-02 17:22:14',NULL,NULL), -('vn-database','10301','00-productionConfig.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-02 17:22:14',NULL,NULL), -('vn-database','10301','01-drop.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-02 17:22:14',NULL,NULL), -('vn-database','10301','02-collection.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-02 17:22:15',NULL,NULL), -('vn-database','10302','00-CreateTableEntryType.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-02 17:22:15',NULL,NULL), -('vn-database','10302','01-insertDataEntryType.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-02 17:22:15',NULL,NULL), -('vn-database','10302','02-alterTableEntry.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-02 17:22:22',NULL,NULL), -('vn-database','10303','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-02 17:22:23',NULL,NULL), -('vn-database','10304','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-02 17:23:48',NULL,NULL), -('vn-database','10304','01-altertableticket.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-02 17:23:51',NULL,NULL), -('vn-database','10305','00-ektAssign.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-02 17:24:52',NULL,NULL), -('vn-database','10306','00-deliveryInformation.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-02 17:25:25',NULL,NULL), -('vn-database','10307','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-02 17:25:26',NULL,NULL), -('vn-database','10308','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-02 17:26:43',NULL,NULL), -('vn-database','10309','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-06 11:37:54',NULL,NULL), -('vn-database','10310','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-08 10:26:33',NULL,NULL), -('vn-database','10311','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-06 11:37:55',NULL,NULL), -('vn-database','10312','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-08 10:26:33',NULL,NULL), -('vn-database','10313','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-08 10:27:21',NULL,NULL), -('vn-database','10314','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-20 12:37:19',NULL,NULL), -('vn-database','10315','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-08 10:31:43',NULL,NULL), -('vn-database','10317','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-08 10:31:43',NULL,NULL), -('vn-database','10318','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-08 10:31:43',NULL,NULL), -('vn-database','10319','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-20 12:37:41',NULL,NULL), -('vn-database','10320','00-operator.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-22 08:29:37',NULL,NULL), -('vn-database','10320','01-collection.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-22 08:29:37',NULL,NULL), -('vn-database','10320','02-productionConfig.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-22 08:29:38',NULL,NULL), -('vn-database','10321','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-08 11:11:12',NULL,NULL), -('vn-database','10322','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-09 09:19:05',NULL,NULL), -('vn-database','10326','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-22 08:29:38',NULL,NULL), -('vn-database','10328','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-22 08:29:38',NULL,NULL), -('vn-database','10329','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-22 08:29:38',NULL,NULL), -('vn-database','10330','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-22 08:34:30',NULL,NULL), -('vn-database','10332','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-22 08:34:30',NULL,NULL), -('vn-database','10334','00-collectionHotbed.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-22 08:34:30',NULL,NULL), -('vn-database','10334','01-saleGroupDetail.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-22 08:34:32',NULL,NULL), -('vn-database','10335','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-10-06 09:52:38',NULL,NULL), -('vn-database','10336','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-22 08:34:32',NULL,NULL), -('vn-database','10337','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-22 08:34:32',NULL,NULL), -('vn-database','10339','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-19 09:41:19',NULL,NULL), -('vn-database','10340','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-29 11:08:03',NULL,NULL), -('vn-database','10341','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-22 08:34:32',NULL,NULL), -('vn-database','10342','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-29 11:08:03',NULL,NULL), -('vn-database','10343','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-22 08:35:30',NULL,NULL), -('vn-database','10345','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-11-04 08:25:16',NULL,NULL), -('vn-database','10347','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-29 11:08:03',NULL,NULL), -('vn-database','10347','01-addVirtualField.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-29 11:08:03',NULL,NULL), -('vn-database','10349','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-10-06 09:52:38',NULL,NULL), -('vn-database','10350','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-30 10:11:56',NULL,NULL), -('vn-database','10352','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-11-04 08:25:16',NULL,NULL), -('vn-database','10353','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-10-06 09:52:38',NULL,NULL), -('vn-database','10354','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-10-06 09:52:38',NULL,NULL), -('vn-database','10356','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-11-10 22:35:00',NULL,NULL), -('vn-database','10356','01-orderConfigFk.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-11-10 22:35:00',NULL,NULL), -('vn-database','10356','02-orderConfigDrop.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-11-10 22:35:00',NULL,NULL), -('vn-database','10357','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-10-06 09:52:38',NULL,NULL), -('vn-database','10359','00-improvedGeneralLog_collate.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-10-06 09:52:39',NULL,NULL), -('vn-database','10360','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-10-06 09:52:39',NULL,NULL), -('vn-database','10361','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-10-06 11:16:07',NULL,NULL), -('vn-database','10362','00-dropUdfs.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-10-10 11:01:15',NULL,NULL), -('vn-database','10363','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-11-04 08:25:17',NULL,NULL), -('vn-database','10365','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-10-13 19:30:46',NULL,NULL), -('vn-database','10368','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-11-04 08:25:17',NULL,NULL), -('vn-database','10369','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-10-14 13:38:06',NULL,NULL), -('vn-database','10370','00-deleteForeignKey.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-11-17 14:32:41',NULL,NULL), -('vn-database','10370','01-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-11-17 14:32:47',NULL,NULL), -('vn-database','10370','02-deleteTable.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-11-17 14:32:49',NULL,NULL), -('vn-database','10370','03-accion.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-11-17 14:32:49',NULL,NULL), -('vn-database','10370','04-inter.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-11-17 14:32:53',NULL,NULL), -('vn-database','10373','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-10-19 08:31:58',NULL,NULL), -('vn-database','10378','00-rename_routeUserPercentage.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-11-04 08:25:17',NULL,NULL), -('vn-database','10383','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-11-17 14:32:53',NULL,NULL), -('vn-database','10385','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-11-17 14:32:54',NULL,NULL), -('vn-database','10386','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-11-17 14:32:54',NULL,NULL), -('vn-database','10387','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-11-16 14:05:33',NULL,NULL), -('vn-database','10396','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-11-17 15:36:38',NULL,NULL); +INSERT INTO `versionLog` VALUES ('vn-database','00001','00-test.sql','juan@10.5.1.3','2022-01-31 10:12:26',NULL,NULL),('vn-database','00003','00-sage.sql','juan@10.5.1.3','2022-01-31 10:12:26',NULL,NULL),('vn-database','10008','00-alterRoleConfig.sql','juan@10.5.1.3','2022-01-31 10:12:26',NULL,NULL),('vn-database','10014','00-rolePrefix.sql','jenkins@10.0.2.68','2022-02-11 00:13:25',NULL,NULL),('vn-database','10017','01-firstScript.sql','jenkins@10.0.2.70','2022-03-09 11:36:54',NULL,NULL),('vn-database','10021','00-bankAccount.sql','jenkins@10.0.2.69','2022-03-16 14:11:22',NULL,NULL),('vn-database','10023','00-firstScript.sql','jenkins@10.0.2.69','2022-03-16 15:05:29',NULL,NULL),('vn-database','10026','00-invoiceInIntrastat.sql','jenkins@10.0.2.69','2022-03-21 15:10:53',NULL,NULL),('vn-database','10027','00-Clientes_cedidos.sql','jenkins@10.0.2.69','2022-03-22 15:58:12',NULL,NULL),('vn-database','10028','00-item_last_buy_.sql','jenkins@10.0.2.69','2022-03-22 15:58:12',NULL,NULL),('vn-database','10029','00-bankToViewAccountingToTable.sql','jenkins@10.0.2.69','2022-03-22 15:58:12',NULL,NULL),('vn-database','10030','00-KkejarNiche.sql','jenkins@10.0.2.69','2022-03-22 15:58:12',NULL,NULL),('vn-database','10036','00-updateBuyConfig.sql','jenkins@10.0.2.69','2022-03-29 12:36:54',NULL,NULL),('vn-database','10037','00-firstScript.sql','jenkins@10.0.2.69','2022-03-28 11:14:26',NULL,NULL),('vn-database','10038','00-printServerQueue.sql','jenkins@10.0.2.69','2022-03-29 08:13:24',NULL,NULL),('vn-database','10048','00-firstScript.sql','jenkins@10.0.2.69','2022-03-30 12:29:06',NULL,NULL),('vn-database','10058','00-vehicleAddFields.sql','jenkins@10.0.2.69','2022-04-06 08:48:34',NULL,NULL),('vn-database','10060','00-firstScript.sql','jenkins@10.0.2.69','2022-04-07 08:50:11',NULL,NULL),('vn-database','10062','00-firstScript.sql','jenkins@10.0.2.69','2022-04-06 10:51:45',NULL,NULL),('vn-database','10064','00-firstScript.sql','jenkins@10.0.2.69','2022-04-06 13:57:11',NULL,NULL),('vn-database','10066','00-firstScript.sql','jenkins@10.0.2.69','2022-04-07 08:50:12',NULL,NULL),('vn-database','10067','00-firstScript.sql','jenkins@10.0.2.69','2022-04-08 10:18:20',NULL,NULL),('vn-database','10071','00-packingSiteLog.sql','jenkins@10.0.2.69','2022-04-08 09:37:30',NULL,NULL),('vn-database','10072','00-firstScript.sql','jenkins@10.0.2.69','2022-04-08 11:01:46',NULL,NULL),('vn-database','10073','00-firstScript.sql','jenkins@10.0.2.69','2022-04-08 13:40:56',NULL,NULL),('vn-database','10074','00-firstScript.sql','jenkins@10.0.2.69','2022-04-10 13:15:05',NULL,NULL),('vn-database','10077','00-firstScript.sql','jenkins@10.0.2.69','2022-04-12 08:07:15',NULL,NULL),('vn-database','10078','00-firstScript.sql','jenkins@10.0.2.69','2022-04-13 07:44:21',NULL,NULL),('vn-database','10079','00-firstScript.sql','jenkins@10.0.2.69','2022-04-12 12:01:37',NULL,NULL),('vn-database','10086','00-firstScript.sql','jenkins@10.0.2.69','2022-04-13 08:58:34',NULL,NULL),('vn-database','10087','00-firstScript.sql','jenkins@10.0.2.69','2022-04-13 09:39:49',NULL,NULL),('vn-database','10088','00-firstScript.sql','jenkins@10.0.2.69','2022-04-13 15:05:12',NULL,NULL),('vn-database','10089','00-firstScript.sql','jenkins@10.0.2.69','2022-04-18 14:12:52',NULL,NULL),('vn-database','10090','00-firstScript.sql','jenkins@10.0.2.69','2022-04-18 14:34:46',NULL,NULL),('vn-database','10092','00-firstScript.sql','jenkins@10.0.2.69','2022-04-19 14:45:46',NULL,NULL),('vn-database','10093','00-autoradioConfig.sql','jenkins@10.0.2.69','2022-05-03 09:16:47',NULL,NULL),('vn-database','10094','00-firstScript.sql','jenkins@10.0.2.69','2022-04-20 10:57:30',NULL,NULL),('vn-database','10097','00-firstScript.sql','jenkins@10.0.2.69','2022-05-05 10:12:59',NULL,NULL),('vn-database','10099','00-firstScript.sql','jenkins@10.0.2.69','2022-04-20 14:35:27',NULL,NULL),('vn-database','10100','00-firstScript.sql','jenkins@10.0.2.69','2022-04-20 14:35:27',NULL,NULL),('vn-database','10101','00-firstScript.sql','jenkins@10.0.2.69','2022-04-21 14:59:31',NULL,NULL),('vn-database','10103','00-awbVolume.sql','jenkins@10.0.2.69','2022-05-05 10:12:59',NULL,NULL),('vn-database','10104','00-firstScript.sql','jenkins@10.0.2.69','2022-05-05 10:12:59',NULL,NULL),('vn-database','10105','00-firstScript.sql','jenkins@10.0.2.69','2022-05-05 10:13:00',NULL,NULL),('vn-database','10107','00-firstScript.sql','jenkins@10.0.2.69','2022-04-23 10:53:53',NULL,NULL),('vn-database','10112','00-firstScript.sql','jenkins@10.0.2.69','2022-05-09 09:14:53',NULL,NULL),('vn-database','10113','00-firstScript.sql','jenkins@10.0.2.69','2022-05-05 10:13:00',NULL,NULL),('vn-database','10114','00-updateConfig.sql','jenkins@10.0.2.69','2022-04-27 13:37:25',NULL,NULL),('vn-database','10116','00-firstScript.sql','jenkins@10.0.2.69','2022-04-28 11:10:14',NULL,NULL),('vn-database','10118','00-firstScript.sql','jenkins@10.0.2.69','2022-04-29 08:10:15',NULL,NULL),('vn-database','10119','00-AfegirFKPart1.sql','jenkins@10.0.2.69','2022-05-05 10:13:00',NULL,NULL),('vn-database','10119','01-AfegirFkPart2.sql','jenkins@10.0.2.69','2022-05-05 10:22:25',NULL,NULL),('vn-database','10125','00-firstScript.sql','jenkins@10.0.2.68','2022-05-18 18:44:30',NULL,NULL),('vn-database','10127','00-firstScript.sql','jenkins@10.0.2.69','2022-05-02 11:04:46',NULL,NULL),('vn-database','10128','00-firstScript.sql','jenkins@10.0.2.69','2022-05-02 13:04:31',NULL,NULL),('vn-database','10129','00-firstScript.sql','jenkins@10.0.2.69','2022-05-03 08:21:01',NULL,NULL),('vn-database','10132','00-firstScript.sql','jenkins@10.0.2.69','2022-05-05 10:22:25',NULL,NULL),('vn-database','10133','00-firstScript.sql','jenkins@10.0.2.69','2022-05-05 14:32:30',NULL,NULL),('vn-database','10134','00-firstScript.sql','jenkins@10.0.2.69','2022-05-06 07:45:25',NULL,NULL),('vn-database','10135','00-firstScript.sql','jenkins@10.0.2.69','2022-06-17 08:46:17',NULL,NULL),('vn-database','10136','00-workerTimeControl.sql','jenkins@10.0.2.69','2022-05-09 13:51:12',NULL,NULL),('vn-database','10138','00-firstScript.sql','jenkins@10.0.2.69','2022-05-10 13:58:05',NULL,NULL),('vn-database','10139','00-firstScript.sql','jenkins@10.0.2.68','2022-05-16 14:32:37',NULL,NULL),('vn-database','10139','01-secondScript.sql','jenkins@10.0.2.68','2022-05-17 12:16:13',NULL,NULL),('vn-database','10141','00-firstScript.sql','jenkins@10.0.2.70','2022-05-12 08:27:31',NULL,NULL),('vn-database','10142','00-firstScript.sql','jenkins@10.0.2.68','2022-05-20 09:20:31',NULL,NULL),('vn-database','10143','00-firstScript.sql','jenkins@10.0.2.68','2022-05-20 09:20:31',NULL,NULL),('vn-database','10144','00-AfegirFKPArt1.sql','jenkins@10.0.2.68','2022-05-20 09:22:33',NULL,NULL),('vn-database','10144','00-firstScript.sql','jenkins@10.0.2.68','2022-05-13 09:44:25',NULL,NULL),('vn-database','10147','00-firstScript.sql','jenkins@10.0.2.68','2022-05-20 09:22:33',NULL,NULL),('vn-database','10149','00-firstScript.sql','jenkins@10.0.2.68','2022-05-20 09:22:33',NULL,NULL),('vn-database','10150','00-firstScript.sql','jenkins@10.0.2.68','2022-05-17 09:57:16',NULL,NULL),('vn-database','10152','00-firstScript.sql','jenkins@10.0.2.68','2022-05-20 09:22:34',NULL,NULL),('vn-database','10153','00-firstScript.sql','jenkins@10.0.2.68','2022-05-20 09:22:34',NULL,NULL),('vn-database','10154','00-compressionKk.sql','jenkins@10.0.2.68','2022-05-20 09:22:34',NULL,NULL),('vn-database','10157','00-firstScript.sql','jenkins@10.0.2.68','2022-05-20 09:22:35',NULL,NULL),('vn-database','10158','00-firstScript.sql','jenkins@10.0.2.68','2022-06-02 12:47:21',NULL,NULL),('vn-database','10160','00-firstScript.sql','jenkins@10.0.2.69','2022-06-30 09:30:50',NULL,NULL),('vn-database','10163','00-firstScript.sql','jenkins@10.0.2.68','2022-05-23 08:17:14',NULL,NULL),('vn-database','10164','00-borrarSectorsDesus.sql','jenkins@10.0.2.68','2022-06-02 12:47:21',NULL,NULL),('vn-database','10165','00-firstScript.sql','jenkins@10.0.2.68','2022-06-02 12:47:22',NULL,NULL),('vn-database','10166','00-firstScript.sql','jenkins@10.0.2.68','2022-05-24 16:11:21',NULL,NULL),('vn-database','10167','00-renameVnActiveContrat.sql','jenkins@10.0.2.68','2022-06-02 12:47:22',NULL,NULL),('vn-database','10168','00-firstScript.sql','jenkins@10.0.2.68','2022-06-02 12:47:22',NULL,NULL),('vn-database','10169','00-createTableBankEntityConfig.sql','jenkins@10.0.2.68','2022-06-02 12:47:22',NULL,NULL),('vn-database','10169','02-addNotNullToBankEntityBic.sql','jenkins@10.0.2.68','2022-06-02 12:47:22',NULL,NULL),('vn-database','10171','00-volumeConfig.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-08-18 14:11:11',NULL,NULL),('vn-database','10171','01-itemWeight.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-08-18 16:01:34',NULL,NULL),('vn-database','10171','02-agencymode.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-08-18 16:01:34',NULL,NULL),('vn-database','10172','00-firstScript.sql','jenkins@10.0.2.68','2022-06-02 12:47:22',NULL,NULL),('vn-database','10174','00-firstScript.sql','jenkins@10.0.2.69','2022-06-17 08:46:17',NULL,NULL),('vn-database','10175','00-firstScript.sql','jenkins@10.0.2.69','2022-06-17 09:03:41',NULL,NULL),('vn-database','10177','00-crearTablaSpecialLabels.sql','jenkins@10.0.2.68','2022-06-02 12:47:22',NULL,NULL),('vn-database','10178','00-firstScript.sql','jenkins@10.0.2.68','2022-06-02 12:47:24',NULL,NULL),('vn-database','10179','00-firstScript.sql','jenkins@10.0.2.68','2022-06-02 12:47:24',NULL,NULL),('vn-database','10183','00-firstScript.sql','jenkins@10.0.2.68','2022-06-02 12:47:24',NULL,NULL),('vn-database','10184','00-firstScript.sql','jenkins@10.0.2.68','2022-06-03 08:05:34',NULL,NULL),('vn-database','10185','00-firstScript.sql','jenkins@10.0.2.68','2022-06-06 09:07:45',NULL,NULL),('vn-database','10186','00-desactivar_trigger.sql','jenkins@10.0.2.68','2022-06-07 09:31:23',NULL,NULL),('vn-database','10186','01-alter_Table_buy.sql','jenkins@10.0.2.68','2022-06-07 09:34:47',NULL,NULL),('vn-database','10186','02-alter_table_entryConfig.sql','jenkins@10.0.2.68','2022-06-07 09:34:47',NULL,NULL),('vn-database','10186','04-regularizar_Sticker_Inventario.sql','jenkins@10.0.2.68','2022-06-07 09:34:51',NULL,NULL),('vn-database','10186','09-reactivar_trigger.sql','jenkins@10.0.2.68','2022-06-07 09:34:51',NULL,NULL),('vn-database','10187','00-firstScript.sql','jenkins@10.0.2.68','2022-06-06 12:37:31',NULL,NULL),('vn-database','10188','00-firstScript.sql','jenkins@10.0.2.68','2022-06-06 14:03:36',NULL,NULL),('vn-database','10189','00-firstScript.sql','jenkins@10.0.2.69','2022-06-17 09:03:41',NULL,NULL),('vn-database','10191','00-firstScript.sql','jenkins@10.0.2.69','2022-06-17 09:03:41',NULL,NULL),('vn-database','10194','00-firstScript.sql','jenkins@10.0.2.69','2022-06-17 09:03:41',NULL,NULL),('vn-database','10195','00-firstScript.sql','jenkins@10.0.2.69','2022-06-17 09:03:41',NULL,NULL),('vn-database','10200','00-firstScript.sql','jenkins@10.0.2.69','2022-06-17 09:04:00',NULL,NULL),('vn-database','10201','00-firstScript.sql','jenkins@10.0.2.69','2022-06-17 09:04:00',NULL,NULL),('vn-database','10202','00-Remove_FK_to_ediGenus.sql','jenkins@10.0.2.69','2022-06-17 09:04:00',NULL,NULL),('vn-database','10203','00-firstScript.sql','jenkins@10.0.2.69','2022-06-17 09:04:01',NULL,NULL),('vn-database','10204','00-firstScript.sql','jenkins@10.0.2.69','2022-06-17 09:04:01',NULL,NULL),('vn-database','10205','00-firstScript.sql','jenkins@10.0.2.69','2022-06-17 09:04:21',NULL,NULL),('vn-database','10207','00-Alter_table_entry.sql','jenkins@10.0.2.69','2022-06-16 07:22:50',NULL,NULL),('vn-database','10207','01-Update_invoiceAmount.sql','jenkins@10.0.2.69','2022-06-16 07:23:00',NULL,NULL),('vn-database','10208','00-firstScript.sql','jenkins@10.0.2.69','2022-06-30 09:31:26',NULL,NULL),('vn-database','10209','00-firstScript.sql','jenkins@10.0.2.69','2022-06-16 08:47:40',NULL,NULL),('vn-database','10210','00-firstScript.sql','jenkins@10.0.2.69','2022-06-16 17:39:17',1046,'Base de datos no seleccionada'),('vn-database','10211','01-firstScript.sql','jenkins@10.0.2.69','2022-06-17 07:11:27',NULL,NULL),('vn-database','10215','00-renameIsInventory.sql','jenkins@10.0.2.69','2022-06-30 09:31:26',NULL,NULL),('vn-database','10216','00-firstScript.sql','jenkins@10.0.2.69','2022-06-23 11:15:28',NULL,NULL),('vn-database','10216','01-batchIndex.sql','jenkins@10.0.2.70','2022-06-27 18:10:55',NULL,NULL),('vn-database','10219','00-AddCollectionFkOnPackingSite.sql','jenkins@10.0.2.70','2022-06-29 09:23:42',NULL,NULL),('vn-database','10219','01-AddFkToCollectionFk.sql','jenkins@10.0.2.70','2022-06-29 09:23:43',NULL,NULL),('vn-database','10220','00-createPersonalProtectionEquipment.sql','jenkins@10.0.2.69','2022-06-30 09:31:26',NULL,NULL),('vn-database','10222','00-firstScript.sql','jenkins@10.0.2.69','2022-07-14 09:12:40',NULL,NULL),('vn-database','10223','00-firstScript.sql','jenkins@10.0.2.69','2022-07-14 09:13:52',NULL,NULL),('vn-database','10224','00-cosetes.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-07-21 12:03:45',NULL,NULL),('vn-database','10229','00-firstScript.sql','jenkins@10.0.2.69','2022-07-01 11:59:34',NULL,NULL),('vn-database','10231','01-tablaEktConfig.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-08-11 09:25:39',NULL,NULL),('vn-database','10233','00-firstScript.sql','jenkins@10.0.2.69','2022-07-14 09:13:53',NULL,NULL),('vn-database','10235','00-firstScript.sql','jenkins@10.0.2.69','2022-07-14 09:13:53',NULL,NULL),('vn-database','10236','00-firstScript.sql','jenkins@10.0.2.69','2022-07-05 12:11:40',NULL,NULL),('vn-database','10237','00-firstScript.sql','jenkins@10.0.2.69','2022-07-14 09:13:53',NULL,NULL),('vn-database','10238','00-worker_mobileExtension.sql','jenkins@10.0.2.69','2022-07-14 09:14:09',NULL,NULL),('vn-database','10239','00-firstScript.sql','jenkins@10.0.2.69','2022-07-07 21:51:58',NULL,NULL),('vn-database','10241','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-07-29 08:14:01',NULL,NULL),('vn-database','10242','00-firstScript.sql','jenkins@10.0.2.69','2022-07-14 09:14:32',NULL,NULL),('vn-database','10243','00-firstScript.sql','jenkins@10.0.2.69','2022-07-14 09:14:32',NULL,NULL),('vn-database','10245','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-07-28 08:34:51',NULL,NULL),('vn-database','10247','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-07-28 08:34:51',NULL,NULL),('vn-database','10248','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-07-20 17:27:51',NULL,NULL),('vn-database','10250','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-07-28 08:36:40',NULL,NULL),('vn-database','10253','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-07-28 08:36:57',NULL,NULL),('vn-database','10254','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-07-28 08:38:48',NULL,NULL),('vn-database','10256','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-07-28 08:38:48',NULL,NULL),('vn-database','10258','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-12-16 09:14:48',NULL,NULL),('vn-database','10259','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-08-02 08:54:56',NULL,NULL),('vn-database','10261','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-07-22 08:42:20',NULL,NULL),('vn-database','10262','00-createTablepackagingWithFreight.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-02 17:22:13',NULL,NULL),('vn-database','10262','01-alterTablePackagingConfig.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-02 17:22:13',NULL,NULL),('vn-database','10262','02-insertsInicials.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-02 17:22:13',NULL,NULL),('vn-database','10262','03-createTablepackingWithoutFreight.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-02 17:22:14',NULL,NULL),('vn-database','10263','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-07-28 08:38:48',NULL,NULL),('vn-database','10265','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-07-28 08:38:48',NULL,NULL),('vn-database','10267','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-08-11 09:34:17',NULL,NULL),('vn-database','10267','01-fixMerge.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-08-11 09:34:17',NULL,NULL),('vn-database','10275','00-improvedGeneralLog.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-08-01 09:55:56',NULL,NULL),('vn-database','10277','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-08 10:26:32',NULL,NULL),('vn-database','10278','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-08-01 17:51:41',NULL,NULL),('vn-database','10279','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-08-11 09:34:17',NULL,NULL),('vn-database','10281','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-08-11 09:34:18',NULL,NULL),('vn-database','10282','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-08-11 09:34:18',NULL,NULL),('vn-database','10283','00-alterTable.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-08-11 09:34:18',NULL,NULL),('vn-database','10284','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-08-04 16:59:08',NULL,NULL),('vn-database','10285','00-firstScript.sql','jenkins@swarm-worker3.static.verdnatura.es','2022-08-05 09:19:33',NULL,NULL),('vn-database','10287','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-08-11 09:35:24',NULL,NULL),('vn-database','10288','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-08-11 09:35:24',NULL,NULL),('vn-database','10289','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-22 08:29:36',NULL,NULL),('vn-database','10291','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-08-10 14:19:34',NULL,NULL),('vn-database','10293','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-08 10:26:32',NULL,NULL),('vn-database','10297','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-08-16 12:43:36',NULL,NULL),('vn-database','10298','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-08-13 21:04:13',NULL,NULL),('vn-database','10299','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-02 17:22:14',NULL,NULL),('vn-database','10301','00-productionConfig.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-02 17:22:14',NULL,NULL),('vn-database','10301','01-drop.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-02 17:22:14',NULL,NULL),('vn-database','10301','02-collection.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-02 17:22:15',NULL,NULL),('vn-database','10302','00-CreateTableEntryType.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-02 17:22:15',NULL,NULL),('vn-database','10302','01-insertDataEntryType.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-02 17:22:15',NULL,NULL),('vn-database','10302','02-alterTableEntry.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-02 17:22:22',NULL,NULL),('vn-database','10303','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-02 17:22:23',NULL,NULL),('vn-database','10304','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-02 17:23:48',NULL,NULL),('vn-database','10304','01-altertableticket.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-02 17:23:51',NULL,NULL),('vn-database','10305','00-ektAssign.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-02 17:24:52',NULL,NULL),('vn-database','10306','00-deliveryInformation.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-02 17:25:25',NULL,NULL),('vn-database','10307','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-02 17:25:26',NULL,NULL),('vn-database','10308','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-02 17:26:43',NULL,NULL),('vn-database','10309','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-06 11:37:54',NULL,NULL),('vn-database','10310','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-08 10:26:33',NULL,NULL),('vn-database','10311','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-06 11:37:55',NULL,NULL),('vn-database','10312','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-08 10:26:33',NULL,NULL),('vn-database','10313','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-08 10:27:21',NULL,NULL),('vn-database','10314','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-20 12:37:19',NULL,NULL),('vn-database','10315','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-08 10:31:43',NULL,NULL),('vn-database','10317','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-08 10:31:43',NULL,NULL),('vn-database','10318','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-08 10:31:43',NULL,NULL),('vn-database','10319','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-20 12:37:41',NULL,NULL),('vn-database','10320','00-operator.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-22 08:29:37',NULL,NULL),('vn-database','10320','01-collection.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-22 08:29:37',NULL,NULL),('vn-database','10320','02-productionConfig.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-22 08:29:38',NULL,NULL),('vn-database','10321','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-08 11:11:12',NULL,NULL),('vn-database','10322','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-09 09:19:05',NULL,NULL),('vn-database','10326','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-22 08:29:38',NULL,NULL),('vn-database','10328','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-22 08:29:38',NULL,NULL),('vn-database','10329','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-22 08:29:38',NULL,NULL),('vn-database','10330','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-22 08:34:30',NULL,NULL),('vn-database','10332','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-22 08:34:30',NULL,NULL),('vn-database','10334','00-collectionHotbed.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-22 08:34:30',NULL,NULL),('vn-database','10334','01-saleGroupDetail.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-22 08:34:32',NULL,NULL),('vn-database','10335','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-10-06 09:52:38',NULL,NULL),('vn-database','10336','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-22 08:34:32',NULL,NULL),('vn-database','10337','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-22 08:34:32',NULL,NULL),('vn-database','10339','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-19 09:41:19',NULL,NULL),('vn-database','10340','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-29 11:08:03',NULL,NULL),('vn-database','10341','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-22 08:34:32',NULL,NULL),('vn-database','10342','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-29 11:08:03',NULL,NULL),('vn-database','10343','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-22 08:35:30',NULL,NULL),('vn-database','10345','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-11-04 08:25:16',NULL,NULL),('vn-database','10347','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-29 11:08:03',NULL,NULL),('vn-database','10347','01-addVirtualField.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-29 11:08:03',NULL,NULL),('vn-database','10349','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-10-06 09:52:38',NULL,NULL),('vn-database','10350','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-09-30 10:11:56',NULL,NULL),('vn-database','10352','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-11-04 08:25:16',NULL,NULL),('vn-database','10353','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-10-06 09:52:38',NULL,NULL),('vn-database','10354','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-10-06 09:52:38',NULL,NULL),('vn-database','10356','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-11-10 22:35:00',NULL,NULL),('vn-database','10356','01-orderConfigFk.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-11-10 22:35:00',NULL,NULL),('vn-database','10356','02-orderConfigDrop.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-11-10 22:35:00',NULL,NULL),('vn-database','10357','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-10-06 09:52:38',NULL,NULL),('vn-database','10359','00-improvedGeneralLog_collate.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-10-06 09:52:39',NULL,NULL),('vn-database','10360','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-10-06 09:52:39',NULL,NULL),('vn-database','10361','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-10-06 11:16:07',NULL,NULL),('vn-database','10362','00-dropUdfs.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-10-10 11:01:15',NULL,NULL),('vn-database','10363','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-11-04 08:25:17',NULL,NULL),('vn-database','10365','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-10-13 19:30:46',NULL,NULL),('vn-database','10368','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-11-04 08:25:17',NULL,NULL),('vn-database','10369','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-10-14 13:38:06',NULL,NULL),('vn-database','10370','00-deleteForeignKey.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-11-17 14:32:41',NULL,NULL),('vn-database','10370','01-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-11-17 14:32:47',NULL,NULL),('vn-database','10370','02-deleteTable.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-11-17 14:32:49',NULL,NULL),('vn-database','10370','03-accion.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-11-17 14:32:49',NULL,NULL),('vn-database','10370','04-inter.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-11-17 14:32:53',NULL,NULL),('vn-database','10371','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-01-12 10:56:23',NULL,NULL),('vn-database','10372','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-12-16 09:14:48',NULL,NULL),('vn-database','10373','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-10-19 08:31:58',NULL,NULL),('vn-database','10378','00-rename_routeUserPercentage.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-11-04 08:25:17',NULL,NULL),('vn-database','10382','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-12-01 08:47:20',NULL,NULL),('vn-database','10383','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-11-17 14:32:53',NULL,NULL),('vn-database','10385','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-11-17 14:32:54',NULL,NULL),('vn-database','10386','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-11-17 14:32:54',NULL,NULL),('vn-database','10387','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-11-16 14:05:33',NULL,NULL),('vn-database','10388','00-resizeUtilVerionLogCode.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-12-01 08:47:20',NULL,NULL),('vn-database','10388','01-resizeUtilVersionCode.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-12-01 08:47:20',NULL,NULL),('vn-database','10390','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-12-01 08:50:16',NULL,NULL),('vn-database','10391','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-01-12 10:56:23',NULL,NULL),('vn-database','10394','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-12-01 08:50:24',NULL,NULL),('vn-database','10395','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-12-01 08:50:29',NULL,NULL),('vn-database','10396','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-11-17 15:36:38',NULL,NULL),('vn-database','10397','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-12-01 08:50:29',NULL,NULL),('vn-database','10399','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-12-01 08:50:29',NULL,NULL),('vn-database','10400','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-12-01 08:50:29',NULL,NULL),('vn-database','10402','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-11-21 14:11:31',NULL,NULL),('vn-database','10404','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-12-01 08:50:29',NULL,NULL),('vn-database','10405','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-02-16 09:58:22',NULL,NULL),('vn-database','10407','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-12-16 09:14:49',NULL,NULL),('vn-database','10408','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-01-12 10:56:23',NULL,NULL),('vn-database','10409','00-firstScript.sql','jenkins@swarm-worker2.static.verdnatura.es','2022-12-16 09:14:49',NULL,NULL),('vn-database','10412','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2022-11-30 12:45:44',NULL,NULL),('vn-database','10413','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-01-12 10:56:24',NULL,NULL),('vn-database','10416','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-01-12 10:56:24',NULL,NULL),('vn-database','10420','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-01-12 10:56:25',NULL,NULL),('vn-database','10421','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-01-12 10:56:26',NULL,NULL),('vn-database','10428','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-01-26 13:27:05',NULL,NULL),('vn-database','10433','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-01-26 13:27:05',NULL,NULL),('vn-database','10434','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-01-26 13:27:05',NULL,NULL),('vn-database','10435','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-01-13 07:30:10',NULL,NULL),('vn-database','10436','00-createFkWorker.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-02-16 09:58:59',NULL,NULL),('vn-database','10436','01-addStateToWorkerProductivity.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-02-16 09:59:00',NULL,NULL),('vn-database','10436','02-DeprecateVnSaleTrackingState.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-02-16 09:59:00',NULL,NULL),('vn-database','10436','03-DeprecateColumnVnSaleTrackingActionFk.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-02-16 09:59:01',NULL,NULL),('vn-database','10436','04-DropSchemaVnControl.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-02-16 09:59:01',NULL,NULL),('vn-database','10436','05-RemoveFkWorkerProductivity.sql','jenkins@db-proxy2.static.verdnatura.es','2023-02-17 14:51:19',NULL,NULL),('vn-database','10444','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-02-16 09:59:01',NULL,NULL),('vn-database','10445','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-02-16 09:59:31',NULL,NULL),('vn-database','10448','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-02-16 09:59:31',NULL,NULL),('vn-database','10450','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-01-27 08:28:04',NULL,NULL),('vn-database','10451','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-02-06 08:08:32',NULL,NULL),('vn-database','10452','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-01-31 12:30:04',NULL,NULL),('vn-database','10453','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-01-31 14:04:37',NULL,NULL),('vn-database','10454','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-01-31 12:30:04',NULL,NULL),('vn-database','10455','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-01-31 12:30:04',NULL,NULL),('vn-database','10456','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-01-31 12:00:30',NULL,NULL),('vn-database','10457','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-01-31 12:00:33',NULL,NULL),('vn-database','10460','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-02-16 09:59:31',NULL,NULL),('vn-database','10461','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-02-16 09:59:31',NULL,NULL),('vn-database','10463','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-02-03 12:59:26',NULL,NULL),('vn-database','10468','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-02-16 09:59:31',NULL,NULL),('vn-database','10469','00-firstScript.sql','jenkins@swarm-worker1.static.verdnatura.es','2023-02-16 09:59:31',NULL,NULL),('vn-database','10480','00-firstScript.sql','jenkins@db-proxy1.static.verdnatura.es','2023-02-17 15:09:26',NULL,NULL),('vn-database','10481','00-firstScript.sql','jenkins@db-proxy1.static.verdnatura.es','2023-02-17 16:37:22',NULL,NULL); /*!40000 ALTER TABLE `versionLog` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -306,13 +54,13 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2022-11-21 7:59:03 +-- Dump completed on 2023-02-20 14:45:51 USE `account`; --- MariaDB dump 10.19 Distrib 10.9.4-MariaDB, for Linux (x86_64) +-- MariaDB dump 10.19 Distrib 10.5.18-MariaDB, for debian-linux-gnu (x86_64) -- --- Host: db.verdnatura.es Database: account +-- Host: db-proxy.verdnatura.es Database: account -- ------------------------------------------------------ --- Server version 10.7.6-MariaDB-1:10.7.6+maria~deb11-log +-- Server version 10.7.7-MariaDB-1:10.7.7+maria~deb11-log /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -330,77 +78,7 @@ USE `account`; LOCK TABLES `role` WRITE; /*!40000 ALTER TABLE `role` DISABLE KEYS */; -INSERT INTO `role` VALUES -(1,'employee','Empleado básico',1,'2017-05-19 07:04:58','2017-11-29 10:06:31'), -(2,'customer','Privilegios básicos de un cliente',1,'2017-05-19 07:04:58','2017-05-19 07:04:58'), -(3,'agency','Consultar tablas de predicciones de bultos',1,'2017-05-19 07:04:58','2017-05-19 07:04:58'), -(5,'administrative','Tareas relacionadas con la contabilidad',1,'2017-05-19 07:04:58','2017-05-19 07:04:58'), -(6,'guest','Privilegios para usuarios sin cuenta',1,'2017-05-19 07:04:58','2017-05-19 07:04:58'), -(9,'developer','Desarrolladores del sistema',1,'2017-05-19 07:04:58','2017-05-19 07:04:58'), -(11,'account','Privilegios relacionados con el login',0,'2017-05-19 07:04:58','2017-09-20 17:06:35'), -(13,'teamBoss','Jefe de equipo/departamento',1,'2017-05-19 07:04:58','2021-06-30 13:29:30'), -(15,'logistic','Departamento de compras, responsables de la logistica',1,'2017-05-19 07:04:58','2018-02-12 10:50:10'), -(16,'logisticBoss','Jefe del departamento de logística',1,'2017-05-19 07:04:58','2017-05-19 07:04:58'), -(17,'adminBoss','Jefe del departamento de administración',1,'2017-05-19 07:04:58','2017-05-19 07:04:58'), -(18,'salesPerson','Departamento de ventas',1,'2017-05-19 07:04:58','2017-05-19 07:04:58'), -(19,'salesBoss','Jefe del departamento de ventas',1,'2017-05-19 07:04:58','2017-08-16 12:38:27'), -(20,'manager','Gerencia',1,'2017-06-01 14:57:02','2022-07-29 07:36:15'), -(21,'salesAssistant','Jefe auxiliar de ventas',1,'2017-08-16 12:40:52','2017-08-16 12:40:52'), -(22,'teamManager','Jefe de departamento con privilegios de auxiliar de venta.',1,'2017-09-07 09:08:12','2017-09-07 09:08:12'), -(30,'financialBoss','Director finaciero',1,'2017-09-21 11:05:36','2017-09-21 11:05:36'), -(31,'freelancer','Trabajadores por cuenta ajena',1,'2017-10-10 12:57:26','2017-10-10 12:59:27'), -(32,'ett','Trabajadores de empresa temporal',1,'2017-10-10 12:58:58','2017-10-10 12:59:20'), -(33,'invoicing','Personal con acceso a facturación',0,'2018-01-29 16:43:34','2018-01-29 16:43:34'), -(34,'agencyBoss','Jefe/a del departamento de agencias',1,'2018-01-29 16:44:39','2018-02-23 07:58:53'), -(35,'buyer','Departamento de compras',1,'2018-02-12 10:35:42','2018-02-12 10:35:42'), -(36,'replenisher','Trabajadores de camara',1,'2018-02-16 14:07:10','2019-04-12 05:38:08'), -(37,'hr','Gestor/a de recursos humanos',1,'2018-02-22 17:34:53','2018-02-22 17:34:53'), -(38,'hrBoss','Jefe/a de recursos humanos',1,'2018-02-22 17:35:09','2018-02-22 17:35:09'), -(39,'adminAssistant','Jefe auxiliar administrativo',1,'2018-02-23 10:37:36','2018-02-23 10:38:41'), -(40,'handmade','Departamento de confección',1,'2018-02-23 11:14:53','2018-02-23 11:39:12'), -(41,'handmadeBoss','Jefe de departamento de confección',1,'2018-02-23 11:15:09','2018-02-23 11:39:26'), -(42,'artificial','Departamento de artificial',1,'2018-02-23 11:39:59','2018-02-23 11:39:59'), -(43,'artificialBoss','Jefe del departamento de artificial',1,'2018-02-23 11:40:16','2018-02-23 11:40:16'), -(44,'accessory','Departamento de complementos',1,'2018-02-23 11:41:12','2018-02-23 11:41:12'), -(45,'accessoryBoss','Jefe del departamento de complementos',1,'2018-02-23 11:41:23','2018-02-23 11:41:23'), -(47,'cooler','Empleados de cámara',1,'2018-02-23 13:08:18','2018-02-23 13:08:18'), -(48,'coolerBoss','Jefe del departamento de cámara',1,'2018-02-23 13:12:01','2018-02-23 13:12:01'), -(49,'production','Empleado de producción',1,'2018-02-26 15:28:23','2021-02-12 09:42:35'), -(50,'productionBoss','Jefe de producción',1,'2018-02-26 15:34:12','2018-02-26 15:34:12'), -(51,'marketing','Departamento de marketing',1,'2018-03-01 07:28:39','2018-03-01 07:28:39'), -(52,'marketingBoss','Jefe del departamento de marketing',1,'2018-03-01 07:28:57','2018-03-01 07:28:57'), -(53,'insurance','Gestor de seguros de cambio',0,'2018-03-05 07:44:35','2019-02-01 13:47:57'), -(54,'itemPicker','Sacador en cámara',1,'2018-03-05 12:08:17','2018-03-05 12:08:17'), -(55,'itemPickerBoss','Jefe de sacadores',1,'2018-03-05 12:08:31','2018-03-05 12:08:31'), -(56,'delivery','Personal de reparto',1,'2018-05-30 06:07:02','2018-05-30 06:07:02'), -(57,'deliveryBoss','Jefe de personal de reparto',1,'2018-05-30 06:07:19','2018-05-30 06:07:19'), -(58,'packager','Departamento encajadores',1,'2019-01-21 12:43:45','2019-01-21 12:43:45'), -(59,'packagerBoss','Jefe departamento encajadores',1,'2019-01-21 12:44:10','2019-01-21 12:44:10'), -(60,'productionAssi','Tareas relacionadas con producción y administración',1,'2019-01-29 13:29:01','2019-01-29 13:29:01'), -(61,'replenisherBos','Jefe de Complementos/Camara',1,'2019-07-01 06:44:07','2019-07-01 06:44:07'), -(62,'noLogin','Role without login access to MySQL',0,'2019-07-01 06:50:19','2019-07-02 13:42:05'), -(64,'balanceSheet','Consulta de Balance',0,'2019-07-16 12:12:08','2019-07-16 12:12:08'), -(65,'officeBoss','Jefe de filial',1,'2019-08-02 06:54:26','2019-08-02 06:54:26'), -(66,'sysadmin','Administrador de sistema',1,'2019-08-08 06:58:56','2019-08-08 06:58:56'), -(67,'adminOfficer','categoria profesional oficial de administración',1,'2020-01-03 08:09:23','2020-01-03 08:09:23'), -(69,'coolerAssist','Empleado cámara con permiso compras',1,'2020-02-05 12:36:09','2020-02-05 12:36:09'), -(70,'trainee','Alumno de prácticas',1,'2020-03-04 11:00:25','2020-03-04 11:00:25'), -(71,'checker','Rol de revisor con privilegios de itemPicker',1,'2020-10-02 10:50:07','2020-10-02 10:50:07'), -(72,'claimManager','Personal de reclamaciones',1,'2020-10-13 10:01:32','2020-10-26 07:29:46'), -(73,'financial','Departamento de finanzas',1,'2020-11-16 09:30:27','2020-11-16 09:30:27'), -(74,'userPhotos','Privilegios para subir fotos de usuario',1,'2021-02-03 10:24:27','2021-02-03 10:24:27'), -(75,'catalogPhotos','Privilegios para subir fotos del catálogo',1,'2021-02-03 10:24:27','2021-02-03 10:24:27'), -(76,'chat','Rol para utilizar el rocket chat',1,'2020-11-27 13:06:50','2020-12-17 07:49:41'), -(100,'root','Rol con todos los privilegios',0,'2018-04-23 14:33:36','2020-11-12 06:50:07'), -(101,'buyerBoss','Jefe del departamento de compras',1,'2021-06-16 09:53:17','2021-06-16 09:53:17'), -(102,'preservedBoss','Responsable preservado',1,'2021-09-14 13:45:37','2021-09-14 13:45:37'), -(103,'it','Departamento de informática',1,'2021-11-11 09:48:22','2021-11-11 09:48:22'), -(104,'itBoss','Jefe de departamento de informática',1,'2021-11-11 09:48:49','2021-11-11 09:48:49'), -(105,'grant','Adjudicar roles a usuarios',1,'2021-11-11 12:41:09','2021-11-11 12:41:09'), -(106,'ext','Usuarios externos de la Base de datos',1,'2021-11-23 14:51:16','2021-11-23 14:51:16'), -(107,'productionPlus','Creado para pepe por orden de Juanvi',1,'2022-02-08 06:47:10','2022-02-08 06:47:10'), -(108,'system','System user',1,'2022-05-16 08:09:51','2022-05-16 08:09:51'), -(109,'salesTeamBoss','Jefe de equipo de comerciales',1,'2022-06-14 13:45:56','2022-06-14 13:45:56'); +INSERT INTO `role` VALUES (1,'employee','Empleado básico',1,'2017-05-19 07:04:58','2017-11-29 10:06:31'),(2,'customer','Privilegios básicos de un cliente',1,'2017-05-19 07:04:58','2017-05-19 07:04:58'),(3,'agency','Consultar tablas de predicciones de bultos',1,'2017-05-19 07:04:58','2017-05-19 07:04:58'),(5,'administrative','Tareas relacionadas con la contabilidad',1,'2017-05-19 07:04:58','2017-05-19 07:04:58'),(6,'guest','Privilegios para usuarios sin cuenta',1,'2017-05-19 07:04:58','2017-05-19 07:04:58'),(9,'developer','Desarrolladores del sistema',1,'2017-05-19 07:04:58','2017-05-19 07:04:58'),(11,'account','Privilegios relacionados con el login',0,'2017-05-19 07:04:58','2017-09-20 17:06:35'),(13,'teamBoss','Jefe de equipo/departamento',1,'2017-05-19 07:04:58','2021-06-30 13:29:30'),(15,'logistic','Departamento de compras, responsables de la logistica',1,'2017-05-19 07:04:58','2018-02-12 10:50:10'),(16,'logisticBoss','Jefe del departamento de logística',1,'2017-05-19 07:04:58','2017-05-19 07:04:58'),(17,'adminBoss','Jefe del departamento de administración',1,'2017-05-19 07:04:58','2017-05-19 07:04:58'),(18,'salesPerson','Departamento de ventas',1,'2017-05-19 07:04:58','2017-05-19 07:04:58'),(19,'salesBoss','Jefe del departamento de ventas',1,'2017-05-19 07:04:58','2017-08-16 12:38:27'),(20,'manager','Gerencia',1,'2017-06-01 14:57:02','2022-07-29 07:36:15'),(21,'salesAssistant','Jefe auxiliar de ventas',1,'2017-08-16 12:40:52','2017-08-16 12:40:52'),(22,'teamManager','Jefe de departamento con privilegios de auxiliar de venta.',1,'2017-09-07 09:08:12','2017-09-07 09:08:12'),(30,'financialBoss','Director finaciero',1,'2017-09-21 11:05:36','2017-09-21 11:05:36'),(31,'freelancer','Trabajadores por cuenta ajena',1,'2017-10-10 12:57:26','2017-10-10 12:59:27'),(32,'ett','Trabajadores de empresa temporal',1,'2017-10-10 12:58:58','2017-10-10 12:59:20'),(33,'invoicing','Personal con acceso a facturación',0,'2018-01-29 16:43:34','2018-01-29 16:43:34'),(34,'agencyBoss','Jefe/a del departamento de agencias',1,'2018-01-29 16:44:39','2018-02-23 07:58:53'),(35,'buyer','Departamento de compras',1,'2018-02-12 10:35:42','2018-02-12 10:35:42'),(36,'replenisher','Trabajadores de camara',1,'2018-02-16 14:07:10','2019-04-12 05:38:08'),(37,'hr','Gestor/a de recursos humanos',1,'2018-02-22 17:34:53','2018-02-22 17:34:53'),(38,'hrBoss','Jefe/a de recursos humanos',1,'2018-02-22 17:35:09','2018-02-22 17:35:09'),(39,'adminAssistant','Jefe auxiliar administrativo',1,'2018-02-23 10:37:36','2018-02-23 10:38:41'),(40,'handmade','Departamento de confección',1,'2018-02-23 11:14:53','2018-02-23 11:39:12'),(41,'handmadeBoss','Jefe de departamento de confección',1,'2018-02-23 11:15:09','2018-02-23 11:39:26'),(42,'artificial','Departamento de artificial',1,'2018-02-23 11:39:59','2018-02-23 11:39:59'),(43,'artificialBoss','Jefe del departamento de artificial',1,'2018-02-23 11:40:16','2018-02-23 11:40:16'),(44,'accessory','Departamento de complementos',1,'2018-02-23 11:41:12','2018-02-23 11:41:12'),(45,'accessoryBoss','Jefe del departamento de complementos',1,'2018-02-23 11:41:23','2018-02-23 11:41:23'),(47,'cooler','Empleados de cámara',1,'2018-02-23 13:08:18','2018-02-23 13:08:18'),(48,'coolerBoss','Jefe del departamento de cámara',1,'2018-02-23 13:12:01','2018-02-23 13:12:01'),(49,'production','Empleado de producción',1,'2018-02-26 15:28:23','2021-02-12 09:42:35'),(50,'productionBoss','Jefe de producción',1,'2018-02-26 15:34:12','2018-02-26 15:34:12'),(51,'marketing','Departamento de marketing',1,'2018-03-01 07:28:39','2018-03-01 07:28:39'),(52,'marketingBoss','Jefe del departamento de marketing',1,'2018-03-01 07:28:57','2018-03-01 07:28:57'),(53,'insurance','Gestor de seguros de cambio',0,'2018-03-05 07:44:35','2019-02-01 13:47:57'),(54,'itemPicker','Sacador en cámara',1,'2018-03-05 12:08:17','2018-03-05 12:08:17'),(55,'itemPickerBoss','Jefe de sacadores',1,'2018-03-05 12:08:31','2018-03-05 12:08:31'),(56,'delivery','Personal de reparto',1,'2018-05-30 06:07:02','2018-05-30 06:07:02'),(57,'deliveryBoss','Jefe de personal de reparto',1,'2018-05-30 06:07:19','2018-05-30 06:07:19'),(58,'packager','Departamento encajadores',1,'2019-01-21 12:43:45','2019-01-21 12:43:45'),(59,'packagerBoss','Jefe departamento encajadores',1,'2019-01-21 12:44:10','2019-01-21 12:44:10'),(60,'productionAssi','Tareas relacionadas con producción y administración',1,'2019-01-29 13:29:01','2019-01-29 13:29:01'),(61,'replenisherBos','Jefe de Complementos/Camara',1,'2019-07-01 06:44:07','2019-07-01 06:44:07'),(62,'noLogin','Role without login access to MySQL',0,'2019-07-01 06:50:19','2019-07-02 13:42:05'),(64,'balanceSheet','Consulta de Balance',0,'2019-07-16 12:12:08','2019-07-16 12:12:08'),(65,'officeBoss','Jefe de filial',1,'2019-08-02 06:54:26','2019-08-02 06:54:26'),(66,'sysadmin','Administrador de sistema',1,'2019-08-08 06:58:56','2019-08-08 06:58:56'),(67,'adminOfficer','categoria profesional oficial de administración',1,'2020-01-03 08:09:23','2020-01-03 08:09:23'),(69,'coolerAssist','Empleado cámara con permiso compras',1,'2020-02-05 12:36:09','2020-02-05 12:36:09'),(70,'trainee','Alumno de prácticas',1,'2020-03-04 11:00:25','2020-03-04 11:00:25'),(71,'checker','Rol de revisor con privilegios de itemPicker',1,'2020-10-02 10:50:07','2020-10-02 10:50:07'),(72,'claimManager','Personal de reclamaciones',1,'2020-10-13 10:01:32','2020-10-26 07:29:46'),(73,'financial','Departamento de finanzas',1,'2020-11-16 09:30:27','2020-11-16 09:30:27'),(74,'userPhotos','Privilegios para subir fotos de usuario',1,'2021-02-03 10:24:27','2021-02-03 10:24:27'),(75,'catalogPhotos','Privilegios para subir fotos del catálogo',1,'2021-02-03 10:24:27','2021-02-03 10:24:27'),(76,'chat','Rol para utilizar el rocket chat',1,'2020-11-27 13:06:50','2020-12-17 07:49:41'),(100,'root','Rol con todos los privilegios',0,'2018-04-23 14:33:36','2020-11-12 06:50:07'),(101,'buyerBoss','Jefe del departamento de compras',1,'2021-06-16 09:53:17','2021-06-16 09:53:17'),(102,'preservedBoss','Responsable preservado',1,'2021-09-14 13:45:37','2021-09-14 13:45:37'),(103,'it','Departamento de informática',1,'2021-11-11 09:48:22','2021-11-11 09:48:22'),(104,'itBoss','Jefe de departamento de informática',1,'2021-11-11 09:48:49','2021-11-11 09:48:49'),(105,'grant','Adjudicar roles a usuarios',1,'2021-11-11 12:41:09','2021-11-11 12:41:09'),(106,'ext','Usuarios externos de la Base de datos',1,'2021-11-23 14:51:16','2021-11-23 14:51:16'),(107,'productionPlus','Creado para pepe por orden de Juanvi',1,'2022-02-08 06:47:10','2022-02-08 06:47:10'),(108,'system','System user',1,'2022-05-16 08:09:51','2022-05-16 08:09:51'),(109,'salesTeamBoss','Jefe de equipo de comerciales',1,'2022-06-14 13:45:56','2022-06-14 13:45:56'),(110,'palletizer','Paletizadores',1,'2022-12-02 12:56:22','2022-12-02 12:56:30'),(111,'entryEditor','Entry editor',1,'2023-01-13 11:21:55','2023-01-13 11:21:55'),(112,'maintenance','Personal de mantenimiento',1,'2023-01-19 06:23:35','2023-01-19 06:23:35'),(114,'maintenanceBos','Jefe de mantenimiento',1,'2023-01-19 06:31:16','2023-01-19 06:31:16'); /*!40000 ALTER TABLE `role` ENABLE KEYS */; UNLOCK TABLES; @@ -410,219 +88,7 @@ UNLOCK TABLES; LOCK TABLES `roleInherit` WRITE; /*!40000 ALTER TABLE `roleInherit` DISABLE KEYS */; -INSERT INTO `roleInherit` VALUES -(1,1,2), -(2,1,3), -(3,1,70), -(4,2,11), -(5,3,11), -(6,5,1), -(7,5,21), -(8,5,33), -(124,5,76), -(167,9,103), -(10,11,6), -(11,13,1), -(12,15,35), -(143,15,49), -(150,15,56), -(114,15,76), -(14,16,13), -(15,16,15), -(127,16,76), -(16,17,20), -(17,17,37), -(18,17,39), -(19,17,64), -(145,17,67), -(136,17,76), -(20,18,1), -(132,18,76), -(21,19,21), -(242,20,9), -(22,20,13), -(23,20,16), -(24,20,65), -(134,20,76), -(25,21,13), -(26,21,18), -(27,21,53), -(241,21,72), -(131,21,76), -(28,22,13), -(29,22,21), -(30,30,5), -(31,30,20), -(32,30,22), -(33,30,53), -(34,30,64), -(118,30,76), -(35,31,1), -(36,32,1), -(37,34,1), -(38,34,13), -(39,34,33), -(40,35,1), -(142,35,75), -(129,35,76), -(41,36,44), -(42,36,47), -(43,37,1), -(139,37,74), -(125,37,76), -(146,38,13), -(44,38,37), -(45,38,64), -(126,38,76), -(46,39,5), -(47,39,21), -(48,39,57), -(115,39,76), -(49,40,1), -(50,40,49), -(51,41,13), -(52,41,35), -(53,41,40), -(135,41,76), -(54,42,35), -(55,42,49), -(128,42,76), -(56,43,13), -(57,43,42), -(58,44,1), -(59,45,13), -(60,45,44), -(61,47,1), -(62,48,13), -(153,48,35), -(63,48,47), -(253,48,49), -(64,49,36), -(65,49,58), -(66,50,13), -(67,50,21), -(68,50,35), -(69,50,49), -(70,50,57), -(71,50,59), -(133,50,76), -(72,51,1), -(251,51,21), -(140,51,74), -(141,51,75), -(73,52,13), -(74,52,19), -(75,52,35), -(76,52,51), -(137,52,76), -(77,53,1), -(78,54,1), -(79,55,13), -(80,55,54), -(81,56,1), -(82,57,13), -(245,57,33), -(83,57,56), -(138,57,76), -(84,58,1), -(85,59,13), -(109,59,50), -(87,60,5), -(89,60,50), -(90,60,57), -(130,60,76), -(91,61,13), -(92,61,36), -(93,65,19), -(94,65,35), -(95,65,50), -(117,65,76), -(168,66,9), -(237,66,103), -(97,67,5), -(98,67,37), -(99,69,35), -(152,69,47), -(101,70,11), -(102,71,1), -(103,71,58), -(105,72,18), -(106,73,5), -(108,73,19), -(107,73,64), -(148,101,13), -(147,101,35), -(154,102,1), -(248,102,13), -(246,102,35), -(173,103,1), -(194,103,2), -(181,103,3), -(179,103,5), -(201,103,6), -(176,103,11), -(231,103,13), -(212,103,15), -(213,103,16), -(178,103,17), -(230,103,18), -(229,103,19), -(238,103,20), -(228,103,21), -(232,103,22), -(199,103,30), -(200,103,31), -(197,103,32), -(207,103,33), -(182,103,34), -(186,103,35), -(225,103,36), -(204,103,37), -(205,103,38), -(177,103,39), -(202,103,40), -(203,103,41), -(183,103,42), -(184,103,43), -(174,103,44), -(175,103,45), -(191,103,47), -(193,103,48), -(222,103,49), -(224,103,50), -(215,103,51), -(216,103,52), -(206,103,53), -(210,103,54), -(211,103,55), -(195,103,56), -(196,103,57), -(219,103,58), -(220,103,59), -(223,103,60), -(226,103,61), -(185,103,64), -(218,103,65), -(180,103,67), -(192,103,69), -(233,103,70), -(189,103,71), -(190,103,72), -(198,103,73), -(234,103,74), -(188,103,75), -(172,103,76), -(187,103,101), -(221,103,102), -(171,104,9), -(170,104,66), -(169,104,100), -(166,104,103), -(239,106,11), -(240,107,60), -(247,108,1), -(250,109,13), -(249,109,18); +INSERT INTO `roleInherit` VALUES (1,1,2),(2,1,3),(3,1,70),(4,2,11),(5,3,11),(6,5,1),(7,5,21),(8,5,33),(124,5,76),(261,5,111),(167,9,103),(10,11,6),(11,13,1),(12,15,35),(143,15,49),(150,15,56),(114,15,76),(14,16,13),(15,16,15),(127,16,76),(16,17,20),(17,17,37),(18,17,39),(19,17,64),(145,17,67),(136,17,76),(20,18,1),(132,18,76),(21,19,21),(242,20,9),(22,20,13),(23,20,16),(24,20,65),(134,20,76),(25,21,13),(26,21,18),(27,21,53),(241,21,72),(131,21,76),(28,22,13),(29,22,21),(30,30,5),(31,30,20),(32,30,22),(33,30,53),(34,30,64),(118,30,76),(35,31,1),(36,32,1),(37,34,1),(38,34,13),(39,34,33),(40,35,1),(142,35,75),(129,35,76),(260,35,111),(41,36,44),(42,36,47),(43,37,1),(139,37,74),(125,37,76),(146,38,13),(44,38,37),(45,38,64),(126,38,76),(46,39,5),(47,39,21),(48,39,57),(115,39,76),(49,40,1),(50,40,49),(51,41,13),(52,41,35),(53,41,40),(135,41,76),(54,42,35),(55,42,49),(128,42,76),(56,43,13),(57,43,42),(258,43,111),(58,44,1),(59,45,13),(60,45,44),(61,47,1),(257,47,111),(62,48,13),(153,48,35),(63,48,47),(253,48,49),(256,48,69),(64,49,36),(65,49,58),(66,50,13),(67,50,21),(68,50,35),(69,50,49),(70,50,57),(71,50,59),(133,50,76),(72,51,1),(251,51,21),(264,51,35),(140,51,74),(141,51,75),(73,52,13),(74,52,19),(76,52,51),(137,52,76),(77,53,1),(78,54,1),(79,55,13),(80,55,54),(81,56,1),(82,57,13),(245,57,33),(83,57,56),(138,57,76),(84,58,1),(85,59,13),(109,59,50),(87,60,5),(89,60,50),(90,60,57),(130,60,76),(91,61,13),(92,61,36),(93,65,19),(94,65,35),(95,65,50),(117,65,76),(168,66,9),(237,66,103),(97,67,5),(98,67,37),(99,69,35),(152,69,47),(101,70,11),(102,71,1),(103,71,58),(105,72,18),(265,72,49),(259,72,111),(106,73,5),(108,73,19),(107,73,64),(148,101,13),(266,101,18),(147,101,35),(154,102,1),(248,102,13),(246,102,35),(173,103,1),(194,103,2),(181,103,3),(179,103,5),(201,103,6),(176,103,11),(231,103,13),(212,103,15),(213,103,16),(178,103,17),(230,103,18),(229,103,19),(238,103,20),(228,103,21),(232,103,22),(199,103,30),(200,103,31),(197,103,32),(207,103,33),(182,103,34),(186,103,35),(225,103,36),(204,103,37),(205,103,38),(177,103,39),(202,103,40),(203,103,41),(183,103,42),(184,103,43),(174,103,44),(175,103,45),(191,103,47),(193,103,48),(222,103,49),(224,103,50),(215,103,51),(216,103,52),(206,103,53),(210,103,54),(211,103,55),(195,103,56),(196,103,57),(219,103,58),(220,103,59),(223,103,60),(226,103,61),(185,103,64),(218,103,65),(180,103,67),(192,103,69),(233,103,70),(189,103,71),(190,103,72),(198,103,73),(234,103,74),(188,103,75),(172,103,76),(187,103,101),(221,103,102),(171,104,9),(170,104,66),(169,104,100),(166,104,103),(239,106,11),(240,107,60),(247,108,1),(250,109,13),(249,109,18),(254,110,1),(255,110,76),(262,112,1),(263,114,112); /*!40000 ALTER TABLE `roleInherit` ENABLE KEYS */; UNLOCK TABLES; @@ -632,1153 +98,7 @@ UNLOCK TABLES; LOCK TABLES `roleRole` WRITE; /*!40000 ALTER TABLE `roleRole` DISABLE KEYS */; -INSERT INTO `roleRole` VALUES -(113544,1,1), -(113545,1,2), -(113546,1,3), -(113549,1,6), -(113548,1,11), -(113547,1,70), -(113462,2,2), -(113464,2,6), -(113463,2,11), -(113344,3,3), -(113346,3,6), -(113345,3,11), -(113314,5,1), -(113321,5,2), -(113320,5,3), -(113313,5,5), -(113326,5,6), -(113325,5,11), -(113318,5,13), -(113322,5,18), -(113315,5,21), -(113316,5,33), -(113323,5,53), -(113319,5,70), -(113324,5,72), -(113317,5,76), -(113646,6,6), -(113485,9,1), -(113486,9,2), -(113487,9,3), -(113488,9,5), -(113489,9,6), -(113483,9,9), -(113490,9,11), -(113491,9,13), -(113492,9,15), -(113493,9,16), -(113494,9,17), -(113495,9,18), -(113496,9,19), -(113497,9,20), -(113498,9,21), -(113499,9,22), -(113500,9,30), -(113501,9,31), -(113502,9,32), -(113503,9,33), -(113504,9,34), -(113505,9,35), -(113506,9,36), -(113507,9,37), -(113508,9,38), -(113509,9,39), -(113510,9,40), -(113511,9,41), -(113512,9,42), -(113513,9,43), -(113514,9,44), -(113515,9,45), -(113516,9,47), -(113517,9,48), -(113518,9,49), -(113519,9,50), -(113520,9,51), -(113521,9,52), -(113522,9,53), -(113523,9,54), -(113524,9,55), -(113525,9,56), -(113526,9,57), -(113527,9,58), -(113528,9,59), -(113529,9,60), -(113530,9,61), -(113531,9,64), -(113532,9,65), -(113533,9,67), -(113534,9,69), -(113535,9,70), -(113536,9,71), -(113537,9,72), -(113538,9,73), -(113539,9,74), -(113540,9,75), -(113541,9,76), -(113542,9,101), -(113543,9,102), -(113484,9,103), -(113234,11,6), -(113233,11,11), -(114340,13,1), -(114341,13,2), -(114342,13,3), -(114345,13,6), -(114344,13,11), -(114339,13,13), -(114343,13,70), -(113860,15,1), -(113864,15,2), -(113863,15,3), -(113867,15,6), -(113866,15,11), -(113852,15,15), -(113853,15,35), -(113858,15,36), -(113861,15,44), -(113865,15,47), -(113854,15,49), -(113855,15,56), -(113857,15,58), -(113862,15,70), -(113859,15,75), -(113856,15,76), -(113874,16,1), -(113879,16,2), -(113878,16,3), -(113885,16,6), -(113884,16,11), -(113869,16,13), -(113870,16,15), -(113868,16,16), -(113873,16,35), -(113880,16,36), -(113883,16,44), -(113882,16,47), -(113872,16,49), -(113875,16,56), -(113881,16,58), -(113877,16,70), -(113876,16,75), -(113871,16,76), -(113260,17,1), -(113271,17,2), -(113270,17,3), -(113265,17,5), -(113293,17,6), -(113264,17,9), -(113292,17,11), -(113263,17,13), -(113275,17,15), -(113262,17,16), -(113252,17,17), -(113277,17,18), -(113274,17,19), -(113253,17,20), -(113266,17,21), -(113291,17,22), -(113290,17,30), -(113289,17,31), -(113288,17,32), -(113268,17,33), -(113287,17,34), -(113273,17,35), -(113286,17,36), -(113254,17,37), -(113285,17,38), -(113255,17,39), -(113284,17,40), -(113283,17,41), -(113282,17,42), -(113281,17,43), -(113294,17,44), -(113295,17,45), -(113296,17,47), -(113297,17,48), -(113298,17,49), -(113272,17,50), -(113299,17,51), -(113300,17,52), -(113278,17,53), -(113301,17,54), -(113302,17,55), -(113280,17,56), -(113267,17,57), -(113303,17,58), -(113304,17,59), -(113305,17,60), -(113306,17,61), -(113256,17,64), -(113261,17,65), -(113257,17,67), -(113307,17,69), -(113269,17,70), -(113308,17,71), -(113279,17,72), -(113309,17,73), -(113259,17,74), -(113310,17,75), -(113258,17,76), -(113311,17,101), -(113312,17,102), -(113276,17,103), -(114253,18,1), -(114256,18,2), -(114255,18,3), -(114259,18,6), -(114258,18,11), -(114252,18,18), -(114257,18,70), -(114254,18,76), -(114246,19,1), -(114249,19,2), -(114248,19,3), -(114251,19,6), -(114250,19,11), -(114241,19,13), -(114242,19,18), -(114239,19,19), -(114240,19,21), -(114243,19,53), -(114247,19,70), -(114244,19,72), -(114245,19,76), -(113895,20,1), -(113903,20,2), -(113902,20,3), -(113901,20,5), -(113900,20,6), -(113887,20,9), -(113899,20,11), -(113888,20,13), -(113894,20,15), -(113889,20,16), -(113898,20,17), -(113904,20,18), -(113893,20,19), -(113886,20,20), -(113905,20,21), -(113906,20,22), -(113907,20,30), -(113908,20,31), -(113909,20,32), -(113910,20,33), -(113911,20,34), -(113892,20,35), -(113912,20,36), -(113913,20,37), -(113914,20,38), -(113915,20,39), -(113916,20,40), -(113917,20,41), -(113918,20,42), -(113919,20,43), -(113920,20,44), -(113921,20,45), -(113922,20,47), -(113923,20,48), -(113924,20,49), -(113897,20,50), -(113925,20,51), -(113926,20,52), -(113927,20,53), -(113928,20,54), -(113929,20,55), -(113930,20,56), -(113931,20,57), -(113932,20,58), -(113933,20,59), -(113934,20,60), -(113935,20,61), -(113936,20,64), -(113890,20,65), -(113937,20,67), -(113938,20,69), -(113939,20,70), -(113940,20,71), -(113941,20,72), -(113942,20,73), -(113943,20,74), -(113944,20,75), -(113891,20,76), -(113945,20,101), -(113946,20,102), -(113896,20,103), -(114233,21,1), -(114236,21,2), -(114235,21,3), -(114238,21,6), -(114237,21,11), -(114228,21,13), -(114229,21,18), -(114227,21,21), -(114230,21,53), -(114234,21,70), -(114231,21,72), -(114232,21,76), -(114350,22,1), -(114356,22,2), -(114355,22,3), -(114358,22,6), -(114357,22,11), -(114347,22,13), -(114349,22,18), -(114348,22,21), -(114346,22,22), -(114351,22,53), -(114354,22,70), -(114352,22,72), -(114353,22,76), -(113589,30,1), -(113597,30,2), -(113596,30,3), -(113578,30,5), -(113609,30,6), -(113586,30,9), -(113610,30,11), -(113585,30,13), -(113591,30,15), -(113584,30,16), -(113608,30,17), -(113594,30,18), -(113598,30,19), -(113579,30,20), -(113588,30,21), -(113580,30,22), -(113577,30,30), -(113607,30,31), -(113606,30,32), -(113587,30,33), -(113605,30,34), -(113599,30,35), -(113604,30,36), -(113603,30,37), -(113602,30,38), -(113601,30,39), -(113611,30,40), -(113612,30,41), -(113613,30,42), -(113614,30,43), -(113615,30,44), -(113616,30,45), -(113617,30,47), -(113618,30,48), -(113619,30,49), -(113600,30,50), -(113620,30,51), -(113621,30,52), -(113581,30,53), -(113622,30,54), -(113623,30,55), -(113624,30,56), -(113625,30,57), -(113626,30,58), -(113627,30,59), -(113628,30,60), -(113629,30,61), -(113582,30,64), -(113590,30,65), -(113630,30,67), -(113631,30,69), -(113595,30,70), -(113632,30,71), -(113593,30,72), -(113633,30,73), -(113634,30,74), -(113635,30,75), -(113583,30,76), -(113636,30,101), -(113637,30,102), -(113592,30,103), -(113639,31,1), -(113640,31,2), -(113641,31,3), -(113644,31,6), -(113643,31,11), -(113638,31,31), -(113642,31,70), -(113551,32,1), -(113552,32,2), -(113553,32,3), -(113556,32,6), -(113555,32,11), -(113550,32,32), -(113554,32,70), -(113704,33,33), -(113348,34,1), -(113353,34,2), -(113352,34,3), -(113355,34,6), -(113354,34,11), -(113349,34,13), -(113350,34,33), -(113347,34,34), -(113351,34,70), -(113390,35,1), -(113395,35,2), -(113394,35,3), -(113397,35,6), -(113396,35,11), -(113389,35,35), -(113393,35,70), -(113391,35,75), -(113392,35,76), -(114140,36,1), -(114142,36,2), -(114141,36,3), -(114145,36,6), -(114144,36,11), -(114137,36,36), -(114138,36,44), -(114139,36,47), -(114143,36,70), -(113677,37,1), -(113682,37,2), -(113681,37,3), -(113684,37,6), -(113683,37,11), -(113676,37,37), -(113680,37,70), -(113678,37,74), -(113679,37,76), -(113691,38,1), -(113694,38,2), -(113693,38,3), -(113696,38,6), -(113695,38,11), -(113686,38,13), -(113687,38,37), -(113685,38,38), -(113688,38,64), -(113692,38,70), -(113690,38,74), -(113689,38,76), -(113243,39,1), -(113249,39,2), -(113248,39,3), -(113236,39,5), -(113251,39,6), -(113250,39,11), -(113241,39,13), -(113240,39,18), -(113237,39,21), -(113242,39,33), -(113235,39,39), -(113244,39,53), -(113246,39,56), -(113238,39,57), -(113247,39,70), -(113245,39,72), -(113239,39,76), -(113648,40,1), -(113651,40,2), -(113650,40,3), -(113658,40,6), -(113657,40,11), -(113653,40,36), -(113647,40,40), -(113656,40,44), -(113655,40,47), -(113649,40,49), -(113654,40,58), -(113652,40,70), -(113666,41,1), -(113670,41,2), -(113669,41,3), -(113675,41,6), -(113674,41,11), -(113660,41,13), -(113661,41,35), -(113667,41,36), -(113662,41,40), -(113659,41,41), -(113673,41,44), -(113672,41,47), -(113664,41,49), -(113671,41,58), -(113668,41,70), -(113665,41,75), -(113663,41,76), -(113362,42,1), -(113367,42,2), -(113366,42,3), -(113370,42,6), -(113369,42,11), -(113357,42,35), -(113360,42,36), -(113356,42,42), -(113364,42,44), -(113368,42,47), -(113358,42,49), -(113363,42,58), -(113365,42,70), -(113361,42,75), -(113359,42,76), -(113375,43,1), -(113381,43,2), -(113380,43,3), -(113387,43,6), -(113386,43,11), -(113372,43,13), -(113374,43,35), -(113382,43,36), -(113373,43,42), -(113371,43,43), -(113385,43,44), -(113384,43,47), -(113376,43,49), -(113383,43,58), -(113379,43,70), -(113378,43,75), -(113377,43,76), -(113218,44,1), -(113219,44,2), -(113220,44,3), -(113223,44,6), -(113222,44,11), -(113217,44,44), -(113221,44,70), -(113227,45,1), -(113229,45,2), -(113228,45,3), -(113232,45,6), -(113231,45,11), -(113225,45,13), -(113226,45,44), -(113224,45,45), -(113230,45,70), -(113429,47,1), -(113430,47,2), -(113431,47,3), -(113434,47,6), -(113433,47,11), -(113428,47,47), -(113432,47,70), -(113454,48,1), -(113459,48,2), -(113458,48,3), -(113461,48,6), -(113460,48,11), -(113447,48,13), -(113448,48,35), -(113451,48,36), -(113456,48,44), -(113449,48,47), -(113446,48,48), -(113450,48,49), -(113455,48,58), -(113457,48,70), -(113453,48,75), -(113452,48,76), -(114054,49,1), -(114057,49,2), -(114056,49,3), -(114059,49,6), -(114058,49,11), -(114050,49,36), -(114053,49,44), -(114052,49,47), -(114049,49,49), -(114051,49,58), -(114055,49,70), -(114100,50,1), -(114107,50,2), -(114106,50,3), -(114109,50,6), -(114108,50,11), -(114087,50,13), -(114099,50,18), -(114088,50,21), -(114101,50,33), -(114089,50,35), -(114095,50,36), -(114104,50,44), -(114103,50,47), -(114090,50,49), -(114086,50,50), -(114098,50,53), -(114102,50,56), -(114091,50,57), -(114094,50,58), -(114092,50,59), -(114105,50,70), -(114097,50,72), -(114096,50,75), -(114093,50,76), -(113948,51,1), -(113955,51,2), -(113954,51,3), -(113961,51,6), -(113960,51,11), -(113952,51,13), -(113956,51,18), -(113949,51,21), -(113947,51,51), -(113957,51,53), -(113953,51,70), -(113958,51,72), -(113950,51,74), -(113951,51,75), -(113959,51,76), -(113971,52,1), -(113976,52,2), -(113975,52,3), -(113979,52,6), -(113978,52,11), -(113963,52,13), -(113973,52,18), -(113964,52,19), -(113970,52,21), -(113965,52,35), -(113966,52,51), -(113962,52,52), -(113972,52,53), -(113974,52,70), -(113977,52,72), -(113968,52,74), -(113969,52,75), -(113967,52,76), -(113698,53,1), -(113699,53,2), -(113700,53,3), -(113703,53,6), -(113702,53,11), -(113697,53,53), -(113701,53,70), -(113837,54,1), -(113838,54,2), -(113839,54,3), -(113842,54,6), -(113841,54,11), -(113836,54,54), -(113840,54,70), -(113846,55,1), -(113848,55,2), -(113847,55,3), -(113851,55,6), -(113850,55,11), -(113844,55,13), -(113845,55,54), -(113843,55,55), -(113849,55,70), -(113466,56,1), -(113467,56,2), -(113468,56,3), -(113471,56,6), -(113470,56,11), -(113465,56,56), -(113469,56,70), -(113477,57,1), -(113480,57,2), -(113479,57,3), -(113482,57,6), -(113481,57,11), -(113473,57,13), -(113474,57,33), -(113475,57,56), -(113472,57,57), -(113478,57,70), -(113476,57,76), -(114008,58,1), -(114009,58,2), -(114010,58,3), -(114013,58,6), -(114012,58,11), -(114007,58,58), -(114011,58,70), -(114018,59,1), -(114028,59,2), -(114027,59,3), -(114037,59,6), -(114036,59,11), -(114015,59,13), -(114025,59,18), -(114017,59,21), -(114032,59,33), -(114019,59,35), -(114030,59,36), -(114035,59,44), -(114034,59,47), -(114020,59,49), -(114016,59,50), -(114024,59,53), -(114033,59,56), -(114021,59,57), -(114031,59,58), -(114014,59,59), -(114026,59,70), -(114023,59,72), -(114029,59,75), -(114022,59,76), -(114068,60,1), -(114080,60,2), -(114079,60,3), -(114061,60,5), -(114085,60,6), -(114084,60,11), -(114065,60,13), -(114077,60,18), -(114067,60,21), -(114066,60,33), -(114069,60,35), -(114073,60,36), -(114083,60,44), -(114082,60,47), -(114070,60,49), -(114062,60,50), -(114076,60,53), -(114072,60,56), -(114063,60,57), -(114081,60,58), -(114071,60,59), -(114060,60,60), -(114078,60,70), -(114075,60,72), -(114074,60,75), -(114064,60,76), -(114150,61,1), -(114154,61,2), -(114153,61,3), -(114156,61,6), -(114155,61,11), -(114147,61,13), -(114148,61,36), -(114149,61,44), -(114151,61,47), -(114146,61,61), -(114152,61,70), -(113980,62,62), -(113388,64,64), -(113988,65,1), -(113996,65,2), -(113995,65,3), -(114006,65,6), -(114005,65,11), -(113986,65,13), -(113999,65,18), -(113982,65,19), -(113989,65,21), -(114001,65,33), -(113983,65,35), -(113993,65,36), -(114004,65,44), -(114003,65,47), -(113990,65,49), -(113984,65,50), -(113998,65,53), -(114002,65,56), -(113991,65,57), -(114000,65,58), -(113992,65,59), -(113981,65,65), -(113994,65,70), -(113997,65,72), -(113987,65,75), -(113985,65,76), -(114274,66,1), -(114273,66,2), -(114275,66,3), -(114276,66,5), -(114277,66,6), -(114271,66,9), -(114278,66,11), -(114279,66,13), -(114280,66,15), -(114281,66,16), -(114282,66,17), -(114283,66,18), -(114284,66,19), -(114285,66,20), -(114286,66,21), -(114287,66,22), -(114288,66,30), -(114289,66,31), -(114290,66,32), -(114291,66,33), -(114292,66,34), -(114293,66,35), -(114294,66,36), -(114295,66,37), -(114296,66,38), -(114297,66,39), -(114298,66,40), -(114299,66,41), -(114300,66,42), -(114301,66,43), -(114302,66,44), -(114303,66,45), -(114304,66,47), -(114305,66,48), -(114306,66,49), -(114307,66,50), -(114308,66,51), -(114309,66,52), -(114310,66,53), -(114311,66,54), -(114312,66,55), -(114313,66,56), -(114314,66,57), -(114315,66,58), -(114316,66,59), -(114317,66,60), -(114318,66,61), -(114319,66,64), -(114320,66,65), -(114270,66,66), -(114321,66,67), -(114322,66,69), -(114323,66,70), -(114324,66,71), -(114325,66,72), -(114326,66,73), -(114327,66,74), -(114328,66,75), -(114329,66,76), -(114330,66,101), -(114331,66,102), -(114272,66,103), -(113331,67,1), -(113339,67,2), -(113338,67,3), -(113328,67,5), -(113343,67,6), -(113342,67,11), -(113336,67,13), -(113335,67,18), -(113330,67,21), -(113332,67,33), -(113329,67,37), -(113340,67,53), -(113327,67,67), -(113337,67,70), -(113341,67,72), -(113334,67,74), -(113333,67,76), -(113439,69,1), -(113443,69,2), -(113442,69,3), -(113445,69,6), -(113444,69,11), -(113436,69,35), -(113437,69,47), -(113435,69,69), -(113441,69,70), -(113438,69,75), -(113440,69,76), -(114361,70,6), -(114360,70,11), -(114359,70,70), -(113412,71,1), -(113415,71,2), -(113414,71,3), -(113418,71,6), -(113417,71,11), -(113413,71,58), -(113416,71,70), -(113411,71,71), -(113421,72,1), -(113424,72,2), -(113423,72,3), -(113427,72,6), -(113426,72,11), -(113420,72,18), -(113425,72,70), -(113419,72,72), -(113422,72,76), -(113566,73,1), -(113571,73,2), -(113570,73,3), -(113561,73,5), -(113576,73,6), -(113575,73,11), -(113568,73,13), -(113572,73,18), -(113562,73,19), -(113565,73,21), -(113564,73,33), -(113573,73,53), -(113563,73,64), -(113569,73,70), -(113574,73,72), -(113560,73,73), -(113567,73,76), -(114362,74,74), -(113409,75,75), -(113410,76,76), -(114183,100,1), -(114179,100,2), -(114165,100,3), -(114163,100,5), -(114190,100,6), -(114182,100,9), -(114160,100,11), -(114223,100,13), -(114201,100,15), -(114202,100,16), -(114162,100,17), -(114219,100,18), -(114218,100,19), -(114203,100,20), -(114217,100,21), -(114224,100,22), -(114187,100,30), -(114188,100,31), -(114184,100,32), -(114196,100,33), -(114166,100,34), -(114170,100,35), -(114215,100,36), -(114193,100,37), -(114194,100,38), -(114161,100,39), -(114191,100,40), -(114192,100,41), -(114167,100,42), -(114168,100,43), -(114158,100,44), -(114159,100,45), -(114176,100,47), -(114178,100,48), -(114211,100,49), -(114213,100,50), -(114204,100,51), -(114205,100,52), -(114195,100,53), -(114199,100,54), -(114200,100,55), -(114180,100,56), -(114181,100,57), -(114208,100,58), -(114209,100,59), -(114212,100,60), -(114216,100,61), -(114206,100,62), -(114169,100,64), -(114207,100,65), -(114221,100,66), -(114164,100,67), -(114177,100,69), -(114225,100,70), -(114174,100,71), -(114175,100,72), -(114186,100,73), -(114226,100,74), -(114172,100,75), -(114173,100,76), -(114157,100,100), -(114171,100,101), -(114210,100,102), -(114197,100,103), -(114198,100,104), -(114189,100,105), -(114185,100,106), -(114214,100,107), -(114222,100,108), -(114220,100,109), -(113402,101,1), -(113406,101,2), -(113405,101,3), -(113408,101,6), -(113407,101,11), -(113399,101,13), -(113400,101,35), -(113404,101,70), -(113401,101,75), -(113403,101,76), -(113398,101,101), -(114039,102,1), -(114044,102,2), -(114043,102,3), -(114048,102,6), -(114047,102,11), -(114040,102,13), -(114041,102,35), -(114042,102,70), -(114045,102,75), -(114046,102,76), -(114038,102,102), -(113706,103,1), -(113707,103,2), -(113708,103,3), -(113709,103,5), -(113710,103,6), -(113765,103,9), -(113711,103,11), -(113712,103,13), -(113713,103,15), -(113714,103,16), -(113715,103,17), -(113716,103,18), -(113717,103,19), -(113718,103,20), -(113719,103,21), -(113720,103,22), -(113721,103,30), -(113722,103,31), -(113723,103,32), -(113724,103,33), -(113725,103,34), -(113726,103,35), -(113727,103,36), -(113728,103,37), -(113729,103,38), -(113730,103,39), -(113731,103,40), -(113732,103,41), -(113733,103,42), -(113734,103,43), -(113735,103,44), -(113736,103,45), -(113737,103,47), -(113738,103,48), -(113739,103,49), -(113740,103,50), -(113741,103,51), -(113742,103,52), -(113743,103,53), -(113744,103,54), -(113745,103,55), -(113746,103,56), -(113747,103,57), -(113748,103,58), -(113749,103,59), -(113750,103,60), -(113751,103,61), -(113752,103,64), -(113753,103,65), -(113754,103,67), -(113755,103,69), -(113756,103,70), -(113757,103,71), -(113758,103,72), -(113759,103,73), -(113760,103,74), -(113761,103,75), -(113762,103,76), -(113763,103,101), -(113764,103,102), -(113705,103,103), -(113774,104,1), -(113773,104,2), -(113772,104,3), -(113771,104,5), -(113775,104,6), -(113767,104,9), -(113776,104,11), -(113777,104,13), -(113778,104,15), -(113779,104,16), -(113780,104,17), -(113781,104,18), -(113782,104,19), -(113783,104,20), -(113784,104,21), -(113785,104,22), -(113786,104,30), -(113787,104,31), -(113788,104,32), -(113789,104,33), -(113790,104,34), -(113791,104,35), -(113792,104,36), -(113793,104,37), -(113794,104,38), -(113795,104,39), -(113796,104,40), -(113797,104,41), -(113798,104,42), -(113799,104,43), -(113800,104,44), -(113801,104,45), -(113802,104,47), -(113803,104,48), -(113804,104,49), -(113805,104,50), -(113806,104,51), -(113807,104,52), -(113808,104,53), -(113809,104,54), -(113810,104,55), -(113811,104,56), -(113812,104,57), -(113813,104,58), -(113814,104,59), -(113815,104,60), -(113816,104,61), -(113832,104,62), -(113817,104,64), -(113818,104,65), -(113768,104,66), -(113819,104,67), -(113820,104,69), -(113821,104,70), -(113822,104,71), -(113823,104,72), -(113824,104,73), -(113825,104,74), -(113826,104,75), -(113827,104,76), -(113769,104,100), -(113828,104,101), -(113829,104,102), -(113770,104,103), -(113766,104,104), -(113831,104,105), -(113830,104,106), -(113833,104,107), -(113835,104,108), -(113834,104,109), -(113645,105,105), -(113559,106,6), -(113558,106,11), -(113557,106,106), -(114119,107,1), -(114131,107,2), -(114130,107,3), -(114112,107,5), -(114136,107,6), -(114135,107,11), -(114116,107,13), -(114128,107,18), -(114118,107,21), -(114117,107,33), -(114120,107,35), -(114124,107,36), -(114134,107,44), -(114133,107,47), -(114121,107,49), -(114113,107,50), -(114127,107,53), -(114123,107,56), -(114114,107,57), -(114132,107,58), -(114122,107,59), -(114111,107,60), -(114129,107,70), -(114126,107,72), -(114125,107,75), -(114115,107,76), -(114110,107,107), -(114333,108,1), -(114334,108,2), -(114335,108,3), -(114338,108,6), -(114337,108,11), -(114336,108,70), -(114332,108,108), -(114264,109,1), -(114266,109,2), -(114265,109,3), -(114269,109,6), -(114268,109,11), -(114261,109,13), -(114262,109,18), -(114267,109,70), -(114263,109,76), -(114260,109,109); +INSERT INTO `roleRole` VALUES (135896,1,1),(135897,1,2),(135898,1,3),(135901,1,6),(135900,1,11),(135899,1,70),(135813,2,2),(135815,2,6),(135814,2,11),(135680,3,3),(135682,3,6),(135681,3,11),(135638,5,1),(135647,5,2),(135646,5,3),(135637,5,5),(135654,5,6),(135651,5,11),(135644,5,13),(135643,5,18),(135639,5,21),(135640,5,33),(135653,5,36),(135656,5,44),(135655,5,47),(135650,5,49),(135648,5,53),(135652,5,58),(135645,5,70),(135649,5,72),(135641,5,76),(135642,5,111),(136006,6,6),(135836,9,1),(135837,9,2),(135838,9,3),(135839,9,5),(135840,9,6),(135834,9,9),(135841,9,11),(135842,9,13),(135843,9,15),(135844,9,16),(135845,9,17),(135846,9,18),(135847,9,19),(135848,9,20),(135849,9,21),(135850,9,22),(135851,9,30),(135852,9,31),(135853,9,32),(135854,9,33),(135855,9,34),(135856,9,35),(135857,9,36),(135858,9,37),(135859,9,38),(135860,9,39),(135861,9,40),(135862,9,41),(135863,9,42),(135864,9,43),(135865,9,44),(135866,9,45),(135867,9,47),(135868,9,48),(135869,9,49),(135870,9,50),(135871,9,51),(135872,9,52),(135873,9,53),(135874,9,54),(135875,9,55),(135876,9,56),(135877,9,57),(135878,9,58),(135879,9,59),(135880,9,60),(135881,9,61),(135882,9,64),(135883,9,65),(135884,9,67),(135885,9,69),(135886,9,70),(135887,9,71),(135888,9,72),(135889,9,73),(135890,9,74),(135891,9,75),(135892,9,76),(135893,9,101),(135894,9,102),(135835,9,103),(135895,9,111),(135551,11,6),(135550,11,11),(136772,13,1),(136773,13,2),(136774,13,3),(136777,13,6),(136776,13,11),(136771,13,13),(136775,13,70),(136227,15,1),(136233,15,2),(136232,15,3),(136235,15,6),(136234,15,11),(136219,15,15),(136220,15,35),(136224,15,36),(136230,15,44),(136229,15,47),(136221,15,49),(136222,15,56),(136228,15,58),(136231,15,70),(136226,15,75),(136223,15,76),(136225,15,111),(136242,16,1),(136247,16,2),(136246,16,3),(136254,16,6),(136253,16,11),(136237,16,13),(136238,16,15),(136236,16,16),(136241,16,35),(136249,16,36),(136252,16,44),(136251,16,47),(136240,16,49),(136243,16,56),(136250,16,58),(136245,16,70),(136244,16,75),(136239,16,76),(136248,16,111),(135583,17,1),(135594,17,2),(135593,17,3),(135588,17,5),(135618,17,6),(135587,17,9),(135617,17,11),(135586,17,13),(135598,17,15),(135585,17,16),(135575,17,17),(135601,17,18),(135597,17,19),(135576,17,20),(135589,17,21),(135616,17,22),(135615,17,30),(135614,17,31),(135613,17,32),(135591,17,33),(135612,17,34),(135596,17,35),(135611,17,36),(135577,17,37),(135610,17,38),(135578,17,39),(135609,17,40),(135608,17,41),(135607,17,42),(135606,17,43),(135605,17,44),(135619,17,45),(135620,17,47),(135621,17,48),(135622,17,49),(135595,17,50),(135623,17,51),(135624,17,52),(135602,17,53),(135625,17,54),(135626,17,55),(135604,17,56),(135590,17,57),(135627,17,58),(135628,17,59),(135629,17,60),(135630,17,61),(135579,17,64),(135584,17,65),(135580,17,67),(135631,17,69),(135592,17,70),(135632,17,71),(135603,17,72),(135633,17,73),(135582,17,74),(135634,17,75),(135581,17,76),(135635,17,101),(135636,17,102),(135599,17,103),(135600,17,111),(136684,18,1),(136687,18,2),(136686,18,3),(136690,18,6),(136689,18,11),(136683,18,18),(136688,18,70),(136685,18,76),(136673,19,1),(136678,19,2),(136677,19,3),(136682,19,6),(136681,19,11),(136666,19,13),(136667,19,18),(136664,19,19),(136665,19,21),(136675,19,36),(136680,19,44),(136679,19,47),(136672,19,49),(136668,19,53),(136674,19,58),(136676,19,70),(136669,19,72),(136670,19,76),(136671,19,111),(136279,20,1),(136287,20,2),(136286,20,3),(136285,20,5),(136284,20,6),(136271,20,9),(136283,20,11),(136272,20,13),(136278,20,15),(136273,20,16),(136282,20,17),(136288,20,18),(136277,20,19),(136270,20,20),(136289,20,21),(136290,20,22),(136291,20,30),(136292,20,31),(136293,20,32),(136294,20,33),(136295,20,34),(136276,20,35),(136296,20,36),(136297,20,37),(136298,20,38),(136299,20,39),(136300,20,40),(136301,20,41),(136302,20,42),(136303,20,43),(136304,20,44),(136305,20,45),(136306,20,47),(136307,20,48),(136308,20,49),(136281,20,50),(136309,20,51),(136310,20,52),(136311,20,53),(136312,20,54),(136313,20,55),(136314,20,56),(136315,20,57),(136316,20,58),(136317,20,59),(136318,20,60),(136319,20,61),(136320,20,64),(136274,20,65),(136321,20,67),(136322,20,69),(136323,20,70),(136324,20,71),(136325,20,72),(136326,20,73),(136327,20,74),(136328,20,75),(136275,20,76),(136329,20,101),(136330,20,102),(136280,20,103),(136331,20,111),(136654,21,1),(136659,21,2),(136658,21,3),(136663,21,6),(136662,21,11),(136647,21,13),(136648,21,18),(136646,21,21),(136656,21,36),(136661,21,44),(136660,21,47),(136653,21,49),(136649,21,53),(136655,21,58),(136657,21,70),(136650,21,72),(136651,21,76),(136652,21,111),(136782,22,1),(136790,22,2),(136789,22,3),(136796,22,6),(136793,22,11),(136779,22,13),(136781,22,18),(136780,22,21),(136778,22,22),(136792,22,36),(136795,22,44),(136794,22,47),(136787,22,49),(136783,22,53),(136791,22,58),(136788,22,70),(136784,22,72),(136785,22,76),(136786,22,111),(135948,30,1),(135958,30,2),(135957,30,3),(135937,30,5),(135968,30,6),(135944,30,9),(135970,30,11),(135943,30,13),(135952,30,15),(135949,30,16),(135967,30,17),(135955,30,18),(135951,30,19),(135938,30,20),(135947,30,21),(135939,30,22),(135936,30,30),(135966,30,31),(135965,30,32),(135946,30,33),(135964,30,34),(135959,30,35),(135963,30,36),(135962,30,37),(135961,30,38),(135971,30,39),(135972,30,40),(135973,30,41),(135974,30,42),(135975,30,43),(135976,30,44),(135977,30,45),(135978,30,47),(135979,30,48),(135969,30,49),(135960,30,50),(135980,30,51),(135981,30,52),(135940,30,53),(135982,30,54),(135983,30,55),(135984,30,56),(135985,30,57),(135986,30,58),(135987,30,59),(135988,30,60),(135989,30,61),(135941,30,64),(135950,30,65),(135990,30,67),(135991,30,69),(135956,30,70),(135992,30,71),(135954,30,72),(135993,30,73),(135994,30,74),(135995,30,75),(135942,30,76),(135996,30,101),(135997,30,102),(135953,30,103),(135945,30,111),(135999,31,1),(136000,31,2),(136001,31,3),(136004,31,6),(136003,31,11),(135998,31,31),(136002,31,70),(135904,32,1),(135905,32,2),(135906,32,3),(135909,32,6),(135908,32,11),(135903,32,32),(135907,32,70),(136066,33,33),(135684,34,1),(135689,34,2),(135688,34,3),(135691,34,6),(135690,34,11),(135685,34,13),(135686,34,33),(135683,34,34),(135687,34,70),(135728,35,1),(135734,35,2),(135733,35,3),(135736,35,6),(135735,35,11),(135727,35,35),(135732,35,70),(135729,35,75),(135730,35,76),(135731,35,111),(136554,36,1),(136556,36,2),(136555,36,3),(136559,36,6),(136558,36,11),(136550,36,36),(136551,36,44),(136552,36,47),(136557,36,70),(136553,36,111),(136039,37,1),(136044,37,2),(136043,37,3),(136046,37,6),(136045,37,11),(136038,37,37),(136042,37,70),(136040,37,74),(136041,37,76),(136053,38,1),(136056,38,2),(136055,38,3),(136058,38,6),(136057,38,11),(136048,38,13),(136049,38,37),(136047,38,38),(136050,38,64),(136054,38,70),(136052,38,74),(136051,38,76),(135560,39,1),(135568,39,2),(135567,39,3),(135553,39,5),(135574,39,6),(135571,39,11),(135557,39,13),(135561,39,18),(135554,39,21),(135559,39,33),(135570,39,36),(135552,39,39),(135573,39,44),(135572,39,47),(135565,39,49),(135562,39,53),(135564,39,56),(135555,39,57),(135569,39,58),(135566,39,70),(135563,39,72),(135556,39,76),(135558,39,111),(136008,40,1),(136011,40,2),(136010,40,3),(136019,40,6),(136017,40,11),(136013,40,36),(136007,40,40),(136016,40,44),(136015,40,47),(136009,40,49),(136014,40,58),(136012,40,70),(136018,40,111),(136028,41,1),(136032,41,2),(136031,41,3),(136037,41,6),(136036,41,11),(136021,41,13),(136022,41,35),(136029,41,36),(136023,41,40),(136020,41,41),(136035,41,44),(136034,41,47),(136025,41,49),(136033,41,58),(136030,41,70),(136027,41,75),(136024,41,76),(136026,41,111),(135698,42,1),(135705,42,2),(135704,42,3),(135707,42,6),(135706,42,11),(135693,42,35),(135699,42,36),(135692,42,42),(135702,42,44),(135701,42,47),(135694,42,49),(135700,42,58),(135703,42,70),(135697,42,75),(135695,42,76),(135696,42,111),(135714,43,1),(135719,43,2),(135718,43,3),(135725,43,6),(135724,43,11),(135709,43,13),(135713,43,35),(135720,43,36),(135710,43,42),(135708,43,43),(135723,43,44),(135722,43,47),(135712,43,49),(135721,43,58),(135717,43,70),(135716,43,75),(135715,43,76),(135711,43,111),(135535,44,1),(135536,44,2),(135537,44,3),(135540,44,6),(135539,44,11),(135534,44,44),(135538,44,70),(135544,45,1),(135546,45,2),(135545,45,3),(135549,45,6),(135548,45,11),(135542,45,13),(135543,45,44),(135541,45,45),(135547,45,70),(135776,47,1),(135779,47,2),(135778,47,3),(135782,47,6),(135781,47,11),(135775,47,47),(135780,47,70),(135777,47,111),(135805,48,1),(135810,48,2),(135809,48,3),(135812,48,6),(135811,48,11),(135796,48,13),(135797,48,35),(135801,48,36),(135807,48,44),(135798,48,47),(135795,48,48),(135799,48,49),(135806,48,58),(135800,48,69),(135808,48,70),(135804,48,75),(135803,48,76),(135802,48,111),(136463,49,1),(136465,49,2),(136464,49,3),(136469,49,6),(136468,49,11),(136459,49,36),(136462,49,44),(136461,49,47),(136458,49,49),(136460,49,58),(136467,49,70),(136466,49,111),(136511,50,1),(136519,50,2),(136518,50,3),(136521,50,6),(136520,50,11),(136498,50,13),(136510,50,18),(136499,50,21),(136513,50,33),(136500,50,35),(136505,50,36),(136516,50,44),(136515,50,47),(136501,50,49),(136497,50,50),(136509,50,53),(136514,50,56),(136502,50,57),(136512,50,58),(136503,50,59),(136517,50,70),(136508,50,72),(136507,50,75),(136504,50,76),(136506,50,111),(136333,51,1),(136342,51,2),(136341,51,3),(136351,51,6),(136348,51,11),(136339,51,13),(136338,51,18),(136334,51,21),(136335,51,35),(136350,51,36),(136353,51,44),(136352,51,47),(136347,51,49),(136332,51,51),(136343,51,53),(136349,51,58),(136340,51,70),(136344,51,72),(136336,51,74),(136337,51,75),(136345,51,76),(136346,51,111),(136362,52,1),(136368,52,2),(136367,52,3),(136375,52,6),(136372,52,11),(136355,52,13),(136365,52,18),(136356,52,19),(136361,52,21),(136360,52,35),(136374,52,36),(136377,52,44),(136376,52,47),(136371,52,49),(136357,52,51),(136354,52,52),(136364,52,53),(136373,52,58),(136366,52,70),(136369,52,72),(136359,52,74),(136363,52,75),(136358,52,76),(136370,52,111),(136060,53,1),(136061,53,2),(136062,53,3),(136065,53,6),(136064,53,11),(136059,53,53),(136063,53,70),(136204,54,1),(136205,54,2),(136206,54,3),(136209,54,6),(136208,54,11),(136203,54,54),(136207,54,70),(136213,55,1),(136215,55,2),(136214,55,3),(136218,55,6),(136217,55,11),(136211,55,13),(136212,55,54),(136210,55,55),(136216,55,70),(135817,56,1),(135818,56,2),(135819,56,3),(135822,56,6),(135821,56,11),(135816,56,56),(135820,56,70),(135828,57,1),(135831,57,2),(135830,57,3),(135833,57,6),(135832,57,11),(135824,57,13),(135825,57,33),(135826,57,56),(135823,57,57),(135829,57,70),(135827,57,76),(136407,58,1),(136408,58,2),(136409,58,3),(136412,58,6),(136411,58,11),(136406,58,58),(136410,58,70),(136417,59,1),(136427,59,2),(136426,59,3),(136437,59,6),(136436,59,11),(136414,59,13),(136424,59,18),(136416,59,21),(136432,59,33),(136418,59,35),(136430,59,36),(136435,59,44),(136434,59,47),(136419,59,49),(136415,59,50),(136423,59,53),(136433,59,56),(136420,59,57),(136431,59,58),(136413,59,59),(136425,59,70),(136422,59,72),(136428,59,75),(136421,59,76),(136429,59,111),(136478,60,1),(136492,60,2),(136491,60,3),(136471,60,5),(136496,60,6),(136495,60,11),(136479,60,13),(136489,60,18),(136477,60,21),(136476,60,33),(136480,60,35),(136485,60,36),(136494,60,44),(136493,60,47),(136481,60,49),(136472,60,50),(136488,60,53),(136483,60,56),(136473,60,57),(136484,60,58),(136482,60,59),(136470,60,60),(136490,60,70),(136487,60,72),(136486,60,75),(136474,60,76),(136475,60,111),(136564,61,1),(136568,61,2),(136567,61,3),(136571,61,6),(136570,61,11),(136561,61,13),(136562,61,36),(136563,61,44),(136565,61,47),(136560,61,61),(136566,61,70),(136569,61,111),(136378,62,62),(135726,64,64),(136386,65,1),(136396,65,2),(136395,65,3),(136405,65,6),(136404,65,11),(136388,65,13),(136399,65,18),(136380,65,19),(136387,65,21),(136400,65,33),(136381,65,35),(136393,65,36),(136403,65,44),(136402,65,47),(136389,65,49),(136382,65,50),(136398,65,53),(136401,65,56),(136390,65,57),(136392,65,58),(136391,65,59),(136379,65,65),(136394,65,70),(136397,65,72),(136385,65,75),(136383,65,76),(136384,65,111),(136705,66,1),(136704,66,2),(136706,66,3),(136707,66,5),(136708,66,6),(136702,66,9),(136709,66,11),(136710,66,13),(136711,66,15),(136712,66,16),(136713,66,17),(136714,66,18),(136715,66,19),(136716,66,20),(136717,66,21),(136718,66,22),(136719,66,30),(136720,66,31),(136721,66,32),(136722,66,33),(136723,66,34),(136724,66,35),(136725,66,36),(136726,66,37),(136727,66,38),(136728,66,39),(136729,66,40),(136730,66,41),(136731,66,42),(136732,66,43),(136733,66,44),(136734,66,45),(136735,66,47),(136736,66,48),(136737,66,49),(136738,66,50),(136739,66,51),(136740,66,52),(136741,66,53),(136742,66,54),(136743,66,55),(136744,66,56),(136745,66,57),(136746,66,58),(136747,66,59),(136748,66,60),(136749,66,61),(136750,66,64),(136751,66,65),(136701,66,66),(136752,66,67),(136753,66,69),(136754,66,70),(136755,66,71),(136756,66,72),(136757,66,73),(136758,66,74),(136759,66,75),(136760,66,76),(136761,66,101),(136762,66,102),(136703,66,103),(136763,66,111),(135661,67,1),(135671,67,2),(135670,67,3),(135658,67,5),(135677,67,6),(135674,67,11),(135668,67,13),(135667,67,18),(135660,67,21),(135662,67,33),(135676,67,36),(135659,67,37),(135679,67,44),(135678,67,47),(135673,67,49),(135666,67,53),(135675,67,58),(135657,67,67),(135669,67,70),(135672,67,72),(135665,67,74),(135663,67,76),(135664,67,111),(135787,69,1),(135792,69,2),(135791,69,3),(135794,69,6),(135793,69,11),(135784,69,35),(135785,69,47),(135783,69,69),(135790,69,70),(135786,69,75),(135788,69,76),(135789,69,111),(136799,70,6),(136798,70,11),(136797,70,70),(135753,71,1),(135756,71,2),(135755,71,3),(135759,71,6),(135758,71,11),(135754,71,58),(135757,71,70),(135752,71,71),(135766,72,1),(135771,72,2),(135770,72,3),(135774,72,6),(135773,72,11),(135761,72,18),(135764,72,36),(135768,72,44),(135772,72,47),(135762,72,49),(135767,72,58),(135769,72,70),(135760,72,72),(135765,72,76),(135763,72,111),(135919,73,1),(135926,73,2),(135925,73,3),(135914,73,5),(135933,73,6),(135930,73,11),(135923,73,13),(135922,73,18),(135915,73,19),(135918,73,21),(135917,73,33),(135932,73,36),(135935,73,44),(135934,73,47),(135929,73,49),(135927,73,53),(135931,73,58),(135916,73,64),(135924,73,70),(135928,73,72),(135913,73,73),(135920,73,76),(135921,73,111),(136800,74,74),(135750,75,75),(135751,76,76),(136598,100,1),(136594,100,2),(136580,100,3),(136578,100,5),(136606,100,6),(136597,100,9),(136575,100,11),(136642,100,13),(136617,100,15),(136618,100,16),(136577,100,17),(136638,100,18),(136637,100,19),(136621,100,20),(136636,100,21),(136643,100,22),(136603,100,30),(136604,100,31),(136600,100,32),(136612,100,33),(136581,100,34),(136585,100,35),(136634,100,36),(136609,100,37),(136610,100,38),(136576,100,39),(136607,100,40),(136608,100,41),(136582,100,42),(136583,100,43),(136573,100,44),(136574,100,45),(136591,100,47),(136593,100,48),(136630,100,49),(136632,100,50),(136622,100,51),(136623,100,52),(136611,100,53),(136615,100,54),(136616,100,55),(136595,100,56),(136596,100,57),(136626,100,58),(136627,100,59),(136631,100,60),(136635,100,61),(136624,100,62),(136584,100,64),(136625,100,65),(136640,100,66),(136579,100,67),(136592,100,69),(136644,100,70),(136589,100,71),(136590,100,72),(136602,100,73),(136645,100,74),(136587,100,75),(136588,100,76),(136572,100,100),(136586,100,101),(136629,100,102),(136613,100,103),(136614,100,104),(136605,100,105),(136601,100,106),(136633,100,107),(136641,100,108),(136639,100,109),(136628,100,110),(136599,100,111),(136619,100,112),(136620,100,114),(135743,101,1),(135747,101,2),(135746,101,3),(135749,101,6),(135748,101,11),(135738,101,13),(135739,101,18),(135740,101,35),(135745,101,70),(135741,101,75),(135742,101,76),(135737,101,101),(135744,101,111),(136447,102,1),(136452,102,2),(136451,102,3),(136457,102,6),(136456,102,11),(136448,102,13),(136449,102,35),(136450,102,70),(136453,102,75),(136454,102,76),(136446,102,102),(136455,102,111),(136068,103,1),(136069,103,2),(136070,103,3),(136071,103,5),(136072,103,6),(136127,103,9),(136073,103,11),(136074,103,13),(136075,103,15),(136076,103,16),(136077,103,17),(136078,103,18),(136079,103,19),(136080,103,20),(136081,103,21),(136082,103,22),(136083,103,30),(136084,103,31),(136085,103,32),(136086,103,33),(136087,103,34),(136088,103,35),(136089,103,36),(136090,103,37),(136091,103,38),(136092,103,39),(136093,103,40),(136094,103,41),(136095,103,42),(136096,103,43),(136097,103,44),(136098,103,45),(136099,103,47),(136100,103,48),(136101,103,49),(136102,103,50),(136103,103,51),(136104,103,52),(136105,103,53),(136106,103,54),(136107,103,55),(136108,103,56),(136109,103,57),(136110,103,58),(136111,103,59),(136112,103,60),(136113,103,61),(136114,103,64),(136115,103,65),(136116,103,67),(136117,103,69),(136118,103,70),(136119,103,71),(136120,103,72),(136121,103,73),(136122,103,74),(136123,103,75),(136124,103,76),(136125,103,101),(136126,103,102),(136067,103,103),(136128,103,111),(136137,104,1),(136136,104,2),(136135,104,3),(136134,104,5),(136138,104,6),(136130,104,9),(136139,104,11),(136140,104,13),(136141,104,15),(136142,104,16),(136143,104,17),(136144,104,18),(136145,104,19),(136146,104,20),(136147,104,21),(136148,104,22),(136149,104,30),(136150,104,31),(136151,104,32),(136152,104,33),(136153,104,34),(136154,104,35),(136155,104,36),(136156,104,37),(136157,104,38),(136158,104,39),(136159,104,40),(136160,104,41),(136161,104,42),(136162,104,43),(136163,104,44),(136164,104,45),(136165,104,47),(136166,104,48),(136167,104,49),(136168,104,50),(136169,104,51),(136170,104,52),(136171,104,53),(136172,104,54),(136173,104,55),(136174,104,56),(136175,104,57),(136176,104,58),(136177,104,59),(136178,104,60),(136179,104,61),(136198,104,62),(136180,104,64),(136181,104,65),(136131,104,66),(136182,104,67),(136183,104,69),(136184,104,70),(136185,104,71),(136186,104,72),(136187,104,73),(136188,104,74),(136189,104,75),(136190,104,76),(136132,104,100),(136191,104,101),(136192,104,102),(136133,104,103),(136129,104,104),(136195,104,105),(136194,104,106),(136200,104,107),(136202,104,108),(136201,104,109),(136199,104,110),(136193,104,111),(136196,104,112),(136197,104,114),(136005,105,105),(135912,106,6),(135911,106,11),(135910,106,106),(136531,107,1),(136545,107,2),(136544,107,3),(136524,107,5),(136549,107,6),(136548,107,11),(136532,107,13),(136542,107,18),(136530,107,21),(136529,107,33),(136533,107,35),(136538,107,36),(136547,107,44),(136546,107,47),(136534,107,49),(136525,107,50),(136541,107,53),(136536,107,56),(136526,107,57),(136537,107,58),(136535,107,59),(136523,107,60),(136543,107,70),(136540,107,72),(136539,107,75),(136527,107,76),(136522,107,107),(136528,107,111),(136765,108,1),(136766,108,2),(136767,108,3),(136770,108,6),(136769,108,11),(136768,108,70),(136764,108,108),(136695,109,1),(136697,109,2),(136696,109,3),(136700,109,6),(136699,109,11),(136692,109,13),(136693,109,18),(136698,109,70),(136694,109,76),(136691,109,109),(136439,110,1),(136442,110,2),(136441,110,3),(136445,110,6),(136444,110,11),(136443,110,70),(136440,110,76),(136438,110,110),(135902,111,111),(136256,112,1),(136257,112,2),(136258,112,3),(136261,112,6),(136260,112,11),(136259,112,70),(136255,112,112),(136264,114,1),(136265,114,2),(136266,114,3),(136269,114,6),(136268,114,11),(136267,114,70),(136263,114,112),(136262,114,114); /*!40000 ALTER TABLE `roleRole` ENABLE KEYS */; UNLOCK TABLES; @@ -1788,8 +108,7 @@ UNLOCK TABLES; LOCK TABLES `userPassword` WRITE; /*!40000 ALTER TABLE `userPassword` DISABLE KEYS */; -INSERT INTO `userPassword` VALUES -(1,7,1,0,2,1); +INSERT INTO `userPassword` VALUES (1,7,1,0,2,1); /*!40000 ALTER TABLE `userPassword` ENABLE KEYS */; UNLOCK TABLES; @@ -1799,8 +118,7 @@ UNLOCK TABLES; LOCK TABLES `accountConfig` WRITE; /*!40000 ALTER TABLE `accountConfig` DISABLE KEYS */; -INSERT INTO `accountConfig` VALUES -(1,'/mnt/homes','/bin/bash',10000,5,60,5,30); +INSERT INTO `accountConfig` VALUES (1,'/mnt/homes','/bin/bash',10000,5,60,5,30); /*!40000 ALTER TABLE `accountConfig` ENABLE KEYS */; UNLOCK TABLES; @@ -1810,8 +128,7 @@ UNLOCK TABLES; LOCK TABLES `mailConfig` WRITE; /*!40000 ALTER TABLE `mailConfig` DISABLE KEYS */; -INSERT INTO `mailConfig` VALUES -(1,'verdnatura.es'); +INSERT INTO `mailConfig` VALUES (1,'verdnatura.es'); /*!40000 ALTER TABLE `mailConfig` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -1823,13 +140,13 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2022-11-21 7:59:04 +-- Dump completed on 2023-02-20 14:45:52 USE `salix`; --- MariaDB dump 10.19 Distrib 10.9.4-MariaDB, for Linux (x86_64) +-- MariaDB dump 10.19 Distrib 10.5.18-MariaDB, for debian-linux-gnu (x86_64) -- --- Host: db.verdnatura.es Database: salix +-- Host: db-proxy.verdnatura.es Database: salix -- ------------------------------------------------------ --- Server version 10.7.6-MariaDB-1:10.7.6+maria~deb11-log +-- Server version 10.7.7-MariaDB-1:10.7.7+maria~deb11-log /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -1847,359 +164,7 @@ USE `salix`; LOCK TABLES `ACL` WRITE; /*!40000 ALTER TABLE `ACL` DISABLE KEYS */; -INSERT INTO `ACL` VALUES -(1,'Account','*','*','ALLOW','ROLE','employee'), -(3,'Address','*','*','ALLOW','ROLE','employee'), -(5,'AgencyService','*','READ','ALLOW','ROLE','employee'), -(7,'Client','*','*','ALLOW','ROLE','employee'), -(9,'ClientObservation','*','*','ALLOW','ROLE','employee'), -(11,'ContactChannel','*','READ','ALLOW','ROLE','trainee'), -(13,'Employee','*','READ','ALLOW','ROLE','employee'), -(14,'PayMethod','*','READ','ALLOW','ROLE','trainee'), -(16,'FakeProduction','*','READ','ALLOW','ROLE','employee'), -(17,'Warehouse','* ','READ','ALLOW','ROLE','trainee'), -(18,'State','*','READ','ALLOW','ROLE','employee'), -(20,'TicketState','*','*','ALLOW','ROLE','employee'), -(24,'Delivery','*','READ','ALLOW','ROLE','employee'), -(25,'Zone','*','READ','ALLOW','ROLE','employee'), -(26,'ClientCredit','*','*','ALLOW','ROLE','employee'), -(27,'ClientCreditLimit','*','READ','ALLOW','ROLE','trainee'), -(30,'GreugeType','*','READ','ALLOW','ROLE','trainee'), -(31,'Mandate','*','READ','ALLOW','ROLE','trainee'), -(32,'MandateType','*','READ','ALLOW','ROLE','trainee'), -(33,'Company','*','READ','ALLOW','ROLE','trainee'), -(34,'Greuge','*','READ','ALLOW','ROLE','trainee'), -(35,'AddressObservation','*','*','ALLOW','ROLE','employee'), -(36,'ObservationType','*','*','ALLOW','ROLE','employee'), -(37,'Greuge','*','WRITE','ALLOW','ROLE','employee'), -(38,'AgencyMode','*','READ','ALLOW','ROLE','employee'), -(39,'ItemTag','*','WRITE','ALLOW','ROLE','buyer'), -(40,'ItemBotanical','*','WRITE','ALLOW','ROLE','buyer'), -(41,'ItemBotanical','*','READ','ALLOW','ROLE','employee'), -(42,'ItemPlacement','*','WRITE','ALLOW','ROLE','buyer'), -(43,'ItemPlacement','*','WRITE','ALLOW','ROLE','replenisher'), -(44,'ItemPlacement','*','READ','ALLOW','ROLE','employee'), -(45,'ItemBarcode','*','READ','ALLOW','ROLE','employee'), -(46,'ItemBarcode','*','WRITE','ALLOW','ROLE','buyer'), -(47,'ItemBarcode','*','WRITE','ALLOW','ROLE','replenisher'), -(51,'ItemTag','*','READ','ALLOW','ROLE','employee'), -(53,'Item','*','READ','ALLOW','ROLE','employee'), -(54,'Item','*','WRITE','ALLOW','ROLE','buyer'), -(55,'Recovery','*','READ','ALLOW','ROLE','trainee'), -(56,'Recovery','*','WRITE','ALLOW','ROLE','administrative'), -(58,'CreditClassification','*','*','ALLOW','ROLE','insurance'), -(60,'CreditInsurance','*','*','ALLOW','ROLE','insurance'), -(61,'InvoiceOut','*','READ','ALLOW','ROLE','employee'), -(62,'Ticket','*','*','ALLOW','ROLE','employee'), -(63,'TicketObservation','*','*','ALLOW','ROLE','employee'), -(64,'Route','*','READ','ALLOW','ROLE','employee'), -(65,'Sale','*','READ','ALLOW','ROLE','employee'), -(66,'TicketTracking','*','READ','ALLOW','ROLE','employee'), -(68,'TicketPackaging','*','*','ALLOW','ROLE','employee'), -(69,'Packaging','*','READ','ALLOW','ROLE','employee'), -(70,'Packaging','*','WRITE','ALLOW','ROLE','logistic'), -(71,'SaleChecked','*','READ','ALLOW','ROLE','employee'), -(72,'SaleComponent','*','READ','ALLOW','ROLE','employee'), -(73,'Expedition','*','READ','ALLOW','ROLE','employee'), -(74,'Expedition','*','WRITE','ALLOW','ROLE','deliveryBoss'), -(75,'Expedition','*','WRITE','ALLOW','ROLE','production'), -(76,'AnnualAverageInvoiced','*','READ','ALLOW','ROLE','employee'), -(77,'WorkerMana','*','READ','ALLOW','ROLE','employee'), -(78,'TicketTracking','*','WRITE','ALLOW','ROLE','production'), -(79,'TicketTracking','changeState','*','ALLOW','ROLE','employee'), -(80,'Sale','deleteSales','*','ALLOW','ROLE','employee'), -(81,'Sale','moveToTicket','*','ALLOW','ROLE','employee'), -(82,'Sale','updateQuantity','*','ALLOW','ROLE','employee'), -(83,'Sale','updatePrice','*','ALLOW','ROLE','employee'), -(84,'Sale','updateDiscount','*','ALLOW','ROLE','employee'), -(85,'SaleTracking','*','READ','ALLOW','ROLE','employee'), -(86,'Order','*','*','ALLOW','ROLE','employee'), -(87,'OrderRow','*','*','ALLOW','ROLE','employee'), -(88,'ClientContact','*','*','ALLOW','ROLE','employee'), -(89,'Sale','moveToNewTicket','*','ALLOW','ROLE','employee'), -(90,'Sale','reserve','*','ALLOW','ROLE','employee'), -(91,'TicketWeekly','*','READ','ALLOW','ROLE','employee'), -(94,'Agency','landsThatDay','*','ALLOW','ROLE','employee'), -(96,'ClaimEnd','*','READ','ALLOW','ROLE','employee'), -(97,'ClaimEnd','*','WRITE','ALLOW','ROLE','claimManager'), -(98,'ClaimBeginning','*','*','ALLOW','ROLE','employee'), -(99,'ClaimDevelopment','*','READ','ALLOW','ROLE','employee'), -(100,'ClaimDevelopment','*','WRITE','ALLOW','ROLE','claimManager'), -(101,'Claim','*','*','ALLOW','ROLE','employee'), -(102,'Claim','createFromSales','*','ALLOW','ROLE','employee'), -(104,'Item','*','WRITE','ALLOW','ROLE','marketingBoss'), -(105,'ItemBarcode','*','WRITE','ALLOW','ROLE','marketingBoss'), -(106,'ItemBotanical','*','WRITE','ALLOW','ROLE','marketingBoss'), -(108,'ItemPlacement','*','WRITE','ALLOW','ROLE','marketingBoss'), -(109,'UserConfig','*','*','ALLOW','ROLE','employee'), -(110,'Bank','*','READ','ALLOW','ROLE','trainee'), -(111,'ClientLog','*','READ','ALLOW','ROLE','trainee'), -(112,'Defaulter','*','READ','ALLOW','ROLE','employee'), -(113,'ClientRisk','*','READ','ALLOW','ROLE','trainee'), -(114,'Receipt','*','READ','ALLOW','ROLE','trainee'), -(115,'Receipt','*','WRITE','ALLOW','ROLE','administrative'), -(116,'BankEntity','*','*','ALLOW','ROLE','employee'), -(117,'ClientSample','*','*','ALLOW','ROLE','employee'), -(118,'WorkerTeam','*','*','ALLOW','ROLE','salesPerson'), -(119,'Travel','*','READ','ALLOW','ROLE','employee'), -(120,'Travel','*','WRITE','ALLOW','ROLE','buyer'), -(121,'Item','regularize','*','ALLOW','ROLE','employee'), -(122,'TicketRequest','*','*','ALLOW','ROLE','employee'), -(123,'Worker','*','*','ALLOW','ROLE','employee'), -(124,'Client','confirmTransaction','WRITE','ALLOW','ROLE','administrative'), -(125,'Agency','getAgenciesWithWarehouse','*','ALLOW','ROLE','employee'), -(126,'Client','activeWorkersWithRole','*','ALLOW','ROLE','employee'), -(127,'TicketLog','*','READ','ALLOW','ROLE','employee'), -(129,'TicketService','*','*','ALLOW','ROLE','employee'), -(130,'Expedition','*','WRITE','ALLOW','ROLE','packager'), -(131,'CreditInsurance','*','READ','ALLOW','ROLE','trainee'), -(132,'CreditClassification','*','READ','ALLOW','ROLE','trainee'), -(133,'ItemTag','*','WRITE','ALLOW','ROLE','marketingBoss'), -(135,'ZoneGeo','*','READ','ALLOW','ROLE','employee'), -(136,'ZoneCalendar','*','READ','ALLOW','ROLE','employee'), -(137,'ZoneIncluded','*','READ','ALLOW','ROLE','employee'), -(138,'LabourHoliday','*','READ','ALLOW','ROLE','employee'), -(139,'LabourHolidayLegend','*','READ','ALLOW','ROLE','employee'), -(140,'LabourHolidayType','*','READ','ALLOW','ROLE','employee'), -(141,'Zone','*','*','ALLOW','ROLE','deliveryBoss'), -(142,'ZoneCalendar','*','WRITE','ALLOW','ROLE','deliveryBoss'), -(143,'ZoneIncluded','*','*','ALLOW','ROLE','deliveryBoss'), -(144,'Stowaway','*','*','ALLOW','ROLE','employee'), -(145,'Ticket','getPossibleStowaways','READ','ALLOW','ROLE','employee'), -(147,'UserConfigView','*','*','ALLOW','ROLE','employee'), -(148,'UserConfigView','*','*','ALLOW','ROLE','employee'), -(149,'Sip','*','READ','ALLOW','ROLE','employee'), -(150,'Sip','*','WRITE','ALLOW','ROLE','hr'), -(151,'Department','*','READ','ALLOW','ROLE','employee'), -(152,'Department','*','WRITE','ALLOW','ROLE','hr'), -(153,'Route','*','READ','ALLOW','ROLE','employee'), -(154,'Route','*','WRITE','ALLOW','ROLE','delivery'), -(155,'Calendar','*','READ','ALLOW','ROLE','hr'), -(156,'WorkerLabour','*','READ','ALLOW','ROLE','hr'), -(157,'Calendar','absences','READ','ALLOW','ROLE','employee'), -(158,'ItemTag','*','WRITE','ALLOW','ROLE','accessory'), -(160,'TicketServiceType','*','READ','ALLOW','ROLE','employee'), -(161,'TicketConfig','*','READ','ALLOW','ROLE','employee'), -(162,'InvoiceOut','delete','WRITE','ALLOW','ROLE','invoicing'), -(163,'InvoiceOut','book','WRITE','ALLOW','ROLE','invoicing'), -(165,'TicketDms','*','*','ALLOW','ROLE','employee'), -(167,'Worker','isSubordinate','READ','ALLOW','ROLE','employee'), -(168,'Worker','mySubordinates','READ','ALLOW','ROLE','employee'), -(169,'WorkerTimeControl','filter','READ','ALLOW','ROLE','employee'), -(170,'WorkerTimeControl','addTime','WRITE','ALLOW','ROLE','employee'), -(171,'TicketServiceType','*','WRITE','ALLOW','ROLE','administrative'), -(172,'Sms','*','READ','ALLOW','ROLE','employee'), -(173,'Sms','send','WRITE','ALLOW','ROLE','employee'), -(174,'Agency','getLanded','READ','ALLOW','ROLE','employee'), -(175,'Agency','getShipped','READ','ALLOW','ROLE','employee'), -(176,'Device','*','*','ALLOW','ROLE','employee'), -(177,'Device','*','*','ALLOW','ROLE','employee'), -(178,'WorkerTimeControl','*','*','ALLOW','ROLE','employee'), -(179,'ItemLog','*','READ','ALLOW','ROLE','employee'), -(180,'RouteLog','*','READ','ALLOW','ROLE','employee'), -(181,'Dms','removeFile','WRITE','ALLOW','ROLE','employee'), -(182,'Dms','uploadFile','WRITE','ALLOW','ROLE','employee'), -(183,'Dms','downloadFile','READ','ALLOW','ROLE','employee'), -(184,'Client','uploadFile','WRITE','ALLOW','ROLE','employee'), -(185,'ClientDms','removeFile','WRITE','ALLOW','ROLE','employee'), -(186,'ClientDms','*','READ','ALLOW','ROLE','trainee'), -(187,'Ticket','uploadFile','WRITE','ALLOW','ROLE','employee'), -(190,'Route','updateVolume','WRITE','ALLOW','ROLE','deliveryBoss'), -(191,'Agency','getLanded','READ','ALLOW','ROLE','employee'), -(192,'Agency','getShipped','READ','ALLOW','ROLE','employee'), -(194,'Postcode','*','WRITE','ALLOW','ROLE','deliveryBoss'), -(195,'Ticket','addSale','WRITE','ALLOW','ROLE','employee'), -(196,'Dms','updateFile','WRITE','ALLOW','ROLE','employee'), -(197,'Dms','*','READ','ALLOW','ROLE','trainee'), -(198,'ClaimDms','removeFile','WRITE','ALLOW','ROLE','employee'), -(199,'ClaimDms','*','READ','ALLOW','ROLE','employee'), -(200,'Claim','uploadFile','WRITE','ALLOW','ROLE','employee'), -(201,'Sale','updateConcept','WRITE','ALLOW','ROLE','employee'), -(202,'Claim','updateClaimAction','WRITE','ALLOW','ROLE','claimManager'), -(203,'UserPhone','*','*','ALLOW','ROLE','employee'), -(204,'WorkerDms','removeFile','WRITE','ALLOW','ROLE','hr'), -(205,'WorkerDms','*','READ','ALLOW','ROLE','hr'), -(206,'Chat','*','*','ALLOW','ROLE','employee'), -(207,'Chat','sendMessage','*','ALLOW','ROLE','employee'), -(208,'Sale','recalculatePrice','WRITE','ALLOW','ROLE','employee'), -(209,'Ticket','recalculateComponents','WRITE','ALLOW','ROLE','employee'), -(211,'TravelLog','*','READ','ALLOW','ROLE','buyer'), -(212,'Thermograph','*','*','ALLOW','ROLE','buyer'), -(213,'TravelThermograph','*','WRITE','ALLOW','ROLE','buyer'), -(214,'Entry','*','*','ALLOW','ROLE','buyer'), -(215,'TicketWeekly','*','WRITE','ALLOW','ROLE','buyer'), -(216,'TravelThermograph','*','READ','ALLOW','ROLE','employee'), -(218,'Intrastat','*','*','ALLOW','ROLE','buyer'), -(219,'Account','acl','READ','ALLOW','ROLE','account'), -(220,'Account','getCurrentUserData','READ','ALLOW','ROLE','account'), -(221,'UserConfig','getUserConfig','READ','ALLOW','ROLE','account'), -(222,'Client','*','READ','ALLOW','ROLE','trainee'), -(226,'ClientObservation','*','READ','ALLOW','ROLE','trainee'), -(227,'Address','*','READ','ALLOW','ROLE','trainee'), -(228,'AddressObservation','*','READ','ALLOW','ROLE','trainee'), -(230,'ClientCredit','*','READ','ALLOW','ROLE','trainee'), -(231,'ClientContact','*','READ','ALLOW','ROLE','trainee'), -(232,'ClientSample','*','READ','ALLOW','ROLE','trainee'), -(233,'EntryLog','*','READ','ALLOW','ROLE','buyer'), -(234,'WorkerLog','*','READ','ALLOW','ROLE','salesAssistant'), -(235,'CustomsAgent','*','*','ALLOW','ROLE','employee'), -(236,'Buy','*','*','ALLOW','ROLE','buyer'), -(237,'WorkerDms','filter','*','ALLOW','ROLE','employee'), -(238,'Town','*','WRITE','ALLOW','ROLE','deliveryBoss'), -(239,'Province','*','WRITE','ALLOW','ROLE','deliveryBoss'), -(240,'supplier','*','WRITE','ALLOW','ROLE','administrative'), -(241,'SupplierContact','*','WRITE','ALLOW','ROLE','administrative'), -(242,'supplier','*','WRITE','ALLOW','ROLE','administrative'), -(244,'supplier','*','WRITE','ALLOW','ROLE','administrative'), -(246,'Account','changePassword','*','ALLOW','ROLE','account'), -(247,'UserAccount','exists','*','ALLOW','ROLE','account'), -(248,'RoleMapping','*','READ','ALLOW','ROLE','account'), -(249,'UserPassword','*','READ','ALLOW','ROLE','account'), -(250,'Town','*','WRITE','ALLOW','ROLE','deliveryBoss'), -(251,'Province','*','WRITE','ALLOW','ROLE','deliveryBoss'), -(252,'Supplier','*','READ','ALLOW','ROLE','employee'), -(253,'Supplier','*','WRITE','ALLOW','ROLE','administrative'), -(254,'SupplierLog','*','READ','ALLOW','ROLE','employee'), -(256,'Image','*','WRITE','ALLOW','ROLE','employee'), -(257,'FixedPrice','*','*','ALLOW','ROLE','buyer'), -(258,'PayDem','*','READ','ALLOW','ROLE','employee'), -(259,'Client','createReceipt','*','ALLOW','ROLE','salesAssistant'), -(260,'PrintServerQueue','*','WRITE','ALLOW','ROLE','employee'), -(261,'SupplierAccount','*','*','ALLOW','ROLE','administrative'), -(262,'Entry','*','*','ALLOW','ROLE','administrative'), -(263,'InvoiceIn','*','*','ALLOW','ROLE','administrative'), -(264,'StarredModule','*','*','ALLOW','ROLE','employee'), -(265,'ItemBotanical','*','WRITE','ALLOW','ROLE','logisticBoss'), -(266,'ZoneLog','*','READ','ALLOW','ROLE','employee'), -(267,'Genus','*','WRITE','ALLOW','ROLE','logisticBoss'), -(268,'Specie','*','WRITE','ALLOW','ROLE','logisticBoss'), -(269,'InvoiceOut','createPdf','WRITE','ALLOW','ROLE','employee'), -(270,'SupplierAddress','*','*','ALLOW','ROLE','employee'), -(271,'SalesMonitor','*','*','ALLOW','ROLE','employee'), -(272,'InvoiceInLog','*','*','ALLOW','ROLE','employee'), -(273,'InvoiceInTax','*','*','ALLOW','ROLE','administrative'), -(274,'InvoiceInLog','*','READ','ALLOW','ROLE','administrative'), -(275,'InvoiceOut','createManualInvoice','WRITE','ALLOW','ROLE','invoicing'), -(276,'InvoiceOut','globalInvoicing','WRITE','ALLOW','ROLE','invoicing'), -(277,'Role','*','*','ALLOW','ROLE','it'), -(278,'RoleInherit','*','WRITE','ALLOW','ROLE','grant'), -(279,'MailAlias','*','*','ALLOW','ROLE','marketing'), -(282,'UserAccount','*','WRITE','ALLOW','ROLE','it'), -(283,'EntryObservation','*','*','ALLOW','ROLE','buyer'), -(284,'LdapConfig','*','*','ALLOW','ROLE','sysadmin'), -(285,'SambaConfig','*','*','ALLOW','ROLE','sysadmin'), -(286,'ACL','*','*','ALLOW','ROLE','developer'), -(287,'AccessToken','*','*','ALLOW','ROLE','developer'), -(288,'MailAliasAccount','*','*','ALLOW','ROLE','marketing'), -(289,'MailAliasAccount','*','*','ALLOW','ROLE','hr'), -(290,'MailAlias','*','*','ALLOW','ROLE','hr'), -(291,'MailForward','*','*','ALLOW','ROLE','marketing'), -(292,'MailForward','*','*','ALLOW','ROLE','hr'), -(293,'RoleInherit','*','*','ALLOW','ROLE','it'), -(294,'RoleRole','*','*','ALLOW','ROLE','it'), -(295,'AccountConfig','*','*','ALLOW','ROLE','sysadmin'), -(296,'Collection','*','READ','ALLOW','ROLE','employee'), -(297,'Sale','refund','WRITE','ALLOW','ROLE','invoicing'), -(298,'InvoiceInDueDay','*','*','ALLOW','ROLE','administrative'), -(299,'Collection','setSaleQuantity','*','ALLOW','ROLE','employee'), -(300,'Docuware','*','*','ALLOW','ROLE','employee'), -(301,'Agency','*','READ','ALLOW','ROLE','employee'), -(302,'AgencyTerm','*','*','ALLOW','ROLE','administrative'), -(303,'ClaimLog','*','READ','ALLOW','ROLE','claimManager'), -(304,'Edi','updateData','WRITE','ALLOW','ROLE','employee'), -(305,'EducationLevel','*','*','ALLOW','ROLE','employee'), -(306,'InvoiceInIntrastat','*','*','ALLOW','ROLE','employee'), -(307,'SupplierAgencyTerm','*','*','ALLOW','ROLE','administrative'), -(308,'InvoiceInIntrastat','*','*','ALLOW','ROLE','employee'), -(309,'Zone','getZoneClosing','*','ALLOW','ROLE','employee'), -(310,'ExpeditionState','*','READ','ALLOW','ROLE','employee'), -(311,'Expense','*','READ','ALLOW','ROLE','employee'), -(312,'Expense','*','WRITE','ALLOW','ROLE','administrative'), -(314,'SupplierActivity','*','READ','ALLOW','ROLE','employee'), -(315,'SupplierActivity','*','WRITE','ALLOW','ROLE','administrative'), -(316,'Dms','deleteTrashFiles','WRITE','ALLOW','ROLE','employee'), -(317,'ClientUnpaid','*','*','ALLOW','ROLE','administrative'), -(318,'MdbVersion','*','*','ALLOW','ROLE','developer'), -(319,'ItemType','*','READ','ALLOW','ROLE','employee'), -(320,'ItemType','*','WRITE','ALLOW','ROLE','buyer'), -(321,'InvoiceOut','refund','WRITE','ALLOW','ROLE','invoicing'), -(322,'InvoiceOut','refund','WRITE','ALLOW','ROLE','salesAssistant'), -(323,'InvoiceOut','refund','WRITE','ALLOW','ROLE','claimManager'), -(324,'Ticket','refund','WRITE','ALLOW','ROLE','invoicing'), -(325,'Ticket','refund','WRITE','ALLOW','ROLE','salesAssistant'), -(326,'Ticket','refund','WRITE','ALLOW','ROLE','claimManager'), -(327,'Sale','refund','WRITE','ALLOW','ROLE','salesAssistant'), -(328,'Sale','refund','WRITE','ALLOW','ROLE','claimManager'), -(329,'TicketRefund','*','WRITE','ALLOW','ROLE','invoicing'), -(330,'ClaimObservation','*','WRITE','ALLOW','ROLE','salesPerson'), -(331,'ClaimObservation','*','READ','ALLOW','ROLE','salesPerson'), -(332,'Client','setPassword','WRITE','ALLOW','ROLE','salesPerson'), -(333,'Client','updateUser','WRITE','ALLOW','ROLE','salesPerson'), -(334,'ShelvingLog','*','READ','ALLOW','ROLE','employee'), -(335,'ZoneExclusionGeo','*','READ','ALLOW','ROLE','employee'), -(336,'ZoneExclusionGeo','*','WRITE','ALLOW','ROLE','deliveryBoss'), -(337,'Parking','*','*','ALLOW','ROLE','employee'), -(338,'Shelving','*','*','ALLOW','ROLE','employee'), -(339,'OsTicket','*','*','ALLOW','ROLE','employee'), -(340,'OsTicketConfig','*','*','ALLOW','ROLE','it'), -(341,'ClientConsumptionQueue','*','WRITE','ALLOW','ROLE','employee'), -(342,'Ticket','deliveryNotePdf','READ','ALLOW','ROLE','employee'), -(343,'Ticket','deliveryNoteEmail','WRITE','ALLOW','ROLE','employee'), -(344,'Ticket','deliveryNoteCsvPdf','READ','ALLOW','ROLE','employee'), -(345,'Ticket','deliveryNoteCsvEmail','WRITE','ALLOW','ROLE','employee'), -(346,'Client','campaignMetricsPdf','READ','ALLOW','ROLE','employee'), -(347,'Client','campaignMetricsEmail','WRITE','ALLOW','ROLE','employee'), -(348,'Client','clientWelcomeHtml','READ','ALLOW','ROLE','employee'), -(349,'Client','clientWelcomeEmail','WRITE','ALLOW','ROLE','employee'), -(350,'Client','creditRequestPdf','READ','ALLOW','ROLE','employee'), -(351,'Client','creditRequestHtml','READ','ALLOW','ROLE','employee'), -(352,'Client','creditRequestEmail','WRITE','ALLOW','ROLE','employee'), -(353,'Client','printerSetupHtml','READ','ALLOW','ROLE','employee'), -(354,'Client','printerSetupEmail','WRITE','ALLOW','ROLE','employee'), -(355,'Client','sepaCoreEmail','WRITE','ALLOW','ROLE','employee'), -(356,'Client','letterDebtorPdf','READ','ALLOW','ROLE','employee'), -(357,'Client','letterDebtorStHtml','READ','ALLOW','ROLE','employee'), -(358,'Client','letterDebtorStEmail','WRITE','ALLOW','ROLE','employee'), -(359,'Client','letterDebtorNdHtml','READ','ALLOW','ROLE','employee'), -(360,'Client','letterDebtorNdEmail','WRITE','ALLOW','ROLE','employee'), -(361,'Client','clientDebtStatementPdf','READ','ALLOW','ROLE','employee'), -(362,'Client','clientDebtStatementHtml','READ','ALLOW','ROLE','employee'), -(363,'Client','clientDebtStatementEmail','WRITE','ALLOW','ROLE','employee'), -(364,'Client','incotermsAuthorizationPdf','READ','ALLOW','ROLE','employee'), -(365,'Client','incotermsAuthorizationHtml','READ','ALLOW','ROLE','employee'), -(366,'Client','incotermsAuthorizationEmail','WRITE','ALLOW','ROLE','employee'), -(367,'Client','consumptionSendQueued','WRITE','ALLOW','ROLE','system'), -(368,'InvoiceOut','invoiceEmail','WRITE','ALLOW','ROLE','employee'), -(369,'InvoiceOut','exportationPdf','READ','ALLOW','ROLE','employee'), -(370,'InvoiceOut','sendQueued','WRITE','ALLOW','ROLE','system'), -(371,'Ticket','invoiceCsvPdf','READ','ALLOW','ROLE','employee'), -(372,'Ticket','invoiceCsvEmail','WRITE','ALLOW','ROLE','employee'), -(373,'Supplier','campaignMetricsPdf','READ','ALLOW','ROLE','employee'), -(374,'Supplier','campaignMetricsEmail','WRITE','ALLOW','ROLE','employee'), -(375,'Travel','extraCommunityPdf','READ','ALLOW','ROLE','employee'), -(376,'Travel','extraCommunityEmail','WRITE','ALLOW','ROLE','employee'), -(377,'Entry','entryOrderPdf','READ','ALLOW','ROLE','employee'), -(378,'OsTicket','osTicketReportEmail','WRITE','ALLOW','ROLE','system'), -(379,'Item','buyerWasteEmail','WRITE','ALLOW','ROLE','system'), -(380,'Claim','claimPickupPdf','READ','ALLOW','ROLE','employee'), -(381,'Claim','claimPickupEmail','WRITE','ALLOW','ROLE','claimManager'), -(382,'Item','labelPdf','READ','ALLOW','ROLE','employee'), -(383,'Sector','*','READ','ALLOW','ROLE','employee'), -(384,'Sector','*','WRITE','ALLOW','ROLE','employee'), -(385,'Route','driverRoutePdf','READ','ALLOW','ROLE','employee'), -(386,'Route','driverRouteEmail','WRITE','ALLOW','ROLE','employee'), -(387,'Ticket','deliveryNotePdf','READ','ALLOW','ROLE','customer'), -(388,'Supplier','newSupplier','WRITE','ALLOW','ROLE','administrative'), -(389,'ClaimRma','*','READ','ALLOW','ROLE','claimManager'), -(390,'ClaimRma','*','WRITE','ALLOW','ROLE','claimManager'), -(391,'Notification','*','WRITE','ALLOW','ROLE','system'), -(392,'Boxing','*','*','ALLOW','ROLE','employee'), -(393,'Url','*','READ','ALLOW','ROLE','employee'), -(394,'Url','*','WRITE','ALLOW','ROLE','it'), -(395,'ItemShelving','*','READ','ALLOW','ROLE','employee'), -(396,'ItemShelving','*','WRITE','ALLOW','ROLE','production'), -(397,'ItemShelvingPlacementSupplyStock','*','READ','ALLOW','ROLE','employee'), -(407, 'ZipConfig', '*', '*', 'ALLOW', 'ROLE', 'employee'); +INSERT INTO `ACL` VALUES (1,'Account','*','*','ALLOW','ROLE','employee'),(3,'Address','*','*','ALLOW','ROLE','employee'),(5,'AgencyService','*','READ','ALLOW','ROLE','employee'),(7,'Client','*','*','ALLOW','ROLE','employee'),(9,'ClientObservation','*','*','ALLOW','ROLE','employee'),(11,'ContactChannel','*','READ','ALLOW','ROLE','trainee'),(13,'Employee','*','READ','ALLOW','ROLE','employee'),(14,'PayMethod','*','READ','ALLOW','ROLE','trainee'),(16,'FakeProduction','*','READ','ALLOW','ROLE','employee'),(17,'Warehouse','* ','READ','ALLOW','ROLE','trainee'),(18,'State','*','READ','ALLOW','ROLE','employee'),(20,'TicketState','*','*','ALLOW','ROLE','employee'),(24,'Delivery','*','READ','ALLOW','ROLE','employee'),(25,'Zone','*','READ','ALLOW','ROLE','employee'),(26,'ClientCredit','*','*','ALLOW','ROLE','employee'),(27,'ClientCreditLimit','*','READ','ALLOW','ROLE','trainee'),(30,'GreugeType','*','READ','ALLOW','ROLE','trainee'),(31,'Mandate','*','READ','ALLOW','ROLE','trainee'),(32,'MandateType','*','READ','ALLOW','ROLE','trainee'),(33,'Company','*','READ','ALLOW','ROLE','trainee'),(34,'Greuge','*','READ','ALLOW','ROLE','trainee'),(35,'AddressObservation','*','*','ALLOW','ROLE','employee'),(36,'ObservationType','*','*','ALLOW','ROLE','employee'),(37,'Greuge','*','WRITE','ALLOW','ROLE','employee'),(38,'AgencyMode','*','READ','ALLOW','ROLE','employee'),(39,'ItemTag','*','WRITE','ALLOW','ROLE','buyer'),(40,'ItemBotanical','*','WRITE','ALLOW','ROLE','buyer'),(41,'ItemBotanical','*','READ','ALLOW','ROLE','employee'),(42,'ItemPlacement','*','WRITE','ALLOW','ROLE','buyer'),(43,'ItemPlacement','*','WRITE','ALLOW','ROLE','replenisher'),(44,'ItemPlacement','*','READ','ALLOW','ROLE','employee'),(45,'ItemBarcode','*','READ','ALLOW','ROLE','employee'),(46,'ItemBarcode','*','WRITE','ALLOW','ROLE','buyer'),(47,'ItemBarcode','*','WRITE','ALLOW','ROLE','replenisher'),(51,'ItemTag','*','READ','ALLOW','ROLE','employee'),(53,'Item','*','READ','ALLOW','ROLE','employee'),(54,'Item','*','WRITE','ALLOW','ROLE','buyer'),(55,'Recovery','*','READ','ALLOW','ROLE','trainee'),(56,'Recovery','*','WRITE','ALLOW','ROLE','administrative'),(58,'CreditClassification','*','*','ALLOW','ROLE','insurance'),(60,'CreditInsurance','*','*','ALLOW','ROLE','insurance'),(61,'InvoiceOut','*','READ','ALLOW','ROLE','employee'),(62,'Ticket','*','*','ALLOW','ROLE','employee'),(63,'TicketObservation','*','*','ALLOW','ROLE','employee'),(64,'Route','*','READ','ALLOW','ROLE','employee'),(65,'Sale','*','READ','ALLOW','ROLE','employee'),(66,'TicketTracking','*','READ','ALLOW','ROLE','employee'),(68,'TicketPackaging','*','*','ALLOW','ROLE','employee'),(69,'Packaging','*','READ','ALLOW','ROLE','employee'),(70,'Packaging','*','WRITE','ALLOW','ROLE','logistic'),(72,'SaleComponent','*','READ','ALLOW','ROLE','employee'),(73,'Expedition','*','READ','ALLOW','ROLE','employee'),(74,'Expedition','*','WRITE','ALLOW','ROLE','deliveryBoss'),(75,'Expedition','*','WRITE','ALLOW','ROLE','production'),(76,'AnnualAverageInvoiced','*','READ','ALLOW','ROLE','employee'),(77,'WorkerMana','*','READ','ALLOW','ROLE','employee'),(78,'TicketTracking','*','WRITE','ALLOW','ROLE','production'),(79,'TicketTracking','changeState','*','ALLOW','ROLE','employee'),(80,'Sale','deleteSales','*','ALLOW','ROLE','employee'),(81,'Sale','moveToTicket','*','ALLOW','ROLE','employee'),(82,'Sale','updateQuantity','*','ALLOW','ROLE','employee'),(83,'Sale','updatePrice','*','ALLOW','ROLE','employee'),(84,'Sale','updateDiscount','*','ALLOW','ROLE','employee'),(85,'SaleTracking','*','READ','ALLOW','ROLE','employee'),(86,'Order','*','*','ALLOW','ROLE','employee'),(87,'OrderRow','*','*','ALLOW','ROLE','employee'),(88,'ClientContact','*','*','ALLOW','ROLE','employee'),(89,'Sale','moveToNewTicket','*','ALLOW','ROLE','employee'),(90,'Sale','reserve','*','ALLOW','ROLE','employee'),(91,'TicketWeekly','*','READ','ALLOW','ROLE','employee'),(94,'Agency','landsThatDay','*','ALLOW','ROLE','employee'),(96,'ClaimEnd','*','READ','ALLOW','ROLE','employee'),(97,'ClaimEnd','*','WRITE','ALLOW','ROLE','claimManager'),(98,'ClaimBeginning','*','*','ALLOW','ROLE','employee'),(99,'ClaimDevelopment','*','READ','ALLOW','ROLE','employee'),(100,'ClaimDevelopment','*','WRITE','ALLOW','ROLE','claimManager'),(101,'Claim','*','*','ALLOW','ROLE','employee'),(102,'Claim','createFromSales','*','ALLOW','ROLE','employee'),(104,'Item','*','WRITE','ALLOW','ROLE','marketingBoss'),(105,'ItemBarcode','*','WRITE','ALLOW','ROLE','marketingBoss'),(106,'ItemBotanical','*','WRITE','ALLOW','ROLE','marketingBoss'),(108,'ItemPlacement','*','WRITE','ALLOW','ROLE','marketingBoss'),(109,'UserConfig','*','*','ALLOW','ROLE','employee'),(110,'Bank','*','READ','ALLOW','ROLE','trainee'),(111,'ClientLog','*','READ','ALLOW','ROLE','trainee'),(112,'Defaulter','*','READ','ALLOW','ROLE','employee'),(113,'ClientRisk','*','READ','ALLOW','ROLE','trainee'),(114,'Receipt','*','READ','ALLOW','ROLE','trainee'),(115,'Receipt','*','WRITE','ALLOW','ROLE','administrative'),(116,'BankEntity','*','*','ALLOW','ROLE','employee'),(117,'ClientSample','*','*','ALLOW','ROLE','employee'),(118,'WorkerTeam','*','*','ALLOW','ROLE','salesPerson'),(119,'Travel','*','READ','ALLOW','ROLE','employee'),(120,'Travel','*','WRITE','ALLOW','ROLE','buyer'),(121,'Item','regularize','*','ALLOW','ROLE','employee'),(122,'TicketRequest','*','*','ALLOW','ROLE','employee'),(123,'Worker','*','READ','ALLOW','ROLE','employee'),(124,'Client','confirmTransaction','WRITE','ALLOW','ROLE','administrative'),(125,'Agency','getAgenciesWithWarehouse','*','ALLOW','ROLE','employee'),(126,'Client','activeWorkersWithRole','*','ALLOW','ROLE','employee'),(127,'TicketLog','*','READ','ALLOW','ROLE','employee'),(129,'TicketService','*','*','ALLOW','ROLE','employee'),(130,'Expedition','*','WRITE','ALLOW','ROLE','packager'),(131,'CreditInsurance','*','READ','ALLOW','ROLE','trainee'),(132,'CreditClassification','*','READ','ALLOW','ROLE','trainee'),(133,'ItemTag','*','WRITE','ALLOW','ROLE','marketingBoss'),(135,'ZoneGeo','*','READ','ALLOW','ROLE','employee'),(136,'ZoneCalendar','*','READ','ALLOW','ROLE','employee'),(137,'ZoneIncluded','*','READ','ALLOW','ROLE','employee'),(138,'LabourHoliday','*','READ','ALLOW','ROLE','employee'),(139,'LabourHolidayLegend','*','READ','ALLOW','ROLE','employee'),(140,'LabourHolidayType','*','READ','ALLOW','ROLE','employee'),(141,'Zone','*','*','ALLOW','ROLE','deliveryBoss'),(142,'ZoneCalendar','*','WRITE','ALLOW','ROLE','deliveryBoss'),(143,'ZoneIncluded','*','*','ALLOW','ROLE','deliveryBoss'),(144,'Stowaway','*','*','ALLOW','ROLE','employee'),(145,'Ticket','getPossibleStowaways','READ','ALLOW','ROLE','employee'),(147,'UserConfigView','*','*','ALLOW','ROLE','employee'),(148,'UserConfigView','*','*','ALLOW','ROLE','employee'),(149,'Sip','*','READ','ALLOW','ROLE','employee'),(150,'Sip','*','WRITE','ALLOW','ROLE','hr'),(151,'Department','*','READ','ALLOW','ROLE','employee'),(152,'Department','*','WRITE','ALLOW','ROLE','hr'),(153,'Route','*','READ','ALLOW','ROLE','employee'),(154,'Route','*','WRITE','ALLOW','ROLE','delivery'),(155,'Calendar','*','READ','ALLOW','ROLE','hr'),(156,'WorkerLabour','*','READ','ALLOW','ROLE','hr'),(157,'Calendar','absences','READ','ALLOW','ROLE','employee'),(158,'ItemTag','*','WRITE','ALLOW','ROLE','accessory'),(160,'TicketServiceType','*','READ','ALLOW','ROLE','employee'),(161,'TicketConfig','*','READ','ALLOW','ROLE','employee'),(162,'InvoiceOut','delete','WRITE','ALLOW','ROLE','invoicing'),(163,'InvoiceOut','book','WRITE','ALLOW','ROLE','invoicing'),(165,'TicketDms','*','*','ALLOW','ROLE','employee'),(167,'Worker','isSubordinate','READ','ALLOW','ROLE','employee'),(168,'Worker','mySubordinates','READ','ALLOW','ROLE','employee'),(169,'WorkerTimeControl','filter','READ','ALLOW','ROLE','employee'),(170,'WorkerTimeControl','addTime','WRITE','ALLOW','ROLE','employee'),(171,'TicketServiceType','*','WRITE','ALLOW','ROLE','administrative'),(172,'Sms','*','READ','ALLOW','ROLE','employee'),(173,'Sms','send','WRITE','ALLOW','ROLE','employee'),(174,'Agency','getLanded','READ','ALLOW','ROLE','employee'),(175,'Agency','getShipped','READ','ALLOW','ROLE','employee'),(176,'Device','*','*','ALLOW','ROLE','employee'),(177,'Device','*','*','ALLOW','ROLE','employee'),(178,'WorkerTimeControl','*','*','ALLOW','ROLE','employee'),(179,'ItemLog','*','READ','ALLOW','ROLE','employee'),(180,'RouteLog','*','READ','ALLOW','ROLE','employee'),(181,'Dms','removeFile','WRITE','ALLOW','ROLE','employee'),(182,'Dms','uploadFile','WRITE','ALLOW','ROLE','employee'),(183,'Dms','downloadFile','READ','ALLOW','ROLE','employee'),(184,'Client','uploadFile','WRITE','ALLOW','ROLE','employee'),(185,'ClientDms','removeFile','WRITE','ALLOW','ROLE','employee'),(186,'ClientDms','*','READ','ALLOW','ROLE','trainee'),(187,'Ticket','uploadFile','WRITE','ALLOW','ROLE','employee'),(190,'Route','updateVolume','WRITE','ALLOW','ROLE','deliveryBoss'),(191,'Agency','getLanded','READ','ALLOW','ROLE','employee'),(192,'Agency','getShipped','READ','ALLOW','ROLE','employee'),(194,'Postcode','*','WRITE','ALLOW','ROLE','deliveryBoss'),(195,'Ticket','addSale','WRITE','ALLOW','ROLE','employee'),(196,'Dms','updateFile','WRITE','ALLOW','ROLE','employee'),(197,'Dms','*','READ','ALLOW','ROLE','trainee'),(198,'ClaimDms','removeFile','WRITE','ALLOW','ROLE','employee'),(199,'ClaimDms','*','READ','ALLOW','ROLE','employee'),(200,'Claim','uploadFile','WRITE','ALLOW','ROLE','employee'),(201,'Sale','updateConcept','WRITE','ALLOW','ROLE','employee'),(202,'Claim','updateClaimAction','WRITE','ALLOW','ROLE','claimManager'),(203,'UserPhone','*','*','ALLOW','ROLE','employee'),(204,'WorkerDms','removeFile','WRITE','ALLOW','ROLE','hr'),(205,'WorkerDms','*','READ','ALLOW','ROLE','hr'),(206,'Chat','*','*','ALLOW','ROLE','employee'),(207,'Chat','sendMessage','*','ALLOW','ROLE','employee'),(208,'Sale','recalculatePrice','WRITE','ALLOW','ROLE','employee'),(209,'Ticket','recalculateComponents','WRITE','ALLOW','ROLE','employee'),(211,'TravelLog','*','READ','ALLOW','ROLE','buyer'),(212,'Thermograph','*','*','ALLOW','ROLE','buyer'),(213,'TravelThermograph','*','WRITE','ALLOW','ROLE','buyer'),(214,'Entry','*','*','ALLOW','ROLE','buyer'),(215,'TicketWeekly','*','WRITE','ALLOW','ROLE','buyer'),(216,'TravelThermograph','*','READ','ALLOW','ROLE','employee'),(218,'Intrastat','*','*','ALLOW','ROLE','buyer'),(219,'Account','acl','READ','ALLOW','ROLE','account'),(220,'Account','getCurrentUserData','READ','ALLOW','ROLE','account'),(221,'UserConfig','getUserConfig','READ','ALLOW','ROLE','account'),(222,'Client','*','READ','ALLOW','ROLE','trainee'),(226,'ClientObservation','*','READ','ALLOW','ROLE','trainee'),(227,'Address','*','READ','ALLOW','ROLE','trainee'),(228,'AddressObservation','*','READ','ALLOW','ROLE','trainee'),(230,'ClientCredit','*','READ','ALLOW','ROLE','trainee'),(231,'ClientContact','*','READ','ALLOW','ROLE','trainee'),(232,'ClientSample','*','READ','ALLOW','ROLE','trainee'),(233,'EntryLog','*','READ','ALLOW','ROLE','buyer'),(234,'WorkerLog','*','READ','ALLOW','ROLE','salesAssistant'),(235,'CustomsAgent','*','*','ALLOW','ROLE','employee'),(236,'Buy','*','*','ALLOW','ROLE','buyer'),(237,'WorkerDms','filter','*','ALLOW','ROLE','employee'),(238,'Town','*','WRITE','ALLOW','ROLE','deliveryBoss'),(239,'Province','*','WRITE','ALLOW','ROLE','deliveryBoss'),(240,'supplier','*','WRITE','ALLOW','ROLE','administrative'),(241,'SupplierContact','*','WRITE','ALLOW','ROLE','administrative'),(242,'supplier','*','WRITE','ALLOW','ROLE','administrative'),(244,'supplier','*','WRITE','ALLOW','ROLE','administrative'),(246,'Account','changePassword','*','ALLOW','ROLE','account'),(247,'UserAccount','exists','*','ALLOW','ROLE','account'),(248,'RoleMapping','*','READ','ALLOW','ROLE','account'),(249,'UserPassword','*','READ','ALLOW','ROLE','account'),(250,'Town','*','WRITE','ALLOW','ROLE','deliveryBoss'),(251,'Province','*','WRITE','ALLOW','ROLE','deliveryBoss'),(252,'Supplier','*','READ','ALLOW','ROLE','employee'),(253,'Supplier','*','WRITE','ALLOW','ROLE','administrative'),(254,'SupplierLog','*','READ','ALLOW','ROLE','employee'),(256,'Image','*','WRITE','ALLOW','ROLE','employee'),(257,'FixedPrice','*','*','ALLOW','ROLE','buyer'),(258,'PayDem','*','READ','ALLOW','ROLE','employee'),(259,'Client','createReceipt','*','ALLOW','ROLE','salesAssistant'),(260,'PrintServerQueue','*','WRITE','ALLOW','ROLE','employee'),(261,'SupplierAccount','*','*','ALLOW','ROLE','administrative'),(262,'Entry','*','*','ALLOW','ROLE','administrative'),(263,'InvoiceIn','*','*','ALLOW','ROLE','administrative'),(264,'StarredModule','*','*','ALLOW','ROLE','employee'),(265,'ItemBotanical','*','WRITE','ALLOW','ROLE','logisticBoss'),(266,'ZoneLog','*','READ','ALLOW','ROLE','employee'),(267,'Genus','*','WRITE','ALLOW','ROLE','logisticBoss'),(268,'Specie','*','WRITE','ALLOW','ROLE','logisticBoss'),(269,'InvoiceOut','createPdf','WRITE','ALLOW','ROLE','employee'),(270,'SupplierAddress','*','*','ALLOW','ROLE','employee'),(271,'SalesMonitor','*','*','ALLOW','ROLE','employee'),(272,'InvoiceInLog','*','*','ALLOW','ROLE','employee'),(273,'InvoiceInTax','*','*','ALLOW','ROLE','administrative'),(274,'InvoiceInLog','*','READ','ALLOW','ROLE','administrative'),(275,'InvoiceOut','createManualInvoice','WRITE','ALLOW','ROLE','invoicing'),(276,'InvoiceOut','globalInvoicing','WRITE','ALLOW','ROLE','invoicing'),(277,'Role','*','*','ALLOW','ROLE','it'),(278,'RoleInherit','*','WRITE','ALLOW','ROLE','grant'),(279,'MailAlias','*','*','ALLOW','ROLE','marketing'),(282,'UserAccount','*','WRITE','ALLOW','ROLE','it'),(283,'EntryObservation','*','*','ALLOW','ROLE','buyer'),(284,'LdapConfig','*','*','ALLOW','ROLE','sysadmin'),(285,'SambaConfig','*','*','ALLOW','ROLE','sysadmin'),(286,'ACL','*','*','ALLOW','ROLE','developer'),(287,'AccessToken','*','*','ALLOW','ROLE','developer'),(288,'MailAliasAccount','*','*','ALLOW','ROLE','marketing'),(289,'MailAliasAccount','*','*','ALLOW','ROLE','hr'),(290,'MailAlias','*','*','ALLOW','ROLE','hr'),(291,'MailForward','*','*','ALLOW','ROLE','marketing'),(292,'MailForward','*','*','ALLOW','ROLE','hr'),(293,'RoleInherit','*','*','ALLOW','ROLE','it'),(294,'RoleRole','*','*','ALLOW','ROLE','it'),(295,'AccountConfig','*','*','ALLOW','ROLE','sysadmin'),(296,'Collection','*','READ','ALLOW','ROLE','employee'),(297,'Sale','refund','WRITE','ALLOW','ROLE','invoicing'),(298,'InvoiceInDueDay','*','*','ALLOW','ROLE','administrative'),(299,'Collection','setSaleQuantity','*','ALLOW','ROLE','employee'),(300,'Docuware','*','*','ALLOW','ROLE','employee'),(301,'Agency','*','READ','ALLOW','ROLE','employee'),(302,'AgencyTerm','*','*','ALLOW','ROLE','administrative'),(303,'ClaimLog','*','READ','ALLOW','ROLE','claimManager'),(304,'Edi','updateData','WRITE','ALLOW','ROLE','employee'),(305,'EducationLevel','*','*','ALLOW','ROLE','employee'),(306,'InvoiceInIntrastat','*','*','ALLOW','ROLE','employee'),(307,'SupplierAgencyTerm','*','*','ALLOW','ROLE','administrative'),(308,'InvoiceInIntrastat','*','*','ALLOW','ROLE','employee'),(309,'Zone','getZoneClosing','*','ALLOW','ROLE','employee'),(310,'ExpeditionState','*','READ','ALLOW','ROLE','employee'),(311,'Expense','*','READ','ALLOW','ROLE','employee'),(312,'Expense','*','WRITE','ALLOW','ROLE','administrative'),(314,'SupplierActivity','*','READ','ALLOW','ROLE','employee'),(315,'SupplierActivity','*','WRITE','ALLOW','ROLE','administrative'),(316,'Dms','deleteTrashFiles','WRITE','ALLOW','ROLE','employee'),(317,'ClientUnpaid','*','*','ALLOW','ROLE','administrative'),(318,'MdbVersion','*','*','ALLOW','ROLE','developer'),(319,'ItemType','*','READ','ALLOW','ROLE','employee'),(320,'ItemType','*','WRITE','ALLOW','ROLE','buyer'),(321,'InvoiceOut','refund','WRITE','ALLOW','ROLE','invoicing'),(322,'InvoiceOut','refund','WRITE','ALLOW','ROLE','salesAssistant'),(323,'InvoiceOut','refund','WRITE','ALLOW','ROLE','claimManager'),(324,'Ticket','refund','WRITE','ALLOW','ROLE','invoicing'),(325,'Ticket','refund','WRITE','ALLOW','ROLE','salesAssistant'),(326,'Ticket','refund','WRITE','ALLOW','ROLE','claimManager'),(327,'Sale','refund','WRITE','ALLOW','ROLE','salesAssistant'),(328,'Sale','refund','WRITE','ALLOW','ROLE','claimManager'),(329,'TicketRefund','*','WRITE','ALLOW','ROLE','invoicing'),(330,'ClaimObservation','*','WRITE','ALLOW','ROLE','salesPerson'),(331,'ClaimObservation','*','READ','ALLOW','ROLE','salesPerson'),(332,'Client','setPassword','WRITE','ALLOW','ROLE','salesPerson'),(333,'Client','updateUser','WRITE','ALLOW','ROLE','salesPerson'),(334,'ShelvingLog','*','READ','ALLOW','ROLE','employee'),(335,'ZoneExclusionGeo','*','READ','ALLOW','ROLE','employee'),(336,'ZoneExclusionGeo','*','WRITE','ALLOW','ROLE','deliveryBoss'),(337,'Parking','*','*','ALLOW','ROLE','employee'),(338,'Shelving','*','*','ALLOW','ROLE','employee'),(339,'OsTicket','*','*','ALLOW','ROLE','employee'),(340,'OsTicketConfig','*','*','ALLOW','ROLE','it'),(341,'ClientConsumptionQueue','*','WRITE','ALLOW','ROLE','employee'),(342,'Ticket','deliveryNotePdf','READ','ALLOW','ROLE','employee'),(343,'Ticket','deliveryNoteEmail','WRITE','ALLOW','ROLE','employee'),(344,'Ticket','deliveryNoteCsvPdf','READ','ALLOW','ROLE','employee'),(345,'Ticket','deliveryNoteCsvEmail','WRITE','ALLOW','ROLE','employee'),(346,'Client','campaignMetricsPdf','READ','ALLOW','ROLE','employee'),(347,'Client','campaignMetricsEmail','WRITE','ALLOW','ROLE','employee'),(348,'Client','clientWelcomeHtml','READ','ALLOW','ROLE','employee'),(349,'Client','clientWelcomeEmail','WRITE','ALLOW','ROLE','employee'),(350,'Client','creditRequestPdf','READ','ALLOW','ROLE','employee'),(351,'Client','creditRequestHtml','READ','ALLOW','ROLE','employee'),(352,'Client','creditRequestEmail','WRITE','ALLOW','ROLE','employee'),(353,'Client','printerSetupHtml','READ','ALLOW','ROLE','employee'),(354,'Client','printerSetupEmail','WRITE','ALLOW','ROLE','employee'),(355,'Client','sepaCoreEmail','WRITE','ALLOW','ROLE','employee'),(356,'Client','letterDebtorPdf','READ','ALLOW','ROLE','employee'),(357,'Client','letterDebtorStHtml','READ','ALLOW','ROLE','employee'),(358,'Client','letterDebtorStEmail','WRITE','ALLOW','ROLE','employee'),(359,'Client','letterDebtorNdHtml','READ','ALLOW','ROLE','employee'),(360,'Client','letterDebtorNdEmail','WRITE','ALLOW','ROLE','employee'),(361,'Client','clientDebtStatementPdf','READ','ALLOW','ROLE','employee'),(362,'Client','clientDebtStatementHtml','READ','ALLOW','ROLE','employee'),(363,'Client','clientDebtStatementEmail','WRITE','ALLOW','ROLE','employee'),(364,'Client','incotermsAuthorizationPdf','READ','ALLOW','ROLE','employee'),(365,'Client','incotermsAuthorizationHtml','READ','ALLOW','ROLE','employee'),(366,'Client','incotermsAuthorizationEmail','WRITE','ALLOW','ROLE','employee'),(367,'Client','consumptionSendQueued','WRITE','ALLOW','ROLE','system'),(368,'InvoiceOut','invoiceEmail','WRITE','ALLOW','ROLE','employee'),(369,'InvoiceOut','exportationPdf','READ','ALLOW','ROLE','employee'),(370,'InvoiceOut','sendQueued','WRITE','ALLOW','ROLE','system'),(371,'Ticket','invoiceCsvPdf','READ','ALLOW','ROLE','employee'),(372,'Ticket','invoiceCsvEmail','WRITE','ALLOW','ROLE','employee'),(373,'Supplier','campaignMetricsPdf','READ','ALLOW','ROLE','employee'),(374,'Supplier','campaignMetricsEmail','WRITE','ALLOW','ROLE','employee'),(375,'Travel','extraCommunityPdf','READ','ALLOW','ROLE','employee'),(376,'Travel','extraCommunityEmail','WRITE','ALLOW','ROLE','employee'),(377,'Entry','entryOrderPdf','READ','ALLOW','ROLE','employee'),(378,'OsTicket','osTicketReportEmail','WRITE','ALLOW','ROLE','system'),(379,'Item','buyerWasteEmail','WRITE','ALLOW','ROLE','system'),(380,'Claim','claimPickupPdf','READ','ALLOW','ROLE','employee'),(381,'Claim','claimPickupEmail','WRITE','ALLOW','ROLE','claimManager'),(382,'Item','labelPdf','READ','ALLOW','ROLE','employee'),(383,'Sector','*','READ','ALLOW','ROLE','employee'),(384,'Sector','*','WRITE','ALLOW','ROLE','employee'),(385,'Route','driverRoutePdf','READ','ALLOW','ROLE','employee'),(386,'Route','driverRouteEmail','WRITE','ALLOW','ROLE','employee'),(387,'Ticket','deliveryNotePdf','READ','ALLOW','ROLE','customer'),(388,'Supplier','newSupplier','WRITE','ALLOW','ROLE','administrative'),(389,'ClaimRma','*','READ','ALLOW','ROLE','claimManager'),(390,'ClaimRma','*','WRITE','ALLOW','ROLE','claimManager'),(391,'Notification','*','WRITE','ALLOW','ROLE','system'),(392,'Boxing','*','*','ALLOW','ROLE','employee'),(393,'Url','*','READ','ALLOW','ROLE','employee'),(394,'Url','*','WRITE','ALLOW','ROLE','it'),(395,'ItemShelving','*','READ','ALLOW','ROLE','employee'),(396,'ItemShelving','*','WRITE','ALLOW','ROLE','production'),(397,'ItemShelvingPlacementSupplyStock','*','READ','ALLOW','ROLE','employee'),(398,'NotificationQueue','*','*','ALLOW','ROLE','employee'),(399,'InvoiceOut','clientsToInvoice','WRITE','ALLOW','ROLE','invoicing'),(400,'InvoiceOut','invoiceClient','WRITE','ALLOW','ROLE','invoicing'),(401,'Sale','editTracked','WRITE','ALLOW','ROLE','production'),(402,'Sale','editFloramondo','WRITE','ALLOW','ROLE','salesAssistant'),(403,'Receipt','balanceCompensationEmail','WRITE','ALLOW','ROLE','employee'),(404,'Receipt','balanceCompensationPdf','READ','ALLOW','ROLE','employee'),(405,'Ticket','getTicketsFuture','READ','ALLOW','ROLE','employee'),(406,'Ticket','merge','WRITE','ALLOW','ROLE','employee'),(407,'Sale','editFloramondo','WRITE','ALLOW','ROLE','logistic'),(408,'ZipConfig','*','*','ALLOW','ROLE','employee'),(409,'Item','*','WRITE','ALLOW','ROLE','administrative'),(410,'Sale','editCloned','WRITE','ALLOW','ROLE','buyer'),(411,'Sale','editCloned','WRITE','ALLOW','ROLE','salesAssistant'),(414,'MdbVersion','*','READ','ALLOW','ROLE','$everyone'),(415,'Dms','saveSign','*','ALLOW','ROLE','employee'),(416,'TicketLog','getChanges','READ','ALLOW','ROLE','employee'),(417,'Ticket','getTicketsAdvance','READ','ALLOW','ROLE','employee'),(418,'EntryLog','*','READ','ALLOW','ROLE','administrative'),(419,'Sale','editTracked','WRITE','ALLOW','ROLE','buyer'),(420,'MdbBranch','*','READ','ALLOW','ROLE','$everyone'),(421,'ItemShelvingSale','*','*','ALLOW','ROLE','employee'),(422,'Docuware','checkFile','READ','ALLOW','ROLE','employee'),(423,'Docuware','download','READ','ALLOW','ROLE','salesPerson'),(424,'Docuware','upload','WRITE','ALLOW','ROLE','productionAssi'),(425,'Docuware','deliveryNoteEmail','WRITE','ALLOW','ROLE','salesPerson'),(426,'TpvTransaction','confirm','WRITE','ALLOW','ROLE','$everyone'),(427,'TpvTransaction','start','WRITE','ALLOW','ROLE','$authenticated'),(428,'TpvTransaction','end','WRITE','ALLOW','ROLE','$authenticated'),(429,'ItemConfig','*','READ','ALLOW','ROLE','employee'),(431,'Tag','onSubmit','WRITE','ALLOW','ROLE','employee'),(432,'Worker','updateAttributes','WRITE','ALLOW','ROLE','hr'),(433,'Worker','createAbsence','*','ALLOW','ROLE','employee'),(434,'Worker','updateAbsence','WRITE','ALLOW','ROLE','employee'),(435,'Worker','deleteAbsence','*','ALLOW','ROLE','employee'),(436,'Worker','new','WRITE','ALLOW','ROLE','hr'),(437,'Role','*','READ','ALLOW','ROLE','hr'),(438,'Client','getClientOrSupplierReference','READ','ALLOW','ROLE','employee'); /*!40000 ALTER TABLE `ACL` ENABLE KEYS */; UNLOCK TABLES; @@ -2209,71 +174,7 @@ UNLOCK TABLES; LOCK TABLES `fieldAcl` WRITE; /*!40000 ALTER TABLE `fieldAcl` DISABLE KEYS */; -INSERT INTO `fieldAcl` VALUES -(1,'Client','name','update','employee'), -(2,'Client','contact','update','employee'), -(3,'Client','email','update','employee'), -(4,'Client','phone','update','employee'), -(5,'Client','mobile','update','employee'), -(6,'Client','contactChannelFk','update','employee'), -(7,'Client','socialName','update','salesPerson'), -(8,'Client','fi','update','salesPerson'), -(9,'Client','street','update','salesPerson'), -(10,'Client','postcode','update','salesPerson'), -(11,'Client','city','update','salesPerson'), -(12,'Client','countryFk','update','salesPerson'), -(13,'Client','provinceFk','update','salesPerson'), -(14,'Client','isActive','update','salesPerson'), -(15,'Client','salesPersonFk','update','salesAssistant'), -(16,'Client','hasToInvoice','update','salesPerson'), -(17,'Client','isToBeMailed','update','salesPerson'), -(18,'Client','isEqualizated','update','salesPerson'), -(19,'Client','isFreezed','update','salesPerson'), -(20,'Client','isVies','update','salesPerson'), -(21,'Client','hasToInvoiceByAddress','update','salesPerson'), -(22,'Client','isTaxDataChecked','update','salesAssistant'), -(23,'Client','payMethodFk','update','salesAssistant'), -(24,'Client','dueDay','update','salesAssistant'), -(25,'Client','iban','update','salesAssistant'), -(26,'Client','bankEntityFk','update','salesAssistant'), -(27,'Client','hasLcr','update','salesAssistant'), -(28,'Client','hasCoreVnl','update','salesAssistant'), -(29,'Client','hasSepaVnl','update','salesAssistant'), -(30,'Client','credit','update','teamBoss'), -(31,'BankEntity','*','insert','salesAssistant'), -(32,'Address','isDefaultAddress','*','employee'), -(33,'Address','nickname','*','employee'), -(34,'Address','postalCode','*','employee'), -(35,'Address','provinceFk','*','employee'), -(36,'Address','agencyModeFk','*','employee'), -(37,'Address','phone','*','employee'), -(38,'Address','mobile','*','employee'), -(39,'Address','street','*','employee'), -(40,'Address','city','*','employee'), -(41,'Address','isActive','*','employee'), -(42,'Address','isEqualizated','*','salesAssistant'), -(43,'Address','clientFk','insert','employee'), -(44,'ClientObservation','*','insert','employee'), -(45,'Recovery','*','insert','administrative'), -(46,'Recovery','finished','update','administrative'), -(47,'CreditClassification','finished','update','creditInsurance'), -(48,'Account','*','update','employee'), -(49,'Greuge','*','insert','salesAssistant'), -(50,'ClientSample','*','insert','employee'), -(51,'Item','*','*','buyer'), -(52,'Item','*','*','marketingBoss'), -(53,'ItemBotanical','*','*','buyer'), -(54,'ClaimEnd','*','*','salesAssistant'), -(55,'Receipt','*','*','administrative'), -(56,'ClaimBeginning','*','*','salesAssistant'), -(57,'TicketRequest','*','*','salesPerson'), -(58,'ClaimBeginning','*','*','salesAssistant'), -(59,'TicketRequest','*','*','salesPerson'), -(60,'ClaimBeginning','*','*','salesAssistant'), -(61,'TicketRequest','*','*','salesPerson'), -(62,'ClaimBeginning','*','*','salesAssistant'), -(63,'TicketRequest','*','*','salesPerson'), -(64,'ClaimBeginning','*','*','salesAssistant'); +INSERT INTO `fieldAcl` VALUES (1,'Client','name','update','employee'),(2,'Client','contact','update','employee'),(3,'Client','email','update','employee'),(4,'Client','phone','update','employee'),(5,'Client','mobile','update','employee'),(6,'Client','contactChannelFk','update','employee'),(7,'Client','socialName','update','salesPerson'),(8,'Client','fi','update','salesPerson'),(9,'Client','street','update','salesPerson'),(10,'Client','postcode','update','salesPerson'),(11,'Client','city','update','salesPerson'),(12,'Client','countryFk','update','salesPerson'),(13,'Client','provinceFk','update','salesPerson'),(14,'Client','isActive','update','salesPerson'),(15,'Client','salesPersonFk','update','salesAssistant'),(16,'Client','hasToInvoice','update','salesPerson'),(17,'Client','isToBeMailed','update','salesPerson'),(18,'Client','isEqualizated','update','salesPerson'),(19,'Client','isFreezed','update','salesPerson'),(20,'Client','isVies','update','salesPerson'),(21,'Client','hasToInvoiceByAddress','update','salesPerson'),(22,'Client','isTaxDataChecked','update','salesAssistant'),(23,'Client','payMethodFk','update','salesAssistant'),(24,'Client','dueDay','update','salesAssistant'),(25,'Client','iban','update','salesAssistant'),(26,'Client','bankEntityFk','update','salesAssistant'),(27,'Client','hasLcr','update','salesAssistant'),(28,'Client','hasCoreVnl','update','salesAssistant'),(29,'Client','hasSepaVnl','update','salesAssistant'),(30,'Client','credit','update','teamBoss'),(31,'BankEntity','*','insert','salesAssistant'),(32,'Address','isDefaultAddress','*','employee'),(33,'Address','nickname','*','employee'),(34,'Address','postalCode','*','employee'),(35,'Address','provinceFk','*','employee'),(36,'Address','agencyModeFk','*','employee'),(37,'Address','phone','*','employee'),(38,'Address','mobile','*','employee'),(39,'Address','street','*','employee'),(40,'Address','city','*','employee'),(41,'Address','isActive','*','employee'),(42,'Address','isEqualizated','*','salesAssistant'),(43,'Address','clientFk','insert','employee'),(44,'ClientObservation','*','insert','employee'),(45,'Recovery','*','insert','administrative'),(46,'Recovery','finished','update','administrative'),(47,'CreditClassification','finished','update','creditInsurance'),(48,'Account','*','update','employee'),(49,'Greuge','*','insert','salesAssistant'),(50,'ClientSample','*','insert','employee'),(51,'Item','*','*','buyer'),(52,'Item','*','*','marketingBoss'),(53,'ItemBotanical','*','*','buyer'),(54,'ClaimEnd','*','*','salesAssistant'),(55,'Receipt','*','*','administrative'),(56,'ClaimBeginning','*','*','salesAssistant'),(57,'TicketRequest','*','*','salesPerson'),(58,'ClaimBeginning','*','*','salesAssistant'),(59,'TicketRequest','*','*','salesPerson'),(60,'ClaimBeginning','*','*','salesAssistant'),(61,'TicketRequest','*','*','salesPerson'),(62,'ClaimBeginning','*','*','salesAssistant'),(63,'TicketRequest','*','*','salesPerson'),(64,'ClaimBeginning','*','*','salesAssistant'); /*!40000 ALTER TABLE `fieldAcl` ENABLE KEYS */; UNLOCK TABLES; @@ -2283,22 +184,7 @@ UNLOCK TABLES; LOCK TABLES `module` WRITE; /*!40000 ALTER TABLE `module` DISABLE KEYS */; -INSERT INTO `module` VALUES -('Claims'), -('Clients'), -('Entries'), -('Invoices in'), -('Invoices out'), -('Items'), -('Monitors'), -('Orders'), -('Routes'), -('Suppliers'), -('Tickets'), -('Travels'), -('Users'), -('Workers'), -('Zones'); +INSERT INTO `module` VALUES ('account'),('claim'),('customer'),('entry'),('invoiceIn'),('invoiceOut'),('item'),('monitor'),('order'),('route'),('shelving'),('supplier'),('ticket'),('travel'),('worker'),('zone'); /*!40000 ALTER TABLE `module` ENABLE KEYS */; UNLOCK TABLES; @@ -2308,11 +194,7 @@ UNLOCK TABLES; LOCK TABLES `defaultViewConfig` WRITE; /*!40000 ALTER TABLE `defaultViewConfig` DISABLE KEYS */; -INSERT INTO `defaultViewConfig` VALUES -('itemsIndex','{\"intrastat\":false,\"stemMultiplier\":false,\"landed\":false,\"producer\":false}'), -('latestBuys','{\"intrastat\":false,\"description\":false,\"density\":false,\"isActive\":false,\n \"freightValue\":false,\"packageValue\":false,\"isIgnored\":false,\"price2\":false,\"ektFk\":false,\"weight\":false,\n \"size\":false,\"comissionValue\":false,\"landing\":false}'), -('ticketsMonitor','{\"id\":false}'), -('clientsDetail','{\"id\":true,\"phone\":true,\"city\":true,\"socialName\":true,\"salesPersonFk\":true,\"email\":true,\"name\":false,\"fi\":false,\"credit\":false,\"creditInsurance\":false,\"mobile\":false,\"street\":false,\"countryFk\":false,\"provinceFk\":false,\"postcode\":false,\"created\":false,\"businessTypeFk\":false,\"payMethodFk\":false,\"sageTaxTypeFk\":false,\"sageTransactionTypeFk\":false,\"isActive\":false,\"isVies\":false,\"isTaxDataChecked\":false,\"isEqualizated\":false,\"isFreezed\":false,\"hasToInvoice\":false,\"hasToInvoiceByAddress\":false,\"isToBeMailed\":false,\"hasLcr\":false,\"hasCoreVnl\":false,\"hasSepaVnl\":false}'); +INSERT INTO `defaultViewConfig` VALUES ('itemsIndex','{\"intrastat\":false,\"stemMultiplier\":false,\"landed\":false,\"producer\":false}'),('latestBuys','{\"intrastat\":false,\"description\":false,\"density\":false,\"isActive\":false,\n \"freightValue\":false,\"packageValue\":false,\"isIgnored\":false,\"price2\":false,\"ektFk\":false,\"weight\":false,\n \"size\":false,\"comissionValue\":false,\"landing\":false}'),('ticketsMonitor','{\"id\":false}'),('clientsDetail','{\"id\":true,\"phone\":true,\"city\":true,\"socialName\":true,\"salesPersonFk\":true,\"email\":true,\"name\":false,\"fi\":false,\"credit\":false,\"creditInsurance\":false,\"mobile\":false,\"street\":false,\"countryFk\":false,\"provinceFk\":false,\"postcode\":false,\"created\":false,\"businessTypeFk\":false,\"payMethodFk\":false,\"sageTaxTypeFk\":false,\"sageTransactionTypeFk\":false,\"isActive\":false,\"isVies\":false,\"isTaxDataChecked\":false,\"isEqualizated\":false,\"isFreezed\":false,\"hasToInvoice\":false,\"hasToInvoiceByAddress\":false,\"isToBeMailed\":false,\"hasLcr\":false,\"hasCoreVnl\":false,\"hasSepaVnl\":false}'); /*!40000 ALTER TABLE `defaultViewConfig` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -2324,13 +206,13 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2022-11-21 7:59:04 +-- Dump completed on 2023-02-20 14:45:53 USE `vn`; --- MariaDB dump 10.19 Distrib 10.9.4-MariaDB, for Linux (x86_64) +-- MariaDB dump 10.19 Distrib 10.5.18-MariaDB, for debian-linux-gnu (x86_64) -- --- Host: db.verdnatura.es Database: vn +-- Host: db-proxy.verdnatura.es Database: vn -- ------------------------------------------------------ --- Server version 10.7.6-MariaDB-1:10.7.6+maria~deb11-log +-- Server version 10.7.7-MariaDB-1:10.7.7+maria~deb11-log /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -2342,17 +224,23 @@ USE `vn`; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +-- +-- Dumping data for table `agencyTermConfig` +-- + +LOCK TABLES `agencyTermConfig` WRITE; +/*!40000 ALTER TABLE `agencyTermConfig` DISABLE KEYS */; +INSERT INTO `agencyTermConfig` VALUES ('6240000000','4721000015',21.0000000000,'Adquisiciones intracomunitarias de servicios'); +/*!40000 ALTER TABLE `agencyTermConfig` ENABLE KEYS */; +UNLOCK TABLES; + -- -- Dumping data for table `alertLevel` -- LOCK TABLES `alertLevel` WRITE; /*!40000 ALTER TABLE `alertLevel` DISABLE KEYS */; -INSERT INTO `alertLevel` VALUES -('FREE',0), -('ON_PREPARATION',1), -('PACKED',2), -('DELIVERED',3); +INSERT INTO `alertLevel` VALUES ('FREE',0),('ON_PREPARATION',1),('PACKED',2),('DELIVERED',3); /*!40000 ALTER TABLE `alertLevel` ENABLE KEYS */; UNLOCK TABLES; @@ -2362,44 +250,7 @@ UNLOCK TABLES; LOCK TABLES `bookingPlanner` WRITE; /*!40000 ALTER TABLE `bookingPlanner` DISABLE KEYS */; -INSERT INTO `bookingPlanner` VALUES -(5,'2017-06-30 22:00:00','4770000002','WORLD',7,4,1), -(6,'2017-06-30 22:00:00','4770000010','NATIONAL',3,1,1), -(8,'2017-06-30 22:00:00','4770000021','NATIONAL',1,2,1), -(9,'2017-06-30 22:00:00','4770000101','EQU',3,1,1), -(11,'2017-06-30 22:00:00','4770000110','EQU',4,1,1), -(12,'2017-06-30 22:00:00','4770000215','EQU',1,2,1), -(13,'2017-06-30 22:00:00','4770000521','EQU',2,2,1), -(15,'2017-06-30 22:00:00','4771000000','CEE',3,1,1), -(16,'2017-06-30 22:00:00','4771000001','CEE',8,3,1), -(19,'2017-07-05 11:54:58','4770000020','NATIONAL',7,4,1), -(20,'2017-07-05 12:09:24','4771000000','CEE',1,2,1), -(21,'2017-07-05 12:09:24','4771000000','CEE',7,4,1), -(22,'2017-07-05 12:12:14','4770000002','WORLD',3,1,1), -(23,'2017-07-05 12:12:14','4770000002','WORLD',1,2,1), -(24,'2017-07-06 08:07:21','4770000002','WORLD',7,4,5), -(25,'2017-07-06 08:07:21','HolandaRED','NATIONAL',3,1,5), -(27,'2017-07-06 08:07:21','HolandaGEN','NATIONAL',1,2,5), -(32,'2017-07-06 08:07:21','4771000000','CEE',3,1,5), -(33,'2017-07-06 08:07:21','4771000001','CEE',8,3,5), -(34,'2017-07-06 08:07:21','4770000020','NATIONAL',7,4,5), -(35,'2017-07-06 08:07:21','4771000000','CEE',1,2,5), -(36,'2017-07-06 08:07:21','4771000000','CEE',7,4,5), -(37,'2017-07-06 08:07:21','4770000002','WORLD',3,1,5), -(38,'2017-07-06 08:07:21','4770000002','WORLD',1,2,5), -(70,'2017-07-06 08:08:48','4770000002','WORLD',7,4,30), -(71,'2017-07-06 08:08:48','IGIC reduc','NATIONAL',3,1,30), -(72,'2017-07-06 08:08:48','4770000020','NATIONAL',7,4,30), -(73,'2017-07-06 08:08:48','IGIC gener','NATIONAL',1,2,30), -(78,'2017-07-06 08:08:48','4770000020','NATIONAL',7,4,30), -(79,'2017-07-06 08:08:48','4770000002','WORLD',3,1,30), -(80,'2017-07-06 08:08:48','4770000002','WORLD',1,2,30), -(81,'2017-07-05 22:00:00','IGIC cero','NATIONAL',5,5,30), -(82,'2019-01-01 11:51:56','4770000504','EQU',5,5,1), -(83,'2019-09-11 10:54:03','4770000405','EQU',6,5,1), -(84,'2019-09-11 10:58:17','4770000004','NATIONAL',5,5,1), -(85,'2019-09-18 22:00:00','4771000000','CEE',5,5,1), -(86,'2021-10-13 22:00:00','4770000002','WORLD',5,5,1); +INSERT INTO `bookingPlanner` VALUES (5,'2017-06-30 22:00:00','4770000002','WORLD',7,4,1),(6,'2017-06-30 22:00:00','4770000010','NATIONAL',3,1,1),(8,'2017-06-30 22:00:00','4770000021','NATIONAL',1,2,1),(9,'2017-06-30 22:00:00','4770000101','EQU',3,1,1),(11,'2017-06-30 22:00:00','4770000110','EQU',4,1,1),(12,'2017-06-30 22:00:00','4770000215','EQU',1,2,1),(13,'2017-06-30 22:00:00','4770000521','EQU',2,2,1),(15,'2017-06-30 22:00:00','4771000000','CEE',3,1,1),(16,'2017-06-30 22:00:00','4771000001','CEE',8,3,1),(19,'2017-07-05 11:54:58','4770000020','NATIONAL',7,4,1),(20,'2017-07-05 12:09:24','4771000000','CEE',1,2,1),(21,'2017-07-05 12:09:24','4771000000','CEE',7,4,1),(22,'2017-07-05 12:12:14','4770000002','WORLD',3,1,1),(23,'2017-07-05 12:12:14','4770000002','WORLD',1,2,1),(24,'2017-07-06 08:07:21','4770000002','WORLD',7,4,5),(25,'2017-07-06 08:07:21','HolandaRED','NATIONAL',3,1,5),(27,'2017-07-06 08:07:21','HolandaGEN','NATIONAL',1,2,5),(32,'2017-07-06 08:07:21','4771000000','CEE',3,1,5),(33,'2017-07-06 08:07:21','4771000001','CEE',8,3,5),(34,'2017-07-06 08:07:21','4770000020','NATIONAL',7,4,5),(35,'2017-07-06 08:07:21','4771000000','CEE',1,2,5),(36,'2017-07-06 08:07:21','4771000000','CEE',7,4,5),(37,'2017-07-06 08:07:21','4770000002','WORLD',3,1,5),(38,'2017-07-06 08:07:21','4770000002','WORLD',1,2,5),(70,'2017-07-06 08:08:48','4770000002','WORLD',7,4,30),(71,'2017-07-06 08:08:48','IGIC reduc','NATIONAL',3,1,30),(72,'2017-07-06 08:08:48','4770000020','NATIONAL',7,4,30),(73,'2017-07-06 08:08:48','IGIC gener','NATIONAL',1,2,30),(78,'2017-07-06 08:08:48','4770000020','NATIONAL',7,4,30),(79,'2017-07-06 08:08:48','4770000002','WORLD',3,1,30),(80,'2017-07-06 08:08:48','4770000002','WORLD',1,2,30),(81,'2017-07-05 22:00:00','IGIC cero','NATIONAL',5,5,30),(82,'2019-01-01 11:51:56','4770000504','EQU',5,5,1),(83,'2019-09-11 10:54:03','4770000405','EQU',6,5,1),(84,'2019-09-11 10:58:17','4770000004','NATIONAL',5,5,1),(85,'2019-09-18 22:00:00','4771000000','CEE',5,5,1),(86,'2021-10-13 22:00:00','4770000002','WORLD',5,5,1); /*!40000 ALTER TABLE `bookingPlanner` ENABLE KEYS */; UNLOCK TABLES; @@ -2409,20 +260,7 @@ UNLOCK TABLES; LOCK TABLES `businessType` WRITE; /*!40000 ALTER TABLE `businessType` DISABLE KEYS */; -INSERT INTO `businessType` VALUES -('decoration','Decoración'), -('events','Eventos'), -('florist','Floristería'), -('gardenCentre','Vivero'), -('gardening','Jardinería'), -('individual','Particular'), -('mortuary','Funeraria'), -('officialOrganism','Organismo oficial'), -('others','Otros'), -('otherSector','Profesional de otro sector'), -('restoration','Restauración'), -('trainingCentre','Centro de formación'), -('wholesaler','Mayorista'); +INSERT INTO `businessType` VALUES ('decoration','Decoración'),('events','Eventos'),('florist','Floristería'),('gardenCentre','Vivero'),('gardening','Jardinería'),('individual','Particular'),('mortuary','Funeraria'),('officialOrganism','Organismo oficial'),('others','Otros'),('otherSector','Profesional de otro sector'),('restoration','Restauración'),('trainingCentre','Centro de formación'),('wholesaler','Mayorista'); /*!40000 ALTER TABLE `businessType` ENABLE KEYS */; UNLOCK TABLES; @@ -2432,18 +270,7 @@ UNLOCK TABLES; LOCK TABLES `cplusInvoiceType472` WRITE; /*!40000 ALTER TABLE `cplusInvoiceType472` DISABLE KEYS */; -INSERT INTO `cplusInvoiceType472` VALUES -(1,'F1 - Factura'), -(2,'F2 - Factura simplificada (ticket)'), -(3,'F3 - Factura emitida en sustitución de facturas simplificadas facturadas y declaradas'), -(4,'F4 - Asiento resumen de facturas'), -(5,'F5 - Importaciones (DUA)'), -(6,'F6 - Otros justificantes contables'), -(7,'R1 - Factura rectificativa (Art. 80.1, 80.2 y error fundado en derecho)'), -(8,'R2 - Factura rectificativa (Art. 80.3)'), -(9,'R3 - Factura rectificativa (Art. 80.4)'), -(10,'R4 - Factura rectificativa (Resto)'), -(11,'R5 - Factura rectificativa en facturas simplificadas'); +INSERT INTO `cplusInvoiceType472` VALUES (1,'F1 - Factura'),(2,'F2 - Factura simplificada (ticket)'),(3,'F3 - Factura emitida en sustitución de facturas simplificadas facturadas y declaradas'),(4,'F4 - Asiento resumen de facturas'),(5,'F5 - Importaciones (DUA)'),(6,'F6 - Otros justificantes contables'),(7,'R1 - Factura rectificativa (Art. 80.1, 80.2 y error fundado en derecho)'),(8,'R2 - Factura rectificativa (Art. 80.3)'),(9,'R3 - Factura rectificativa (Art. 80.4)'),(10,'R4 - Factura rectificativa (Resto)'),(11,'R5 - Factura rectificativa en facturas simplificadas'); /*!40000 ALTER TABLE `cplusInvoiceType472` ENABLE KEYS */; UNLOCK TABLES; @@ -2453,16 +280,7 @@ UNLOCK TABLES; LOCK TABLES `cplusInvoiceType477` WRITE; /*!40000 ALTER TABLE `cplusInvoiceType477` DISABLE KEYS */; -INSERT INTO `cplusInvoiceType477` VALUES -(1,'F1 - Factura'), -(2,'F2 - Factura simplificada (ticket)'), -(3,'F3 - Factura emitida en sustitución de facturas simplificadas facturadas y declaradas'), -(4,'F4 - Asiento resumen de facturas'), -(5,'R1 - Factura rectificativa (Art. 80.1, 80.2 y error fundado en derecho)'), -(6,'R2 - Factura rectificativa (Art. 80.3)'), -(7,'R3 - Factura rectificativa (Art. 80.4)'), -(8,'R4 - Factura rectificativa (Resto)'), -(9,'R5 - Factura rectificativa en facturas simplificadas'); +INSERT INTO `cplusInvoiceType477` VALUES (1,'F1 - Factura'),(2,'F2 - Factura simplificada (ticket)'),(3,'F3 - Factura emitida en sustitución de facturas simplificadas facturadas y declaradas'),(4,'F4 - Asiento resumen de facturas'),(5,'R1 - Factura rectificativa (Art. 80.1, 80.2 y error fundado en derecho)'),(6,'R2 - Factura rectificativa (Art. 80.3)'),(7,'R3 - Factura rectificativa (Art. 80.4)'),(8,'R4 - Factura rectificativa (Resto)'),(9,'R5 - Factura rectificativa en facturas simplificadas'); /*!40000 ALTER TABLE `cplusInvoiceType477` ENABLE KEYS */; UNLOCK TABLES; @@ -2472,10 +290,7 @@ UNLOCK TABLES; LOCK TABLES `cplusRectificationType` WRITE; /*!40000 ALTER TABLE `cplusRectificationType` DISABLE KEYS */; -INSERT INTO `cplusRectificationType` VALUES -(1,'Campo vacio'), -(2,'I – Por diferencias'), -(3,'S – Por sustitución'); +INSERT INTO `cplusRectificationType` VALUES (1,'Campo vacio'),(2,'I – Por diferencias'),(3,'S – Por sustitución'); /*!40000 ALTER TABLE `cplusRectificationType` ENABLE KEYS */; UNLOCK TABLES; @@ -2485,10 +300,7 @@ UNLOCK TABLES; LOCK TABLES `cplusSubjectOp` WRITE; /*!40000 ALTER TABLE `cplusSubjectOp` DISABLE KEYS */; -INSERT INTO `cplusSubjectOp` VALUES -(1,'Campo vacio'), -(2,'S1 – Sujeta – No exenta'), -(3,'S2 – Sujeta – No exenta – Inv. Suj. Pasivo'); +INSERT INTO `cplusSubjectOp` VALUES (1,'Campo vacio'),(2,'S1 – Sujeta – No exenta'),(3,'S2 – Sujeta – No exenta – Inv. Suj. Pasivo'); /*!40000 ALTER TABLE `cplusSubjectOp` ENABLE KEYS */; UNLOCK TABLES; @@ -2498,14 +310,7 @@ UNLOCK TABLES; LOCK TABLES `cplusTaxBreak` WRITE; /*!40000 ALTER TABLE `cplusTaxBreak` DISABLE KEYS */; -INSERT INTO `cplusTaxBreak` VALUES -(1,'Campo vacio'), -(2,'E1 - Exenta por el artículo 20'), -(3,'E2 - Exenta por el artículo 21'), -(4,'E3 - Exenta por el artículo 22'), -(5,'E4 - Exenta por el artículo 24'), -(6,'E5 - Exenta por el artículo 25'), -(7,'E6 - Exenta por otros'); +INSERT INTO `cplusTaxBreak` VALUES (1,'Campo vacio'),(2,'E1 - Exenta por el artículo 20'),(3,'E2 - Exenta por el artículo 21'),(4,'E3 - Exenta por el artículo 22'),(5,'E4 - Exenta por el artículo 24'),(6,'E5 - Exenta por el artículo 25'),(7,'E6 - Exenta por otros'); /*!40000 ALTER TABLE `cplusTaxBreak` ENABLE KEYS */; UNLOCK TABLES; @@ -2515,19 +320,7 @@ UNLOCK TABLES; LOCK TABLES `cplusTrascendency472` WRITE; /*!40000 ALTER TABLE `cplusTrascendency472` DISABLE KEYS */; -INSERT INTO `cplusTrascendency472` VALUES -(1,'01 - Operación de régimen general'), -(2,'02 - Operaciones por las que los empresarios satisfacen compensaciones REAGYP'), -(3,'03 - Operaciones a las que se aplique el régimen especial de bienes usados, objetos de arte, antigüedades y objetos de colección (135 - 139 de LIVA)'), -(4,'04 - Régimen especial oro de inversión'), -(5,'05 - Régimen especial agencias de viajes'), -(6,'06 - Régimen especial grupo de entidades en IVA (Nivel Avanzado)'), -(7,'07 - Régimen especial criterio de caja'), -(8,'08 - Operaciones sujetas al IPSI / IGIC'), -(9,'09 - Adquisiciones intracomunitarias de bienes y prestaciones de servicios'), -(10,'12 - Operaciones de arrendamiento de local de negocio'), -(11,'13 - Factura correspondiente a una importación (informada sin asociar a un DUA)'), -(12,'14 - Primer semestre 2017'); +INSERT INTO `cplusTrascendency472` VALUES (1,'01 - Operación de régimen general'),(2,'02 - Operaciones por las que los empresarios satisfacen compensaciones REAGYP'),(3,'03 - Operaciones a las que se aplique el régimen especial de bienes usados, objetos de arte, antigüedades y objetos de colección (135 - 139 de LIVA)'),(4,'04 - Régimen especial oro de inversión'),(5,'05 - Régimen especial agencias de viajes'),(6,'06 - Régimen especial grupo de entidades en IVA (Nivel Avanzado)'),(7,'07 - Régimen especial criterio de caja'),(8,'08 - Operaciones sujetas al IPSI / IGIC'),(9,'09 - Adquisiciones intracomunitarias de bienes y prestaciones de servicios'),(10,'12 - Operaciones de arrendamiento de local de negocio'),(11,'13 - Factura correspondiente a una importación (informada sin asociar a un DUA)'),(12,'14 - Primer semestre 2017'); /*!40000 ALTER TABLE `cplusTrascendency472` ENABLE KEYS */; UNLOCK TABLES; @@ -2537,30 +330,7 @@ UNLOCK TABLES; LOCK TABLES `claimResponsible` WRITE; /*!40000 ALTER TABLE `claimResponsible` DISABLE KEYS */; -INSERT INTO `claimResponsible` VALUES -(1,'Compradores',0), -(2,'Proveedor',0), -(3,'Entradores',0), -(4,'Camareros',0), -(6,'Sacadores',0), -(7,'Revisadores',0), -(8,'Calidad general',0), -(9,'Encajadores',0), -(10,'Clima',0), -(11,'Comerciales',1), -(12,'Clientes',1), -(13,'Administración',0), -(14,'Agencia',0), -(15,'Repartidores',0), -(16,'Informatica',0), -(17,'Transp.origen',0), -(18,'Confeccion',0), -(19,'OTROS',0), -(21,'Gerencia',0), -(22,'Paletizadores',0), -(23,'Preparación Previa',0), -(24,'Almacén PCA',0), -(25,'Huelga',0); +INSERT INTO `claimResponsible` VALUES (1,'Compradores',0),(2,'Proveedor',0),(3,'Entradores',0),(4,'Camareros',0),(6,'Sacadores',0),(7,'Revisadores',0),(8,'Calidad general',0),(9,'Encajadores',0),(10,'Clima',0),(11,'Comerciales',1),(12,'Clientes',1),(13,'Administración',0),(14,'Agencia',0),(15,'Repartidores',0),(16,'Informatica',0),(17,'Transp.origen',0),(18,'Confeccion',0),(19,'OTROS',0),(21,'Gerencia',0),(22,'Paletizadores',0),(23,'Preparación Previa',0),(24,'Almacén PCA',0),(25,'Huelga',0); /*!40000 ALTER TABLE `claimResponsible` ENABLE KEYS */; UNLOCK TABLES; @@ -2570,44 +340,7 @@ UNLOCK TABLES; LOCK TABLES `claimReason` WRITE; /*!40000 ALTER TABLE `claimReason` DISABLE KEYS */; -INSERT INTO `claimReason` VALUES -(1,'Prisas',0), -(2,'Novato',0), -(3,'Exceso de confianza',0), -(4,'Exceso de celo',0), -(5,'Indiferencia',0), -(6,'Extraviado o Hurto',0), -(7,'Incompetencia',0), -(8,'Ubicación erronea',0), -(9,'Dat.Inctos/Pak.conf',0), -(10,'Datos duplicados',0), -(11,'Fallo stock',0), -(12,'Innovación',0), -(13,'Distracción',1), -(15,'Portes indebidos',0), -(16,'Baja calidad',0), -(17,'Defectuoso',0), -(19,'Endiñado',0), -(20,'Calor',0), -(21,'Frio',0), -(22,'Cambiado',0), -(24,'Cansancio',1), -(25,'Mal etiquetado',1), -(26,'Cantidad malentendido',0), -(30,'No revisado',1), -(34,'Error fotografia',0), -(40,'Fallo Personal VN',0), -(41,'Fallo Personal Cliente',0), -(42,'Otros',0), -(43,'Precio alto',0), -(44,'Abuso de confianza',0), -(45,'Retraso Agencia',0), -(46,'Delicado',0), -(47,'Seco',0), -(48,'Retraso Reparto',0), -(49,'Mal Embalado',0), -(50,'Tumbado',0), -(51,'Enfermo/Plaga',0); +INSERT INTO `claimReason` VALUES (1,'Prisas',0),(2,'Novato',0),(3,'Exceso de confianza',0),(4,'Exceso de celo',0),(5,'Indiferencia',0),(6,'Extraviado o Hurto',0),(7,'Incompetencia',0),(8,'Ubicación erronea',0),(9,'Dat.Inctos/Pak.conf',0),(10,'Datos duplicados',0),(11,'Fallo stock',0),(12,'Innovación',0),(13,'Distracción',1),(15,'Portes indebidos',0),(16,'Baja calidad',0),(17,'Defectuoso',0),(19,'Endiñado',0),(20,'Calor',0),(21,'Frio',0),(22,'Cambiado',0),(24,'Cansancio',1),(25,'Mal etiquetado',1),(26,'Cantidad malentendido',0),(30,'No revisado',1),(34,'Error fotografia',0),(40,'Fallo Personal VN',0),(41,'Fallo Personal Cliente',0),(42,'Otros',0),(43,'Precio alto',0),(44,'Abuso de confianza',0),(45,'Retraso Agencia',0),(46,'Delicado',0),(47,'Seco',0),(48,'Retraso Reparto',0),(49,'Mal Embalado',0),(50,'Tumbado',0),(51,'Enfermo/Plaga',0),(52,'Mala gestión comercial',0),(53,'Mala gestión comprador',0),(54,'A2',0); /*!40000 ALTER TABLE `claimReason` ENABLE KEYS */; UNLOCK TABLES; @@ -2617,13 +350,7 @@ UNLOCK TABLES; LOCK TABLES `claimRedelivery` WRITE; /*!40000 ALTER TABLE `claimRedelivery` DISABLE KEYS */; -INSERT INTO `claimRedelivery` VALUES -(1,'Cliente'), -(2,'No dev./No especif.'), -(3,'Reparto'), -(4,'Agencia'), -(5,'Tour'), -(6,'Fuera Peninsula'); +INSERT INTO `claimRedelivery` VALUES (1,'Cliente'),(2,'No dev./No especif.'),(3,'Reparto'),(4,'Agencia'),(5,'Tour'),(6,'Fuera Peninsula'); /*!40000 ALTER TABLE `claimRedelivery` ENABLE KEYS */; UNLOCK TABLES; @@ -2633,36 +360,7 @@ UNLOCK TABLES; LOCK TABLES `claimResult` WRITE; /*!40000 ALTER TABLE `claimResult` DISABLE KEYS */; -INSERT INTO `claimResult` VALUES -(1,'Otros daños'), -(2,'Roces'), -(3,'Humedad'), -(4,'Deshidratacion'), -(5,'Error identidad'), -(6,'Incompleto (Faltas)'), -(7,'Error packing'), -(8,'Error color'), -(9,'Error medida'), -(10,'Error origen'), -(11,'Envejecido'), -(12,'Venta Perdida'), -(13,'Duplicacion'), -(14,'Rechazado'), -(15,'Rotura'), -(16,'Deterioro/Estropeado'), -(17,'Podrido'), -(18,'Baboso'), -(19,'Cocido'), -(20,'Congelado'), -(21,'Machacado'), -(22,'Error precio'), -(23,'Manchado'), -(24,'No entregado'), -(25,'Cobro indebido'), -(26,'Decepcion/Esperaba mas'), -(27,'Otros'), -(28,'Baboso/Cocido'), -(29,'Video Camara'); +INSERT INTO `claimResult` VALUES (1,'Otros daños'),(2,'Roces'),(3,'Humedad'),(4,'Deshidratacion'),(5,'Error identidad'),(6,'Incompleto (Faltas)'),(7,'Error packing'),(8,'Error color'),(9,'Error medida'),(10,'Error origen'),(11,'Envejecido'),(12,'Venta Perdida'),(13,'Duplicacion'),(14,'Rechazado'),(15,'Rotura'),(16,'Deterioro/Estropeado'),(17,'Podrido'),(18,'Baboso'),(19,'Cocido'),(20,'Congelado'),(21,'Machacado'),(22,'Error precio'),(23,'Manchado'),(24,'No entregado'),(25,'Cobro indebido'),(26,'Decepcion/Esperaba mas'),(27,'Otros'),(28,'Baboso/Cocido'),(29,'Video Camara'); /*!40000 ALTER TABLE `claimResult` ENABLE KEYS */; UNLOCK TABLES; @@ -2672,31 +370,7 @@ UNLOCK TABLES; LOCK TABLES `component` WRITE; /*!40000 ALTER TABLE `component` DISABLE KEYS */; -INSERT INTO `component` VALUES -(10,'Precios Especiales',4,NULL,NULL,1,'specialPrices',0), -(14,'porte extra por dia semana',6,NULL,NULL,1,'extraCostPerWeekDay',0), -(15,'reparto',6,NULL,NULL,1,'delivery',1), -(17,'recobro',5,NULL,NULL,1,'debtCollection',0), -(21,'ajuste',11,NULL,NULL,1,'adjustment',0), -(22,'venta por paquete',9,1,NULL,0,'salePerPackage',0), -(23,'venta por caja',9,2,NULL,0,'salePerBox',0), -(28,'valor de compra',1,NULL,NULL,1,'purchaseValue',1), -(29,'margen',4,NULL,NULL,1,'margin',1), -(32,'descuento ultimas unidades',9,3,-0.05,0,'lastUnitsDiscount',0), -(33,'venta por caja',9,1,NULL,0,'salePerBox',0), -(34,'descuento comprador',4,NULL,NULL,1,'buyerDiscount',0), -(35,'cartera comprador',10,NULL,NULL,1,NULL,0), -(36,'descuadre',12,NULL,NULL,1,'imbalance',0), -(37,'maná',7,4,NULL,0,'mana',0), -(38,'embolsado',9,NULL,NULL,1,'bagged',0), -(39,'maná auto',7,NULL,NULL,1,'autoMana',0), -(40,'cambios Santos 2016',4,NULL,NULL,1,NULL,0), -(41,'bonificacion porte',6,NULL,NULL,1,'freightCharge',0), -(42,'promocion Francia',4,NULL,NULL,1,'frenchOffer',0), -(43,'promocion Floramondo',4,NULL,NULL,1,'floramondoPromo',0), -(44,'rappel cadena',2,NULL,NULL,1,'rappel',0), -(45,'maná reclamacion',7,4,NULL,0,'manaClaim',0), -(46,'recargo a particular',2,NULL,0.25,0,'individual',0); +INSERT INTO `component` VALUES (10,'Precios Especiales',4,NULL,NULL,1,'specialPrices',0),(14,'porte extra por dia semana',6,NULL,NULL,1,'extraCostPerWeekDay',0),(15,'reparto',6,NULL,NULL,1,'delivery',1),(17,'recobro',5,NULL,NULL,1,'debtCollection',0),(21,'ajuste',4,NULL,NULL,1,'adjustment',0),(22,'venta por paquete',9,1,NULL,0,'salePerPackage',0),(23,'venta por caja',9,2,NULL,0,'salePerBox',0),(28,'valor de compra',1,NULL,NULL,1,'purchaseValue',1),(29,'margen',4,NULL,NULL,1,'margin',1),(32,'descuento ultimas unidades',9,3,-0.05,0,'lastUnitsDiscount',0),(33,'venta por caja',9,1,NULL,0,'salePerBox',0),(34,'descuento comprador',4,NULL,NULL,1,'buyerDiscount',0),(35,'cartera comprador',10,NULL,NULL,1,NULL,0),(36,'descuadre',4,NULL,NULL,1,'imbalance',0),(37,'maná',7,4,NULL,0,'mana',0),(38,'embolsado',9,NULL,NULL,1,'bagged',0),(39,'maná auto',7,NULL,NULL,1,'autoMana',0),(40,'cambios Santos 2016',4,NULL,NULL,1,NULL,0),(41,'bonificacion porte',6,NULL,NULL,1,'freightCharge',0),(42,'promocion Francia',4,NULL,NULL,1,'frenchOffer',0),(43,'promocion Floramondo',4,NULL,NULL,1,'floramondoPromo',0),(44,'rappel cadena',2,NULL,NULL,1,'rappel',0),(45,'maná reclamacion',7,4,NULL,0,'manaClaim',0),(46,'recargo a particular',2,NULL,0.25,0,'individual',0),(47,'promocion Italia',4,NULL,NULL,1,'italianOffer',0),(48,'fusión de lineas',4,NULL,NULL,1,'lineFusion',0); /*!40000 ALTER TABLE `component` ENABLE KEYS */; UNLOCK TABLES; @@ -2706,19 +380,7 @@ UNLOCK TABLES; LOCK TABLES `componentType` WRITE; /*!40000 ALTER TABLE `componentType` DISABLE KEYS */; -INSERT INTO `componentType` VALUES -(1,'coste',1,0,'COST'), -(2,'com ventas',1,1,NULL), -(3,'com compras',1,1,NULL), -(4,'empresa',1,1,'MARGIN'), -(5,'cliente',0,0,NULL), -(6,'agencia',0,0,'FREIGHT'), -(7,'cartera_comercial',0,0,NULL), -(8,'cartera_producto',0,1,NULL), -(9,'maniobra',1,0,NULL), -(10,'cartera_comprador',0,1,NULL), -(11,'errores',0,1,NULL), -(12,'otros',0,1,NULL); +INSERT INTO `componentType` VALUES (1,'coste',1,0,'COST'),(2,'com ventas',1,1,NULL),(3,'com compras',1,1,NULL),(4,'empresa',1,1,'MARGIN'),(5,'cliente',0,0,NULL),(6,'agencia',0,0,'FREIGHT'),(7,'cartera_comercial',0,0,'MANA'),(8,'cartera_producto',0,1,NULL),(9,'maniobra',1,0,NULL),(10,'cartera_comprador',0,1,NULL),(11,'errores',0,1,NULL),(12,'otros',0,1,NULL); /*!40000 ALTER TABLE `componentType` ENABLE KEYS */; UNLOCK TABLES; @@ -2728,12 +390,7 @@ UNLOCK TABLES; LOCK TABLES `continent` WRITE; /*!40000 ALTER TABLE `continent` DISABLE KEYS */; -INSERT INTO `continent` VALUES -(1,'Asia','AS'), -(2,'América','AM'), -(3,'África','AF'), -(4,'Europa','EU'), -(5,'Oceanía','OC'); +INSERT INTO `continent` VALUES (1,'Asia','AS'),(2,'América','AM'),(3,'África','AF'),(4,'Europa','EU'),(5,'Oceanía','OC'); /*!40000 ALTER TABLE `continent` ENABLE KEYS */; UNLOCK TABLES; @@ -2743,69 +400,27 @@ UNLOCK TABLES; LOCK TABLES `department` WRITE; /*!40000 ALTER TABLE `department` DISABLE KEYS */; -INSERT INTO `department` VALUES -(1,NULL,'VERDNATURA',1,96,763,0,0,0,0,29,NULL,'/',NULL,0,NULL,0,0,0,0,NULL), -(22,NULL,'COMPRAS',2,3,NULL,72,0,0,1,0,1,'/1/',NULL,1,NULL,1,0,0,0,NULL), -(23,'CMA','CAMARA',13,14,NULL,72,1,1,2,0,37,'/1/37/',NULL,0,NULL,0,1,1,1,NULL), -(31,'IT','INFORMATICA',4,5,NULL,72,0,0,1,0,1,'/1/','informatica-cau',1,NULL,1,0,0,0,NULL), -(34,NULL,'CONTABILIDAD',6,7,NULL,0,0,0,1,0,1,'/1/',NULL,1,NULL,1,0,0,0,NULL), -(35,NULL,'FINANZAS',8,9,NULL,0,0,0,1,0,1,'/1/',NULL,1,'begonya@verdnatura.es',1,0,0,0,NULL), -(36,NULL,'LABORAL',10,11,NULL,0,0,0,1,0,1,'/1/',NULL,1,NULL,1,0,0,0,NULL), -(37,'PROD','PRODUCCION',12,27,NULL,72,1,1,1,7,1,'/1/',NULL,0,NULL,0,1,1,1,NULL), -(38,NULL,'SACADO',15,16,NULL,72,1,0,2,0,37,'/1/37/',NULL,0,NULL,0,0,0,0,NULL), -(39,NULL,'ENCAJADO',17,18,NULL,72,1,0,2,0,37,'/1/37/',NULL,0,NULL,0,0,0,0,NULL), -(41,NULL,'ADMINISTRACION',28,29,NULL,72,0,0,1,0,1,'/1/',NULL,1,NULL,1,0,0,0,NULL), -(43,'VT','VENTAS',30,49,NULL,0,0,0,1,9,1,'/1/',NULL,1,'',1,0,0,0,NULL), -(44,NULL,'GERENCIA',50,51,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL), -(45,NULL,'LOGISTICA',52,53,NULL,72,0,0,1,0,1,'/1/',NULL,1,NULL,1,0,0,0,NULL), -(46,NULL,'REPARTO',54,55,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,1,0,0,NULL), -(48,NULL,'ALMACENAJE',56,57,NULL,0,1,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL), -(49,NULL,'PROPIEDAD',58,59,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL), -(52,NULL,'CARGA AEREA',60,61,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL), -(53,NULL,'MARKETING Y COMUNICACIÓN',62,63,NULL,72,0,0,1,0,1,'/1/',NULL,1,NULL,1,0,0,0,NULL), -(54,NULL,'ORNAMENTALES',64,65,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL), -(55,NULL,'TALLER NATURAL',66,69,3366,72,0,0,1,1,1,'/1/',NULL,0,NULL,0,1,1,0,1118), -(56,NULL,'TALLER ARTIFICIAL',67,68,8470,72,0,0,2,0,55,'/1/55/',NULL,0,NULL,0,1,1,0,1927), -(58,'CMP','CAMPOS',70,73,NULL,72,0,0,1,1,1,'/1/',NULL,0,NULL,0,0,0,0,NULL), -(59,NULL,'MANTENIMIENTO',74,75,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL), -(60,NULL,'RECLAMACIONES',76,77,NULL,72,0,0,1,0,1,'/1/',NULL,1,NULL,1,0,0,0,NULL), -(61,NULL,'VNH',78,79,NULL,73,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL), -(63,NULL,'VENTAS FRANCIA',31,32,NULL,72,0,0,2,0,43,'/1/43/',NULL,0,NULL,0,0,0,0,NULL), -(66,NULL,'VERDNAMADRID',80,81,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL), -(68,NULL,'COMPLEMENTOS',19,20,NULL,72,1,0,2,0,37,'/1/37/',NULL,0,NULL,0,1,0,0,NULL), -(69,NULL,'VERDNABARNA',82,83,NULL,74,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL), -(80,NULL,'EQUIPO J VALLES',33,34,4250,72,0,0,2,0,43,'/1/43/','jvp_equipo',1,'gestioncomercial@verdnatura.es',1,0,0,0,NULL), -(86,NULL,'LIMPIEZA',84,85,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL), -(89,NULL,'COORDINACION',86,87,NULL,0,1,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL), -(90,NULL,'TRAILER',88,89,NULL,0,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL), -(91,NULL,'ARTIFICIAL',21,22,NULL,0,1,0,2,0,37,'/1/37/',NULL,0,NULL,0,0,0,0,NULL), -(92,NULL,'EQUIPO SILVERIO',35,36,1203,0,0,0,2,0,43,'/1/43/','sdc_equipo',1,'gestioncomercial@verdnatura.es',1,0,0,0,NULL), -(93,NULL,'CONFECCION',90,91,NULL,0,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,1,0,NULL), -(94,NULL,'EQUIPO J BROCAL',37,38,3797,0,0,0,2,0,43,'/1/43/','jes_equipo',1,'gestioncomercial@verdnatura.es',1,0,0,0,NULL), -(95,NULL,'EQUIPO C ZAMBRANO',39,40,4667,0,0,0,2,0,43,'/1/43/','czg_equipo',1,'gestioncomercial@verdnatura.es',1,0,0,0,NULL), -(96,NULL,'EQUIPO C LOPEZ',41,42,4661,0,0,0,2,0,43,'/1/43/','cla_equipo',1,'gestioncomercial@verdnatura.es',1,0,0,0,NULL), -(115,NULL,'EQUIPO CLAUDI',43,44,3810,0,0,0,2,0,43,'/1/43/','csr_equipo',1,'gestioncomercial@verdnatura.es',1,0,0,0,NULL), -(123,NULL,'EQUIPO ELENA BASCUÑANA',45,46,7102,0,0,0,2,0,43,'/1/43/','ebt_equipo',1,'gestioncomercial@verdnatura.es',1,0,0,0,NULL), -(124,NULL,'CONTROL INTERNO',92,93,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,1,0,0,0,NULL), -(125,NULL,'EQUIPO MIRIAM MAR',47,48,1118,0,0,0,2,0,43,'/1/43/','mir_equipo',1,'gestioncomercial@verdnatura.es',1,0,0,0,NULL), -(126,NULL,'PRESERVADO',94,95,NULL,0,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,1,0,NULL), -(128,NULL,'PALETIZADO',23,24,NULL,0,0,0,2,0,37,'/1/37/',NULL,0,NULL,0,0,0,0,NULL), -(130,NULL,'REVISION',25,26,NULL,0,0,0,2,0,37,'/1/37/',NULL,0,NULL,0,0,0,0,NULL), -(131,NULL,'INVERNADERO',71,72,NULL,0,0,0,2,0,58,'/1/58/',NULL,0,NULL,0,0,0,0,NULL); +INSERT INTO `department` VALUES (1,NULL,'VERDNATURA',1,98,763,0,0,0,0,29,NULL,'/',NULL,0,NULL,0,0,0,0,NULL),(22,NULL,'COMPRAS',2,3,NULL,72,0,0,1,0,1,'/1/',NULL,1,NULL,1,0,0,0,NULL),(23,'CMA','CAMARA',13,14,NULL,72,1,1,2,0,37,'/1/37/',NULL,0,NULL,0,1,1,1,NULL),(31,'IT','INFORMATICA',4,5,NULL,72,0,0,1,0,1,'/1/','informatica-cau',1,NULL,1,0,0,0,NULL),(34,NULL,'CONTABILIDAD',6,7,NULL,0,0,0,1,0,1,'/1/',NULL,1,NULL,1,0,0,0,NULL),(35,NULL,'FINANZAS',8,9,NULL,0,0,0,1,0,1,'/1/',NULL,1,'begonya@verdnatura.es',1,0,0,0,NULL),(36,NULL,'LABORAL',10,11,NULL,0,0,0,1,0,1,'/1/',NULL,1,NULL,1,0,0,0,NULL),(37,'PROD','PRODUCCION',12,27,NULL,72,1,1,1,7,1,'/1/',NULL,0,NULL,0,1,1,1,NULL),(38,NULL,'SACADO',15,16,NULL,72,1,0,2,0,37,'/1/37/',NULL,0,NULL,0,0,0,0,NULL),(39,NULL,'ENCAJADO',17,18,NULL,72,1,0,2,0,37,'/1/37/',NULL,0,NULL,0,0,0,0,NULL),(41,NULL,'ADMINISTRACION',28,29,NULL,72,0,0,1,0,1,'/1/',NULL,1,NULL,1,0,0,0,NULL),(43,'VT','VENTAS',30,51,NULL,0,0,0,1,10,1,'/1/',NULL,1,'',1,0,0,0,NULL),(44,NULL,'GERENCIA',52,53,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL),(45,NULL,'LOGISTICA',54,55,NULL,72,0,0,1,0,1,'/1/',NULL,1,NULL,1,0,0,0,NULL),(46,NULL,'REPARTO',56,57,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,1,0,0,NULL),(48,NULL,'ALMACENAJE',58,59,NULL,0,1,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL),(49,NULL,'PROPIEDAD',60,61,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL),(52,NULL,'CARGA AEREA',62,63,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL),(53,NULL,'MARKETING Y COMUNICACIÓN',64,65,NULL,72,0,0,1,0,1,'/1/',NULL,1,NULL,1,0,0,0,NULL),(54,NULL,'ORNAMENTALES',66,67,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL),(55,NULL,'TALLER NATURAL',68,71,14548,72,0,0,1,1,1,'/1/',NULL,0,NULL,0,1,1,0,1118),(56,NULL,'TALLER ARTIFICIAL',69,70,8470,72,0,0,2,0,55,'/1/55/',NULL,0,NULL,0,1,1,0,1927),(58,'CMP','CAMPOS',72,75,NULL,72,0,0,1,1,1,'/1/',NULL,0,NULL,0,0,0,0,NULL),(59,NULL,'MANTENIMIENTO',76,77,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL),(60,NULL,'RECLAMACIONES',78,79,NULL,72,0,0,1,0,1,'/1/',NULL,1,NULL,1,0,0,0,NULL),(61,NULL,'VNH',80,81,NULL,73,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL),(66,NULL,'VERDNAMADRID',82,83,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL),(68,NULL,'COMPLEMENTOS',19,20,NULL,72,1,0,2,0,37,'/1/37/',NULL,0,NULL,0,1,0,0,NULL),(69,NULL,'VERDNABARNA',84,85,NULL,74,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL),(80,NULL,'EQUIPO J VALLES',31,32,4250,72,0,0,2,0,43,'/1/43/','jvp_equipo',1,'gestioncomercial@verdnatura.es',1,0,0,0,NULL),(86,NULL,'LIMPIEZA',86,87,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL),(89,NULL,'COORDINACION',88,89,NULL,0,1,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL),(90,NULL,'TRAILER',90,91,NULL,0,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL),(91,NULL,'ARTIFICIAL',21,22,NULL,0,1,0,2,0,37,'/1/37/',NULL,0,NULL,0,0,0,0,NULL),(92,NULL,'EQUIPO SILVERIO',33,34,1203,0,0,0,2,0,43,'/1/43/','sdc_equipo',1,'gestioncomercial@verdnatura.es',1,0,0,0,NULL),(93,NULL,'CONFECCION',92,93,NULL,0,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,1,0,NULL),(94,NULL,'EQUIPO J BROCAL',35,36,3797,0,0,0,2,0,43,'/1/43/','jes_equipo',1,'gestioncomercial@verdnatura.es',1,0,0,0,NULL),(95,NULL,'EQUIPO C ZAMBRANO',37,38,4667,0,0,0,2,0,43,'/1/43/','czg_equipo',1,'gestioncomercial@verdnatura.es',1,0,0,0,NULL),(96,NULL,'EQUIPO C LOPEZ',39,40,4661,0,0,0,2,0,43,'/1/43/','cla_equipo',1,'gestioncomercial@verdnatura.es',1,0,0,0,NULL),(115,NULL,'EQUIPO CLAUDI',41,42,3810,0,0,0,2,0,43,'/1/43/','csr_equipo',1,'gestioncomercial@verdnatura.es',1,0,0,0,NULL),(123,NULL,'EQUIPO ELENA BASCUÑANA',43,44,7102,0,0,0,2,0,43,'/1/43/','ebt_equipo',1,'gestioncomercial@verdnatura.es',1,0,0,0,NULL),(124,NULL,'CONTROL INTERNO',94,95,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,1,0,0,0,NULL),(125,NULL,'EQUIPO MIRIAM MAR',45,46,1118,0,0,0,2,0,43,'/1/43/','mir_equipo',1,'gestioncomercial@verdnatura.es',1,0,0,0,NULL),(126,NULL,'PRESERVADO',96,97,NULL,0,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,1,0,NULL),(128,NULL,'PALETIZADO',23,24,NULL,0,0,0,2,0,37,'/1/37/',NULL,0,NULL,0,0,0,0,NULL),(130,NULL,'REVISION',25,26,NULL,0,0,0,2,0,37,'/1/37/',NULL,0,NULL,0,0,0,0,NULL),(131,NULL,'INVERNADERO',73,74,NULL,0,0,0,2,0,58,'/1/58/',NULL,0,NULL,0,0,0,0,NULL),(132,NULL,'EQUIPO DC',47,48,1731,0,0,0,2,0,43,'/1/43/','dc_equipo',1,'gestioncomercial@verdnatura.es',0,0,0,0,NULL),(133,NULL,'EQUIPO FRANCIA',49,50,1731,72,0,0,2,0,43,'/1/43/','fra_equipo',1,'gestioncomercial@verdnatura.es',0,0,0,0,NULL); /*!40000 ALTER TABLE `department` ENABLE KEYS */; UNLOCK TABLES; +-- +-- Dumping data for table `docuware` +-- + +LOCK TABLES `docuware` WRITE; +/*!40000 ALTER TABLE `docuware` DISABLE KEYS */; +INSERT INTO `docuware` VALUES (1,'deliveryNote','Albaranes cliente','find','find','N__ALBAR_N'),(2,'deliveryNote','Albaranes cliente','store','Archivar','N__ALBAR_N'); +/*!40000 ALTER TABLE `docuware` ENABLE KEYS */; +UNLOCK TABLES; + -- -- Dumping data for table `itemPackingType` -- LOCK TABLES `itemPackingType` WRITE; /*!40000 ALTER TABLE `itemPackingType` DISABLE KEYS */; -INSERT INTO `itemPackingType` VALUES -('F','Fruta y Verdura'), -('H','Horizontal'), -('P','Pienso'), -('V','Vertical'); +INSERT INTO `itemPackingType` VALUES ('F','Fruta y Verdura',0),('H','Horizontal',1),('P','Pienso',0),('V','Vertical',1); /*!40000 ALTER TABLE `itemPackingType` ENABLE KEYS */; UNLOCK TABLES; @@ -2815,31 +430,7 @@ UNLOCK TABLES; LOCK TABLES `pgc` WRITE; /*!40000 ALTER TABLE `pgc` DISABLE KEYS */; -INSERT INTO `pgc` VALUES -('4722000000',0.00,'Importación Exento ',1,0,0,1,0), -('4722000010',10.00,'Importación Reducido ',1,0,0,1,0), -('4722000021',21.00,'Importación General ',1,0,0,1,0), -('4770000001',8.00,'Reducido',1,1,1,1,0), -('4770000002',0.00,'Extra-Community supply',3,1,0,2,0), -('4770000004',4.00,'Super reducido',1,1,1,1,0), -('4770000010',10.00,'Reducido',1,1,1,1,0), -('4770000020',0.00,'Exento',7,1,1,1,0), -('4770000021',21.00,'General',1,1,1,1,0), -('4770000101',10.00,'Reducido ',1,1,1,1,0), -('4770000108',8.00,'Reducido',1,1,1,1,0), -('4770000110',1.40,'Rec. Eq. Reducido',1,0,0,1,1), -('4770000215',21.00,'General',1,1,1,1,0), -('4770000405',0.50,'Rec. Eq. Super Reducido',1,0,0,1,1), -('4770000504',4.00,'Super reducido',1,1,1,1,0), -('4770000521',5.20,'Rec. Eq. General',1,0,0,1,1), -('4770000701',1.00,'Rec. Eq. Reducido',1,0,0,1,1), -('4771000000',0.00,'Intra-Community supply',6,1,1,1,0), -('4771000001',0.00,'Intra-Community services',7,1,1,1,0), -('HolandaGEN',21.00,'General',1,0,0,1,0), -('HolandaRED',9.00,'Reducido',1,0,0,1,0), -('IGIC cero',0.00,'Cero',1,0,0,1,0), -('IGIC gener',6.50,'General',1,0,0,1,0), -('IGIC reduc',3.00,'Reducido',1,0,0,1,0); +INSERT INTO `pgc` VALUES ('4722000000',0.00,'Importación Exento ',1,0,0,1,0),('4722000010',10.00,'Importación Reducido ',1,0,0,1,0),('4722000021',21.00,'Importación General ',1,0,0,1,0),('4770000001',8.00,'Reducido',1,1,1,1,0),('4770000002',0.00,'Extra-Community supply',3,1,0,2,0),('4770000004',4.00,'Super reducido',1,1,1,1,0),('4770000010',10.00,'Reducido',1,1,1,1,0),('4770000020',0.00,'Exento',7,1,1,1,0),('4770000021',21.00,'General',1,1,1,1,0),('4770000101',10.00,'Reducido ',1,1,1,1,0),('4770000108',8.00,'Reducido',1,1,1,1,0),('4770000110',1.40,'Rec. Eq. Reducido',1,0,0,1,1),('4770000215',21.00,'General',1,1,1,1,0),('4770000405',0.50,'Rec. Eq. Super Reducido',1,0,0,1,1),('4770000504',4.00,'Super reducido',1,1,1,1,0),('4770000521',5.20,'Rec. Eq. General',1,0,0,1,1),('4770000701',1.00,'Rec. Eq. Reducido',1,0,0,1,1),('4771000000',0.00,'Intra-Community supply',6,1,1,1,0),('4771000001',0.00,'Intra-Community services',7,1,1,1,0),('HolandaGEN',21.00,'General',1,0,0,1,0),('HolandaRED',9.00,'Reducido',1,0,0,1,0),('IGIC cero',0.00,'Cero',1,0,0,1,0),('IGIC gener',6.50,'General',1,0,0,1,0),('IGIC reduc',3.00,'Reducido',1,0,0,1,0); /*!40000 ALTER TABLE `pgc` ENABLE KEYS */; UNLOCK TABLES; @@ -2849,27 +440,7 @@ UNLOCK TABLES; LOCK TABLES `sample` WRITE; /*!40000 ALTER TABLE `sample` DISABLE KEYS */; -INSERT INTO `sample` VALUES -(1,'Carta_1','Aviso inicial por saldo deudor',0,0,1,0,NULL), -(2,'Carta_2','Reiteracion de aviso por saldo deudor',0,0,1,0,NULL), -(3,'Cred_Up','Notificación de aumento de crédito',0,0,1,0,NULL), -(4,'Cred_down','Notificación de reducción de crédito',0,0,1,0,NULL), -(5,'Pet_CC','Petición de datos bancarios B2B',0,0,1,0,NULL), -(6,'SolCredito','Solicitud de crédito',0,0,1,0,NULL), -(7,'LeyPago','Ley de pagos',0,0,1,0,NULL), -(8,'Pet_CC_Core','Petición de datos bancarios CORE',0,0,1,0,NULL), -(9,'nueva_alta','Documento de nueva alta de cliente',0,0,1,0,NULL), -(10,'client_welcome','Email de bienvenida para nuevo cliente',0,0,1,0,NULL), -(11,'setup_printer','Email de instalación de impresora',0,0,1,0,NULL), -(12,'client-welcome','Bienvenida como nuevo cliente',1,0,1,0,'Clients'), -(13,'printer-setup','Instalación y configuración de impresora de coronas',1,0,1,0,'Clients'), -(14,'sepa-core','Solicitud de domiciliación bancaria',1,1,0,0,'Clients'), -(15,'letter-debtor-st','Aviso inicial por saldo deudor',1,1,1,0,'Clients'), -(16,'letter-debtor-nd','Aviso reiterado por saldo deudor',1,1,1,0,'Clients'), -(17,'client-lcr','Email de solicitud de datos bancarios LCR',0,1,1,0,NULL), -(18,'client-debt-statement','Extracto del cliente',1,0,1,1,'Clients'), -(19,'credit-request','Solicitud de crédito',1,1,1,0,'Clients'), -(20,'incoterms-authorization','Autorización de incoterms',1,1,1,0,'Clients'); +INSERT INTO `sample` VALUES (1,'Carta_1','Aviso inicial por saldo deudor',0,0,1,0,NULL),(2,'Carta_2','Reiteracion de aviso por saldo deudor',0,0,1,0,NULL),(3,'Cred_Up','Notificación de aumento de crédito',0,0,1,0,NULL),(4,'Cred_down','Notificación de reducción de crédito',0,0,1,0,NULL),(5,'Pet_CC','Petición de datos bancarios B2B',0,0,1,0,NULL),(6,'SolCredito','Solicitud de crédito',0,0,1,0,NULL),(7,'LeyPago','Ley de pagos',0,0,1,0,NULL),(8,'Pet_CC_Core','Petición de datos bancarios CORE',0,0,1,0,NULL),(9,'nueva_alta','Documento de nueva alta de cliente',0,0,1,0,NULL),(10,'client_welcome','Email de bienvenida para nuevo cliente',0,0,1,0,NULL),(11,'setup_printer','Email de instalación de impresora',0,0,1,0,NULL),(12,'client-welcome','Bienvenida como nuevo cliente',1,0,1,0,'Clients'),(13,'printer-setup','Instalación y configuración de impresora de coronas',1,0,1,0,'Clients'),(14,'sepa-core','Solicitud de domiciliación bancaria',1,1,0,0,'Clients'),(15,'letter-debtor-st','Aviso inicial por saldo deudor',1,1,1,0,'Clients'),(16,'letter-debtor-nd','Aviso reiterado por saldo deudor',1,1,1,0,'Clients'),(17,'client-lcr','Email de solicitud de datos bancarios LCR',0,1,1,0,NULL),(18,'client-debt-statement','Extracto del cliente',1,0,1,1,'Clients'),(19,'credit-request','Solicitud de crédito',1,1,1,0,'Clients'),(20,'incoterms-authorization','Autorización de incoterms',1,1,1,0,'Clients'); /*!40000 ALTER TABLE `sample` ENABLE KEYS */; UNLOCK TABLES; @@ -2879,42 +450,7 @@ UNLOCK TABLES; LOCK TABLES `state` WRITE; /*!40000 ALTER TABLE `state` DISABLE KEYS */; -INSERT INTO `state` VALUES -(1,'Arreglar',2,0,'FIXING',NULL,1,0,0,0,0,0,0,4,1,'alert'), -(2,'Libre',2,0,'FREE',NULL,2,1,0,0,0,1,0,4,1,'notice'), -(3,'OK',3,0,'OK',3,28,1,0,0,0,1,1,3,0,'success'), -(4,'Impreso',4,0,'PRINTED',2,29,1,0,1,0,0,1,2,0,'success'), -(5,'Preparación',6,1,'ON_PREPARATION',7,14,0,0,0,2,0,0,2,0,'warning'), -(6,'En Revisión',7,1,'ON_CHECKING',NULL,6,0,1,0,3,0,0,1,0,'warning'), -(7,'Sin Acabar',1,0,'NOT_READY',NULL,7,0,0,0,0,0,0,4,1,'alert'), -(8,'Revisado',8,1,'CHECKED',NULL,8,0,1,0,3,0,0,1,0,'warning'), -(9,'Encajando',9,2,'PACKING',NULL,9,0,1,0,0,0,0,1,0,NULL), -(10,'Encajado',10,2,'PACKED',NULL,10,0,1,0,0,0,0,0,0,NULL), -(11,'Facturado',0,3,'INVOICED',NULL,11,0,1,0,0,0,0,0,0,NULL), -(12,'Bloqueado',0,0,'BLOCKED',NULL,12,0,0,0,0,0,0,4,1,'alert'), -(13,'En Reparto',11,3,'ON_DELIVERY',NULL,13,0,1,0,0,0,0,0,0,NULL), -(14,'Preparado',6,1,'PREPARED',NULL,14,0,1,0,2,0,0,1,0,'warning'), -(15,'Pte Recogida',12,3,'WAITING_FOR_PICKUP',NULL,15,0,1,0,0,0,0,0,0,NULL), -(16,'Entregado',13,3,'DELIVERED',NULL,16,0,1,0,0,0,0,0,0,NULL), -(20,'Asignado',4,0,'PICKER_DESIGNED',NULL,20,1,0,0,0,0,0,2,0,'success'), -(21,'Retornado',4,1,'PRINTED_BACK',6,21,0,0,0,0,0,0,2,0,'success'), -(22,'Pte. Ampliar',2,0,'EXPANDABLE',NULL,22,0,0,0,0,0,0,4,1,'alert'), -(23,'URGENTE',5,1,'LAST_CALL',NULL,23,1,0,1,0,0,0,4,1,'success'), -(24,'Encadenado',4,0,'CHAINED',4,24,0,0,0,0,0,0,3,1,'success'), -(25,'Embarcando',3,0,'BOARDING',5,25,1,0,0,0,0,0,3,0,'alert'), -(26,'Prep Previa',5,1,'PREVIOUS_PREPARATION',1,28,1,0,0,1,0,0,2,0,'warning'), -(27,'Prep Asistida',5,1,'ASSISTED_PREPARATION',7,27,0,0,0,0,0,0,2,0,'success'), -(28,'Previa OK',3,0,'OK PREVIOUS',3,28,1,0,1,1,1,1,3,0,'warning'), -(29,'Previa Impreso',4,0,'PRINTED PREVIOUS',2,29,1,0,1,0,0,1,2,0,'success'), -(30,'Embarcado',4,1,'BOARD',5,30,0,0,0,2,0,0,3,0,'success'), -(31,'Polizon Impreso',4,1,'PRINTED STOWAWAY',2,29,1,0,1,0,0,1,2,0,'success'), -(32,'Polizon OK',3,1,'OK STOWAWAY',3,31,1,0,0,1,1,1,3,0,'warning'), -(33,'Auto_Impreso',4,0,'PRINTED_AUTO',2,29,1,0,1,0,0,1,2,0,'success'), -(34,'Pte Pago',3,0,'WAITING_FOR_PAYMENT',NULL,34,0,0,0,0,0,0,4,1,'alert'), -(35,'Semi-Encajado',9,2,'HALF_PACKED',NULL,10,0,1,0,0,0,0,1,0,NULL), -(36,'Previa Revisando',3,0,'PREVIOUS_CONTROL',2,37,1,0,0,4,0,1,2,0,'warning'), -(37,'Previa Revisado',3,0,'PREVIOUS_CONTROLLED',2,29,1,0,1,0,0,1,2,0,'warning'), -(38,'Prep Cámara',6,1,'COOLER_PREPARATION',7,14,0,0,0,2,0,0,2,0,'warning'); +INSERT INTO `state` VALUES (1,'Arreglar',2,0,'FIXING',NULL,1,0,0,0,0,0,0,4,1,'alert'),(2,'Libre',2,0,'FREE',NULL,2,0,0,0,0,0,0,4,1,'notice'),(3,'OK',3,0,'OK',3,28,1,0,0,0,1,1,3,0,'success'),(4,'Impreso',4,0,'PRINTED',2,29,1,0,1,0,0,1,2,0,'success'),(5,'Preparación',6,1,'ON_PREPARATION',7,14,0,0,0,2,0,0,2,0,'warning'),(6,'En Revisión',7,1,'ON_CHECKING',NULL,6,0,1,0,3,0,0,1,0,'warning'),(7,'Sin Acabar',1,0,'NOT_READY',NULL,7,0,0,0,0,0,0,4,1,'alert'),(8,'Revisado',8,1,'CHECKED',NULL,8,0,1,0,3,0,0,1,0,'warning'),(9,'Encajando',9,2,'PACKING',NULL,9,0,1,0,0,0,0,1,0,NULL),(10,'Encajado',10,2,'PACKED',NULL,10,0,1,0,0,0,0,0,0,NULL),(11,'Facturado',0,3,'INVOICED',NULL,11,0,1,0,0,0,0,0,0,NULL),(12,'Bloqueado',0,0,'BLOCKED',NULL,12,0,0,0,0,0,0,4,1,'alert'),(13,'En Reparto',11,3,'ON_DELIVERY',NULL,13,0,1,0,0,0,0,0,0,NULL),(14,'Preparado',6,1,'PREPARED',NULL,14,0,1,0,2,0,0,1,0,'warning'),(15,'Pte Recogida',12,3,'WAITING_FOR_PICKUP',NULL,15,0,1,0,0,0,0,0,0,NULL),(16,'Entregado',13,3,'DELIVERED',NULL,16,0,1,0,0,0,0,0,0,NULL),(20,'Asignado',4,0,'PICKER_DESIGNED',NULL,20,1,0,0,0,0,0,2,0,'success'),(21,'Retornado',4,1,'PRINTED_BACK',6,21,0,0,0,0,0,0,2,0,'success'),(22,'Pte. Ampliar',2,0,'EXPANDABLE',NULL,22,0,0,0,0,0,0,4,1,'alert'),(23,'URGENTE',5,1,'LAST_CALL',NULL,23,1,0,1,0,0,0,4,1,'success'),(24,'Encadenado',4,0,'CHAINED',4,24,0,0,0,0,0,0,3,1,'success'),(25,'Embarcando',3,0,'BOARDING',5,25,1,0,0,0,0,0,3,0,'alert'),(26,'Prep Previa',5,1,'PREVIOUS_PREPARATION',1,28,1,0,0,1,0,0,2,0,'warning'),(27,'Prep Asistida',5,1,'ASSISTED_PREPARATION',7,27,0,0,0,0,0,0,2,0,'success'),(28,'Previa OK',3,0,'OK PREVIOUS',3,28,1,0,1,1,1,1,3,0,'warning'),(29,'Previa Impreso',4,0,'PRINTED PREVIOUS',2,29,1,0,1,0,0,1,2,0,'success'),(30,'Embarcado',4,1,'BOARD',5,30,0,0,0,2,0,0,3,0,'success'),(31,'Polizon Impreso',4,1,'PRINTED STOWAWAY',2,29,1,0,1,0,0,1,2,0,'success'),(32,'Polizon OK',3,1,'OK STOWAWAY',3,31,1,0,0,1,1,1,3,0,'warning'),(33,'Auto_Impreso',4,0,'PRINTED_AUTO',2,29,1,0,1,0,0,1,2,0,'success'),(34,'Pte Pago',3,0,'WAITING_FOR_PAYMENT',NULL,34,0,0,0,0,0,0,4,1,'alert'),(35,'Semi-Encajado',9,2,'HALF_PACKED',NULL,10,0,1,0,0,0,0,1,0,NULL),(36,'Previa Revisando',3,0,'PREVIOUS_CONTROL',2,37,1,0,0,4,0,1,2,0,'warning'),(37,'Previa Revisado',3,0,'PREVIOUS_CONTROLLED',2,29,1,0,1,0,0,1,2,0,'warning'),(38,'Prep Cámara',6,1,'COOLER_PREPARATION',7,14,0,0,0,2,0,0,2,0,'warning'); /*!40000 ALTER TABLE `state` ENABLE KEYS */; UNLOCK TABLES; @@ -2924,9 +460,7 @@ UNLOCK TABLES; LOCK TABLES `ticketUpdateAction` WRITE; /*!40000 ALTER TABLE `ticketUpdateAction` DISABLE KEYS */; -INSERT INTO `ticketUpdateAction` VALUES -(1,'Cambiar los precios en el ticket','changePrice'), -(3,'Convertir en maná','turnInMana'); +INSERT INTO `ticketUpdateAction` VALUES (1,'Cambiar los precios en el ticket','changePrice'),(3,'Convertir en maná','turnInMana'); /*!40000 ALTER TABLE `ticketUpdateAction` ENABLE KEYS */; UNLOCK TABLES; @@ -2936,10600 +470,7 @@ UNLOCK TABLES; LOCK TABLES `time` WRITE; /*!40000 ALTER TABLE `time` DISABLE KEYS */; -INSERT INTO `time` VALUES -('2007-12-31',200801,12,2007,31,1,200712,2008), -('2008-01-01',200801,1,2008,1,1,200801,2008), -('2008-01-02',200801,1,2008,2,1,200801,2008), -('2008-01-03',200801,1,2008,3,1,200801,2008), -('2008-01-04',200801,1,2008,4,1,200801,2008), -('2008-01-05',200801,1,2008,5,1,200801,2008), -('2008-01-06',200802,1,2008,6,2,200801,2008), -('2008-01-07',200802,1,2008,7,2,200801,2008), -('2008-01-08',200802,1,2008,8,2,200801,2008), -('2008-01-09',200802,1,2008,9,2,200801,2008), -('2008-01-10',200802,1,2008,10,2,200801,2008), -('2008-01-11',200802,1,2008,11,2,200801,2008), -('2008-01-12',200802,1,2008,12,2,200801,2008), -('2008-01-13',200803,1,2008,13,3,200801,2008), -('2008-01-14',200803,1,2008,14,3,200801,2008), -('2008-01-15',200803,1,2008,15,3,200801,2008), -('2008-01-16',200803,1,2008,16,3,200801,2008), -('2008-01-17',200803,1,2008,17,3,200801,2008), -('2008-01-18',200803,1,2008,18,3,200801,2008), -('2008-01-19',200803,1,2008,19,3,200801,2008), -('2008-01-20',200804,1,2008,20,4,200801,2008), -('2008-01-21',200804,1,2008,21,4,200801,2008), -('2008-01-22',200804,1,2008,22,4,200801,2008), -('2008-01-23',200804,1,2008,23,4,200801,2008), -('2008-01-24',200804,1,2008,24,4,200801,2008), -('2008-01-25',200804,1,2008,25,4,200801,2008), -('2008-01-26',200804,1,2008,26,4,200801,2008), -('2008-01-27',200805,1,2008,27,5,200801,2008), -('2008-01-28',200805,1,2008,28,5,200801,2008), -('2008-01-29',200805,1,2008,29,5,200801,2008), -('2008-01-30',200805,1,2008,30,5,200801,2008), -('2008-01-31',200805,1,2008,31,5,200801,2008), -('2008-02-01',200805,2,2008,1,5,200802,2008), -('2008-02-02',200805,2,2008,2,5,200802,2008), -('2008-02-03',200806,2,2008,3,6,200802,2008), -('2008-02-04',200806,2,2008,4,6,200802,2008), -('2008-02-05',200806,2,2008,5,6,200802,2008), -('2008-02-06',200806,2,2008,6,6,200802,2008), -('2008-02-07',200806,2,2008,7,6,200802,2008), -('2008-02-08',200806,2,2008,8,6,200802,2008), -('2008-02-09',200806,2,2008,9,6,200802,2008), -('2008-02-10',200807,2,2008,10,7,200802,2008), -('2008-02-11',200807,2,2008,11,7,200802,2008), -('2008-02-12',200807,2,2008,12,7,200802,2008), -('2008-02-13',200807,2,2008,13,7,200802,2008), -('2008-02-14',200807,2,2008,14,7,200802,2008), -('2008-02-15',200807,2,2008,15,7,200802,2008), -('2008-02-16',200807,2,2008,16,7,200802,2008), -('2008-02-17',200808,2,2008,17,8,200802,2008), -('2008-02-18',200808,2,2008,18,8,200802,2008), -('2008-02-19',200808,2,2008,19,8,200802,2008), -('2008-02-20',200808,2,2008,20,8,200802,2008), -('2008-02-21',200808,2,2008,21,8,200802,2008), -('2008-02-22',200808,2,2008,22,8,200802,2008), -('2008-02-23',200808,2,2008,23,8,200802,2008), -('2008-02-24',200809,2,2008,24,9,200802,2008), -('2008-02-25',200809,2,2008,25,9,200802,2008), -('2008-02-26',200809,2,2008,26,9,200802,2008), -('2008-02-27',200809,2,2008,27,9,200802,2008), -('2008-02-28',200809,2,2008,28,9,200802,2008), -('2008-02-29',200809,2,2008,29,9,200802,2008), -('2008-03-01',200809,3,2008,1,9,200803,2008), -('2008-03-02',200810,3,2008,2,10,200803,2008), -('2008-03-03',200810,3,2008,3,10,200803,2008), -('2008-03-04',200810,3,2008,4,10,200803,2008), -('2008-03-05',200810,3,2008,5,10,200803,2008), -('2008-03-06',200810,3,2008,6,10,200803,2008), -('2008-03-07',200810,3,2008,7,10,200803,2008), -('2008-03-08',200810,3,2008,8,10,200803,2008), -('2008-03-09',200811,3,2008,9,11,200803,2008), -('2008-03-10',200811,3,2008,10,11,200803,2008), -('2008-03-11',200811,3,2008,11,11,200803,2008), -('2008-03-12',200811,3,2008,12,11,200803,2008), -('2008-03-13',200811,3,2008,13,11,200803,2008), -('2008-03-14',200811,3,2008,14,11,200803,2008), -('2008-03-15',200811,3,2008,15,11,200803,2008), -('2008-03-16',200812,3,2008,16,12,200803,2008), -('2008-03-17',200812,3,2008,17,12,200803,2008), -('2008-03-18',200812,3,2008,18,12,200803,2008), -('2008-03-19',200812,3,2008,19,12,200803,2008), -('2008-03-20',200812,3,2008,20,12,200803,2008), -('2008-03-21',200812,3,2008,21,12,200803,2008), -('2008-03-22',200812,3,2008,22,12,200803,2008), -('2008-03-23',200813,3,2008,23,13,200803,2008), -('2008-03-24',200813,3,2008,24,13,200803,2008), -('2008-03-25',200813,3,2008,25,13,200803,2008), -('2008-03-26',200813,3,2008,26,13,200803,2008), -('2008-03-27',200813,3,2008,27,13,200803,2008), -('2008-03-28',200813,3,2008,28,13,200803,2008), -('2008-03-29',200813,3,2008,29,13,200803,2008), -('2008-03-30',200814,3,2008,30,14,200803,2008), -('2008-03-31',200814,3,2008,31,14,200803,2008), -('2008-04-01',200814,4,2008,1,14,200804,2008), -('2008-04-02',200814,4,2008,2,14,200804,2008), -('2008-04-03',200814,4,2008,3,14,200804,2008), -('2008-04-04',200814,4,2008,4,14,200804,2008), -('2008-04-05',200814,4,2008,5,14,200804,2008), -('2008-04-06',200815,4,2008,6,15,200804,2008), -('2008-04-07',200815,4,2008,7,15,200804,2008), -('2008-04-08',200815,4,2008,8,15,200804,2008), -('2008-04-09',200815,4,2008,9,15,200804,2008), -('2008-04-10',200815,4,2008,10,15,200804,2008), -('2008-04-11',200815,4,2008,11,15,200804,2008), -('2008-04-12',200815,4,2008,12,15,200804,2008), -('2008-04-13',200816,4,2008,13,16,200804,2008), -('2008-04-14',200816,4,2008,14,16,200804,2008), -('2008-04-15',200816,4,2008,15,16,200804,2008), -('2008-04-16',200816,4,2008,16,16,200804,2008), -('2008-04-17',200816,4,2008,17,16,200804,2008), -('2008-04-18',200816,4,2008,18,16,200804,2008), -('2008-04-19',200816,4,2008,19,16,200804,2008), -('2008-04-20',200817,4,2008,20,17,200804,2008), -('2008-04-21',200817,4,2008,21,17,200804,2008), -('2008-04-22',200817,4,2008,22,17,200804,2008), -('2008-04-23',200817,4,2008,23,17,200804,2008), -('2008-04-24',200817,4,2008,24,17,200804,2008), -('2008-04-25',200817,4,2008,25,17,200804,2008), -('2008-04-26',200817,4,2008,26,17,200804,2008), -('2008-04-27',200818,4,2008,27,18,200804,2008), -('2008-04-28',200818,4,2008,28,18,200804,2008), -('2008-04-29',200818,4,2008,29,18,200804,2008), -('2008-04-30',200818,4,2008,30,18,200804,2008), -('2008-05-01',200818,5,2008,1,18,200805,2008), -('2008-05-02',200818,5,2008,2,18,200805,2008), -('2008-05-03',200818,5,2008,3,18,200805,2008), -('2008-05-04',200819,5,2008,4,19,200805,2008), -('2008-05-05',200819,5,2008,5,19,200805,2008), -('2008-05-06',200819,5,2008,6,19,200805,2008), -('2008-05-07',200819,5,2008,7,19,200805,2008), -('2008-05-08',200819,5,2008,8,19,200805,2008), -('2008-05-09',200819,5,2008,9,19,200805,2008), -('2008-05-10',200819,5,2008,10,19,200805,2008), -('2008-05-11',200820,5,2008,11,20,200805,2008), -('2008-05-12',200820,5,2008,12,20,200805,2008), -('2008-05-13',200820,5,2008,13,20,200805,2008), -('2008-05-14',200820,5,2008,14,20,200805,2008), -('2008-05-15',200820,5,2008,15,20,200805,2008), -('2008-05-16',200820,5,2008,16,20,200805,2008), -('2008-05-17',200820,5,2008,17,20,200805,2008), -('2008-05-18',200821,5,2008,18,21,200805,2008), -('2008-05-19',200821,5,2008,19,21,200805,2008), -('2008-05-20',200821,5,2008,20,21,200805,2008), -('2008-05-21',200821,5,2008,21,21,200805,2008), -('2008-05-22',200821,5,2008,22,21,200805,2008), -('2008-05-23',200821,5,2008,23,21,200805,2008), -('2008-05-24',200821,5,2008,24,21,200805,2008), -('2008-05-25',200822,5,2008,25,22,200805,2008), -('2008-05-26',200822,5,2008,26,22,200805,2008), -('2008-05-27',200822,5,2008,27,22,200805,2008), -('2008-05-28',200822,5,2008,28,22,200805,2008), -('2008-05-29',200822,5,2008,29,22,200805,2008), -('2008-05-30',200822,5,2008,30,22,200805,2008), -('2008-05-31',200822,5,2008,31,22,200805,2008), -('2008-06-01',200823,6,2008,1,23,200806,2008), -('2008-06-02',200823,6,2008,2,23,200806,2008), -('2008-06-03',200823,6,2008,3,23,200806,2008), -('2008-06-04',200823,6,2008,4,23,200806,2008), -('2008-06-05',200823,6,2008,5,23,200806,2008), -('2008-06-06',200823,6,2008,6,23,200806,2008), -('2008-06-07',200823,6,2008,7,23,200806,2008), -('2008-06-08',200824,6,2008,8,24,200806,2008), -('2008-06-09',200824,6,2008,9,24,200806,2008), -('2008-06-10',200824,6,2008,10,24,200806,2008), -('2008-06-11',200824,6,2008,11,24,200806,2008), -('2008-06-12',200824,6,2008,12,24,200806,2008), -('2008-06-13',200824,6,2008,13,24,200806,2008), -('2008-06-14',200824,6,2008,14,24,200806,2008), -('2008-06-15',200825,6,2008,15,25,200806,2008), -('2008-06-16',200825,6,2008,16,25,200806,2008), -('2008-06-17',200825,6,2008,17,25,200806,2008), -('2008-06-18',200825,6,2008,18,25,200806,2008), -('2008-06-19',200825,6,2008,19,25,200806,2008), -('2008-06-20',200825,6,2008,20,25,200806,2008), -('2008-06-21',200825,6,2008,21,25,200806,2008), -('2008-06-22',200826,6,2008,22,26,200806,2008), -('2008-06-23',200826,6,2008,23,26,200806,2008), -('2008-06-24',200826,6,2008,24,26,200806,2008), -('2008-06-25',200826,6,2008,25,26,200806,2008), -('2008-06-26',200826,6,2008,26,26,200806,2008), -('2008-06-27',200826,6,2008,27,26,200806,2008), -('2008-06-28',200826,6,2008,28,26,200806,2008), -('2008-06-29',200827,6,2008,29,27,200806,2008), -('2008-06-30',200827,6,2008,30,27,200806,2008), -('2008-07-01',200827,7,2008,1,27,200807,2008), -('2008-07-02',200827,7,2008,2,27,200807,2008), -('2008-07-03',200827,7,2008,3,27,200807,2008), -('2008-07-04',200827,7,2008,4,27,200807,2008), -('2008-07-05',200827,7,2008,5,27,200807,2008), -('2008-07-06',200828,7,2008,6,28,200807,2008), -('2008-07-07',200828,7,2008,7,28,200807,2008), -('2008-07-08',200828,7,2008,8,28,200807,2008), -('2008-07-09',200828,7,2008,9,28,200807,2008), -('2008-07-10',200828,7,2008,10,28,200807,2008), -('2008-07-11',200828,7,2008,11,28,200807,2008), -('2008-07-12',200828,7,2008,12,28,200807,2008), -('2008-07-13',200829,7,2008,13,29,200807,2008), -('2008-07-14',200829,7,2008,14,29,200807,2008), -('2008-07-15',200829,7,2008,15,29,200807,2008), -('2008-07-16',200829,7,2008,16,29,200807,2008), -('2008-07-17',200829,7,2008,17,29,200807,2008), -('2008-07-18',200829,7,2008,18,29,200807,2008), -('2008-07-19',200829,7,2008,19,29,200807,2008), -('2008-07-20',200830,7,2008,20,30,200807,2008), -('2008-07-21',200830,7,2008,21,30,200807,2008), -('2008-07-22',200830,7,2008,22,30,200807,2008), -('2008-07-23',200830,7,2008,23,30,200807,2008), -('2008-07-24',200830,7,2008,24,30,200807,2008), -('2008-07-25',200830,7,2008,25,30,200807,2008), -('2008-07-26',200830,7,2008,26,30,200807,2008), -('2008-07-27',200831,7,2008,27,31,200807,2008), -('2008-07-28',200831,7,2008,28,31,200807,2008), -('2008-07-29',200831,7,2008,29,31,200807,2008), -('2008-07-30',200831,7,2008,30,31,200807,2008), -('2008-07-31',200831,7,2008,31,31,200807,2008), -('2008-08-01',200831,8,2008,1,31,200808,2008), -('2008-08-02',200831,8,2008,2,31,200808,2008), -('2008-08-03',200832,8,2008,3,32,200808,2008), -('2008-08-04',200832,8,2008,4,32,200808,2008), -('2008-08-05',200832,8,2008,5,32,200808,2008), -('2008-08-06',200832,8,2008,6,32,200808,2008), -('2008-08-07',200832,8,2008,7,32,200808,2008), -('2008-08-08',200832,8,2008,8,32,200808,2008), -('2008-08-09',200832,8,2008,9,32,200808,2008), -('2008-08-10',200833,8,2008,10,33,200808,2008), -('2008-08-11',200833,8,2008,11,33,200808,2008), -('2008-08-12',200833,8,2008,12,33,200808,2008), -('2008-08-13',200833,8,2008,13,33,200808,2008), -('2008-08-14',200833,8,2008,14,33,200808,2008), -('2008-08-15',200833,8,2008,15,33,200808,2008), -('2008-08-16',200833,8,2008,16,33,200808,2008), -('2008-08-17',200834,8,2008,17,34,200808,2008), -('2008-08-18',200834,8,2008,18,34,200808,2008), -('2008-08-19',200834,8,2008,19,34,200808,2008), -('2008-08-20',200834,8,2008,20,34,200808,2008), -('2008-08-21',200834,8,2008,21,34,200808,2008), -('2008-08-22',200834,8,2008,22,34,200808,2008), -('2008-08-23',200834,8,2008,23,34,200808,2008), -('2008-08-24',200835,8,2008,24,35,200808,2008), -('2008-08-25',200835,8,2008,25,35,200808,2008), -('2008-08-26',200835,8,2008,26,35,200808,2008), -('2008-08-27',200835,8,2008,27,35,200808,2008), -('2008-08-28',200835,8,2008,28,35,200808,2008), -('2008-08-29',200835,8,2008,29,35,200808,2008), -('2008-08-30',200835,8,2008,30,35,200808,2008), -('2008-08-31',200836,8,2008,31,36,200808,2008), -('2008-09-01',200836,9,2008,1,36,200809,2008), -('2008-09-02',200836,9,2008,2,36,200809,2008), -('2008-09-03',200836,9,2008,3,36,200809,2008), -('2008-09-04',200836,9,2008,4,36,200809,2008), -('2008-09-05',200836,9,2008,5,36,200809,2008), -('2008-09-06',200836,9,2008,6,36,200809,2008), -('2008-09-07',200837,9,2008,7,37,200809,2008), -('2008-09-08',200837,9,2008,8,37,200809,2008), -('2008-09-09',200837,9,2008,9,37,200809,2008), -('2008-09-10',200837,9,2008,10,37,200809,2008), -('2008-09-11',200837,9,2008,11,37,200809,2008), -('2008-09-12',200837,9,2008,12,37,200809,2008), -('2008-09-13',200837,9,2008,13,37,200809,2008), -('2008-09-14',200838,9,2008,14,38,200809,2008), -('2008-09-15',200838,9,2008,15,38,200809,2008), -('2008-09-16',200838,9,2008,16,38,200809,2008), -('2008-09-17',200838,9,2008,17,38,200809,2008), -('2008-09-18',200838,9,2008,18,38,200809,2008), -('2008-09-19',200838,9,2008,19,38,200809,2008), -('2008-09-20',200838,9,2008,20,38,200809,2008), -('2008-09-21',200839,9,2008,21,39,200809,2008), -('2008-09-22',200839,9,2008,22,39,200809,2008), -('2008-09-23',200839,9,2008,23,39,200809,2008), -('2008-09-24',200839,9,2008,24,39,200809,2008), -('2008-09-25',200839,9,2008,25,39,200809,2008), -('2008-09-26',200839,9,2008,26,39,200809,2008), -('2008-09-27',200839,9,2008,27,39,200809,2008), -('2008-09-28',200840,9,2008,28,40,200809,2008), -('2008-09-29',200840,9,2008,29,40,200809,2008), -('2008-09-30',200840,9,2008,30,40,200809,2008), -('2008-10-01',200840,10,2008,1,40,200810,2008), -('2008-10-02',200840,10,2008,2,40,200810,2008), -('2008-10-03',200840,10,2008,3,40,200810,2008), -('2008-10-04',200840,10,2008,4,40,200810,2008), -('2008-10-05',200841,10,2008,5,41,200810,2008), -('2008-10-06',200841,10,2008,6,41,200810,2008), -('2008-10-07',200841,10,2008,7,41,200810,2008), -('2008-10-08',200841,10,2008,8,41,200810,2008), -('2008-10-09',200841,10,2008,9,41,200810,2008), -('2008-10-10',200841,10,2008,10,41,200810,2008), -('2008-10-11',200841,10,2008,11,41,200810,2008), -('2008-10-12',200842,10,2008,12,42,200810,2008), -('2008-10-13',200842,10,2008,13,42,200810,2008), -('2008-10-14',200842,10,2008,14,42,200810,2008), -('2008-10-15',200842,10,2008,15,42,200810,2008), -('2008-10-16',200842,10,2008,16,42,200810,2008), -('2008-10-17',200842,10,2008,17,42,200810,2008), -('2008-10-18',200842,10,2008,18,42,200810,2008), -('2008-10-19',200843,10,2008,19,43,200810,2008), -('2008-10-20',200843,10,2008,20,43,200810,2008), -('2008-10-21',200843,10,2008,21,43,200810,2008), -('2008-10-22',200843,10,2008,22,43,200810,2008), -('2008-10-23',200843,10,2008,23,43,200810,2008), -('2008-10-24',200843,10,2008,24,43,200810,2008), -('2008-10-25',200843,10,2008,25,43,200810,2008), -('2008-10-26',200844,10,2008,26,44,200810,2008), -('2008-10-27',200844,10,2008,27,44,200810,2008), -('2008-10-28',200844,10,2008,28,44,200810,2008), -('2008-10-29',200844,10,2008,29,44,200810,2008), -('2008-10-30',200844,10,2008,30,44,200810,2008), -('2008-10-31',200844,10,2008,31,44,200810,2008), -('2008-11-01',200844,11,2008,1,44,200811,2008), -('2008-11-02',200845,11,2008,2,45,200811,2008), -('2008-11-03',200845,11,2008,3,45,200811,2008), -('2008-11-04',200845,11,2008,4,45,200811,2008), -('2008-11-05',200845,11,2008,5,45,200811,2008), -('2008-11-06',200845,11,2008,6,45,200811,2008), -('2008-11-07',200845,11,2008,7,45,200811,2008), -('2008-11-08',200845,11,2008,8,45,200811,2008), -('2008-11-09',200846,11,2008,9,46,200811,2008), -('2008-11-10',200846,11,2008,10,46,200811,2008), -('2008-11-11',200846,11,2008,11,46,200811,2008), -('2008-11-12',200846,11,2008,12,46,200811,2008), -('2008-11-13',200846,11,2008,13,46,200811,2008), -('2008-11-14',200846,11,2008,14,46,200811,2008), -('2008-11-15',200846,11,2008,15,46,200811,2008), -('2008-11-16',200847,11,2008,16,47,200811,2008), -('2008-11-17',200847,11,2008,17,47,200811,2008), -('2008-11-18',200847,11,2008,18,47,200811,2008), -('2008-11-19',200847,11,2008,19,47,200811,2008), -('2008-11-20',200847,11,2008,20,47,200811,2008), -('2008-11-21',200847,11,2008,21,47,200811,2008), -('2008-11-22',200847,11,2008,22,47,200811,2008), -('2008-11-23',200848,11,2008,23,48,200811,2008), -('2008-11-24',200848,11,2008,24,48,200811,2008), -('2008-11-25',200848,11,2008,25,48,200811,2008), -('2008-11-26',200848,11,2008,26,48,200811,2008), -('2008-11-27',200848,11,2008,27,48,200811,2008), -('2008-11-28',200848,11,2008,28,48,200811,2008), -('2008-11-29',200848,11,2008,29,48,200811,2008), -('2008-11-30',200849,11,2008,30,49,200811,2008), -('2008-12-01',200849,12,2008,1,49,200812,2009), -('2008-12-02',200849,12,2008,2,49,200812,2009), -('2008-12-03',200849,12,2008,3,49,200812,2009), -('2008-12-04',200849,12,2008,4,49,200812,2009), -('2008-12-05',200849,12,2008,5,49,200812,2009), -('2008-12-06',200849,12,2008,6,49,200812,2009), -('2008-12-07',200850,12,2008,7,50,200812,2009), -('2008-12-08',200850,12,2008,8,50,200812,2009), -('2008-12-09',200850,12,2008,9,50,200812,2009), -('2008-12-10',200850,12,2008,10,50,200812,2009), -('2008-12-11',200850,12,2008,11,50,200812,2009), -('2008-12-12',200850,12,2008,12,50,200812,2009), -('2008-12-13',200850,12,2008,13,50,200812,2009), -('2008-12-14',200851,12,2008,14,51,200812,2009), -('2008-12-15',200851,12,2008,15,51,200812,2009), -('2008-12-16',200851,12,2008,16,51,200812,2009), -('2008-12-17',200851,12,2008,17,51,200812,2009), -('2008-12-18',200851,12,2008,18,51,200812,2009), -('2008-12-19',200851,12,2008,19,51,200812,2009), -('2008-12-20',200851,12,2008,20,51,200812,2009), -('2008-12-21',200852,12,2008,21,52,200812,2009), -('2008-12-22',200852,12,2008,22,52,200812,2009), -('2008-12-23',200852,12,2008,23,52,200812,2009), -('2008-12-24',200852,12,2008,24,52,200812,2009), -('2008-12-25',200852,12,2008,25,52,200812,2009), -('2008-12-26',200852,12,2008,26,52,200812,2009), -('2008-12-27',200852,12,2008,27,52,200812,2009), -('2008-12-28',200853,12,2008,28,53,200812,2009), -('2008-12-29',200901,12,2008,29,53,200812,2009), -('2008-12-30',200901,12,2008,30,53,200812,2009), -('2008-12-31',200901,12,2008,31,53,200812,2009), -('2009-01-01',200901,1,2009,1,53,200901,2009), -('2009-01-02',200901,1,2009,2,53,200901,2009), -('2009-01-03',200901,1,2009,3,53,200901,2009), -('2009-01-04',200902,1,2009,4,1,200901,2009), -('2009-01-05',200902,1,2009,5,1,200901,2009), -('2009-01-06',200902,1,2009,6,1,200901,2009), -('2009-01-07',200902,1,2009,7,1,200901,2009), -('2009-01-08',200902,1,2009,8,1,200901,2009), -('2009-01-09',200902,1,2009,9,1,200901,2009), -('2009-01-10',200902,1,2009,10,1,200901,2009), -('2009-01-11',200903,1,2009,11,2,200901,2009), -('2009-01-12',200903,1,2009,12,2,200901,2009), -('2009-01-13',200903,1,2009,13,2,200901,2009), -('2009-01-14',200903,1,2009,14,2,200901,2009), -('2009-01-15',200903,1,2009,15,2,200901,2009), -('2009-01-16',200903,1,2009,16,2,200901,2009), -('2009-01-17',200903,1,2009,17,2,200901,2009), -('2009-01-18',200904,1,2009,18,3,200901,2009), -('2009-01-19',200904,1,2009,19,3,200901,2009), -('2009-01-20',200904,1,2009,20,3,200901,2009), -('2009-01-21',200904,1,2009,21,3,200901,2009), -('2009-01-22',200904,1,2009,22,3,200901,2009), -('2009-01-23',200904,1,2009,23,3,200901,2009), -('2009-01-24',200904,1,2009,24,3,200901,2009), -('2009-01-25',200905,1,2009,25,4,200901,2009), -('2009-01-26',200905,1,2009,26,4,200901,2009), -('2009-01-27',200905,1,2009,27,4,200901,2009), -('2009-01-28',200905,1,2009,28,4,200901,2009), -('2009-01-29',200905,1,2009,29,4,200901,2009), -('2009-01-30',200905,1,2009,30,4,200901,2009), -('2009-01-31',200905,1,2009,31,4,200901,2009), -('2009-02-01',200906,2,2009,1,5,200902,2009), -('2009-02-02',200906,2,2009,2,5,200902,2009), -('2009-02-03',200906,2,2009,3,5,200902,2009), -('2009-02-04',200906,2,2009,4,5,200902,2009), -('2009-02-05',200906,2,2009,5,5,200902,2009), -('2009-02-06',200906,2,2009,6,5,200902,2009), -('2009-02-07',200906,2,2009,7,5,200902,2009), -('2009-02-08',200907,2,2009,8,6,200902,2009), -('2009-02-09',200907,2,2009,9,6,200902,2009), -('2009-02-10',200907,2,2009,10,6,200902,2009), -('2009-02-11',200907,2,2009,11,6,200902,2009), -('2009-02-12',200907,2,2009,12,6,200902,2009), -('2009-02-13',200907,2,2009,13,6,200902,2009), -('2009-02-14',200907,2,2009,14,6,200902,2009), -('2009-02-15',200908,2,2009,15,7,200902,2009), -('2009-02-16',200908,2,2009,16,7,200902,2009), -('2009-02-17',200908,2,2009,17,7,200902,2009), -('2009-02-18',200908,2,2009,18,7,200902,2009), -('2009-02-19',200908,2,2009,19,7,200902,2009), -('2009-02-20',200908,2,2009,20,7,200902,2009), -('2009-02-21',200908,2,2009,21,7,200902,2009), -('2009-02-22',200909,2,2009,22,8,200902,2009), -('2009-02-23',200909,2,2009,23,8,200902,2009), -('2009-02-24',200909,2,2009,24,8,200902,2009), -('2009-02-25',200909,2,2009,25,8,200902,2009), -('2009-02-26',200909,2,2009,26,8,200902,2009), -('2009-02-27',200909,2,2009,27,8,200902,2009), -('2009-02-28',200909,2,2009,28,8,200902,2009), -('2009-03-01',200910,3,2009,1,9,200903,2009), -('2009-03-02',200910,3,2009,2,9,200903,2009), -('2009-03-03',200910,3,2009,3,9,200903,2009), -('2009-03-04',200910,3,2009,4,9,200903,2009), -('2009-03-05',200910,3,2009,5,9,200903,2009), -('2009-03-06',200910,3,2009,6,9,200903,2009), -('2009-03-07',200910,3,2009,7,9,200903,2009), -('2009-03-08',200911,3,2009,8,10,200903,2009), -('2009-03-09',200911,3,2009,9,10,200903,2009), -('2009-03-10',200911,3,2009,10,10,200903,2009), -('2009-03-11',200911,3,2009,11,10,200903,2009), -('2009-03-12',200911,3,2009,12,10,200903,2009), -('2009-03-13',200911,3,2009,13,10,200903,2009), -('2009-03-14',200911,3,2009,14,10,200903,2009), -('2009-03-15',200912,3,2009,15,11,200903,2009), -('2009-03-16',200912,3,2009,16,11,200903,2009), -('2009-03-17',200912,3,2009,17,11,200903,2009), -('2009-03-18',200912,3,2009,18,11,200903,2009), -('2009-03-19',200912,3,2009,19,11,200903,2009), -('2009-03-20',200912,3,2009,20,11,200903,2009), -('2009-03-21',200912,3,2009,21,11,200903,2009), -('2009-03-22',200913,3,2009,22,12,200903,2009), -('2009-03-23',200913,3,2009,23,12,200903,2009), -('2009-03-24',200913,3,2009,24,12,200903,2009), -('2009-03-25',200913,3,2009,25,12,200903,2009), -('2009-03-26',200913,3,2009,26,12,200903,2009), -('2009-03-27',200913,3,2009,27,12,200903,2009), -('2009-03-28',200913,3,2009,28,12,200903,2009), -('2009-03-29',200914,3,2009,29,13,200903,2009), -('2009-03-30',200914,3,2009,30,13,200903,2009), -('2009-03-31',200914,3,2009,31,13,200903,2009), -('2009-04-01',200914,4,2009,1,13,200904,2009), -('2009-04-02',200914,4,2009,2,13,200904,2009), -('2009-04-03',200914,4,2009,3,13,200904,2009), -('2009-04-04',200914,4,2009,4,13,200904,2009), -('2009-04-05',200915,4,2009,5,14,200904,2009), -('2009-04-06',200915,4,2009,6,14,200904,2009), -('2009-04-07',200915,4,2009,7,14,200904,2009), -('2009-04-08',200915,4,2009,8,14,200904,2009), -('2009-04-09',200915,4,2009,9,14,200904,2009), -('2009-04-10',200915,4,2009,10,14,200904,2009), -('2009-04-11',200915,4,2009,11,14,200904,2009), -('2009-04-12',200916,4,2009,12,15,200904,2009), -('2009-04-13',200916,4,2009,13,15,200904,2009), -('2009-04-14',200916,4,2009,14,15,200904,2009), -('2009-04-15',200916,4,2009,15,15,200904,2009), -('2009-04-16',200916,4,2009,16,15,200904,2009), -('2009-04-17',200916,4,2009,17,15,200904,2009), -('2009-04-18',200916,4,2009,18,15,200904,2009), -('2009-04-19',200917,4,2009,19,16,200904,2009), -('2009-04-20',200917,4,2009,20,16,200904,2009), -('2009-04-21',200917,4,2009,21,16,200904,2009), -('2009-04-22',200917,4,2009,22,16,200904,2009), -('2009-04-23',200917,4,2009,23,16,200904,2009), -('2009-04-24',200917,4,2009,24,16,200904,2009), -('2009-04-25',200917,4,2009,25,16,200904,2009), -('2009-04-26',200918,4,2009,26,17,200904,2009), -('2009-04-27',200918,4,2009,27,17,200904,2009), -('2009-04-28',200918,4,2009,28,17,200904,2009), -('2009-04-29',200918,4,2009,29,17,200904,2009), -('2009-04-30',200918,4,2009,30,17,200904,2009), -('2009-05-01',200918,5,2009,1,17,200905,2009), -('2009-05-02',200918,5,2009,2,17,200905,2009), -('2009-05-03',200919,5,2009,3,18,200905,2009), -('2009-05-04',200919,5,2009,4,18,200905,2009), -('2009-05-05',200919,5,2009,5,18,200905,2009), -('2009-05-06',200919,5,2009,6,18,200905,2009), -('2009-05-07',200919,5,2009,7,18,200905,2009), -('2009-05-08',200919,5,2009,8,18,200905,2009), -('2009-05-09',200919,5,2009,9,18,200905,2009), -('2009-05-10',200920,5,2009,10,19,200905,2009), -('2009-05-11',200920,5,2009,11,19,200905,2009), -('2009-05-12',200920,5,2009,12,19,200905,2009), -('2009-05-13',200920,5,2009,13,19,200905,2009), -('2009-05-14',200920,5,2009,14,19,200905,2009), -('2009-05-15',200920,5,2009,15,19,200905,2009), -('2009-05-16',200920,5,2009,16,19,200905,2009), -('2009-05-17',200921,5,2009,17,20,200905,2009), -('2009-05-18',200921,5,2009,18,20,200905,2009), -('2009-05-19',200921,5,2009,19,20,200905,2009), -('2009-05-20',200921,5,2009,20,20,200905,2009), -('2009-05-21',200921,5,2009,21,20,200905,2009), -('2009-05-22',200921,5,2009,22,20,200905,2009), -('2009-05-23',200921,5,2009,23,20,200905,2009), -('2009-05-24',200922,5,2009,24,21,200905,2009), -('2009-05-25',200922,5,2009,25,21,200905,2009), -('2009-05-26',200922,5,2009,26,21,200905,2009), -('2009-05-27',200922,5,2009,27,21,200905,2009), -('2009-05-28',200922,5,2009,28,21,200905,2009), -('2009-05-29',200922,5,2009,29,21,200905,2009), -('2009-05-30',200922,5,2009,30,21,200905,2009), -('2009-05-31',200923,5,2009,31,22,200905,2009), -('2009-06-01',200923,6,2009,1,22,200906,2009), -('2009-06-02',200923,6,2009,2,22,200906,2009), -('2009-06-03',200923,6,2009,3,22,200906,2009), -('2009-06-04',200923,6,2009,4,22,200906,2009), -('2009-06-05',200923,6,2009,5,22,200906,2009), -('2009-06-06',200923,6,2009,6,22,200906,2009), -('2009-06-07',200924,6,2009,7,23,200906,2009), -('2009-06-08',200924,6,2009,8,23,200906,2009), -('2009-06-09',200924,6,2009,9,23,200906,2009), -('2009-06-10',200924,6,2009,10,23,200906,2009), -('2009-06-11',200924,6,2009,11,23,200906,2009), -('2009-06-12',200924,6,2009,12,23,200906,2009), -('2009-06-13',200924,6,2009,13,23,200906,2009), -('2009-06-14',200925,6,2009,14,24,200906,2009), -('2009-06-15',200925,6,2009,15,24,200906,2009), -('2009-06-16',200925,6,2009,16,24,200906,2009), -('2009-06-17',200925,6,2009,17,24,200906,2009), -('2009-06-18',200925,6,2009,18,24,200906,2009), -('2009-06-19',200925,6,2009,19,24,200906,2009), -('2009-06-20',200925,6,2009,20,24,200906,2009), -('2009-06-21',200926,6,2009,21,25,200906,2009), -('2009-06-22',200926,6,2009,22,25,200906,2009), -('2009-06-23',200926,6,2009,23,25,200906,2009), -('2009-06-24',200926,6,2009,24,25,200906,2009), -('2009-06-25',200926,6,2009,25,25,200906,2009), -('2009-06-26',200926,6,2009,26,25,200906,2009), -('2009-06-27',200926,6,2009,27,25,200906,2009), -('2009-06-28',200927,6,2009,28,26,200906,2009), -('2009-06-29',200927,6,2009,29,26,200906,2009), -('2009-06-30',200927,6,2009,30,26,200906,2009), -('2009-07-01',200927,7,2009,1,26,200907,2009), -('2009-07-02',200927,7,2009,2,26,200907,2009), -('2009-07-03',200927,7,2009,3,26,200907,2009), -('2009-07-04',200927,7,2009,4,26,200907,2009), -('2009-07-05',200928,7,2009,5,27,200907,2009), -('2009-07-06',200928,7,2009,6,27,200907,2009), -('2009-07-07',200928,7,2009,7,27,200907,2009), -('2009-07-08',200928,7,2009,8,27,200907,2009), -('2009-07-09',200928,7,2009,9,27,200907,2009), -('2009-07-10',200928,7,2009,10,27,200907,2009), -('2009-07-11',200928,7,2009,11,27,200907,2009), -('2009-07-12',200929,7,2009,12,28,200907,2009), -('2009-07-13',200929,7,2009,13,28,200907,2009), -('2009-07-14',200929,7,2009,14,28,200907,2009), -('2009-07-15',200929,7,2009,15,28,200907,2009), -('2009-07-16',200929,7,2009,16,28,200907,2009), -('2009-07-17',200929,7,2009,17,28,200907,2009), -('2009-07-18',200929,7,2009,18,28,200907,2009), -('2009-07-19',200930,7,2009,19,29,200907,2009), -('2009-07-20',200930,7,2009,20,29,200907,2009), -('2009-07-21',200930,7,2009,21,29,200907,2009), -('2009-07-22',200930,7,2009,22,29,200907,2009), -('2009-07-23',200930,7,2009,23,29,200907,2009), -('2009-07-24',200930,7,2009,24,29,200907,2009), -('2009-07-25',200930,7,2009,25,29,200907,2009), -('2009-07-26',200931,7,2009,26,30,200907,2009), -('2009-07-27',200931,7,2009,27,30,200907,2009), -('2009-07-28',200931,7,2009,28,30,200907,2009), -('2009-07-29',200931,7,2009,29,30,200907,2009), -('2009-07-30',200931,7,2009,30,30,200907,2009), -('2009-07-31',200931,7,2009,31,30,200907,2009), -('2009-08-01',200931,8,2009,1,30,200908,2009), -('2009-08-02',200932,8,2009,2,31,200908,2009), -('2009-08-03',200932,8,2009,3,31,200908,2009), -('2009-08-04',200932,8,2009,4,31,200908,2009), -('2009-08-05',200932,8,2009,5,31,200908,2009), -('2009-08-06',200932,8,2009,6,31,200908,2009), -('2009-08-07',200932,8,2009,7,31,200908,2009), -('2009-08-08',200932,8,2009,8,31,200908,2009), -('2009-08-09',200933,8,2009,9,32,200908,2009), -('2009-08-10',200933,8,2009,10,32,200908,2009), -('2009-08-11',200933,8,2009,11,32,200908,2009), -('2009-08-12',200933,8,2009,12,32,200908,2009), -('2009-08-13',200933,8,2009,13,32,200908,2009), -('2009-08-14',200933,8,2009,14,32,200908,2009), -('2009-08-15',200933,8,2009,15,32,200908,2009), -('2009-08-16',200934,8,2009,16,33,200908,2009), -('2009-08-17',200934,8,2009,17,33,200908,2009), -('2009-08-18',200934,8,2009,18,33,200908,2009), -('2009-08-19',200934,8,2009,19,33,200908,2009), -('2009-08-20',200934,8,2009,20,33,200908,2009), -('2009-08-21',200934,8,2009,21,33,200908,2009), -('2009-08-22',200934,8,2009,22,33,200908,2009), -('2009-08-23',200935,8,2009,23,34,200908,2009), -('2009-08-24',200935,8,2009,24,34,200908,2009), -('2009-08-25',200935,8,2009,25,34,200908,2009), -('2009-08-26',200935,8,2009,26,34,200908,2009), -('2009-08-27',200935,8,2009,27,34,200908,2009), -('2009-08-28',200935,8,2009,28,34,200908,2009), -('2009-08-29',200935,8,2009,29,34,200908,2009), -('2009-08-30',200936,8,2009,30,35,200908,2009), -('2009-08-31',200936,8,2009,31,35,200908,2009), -('2009-09-01',200936,9,2009,1,35,200909,2009), -('2009-09-02',200936,9,2009,2,35,200909,2009), -('2009-09-03',200936,9,2009,3,35,200909,2009), -('2009-09-04',200936,9,2009,4,35,200909,2009), -('2009-09-05',200936,9,2009,5,35,200909,2009), -('2009-09-06',200937,9,2009,6,36,200909,2009), -('2009-09-07',200937,9,2009,7,36,200909,2009), -('2009-09-08',200937,9,2009,8,36,200909,2009), -('2009-09-09',200937,9,2009,9,36,200909,2009), -('2009-09-10',200937,9,2009,10,36,200909,2009), -('2009-09-11',200937,9,2009,11,36,200909,2009), -('2009-09-12',200937,9,2009,12,36,200909,2009), -('2009-09-13',200938,9,2009,13,37,200909,2009), -('2009-09-14',200938,9,2009,14,37,200909,2009), -('2009-09-15',200938,9,2009,15,37,200909,2009), -('2009-09-16',200938,9,2009,16,37,200909,2009), -('2009-09-17',200938,9,2009,17,37,200909,2009), -('2009-09-18',200938,9,2009,18,37,200909,2009), -('2009-09-19',200938,9,2009,19,37,200909,2009), -('2009-09-20',200939,9,2009,20,38,200909,2009), -('2009-09-21',200939,9,2009,21,38,200909,2009), -('2009-09-22',200939,9,2009,22,38,200909,2009), -('2009-09-23',200939,9,2009,23,38,200909,2009), -('2009-09-24',200939,9,2009,24,38,200909,2009), -('2009-09-25',200939,9,2009,25,38,200909,2009), -('2009-09-26',200939,9,2009,26,38,200909,2009), -('2009-09-27',200940,9,2009,27,39,200909,2009), -('2009-09-28',200940,9,2009,28,39,200909,2009), -('2009-09-29',200940,9,2009,29,39,200909,2009), -('2009-09-30',200940,9,2009,30,39,200909,2009), -('2009-10-01',200940,10,2009,1,39,200910,2009), -('2009-10-02',200940,10,2009,2,39,200910,2009), -('2009-10-03',200940,10,2009,3,39,200910,2009), -('2009-10-04',200941,10,2009,4,40,200910,2009), -('2009-10-05',200941,10,2009,5,40,200910,2009), -('2009-10-06',200941,10,2009,6,40,200910,2009), -('2009-10-07',200941,10,2009,7,40,200910,2009), -('2009-10-08',200941,10,2009,8,40,200910,2009), -('2009-10-09',200941,10,2009,9,40,200910,2009), -('2009-10-10',200941,10,2009,10,40,200910,2009), -('2009-10-11',200942,10,2009,11,41,200910,2009), -('2009-10-12',200942,10,2009,12,41,200910,2009), -('2009-10-13',200942,10,2009,13,41,200910,2009), -('2009-10-14',200942,10,2009,14,41,200910,2009), -('2009-10-15',200942,10,2009,15,41,200910,2009), -('2009-10-16',200942,10,2009,16,41,200910,2009), -('2009-10-17',200942,10,2009,17,41,200910,2009), -('2009-10-18',200943,10,2009,18,42,200910,2009), -('2009-10-19',200943,10,2009,19,42,200910,2009), -('2009-10-20',200943,10,2009,20,42,200910,2009), -('2009-10-21',200943,10,2009,21,42,200910,2009), -('2009-10-22',200943,10,2009,22,42,200910,2009), -('2009-10-23',200943,10,2009,23,42,200910,2009), -('2009-10-24',200943,10,2009,24,42,200910,2009), -('2009-10-25',200944,10,2009,25,43,200910,2009), -('2009-10-26',200944,10,2009,26,43,200910,2009), -('2009-10-27',200944,10,2009,27,43,200910,2009), -('2009-10-28',200944,10,2009,28,43,200910,2009), -('2009-10-29',200944,10,2009,29,43,200910,2009), -('2009-10-30',200944,10,2009,30,43,200910,2009), -('2009-10-31',200944,10,2009,31,43,200910,2009), -('2009-11-01',200945,11,2009,1,44,200911,2009), -('2009-11-02',200945,11,2009,2,44,200911,2009), -('2009-11-03',200945,11,2009,3,44,200911,2009), -('2009-11-04',200945,11,2009,4,44,200911,2009), -('2009-11-05',200945,11,2009,5,44,200911,2009), -('2009-11-06',200945,11,2009,6,44,200911,2009), -('2009-11-07',200945,11,2009,7,44,200911,2009), -('2009-11-08',200946,11,2009,8,45,200911,2009), -('2009-11-09',200946,11,2009,9,45,200911,2009), -('2009-11-10',200946,11,2009,10,45,200911,2009), -('2009-11-11',200946,11,2009,11,45,200911,2009), -('2009-11-12',200946,11,2009,12,45,200911,2009), -('2009-11-13',200946,11,2009,13,45,200911,2009), -('2009-11-14',200946,11,2009,14,45,200911,2009), -('2009-11-15',200947,11,2009,15,46,200911,2009), -('2009-11-16',200947,11,2009,16,46,200911,2009), -('2009-11-17',200947,11,2009,17,46,200911,2009), -('2009-11-18',200947,11,2009,18,46,200911,2009), -('2009-11-19',200947,11,2009,19,46,200911,2009), -('2009-11-20',200947,11,2009,20,46,200911,2009), -('2009-11-21',200947,11,2009,21,46,200911,2009), -('2009-11-22',200948,11,2009,22,47,200911,2009), -('2009-11-23',200948,11,2009,23,47,200911,2009), -('2009-11-24',200948,11,2009,24,47,200911,2009), -('2009-11-25',200948,11,2009,25,47,200911,2009), -('2009-11-26',200948,11,2009,26,47,200911,2009), -('2009-11-27',200948,11,2009,27,47,200911,2009), -('2009-11-28',200948,11,2009,28,47,200911,2009), -('2009-11-29',200949,11,2009,29,48,200911,2009), -('2009-11-30',200949,11,2009,30,48,200911,2009), -('2009-12-01',200949,12,2009,1,48,200912,2010), -('2009-12-02',200949,12,2009,2,48,200912,2010), -('2009-12-03',200949,12,2009,3,48,200912,2010), -('2009-12-04',200949,12,2009,4,48,200912,2010), -('2009-12-05',200949,12,2009,5,48,200912,2010), -('2009-12-06',200950,12,2009,6,49,200912,2010), -('2009-12-07',200950,12,2009,7,49,200912,2010), -('2009-12-08',200950,12,2009,8,49,200912,2010), -('2009-12-09',200950,12,2009,9,49,200912,2010), -('2009-12-10',200950,12,2009,10,49,200912,2010), -('2009-12-11',200950,12,2009,11,49,200912,2010), -('2009-12-12',200950,12,2009,12,49,200912,2010), -('2009-12-13',200951,12,2009,13,50,200912,2010), -('2009-12-14',200951,12,2009,14,50,200912,2010), -('2009-12-15',200951,12,2009,15,50,200912,2010), -('2009-12-16',200951,12,2009,16,50,200912,2010), -('2009-12-17',200951,12,2009,17,50,200912,2010), -('2009-12-18',200951,12,2009,18,50,200912,2010), -('2009-12-19',200951,12,2009,19,50,200912,2010), -('2009-12-20',200952,12,2009,20,51,200912,2010), -('2009-12-21',200952,12,2009,21,51,200912,2010), -('2009-12-22',200952,12,2009,22,51,200912,2010), -('2009-12-23',200952,12,2009,23,51,200912,2010), -('2009-12-24',200952,12,2009,24,51,200912,2010), -('2009-12-25',200952,12,2009,25,51,200912,2010), -('2009-12-26',200952,12,2009,26,51,200912,2010), -('2009-12-27',200953,12,2009,27,52,200912,2010), -('2009-12-28',200952,12,2009,28,52,200912,2010), -('2009-12-29',200952,12,2009,29,52,200912,2010), -('2009-12-30',200952,12,2009,30,52,200912,2010), -('2009-12-31',200952,12,2009,31,52,200912,2010), -('2010-01-01',201001,1,2010,1,52,201001,2010), -('2010-01-02',201001,1,2010,2,52,201001,2010), -('2010-01-03',201002,1,2010,3,1,201001,2010), -('2010-01-04',201001,1,2010,4,1,201001,2010), -('2010-01-05',201001,1,2010,5,1,201001,2010), -('2010-01-06',201001,1,2010,6,1,201001,2010), -('2010-01-07',201001,1,2010,7,1,201001,2010), -('2010-01-08',201001,1,2010,8,1,201001,2010), -('2010-01-09',201001,1,2010,9,1,201001,2010), -('2010-01-10',201002,1,2010,10,2,201001,2010), -('2010-01-11',201002,1,2010,11,2,201001,2010), -('2010-01-12',201002,1,2010,12,2,201001,2010), -('2010-01-13',201002,1,2010,13,2,201001,2010), -('2010-01-14',201002,1,2010,14,2,201001,2010), -('2010-01-15',201002,1,2010,15,2,201001,2010), -('2010-01-16',201002,1,2010,16,2,201001,2010), -('2010-01-17',201003,1,2010,17,3,201001,2010), -('2010-01-18',201003,1,2010,18,3,201001,2010), -('2010-01-19',201003,1,2010,19,3,201001,2010), -('2010-01-20',201003,1,2010,20,3,201001,2010), -('2010-01-21',201003,1,2010,21,3,201001,2010), -('2010-01-22',201003,1,2010,22,3,201001,2010), -('2010-01-23',201003,1,2010,23,3,201001,2010), -('2010-01-24',201004,1,2010,24,4,201001,2010), -('2010-01-25',201004,1,2010,25,4,201001,2010), -('2010-01-26',201004,1,2010,26,4,201001,2010), -('2010-01-27',201004,1,2010,27,4,201001,2010), -('2010-01-28',201004,1,2010,28,4,201001,2010), -('2010-01-29',201004,1,2010,29,4,201001,2010), -('2010-01-30',201004,1,2010,30,4,201001,2010), -('2010-01-31',201005,1,2010,31,5,201001,2010), -('2010-02-01',201005,2,2010,1,5,201002,2010), -('2010-02-02',201005,2,2010,2,5,201002,2010), -('2010-02-03',201005,2,2010,3,5,201002,2010), -('2010-02-04',201005,2,2010,4,5,201002,2010), -('2010-02-05',201005,2,2010,5,5,201002,2010), -('2010-02-06',201005,2,2010,6,5,201002,2010), -('2010-02-07',201006,2,2010,7,6,201002,2010), -('2010-02-08',201006,2,2010,8,6,201002,2010), -('2010-02-09',201006,2,2010,9,6,201002,2010), -('2010-02-10',201006,2,2010,10,6,201002,2010), -('2010-02-11',201006,2,2010,11,6,201002,2010), -('2010-02-12',201006,2,2010,12,6,201002,2010), -('2010-02-13',201006,2,2010,13,6,201002,2010), -('2010-02-14',201007,2,2010,14,7,201002,2010), -('2010-02-15',201007,2,2010,15,7,201002,2010), -('2010-02-16',201007,2,2010,16,7,201002,2010), -('2010-02-17',201007,2,2010,17,7,201002,2010), -('2010-02-18',201007,2,2010,18,7,201002,2010), -('2010-02-19',201007,2,2010,19,7,201002,2010), -('2010-02-20',201007,2,2010,20,7,201002,2010), -('2010-02-21',201008,2,2010,21,8,201002,2010), -('2010-02-22',201008,2,2010,22,8,201002,2010), -('2010-02-23',201008,2,2010,23,8,201002,2010), -('2010-02-24',201008,2,2010,24,8,201002,2010), -('2010-02-25',201008,2,2010,25,8,201002,2010), -('2010-02-26',201008,2,2010,26,8,201002,2010), -('2010-02-27',201008,2,2010,27,8,201002,2010), -('2010-02-28',201009,2,2010,28,9,201002,2010), -('2010-03-01',201009,3,2010,1,9,201003,2010), -('2010-03-02',201009,3,2010,2,9,201003,2010), -('2010-03-03',201009,3,2010,3,9,201003,2010), -('2010-03-04',201009,3,2010,4,9,201003,2010), -('2010-03-05',201009,3,2010,5,9,201003,2010), -('2010-03-06',201009,3,2010,6,9,201003,2010), -('2010-03-07',201010,3,2010,7,10,201003,2010), -('2010-03-08',201010,3,2010,8,10,201003,2010), -('2010-03-09',201010,3,2010,9,10,201003,2010), -('2010-03-10',201010,3,2010,10,10,201003,2010), -('2010-03-11',201010,3,2010,11,10,201003,2010), -('2010-03-12',201010,3,2010,12,10,201003,2010), -('2010-03-13',201010,3,2010,13,10,201003,2010), -('2010-03-14',201011,3,2010,14,11,201003,2010), -('2010-03-15',201011,3,2010,15,11,201003,2010), -('2010-03-16',201011,3,2010,16,11,201003,2010), -('2010-03-17',201011,3,2010,17,11,201003,2010), -('2010-03-18',201011,3,2010,18,11,201003,2010), -('2010-03-19',201011,3,2010,19,11,201003,2010), -('2010-03-20',201011,3,2010,20,11,201003,2010), -('2010-03-21',201012,3,2010,21,12,201003,2010), -('2010-03-22',201012,3,2010,22,12,201003,2010), -('2010-03-23',201012,3,2010,23,12,201003,2010), -('2010-03-24',201012,3,2010,24,12,201003,2010), -('2010-03-25',201012,3,2010,25,12,201003,2010), -('2010-03-26',201012,3,2010,26,12,201003,2010), -('2010-03-27',201012,3,2010,27,12,201003,2010), -('2010-03-28',201013,3,2010,28,13,201003,2010), -('2010-03-29',201013,3,2010,29,13,201003,2010), -('2010-03-30',201013,3,2010,30,13,201003,2010), -('2010-03-31',201013,3,2010,31,13,201003,2010), -('2010-04-01',201013,4,2010,1,13,201004,2010), -('2010-04-02',201013,4,2010,2,13,201004,2010), -('2010-04-03',201013,4,2010,3,13,201004,2010), -('2010-04-04',201014,4,2010,4,14,201004,2010), -('2010-04-05',201014,4,2010,5,14,201004,2010), -('2010-04-06',201014,4,2010,6,14,201004,2010), -('2010-04-07',201014,4,2010,7,14,201004,2010), -('2010-04-08',201014,4,2010,8,14,201004,2010), -('2010-04-09',201014,4,2010,9,14,201004,2010), -('2010-04-10',201014,4,2010,10,14,201004,2010), -('2010-04-11',201015,4,2010,11,15,201004,2010), -('2010-04-12',201015,4,2010,12,15,201004,2010), -('2010-04-13',201015,4,2010,13,15,201004,2010), -('2010-04-14',201015,4,2010,14,15,201004,2010), -('2010-04-15',201015,4,2010,15,15,201004,2010), -('2010-04-16',201015,4,2010,16,15,201004,2010), -('2010-04-17',201015,4,2010,17,15,201004,2010), -('2010-04-18',201016,4,2010,18,16,201004,2010), -('2010-04-19',201016,4,2010,19,16,201004,2010), -('2010-04-20',201016,4,2010,20,16,201004,2010), -('2010-04-21',201016,4,2010,21,16,201004,2010), -('2010-04-22',201016,4,2010,22,16,201004,2010), -('2010-04-23',201016,4,2010,23,16,201004,2010), -('2010-04-24',201016,4,2010,24,16,201004,2010), -('2010-04-25',201017,4,2010,25,17,201004,2010), -('2010-04-26',201017,4,2010,26,17,201004,2010), -('2010-04-27',201017,4,2010,27,17,201004,2010), -('2010-04-28',201017,4,2010,28,17,201004,2010), -('2010-04-29',201017,4,2010,29,17,201004,2010), -('2010-04-30',201017,4,2010,30,17,201004,2010), -('2010-05-01',201017,5,2010,1,17,201005,2010), -('2010-05-02',201018,5,2010,2,18,201005,2010), -('2010-05-03',201018,5,2010,3,18,201005,2010), -('2010-05-04',201018,5,2010,4,18,201005,2010), -('2010-05-05',201018,5,2010,5,18,201005,2010), -('2010-05-06',201018,5,2010,6,18,201005,2010), -('2010-05-07',201018,5,2010,7,18,201005,2010), -('2010-05-08',201018,5,2010,8,18,201005,2010), -('2010-05-09',201019,5,2010,9,19,201005,2010), -('2010-05-10',201019,5,2010,10,19,201005,2010), -('2010-05-11',201019,5,2010,11,19,201005,2010), -('2010-05-12',201019,5,2010,12,19,201005,2010), -('2010-05-13',201019,5,2010,13,19,201005,2010), -('2010-05-14',201019,5,2010,14,19,201005,2010), -('2010-05-15',201019,5,2010,15,19,201005,2010), -('2010-05-16',201020,5,2010,16,20,201005,2010), -('2010-05-17',201020,5,2010,17,20,201005,2010), -('2010-05-18',201020,5,2010,18,20,201005,2010), -('2010-05-19',201020,5,2010,19,20,201005,2010), -('2010-05-20',201020,5,2010,20,20,201005,2010), -('2010-05-21',201020,5,2010,21,20,201005,2010), -('2010-05-22',201020,5,2010,22,20,201005,2010), -('2010-05-23',201021,5,2010,23,21,201005,2010), -('2010-05-24',201021,5,2010,24,21,201005,2010), -('2010-05-25',201021,5,2010,25,21,201005,2010), -('2010-05-26',201021,5,2010,26,21,201005,2010), -('2010-05-27',201021,5,2010,27,21,201005,2010), -('2010-05-28',201021,5,2010,28,21,201005,2010), -('2010-05-29',201021,5,2010,29,21,201005,2010), -('2010-05-30',201022,5,2010,30,22,201005,2010), -('2010-05-31',201022,5,2010,31,22,201005,2010), -('2010-06-01',201022,6,2010,1,22,201006,2010), -('2010-06-02',201022,6,2010,2,22,201006,2010), -('2010-06-03',201022,6,2010,3,22,201006,2010), -('2010-06-04',201022,6,2010,4,22,201006,2010), -('2010-06-05',201022,6,2010,5,22,201006,2010), -('2010-06-06',201023,6,2010,6,23,201006,2010), -('2010-06-07',201023,6,2010,7,23,201006,2010), -('2010-06-08',201023,6,2010,8,23,201006,2010), -('2010-06-09',201023,6,2010,9,23,201006,2010), -('2010-06-10',201023,6,2010,10,23,201006,2010), -('2010-06-11',201023,6,2010,11,23,201006,2010), -('2010-06-12',201023,6,2010,12,23,201006,2010), -('2010-06-13',201024,6,2010,13,24,201006,2010), -('2010-06-14',201024,6,2010,14,24,201006,2010), -('2010-06-15',201024,6,2010,15,24,201006,2010), -('2010-06-16',201024,6,2010,16,24,201006,2010), -('2010-06-17',201024,6,2010,17,24,201006,2010), -('2010-06-18',201024,6,2010,18,24,201006,2010), -('2010-06-19',201024,6,2010,19,24,201006,2010), -('2010-06-20',201025,6,2010,20,25,201006,2010), -('2010-06-21',201025,6,2010,21,25,201006,2010), -('2010-06-22',201025,6,2010,22,25,201006,2010), -('2010-06-23',201025,6,2010,23,25,201006,2010), -('2010-06-24',201025,6,2010,24,25,201006,2010), -('2010-06-25',201025,6,2010,25,25,201006,2010), -('2010-06-26',201025,6,2010,26,25,201006,2010), -('2010-06-27',201026,6,2010,27,26,201006,2010), -('2010-06-28',201026,6,2010,28,26,201006,2010), -('2010-06-29',201026,6,2010,29,26,201006,2010), -('2010-06-30',201026,6,2010,30,26,201006,2010), -('2010-07-01',201026,7,2010,1,26,201007,2010), -('2010-07-02',201026,7,2010,2,26,201007,2010), -('2010-07-03',201026,7,2010,3,26,201007,2010), -('2010-07-04',201027,7,2010,4,27,201007,2010), -('2010-07-05',201027,7,2010,5,27,201007,2010), -('2010-07-06',201027,7,2010,6,27,201007,2010), -('2010-07-07',201027,7,2010,7,27,201007,2010), -('2010-07-08',201027,7,2010,8,27,201007,2010), -('2010-07-09',201027,7,2010,9,27,201007,2010), -('2010-07-10',201027,7,2010,10,27,201007,2010), -('2010-07-11',201028,7,2010,11,28,201007,2010), -('2010-07-12',201028,7,2010,12,28,201007,2010), -('2010-07-13',201028,7,2010,13,28,201007,2010), -('2010-07-14',201028,7,2010,14,28,201007,2010), -('2010-07-15',201028,7,2010,15,28,201007,2010), -('2010-07-16',201028,7,2010,16,28,201007,2010), -('2010-07-17',201028,7,2010,17,28,201007,2010), -('2010-07-18',201029,7,2010,18,29,201007,2010), -('2010-07-19',201029,7,2010,19,29,201007,2010), -('2010-07-20',201029,7,2010,20,29,201007,2010), -('2010-07-21',201029,7,2010,21,29,201007,2010), -('2010-07-22',201029,7,2010,22,29,201007,2010), -('2010-07-23',201029,7,2010,23,29,201007,2010), -('2010-07-24',201029,7,2010,24,29,201007,2010), -('2010-07-25',201030,7,2010,25,30,201007,2010), -('2010-07-26',201030,7,2010,26,30,201007,2010), -('2010-07-27',201030,7,2010,27,30,201007,2010), -('2010-07-28',201030,7,2010,28,30,201007,2010), -('2010-07-29',201030,7,2010,29,30,201007,2010), -('2010-07-30',201030,7,2010,30,30,201007,2010), -('2010-07-31',201030,7,2010,31,30,201007,2010), -('2010-08-01',201031,8,2010,1,31,201008,2010), -('2010-08-02',201031,8,2010,2,31,201008,2010), -('2010-08-03',201031,8,2010,3,31,201008,2010), -('2010-08-04',201031,8,2010,4,31,201008,2010), -('2010-08-05',201031,8,2010,5,31,201008,2010), -('2010-08-06',201031,8,2010,6,31,201008,2010), -('2010-08-07',201031,8,2010,7,31,201008,2010), -('2010-08-08',201032,8,2010,8,32,201008,2010), -('2010-08-09',201032,8,2010,9,32,201008,2010), -('2010-08-10',201032,8,2010,10,32,201008,2010), -('2010-08-11',201032,8,2010,11,32,201008,2010), -('2010-08-12',201032,8,2010,12,32,201008,2010), -('2010-08-13',201032,8,2010,13,32,201008,2010), -('2010-08-14',201032,8,2010,14,32,201008,2010), -('2010-08-15',201033,8,2010,15,33,201008,2010), -('2010-08-16',201033,8,2010,16,33,201008,2010), -('2010-08-17',201033,8,2010,17,33,201008,2010), -('2010-08-18',201033,8,2010,18,33,201008,2010), -('2010-08-19',201033,8,2010,19,33,201008,2010), -('2010-08-20',201033,8,2010,20,33,201008,2010), -('2010-08-21',201033,8,2010,21,33,201008,2010), -('2010-08-22',201034,8,2010,22,34,201008,2010), -('2010-08-23',201034,8,2010,23,34,201008,2010), -('2010-08-24',201034,8,2010,24,34,201008,2010), -('2010-08-25',201034,8,2010,25,34,201008,2010), -('2010-08-26',201034,8,2010,26,34,201008,2010), -('2010-08-27',201034,8,2010,27,34,201008,2010), -('2010-08-28',201034,8,2010,28,34,201008,2010), -('2010-08-29',201035,8,2010,29,35,201008,2010), -('2010-08-30',201035,8,2010,30,35,201008,2010), -('2010-08-31',201035,8,2010,31,35,201008,2010), -('2010-09-01',201035,9,2010,1,35,201009,2010), -('2010-09-02',201035,9,2010,2,35,201009,2010), -('2010-09-03',201035,9,2010,3,35,201009,2010), -('2010-09-04',201035,9,2010,4,35,201009,2010), -('2010-09-05',201036,9,2010,5,36,201009,2010), -('2010-09-06',201036,9,2010,6,36,201009,2010), -('2010-09-07',201036,9,2010,7,36,201009,2010), -('2010-09-08',201036,9,2010,8,36,201009,2010), -('2010-09-09',201036,9,2010,9,36,201009,2010), -('2010-09-10',201036,9,2010,10,36,201009,2010), -('2010-09-11',201036,9,2010,11,36,201009,2010), -('2010-09-12',201037,9,2010,12,37,201009,2010), -('2010-09-13',201037,9,2010,13,37,201009,2010), -('2010-09-14',201037,9,2010,14,37,201009,2010), -('2010-09-15',201037,9,2010,15,37,201009,2010), -('2010-09-16',201037,9,2010,16,37,201009,2010), -('2010-09-17',201037,9,2010,17,37,201009,2010), -('2010-09-18',201037,9,2010,18,37,201009,2010), -('2010-09-19',201038,9,2010,19,38,201009,2010), -('2010-09-20',201038,9,2010,20,38,201009,2010), -('2010-09-21',201038,9,2010,21,38,201009,2010), -('2010-09-22',201038,9,2010,22,38,201009,2010), -('2010-09-23',201038,9,2010,23,38,201009,2010), -('2010-09-24',201038,9,2010,24,38,201009,2010), -('2010-09-25',201038,9,2010,25,38,201009,2010), -('2010-09-26',201039,9,2010,26,39,201009,2010), -('2010-09-27',201039,9,2010,27,39,201009,2010), -('2010-09-28',201039,9,2010,28,39,201009,2010), -('2010-09-29',201039,9,2010,29,39,201009,2010), -('2010-09-30',201039,9,2010,30,39,201009,2010), -('2010-10-01',201039,10,2010,1,39,201010,2010), -('2010-10-02',201039,10,2010,2,39,201010,2010), -('2010-10-03',201040,10,2010,3,40,201010,2010), -('2010-10-04',201040,10,2010,4,40,201010,2010), -('2010-10-05',201040,10,2010,5,40,201010,2010), -('2010-10-06',201040,10,2010,6,40,201010,2010), -('2010-10-07',201040,10,2010,7,40,201010,2010), -('2010-10-08',201040,10,2010,8,40,201010,2010), -('2010-10-09',201040,10,2010,9,40,201010,2010), -('2010-10-10',201041,10,2010,10,41,201010,2010), -('2010-10-11',201041,10,2010,11,41,201010,2010), -('2010-10-12',201041,10,2010,12,41,201010,2010), -('2010-10-13',201041,10,2010,13,41,201010,2010), -('2010-10-14',201041,10,2010,14,41,201010,2010), -('2010-10-15',201041,10,2010,15,41,201010,2010), -('2010-10-16',201041,10,2010,16,41,201010,2010), -('2010-10-17',201042,10,2010,17,42,201010,2010), -('2010-10-18',201042,10,2010,18,42,201010,2010), -('2010-10-19',201042,10,2010,19,42,201010,2010), -('2010-10-20',201042,10,2010,20,42,201010,2010), -('2010-10-21',201042,10,2010,21,42,201010,2010), -('2010-10-22',201042,10,2010,22,42,201010,2010), -('2010-10-23',201042,10,2010,23,42,201010,2010), -('2010-10-24',201043,10,2010,24,43,201010,2010), -('2010-10-25',201043,10,2010,25,43,201010,2010), -('2010-10-26',201043,10,2010,26,43,201010,2010), -('2010-10-27',201043,10,2010,27,43,201010,2010), -('2010-10-28',201043,10,2010,28,43,201010,2010), -('2010-10-29',201043,10,2010,29,43,201010,2010), -('2010-10-30',201043,10,2010,30,43,201010,2010), -('2010-10-31',201044,10,2010,31,44,201010,2010), -('2010-11-01',201044,11,2010,1,44,201011,2010), -('2010-11-02',201044,11,2010,2,44,201011,2010), -('2010-11-03',201044,11,2010,3,44,201011,2010), -('2010-11-04',201044,11,2010,4,44,201011,2010), -('2010-11-05',201044,11,2010,5,44,201011,2010), -('2010-11-06',201044,11,2010,6,44,201011,2010), -('2010-11-07',201045,11,2010,7,45,201011,2010), -('2010-11-08',201045,11,2010,8,45,201011,2010), -('2010-11-09',201045,11,2010,9,45,201011,2010), -('2010-11-10',201045,11,2010,10,45,201011,2010), -('2010-11-11',201045,11,2010,11,45,201011,2010), -('2010-11-12',201045,11,2010,12,45,201011,2010), -('2010-11-13',201045,11,2010,13,45,201011,2010), -('2010-11-14',201046,11,2010,14,46,201011,2010), -('2010-11-15',201046,11,2010,15,46,201011,2010), -('2010-11-16',201046,11,2010,16,46,201011,2010), -('2010-11-17',201046,11,2010,17,46,201011,2010), -('2010-11-18',201046,11,2010,18,46,201011,2010), -('2010-11-19',201046,11,2010,19,46,201011,2010), -('2010-11-20',201046,11,2010,20,46,201011,2010), -('2010-11-21',201047,11,2010,21,47,201011,2010), -('2010-11-22',201047,11,2010,22,47,201011,2010), -('2010-11-23',201047,11,2010,23,47,201011,2010), -('2010-11-24',201047,11,2010,24,47,201011,2010), -('2010-11-25',201047,11,2010,25,47,201011,2010), -('2010-11-26',201047,11,2010,26,47,201011,2010), -('2010-11-27',201047,11,2010,27,47,201011,2010), -('2010-11-28',201048,11,2010,28,48,201011,2010), -('2010-11-29',201048,11,2010,29,48,201011,2010), -('2010-11-30',201048,11,2010,30,48,201011,2010), -('2010-12-01',201048,12,2010,1,48,201012,2011), -('2010-12-02',201048,12,2010,2,48,201012,2011), -('2010-12-03',201048,12,2010,3,48,201012,2011), -('2010-12-04',201048,12,2010,4,48,201012,2011), -('2010-12-05',201049,12,2010,5,49,201012,2011), -('2010-12-06',201049,12,2010,6,49,201012,2011), -('2010-12-07',201049,12,2010,7,49,201012,2011), -('2010-12-08',201049,12,2010,8,49,201012,2011), -('2010-12-09',201049,12,2010,9,49,201012,2011), -('2010-12-10',201049,12,2010,10,49,201012,2011), -('2010-12-11',201049,12,2010,11,49,201012,2011), -('2010-12-12',201050,12,2010,12,50,201012,2011), -('2010-12-13',201050,12,2010,13,50,201012,2011), -('2010-12-14',201050,12,2010,14,50,201012,2011), -('2010-12-15',201050,12,2010,15,50,201012,2011), -('2010-12-16',201050,12,2010,16,50,201012,2011), -('2010-12-17',201050,12,2010,17,50,201012,2011), -('2010-12-18',201050,12,2010,18,50,201012,2011), -('2010-12-19',201051,12,2010,19,51,201012,2011), -('2010-12-20',201051,12,2010,20,51,201012,2011), -('2010-12-21',201051,12,2010,21,51,201012,2011), -('2010-12-22',201051,12,2010,22,51,201012,2011), -('2010-12-23',201051,12,2010,23,51,201012,2011), -('2010-12-24',201051,12,2010,24,51,201012,2011), -('2010-12-25',201051,12,2010,25,51,201012,2011), -('2010-12-26',201052,12,2010,26,52,201012,2011), -('2010-12-27',201052,12,2010,27,52,201012,2011), -('2010-12-28',201052,12,2010,28,52,201012,2011), -('2010-12-29',201052,12,2010,29,52,201012,2011), -('2010-12-30',201052,12,2010,30,52,201012,2011), -('2010-12-31',201052,12,2010,31,52,201012,2011), -('2011-01-01',201052,1,2011,1,52,201101,2011), -('2011-01-02',201053,1,2011,2,1,201101,2011), -('2011-01-03',201101,1,2011,3,1,201101,2011), -('2011-01-04',201101,1,2011,4,1,201101,2011), -('2011-01-05',201101,1,2011,5,1,201101,2011), -('2011-01-06',201101,1,2011,6,1,201101,2011), -('2011-01-07',201101,1,2011,7,1,201101,2011), -('2011-01-08',201101,1,2011,8,1,201101,2011), -('2011-01-09',201102,1,2011,9,2,201101,2011), -('2011-01-10',201102,1,2011,10,2,201101,2011), -('2011-01-11',201102,1,2011,11,2,201101,2011), -('2011-01-12',201102,1,2011,12,2,201101,2011), -('2011-01-13',201102,1,2011,13,2,201101,2011), -('2011-01-14',201102,1,2011,14,2,201101,2011), -('2011-01-15',201102,1,2011,15,2,201101,2011), -('2011-01-16',201103,1,2011,16,3,201101,2011), -('2011-01-17',201103,1,2011,17,3,201101,2011), -('2011-01-18',201103,1,2011,18,3,201101,2011), -('2011-01-19',201103,1,2011,19,3,201101,2011), -('2011-01-20',201103,1,2011,20,3,201101,2011), -('2011-01-21',201103,1,2011,21,3,201101,2011), -('2011-01-22',201103,1,2011,22,3,201101,2011), -('2011-01-23',201104,1,2011,23,4,201101,2011), -('2011-01-24',201104,1,2011,24,4,201101,2011), -('2011-01-25',201104,1,2011,25,4,201101,2011), -('2011-01-26',201104,1,2011,26,4,201101,2011), -('2011-01-27',201104,1,2011,27,4,201101,2011), -('2011-01-28',201104,1,2011,28,4,201101,2011), -('2011-01-29',201104,1,2011,29,4,201101,2011), -('2011-01-30',201105,1,2011,30,5,201101,2011), -('2011-01-31',201105,1,2011,31,5,201101,2011), -('2011-02-01',201105,2,2011,1,5,201102,2011), -('2011-02-02',201105,2,2011,2,5,201102,2011), -('2011-02-03',201105,2,2011,3,5,201102,2011), -('2011-02-04',201105,2,2011,4,5,201102,2011), -('2011-02-05',201105,2,2011,5,5,201102,2011), -('2011-02-06',201106,2,2011,6,6,201102,2011), -('2011-02-07',201106,2,2011,7,6,201102,2011), -('2011-02-08',201106,2,2011,8,6,201102,2011), -('2011-02-09',201106,2,2011,9,6,201102,2011), -('2011-02-10',201106,2,2011,10,6,201102,2011), -('2011-02-11',201106,2,2011,11,6,201102,2011), -('2011-02-12',201106,2,2011,12,6,201102,2011), -('2011-02-13',201107,2,2011,13,7,201102,2011), -('2011-02-14',201107,2,2011,14,7,201102,2011), -('2011-02-15',201107,2,2011,15,7,201102,2011), -('2011-02-16',201107,2,2011,16,7,201102,2011), -('2011-02-17',201107,2,2011,17,7,201102,2011), -('2011-02-18',201107,2,2011,18,7,201102,2011), -('2011-02-19',201107,2,2011,19,7,201102,2011), -('2011-02-20',201108,2,2011,20,8,201102,2011), -('2011-02-21',201108,2,2011,21,8,201102,2011), -('2011-02-22',201108,2,2011,22,8,201102,2011), -('2011-02-23',201108,2,2011,23,8,201102,2011), -('2011-02-24',201108,2,2011,24,8,201102,2011), -('2011-02-25',201108,2,2011,25,8,201102,2011), -('2011-02-26',201108,2,2011,26,8,201102,2011), -('2011-02-27',201109,2,2011,27,9,201102,2011), -('2011-02-28',201109,2,2011,28,9,201102,2011), -('2011-03-01',201109,3,2011,1,9,201103,2011), -('2011-03-02',201109,3,2011,2,9,201103,2011), -('2011-03-03',201109,3,2011,3,9,201103,2011), -('2011-03-04',201109,3,2011,4,9,201103,2011), -('2011-03-05',201109,3,2011,5,9,201103,2011), -('2011-03-06',201110,3,2011,6,10,201103,2011), -('2011-03-07',201110,3,2011,7,10,201103,2011), -('2011-03-08',201110,3,2011,8,10,201103,2011), -('2011-03-09',201110,3,2011,9,10,201103,2011), -('2011-03-10',201110,3,2011,10,10,201103,2011), -('2011-03-11',201110,3,2011,11,10,201103,2011), -('2011-03-12',201110,3,2011,12,10,201103,2011), -('2011-03-13',201111,3,2011,13,11,201103,2011), -('2011-03-14',201111,3,2011,14,11,201103,2011), -('2011-03-15',201111,3,2011,15,11,201103,2011), -('2011-03-16',201111,3,2011,16,11,201103,2011), -('2011-03-17',201111,3,2011,17,11,201103,2011), -('2011-03-18',201111,3,2011,18,11,201103,2011), -('2011-03-19',201111,3,2011,19,11,201103,2011), -('2011-03-20',201112,3,2011,20,12,201103,2011), -('2011-03-21',201112,3,2011,21,12,201103,2011), -('2011-03-22',201112,3,2011,22,12,201103,2011), -('2011-03-23',201112,3,2011,23,12,201103,2011), -('2011-03-24',201112,3,2011,24,12,201103,2011), -('2011-03-25',201112,3,2011,25,12,201103,2011), -('2011-03-26',201112,3,2011,26,12,201103,2011), -('2011-03-27',201113,3,2011,27,13,201103,2011), -('2011-03-28',201113,3,2011,28,13,201103,2011), -('2011-03-29',201113,3,2011,29,13,201103,2011), -('2011-03-30',201113,3,2011,30,13,201103,2011), -('2011-03-31',201113,3,2011,31,13,201103,2011), -('2011-04-01',201113,4,2011,1,13,201104,2011), -('2011-04-02',201113,4,2011,2,13,201104,2011), -('2011-04-03',201114,4,2011,3,14,201104,2011), -('2011-04-04',201114,4,2011,4,14,201104,2011), -('2011-04-05',201114,4,2011,5,14,201104,2011), -('2011-04-06',201114,4,2011,6,14,201104,2011), -('2011-04-07',201114,4,2011,7,14,201104,2011), -('2011-04-08',201114,4,2011,8,14,201104,2011), -('2011-04-09',201114,4,2011,9,14,201104,2011), -('2011-04-10',201115,4,2011,10,15,201104,2011), -('2011-04-11',201115,4,2011,11,15,201104,2011), -('2011-04-12',201115,4,2011,12,15,201104,2011), -('2011-04-13',201115,4,2011,13,15,201104,2011), -('2011-04-14',201115,4,2011,14,15,201104,2011), -('2011-04-15',201115,4,2011,15,15,201104,2011), -('2011-04-16',201115,4,2011,16,15,201104,2011), -('2011-04-17',201116,4,2011,17,16,201104,2011), -('2011-04-18',201116,4,2011,18,16,201104,2011), -('2011-04-19',201116,4,2011,19,16,201104,2011), -('2011-04-20',201116,4,2011,20,16,201104,2011), -('2011-04-21',201116,4,2011,21,16,201104,2011), -('2011-04-22',201116,4,2011,22,16,201104,2011), -('2011-04-23',201116,4,2011,23,16,201104,2011), -('2011-04-24',201117,4,2011,24,17,201104,2011), -('2011-04-25',201117,4,2011,25,17,201104,2011), -('2011-04-26',201117,4,2011,26,17,201104,2011), -('2011-04-27',201117,4,2011,27,17,201104,2011), -('2011-04-28',201117,4,2011,28,17,201104,2011), -('2011-04-29',201117,4,2011,29,17,201104,2011), -('2011-04-30',201117,4,2011,30,17,201104,2011), -('2011-05-01',201118,5,2011,1,18,201105,2011), -('2011-05-02',201118,5,2011,2,18,201105,2011), -('2011-05-03',201118,5,2011,3,18,201105,2011), -('2011-05-04',201118,5,2011,4,18,201105,2011), -('2011-05-05',201118,5,2011,5,18,201105,2011), -('2011-05-06',201118,5,2011,6,18,201105,2011), -('2011-05-07',201118,5,2011,7,18,201105,2011), -('2011-05-08',201119,5,2011,8,19,201105,2011), -('2011-05-09',201119,5,2011,9,19,201105,2011), -('2011-05-10',201119,5,2011,10,19,201105,2011), -('2011-05-11',201119,5,2011,11,19,201105,2011), -('2011-05-12',201119,5,2011,12,19,201105,2011), -('2011-05-13',201119,5,2011,13,19,201105,2011), -('2011-05-14',201119,5,2011,14,19,201105,2011), -('2011-05-15',201120,5,2011,15,20,201105,2011), -('2011-05-16',201120,5,2011,16,20,201105,2011), -('2011-05-17',201120,5,2011,17,20,201105,2011), -('2011-05-18',201120,5,2011,18,20,201105,2011), -('2011-05-19',201120,5,2011,19,20,201105,2011), -('2011-05-20',201120,5,2011,20,20,201105,2011), -('2011-05-21',201120,5,2011,21,20,201105,2011), -('2011-05-22',201121,5,2011,22,21,201105,2011), -('2011-05-23',201121,5,2011,23,21,201105,2011), -('2011-05-24',201121,5,2011,24,21,201105,2011), -('2011-05-25',201121,5,2011,25,21,201105,2011), -('2011-05-26',201121,5,2011,26,21,201105,2011), -('2011-05-27',201121,5,2011,27,21,201105,2011), -('2011-05-28',201121,5,2011,28,21,201105,2011), -('2011-05-29',201122,5,2011,29,22,201105,2011), -('2011-05-30',201122,5,2011,30,22,201105,2011), -('2011-05-31',201122,5,2011,31,22,201105,2011), -('2011-06-01',201122,6,2011,1,22,201106,2011), -('2011-06-02',201122,6,2011,2,22,201106,2011), -('2011-06-03',201122,6,2011,3,22,201106,2011), -('2011-06-04',201122,6,2011,4,22,201106,2011), -('2011-06-05',201123,6,2011,5,23,201106,2011), -('2011-06-06',201123,6,2011,6,23,201106,2011), -('2011-06-07',201123,6,2011,7,23,201106,2011), -('2011-06-08',201123,6,2011,8,23,201106,2011), -('2011-06-09',201123,6,2011,9,23,201106,2011), -('2011-06-10',201123,6,2011,10,23,201106,2011), -('2011-06-11',201123,6,2011,11,23,201106,2011), -('2011-06-12',201124,6,2011,12,24,201106,2011), -('2011-06-13',201124,6,2011,13,24,201106,2011), -('2011-06-14',201124,6,2011,14,24,201106,2011), -('2011-06-15',201124,6,2011,15,24,201106,2011), -('2011-06-16',201124,6,2011,16,24,201106,2011), -('2011-06-17',201124,6,2011,17,24,201106,2011), -('2011-06-18',201124,6,2011,18,24,201106,2011), -('2011-06-19',201125,6,2011,19,25,201106,2011), -('2011-06-20',201125,6,2011,20,25,201106,2011), -('2011-06-21',201125,6,2011,21,25,201106,2011), -('2011-06-22',201125,6,2011,22,25,201106,2011), -('2011-06-23',201125,6,2011,23,25,201106,2011), -('2011-06-24',201125,6,2011,24,25,201106,2011), -('2011-06-25',201125,6,2011,25,25,201106,2011), -('2011-06-26',201126,6,2011,26,26,201106,2011), -('2011-06-27',201126,6,2011,27,26,201106,2011), -('2011-06-28',201126,6,2011,28,26,201106,2011), -('2011-06-29',201126,6,2011,29,26,201106,2011), -('2011-06-30',201126,6,2011,30,26,201106,2011), -('2011-07-01',201126,7,2011,1,26,201107,2011), -('2011-07-02',201126,7,2011,2,26,201107,2011), -('2011-07-03',201127,7,2011,3,27,201107,2011), -('2011-07-04',201127,7,2011,4,27,201107,2011), -('2011-07-05',201127,7,2011,5,27,201107,2011), -('2011-07-06',201127,7,2011,6,27,201107,2011), -('2011-07-07',201127,7,2011,7,27,201107,2011), -('2011-07-08',201127,7,2011,8,27,201107,2011), -('2011-07-09',201127,7,2011,9,27,201107,2011), -('2011-07-10',201128,7,2011,10,28,201107,2011), -('2011-07-11',201128,7,2011,11,28,201107,2011), -('2011-07-12',201128,7,2011,12,28,201107,2011), -('2011-07-13',201128,7,2011,13,28,201107,2011), -('2011-07-14',201128,7,2011,14,28,201107,2011), -('2011-07-15',201128,7,2011,15,28,201107,2011), -('2011-07-16',201128,7,2011,16,28,201107,2011), -('2011-07-17',201129,7,2011,17,29,201107,2011), -('2011-07-18',201129,7,2011,18,29,201107,2011), -('2011-07-19',201129,7,2011,19,29,201107,2011), -('2011-07-20',201129,7,2011,20,29,201107,2011), -('2011-07-21',201129,7,2011,21,29,201107,2011), -('2011-07-22',201129,7,2011,22,29,201107,2011), -('2011-07-23',201129,7,2011,23,29,201107,2011), -('2011-07-24',201130,7,2011,24,30,201107,2011), -('2011-07-25',201130,7,2011,25,30,201107,2011), -('2011-07-26',201130,7,2011,26,30,201107,2011), -('2011-07-27',201130,7,2011,27,30,201107,2011), -('2011-07-28',201130,7,2011,28,30,201107,2011), -('2011-07-29',201130,7,2011,29,30,201107,2011), -('2011-07-30',201130,7,2011,30,30,201107,2011), -('2011-07-31',201131,7,2011,31,31,201107,2011), -('2011-08-01',201131,8,2011,1,31,201108,2011), -('2011-08-02',201131,8,2011,2,31,201108,2011), -('2011-08-03',201131,8,2011,3,31,201108,2011), -('2011-08-04',201131,8,2011,4,31,201108,2011), -('2011-08-05',201131,8,2011,5,31,201108,2011), -('2011-08-06',201131,8,2011,6,31,201108,2011), -('2011-08-07',201132,8,2011,7,32,201108,2011), -('2011-08-08',201132,8,2011,8,32,201108,2011), -('2011-08-09',201132,8,2011,9,32,201108,2011), -('2011-08-10',201132,8,2011,10,32,201108,2011), -('2011-08-11',201132,8,2011,11,32,201108,2011), -('2011-08-12',201132,8,2011,12,32,201108,2011), -('2011-08-13',201132,8,2011,13,32,201108,2011), -('2011-08-14',201133,8,2011,14,33,201108,2011), -('2011-08-15',201133,8,2011,15,33,201108,2011), -('2011-08-16',201133,8,2011,16,33,201108,2011), -('2011-08-17',201133,8,2011,17,33,201108,2011), -('2011-08-18',201133,8,2011,18,33,201108,2011), -('2011-08-19',201133,8,2011,19,33,201108,2011), -('2011-08-20',201133,8,2011,20,33,201108,2011), -('2011-08-21',201134,8,2011,21,34,201108,2011), -('2011-08-22',201134,8,2011,22,34,201108,2011), -('2011-08-23',201134,8,2011,23,34,201108,2011), -('2011-08-24',201134,8,2011,24,34,201108,2011), -('2011-08-25',201134,8,2011,25,34,201108,2011), -('2011-08-26',201134,8,2011,26,34,201108,2011), -('2011-08-27',201134,8,2011,27,34,201108,2011), -('2011-08-28',201135,8,2011,28,35,201108,2011), -('2011-08-29',201135,8,2011,29,35,201108,2011), -('2011-08-30',201135,8,2011,30,35,201108,2011), -('2011-08-31',201135,8,2011,31,35,201108,2011), -('2011-09-01',201135,9,2011,1,35,201109,2011), -('2011-09-02',201135,9,2011,2,35,201109,2011), -('2011-09-03',201135,9,2011,3,35,201109,2011), -('2011-09-04',201136,9,2011,4,36,201109,2011), -('2011-09-05',201136,9,2011,5,36,201109,2011), -('2011-09-06',201136,9,2011,6,36,201109,2011), -('2011-09-07',201136,9,2011,7,36,201109,2011), -('2011-09-08',201136,9,2011,8,36,201109,2011), -('2011-09-09',201136,9,2011,9,36,201109,2011), -('2011-09-10',201136,9,2011,10,36,201109,2011), -('2011-09-11',201137,9,2011,11,37,201109,2011), -('2011-09-12',201137,9,2011,12,37,201109,2011), -('2011-09-13',201137,9,2011,13,37,201109,2011), -('2011-09-14',201137,9,2011,14,37,201109,2011), -('2011-09-15',201137,9,2011,15,37,201109,2011), -('2011-09-16',201137,9,2011,16,37,201109,2011), -('2011-09-17',201137,9,2011,17,37,201109,2011), -('2011-09-18',201138,9,2011,18,38,201109,2011), -('2011-09-19',201138,9,2011,19,38,201109,2011), -('2011-09-20',201138,9,2011,20,38,201109,2011), -('2011-09-21',201138,9,2011,21,38,201109,2011), -('2011-09-22',201138,9,2011,22,38,201109,2011), -('2011-09-23',201138,9,2011,23,38,201109,2011), -('2011-09-24',201138,9,2011,24,38,201109,2011), -('2011-09-25',201139,9,2011,25,39,201109,2011), -('2011-09-26',201139,9,2011,26,39,201109,2011), -('2011-09-27',201139,9,2011,27,39,201109,2011), -('2011-09-28',201139,9,2011,28,39,201109,2011), -('2011-09-29',201139,9,2011,29,39,201109,2011), -('2011-09-30',201139,9,2011,30,39,201109,2011), -('2011-10-01',201139,10,2011,1,39,201110,2011), -('2011-10-02',201140,10,2011,2,40,201110,2011), -('2011-10-03',201140,10,2011,3,40,201110,2011), -('2011-10-04',201140,10,2011,4,40,201110,2011), -('2011-10-05',201140,10,2011,5,40,201110,2011), -('2011-10-06',201140,10,2011,6,40,201110,2011), -('2011-10-07',201140,10,2011,7,40,201110,2011), -('2011-10-08',201140,10,2011,8,40,201110,2011), -('2011-10-09',201141,10,2011,9,41,201110,2011), -('2011-10-10',201141,10,2011,10,41,201110,2011), -('2011-10-11',201141,10,2011,11,41,201110,2011), -('2011-10-12',201141,10,2011,12,41,201110,2011), -('2011-10-13',201141,10,2011,13,41,201110,2011), -('2011-10-14',201141,10,2011,14,41,201110,2011), -('2011-10-15',201141,10,2011,15,41,201110,2011), -('2011-10-16',201142,10,2011,16,42,201110,2011), -('2011-10-17',201142,10,2011,17,42,201110,2011), -('2011-10-18',201142,10,2011,18,42,201110,2011), -('2011-10-19',201142,10,2011,19,42,201110,2011), -('2011-10-20',201142,10,2011,20,42,201110,2011), -('2011-10-21',201142,10,2011,21,42,201110,2011), -('2011-10-22',201142,10,2011,22,42,201110,2011), -('2011-10-23',201143,10,2011,23,43,201110,2011), -('2011-10-24',201143,10,2011,24,43,201110,2011), -('2011-10-25',201143,10,2011,25,43,201110,2011), -('2011-10-26',201143,10,2011,26,43,201110,2011), -('2011-10-27',201143,10,2011,27,43,201110,2011), -('2011-10-28',201143,10,2011,28,43,201110,2011), -('2011-10-29',201143,10,2011,29,43,201110,2011), -('2011-10-30',201144,10,2011,30,44,201110,2011), -('2011-10-31',201144,10,2011,31,44,201110,2011), -('2011-11-01',201144,11,2011,1,44,201111,2011), -('2011-11-02',201144,11,2011,2,44,201111,2011), -('2011-11-03',201144,11,2011,3,44,201111,2011), -('2011-11-04',201144,11,2011,4,44,201111,2011), -('2011-11-05',201144,11,2011,5,44,201111,2011), -('2011-11-06',201145,11,2011,6,45,201111,2011), -('2011-11-07',201145,11,2011,7,45,201111,2011), -('2011-11-08',201145,11,2011,8,45,201111,2011), -('2011-11-09',201145,11,2011,9,45,201111,2011), -('2011-11-10',201145,11,2011,10,45,201111,2011), -('2011-11-11',201145,11,2011,11,45,201111,2011), -('2011-11-12',201145,11,2011,12,45,201111,2011), -('2011-11-13',201146,11,2011,13,46,201111,2011), -('2011-11-14',201146,11,2011,14,46,201111,2011), -('2011-11-15',201146,11,2011,15,46,201111,2011), -('2011-11-16',201146,11,2011,16,46,201111,2011), -('2011-11-17',201146,11,2011,17,46,201111,2011), -('2011-11-18',201146,11,2011,18,46,201111,2011), -('2011-11-19',201146,11,2011,19,46,201111,2011), -('2011-11-20',201147,11,2011,20,47,201111,2011), -('2011-11-21',201147,11,2011,21,47,201111,2011), -('2011-11-22',201147,11,2011,22,47,201111,2011), -('2011-11-23',201147,11,2011,23,47,201111,2011), -('2011-11-24',201147,11,2011,24,47,201111,2011), -('2011-11-25',201147,11,2011,25,47,201111,2011), -('2011-11-26',201147,11,2011,26,47,201111,2011), -('2011-11-27',201148,11,2011,27,48,201111,2011), -('2011-11-28',201148,11,2011,28,48,201111,2011), -('2011-11-29',201148,11,2011,29,48,201111,2011), -('2011-11-30',201148,11,2011,30,48,201111,2011), -('2011-12-01',201148,12,2011,1,48,201112,2012), -('2011-12-02',201148,12,2011,2,48,201112,2012), -('2011-12-03',201148,12,2011,3,48,201112,2012), -('2011-12-04',201149,12,2011,4,49,201112,2012), -('2011-12-05',201149,12,2011,5,49,201112,2012), -('2011-12-06',201149,12,2011,6,49,201112,2012), -('2011-12-07',201149,12,2011,7,49,201112,2012), -('2011-12-08',201149,12,2011,8,49,201112,2012), -('2011-12-09',201149,12,2011,9,49,201112,2012), -('2011-12-10',201149,12,2011,10,49,201112,2012), -('2011-12-11',201150,12,2011,11,50,201112,2012), -('2011-12-12',201150,12,2011,12,50,201112,2012), -('2011-12-13',201150,12,2011,13,50,201112,2012), -('2011-12-14',201150,12,2011,14,50,201112,2012), -('2011-12-15',201150,12,2011,15,50,201112,2012), -('2011-12-16',201150,12,2011,16,50,201112,2012), -('2011-12-17',201150,12,2011,17,50,201112,2012), -('2011-12-18',201151,12,2011,18,51,201112,2012), -('2011-12-19',201151,12,2011,19,51,201112,2012), -('2011-12-20',201151,12,2011,20,51,201112,2012), -('2011-12-21',201151,12,2011,21,51,201112,2012), -('2011-12-22',201151,12,2011,22,51,201112,2012), -('2011-12-23',201151,12,2011,23,51,201112,2012), -('2011-12-24',201151,12,2011,24,51,201112,2012), -('2011-12-25',201152,12,2011,25,52,201112,2012), -('2011-12-26',201152,12,2011,26,52,201112,2012), -('2011-12-27',201152,12,2011,27,52,201112,2012), -('2011-12-28',201152,12,2011,28,52,201112,2012), -('2011-12-29',201152,12,2011,29,52,201112,2012), -('2011-12-30',201152,12,2011,30,52,201112,2012), -('2011-12-31',201152,12,2011,31,52,201112,2012), -('2012-01-01',201153,1,2012,1,1,201201,2012), -('2012-01-02',201201,1,2012,2,1,201201,2012), -('2012-01-03',201201,1,2012,3,1,201201,2012), -('2012-01-04',201201,1,2012,4,1,201201,2012), -('2012-01-05',201201,1,2012,5,1,201201,2012), -('2012-01-06',201201,1,2012,6,1,201201,2012), -('2012-01-07',201201,1,2012,7,1,201201,2012), -('2012-01-08',201202,1,2012,8,2,201201,2012), -('2012-01-09',201202,1,2012,9,2,201201,2012), -('2012-01-10',201202,1,2012,10,2,201201,2012), -('2012-01-11',201202,1,2012,11,2,201201,2012), -('2012-01-12',201202,1,2012,12,2,201201,2012), -('2012-01-13',201202,1,2012,13,2,201201,2012), -('2012-01-14',201202,1,2012,14,2,201201,2012), -('2012-01-15',201203,1,2012,15,3,201201,2012), -('2012-01-16',201203,1,2012,16,3,201201,2012), -('2012-01-17',201203,1,2012,17,3,201201,2012), -('2012-01-18',201203,1,2012,18,3,201201,2012), -('2012-01-19',201203,1,2012,19,3,201201,2012), -('2012-01-20',201203,1,2012,20,3,201201,2012), -('2012-01-21',201203,1,2012,21,3,201201,2012), -('2012-01-22',201204,1,2012,22,4,201201,2012), -('2012-01-23',201204,1,2012,23,4,201201,2012), -('2012-01-24',201204,1,2012,24,4,201201,2012), -('2012-01-25',201204,1,2012,25,4,201201,2012), -('2012-01-26',201204,1,2012,26,4,201201,2012), -('2012-01-27',201204,1,2012,27,4,201201,2012), -('2012-01-28',201204,1,2012,28,4,201201,2012), -('2012-01-29',201205,1,2012,29,5,201201,2012), -('2012-01-30',201205,1,2012,30,5,201201,2012), -('2012-01-31',201205,1,2012,31,5,201201,2012), -('2012-02-01',201205,2,2012,1,5,201202,2012), -('2012-02-02',201205,2,2012,2,5,201202,2012), -('2012-02-03',201205,2,2012,3,5,201202,2012), -('2012-02-04',201205,2,2012,4,5,201202,2012), -('2012-02-05',201206,2,2012,5,6,201202,2012), -('2012-02-06',201206,2,2012,6,6,201202,2012), -('2012-02-07',201206,2,2012,7,6,201202,2012), -('2012-02-08',201206,2,2012,8,6,201202,2012), -('2012-02-09',201206,2,2012,9,6,201202,2012), -('2012-02-10',201206,2,2012,10,6,201202,2012), -('2012-02-11',201206,2,2012,11,6,201202,2012), -('2012-02-12',201207,2,2012,12,7,201202,2012), -('2012-02-13',201207,2,2012,13,7,201202,2012), -('2012-02-14',201207,2,2012,14,7,201202,2012), -('2012-02-15',201207,2,2012,15,7,201202,2012), -('2012-02-16',201207,2,2012,16,7,201202,2012), -('2012-02-17',201207,2,2012,17,7,201202,2012), -('2012-02-18',201207,2,2012,18,7,201202,2012), -('2012-02-19',201208,2,2012,19,8,201202,2012), -('2012-02-20',201208,2,2012,20,8,201202,2012), -('2012-02-21',201208,2,2012,21,8,201202,2012), -('2012-02-22',201208,2,2012,22,8,201202,2012), -('2012-02-23',201208,2,2012,23,8,201202,2012), -('2012-02-24',201208,2,2012,24,8,201202,2012), -('2012-02-25',201208,2,2012,25,8,201202,2012), -('2012-02-26',201209,2,2012,26,9,201202,2012), -('2012-02-27',201209,2,2012,27,9,201202,2012), -('2012-02-28',201209,2,2012,28,9,201202,2012), -('2012-02-29',201209,2,2012,29,9,201202,2012), -('2012-03-01',201209,3,2012,1,9,201203,2012), -('2012-03-02',201209,3,2012,2,9,201203,2012), -('2012-03-03',201209,3,2012,3,9,201203,2012), -('2012-03-04',201210,3,2012,4,10,201203,2012), -('2012-03-05',201210,3,2012,5,10,201203,2012), -('2012-03-06',201210,3,2012,6,10,201203,2012), -('2012-03-07',201210,3,2012,7,10,201203,2012), -('2012-03-08',201210,3,2012,8,10,201203,2012), -('2012-03-09',201210,3,2012,9,10,201203,2012), -('2012-03-10',201210,3,2012,10,10,201203,2012), -('2012-03-11',201211,3,2012,11,11,201203,2012), -('2012-03-12',201211,3,2012,12,11,201203,2012), -('2012-03-13',201211,3,2012,13,11,201203,2012), -('2012-03-14',201211,3,2012,14,11,201203,2012), -('2012-03-15',201211,3,2012,15,11,201203,2012), -('2012-03-16',201211,3,2012,16,11,201203,2012), -('2012-03-17',201211,3,2012,17,11,201203,2012), -('2012-03-18',201212,3,2012,18,12,201203,2012), -('2012-03-19',201212,3,2012,19,12,201203,2012), -('2012-03-20',201212,3,2012,20,12,201203,2012), -('2012-03-21',201212,3,2012,21,12,201203,2012), -('2012-03-22',201212,3,2012,22,12,201203,2012), -('2012-03-23',201212,3,2012,23,12,201203,2012), -('2012-03-24',201212,3,2012,24,12,201203,2012), -('2012-03-25',201213,3,2012,25,13,201203,2012), -('2012-03-26',201213,3,2012,26,13,201203,2012), -('2012-03-27',201213,3,2012,27,13,201203,2012), -('2012-03-28',201213,3,2012,28,13,201203,2012), -('2012-03-29',201213,3,2012,29,13,201203,2012), -('2012-03-30',201213,3,2012,30,13,201203,2012), -('2012-03-31',201213,3,2012,31,13,201203,2012), -('2012-04-01',201214,4,2012,1,14,201204,2012), -('2012-04-02',201214,4,2012,2,14,201204,2012), -('2012-04-03',201214,4,2012,3,14,201204,2012), -('2012-04-04',201214,4,2012,4,14,201204,2012), -('2012-04-05',201214,4,2012,5,14,201204,2012), -('2012-04-06',201214,4,2012,6,14,201204,2012), -('2012-04-07',201214,4,2012,7,14,201204,2012), -('2012-04-08',201215,4,2012,8,15,201204,2012), -('2012-04-09',201215,4,2012,9,15,201204,2012), -('2012-04-10',201215,4,2012,10,15,201204,2012), -('2012-04-11',201215,4,2012,11,15,201204,2012), -('2012-04-12',201215,4,2012,12,15,201204,2012), -('2012-04-13',201215,4,2012,13,15,201204,2012), -('2012-04-14',201215,4,2012,14,15,201204,2012), -('2012-04-15',201216,4,2012,15,16,201204,2012), -('2012-04-16',201216,4,2012,16,16,201204,2012), -('2012-04-17',201216,4,2012,17,16,201204,2012), -('2012-04-18',201216,4,2012,18,16,201204,2012), -('2012-04-19',201216,4,2012,19,16,201204,2012), -('2012-04-20',201216,4,2012,20,16,201204,2012), -('2012-04-21',201216,4,2012,21,16,201204,2012), -('2012-04-22',201217,4,2012,22,17,201204,2012), -('2012-04-23',201217,4,2012,23,17,201204,2012), -('2012-04-24',201217,4,2012,24,17,201204,2012), -('2012-04-25',201217,4,2012,25,17,201204,2012), -('2012-04-26',201217,4,2012,26,17,201204,2012), -('2012-04-27',201217,4,2012,27,17,201204,2012), -('2012-04-28',201217,4,2012,28,17,201204,2012), -('2012-04-29',201218,4,2012,29,18,201204,2012), -('2012-04-30',201218,4,2012,30,18,201204,2012), -('2012-05-01',201218,5,2012,1,18,201205,2012), -('2012-05-02',201218,5,2012,2,18,201205,2012), -('2012-05-03',201218,5,2012,3,18,201205,2012), -('2012-05-04',201218,5,2012,4,18,201205,2012), -('2012-05-05',201218,5,2012,5,18,201205,2012), -('2012-05-06',201219,5,2012,6,19,201205,2012), -('2012-05-07',201219,5,2012,7,19,201205,2012), -('2012-05-08',201219,5,2012,8,19,201205,2012), -('2012-05-09',201219,5,2012,9,19,201205,2012), -('2012-05-10',201219,5,2012,10,19,201205,2012), -('2012-05-11',201219,5,2012,11,19,201205,2012), -('2012-05-12',201219,5,2012,12,19,201205,2012), -('2012-05-13',201220,5,2012,13,20,201205,2012), -('2012-05-14',201220,5,2012,14,20,201205,2012), -('2012-05-15',201220,5,2012,15,20,201205,2012), -('2012-05-16',201220,5,2012,16,20,201205,2012), -('2012-05-17',201220,5,2012,17,20,201205,2012), -('2012-05-18',201220,5,2012,18,20,201205,2012), -('2012-05-19',201220,5,2012,19,20,201205,2012), -('2012-05-20',201221,5,2012,20,21,201205,2012), -('2012-05-21',201221,5,2012,21,21,201205,2012), -('2012-05-22',201221,5,2012,22,21,201205,2012), -('2012-05-23',201221,5,2012,23,21,201205,2012), -('2012-05-24',201221,5,2012,24,21,201205,2012), -('2012-05-25',201221,5,2012,25,21,201205,2012), -('2012-05-26',201221,5,2012,26,21,201205,2012), -('2012-05-27',201222,5,2012,27,22,201205,2012), -('2012-05-28',201222,5,2012,28,22,201205,2012), -('2012-05-29',201222,5,2012,29,22,201205,2012), -('2012-05-30',201222,5,2012,30,22,201205,2012), -('2012-05-31',201222,5,2012,31,22,201205,2012), -('2012-06-01',201222,6,2012,1,22,201206,2012), -('2012-06-02',201222,6,2012,2,22,201206,2012), -('2012-06-03',201223,6,2012,3,23,201206,2012), -('2012-06-04',201223,6,2012,4,23,201206,2012), -('2012-06-05',201223,6,2012,5,23,201206,2012), -('2012-06-06',201223,6,2012,6,23,201206,2012), -('2012-06-07',201223,6,2012,7,23,201206,2012), -('2012-06-08',201223,6,2012,8,23,201206,2012), -('2012-06-09',201223,6,2012,9,23,201206,2012), -('2012-06-10',201224,6,2012,10,24,201206,2012), -('2012-06-11',201224,6,2012,11,24,201206,2012), -('2012-06-12',201224,6,2012,12,24,201206,2012), -('2012-06-13',201224,6,2012,13,24,201206,2012), -('2012-06-14',201224,6,2012,14,24,201206,2012), -('2012-06-15',201224,6,2012,15,24,201206,2012), -('2012-06-16',201224,6,2012,16,24,201206,2012), -('2012-06-17',201225,6,2012,17,25,201206,2012), -('2012-06-18',201225,6,2012,18,25,201206,2012), -('2012-06-19',201225,6,2012,19,25,201206,2012), -('2012-06-20',201225,6,2012,20,25,201206,2012), -('2012-06-21',201225,6,2012,21,25,201206,2012), -('2012-06-22',201225,6,2012,22,25,201206,2012), -('2012-06-23',201225,6,2012,23,25,201206,2012), -('2012-06-24',201226,6,2012,24,26,201206,2012), -('2012-06-25',201226,6,2012,25,26,201206,2012), -('2012-06-26',201226,6,2012,26,26,201206,2012), -('2012-06-27',201226,6,2012,27,26,201206,2012), -('2012-06-28',201226,6,2012,28,26,201206,2012), -('2012-06-29',201226,6,2012,29,26,201206,2012), -('2012-06-30',201226,6,2012,30,26,201206,2012), -('2012-07-01',201227,7,2012,1,27,201207,2012), -('2012-07-02',201227,7,2012,2,27,201207,2012), -('2012-07-03',201227,7,2012,3,27,201207,2012), -('2012-07-04',201227,7,2012,4,27,201207,2012), -('2012-07-05',201227,7,2012,5,27,201207,2012), -('2012-07-06',201227,7,2012,6,27,201207,2012), -('2012-07-07',201227,7,2012,7,27,201207,2012), -('2012-07-08',201228,7,2012,8,28,201207,2012), -('2012-07-09',201228,7,2012,9,28,201207,2012), -('2012-07-10',201228,7,2012,10,28,201207,2012), -('2012-07-11',201228,7,2012,11,28,201207,2012), -('2012-07-12',201228,7,2012,12,28,201207,2012), -('2012-07-13',201228,7,2012,13,28,201207,2012), -('2012-07-14',201228,7,2012,14,28,201207,2012), -('2012-07-15',201229,7,2012,15,29,201207,2012), -('2012-07-16',201229,7,2012,16,29,201207,2012), -('2012-07-17',201229,7,2012,17,29,201207,2012), -('2012-07-18',201229,7,2012,18,29,201207,2012), -('2012-07-19',201229,7,2012,19,29,201207,2012), -('2012-07-20',201229,7,2012,20,29,201207,2012), -('2012-07-21',201229,7,2012,21,29,201207,2012), -('2012-07-22',201230,7,2012,22,30,201207,2012), -('2012-07-23',201230,7,2012,23,30,201207,2012), -('2012-07-24',201230,7,2012,24,30,201207,2012), -('2012-07-25',201230,7,2012,25,30,201207,2012), -('2012-07-26',201230,7,2012,26,30,201207,2012), -('2012-07-27',201230,7,2012,27,30,201207,2012), -('2012-07-28',201230,7,2012,28,30,201207,2012), -('2012-07-29',201231,7,2012,29,31,201207,2012), -('2012-07-30',201231,7,2012,30,31,201207,2012), -('2012-07-31',201231,7,2012,31,31,201207,2012), -('2012-08-01',201231,8,2012,1,31,201208,2012), -('2012-08-02',201231,8,2012,2,31,201208,2012), -('2012-08-03',201231,8,2012,3,31,201208,2012), -('2012-08-04',201231,8,2012,4,31,201208,2012), -('2012-08-05',201232,8,2012,5,32,201208,2012), -('2012-08-06',201232,8,2012,6,32,201208,2012), -('2012-08-07',201232,8,2012,7,32,201208,2012), -('2012-08-08',201232,8,2012,8,32,201208,2012), -('2012-08-09',201232,8,2012,9,32,201208,2012), -('2012-08-10',201232,8,2012,10,32,201208,2012), -('2012-08-11',201232,8,2012,11,32,201208,2012), -('2012-08-12',201233,8,2012,12,33,201208,2012), -('2012-08-13',201233,8,2012,13,33,201208,2012), -('2012-08-14',201233,8,2012,14,33,201208,2012), -('2012-08-15',201233,8,2012,15,33,201208,2012), -('2012-08-16',201233,8,2012,16,33,201208,2012), -('2012-08-17',201233,8,2012,17,33,201208,2012), -('2012-08-18',201233,8,2012,18,33,201208,2012), -('2012-08-19',201234,8,2012,19,34,201208,2012), -('2012-08-20',201234,8,2012,20,34,201208,2012), -('2012-08-21',201234,8,2012,21,34,201208,2012), -('2012-08-22',201234,8,2012,22,34,201208,2012), -('2012-08-23',201234,8,2012,23,34,201208,2012), -('2012-08-24',201234,8,2012,24,34,201208,2012), -('2012-08-25',201234,8,2012,25,34,201208,2012), -('2012-08-26',201235,8,2012,26,35,201208,2012), -('2012-08-27',201235,8,2012,27,35,201208,2012), -('2012-08-28',201235,8,2012,28,35,201208,2012), -('2012-08-29',201235,8,2012,29,35,201208,2012), -('2012-08-30',201235,8,2012,30,35,201208,2012), -('2012-08-31',201235,8,2012,31,35,201208,2012), -('2012-09-01',201235,9,2012,1,35,201209,2012), -('2012-09-02',201236,9,2012,2,36,201209,2012), -('2012-09-03',201236,9,2012,3,36,201209,2012), -('2012-09-04',201236,9,2012,4,36,201209,2012), -('2012-09-05',201236,9,2012,5,36,201209,2012), -('2012-09-06',201236,9,2012,6,36,201209,2012), -('2012-09-07',201236,9,2012,7,36,201209,2012), -('2012-09-08',201236,9,2012,8,36,201209,2012), -('2012-09-09',201237,9,2012,9,37,201209,2012), -('2012-09-10',201237,9,2012,10,37,201209,2012), -('2012-09-11',201237,9,2012,11,37,201209,2012), -('2012-09-12',201237,9,2012,12,37,201209,2012), -('2012-09-13',201237,9,2012,13,37,201209,2012), -('2012-09-14',201237,9,2012,14,37,201209,2012), -('2012-09-15',201237,9,2012,15,37,201209,2012), -('2012-09-16',201238,9,2012,16,38,201209,2012), -('2012-09-17',201238,9,2012,17,38,201209,2012), -('2012-09-18',201238,9,2012,18,38,201209,2012), -('2012-09-19',201238,9,2012,19,38,201209,2012), -('2012-09-20',201238,9,2012,20,38,201209,2012), -('2012-09-21',201238,9,2012,21,38,201209,2012), -('2012-09-22',201238,9,2012,22,38,201209,2012), -('2012-09-23',201239,9,2012,23,39,201209,2012), -('2012-09-24',201239,9,2012,24,39,201209,2012), -('2012-09-25',201239,9,2012,25,39,201209,2012), -('2012-09-26',201239,9,2012,26,39,201209,2012), -('2012-09-27',201239,9,2012,27,39,201209,2012), -('2012-09-28',201239,9,2012,28,39,201209,2012), -('2012-09-29',201239,9,2012,29,39,201209,2012), -('2012-09-30',201240,9,2012,30,40,201209,2012), -('2012-10-01',201240,10,2012,1,40,201210,2012), -('2012-10-02',201240,10,2012,2,40,201210,2012), -('2012-10-03',201240,10,2012,3,40,201210,2012), -('2012-10-04',201240,10,2012,4,40,201210,2012), -('2012-10-05',201240,10,2012,5,40,201210,2012), -('2012-10-06',201240,10,2012,6,40,201210,2012), -('2012-10-07',201241,10,2012,7,41,201210,2012), -('2012-10-08',201241,10,2012,8,41,201210,2012), -('2012-10-09',201241,10,2012,9,41,201210,2012), -('2012-10-10',201241,10,2012,10,41,201210,2012), -('2012-10-11',201241,10,2012,11,41,201210,2012), -('2012-10-12',201241,10,2012,12,41,201210,2012), -('2012-10-13',201241,10,2012,13,41,201210,2012), -('2012-10-14',201242,10,2012,14,42,201210,2012), -('2012-10-15',201242,10,2012,15,42,201210,2012), -('2012-10-16',201242,10,2012,16,42,201210,2012), -('2012-10-17',201242,10,2012,17,42,201210,2012), -('2012-10-18',201242,10,2012,18,42,201210,2012), -('2012-10-19',201242,10,2012,19,42,201210,2012), -('2012-10-20',201242,10,2012,20,42,201210,2012), -('2012-10-21',201243,10,2012,21,43,201210,2012), -('2012-10-22',201243,10,2012,22,43,201210,2012), -('2012-10-23',201243,10,2012,23,43,201210,2012), -('2012-10-24',201243,10,2012,24,43,201210,2012), -('2012-10-25',201243,10,2012,25,43,201210,2012), -('2012-10-26',201243,10,2012,26,43,201210,2012), -('2012-10-27',201243,10,2012,27,43,201210,2012), -('2012-10-28',201244,10,2012,28,44,201210,2012), -('2012-10-29',201244,10,2012,29,44,201210,2012), -('2012-10-30',201244,10,2012,30,44,201210,2012), -('2012-10-31',201244,10,2012,31,44,201210,2012), -('2012-11-01',201244,11,2012,1,44,201211,2012), -('2012-11-02',201244,11,2012,2,44,201211,2012), -('2012-11-03',201244,11,2012,3,44,201211,2012), -('2012-11-04',201245,11,2012,4,45,201211,2012), -('2012-11-05',201245,11,2012,5,45,201211,2012), -('2012-11-06',201245,11,2012,6,45,201211,2012), -('2012-11-07',201245,11,2012,7,45,201211,2012), -('2012-11-08',201245,11,2012,8,45,201211,2012), -('2012-11-09',201245,11,2012,9,45,201211,2012), -('2012-11-10',201245,11,2012,10,45,201211,2012), -('2012-11-11',201246,11,2012,11,46,201211,2012), -('2012-11-12',201246,11,2012,12,46,201211,2012), -('2012-11-13',201246,11,2012,13,46,201211,2012), -('2012-11-14',201246,11,2012,14,46,201211,2012), -('2012-11-15',201246,11,2012,15,46,201211,2012), -('2012-11-16',201246,11,2012,16,46,201211,2012), -('2012-11-17',201246,11,2012,17,46,201211,2012), -('2012-11-18',201247,11,2012,18,47,201211,2012), -('2012-11-19',201247,11,2012,19,47,201211,2012), -('2012-11-20',201247,11,2012,20,47,201211,2012), -('2012-11-21',201247,11,2012,21,47,201211,2012), -('2012-11-22',201247,11,2012,22,47,201211,2012), -('2012-11-23',201247,11,2012,23,47,201211,2012), -('2012-11-24',201247,11,2012,24,47,201211,2012), -('2012-11-25',201248,11,2012,25,48,201211,2012), -('2012-11-26',201248,11,2012,26,48,201211,2012), -('2012-11-27',201248,11,2012,27,48,201211,2012), -('2012-11-28',201248,11,2012,28,48,201211,2012), -('2012-11-29',201248,11,2012,29,48,201211,2012), -('2012-11-30',201248,11,2012,30,48,201211,2012), -('2012-12-01',201248,12,2012,1,48,201212,2013), -('2012-12-02',201249,12,2012,2,49,201212,2013), -('2012-12-03',201249,12,2012,3,49,201212,2013), -('2012-12-04',201249,12,2012,4,49,201212,2013), -('2012-12-05',201249,12,2012,5,49,201212,2013), -('2012-12-06',201249,12,2012,6,49,201212,2013), -('2012-12-07',201249,12,2012,7,49,201212,2013), -('2012-12-08',201249,12,2012,8,49,201212,2013), -('2012-12-09',201250,12,2012,9,50,201212,2013), -('2012-12-10',201250,12,2012,10,50,201212,2013), -('2012-12-11',201250,12,2012,11,50,201212,2013), -('2012-12-12',201250,12,2012,12,50,201212,2013), -('2012-12-13',201250,12,2012,13,50,201212,2013), -('2012-12-14',201250,12,2012,14,50,201212,2013), -('2012-12-15',201250,12,2012,15,50,201212,2013), -('2012-12-16',201251,12,2012,16,51,201212,2013), -('2012-12-17',201251,12,2012,17,51,201212,2013), -('2012-12-18',201251,12,2012,18,51,201212,2013), -('2012-12-19',201251,12,2012,19,51,201212,2013), -('2012-12-20',201251,12,2012,20,51,201212,2013), -('2012-12-21',201251,12,2012,21,51,201212,2013), -('2012-12-22',201251,12,2012,22,51,201212,2013), -('2012-12-23',201252,12,2012,23,52,201212,2013), -('2012-12-24',201252,12,2012,24,52,201212,2013), -('2012-12-25',201252,12,2012,25,52,201212,2013), -('2012-12-26',201252,12,2012,26,52,201212,2013), -('2012-12-27',201252,12,2012,27,52,201212,2013), -('2012-12-28',201252,12,2012,28,52,201212,2013), -('2012-12-29',201252,12,2012,29,52,201212,2013), -('2012-12-30',201301,12,2012,30,1,201212,2013), -('2012-12-31',201301,12,2012,31,1,201212,2013), -('2013-01-01',201301,1,2013,1,1,201301,2013), -('2013-01-02',201301,1,2013,2,1,201301,2013), -('2013-01-03',201301,1,2013,3,1,201301,2013), -('2013-01-04',201301,1,2013,4,1,201301,2013), -('2013-01-05',201301,1,2013,5,1,201301,2013), -('2013-01-06',201302,1,2013,6,2,201301,2013), -('2013-01-07',201302,1,2013,7,2,201301,2013), -('2013-01-08',201302,1,2013,8,2,201301,2013), -('2013-01-09',201302,1,2013,9,2,201301,2013), -('2013-01-10',201302,1,2013,10,2,201301,2013), -('2013-01-11',201302,1,2013,11,2,201301,2013), -('2013-01-12',201302,1,2013,12,2,201301,2013), -('2013-01-13',201303,1,2013,13,3,201301,2013), -('2013-01-14',201303,1,2013,14,3,201301,2013), -('2013-01-15',201303,1,2013,15,3,201301,2013), -('2013-01-16',201303,1,2013,16,3,201301,2013), -('2013-01-17',201303,1,2013,17,3,201301,2013), -('2013-01-18',201303,1,2013,18,3,201301,2013), -('2013-01-19',201303,1,2013,19,3,201301,2013), -('2013-01-20',201304,1,2013,20,4,201301,2013), -('2013-01-21',201304,1,2013,21,4,201301,2013), -('2013-01-22',201304,1,2013,22,4,201301,2013), -('2013-01-23',201304,1,2013,23,4,201301,2013), -('2013-01-24',201304,1,2013,24,4,201301,2013), -('2013-01-25',201304,1,2013,25,4,201301,2013), -('2013-01-26',201304,1,2013,26,4,201301,2013), -('2013-01-27',201305,1,2013,27,5,201301,2013), -('2013-01-28',201305,1,2013,28,5,201301,2013), -('2013-01-29',201305,1,2013,29,5,201301,2013), -('2013-01-30',201305,1,2013,30,5,201301,2013), -('2013-01-31',201305,1,2013,31,5,201301,2013), -('2013-02-01',201305,2,2013,1,5,201302,2013), -('2013-02-02',201305,2,2013,2,5,201302,2013), -('2013-02-03',201306,2,2013,3,6,201302,2013), -('2013-02-04',201306,2,2013,4,6,201302,2013), -('2013-02-05',201306,2,2013,5,6,201302,2013), -('2013-02-06',201306,2,2013,6,6,201302,2013), -('2013-02-07',201306,2,2013,7,6,201302,2013), -('2013-02-08',201306,2,2013,8,6,201302,2013), -('2013-02-09',201306,2,2013,9,6,201302,2013), -('2013-02-10',201307,2,2013,10,7,201302,2013), -('2013-02-11',201307,2,2013,11,7,201302,2013), -('2013-02-12',201307,2,2013,12,7,201302,2013), -('2013-02-13',201307,2,2013,13,7,201302,2013), -('2013-02-14',201307,2,2013,14,7,201302,2013), -('2013-02-15',201307,2,2013,15,7,201302,2013), -('2013-02-16',201307,2,2013,16,7,201302,2013), -('2013-02-17',201308,2,2013,17,8,201302,2013), -('2013-02-18',201308,2,2013,18,8,201302,2013), -('2013-02-19',201308,2,2013,19,8,201302,2013), -('2013-02-20',201308,2,2013,20,8,201302,2013), -('2013-02-21',201308,2,2013,21,8,201302,2013), -('2013-02-22',201308,2,2013,22,8,201302,2013), -('2013-02-23',201308,2,2013,23,8,201302,2013), -('2013-02-24',201309,2,2013,24,9,201302,2013), -('2013-02-25',201309,2,2013,25,9,201302,2013), -('2013-02-26',201309,2,2013,26,9,201302,2013), -('2013-02-27',201309,2,2013,27,9,201302,2013), -('2013-02-28',201309,2,2013,28,9,201302,2013), -('2013-03-01',201309,3,2013,1,9,201303,2013), -('2013-03-02',201309,3,2013,2,9,201303,2013), -('2013-03-03',201310,3,2013,3,10,201303,2013), -('2013-03-04',201310,3,2013,4,10,201303,2013), -('2013-03-05',201310,3,2013,5,10,201303,2013), -('2013-03-06',201310,3,2013,6,10,201303,2013), -('2013-03-07',201310,3,2013,7,10,201303,2013), -('2013-03-08',201310,3,2013,8,10,201303,2013), -('2013-03-09',201310,3,2013,9,10,201303,2013), -('2013-03-10',201311,3,2013,10,11,201303,2013), -('2013-03-11',201311,3,2013,11,11,201303,2013), -('2013-03-12',201311,3,2013,12,11,201303,2013), -('2013-03-13',201311,3,2013,13,11,201303,2013), -('2013-03-14',201311,3,2013,14,11,201303,2013), -('2013-03-15',201311,3,2013,15,11,201303,2013), -('2013-03-16',201311,3,2013,16,11,201303,2013), -('2013-03-17',201312,3,2013,17,12,201303,2013), -('2013-03-18',201312,3,2013,18,12,201303,2013), -('2013-03-19',201312,3,2013,19,12,201303,2013), -('2013-03-20',201312,3,2013,20,12,201303,2013), -('2013-03-21',201312,3,2013,21,12,201303,2013), -('2013-03-22',201312,3,2013,22,12,201303,2013), -('2013-03-23',201312,3,2013,23,12,201303,2013), -('2013-03-24',201313,3,2013,24,13,201303,2013), -('2013-03-25',201313,3,2013,25,13,201303,2013), -('2013-03-26',201313,3,2013,26,13,201303,2013), -('2013-03-27',201313,3,2013,27,13,201303,2013), -('2013-03-28',201313,3,2013,28,13,201303,2013), -('2013-03-29',201313,3,2013,29,13,201303,2013), -('2013-03-30',201313,3,2013,30,13,201303,2013), -('2013-03-31',201314,3,2013,31,14,201303,2013), -('2013-04-01',201314,4,2013,1,14,201304,2013), -('2013-04-02',201314,4,2013,2,14,201304,2013), -('2013-04-03',201314,4,2013,3,14,201304,2013), -('2013-04-04',201314,4,2013,4,14,201304,2013), -('2013-04-05',201314,4,2013,5,14,201304,2013), -('2013-04-06',201314,4,2013,6,14,201304,2013), -('2013-04-07',201315,4,2013,7,15,201304,2013), -('2013-04-08',201315,4,2013,8,15,201304,2013), -('2013-04-09',201315,4,2013,9,15,201304,2013), -('2013-04-10',201315,4,2013,10,15,201304,2013), -('2013-04-11',201315,4,2013,11,15,201304,2013), -('2013-04-12',201315,4,2013,12,15,201304,2013), -('2013-04-13',201315,4,2013,13,15,201304,2013), -('2013-04-14',201316,4,2013,14,16,201304,2013), -('2013-04-15',201316,4,2013,15,16,201304,2013), -('2013-04-16',201316,4,2013,16,16,201304,2013), -('2013-04-17',201316,4,2013,17,16,201304,2013), -('2013-04-18',201316,4,2013,18,16,201304,2013), -('2013-04-19',201316,4,2013,19,16,201304,2013), -('2013-04-20',201316,4,2013,20,16,201304,2013), -('2013-04-21',201317,4,2013,21,17,201304,2013), -('2013-04-22',201317,4,2013,22,17,201304,2013), -('2013-04-23',201317,4,2013,23,17,201304,2013), -('2013-04-24',201317,4,2013,24,17,201304,2013), -('2013-04-25',201317,4,2013,25,17,201304,2013), -('2013-04-26',201317,4,2013,26,17,201304,2013), -('2013-04-27',201317,4,2013,27,17,201304,2013), -('2013-04-28',201318,4,2013,28,18,201304,2013), -('2013-04-29',201318,4,2013,29,18,201304,2013), -('2013-04-30',201318,4,2013,30,18,201304,2013), -('2013-05-01',201318,5,2013,1,18,201305,2013), -('2013-05-02',201318,5,2013,2,18,201305,2013), -('2013-05-03',201318,5,2013,3,18,201305,2013), -('2013-05-04',201318,5,2013,4,18,201305,2013), -('2013-05-05',201319,5,2013,5,19,201305,2013), -('2013-05-06',201319,5,2013,6,19,201305,2013), -('2013-05-07',201319,5,2013,7,19,201305,2013), -('2013-05-08',201319,5,2013,8,19,201305,2013), -('2013-05-09',201319,5,2013,9,19,201305,2013), -('2013-05-10',201319,5,2013,10,19,201305,2013), -('2013-05-11',201319,5,2013,11,19,201305,2013), -('2013-05-12',201320,5,2013,12,20,201305,2013), -('2013-05-13',201320,5,2013,13,20,201305,2013), -('2013-05-14',201320,5,2013,14,20,201305,2013), -('2013-05-15',201320,5,2013,15,20,201305,2013), -('2013-05-16',201320,5,2013,16,20,201305,2013), -('2013-05-17',201320,5,2013,17,20,201305,2013), -('2013-05-18',201320,5,2013,18,20,201305,2013), -('2013-05-19',201321,5,2013,19,21,201305,2013), -('2013-05-20',201321,5,2013,20,21,201305,2013), -('2013-05-21',201321,5,2013,21,21,201305,2013), -('2013-05-22',201321,5,2013,22,21,201305,2013), -('2013-05-23',201321,5,2013,23,21,201305,2013), -('2013-05-24',201321,5,2013,24,21,201305,2013), -('2013-05-25',201321,5,2013,25,21,201305,2013), -('2013-05-26',201322,5,2013,26,22,201305,2013), -('2013-05-27',201322,5,2013,27,22,201305,2013), -('2013-05-28',201322,5,2013,28,22,201305,2013), -('2013-05-29',201322,5,2013,29,22,201305,2013), -('2013-05-30',201322,5,2013,30,22,201305,2013), -('2013-05-31',201322,5,2013,31,22,201305,2013), -('2013-06-01',201322,6,2013,1,22,201306,2013), -('2013-06-02',201323,6,2013,2,23,201306,2013), -('2013-06-03',201323,6,2013,3,23,201306,2013), -('2013-06-04',201323,6,2013,4,23,201306,2013), -('2013-06-05',201323,6,2013,5,23,201306,2013), -('2013-06-06',201323,6,2013,6,23,201306,2013), -('2013-06-07',201323,6,2013,7,23,201306,2013), -('2013-06-08',201323,6,2013,8,23,201306,2013), -('2013-06-09',201324,6,2013,9,24,201306,2013), -('2013-06-10',201324,6,2013,10,24,201306,2013), -('2013-06-11',201324,6,2013,11,24,201306,2013), -('2013-06-12',201324,6,2013,12,24,201306,2013), -('2013-06-13',201324,6,2013,13,24,201306,2013), -('2013-06-14',201324,6,2013,14,24,201306,2013), -('2013-06-15',201324,6,2013,15,24,201306,2013), -('2013-06-16',201325,6,2013,16,25,201306,2013), -('2013-06-17',201325,6,2013,17,25,201306,2013), -('2013-06-18',201325,6,2013,18,25,201306,2013), -('2013-06-19',201325,6,2013,19,25,201306,2013), -('2013-06-20',201325,6,2013,20,25,201306,2013), -('2013-06-21',201325,6,2013,21,25,201306,2013), -('2013-06-22',201325,6,2013,22,25,201306,2013), -('2013-06-23',201326,6,2013,23,26,201306,2013), -('2013-06-24',201326,6,2013,24,26,201306,2013), -('2013-06-25',201326,6,2013,25,26,201306,2013), -('2013-06-26',201326,6,2013,26,26,201306,2013), -('2013-06-27',201326,6,2013,27,26,201306,2013), -('2013-06-28',201326,6,2013,28,26,201306,2013), -('2013-06-29',201326,6,2013,29,26,201306,2013), -('2013-06-30',201327,6,2013,30,27,201306,2013), -('2013-07-01',201327,7,2013,1,27,201307,2013), -('2013-07-02',201327,7,2013,2,27,201307,2013), -('2013-07-03',201327,7,2013,3,27,201307,2013), -('2013-07-04',201327,7,2013,4,27,201307,2013), -('2013-07-05',201327,7,2013,5,27,201307,2013), -('2013-07-06',201327,7,2013,6,27,201307,2013), -('2013-07-07',201328,7,2013,7,28,201307,2013), -('2013-07-08',201328,7,2013,8,28,201307,2013), -('2013-07-09',201328,7,2013,9,28,201307,2013), -('2013-07-10',201328,7,2013,10,28,201307,2013), -('2013-07-11',201328,7,2013,11,28,201307,2013), -('2013-07-12',201328,7,2013,12,28,201307,2013), -('2013-07-13',201328,7,2013,13,28,201307,2013), -('2013-07-14',201329,7,2013,14,29,201307,2013), -('2013-07-15',201329,7,2013,15,29,201307,2013), -('2013-07-16',201329,7,2013,16,29,201307,2013), -('2013-07-17',201329,7,2013,17,29,201307,2013), -('2013-07-18',201329,7,2013,18,29,201307,2013), -('2013-07-19',201329,7,2013,19,29,201307,2013), -('2013-07-20',201329,7,2013,20,29,201307,2013), -('2013-07-21',201330,7,2013,21,30,201307,2013), -('2013-07-22',201330,7,2013,22,30,201307,2013), -('2013-07-23',201330,7,2013,23,30,201307,2013), -('2013-07-24',201330,7,2013,24,30,201307,2013), -('2013-07-25',201330,7,2013,25,30,201307,2013), -('2013-07-26',201330,7,2013,26,30,201307,2013), -('2013-07-27',201330,7,2013,27,30,201307,2013), -('2013-07-28',201331,7,2013,28,31,201307,2013), -('2013-07-29',201331,7,2013,29,31,201307,2013), -('2013-07-30',201331,7,2013,30,31,201307,2013), -('2013-07-31',201331,7,2013,31,31,201307,2013), -('2013-08-01',201331,8,2013,1,31,201308,2013), -('2013-08-02',201331,8,2013,2,31,201308,2013), -('2013-08-03',201331,8,2013,3,31,201308,2013), -('2013-08-04',201332,8,2013,4,32,201308,2013), -('2013-08-05',201332,8,2013,5,32,201308,2013), -('2013-08-06',201332,8,2013,6,32,201308,2013), -('2013-08-07',201332,8,2013,7,32,201308,2013), -('2013-08-08',201332,8,2013,8,32,201308,2013), -('2013-08-09',201332,8,2013,9,32,201308,2013), -('2013-08-10',201332,8,2013,10,32,201308,2013), -('2013-08-11',201333,8,2013,11,33,201308,2013), -('2013-08-12',201333,8,2013,12,33,201308,2013), -('2013-08-13',201333,8,2013,13,33,201308,2013), -('2013-08-14',201333,8,2013,14,33,201308,2013), -('2013-08-15',201333,8,2013,15,33,201308,2013), -('2013-08-16',201333,8,2013,16,33,201308,2013), -('2013-08-17',201333,8,2013,17,33,201308,2013), -('2013-08-18',201334,8,2013,18,34,201308,2013), -('2013-08-19',201334,8,2013,19,34,201308,2013), -('2013-08-20',201334,8,2013,20,34,201308,2013), -('2013-08-21',201334,8,2013,21,34,201308,2013), -('2013-08-22',201334,8,2013,22,34,201308,2013), -('2013-08-23',201334,8,2013,23,34,201308,2013), -('2013-08-24',201334,8,2013,24,34,201308,2013), -('2013-08-25',201335,8,2013,25,35,201308,2013), -('2013-08-26',201335,8,2013,26,35,201308,2013), -('2013-08-27',201335,8,2013,27,35,201308,2013), -('2013-08-28',201335,8,2013,28,35,201308,2013), -('2013-08-29',201335,8,2013,29,35,201308,2013), -('2013-08-30',201335,8,2013,30,35,201308,2013), -('2013-08-31',201335,8,2013,31,35,201308,2013), -('2013-09-01',201336,9,2013,1,36,201309,2013), -('2013-09-02',201336,9,2013,2,36,201309,2013), -('2013-09-03',201336,9,2013,3,36,201309,2013), -('2013-09-04',201336,9,2013,4,36,201309,2013), -('2013-09-05',201336,9,2013,5,36,201309,2013), -('2013-09-06',201336,9,2013,6,36,201309,2013), -('2013-09-07',201336,9,2013,7,36,201309,2013), -('2013-09-08',201337,9,2013,8,37,201309,2013), -('2013-09-09',201337,9,2013,9,37,201309,2013), -('2013-09-10',201337,9,2013,10,37,201309,2013), -('2013-09-11',201337,9,2013,11,37,201309,2013), -('2013-09-12',201337,9,2013,12,37,201309,2013), -('2013-09-13',201337,9,2013,13,37,201309,2013), -('2013-09-14',201337,9,2013,14,37,201309,2013), -('2013-09-15',201338,9,2013,15,38,201309,2013), -('2013-09-16',201338,9,2013,16,38,201309,2013), -('2013-09-17',201338,9,2013,17,38,201309,2013), -('2013-09-18',201338,9,2013,18,38,201309,2013), -('2013-09-19',201338,9,2013,19,38,201309,2013), -('2013-09-20',201338,9,2013,20,38,201309,2013), -('2013-09-21',201338,9,2013,21,38,201309,2013), -('2013-09-22',201339,9,2013,22,39,201309,2013), -('2013-09-23',201339,9,2013,23,39,201309,2013), -('2013-09-24',201339,9,2013,24,39,201309,2013), -('2013-09-25',201339,9,2013,25,39,201309,2013), -('2013-09-26',201339,9,2013,26,39,201309,2013), -('2013-09-27',201339,9,2013,27,39,201309,2013), -('2013-09-28',201339,9,2013,28,39,201309,2013), -('2013-09-29',201340,9,2013,29,40,201309,2013), -('2013-09-30',201340,9,2013,30,40,201309,2013), -('2013-10-01',201340,10,2013,1,40,201310,2013), -('2013-10-02',201340,10,2013,2,40,201310,2013), -('2013-10-03',201340,10,2013,3,40,201310,2013), -('2013-10-04',201340,10,2013,4,40,201310,2013), -('2013-10-05',201340,10,2013,5,40,201310,2013), -('2013-10-06',201341,10,2013,6,41,201310,2013), -('2013-10-07',201341,10,2013,7,41,201310,2013), -('2013-10-08',201341,10,2013,8,41,201310,2013), -('2013-10-09',201341,10,2013,9,41,201310,2013), -('2013-10-10',201341,10,2013,10,41,201310,2013), -('2013-10-11',201341,10,2013,11,41,201310,2013), -('2013-10-12',201341,10,2013,12,41,201310,2013), -('2013-10-13',201342,10,2013,13,42,201310,2013), -('2013-10-14',201342,10,2013,14,42,201310,2013), -('2013-10-15',201342,10,2013,15,42,201310,2013), -('2013-10-16',201342,10,2013,16,42,201310,2013), -('2013-10-17',201342,10,2013,17,42,201310,2013), -('2013-10-18',201342,10,2013,18,42,201310,2013), -('2013-10-19',201342,10,2013,19,42,201310,2013), -('2013-10-20',201343,10,2013,20,43,201310,2013), -('2013-10-21',201343,10,2013,21,43,201310,2013), -('2013-10-22',201343,10,2013,22,43,201310,2013), -('2013-10-23',201343,10,2013,23,43,201310,2013), -('2013-10-24',201343,10,2013,24,43,201310,2013), -('2013-10-25',201343,10,2013,25,43,201310,2013), -('2013-10-26',201343,10,2013,26,43,201310,2013), -('2013-10-27',201344,10,2013,27,44,201310,2013), -('2013-10-28',201344,10,2013,28,44,201310,2013), -('2013-10-29',201344,10,2013,29,44,201310,2013), -('2013-10-30',201344,10,2013,30,44,201310,2013), -('2013-10-31',201344,10,2013,31,44,201310,2013), -('2013-11-01',201344,11,2013,1,44,201311,2013), -('2013-11-02',201344,11,2013,2,44,201311,2013), -('2013-11-03',201345,11,2013,3,45,201311,2013), -('2013-11-04',201345,11,2013,4,45,201311,2013), -('2013-11-05',201345,11,2013,5,45,201311,2013), -('2013-11-06',201345,11,2013,6,45,201311,2013), -('2013-11-07',201345,11,2013,7,45,201311,2013), -('2013-11-08',201345,11,2013,8,45,201311,2013), -('2013-11-09',201345,11,2013,9,45,201311,2013), -('2013-11-10',201346,11,2013,10,46,201311,2013), -('2013-11-11',201346,11,2013,11,46,201311,2013), -('2013-11-12',201346,11,2013,12,46,201311,2013), -('2013-11-13',201346,11,2013,13,46,201311,2013), -('2013-11-14',201346,11,2013,14,46,201311,2013), -('2013-11-15',201346,11,2013,15,46,201311,2013), -('2013-11-16',201346,11,2013,16,46,201311,2013), -('2013-11-17',201347,11,2013,17,47,201311,2013), -('2013-11-18',201347,11,2013,18,47,201311,2013), -('2013-11-19',201347,11,2013,19,47,201311,2013), -('2013-11-20',201347,11,2013,20,47,201311,2013), -('2013-11-21',201347,11,2013,21,47,201311,2013), -('2013-11-22',201347,11,2013,22,47,201311,2013), -('2013-11-23',201347,11,2013,23,47,201311,2013), -('2013-11-24',201348,11,2013,24,48,201311,2013), -('2013-11-25',201348,11,2013,25,48,201311,2013), -('2013-11-26',201348,11,2013,26,48,201311,2013), -('2013-11-27',201348,11,2013,27,48,201311,2013), -('2013-11-28',201348,11,2013,28,48,201311,2013), -('2013-11-29',201348,11,2013,29,48,201311,2013), -('2013-11-30',201348,11,2013,30,48,201311,2013), -('2013-12-01',201349,12,2013,1,49,201312,2014), -('2013-12-02',201349,12,2013,2,49,201312,2014), -('2013-12-03',201349,12,2013,3,49,201312,2014), -('2013-12-04',201349,12,2013,4,49,201312,2014), -('2013-12-05',201349,12,2013,5,49,201312,2014), -('2013-12-06',201349,12,2013,6,49,201312,2014), -('2013-12-07',201349,12,2013,7,49,201312,2014), -('2013-12-08',201350,12,2013,8,50,201312,2014), -('2013-12-09',201350,12,2013,9,50,201312,2014), -('2013-12-10',201350,12,2013,10,50,201312,2014), -('2013-12-11',201350,12,2013,11,50,201312,2014), -('2013-12-12',201350,12,2013,12,50,201312,2014), -('2013-12-13',201350,12,2013,13,50,201312,2014), -('2013-12-14',201350,12,2013,14,50,201312,2014), -('2013-12-15',201351,12,2013,15,51,201312,2014), -('2013-12-16',201351,12,2013,16,51,201312,2014), -('2013-12-17',201351,12,2013,17,51,201312,2014), -('2013-12-18',201351,12,2013,18,51,201312,2014), -('2013-12-19',201351,12,2013,19,51,201312,2014), -('2013-12-20',201351,12,2013,20,51,201312,2014), -('2013-12-21',201351,12,2013,21,51,201312,2014), -('2013-12-22',201352,12,2013,22,52,201312,2014), -('2013-12-23',201352,12,2013,23,52,201312,2014), -('2013-12-24',201352,12,2013,24,52,201312,2014), -('2013-12-25',201352,12,2013,25,52,201312,2014), -('2013-12-26',201352,12,2013,26,52,201312,2014), -('2013-12-27',201352,12,2013,27,52,201312,2014), -('2013-12-28',201352,12,2013,28,52,201312,2014), -('2013-12-29',201401,12,2013,29,1,201312,2014), -('2013-12-30',201401,12,2013,30,1,201312,2014), -('2013-12-31',201401,12,2013,31,1,201312,2014), -('2014-01-01',201401,1,2014,1,1,201401,2014), -('2014-01-02',201401,1,2014,2,1,201401,2014), -('2014-01-03',201401,1,2014,3,1,201401,2014), -('2014-01-04',201401,1,2014,4,1,201401,2014), -('2014-01-05',201402,1,2014,5,2,201401,2014), -('2014-01-06',201402,1,2014,6,2,201401,2014), -('2014-01-07',201402,1,2014,7,2,201401,2014), -('2014-01-08',201402,1,2014,8,2,201401,2014), -('2014-01-09',201402,1,2014,9,2,201401,2014), -('2014-01-10',201402,1,2014,10,2,201401,2014), -('2014-01-11',201402,1,2014,11,2,201401,2014), -('2014-01-12',201403,1,2014,12,3,201401,2014), -('2014-01-13',201403,1,2014,13,3,201401,2014), -('2014-01-14',201403,1,2014,14,3,201401,2014), -('2014-01-15',201403,1,2014,15,3,201401,2014), -('2014-01-16',201403,1,2014,16,3,201401,2014), -('2014-01-17',201403,1,2014,17,3,201401,2014), -('2014-01-18',201403,1,2014,18,3,201401,2014), -('2014-01-19',201404,1,2014,19,4,201401,2014), -('2014-01-20',201404,1,2014,20,4,201401,2014), -('2014-01-21',201404,1,2014,21,4,201401,2014), -('2014-01-22',201404,1,2014,22,4,201401,2014), -('2014-01-23',201404,1,2014,23,4,201401,2014), -('2014-01-24',201404,1,2014,24,4,201401,2014), -('2014-01-25',201404,1,2014,25,4,201401,2014), -('2014-01-26',201405,1,2014,26,5,201401,2014), -('2014-01-27',201405,1,2014,27,5,201401,2014), -('2014-01-28',201405,1,2014,28,5,201401,2014), -('2014-01-29',201405,1,2014,29,5,201401,2014), -('2014-01-30',201405,1,2014,30,5,201401,2014), -('2014-01-31',201405,1,2014,31,5,201401,2014), -('2014-02-01',201405,2,2014,1,5,201402,2014), -('2014-02-02',201406,2,2014,2,6,201402,2014), -('2014-02-03',201406,2,2014,3,6,201402,2014), -('2014-02-04',201406,2,2014,4,6,201402,2014), -('2014-02-05',201406,2,2014,5,6,201402,2014), -('2014-02-06',201406,2,2014,6,6,201402,2014), -('2014-02-07',201406,2,2014,7,6,201402,2014), -('2014-02-08',201406,2,2014,8,6,201402,2014), -('2014-02-09',201407,2,2014,9,7,201402,2014), -('2014-02-10',201407,2,2014,10,7,201402,2014), -('2014-02-11',201407,2,2014,11,7,201402,2014), -('2014-02-12',201407,2,2014,12,7,201402,2014), -('2014-02-13',201407,2,2014,13,7,201402,2014), -('2014-02-14',201407,2,2014,14,7,201402,2014), -('2014-02-15',201407,2,2014,15,7,201402,2014), -('2014-02-16',201408,2,2014,16,8,201402,2014), -('2014-02-17',201408,2,2014,17,8,201402,2014), -('2014-02-18',201408,2,2014,18,8,201402,2014), -('2014-02-19',201408,2,2014,19,8,201402,2014), -('2014-02-20',201408,2,2014,20,8,201402,2014), -('2014-02-21',201408,2,2014,21,8,201402,2014), -('2014-02-22',201408,2,2014,22,8,201402,2014), -('2014-02-23',201409,2,2014,23,9,201402,2014), -('2014-02-24',201409,2,2014,24,9,201402,2014), -('2014-02-25',201409,2,2014,25,9,201402,2014), -('2014-02-26',201409,2,2014,26,9,201402,2014), -('2014-02-27',201409,2,2014,27,9,201402,2014), -('2014-02-28',201409,2,2014,28,9,201402,2014), -('2014-03-01',201409,3,2014,1,9,201403,2014), -('2014-03-02',201410,3,2014,2,10,201403,2014), -('2014-03-03',201410,3,2014,3,10,201403,2014), -('2014-03-04',201410,3,2014,4,10,201403,2014), -('2014-03-05',201410,3,2014,5,10,201403,2014), -('2014-03-06',201410,3,2014,6,10,201403,2014), -('2014-03-07',201410,3,2014,7,10,201403,2014), -('2014-03-08',201410,3,2014,8,10,201403,2014), -('2014-03-09',201411,3,2014,9,11,201403,2014), -('2014-03-10',201411,3,2014,10,11,201403,2014), -('2014-03-11',201411,3,2014,11,11,201403,2014), -('2014-03-12',201411,3,2014,12,11,201403,2014), -('2014-03-13',201411,3,2014,13,11,201403,2014), -('2014-03-14',201411,3,2014,14,11,201403,2014), -('2014-03-15',201411,3,2014,15,11,201403,2014), -('2014-03-16',201412,3,2014,16,12,201403,2014), -('2014-03-17',201412,3,2014,17,12,201403,2014), -('2014-03-18',201412,3,2014,18,12,201403,2014), -('2014-03-19',201412,3,2014,19,12,201403,2014), -('2014-03-20',201412,3,2014,20,12,201403,2014), -('2014-03-21',201412,3,2014,21,12,201403,2014), -('2014-03-22',201412,3,2014,22,12,201403,2014), -('2014-03-23',201413,3,2014,23,13,201403,2014), -('2014-03-24',201413,3,2014,24,13,201403,2014), -('2014-03-25',201413,3,2014,25,13,201403,2014), -('2014-03-26',201413,3,2014,26,13,201403,2014), -('2014-03-27',201413,3,2014,27,13,201403,2014), -('2014-03-28',201413,3,2014,28,13,201403,2014), -('2014-03-29',201413,3,2014,29,13,201403,2014), -('2014-03-30',201414,3,2014,30,14,201403,2014), -('2014-03-31',201414,3,2014,31,14,201403,2014), -('2014-04-01',201414,4,2014,1,14,201404,2014), -('2014-04-02',201414,4,2014,2,14,201404,2014), -('2014-04-03',201414,4,2014,3,14,201404,2014), -('2014-04-04',201414,4,2014,4,14,201404,2014), -('2014-04-05',201414,4,2014,5,14,201404,2014), -('2014-04-06',201415,4,2014,6,15,201404,2014), -('2014-04-07',201415,4,2014,7,15,201404,2014), -('2014-04-08',201415,4,2014,8,15,201404,2014), -('2014-04-09',201415,4,2014,9,15,201404,2014), -('2014-04-10',201415,4,2014,10,15,201404,2014), -('2014-04-11',201415,4,2014,11,15,201404,2014), -('2014-04-12',201415,4,2014,12,15,201404,2014), -('2014-04-13',201416,4,2014,13,16,201404,2014), -('2014-04-14',201416,4,2014,14,16,201404,2014), -('2014-04-15',201416,4,2014,15,16,201404,2014), -('2014-04-16',201416,4,2014,16,16,201404,2014), -('2014-04-17',201416,4,2014,17,16,201404,2014), -('2014-04-18',201416,4,2014,18,16,201404,2014), -('2014-04-19',201416,4,2014,19,16,201404,2014), -('2014-04-20',201417,4,2014,20,17,201404,2014), -('2014-04-21',201417,4,2014,21,17,201404,2014), -('2014-04-22',201417,4,2014,22,17,201404,2014), -('2014-04-23',201417,4,2014,23,17,201404,2014), -('2014-04-24',201417,4,2014,24,17,201404,2014), -('2014-04-25',201417,4,2014,25,17,201404,2014), -('2014-04-26',201417,4,2014,26,17,201404,2014), -('2014-04-27',201418,4,2014,27,18,201404,2014), -('2014-04-28',201418,4,2014,28,18,201404,2014), -('2014-04-29',201418,4,2014,29,18,201404,2014), -('2014-04-30',201418,4,2014,30,18,201404,2014), -('2014-05-01',201418,5,2014,1,18,201405,2014), -('2014-05-02',201418,5,2014,2,18,201405,2014), -('2014-05-03',201418,5,2014,3,18,201405,2014), -('2014-05-04',201419,5,2014,4,19,201405,2014), -('2014-05-05',201419,5,2014,5,19,201405,2014), -('2014-05-06',201419,5,2014,6,19,201405,2014), -('2014-05-07',201419,5,2014,7,19,201405,2014), -('2014-05-08',201419,5,2014,8,19,201405,2014), -('2014-05-09',201419,5,2014,9,19,201405,2014), -('2014-05-10',201419,5,2014,10,19,201405,2014), -('2014-05-11',201420,5,2014,11,20,201405,2014), -('2014-05-12',201420,5,2014,12,20,201405,2014), -('2014-05-13',201420,5,2014,13,20,201405,2014), -('2014-05-14',201420,5,2014,14,20,201405,2014), -('2014-05-15',201420,5,2014,15,20,201405,2014), -('2014-05-16',201420,5,2014,16,20,201405,2014), -('2014-05-17',201420,5,2014,17,20,201405,2014), -('2014-05-18',201421,5,2014,18,21,201405,2014), -('2014-05-19',201421,5,2014,19,21,201405,2014), -('2014-05-20',201421,5,2014,20,21,201405,2014), -('2014-05-21',201421,5,2014,21,21,201405,2014), -('2014-05-22',201421,5,2014,22,21,201405,2014), -('2014-05-23',201421,5,2014,23,21,201405,2014), -('2014-05-24',201421,5,2014,24,21,201405,2014), -('2014-05-25',201422,5,2014,25,22,201405,2014), -('2014-05-26',201422,5,2014,26,22,201405,2014), -('2014-05-27',201422,5,2014,27,22,201405,2014), -('2014-05-28',201422,5,2014,28,22,201405,2014), -('2014-05-29',201422,5,2014,29,22,201405,2014), -('2014-05-30',201422,5,2014,30,22,201405,2014), -('2014-05-31',201422,5,2014,31,22,201405,2014), -('2014-06-01',201423,6,2014,1,23,201406,2014), -('2014-06-02',201423,6,2014,2,23,201406,2014), -('2014-06-03',201423,6,2014,3,23,201406,2014), -('2014-06-04',201423,6,2014,4,23,201406,2014), -('2014-06-05',201423,6,2014,5,23,201406,2014), -('2014-06-06',201423,6,2014,6,23,201406,2014), -('2014-06-07',201423,6,2014,7,23,201406,2014), -('2014-06-08',201424,6,2014,8,24,201406,2014), -('2014-06-09',201424,6,2014,9,24,201406,2014), -('2014-06-10',201424,6,2014,10,24,201406,2014), -('2014-06-11',201424,6,2014,11,24,201406,2014), -('2014-06-12',201424,6,2014,12,24,201406,2014), -('2014-06-13',201424,6,2014,13,24,201406,2014), -('2014-06-14',201424,6,2014,14,24,201406,2014), -('2014-06-15',201425,6,2014,15,25,201406,2014), -('2014-06-16',201425,6,2014,16,25,201406,2014), -('2014-06-17',201425,6,2014,17,25,201406,2014), -('2014-06-18',201425,6,2014,18,25,201406,2014), -('2014-06-19',201425,6,2014,19,25,201406,2014), -('2014-06-20',201425,6,2014,20,25,201406,2014), -('2014-06-21',201425,6,2014,21,25,201406,2014), -('2014-06-22',201426,6,2014,22,26,201406,2014), -('2014-06-23',201426,6,2014,23,26,201406,2014), -('2014-06-24',201426,6,2014,24,26,201406,2014), -('2014-06-25',201426,6,2014,25,26,201406,2014), -('2014-06-26',201426,6,2014,26,26,201406,2014), -('2014-06-27',201426,6,2014,27,26,201406,2014), -('2014-06-28',201426,6,2014,28,26,201406,2014), -('2014-06-29',201427,6,2014,29,27,201406,2014), -('2014-06-30',201427,6,2014,30,27,201406,2014), -('2014-07-01',201427,7,2014,1,27,201407,2014), -('2014-07-02',201427,7,2014,2,27,201407,2014), -('2014-07-03',201427,7,2014,3,27,201407,2014), -('2014-07-04',201427,7,2014,4,27,201407,2014), -('2014-07-05',201427,7,2014,5,27,201407,2014), -('2014-07-06',201428,7,2014,6,28,201407,2014), -('2014-07-07',201428,7,2014,7,28,201407,2014), -('2014-07-08',201428,7,2014,8,28,201407,2014), -('2014-07-09',201428,7,2014,9,28,201407,2014), -('2014-07-10',201428,7,2014,10,28,201407,2014), -('2014-07-11',201428,7,2014,11,28,201407,2014), -('2014-07-12',201428,7,2014,12,28,201407,2014), -('2014-07-13',201429,7,2014,13,29,201407,2014), -('2014-07-14',201429,7,2014,14,29,201407,2014), -('2014-07-15',201429,7,2014,15,29,201407,2014), -('2014-07-16',201429,7,2014,16,29,201407,2014), -('2014-07-17',201429,7,2014,17,29,201407,2014), -('2014-07-18',201429,7,2014,18,29,201407,2014), -('2014-07-19',201429,7,2014,19,29,201407,2014), -('2014-07-20',201430,7,2014,20,30,201407,2014), -('2014-07-21',201430,7,2014,21,30,201407,2014), -('2014-07-22',201430,7,2014,22,30,201407,2014), -('2014-07-23',201430,7,2014,23,30,201407,2014), -('2014-07-24',201430,7,2014,24,30,201407,2014), -('2014-07-25',201430,7,2014,25,30,201407,2014), -('2014-07-26',201430,7,2014,26,30,201407,2014), -('2014-07-27',201431,7,2014,27,31,201407,2014), -('2014-07-28',201431,7,2014,28,31,201407,2014), -('2014-07-29',201431,7,2014,29,31,201407,2014), -('2014-07-30',201431,7,2014,30,31,201407,2014), -('2014-07-31',201431,7,2014,31,31,201407,2014), -('2014-08-01',201431,8,2014,1,31,201408,2014), -('2014-08-02',201431,8,2014,2,31,201408,2014), -('2014-08-03',201432,8,2014,3,32,201408,2014), -('2014-08-04',201432,8,2014,4,32,201408,2014), -('2014-08-05',201432,8,2014,5,32,201408,2014), -('2014-08-06',201432,8,2014,6,32,201408,2014), -('2014-08-07',201432,8,2014,7,32,201408,2014), -('2014-08-08',201432,8,2014,8,32,201408,2014), -('2014-08-09',201432,8,2014,9,32,201408,2014), -('2014-08-10',201433,8,2014,10,33,201408,2014), -('2014-08-11',201433,8,2014,11,33,201408,2014), -('2014-08-12',201433,8,2014,12,33,201408,2014), -('2014-08-13',201433,8,2014,13,33,201408,2014), -('2014-08-14',201433,8,2014,14,33,201408,2014), -('2014-08-15',201433,8,2014,15,33,201408,2014), -('2014-08-16',201433,8,2014,16,33,201408,2014), -('2014-08-17',201434,8,2014,17,34,201408,2014), -('2014-08-18',201434,8,2014,18,34,201408,2014), -('2014-08-19',201434,8,2014,19,34,201408,2014), -('2014-08-20',201434,8,2014,20,34,201408,2014), -('2014-08-21',201434,8,2014,21,34,201408,2014), -('2014-08-22',201434,8,2014,22,34,201408,2014), -('2014-08-23',201434,8,2014,23,34,201408,2014), -('2014-08-24',201435,8,2014,24,35,201408,2014), -('2014-08-25',201435,8,2014,25,35,201408,2014), -('2014-08-26',201435,8,2014,26,35,201408,2014), -('2014-08-27',201435,8,2014,27,35,201408,2014), -('2014-08-28',201435,8,2014,28,35,201408,2014), -('2014-08-29',201435,8,2014,29,35,201408,2014), -('2014-08-30',201435,8,2014,30,35,201408,2014), -('2014-08-31',201436,8,2014,31,36,201408,2014), -('2014-09-01',201436,9,2014,1,36,201409,2014), -('2014-09-02',201436,9,2014,2,36,201409,2014), -('2014-09-03',201436,9,2014,3,36,201409,2014), -('2014-09-04',201436,9,2014,4,36,201409,2014), -('2014-09-05',201436,9,2014,5,36,201409,2014), -('2014-09-06',201436,9,2014,6,36,201409,2014), -('2014-09-07',201437,9,2014,7,37,201409,2014), -('2014-09-08',201437,9,2014,8,37,201409,2014), -('2014-09-09',201437,9,2014,9,37,201409,2014), -('2014-09-10',201437,9,2014,10,37,201409,2014), -('2014-09-11',201437,9,2014,11,37,201409,2014), -('2014-09-12',201437,9,2014,12,37,201409,2014), -('2014-09-13',201437,9,2014,13,37,201409,2014), -('2014-09-14',201438,9,2014,14,38,201409,2014), -('2014-09-15',201438,9,2014,15,38,201409,2014), -('2014-09-16',201438,9,2014,16,38,201409,2014), -('2014-09-17',201438,9,2014,17,38,201409,2014), -('2014-09-18',201438,9,2014,18,38,201409,2014), -('2014-09-19',201438,9,2014,19,38,201409,2014), -('2014-09-20',201438,9,2014,20,38,201409,2014), -('2014-09-21',201439,9,2014,21,39,201409,2014), -('2014-09-22',201439,9,2014,22,39,201409,2014), -('2014-09-23',201439,9,2014,23,39,201409,2014), -('2014-09-24',201439,9,2014,24,39,201409,2014), -('2014-09-25',201439,9,2014,25,39,201409,2014), -('2014-09-26',201439,9,2014,26,39,201409,2014), -('2014-09-27',201439,9,2014,27,39,201409,2014), -('2014-09-28',201440,9,2014,28,40,201409,2014), -('2014-09-29',201440,9,2014,29,40,201409,2014), -('2014-09-30',201440,9,2014,30,40,201409,2014), -('2014-10-01',201440,10,2014,1,40,201410,2014), -('2014-10-02',201440,10,2014,2,40,201410,2014), -('2014-10-03',201440,10,2014,3,40,201410,2014), -('2014-10-04',201440,10,2014,4,40,201410,2014), -('2014-10-05',201441,10,2014,5,41,201410,2014), -('2014-10-06',201441,10,2014,6,41,201410,2014), -('2014-10-07',201441,10,2014,7,41,201410,2014), -('2014-10-08',201441,10,2014,8,41,201410,2014), -('2014-10-09',201441,10,2014,9,41,201410,2014), -('2014-10-10',201441,10,2014,10,41,201410,2014), -('2014-10-11',201441,10,2014,11,41,201410,2014), -('2014-10-12',201442,10,2014,12,42,201410,2014), -('2014-10-13',201442,10,2014,13,42,201410,2014), -('2014-10-14',201442,10,2014,14,42,201410,2014), -('2014-10-15',201442,10,2014,15,42,201410,2014), -('2014-10-16',201442,10,2014,16,42,201410,2014), -('2014-10-17',201442,10,2014,17,42,201410,2014), -('2014-10-18',201442,10,2014,18,42,201410,2014), -('2014-10-19',201443,10,2014,19,43,201410,2014), -('2014-10-20',201443,10,2014,20,43,201410,2014), -('2014-10-21',201443,10,2014,21,43,201410,2014), -('2014-10-22',201443,10,2014,22,43,201410,2014), -('2014-10-23',201443,10,2014,23,43,201410,2014), -('2014-10-24',201443,10,2014,24,43,201410,2014), -('2014-10-25',201443,10,2014,25,43,201410,2014), -('2014-10-26',201444,10,2014,26,44,201410,2014), -('2014-10-27',201444,10,2014,27,44,201410,2014), -('2014-10-28',201444,10,2014,28,44,201410,2014), -('2014-10-29',201444,10,2014,29,44,201410,2014), -('2014-10-30',201444,10,2014,30,44,201410,2014), -('2014-10-31',201444,10,2014,31,44,201410,2014), -('2014-11-01',201444,11,2014,1,44,201411,2014), -('2014-11-02',201445,11,2014,2,45,201411,2014), -('2014-11-03',201445,11,2014,3,45,201411,2014), -('2014-11-04',201445,11,2014,4,45,201411,2014), -('2014-11-05',201445,11,2014,5,45,201411,2014), -('2014-11-06',201445,11,2014,6,45,201411,2014), -('2014-11-07',201445,11,2014,7,45,201411,2014), -('2014-11-08',201445,11,2014,8,45,201411,2014), -('2014-11-09',201446,11,2014,9,46,201411,2014), -('2014-11-10',201446,11,2014,10,46,201411,2014), -('2014-11-11',201446,11,2014,11,46,201411,2014), -('2014-11-12',201446,11,2014,12,46,201411,2014), -('2014-11-13',201446,11,2014,13,46,201411,2014), -('2014-11-14',201446,11,2014,14,46,201411,2014), -('2014-11-15',201446,11,2014,15,46,201411,2014), -('2014-11-16',201447,11,2014,16,47,201411,2014), -('2014-11-17',201447,11,2014,17,47,201411,2014), -('2014-11-18',201447,11,2014,18,47,201411,2014), -('2014-11-19',201447,11,2014,19,47,201411,2014), -('2014-11-20',201447,11,2014,20,47,201411,2014), -('2014-11-21',201447,11,2014,21,47,201411,2014), -('2014-11-22',201447,11,2014,22,47,201411,2014), -('2014-11-23',201448,11,2014,23,48,201411,2014), -('2014-11-24',201448,11,2014,24,48,201411,2014), -('2014-11-25',201448,11,2014,25,48,201411,2014), -('2014-11-26',201448,11,2014,26,48,201411,2014), -('2014-11-27',201448,11,2014,27,48,201411,2014), -('2014-11-28',201448,11,2014,28,48,201411,2014), -('2014-11-29',201448,11,2014,29,48,201411,2014), -('2014-11-30',201449,11,2014,30,49,201411,2014), -('2014-12-01',201449,12,2014,1,49,201412,2015), -('2014-12-02',201449,12,2014,2,49,201412,2015), -('2014-12-03',201449,12,2014,3,49,201412,2015), -('2014-12-04',201449,12,2014,4,49,201412,2015), -('2014-12-05',201449,12,2014,5,49,201412,2015), -('2014-12-06',201449,12,2014,6,49,201412,2015), -('2014-12-07',201450,12,2014,7,50,201412,2015), -('2014-12-08',201450,12,2014,8,50,201412,2015), -('2014-12-09',201450,12,2014,9,50,201412,2015), -('2014-12-10',201450,12,2014,10,50,201412,2015), -('2014-12-11',201450,12,2014,11,50,201412,2015), -('2014-12-12',201450,12,2014,12,50,201412,2015), -('2014-12-13',201450,12,2014,13,50,201412,2015), -('2014-12-14',201451,12,2014,14,51,201412,2015), -('2014-12-15',201451,12,2014,15,51,201412,2015), -('2014-12-16',201451,12,2014,16,51,201412,2015), -('2014-12-17',201451,12,2014,17,51,201412,2015), -('2014-12-18',201451,12,2014,18,51,201412,2015), -('2014-12-19',201451,12,2014,19,51,201412,2015), -('2014-12-20',201451,12,2014,20,51,201412,2015), -('2014-12-21',201452,12,2014,21,52,201412,2015), -('2014-12-22',201452,12,2014,22,52,201412,2015), -('2014-12-23',201452,12,2014,23,52,201412,2015), -('2014-12-24',201452,12,2014,24,52,201412,2015), -('2014-12-25',201452,12,2014,25,52,201412,2015), -('2014-12-26',201452,12,2014,26,52,201412,2015), -('2014-12-27',201452,12,2014,27,52,201412,2015), -('2014-12-28',201453,12,2014,28,53,201412,2015), -('2014-12-29',201453,12,2014,29,53,201412,2015), -('2014-12-30',201453,12,2014,30,53,201412,2015), -('2014-12-31',201453,12,2014,31,53,201412,2015), -('2015-01-01',201453,1,2015,1,53,201501,2015), -('2015-01-02',201453,1,2015,2,53,201501,2015), -('2015-01-03',201453,1,2015,3,53,201501,2015), -('2015-01-04',201501,1,2015,4,1,201501,2015), -('2015-01-05',201501,1,2015,5,1,201501,2015), -('2015-01-06',201501,1,2015,6,1,201501,2015), -('2015-01-07',201501,1,2015,7,1,201501,2015), -('2015-01-08',201501,1,2015,8,1,201501,2015), -('2015-01-09',201501,1,2015,9,1,201501,2015), -('2015-01-10',201501,1,2015,10,1,201501,2015), -('2015-01-11',201502,1,2015,11,2,201501,2015), -('2015-01-12',201502,1,2015,12,2,201501,2015), -('2015-01-13',201502,1,2015,13,2,201501,2015), -('2015-01-14',201502,1,2015,14,2,201501,2015), -('2015-01-15',201502,1,2015,15,2,201501,2015), -('2015-01-16',201502,1,2015,16,2,201501,2015), -('2015-01-17',201502,1,2015,17,2,201501,2015), -('2015-01-18',201503,1,2015,18,3,201501,2015), -('2015-01-19',201503,1,2015,19,3,201501,2015), -('2015-01-20',201503,1,2015,20,3,201501,2015), -('2015-01-21',201503,1,2015,21,3,201501,2015), -('2015-01-22',201503,1,2015,22,3,201501,2015), -('2015-01-23',201503,1,2015,23,3,201501,2015), -('2015-01-24',201503,1,2015,24,3,201501,2015), -('2015-01-25',201504,1,2015,25,4,201501,2015), -('2015-01-26',201504,1,2015,26,4,201501,2015), -('2015-01-27',201504,1,2015,27,4,201501,2015), -('2015-01-28',201504,1,2015,28,4,201501,2015), -('2015-01-29',201504,1,2015,29,4,201501,2015), -('2015-01-30',201504,1,2015,30,4,201501,2015), -('2015-01-31',201504,1,2015,31,4,201501,2015), -('2015-02-01',201505,2,2015,1,5,201502,2015), -('2015-02-02',201505,2,2015,2,5,201502,2015), -('2015-02-03',201505,2,2015,3,5,201502,2015), -('2015-02-04',201505,2,2015,4,5,201502,2015), -('2015-02-05',201505,2,2015,5,5,201502,2015), -('2015-02-06',201505,2,2015,6,5,201502,2015), -('2015-02-07',201505,2,2015,7,5,201502,2015), -('2015-02-08',201506,2,2015,8,6,201502,2015), -('2015-02-09',201506,2,2015,9,6,201502,2015), -('2015-02-10',201506,2,2015,10,6,201502,2015), -('2015-02-11',201506,2,2015,11,6,201502,2015), -('2015-02-12',201506,2,2015,12,6,201502,2015), -('2015-02-13',201506,2,2015,13,6,201502,2015), -('2015-02-14',201506,2,2015,14,6,201502,2015), -('2015-02-15',201507,2,2015,15,7,201502,2015), -('2015-02-16',201507,2,2015,16,7,201502,2015), -('2015-02-17',201507,2,2015,17,7,201502,2015), -('2015-02-18',201507,2,2015,18,7,201502,2015), -('2015-02-19',201507,2,2015,19,7,201502,2015), -('2015-02-20',201507,2,2015,20,7,201502,2015), -('2015-02-21',201507,2,2015,21,7,201502,2015), -('2015-02-22',201508,2,2015,22,8,201502,2015), -('2015-02-23',201508,2,2015,23,8,201502,2015), -('2015-02-24',201508,2,2015,24,8,201502,2015), -('2015-02-25',201508,2,2015,25,8,201502,2015), -('2015-02-26',201508,2,2015,26,8,201502,2015), -('2015-02-27',201508,2,2015,27,8,201502,2015), -('2015-02-28',201508,2,2015,28,8,201502,2015), -('2015-03-01',201509,3,2015,1,9,201503,2015), -('2015-03-02',201509,3,2015,2,9,201503,2015), -('2015-03-03',201509,3,2015,3,9,201503,2015), -('2015-03-04',201509,3,2015,4,9,201503,2015), -('2015-03-05',201509,3,2015,5,9,201503,2015), -('2015-03-06',201509,3,2015,6,9,201503,2015), -('2015-03-07',201509,3,2015,7,9,201503,2015), -('2015-03-08',201510,3,2015,8,10,201503,2015), -('2015-03-09',201510,3,2015,9,10,201503,2015), -('2015-03-10',201510,3,2015,10,10,201503,2015), -('2015-03-11',201510,3,2015,11,10,201503,2015), -('2015-03-12',201510,3,2015,12,10,201503,2015), -('2015-03-13',201510,3,2015,13,10,201503,2015), -('2015-03-14',201510,3,2015,14,10,201503,2015), -('2015-03-15',201511,3,2015,15,11,201503,2015), -('2015-03-16',201511,3,2015,16,11,201503,2015), -('2015-03-17',201511,3,2015,17,11,201503,2015), -('2015-03-18',201511,3,2015,18,11,201503,2015), -('2015-03-19',201511,3,2015,19,11,201503,2015), -('2015-03-20',201511,3,2015,20,11,201503,2015), -('2015-03-21',201511,3,2015,21,11,201503,2015), -('2015-03-22',201512,3,2015,22,12,201503,2015), -('2015-03-23',201512,3,2015,23,12,201503,2015), -('2015-03-24',201512,3,2015,24,12,201503,2015), -('2015-03-25',201512,3,2015,25,12,201503,2015), -('2015-03-26',201512,3,2015,26,12,201503,2015), -('2015-03-27',201512,3,2015,27,12,201503,2015), -('2015-03-28',201512,3,2015,28,12,201503,2015), -('2015-03-29',201513,3,2015,29,13,201503,2015), -('2015-03-30',201513,3,2015,30,13,201503,2015), -('2015-03-31',201513,3,2015,31,13,201503,2015), -('2015-04-01',201513,4,2015,1,13,201504,2015), -('2015-04-02',201513,4,2015,2,13,201504,2015), -('2015-04-03',201513,4,2015,3,13,201504,2015), -('2015-04-04',201513,4,2015,4,13,201504,2015), -('2015-04-05',201514,4,2015,5,14,201504,2015), -('2015-04-06',201514,4,2015,6,14,201504,2015), -('2015-04-07',201514,4,2015,7,14,201504,2015), -('2015-04-08',201514,4,2015,8,14,201504,2015), -('2015-04-09',201514,4,2015,9,14,201504,2015), -('2015-04-10',201514,4,2015,10,14,201504,2015), -('2015-04-11',201514,4,2015,11,14,201504,2015), -('2015-04-12',201515,4,2015,12,15,201504,2015), -('2015-04-13',201515,4,2015,13,15,201504,2015), -('2015-04-14',201515,4,2015,14,15,201504,2015), -('2015-04-15',201515,4,2015,15,15,201504,2015), -('2015-04-16',201515,4,2015,16,15,201504,2015), -('2015-04-17',201515,4,2015,17,15,201504,2015), -('2015-04-18',201515,4,2015,18,15,201504,2015), -('2015-04-19',201516,4,2015,19,16,201504,2015), -('2015-04-20',201516,4,2015,20,16,201504,2015), -('2015-04-21',201516,4,2015,21,16,201504,2015), -('2015-04-22',201516,4,2015,22,16,201504,2015), -('2015-04-23',201516,4,2015,23,16,201504,2015), -('2015-04-24',201516,4,2015,24,16,201504,2015), -('2015-04-25',201516,4,2015,25,16,201504,2015), -('2015-04-26',201517,4,2015,26,17,201504,2015), -('2015-04-27',201517,4,2015,27,17,201504,2015), -('2015-04-28',201517,4,2015,28,17,201504,2015), -('2015-04-29',201517,4,2015,29,17,201504,2015), -('2015-04-30',201517,4,2015,30,17,201504,2015), -('2015-05-01',201517,5,2015,1,17,201505,2015), -('2015-05-02',201517,5,2015,2,17,201505,2015), -('2015-05-03',201518,5,2015,3,18,201505,2015), -('2015-05-04',201518,5,2015,4,18,201505,2015), -('2015-05-05',201518,5,2015,5,18,201505,2015), -('2015-05-06',201518,5,2015,6,18,201505,2015), -('2015-05-07',201518,5,2015,7,18,201505,2015), -('2015-05-08',201518,5,2015,8,18,201505,2015), -('2015-05-09',201518,5,2015,9,18,201505,2015), -('2015-05-10',201519,5,2015,10,19,201505,2015), -('2015-05-11',201519,5,2015,11,19,201505,2015), -('2015-05-12',201519,5,2015,12,19,201505,2015), -('2015-05-13',201519,5,2015,13,19,201505,2015), -('2015-05-14',201519,5,2015,14,19,201505,2015), -('2015-05-15',201519,5,2015,15,19,201505,2015), -('2015-05-16',201519,5,2015,16,19,201505,2015), -('2015-05-17',201520,5,2015,17,20,201505,2015), -('2015-05-18',201520,5,2015,18,20,201505,2015), -('2015-05-19',201520,5,2015,19,20,201505,2015), -('2015-05-20',201520,5,2015,20,20,201505,2015), -('2015-05-21',201520,5,2015,21,20,201505,2015), -('2015-05-22',201520,5,2015,22,20,201505,2015), -('2015-05-23',201520,5,2015,23,20,201505,2015), -('2015-05-24',201521,5,2015,24,21,201505,2015), -('2015-05-25',201521,5,2015,25,21,201505,2015), -('2015-05-26',201521,5,2015,26,21,201505,2015), -('2015-05-27',201521,5,2015,27,21,201505,2015), -('2015-05-28',201521,5,2015,28,21,201505,2015), -('2015-05-29',201521,5,2015,29,21,201505,2015), -('2015-05-30',201521,5,2015,30,21,201505,2015), -('2015-05-31',201522,5,2015,31,22,201505,2015), -('2015-06-01',201522,6,2015,1,22,201506,2015), -('2015-06-02',201522,6,2015,2,22,201506,2015), -('2015-06-03',201522,6,2015,3,22,201506,2015), -('2015-06-04',201522,6,2015,4,22,201506,2015), -('2015-06-05',201522,6,2015,5,22,201506,2015), -('2015-06-06',201522,6,2015,6,22,201506,2015), -('2015-06-07',201523,6,2015,7,23,201506,2015), -('2015-06-08',201523,6,2015,8,23,201506,2015), -('2015-06-09',201523,6,2015,9,23,201506,2015), -('2015-06-10',201523,6,2015,10,23,201506,2015), -('2015-06-11',201523,6,2015,11,23,201506,2015), -('2015-06-12',201523,6,2015,12,23,201506,2015), -('2015-06-13',201523,6,2015,13,23,201506,2015), -('2015-06-14',201524,6,2015,14,24,201506,2015), -('2015-06-15',201524,6,2015,15,24,201506,2015), -('2015-06-16',201524,6,2015,16,24,201506,2015), -('2015-06-17',201524,6,2015,17,24,201506,2015), -('2015-06-18',201524,6,2015,18,24,201506,2015), -('2015-06-19',201524,6,2015,19,24,201506,2015), -('2015-06-20',201524,6,2015,20,24,201506,2015), -('2015-06-21',201525,6,2015,21,25,201506,2015), -('2015-06-22',201525,6,2015,22,25,201506,2015), -('2015-06-23',201525,6,2015,23,25,201506,2015), -('2015-06-24',201525,6,2015,24,25,201506,2015), -('2015-06-25',201525,6,2015,25,25,201506,2015), -('2015-06-26',201525,6,2015,26,25,201506,2015), -('2015-06-27',201525,6,2015,27,25,201506,2015), -('2015-06-28',201526,6,2015,28,26,201506,2015), -('2015-06-29',201526,6,2015,29,26,201506,2015), -('2015-06-30',201526,6,2015,30,26,201506,2015), -('2015-07-01',201526,7,2015,1,26,201507,2015), -('2015-07-02',201526,7,2015,2,26,201507,2015), -('2015-07-03',201526,7,2015,3,26,201507,2015), -('2015-07-04',201526,7,2015,4,26,201507,2015), -('2015-07-05',201527,7,2015,5,27,201507,2015), -('2015-07-06',201527,7,2015,6,27,201507,2015), -('2015-07-07',201527,7,2015,7,27,201507,2015), -('2015-07-08',201527,7,2015,8,27,201507,2015), -('2015-07-09',201527,7,2015,9,27,201507,2015), -('2015-07-10',201527,7,2015,10,27,201507,2015), -('2015-07-11',201527,7,2015,11,27,201507,2015), -('2015-07-12',201528,7,2015,12,28,201507,2015), -('2015-07-13',201528,7,2015,13,28,201507,2015), -('2015-07-14',201528,7,2015,14,28,201507,2015), -('2015-07-15',201528,7,2015,15,28,201507,2015), -('2015-07-16',201528,7,2015,16,28,201507,2015), -('2015-07-17',201528,7,2015,17,28,201507,2015), -('2015-07-18',201528,7,2015,18,28,201507,2015), -('2015-07-19',201529,7,2015,19,29,201507,2015), -('2015-07-20',201529,7,2015,20,29,201507,2015), -('2015-07-21',201529,7,2015,21,29,201507,2015), -('2015-07-22',201529,7,2015,22,29,201507,2015), -('2015-07-23',201529,7,2015,23,29,201507,2015), -('2015-07-24',201529,7,2015,24,29,201507,2015), -('2015-07-25',201529,7,2015,25,29,201507,2015), -('2015-07-26',201530,7,2015,26,30,201507,2015), -('2015-07-27',201530,7,2015,27,30,201507,2015), -('2015-07-28',201530,7,2015,28,30,201507,2015), -('2015-07-29',201530,7,2015,29,30,201507,2015), -('2015-07-30',201530,7,2015,30,30,201507,2015), -('2015-07-31',201530,7,2015,31,30,201507,2015), -('2015-08-01',201530,8,2015,1,30,201508,2015), -('2015-08-02',201531,8,2015,2,31,201508,2015), -('2015-08-03',201531,8,2015,3,31,201508,2015), -('2015-08-04',201531,8,2015,4,31,201508,2015), -('2015-08-05',201531,8,2015,5,31,201508,2015), -('2015-08-06',201531,8,2015,6,31,201508,2015), -('2015-08-07',201531,8,2015,7,31,201508,2015), -('2015-08-08',201531,8,2015,8,31,201508,2015), -('2015-08-09',201532,8,2015,9,32,201508,2015), -('2015-08-10',201532,8,2015,10,32,201508,2015), -('2015-08-11',201532,8,2015,11,32,201508,2015), -('2015-08-12',201532,8,2015,12,32,201508,2015), -('2015-08-13',201532,8,2015,13,32,201508,2015), -('2015-08-14',201532,8,2015,14,32,201508,2015), -('2015-08-15',201532,8,2015,15,32,201508,2015), -('2015-08-16',201533,8,2015,16,33,201508,2015), -('2015-08-17',201533,8,2015,17,33,201508,2015), -('2015-08-18',201533,8,2015,18,33,201508,2015), -('2015-08-19',201533,8,2015,19,33,201508,2015), -('2015-08-20',201533,8,2015,20,33,201508,2015), -('2015-08-21',201533,8,2015,21,33,201508,2015), -('2015-08-22',201533,8,2015,22,33,201508,2015), -('2015-08-23',201534,8,2015,23,34,201508,2015), -('2015-08-24',201534,8,2015,24,34,201508,2015), -('2015-08-25',201534,8,2015,25,34,201508,2015), -('2015-08-26',201534,8,2015,26,34,201508,2015), -('2015-08-27',201534,8,2015,27,34,201508,2015), -('2015-08-28',201534,8,2015,28,34,201508,2015), -('2015-08-29',201534,8,2015,29,34,201508,2015), -('2015-08-30',201535,8,2015,30,35,201508,2015), -('2015-08-31',201535,8,2015,31,35,201508,2015), -('2015-09-01',201535,9,2015,1,35,201509,2015), -('2015-09-02',201535,9,2015,2,35,201509,2015), -('2015-09-03',201535,9,2015,3,35,201509,2015), -('2015-09-04',201535,9,2015,4,35,201509,2015), -('2015-09-05',201535,9,2015,5,35,201509,2015), -('2015-09-06',201536,9,2015,6,36,201509,2015), -('2015-09-07',201536,9,2015,7,36,201509,2015), -('2015-09-08',201536,9,2015,8,36,201509,2015), -('2015-09-09',201536,9,2015,9,36,201509,2015), -('2015-09-10',201536,9,2015,10,36,201509,2015), -('2015-09-11',201536,9,2015,11,36,201509,2015), -('2015-09-12',201536,9,2015,12,36,201509,2015), -('2015-09-13',201537,9,2015,13,37,201509,2015), -('2015-09-14',201537,9,2015,14,37,201509,2015), -('2015-09-15',201537,9,2015,15,37,201509,2015), -('2015-09-16',201537,9,2015,16,37,201509,2015), -('2015-09-17',201537,9,2015,17,37,201509,2015), -('2015-09-18',201537,9,2015,18,37,201509,2015), -('2015-09-19',201537,9,2015,19,37,201509,2015), -('2015-09-20',201538,9,2015,20,38,201509,2015), -('2015-09-21',201538,9,2015,21,38,201509,2015), -('2015-09-22',201538,9,2015,22,38,201509,2015), -('2015-09-23',201538,9,2015,23,38,201509,2015), -('2015-09-24',201538,9,2015,24,38,201509,2015), -('2015-09-25',201538,9,2015,25,38,201509,2015), -('2015-09-26',201538,9,2015,26,38,201509,2015), -('2015-09-27',201539,9,2015,27,39,201509,2015), -('2015-09-28',201539,9,2015,28,39,201509,2015), -('2015-09-29',201539,9,2015,29,39,201509,2015), -('2015-09-30',201539,9,2015,30,39,201509,2015), -('2015-10-01',201539,10,2015,1,39,201510,2015), -('2015-10-02',201539,10,2015,2,39,201510,2015), -('2015-10-03',201539,10,2015,3,39,201510,2015), -('2015-10-04',201540,10,2015,4,40,201510,2015), -('2015-10-05',201540,10,2015,5,40,201510,2015), -('2015-10-06',201540,10,2015,6,40,201510,2015), -('2015-10-07',201540,10,2015,7,40,201510,2015), -('2015-10-08',201540,10,2015,8,40,201510,2015), -('2015-10-09',201540,10,2015,9,40,201510,2015), -('2015-10-10',201540,10,2015,10,40,201510,2015), -('2015-10-11',201541,10,2015,11,41,201510,2015), -('2015-10-12',201541,10,2015,12,41,201510,2015), -('2015-10-13',201541,10,2015,13,41,201510,2015), -('2015-10-14',201541,10,2015,14,41,201510,2015), -('2015-10-15',201541,10,2015,15,41,201510,2015), -('2015-10-16',201541,10,2015,16,41,201510,2015), -('2015-10-17',201541,10,2015,17,41,201510,2015), -('2015-10-18',201542,10,2015,18,42,201510,2015), -('2015-10-19',201542,10,2015,19,42,201510,2015), -('2015-10-20',201542,10,2015,20,42,201510,2015), -('2015-10-21',201542,10,2015,21,42,201510,2015), -('2015-10-22',201542,10,2015,22,42,201510,2015), -('2015-10-23',201542,10,2015,23,42,201510,2015), -('2015-10-24',201542,10,2015,24,42,201510,2015), -('2015-10-25',201543,10,2015,25,43,201510,2015), -('2015-10-26',201543,10,2015,26,43,201510,2015), -('2015-10-27',201543,10,2015,27,43,201510,2015), -('2015-10-28',201543,10,2015,28,43,201510,2015), -('2015-10-29',201543,10,2015,29,43,201510,2015), -('2015-10-30',201543,10,2015,30,43,201510,2015), -('2015-10-31',201543,10,2015,31,43,201510,2015), -('2015-11-01',201544,11,2015,1,44,201511,2015), -('2015-11-02',201544,11,2015,2,44,201511,2015), -('2015-11-03',201544,11,2015,3,44,201511,2015), -('2015-11-04',201544,11,2015,4,44,201511,2015), -('2015-11-05',201544,11,2015,5,44,201511,2015), -('2015-11-06',201544,11,2015,6,44,201511,2015), -('2015-11-07',201544,11,2015,7,44,201511,2015), -('2015-11-08',201545,11,2015,8,45,201511,2015), -('2015-11-09',201545,11,2015,9,45,201511,2015), -('2015-11-10',201545,11,2015,10,45,201511,2015), -('2015-11-11',201545,11,2015,11,45,201511,2015), -('2015-11-12',201545,11,2015,12,45,201511,2015), -('2015-11-13',201545,11,2015,13,45,201511,2015), -('2015-11-14',201545,11,2015,14,45,201511,2015), -('2015-11-15',201546,11,2015,15,46,201511,2015), -('2015-11-16',201546,11,2015,16,46,201511,2015), -('2015-11-17',201546,11,2015,17,46,201511,2015), -('2015-11-18',201546,11,2015,18,46,201511,2015), -('2015-11-19',201546,11,2015,19,46,201511,2015), -('2015-11-20',201546,11,2015,20,46,201511,2015), -('2015-11-21',201546,11,2015,21,46,201511,2015), -('2015-11-22',201547,11,2015,22,47,201511,2015), -('2015-11-23',201547,11,2015,23,47,201511,2015), -('2015-11-24',201547,11,2015,24,47,201511,2015), -('2015-11-25',201547,11,2015,25,47,201511,2015), -('2015-11-26',201547,11,2015,26,47,201511,2015), -('2015-11-27',201547,11,2015,27,47,201511,2015), -('2015-11-28',201547,11,2015,28,47,201511,2015), -('2015-11-29',201548,11,2015,29,48,201511,2015), -('2015-11-30',201548,11,2015,30,48,201511,2015), -('2015-12-01',201548,12,2015,1,48,201512,2016), -('2015-12-02',201548,12,2015,2,48,201512,2016), -('2015-12-03',201548,12,2015,3,48,201512,2016), -('2015-12-04',201548,12,2015,4,48,201512,2016), -('2015-12-05',201548,12,2015,5,48,201512,2016), -('2015-12-06',201549,12,2015,6,49,201512,2016), -('2015-12-07',201549,12,2015,7,49,201512,2016), -('2015-12-08',201549,12,2015,8,49,201512,2016), -('2015-12-09',201549,12,2015,9,49,201512,2016), -('2015-12-10',201549,12,2015,10,49,201512,2016), -('2015-12-11',201549,12,2015,11,49,201512,2016), -('2015-12-12',201549,12,2015,12,49,201512,2016), -('2015-12-13',201550,12,2015,13,50,201512,2016), -('2015-12-14',201550,12,2015,14,50,201512,2016), -('2015-12-15',201550,12,2015,15,50,201512,2016), -('2015-12-16',201550,12,2015,16,50,201512,2016), -('2015-12-17',201550,12,2015,17,50,201512,2016), -('2015-12-18',201550,12,2015,18,50,201512,2016), -('2015-12-19',201550,12,2015,19,50,201512,2016), -('2015-12-20',201551,12,2015,20,51,201512,2016), -('2015-12-21',201551,12,2015,21,51,201512,2016), -('2015-12-22',201551,12,2015,22,51,201512,2016), -('2015-12-23',201551,12,2015,23,51,201512,2016), -('2015-12-24',201551,12,2015,24,51,201512,2016), -('2015-12-25',201551,12,2015,25,51,201512,2016), -('2015-12-26',201551,12,2015,26,51,201512,2016), -('2015-12-27',201552,12,2015,27,52,201512,2016), -('2015-12-28',201552,12,2015,28,52,201512,2016), -('2015-12-29',201552,12,2015,29,52,201512,2016), -('2015-12-30',201552,12,2015,30,52,201512,2016), -('2015-12-31',201552,12,2015,31,52,201512,2016), -('2016-01-01',201552,1,2016,1,1,201601,2016), -('2016-01-02',201552,1,2016,2,1,201601,2016), -('2016-01-03',201601,1,2016,3,1,201601,2016), -('2016-01-04',201601,1,2016,4,1,201601,2016), -('2016-01-05',201601,1,2016,5,1,201601,2016), -('2016-01-06',201601,1,2016,6,1,201601,2016), -('2016-01-07',201601,1,2016,7,1,201601,2016), -('2016-01-08',201601,1,2016,8,1,201601,2016), -('2016-01-09',201601,1,2016,9,1,201601,2016), -('2016-01-10',201602,1,2016,10,2,201601,2016), -('2016-01-11',201602,1,2016,11,2,201601,2016), -('2016-01-12',201602,1,2016,12,2,201601,2016), -('2016-01-13',201602,1,2016,13,2,201601,2016), -('2016-01-14',201602,1,2016,14,2,201601,2016), -('2016-01-15',201602,1,2016,15,2,201601,2016), -('2016-01-16',201602,1,2016,16,2,201601,2016), -('2016-01-17',201603,1,2016,17,3,201601,2016), -('2016-01-18',201603,1,2016,18,3,201601,2016), -('2016-01-19',201603,1,2016,19,3,201601,2016), -('2016-01-20',201603,1,2016,20,3,201601,2016), -('2016-01-21',201603,1,2016,21,3,201601,2016), -('2016-01-22',201603,1,2016,22,3,201601,2016), -('2016-01-23',201603,1,2016,23,3,201601,2016), -('2016-01-24',201604,1,2016,24,4,201601,2016), -('2016-01-25',201604,1,2016,25,4,201601,2016), -('2016-01-26',201604,1,2016,26,4,201601,2016), -('2016-01-27',201604,1,2016,27,4,201601,2016), -('2016-01-28',201604,1,2016,28,4,201601,2016), -('2016-01-29',201604,1,2016,29,4,201601,2016), -('2016-01-30',201604,1,2016,30,4,201601,2016), -('2016-01-31',201605,1,2016,31,5,201601,2016), -('2016-02-01',201605,2,2016,1,5,201602,2016), -('2016-02-02',201605,2,2016,2,5,201602,2016), -('2016-02-03',201605,2,2016,3,5,201602,2016), -('2016-02-04',201605,2,2016,4,5,201602,2016), -('2016-02-05',201605,2,2016,5,5,201602,2016), -('2016-02-06',201605,2,2016,6,5,201602,2016), -('2016-02-07',201606,2,2016,7,6,201602,2016), -('2016-02-08',201606,2,2016,8,6,201602,2016), -('2016-02-09',201606,2,2016,9,6,201602,2016), -('2016-02-10',201606,2,2016,10,6,201602,2016), -('2016-02-11',201606,2,2016,11,6,201602,2016), -('2016-02-12',201606,2,2016,12,6,201602,2016), -('2016-02-13',201606,2,2016,13,6,201602,2016), -('2016-02-14',201607,2,2016,14,7,201602,2016), -('2016-02-15',201607,2,2016,15,7,201602,2016), -('2016-02-16',201607,2,2016,16,7,201602,2016), -('2016-02-17',201607,2,2016,17,7,201602,2016), -('2016-02-18',201607,2,2016,18,7,201602,2016), -('2016-02-19',201607,2,2016,19,7,201602,2016), -('2016-02-20',201607,2,2016,20,7,201602,2016), -('2016-02-21',201608,2,2016,21,8,201602,2016), -('2016-02-22',201608,2,2016,22,8,201602,2016), -('2016-02-23',201608,2,2016,23,8,201602,2016), -('2016-02-24',201608,2,2016,24,8,201602,2016), -('2016-02-25',201608,2,2016,25,8,201602,2016), -('2016-02-26',201608,2,2016,26,8,201602,2016), -('2016-02-27',201608,2,2016,27,8,201602,2016), -('2016-02-28',201609,2,2016,28,9,201602,2016), -('2016-02-29',201609,2,2016,29,9,201602,2016), -('2016-03-01',201609,3,2016,1,9,201603,2016), -('2016-03-02',201609,3,2016,2,9,201603,2016), -('2016-03-03',201609,3,2016,3,9,201603,2016), -('2016-03-04',201609,3,2016,4,9,201603,2016), -('2016-03-05',201609,3,2016,5,9,201603,2016), -('2016-03-06',201610,3,2016,6,10,201603,2016), -('2016-03-07',201610,3,2016,7,10,201603,2016), -('2016-03-08',201610,3,2016,8,10,201603,2016), -('2016-03-09',201610,3,2016,9,10,201603,2016), -('2016-03-10',201610,3,2016,10,10,201603,2016), -('2016-03-11',201610,3,2016,11,10,201603,2016), -('2016-03-12',201610,3,2016,12,10,201603,2016), -('2016-03-13',201611,3,2016,13,11,201603,2016), -('2016-03-14',201611,3,2016,14,11,201603,2016), -('2016-03-15',201611,3,2016,15,11,201603,2016), -('2016-03-16',201611,3,2016,16,11,201603,2016), -('2016-03-17',201611,3,2016,17,11,201603,2016), -('2016-03-18',201611,3,2016,18,11,201603,2016), -('2016-03-19',201611,3,2016,19,11,201603,2016), -('2016-03-20',201612,3,2016,20,12,201603,2016), -('2016-03-21',201612,3,2016,21,12,201603,2016), -('2016-03-22',201612,3,2016,22,12,201603,2016), -('2016-03-23',201612,3,2016,23,12,201603,2016), -('2016-03-24',201612,3,2016,24,12,201603,2016), -('2016-03-25',201612,3,2016,25,12,201603,2016), -('2016-03-26',201612,3,2016,26,12,201603,2016), -('2016-03-27',201613,3,2016,27,13,201603,2016), -('2016-03-28',201613,3,2016,28,13,201603,2016), -('2016-03-29',201613,3,2016,29,13,201603,2016), -('2016-03-30',201613,3,2016,30,13,201603,2016), -('2016-03-31',201613,3,2016,31,13,201603,2016), -('2016-04-01',201613,4,2016,1,13,201604,2016), -('2016-04-02',201613,4,2016,2,13,201604,2016), -('2016-04-03',201614,4,2016,3,14,201604,2016), -('2016-04-04',201614,4,2016,4,14,201604,2016), -('2016-04-05',201614,4,2016,5,14,201604,2016), -('2016-04-06',201614,4,2016,6,14,201604,2016), -('2016-04-07',201614,4,2016,7,14,201604,2016), -('2016-04-08',201614,4,2016,8,14,201604,2016), -('2016-04-09',201614,4,2016,9,14,201604,2016), -('2016-04-10',201615,4,2016,10,15,201604,2016), -('2016-04-11',201615,4,2016,11,15,201604,2016), -('2016-04-12',201615,4,2016,12,15,201604,2016), -('2016-04-13',201615,4,2016,13,15,201604,2016), -('2016-04-14',201615,4,2016,14,15,201604,2016), -('2016-04-15',201615,4,2016,15,15,201604,2016), -('2016-04-16',201615,4,2016,16,15,201604,2016), -('2016-04-17',201616,4,2016,17,16,201604,2016), -('2016-04-18',201616,4,2016,18,16,201604,2016), -('2016-04-19',201616,4,2016,19,16,201604,2016), -('2016-04-20',201616,4,2016,20,16,201604,2016), -('2016-04-21',201616,4,2016,21,16,201604,2016), -('2016-04-22',201616,4,2016,22,16,201604,2016), -('2016-04-23',201616,4,2016,23,16,201604,2016), -('2016-04-24',201617,4,2016,24,17,201604,2016), -('2016-04-25',201617,4,2016,25,17,201604,2016), -('2016-04-26',201617,4,2016,26,17,201604,2016), -('2016-04-27',201617,4,2016,27,17,201604,2016), -('2016-04-28',201617,4,2016,28,17,201604,2016), -('2016-04-29',201617,4,2016,29,17,201604,2016), -('2016-04-30',201617,4,2016,30,17,201604,2016), -('2016-05-01',201618,5,2016,1,18,201605,2016), -('2016-05-02',201618,5,2016,2,18,201605,2016), -('2016-05-03',201618,5,2016,3,18,201605,2016), -('2016-05-04',201618,5,2016,4,18,201605,2016), -('2016-05-05',201618,5,2016,5,18,201605,2016), -('2016-05-06',201618,5,2016,6,18,201605,2016), -('2016-05-07',201618,5,2016,7,18,201605,2016), -('2016-05-08',201619,5,2016,8,19,201605,2016), -('2016-05-09',201619,5,2016,9,19,201605,2016), -('2016-05-10',201619,5,2016,10,19,201605,2016), -('2016-05-11',201619,5,2016,11,19,201605,2016), -('2016-05-12',201619,5,2016,12,19,201605,2016), -('2016-05-13',201619,5,2016,13,19,201605,2016), -('2016-05-14',201619,5,2016,14,19,201605,2016), -('2016-05-15',201620,5,2016,15,20,201605,2016), -('2016-05-16',201620,5,2016,16,20,201605,2016), -('2016-05-17',201620,5,2016,17,20,201605,2016), -('2016-05-18',201620,5,2016,18,20,201605,2016), -('2016-05-19',201620,5,2016,19,20,201605,2016), -('2016-05-20',201620,5,2016,20,20,201605,2016), -('2016-05-21',201620,5,2016,21,20,201605,2016), -('2016-05-22',201621,5,2016,22,21,201605,2016), -('2016-05-23',201621,5,2016,23,21,201605,2016), -('2016-05-24',201621,5,2016,24,21,201605,2016), -('2016-05-25',201621,5,2016,25,21,201605,2016), -('2016-05-26',201621,5,2016,26,21,201605,2016), -('2016-05-27',201621,5,2016,27,21,201605,2016), -('2016-05-28',201621,5,2016,28,21,201605,2016), -('2016-05-29',201622,5,2016,29,22,201605,2016), -('2016-05-30',201622,5,2016,30,22,201605,2016), -('2016-05-31',201622,5,2016,31,22,201605,2016), -('2016-06-01',201622,6,2016,1,22,201606,2016), -('2016-06-02',201622,6,2016,2,22,201606,2016), -('2016-06-03',201622,6,2016,3,22,201606,2016), -('2016-06-04',201622,6,2016,4,22,201606,2016), -('2016-06-05',201623,6,2016,5,23,201606,2016), -('2016-06-06',201623,6,2016,6,23,201606,2016), -('2016-06-07',201623,6,2016,7,23,201606,2016), -('2016-06-08',201623,6,2016,8,23,201606,2016), -('2016-06-09',201623,6,2016,9,23,201606,2016), -('2016-06-10',201623,6,2016,10,23,201606,2016), -('2016-06-11',201623,6,2016,11,23,201606,2016), -('2016-06-12',201624,6,2016,12,24,201606,2016), -('2016-06-13',201624,6,2016,13,24,201606,2016), -('2016-06-14',201624,6,2016,14,24,201606,2016), -('2016-06-15',201624,6,2016,15,24,201606,2016), -('2016-06-16',201624,6,2016,16,24,201606,2016), -('2016-06-17',201624,6,2016,17,24,201606,2016), -('2016-06-18',201624,6,2016,18,24,201606,2016), -('2016-06-19',201625,6,2016,19,25,201606,2016), -('2016-06-20',201625,6,2016,20,25,201606,2016), -('2016-06-21',201625,6,2016,21,25,201606,2016), -('2016-06-22',201625,6,2016,22,25,201606,2016), -('2016-06-23',201625,6,2016,23,25,201606,2016), -('2016-06-24',201625,6,2016,24,25,201606,2016), -('2016-06-25',201625,6,2016,25,25,201606,2016), -('2016-06-26',201626,6,2016,26,26,201606,2016), -('2016-06-27',201626,6,2016,27,26,201606,2016), -('2016-06-28',201626,6,2016,28,26,201606,2016), -('2016-06-29',201626,6,2016,29,26,201606,2016), -('2016-06-30',201626,6,2016,30,26,201606,2016), -('2016-07-01',201626,7,2016,1,26,201607,2016), -('2016-07-02',201626,7,2016,2,26,201607,2016), -('2016-07-03',201627,7,2016,3,27,201607,2016), -('2016-07-04',201627,7,2016,4,27,201607,2016), -('2016-07-05',201627,7,2016,5,27,201607,2016), -('2016-07-06',201627,7,2016,6,27,201607,2016), -('2016-07-07',201627,7,2016,7,27,201607,2016), -('2016-07-08',201627,7,2016,8,27,201607,2016), -('2016-07-09',201627,7,2016,9,27,201607,2016), -('2016-07-10',201628,7,2016,10,28,201607,2016), -('2016-07-11',201628,7,2016,11,28,201607,2016), -('2016-07-12',201628,7,2016,12,28,201607,2016), -('2016-07-13',201628,7,2016,13,28,201607,2016), -('2016-07-14',201628,7,2016,14,28,201607,2016), -('2016-07-15',201628,7,2016,15,28,201607,2016), -('2016-07-16',201628,7,2016,16,28,201607,2016), -('2016-07-17',201629,7,2016,17,29,201607,2016), -('2016-07-18',201629,7,2016,18,29,201607,2016), -('2016-07-19',201629,7,2016,19,29,201607,2016), -('2016-07-20',201629,7,2016,20,29,201607,2016), -('2016-07-21',201629,7,2016,21,29,201607,2016), -('2016-07-22',201629,7,2016,22,29,201607,2016), -('2016-07-23',201629,7,2016,23,29,201607,2016), -('2016-07-24',201630,7,2016,24,30,201607,2016), -('2016-07-25',201630,7,2016,25,30,201607,2016), -('2016-07-26',201630,7,2016,26,30,201607,2016), -('2016-07-27',201630,7,2016,27,30,201607,2016), -('2016-07-28',201630,7,2016,28,30,201607,2016), -('2016-07-29',201630,7,2016,29,30,201607,2016), -('2016-07-30',201630,7,2016,30,30,201607,2016), -('2016-07-31',201631,7,2016,31,31,201607,2016), -('2016-08-01',201631,8,2016,1,31,201608,2016), -('2016-08-02',201631,8,2016,2,31,201608,2016), -('2016-08-03',201631,8,2016,3,31,201608,2016), -('2016-08-04',201631,8,2016,4,31,201608,2016), -('2016-08-05',201631,8,2016,5,31,201608,2016), -('2016-08-06',201631,8,2016,6,31,201608,2016), -('2016-08-07',201632,8,2016,7,32,201608,2016), -('2016-08-08',201632,8,2016,8,32,201608,2016), -('2016-08-09',201632,8,2016,9,32,201608,2016), -('2016-08-10',201632,8,2016,10,32,201608,2016), -('2016-08-11',201632,8,2016,11,32,201608,2016), -('2016-08-12',201632,8,2016,12,32,201608,2016), -('2016-08-13',201632,8,2016,13,32,201608,2016), -('2016-08-14',201633,8,2016,14,33,201608,2016), -('2016-08-15',201633,8,2016,15,33,201608,2016), -('2016-08-16',201633,8,2016,16,33,201608,2016), -('2016-08-17',201633,8,2016,17,33,201608,2016), -('2016-08-18',201633,8,2016,18,33,201608,2016), -('2016-08-19',201633,8,2016,19,33,201608,2016), -('2016-08-20',201633,8,2016,20,33,201608,2016), -('2016-08-21',201634,8,2016,21,34,201608,2016), -('2016-08-22',201634,8,2016,22,34,201608,2016), -('2016-08-23',201634,8,2016,23,34,201608,2016), -('2016-08-24',201634,8,2016,24,34,201608,2016), -('2016-08-25',201634,8,2016,25,34,201608,2016), -('2016-08-26',201634,8,2016,26,34,201608,2016), -('2016-08-27',201634,8,2016,27,34,201608,2016), -('2016-08-28',201635,8,2016,28,35,201608,2016), -('2016-08-29',201635,8,2016,29,35,201608,2016), -('2016-08-30',201635,8,2016,30,35,201608,2016), -('2016-08-31',201635,8,2016,31,35,201608,2016), -('2016-09-01',201635,9,2016,1,35,201609,2016), -('2016-09-02',201635,9,2016,2,35,201609,2016), -('2016-09-03',201635,9,2016,3,35,201609,2016), -('2016-09-04',201636,9,2016,4,36,201609,2016), -('2016-09-05',201636,9,2016,5,36,201609,2016), -('2016-09-06',201636,9,2016,6,36,201609,2016), -('2016-09-07',201636,9,2016,7,36,201609,2016), -('2016-09-08',201636,9,2016,8,36,201609,2016), -('2016-09-09',201636,9,2016,9,36,201609,2016), -('2016-09-10',201636,9,2016,10,36,201609,2016), -('2016-09-11',201637,9,2016,11,37,201609,2016), -('2016-09-12',201637,9,2016,12,37,201609,2016), -('2016-09-13',201637,9,2016,13,37,201609,2016), -('2016-09-14',201637,9,2016,14,37,201609,2016), -('2016-09-15',201637,9,2016,15,37,201609,2016), -('2016-09-16',201637,9,2016,16,37,201609,2016), -('2016-09-17',201637,9,2016,17,37,201609,2016), -('2016-09-18',201638,9,2016,18,38,201609,2016), -('2016-09-19',201638,9,2016,19,38,201609,2016), -('2016-09-20',201638,9,2016,20,38,201609,2016), -('2016-09-21',201638,9,2016,21,38,201609,2016), -('2016-09-22',201638,9,2016,22,38,201609,2016), -('2016-09-23',201638,9,2016,23,38,201609,2016), -('2016-09-24',201638,9,2016,24,38,201609,2016), -('2016-09-25',201639,9,2016,25,39,201609,2016), -('2016-09-26',201639,9,2016,26,39,201609,2016), -('2016-09-27',201639,9,2016,27,39,201609,2016), -('2016-09-28',201639,9,2016,28,39,201609,2016), -('2016-09-29',201639,9,2016,29,39,201609,2016), -('2016-09-30',201639,9,2016,30,39,201609,2016), -('2016-10-01',201639,10,2016,1,39,201610,2016), -('2016-10-02',201640,10,2016,2,40,201610,2016), -('2016-10-03',201640,10,2016,3,40,201610,2016), -('2016-10-04',201640,10,2016,4,40,201610,2016), -('2016-10-05',201640,10,2016,5,40,201610,2016), -('2016-10-06',201640,10,2016,6,40,201610,2016), -('2016-10-07',201640,10,2016,7,40,201610,2016), -('2016-10-08',201640,10,2016,8,40,201610,2016), -('2016-10-09',201641,10,2016,9,41,201610,2016), -('2016-10-10',201641,10,2016,10,41,201610,2016), -('2016-10-11',201641,10,2016,11,41,201610,2016), -('2016-10-12',201641,10,2016,12,41,201610,2016), -('2016-10-13',201641,10,2016,13,41,201610,2016), -('2016-10-14',201641,10,2016,14,41,201610,2016), -('2016-10-15',201641,10,2016,15,41,201610,2016), -('2016-10-16',201642,10,2016,16,42,201610,2016), -('2016-10-17',201642,10,2016,17,42,201610,2016), -('2016-10-18',201642,10,2016,18,42,201610,2016), -('2016-10-19',201642,10,2016,19,42,201610,2016), -('2016-10-20',201642,10,2016,20,42,201610,2016), -('2016-10-21',201642,10,2016,21,42,201610,2016), -('2016-10-22',201642,10,2016,22,42,201610,2016), -('2016-10-23',201643,10,2016,23,43,201610,2016), -('2016-10-24',201643,10,2016,24,43,201610,2016), -('2016-10-25',201643,10,2016,25,43,201610,2016), -('2016-10-26',201643,10,2016,26,43,201610,2016), -('2016-10-27',201643,10,2016,27,43,201610,2016), -('2016-10-28',201643,10,2016,28,43,201610,2016), -('2016-10-29',201643,10,2016,29,43,201610,2016), -('2016-10-30',201644,10,2016,30,44,201610,2016), -('2016-10-31',201644,10,2016,31,44,201610,2016), -('2016-11-01',201644,11,2016,1,44,201611,2016), -('2016-11-02',201644,11,2016,2,44,201611,2016), -('2016-11-03',201644,11,2016,3,44,201611,2016), -('2016-11-04',201644,11,2016,4,44,201611,2016), -('2016-11-05',201644,11,2016,5,44,201611,2016), -('2016-11-06',201645,11,2016,6,45,201611,2016), -('2016-11-07',201645,11,2016,7,45,201611,2016), -('2016-11-08',201645,11,2016,8,45,201611,2016), -('2016-11-09',201645,11,2016,9,45,201611,2016), -('2016-11-10',201645,11,2016,10,45,201611,2016), -('2016-11-11',201645,11,2016,11,45,201611,2016), -('2016-11-12',201645,11,2016,12,45,201611,2016), -('2016-11-13',201646,11,2016,13,46,201611,2016), -('2016-11-14',201646,11,2016,14,46,201611,2016), -('2016-11-15',201646,11,2016,15,46,201611,2016), -('2016-11-16',201646,11,2016,16,46,201611,2016), -('2016-11-17',201646,11,2016,17,46,201611,2016), -('2016-11-18',201646,11,2016,18,46,201611,2016), -('2016-11-19',201646,11,2016,19,46,201611,2016), -('2016-11-20',201647,11,2016,20,47,201611,2016), -('2016-11-21',201647,11,2016,21,47,201611,2016), -('2016-11-22',201647,11,2016,22,47,201611,2016), -('2016-11-23',201647,11,2016,23,47,201611,2016), -('2016-11-24',201647,11,2016,24,47,201611,2016), -('2016-11-25',201647,11,2016,25,47,201611,2016), -('2016-11-26',201647,11,2016,26,47,201611,2016), -('2016-11-27',201648,11,2016,27,48,201611,2016), -('2016-11-28',201648,11,2016,28,48,201611,2016), -('2016-11-29',201648,11,2016,29,48,201611,2016), -('2016-11-30',201648,11,2016,30,48,201611,2016), -('2016-12-01',201648,12,2016,1,48,201612,2017), -('2016-12-02',201648,12,2016,2,48,201612,2017), -('2016-12-03',201648,12,2016,3,48,201612,2017), -('2016-12-04',201649,12,2016,4,49,201612,2017), -('2016-12-05',201649,12,2016,5,49,201612,2017), -('2016-12-06',201649,12,2016,6,49,201612,2017), -('2016-12-07',201649,12,2016,7,49,201612,2017), -('2016-12-08',201649,12,2016,8,49,201612,2017), -('2016-12-09',201649,12,2016,9,49,201612,2017), -('2016-12-10',201649,12,2016,10,49,201612,2017), -('2016-12-11',201650,12,2016,11,50,201612,2017), -('2016-12-12',201650,12,2016,12,50,201612,2017), -('2016-12-13',201650,12,2016,13,50,201612,2017), -('2016-12-14',201650,12,2016,14,50,201612,2017), -('2016-12-15',201650,12,2016,15,50,201612,2017), -('2016-12-16',201650,12,2016,16,50,201612,2017), -('2016-12-17',201650,12,2016,17,50,201612,2017), -('2016-12-18',201651,12,2016,18,51,201612,2017), -('2016-12-19',201651,12,2016,19,51,201612,2017), -('2016-12-20',201651,12,2016,20,51,201612,2017), -('2016-12-21',201651,12,2016,21,51,201612,2017), -('2016-12-22',201651,12,2016,22,51,201612,2017), -('2016-12-23',201651,12,2016,23,51,201612,2017), -('2016-12-24',201651,12,2016,24,51,201612,2017), -('2016-12-25',201652,12,2016,25,52,201612,2017), -('2016-12-26',201652,12,2016,26,52,201612,2017), -('2016-12-27',201652,12,2016,27,52,201612,2017), -('2016-12-28',201652,12,2016,28,52,201612,2017), -('2016-12-29',201652,12,2016,29,52,201612,2017), -('2016-12-30',201652,12,2016,30,52,201612,2017), -('2016-12-31',201652,12,2016,31,52,201612,2017), -('2017-01-01',201701,1,2017,1,1,201701,2017), -('2017-01-02',201701,1,2017,2,1,201701,2017), -('2017-01-03',201701,1,2017,3,1,201701,2017), -('2017-01-04',201701,1,2017,4,1,201701,2017), -('2017-01-05',201701,1,2017,5,1,201701,2017), -('2017-01-06',201701,1,2017,6,1,201701,2017), -('2017-01-07',201701,1,2017,7,1,201701,2017), -('2017-01-08',201702,1,2017,8,2,201701,2017), -('2017-01-09',201702,1,2017,9,2,201701,2017), -('2017-01-10',201702,1,2017,10,2,201701,2017), -('2017-01-11',201702,1,2017,11,2,201701,2017), -('2017-01-12',201702,1,2017,12,2,201701,2017), -('2017-01-13',201702,1,2017,13,2,201701,2017), -('2017-01-14',201702,1,2017,14,2,201701,2017), -('2017-01-15',201703,1,2017,15,3,201701,2017), -('2017-01-16',201703,1,2017,16,3,201701,2017), -('2017-01-17',201703,1,2017,17,3,201701,2017), -('2017-01-18',201703,1,2017,18,3,201701,2017), -('2017-01-19',201703,1,2017,19,3,201701,2017), -('2017-01-20',201703,1,2017,20,3,201701,2017), -('2017-01-21',201703,1,2017,21,3,201701,2017), -('2017-01-22',201704,1,2017,22,4,201701,2017), -('2017-01-23',201704,1,2017,23,4,201701,2017), -('2017-01-24',201704,1,2017,24,4,201701,2017), -('2017-01-25',201704,1,2017,25,4,201701,2017), -('2017-01-26',201704,1,2017,26,4,201701,2017), -('2017-01-27',201704,1,2017,27,4,201701,2017), -('2017-01-28',201704,1,2017,28,4,201701,2017), -('2017-01-29',201705,1,2017,29,5,201701,2017), -('2017-01-30',201705,1,2017,30,5,201701,2017), -('2017-01-31',201705,1,2017,31,5,201701,2017), -('2017-02-01',201705,2,2017,1,5,201702,2017), -('2017-02-02',201705,2,2017,2,5,201702,2017), -('2017-02-03',201705,2,2017,3,5,201702,2017), -('2017-02-04',201705,2,2017,4,5,201702,2017), -('2017-02-05',201706,2,2017,5,6,201702,2017), -('2017-02-06',201706,2,2017,6,6,201702,2017), -('2017-02-07',201706,2,2017,7,6,201702,2017), -('2017-02-08',201706,2,2017,8,6,201702,2017), -('2017-02-09',201706,2,2017,9,6,201702,2017), -('2017-02-10',201706,2,2017,10,6,201702,2017), -('2017-02-11',201706,2,2017,11,6,201702,2017), -('2017-02-12',201707,2,2017,12,7,201702,2017), -('2017-02-13',201707,2,2017,13,7,201702,2017), -('2017-02-14',201707,2,2017,14,7,201702,2017), -('2017-02-15',201707,2,2017,15,7,201702,2017), -('2017-02-16',201707,2,2017,16,7,201702,2017), -('2017-02-17',201707,2,2017,17,7,201702,2017), -('2017-02-18',201707,2,2017,18,7,201702,2017), -('2017-02-19',201708,2,2017,19,8,201702,2017), -('2017-02-20',201708,2,2017,20,8,201702,2017), -('2017-02-21',201708,2,2017,21,8,201702,2017), -('2017-02-22',201708,2,2017,22,8,201702,2017), -('2017-02-23',201708,2,2017,23,8,201702,2017), -('2017-02-24',201708,2,2017,24,8,201702,2017), -('2017-02-25',201708,2,2017,25,8,201702,2017), -('2017-02-26',201709,2,2017,26,9,201702,2017), -('2017-02-27',201709,2,2017,27,9,201702,2017), -('2017-02-28',201709,2,2017,28,9,201702,2017), -('2017-03-01',201709,3,2017,1,9,201703,2017), -('2017-03-02',201709,3,2017,2,9,201703,2017), -('2017-03-03',201709,3,2017,3,9,201703,2017), -('2017-03-04',201709,3,2017,4,9,201703,2017), -('2017-03-05',201710,3,2017,5,10,201703,2017), -('2017-03-06',201710,3,2017,6,10,201703,2017), -('2017-03-07',201710,3,2017,7,10,201703,2017), -('2017-03-08',201710,3,2017,8,10,201703,2017), -('2017-03-09',201710,3,2017,9,10,201703,2017), -('2017-03-10',201710,3,2017,10,10,201703,2017), -('2017-03-11',201710,3,2017,11,10,201703,2017), -('2017-03-12',201711,3,2017,12,11,201703,2017), -('2017-03-13',201711,3,2017,13,11,201703,2017), -('2017-03-14',201711,3,2017,14,11,201703,2017), -('2017-03-15',201711,3,2017,15,11,201703,2017), -('2017-03-16',201711,3,2017,16,11,201703,2017), -('2017-03-17',201711,3,2017,17,11,201703,2017), -('2017-03-18',201711,3,2017,18,11,201703,2017), -('2017-03-19',201712,3,2017,19,12,201703,2017), -('2017-03-20',201712,3,2017,20,12,201703,2017), -('2017-03-21',201712,3,2017,21,12,201703,2017), -('2017-03-22',201712,3,2017,22,12,201703,2017), -('2017-03-23',201712,3,2017,23,12,201703,2017), -('2017-03-24',201712,3,2017,24,12,201703,2017), -('2017-03-25',201712,3,2017,25,12,201703,2017), -('2017-03-26',201713,3,2017,26,13,201703,2017), -('2017-03-27',201713,3,2017,27,13,201703,2017), -('2017-03-28',201713,3,2017,28,13,201703,2017), -('2017-03-29',201713,3,2017,29,13,201703,2017), -('2017-03-30',201713,3,2017,30,13,201703,2017), -('2017-03-31',201713,3,2017,31,13,201703,2017), -('2017-04-01',201713,4,2017,1,13,201704,2017), -('2017-04-02',201714,4,2017,2,14,201704,2017), -('2017-04-03',201714,4,2017,3,14,201704,2017), -('2017-04-04',201714,4,2017,4,14,201704,2017), -('2017-04-05',201714,4,2017,5,14,201704,2017), -('2017-04-06',201714,4,2017,6,14,201704,2017), -('2017-04-07',201714,4,2017,7,14,201704,2017), -('2017-04-08',201714,4,2017,8,14,201704,2017), -('2017-04-09',201715,4,2017,9,15,201704,2017), -('2017-04-10',201715,4,2017,10,15,201704,2017), -('2017-04-11',201715,4,2017,11,15,201704,2017), -('2017-04-12',201715,4,2017,12,15,201704,2017), -('2017-04-13',201715,4,2017,13,15,201704,2017), -('2017-04-14',201715,4,2017,14,15,201704,2017), -('2017-04-15',201715,4,2017,15,15,201704,2017), -('2017-04-16',201716,4,2017,16,16,201704,2017), -('2017-04-17',201716,4,2017,17,16,201704,2017), -('2017-04-18',201716,4,2017,18,16,201704,2017), -('2017-04-19',201716,4,2017,19,16,201704,2017), -('2017-04-20',201716,4,2017,20,16,201704,2017), -('2017-04-21',201716,4,2017,21,16,201704,2017), -('2017-04-22',201716,4,2017,22,16,201704,2017), -('2017-04-23',201717,4,2017,23,17,201704,2017), -('2017-04-24',201717,4,2017,24,17,201704,2017), -('2017-04-25',201717,4,2017,25,17,201704,2017), -('2017-04-26',201717,4,2017,26,17,201704,2017), -('2017-04-27',201717,4,2017,27,17,201704,2017), -('2017-04-28',201717,4,2017,28,17,201704,2017), -('2017-04-29',201717,4,2017,29,17,201704,2017), -('2017-04-30',201718,4,2017,30,18,201704,2017), -('2017-05-01',201718,5,2017,1,18,201705,2017), -('2017-05-02',201718,5,2017,2,18,201705,2017), -('2017-05-03',201718,5,2017,3,18,201705,2017), -('2017-05-04',201718,5,2017,4,18,201705,2017), -('2017-05-05',201718,5,2017,5,18,201705,2017), -('2017-05-06',201718,5,2017,6,18,201705,2017), -('2017-05-07',201719,5,2017,7,19,201705,2017), -('2017-05-08',201719,5,2017,8,19,201705,2017), -('2017-05-09',201719,5,2017,9,19,201705,2017), -('2017-05-10',201719,5,2017,10,19,201705,2017), -('2017-05-11',201719,5,2017,11,19,201705,2017), -('2017-05-12',201719,5,2017,12,19,201705,2017), -('2017-05-13',201719,5,2017,13,19,201705,2017), -('2017-05-14',201720,5,2017,14,20,201705,2017), -('2017-05-15',201720,5,2017,15,20,201705,2017), -('2017-05-16',201720,5,2017,16,20,201705,2017), -('2017-05-17',201720,5,2017,17,20,201705,2017), -('2017-05-18',201720,5,2017,18,20,201705,2017), -('2017-05-19',201720,5,2017,19,20,201705,2017), -('2017-05-20',201720,5,2017,20,20,201705,2017), -('2017-05-21',201721,5,2017,21,21,201705,2017), -('2017-05-22',201721,5,2017,22,21,201705,2017), -('2017-05-23',201721,5,2017,23,21,201705,2017), -('2017-05-24',201721,5,2017,24,21,201705,2017), -('2017-05-25',201721,5,2017,25,21,201705,2017), -('2017-05-26',201721,5,2017,26,21,201705,2017), -('2017-05-27',201721,5,2017,27,21,201705,2017), -('2017-05-28',201722,5,2017,28,22,201705,2017), -('2017-05-29',201722,5,2017,29,22,201705,2017), -('2017-05-30',201722,5,2017,30,22,201705,2017), -('2017-05-31',201722,5,2017,31,22,201705,2017), -('2017-06-01',201722,6,2017,1,22,201706,2017), -('2017-06-02',201722,6,2017,2,22,201706,2017), -('2017-06-03',201722,6,2017,3,22,201706,2017), -('2017-06-04',201723,6,2017,4,23,201706,2017), -('2017-06-05',201723,6,2017,5,23,201706,2017), -('2017-06-06',201723,6,2017,6,23,201706,2017), -('2017-06-07',201723,6,2017,7,23,201706,2017), -('2017-06-08',201723,6,2017,8,23,201706,2017), -('2017-06-09',201723,6,2017,9,23,201706,2017), -('2017-06-10',201723,6,2017,10,23,201706,2017), -('2017-06-11',201724,6,2017,11,24,201706,2017), -('2017-06-12',201724,6,2017,12,24,201706,2017), -('2017-06-13',201724,6,2017,13,24,201706,2017), -('2017-06-14',201724,6,2017,14,24,201706,2017), -('2017-06-15',201724,6,2017,15,24,201706,2017), -('2017-06-16',201724,6,2017,16,24,201706,2017), -('2017-06-17',201724,6,2017,17,24,201706,2017), -('2017-06-18',201725,6,2017,18,25,201706,2017), -('2017-06-19',201725,6,2017,19,25,201706,2017), -('2017-06-20',201725,6,2017,20,25,201706,2017), -('2017-06-21',201725,6,2017,21,25,201706,2017), -('2017-06-22',201725,6,2017,22,25,201706,2017), -('2017-06-23',201725,6,2017,23,25,201706,2017), -('2017-06-24',201725,6,2017,24,25,201706,2017), -('2017-06-25',201726,6,2017,25,26,201706,2017), -('2017-06-26',201726,6,2017,26,26,201706,2017), -('2017-06-27',201726,6,2017,27,26,201706,2017), -('2017-06-28',201726,6,2017,28,26,201706,2017), -('2017-06-29',201726,6,2017,29,26,201706,2017), -('2017-06-30',201726,6,2017,30,26,201706,2017), -('2017-07-01',201726,7,2017,1,26,201707,2017), -('2017-07-02',201727,7,2017,2,27,201707,2017), -('2017-07-03',201727,7,2017,3,27,201707,2017), -('2017-07-04',201727,7,2017,4,27,201707,2017), -('2017-07-05',201727,7,2017,5,27,201707,2017), -('2017-07-06',201727,7,2017,6,27,201707,2017), -('2017-07-07',201727,7,2017,7,27,201707,2017), -('2017-07-08',201727,7,2017,8,27,201707,2017), -('2017-07-09',201728,7,2017,9,28,201707,2017), -('2017-07-10',201728,7,2017,10,28,201707,2017), -('2017-07-11',201728,7,2017,11,28,201707,2017), -('2017-07-12',201728,7,2017,12,28,201707,2017), -('2017-07-13',201728,7,2017,13,28,201707,2017), -('2017-07-14',201728,7,2017,14,28,201707,2017), -('2017-07-15',201728,7,2017,15,28,201707,2017), -('2017-07-16',201729,7,2017,16,29,201707,2017), -('2017-07-17',201729,7,2017,17,29,201707,2017), -('2017-07-18',201729,7,2017,18,29,201707,2017), -('2017-07-19',201729,7,2017,19,29,201707,2017), -('2017-07-20',201729,7,2017,20,29,201707,2017), -('2017-07-21',201729,7,2017,21,29,201707,2017), -('2017-07-22',201729,7,2017,22,29,201707,2017), -('2017-07-23',201730,7,2017,23,30,201707,2017), -('2017-07-24',201730,7,2017,24,30,201707,2017), -('2017-07-25',201730,7,2017,25,30,201707,2017), -('2017-07-26',201730,7,2017,26,30,201707,2017), -('2017-07-27',201730,7,2017,27,30,201707,2017), -('2017-07-28',201730,7,2017,28,30,201707,2017), -('2017-07-29',201730,7,2017,29,30,201707,2017), -('2017-07-30',201731,7,2017,30,31,201707,2017), -('2017-07-31',201731,7,2017,31,31,201707,2017), -('2017-08-01',201731,8,2017,1,31,201708,2017), -('2017-08-02',201731,8,2017,2,31,201708,2017), -('2017-08-03',201731,8,2017,3,31,201708,2017), -('2017-08-04',201731,8,2017,4,31,201708,2017), -('2017-08-05',201731,8,2017,5,31,201708,2017), -('2017-08-06',201732,8,2017,6,32,201708,2017), -('2017-08-07',201732,8,2017,7,32,201708,2017), -('2017-08-08',201732,8,2017,8,32,201708,2017), -('2017-08-09',201732,8,2017,9,32,201708,2017), -('2017-08-10',201732,8,2017,10,32,201708,2017), -('2017-08-11',201732,8,2017,11,32,201708,2017), -('2017-08-12',201732,8,2017,12,32,201708,2017), -('2017-08-13',201733,8,2017,13,33,201708,2017), -('2017-08-14',201733,8,2017,14,33,201708,2017), -('2017-08-15',201733,8,2017,15,33,201708,2017), -('2017-08-16',201733,8,2017,16,33,201708,2017), -('2017-08-17',201733,8,2017,17,33,201708,2017), -('2017-08-18',201733,8,2017,18,33,201708,2017), -('2017-08-19',201733,8,2017,19,33,201708,2017), -('2017-08-20',201734,8,2017,20,34,201708,2017), -('2017-08-21',201734,8,2017,21,34,201708,2017), -('2017-08-22',201734,8,2017,22,34,201708,2017), -('2017-08-23',201734,8,2017,23,34,201708,2017), -('2017-08-24',201734,8,2017,24,34,201708,2017), -('2017-08-25',201734,8,2017,25,34,201708,2017), -('2017-08-26',201734,8,2017,26,34,201708,2017), -('2017-08-27',201735,8,2017,27,35,201708,2017), -('2017-08-28',201735,8,2017,28,35,201708,2017), -('2017-08-29',201735,8,2017,29,35,201708,2017), -('2017-08-30',201735,8,2017,30,35,201708,2017), -('2017-08-31',201735,8,2017,31,35,201708,2017), -('2017-09-01',201735,9,2017,1,35,201709,2017), -('2017-09-02',201735,9,2017,2,35,201709,2017), -('2017-09-03',201736,9,2017,3,36,201709,2017), -('2017-09-04',201736,9,2017,4,36,201709,2017), -('2017-09-05',201736,9,2017,5,36,201709,2017), -('2017-09-06',201736,9,2017,6,36,201709,2017), -('2017-09-07',201736,9,2017,7,36,201709,2017), -('2017-09-08',201736,9,2017,8,36,201709,2017), -('2017-09-09',201736,9,2017,9,36,201709,2017), -('2017-09-10',201737,9,2017,10,37,201709,2017), -('2017-09-11',201737,9,2017,11,37,201709,2017), -('2017-09-12',201737,9,2017,12,37,201709,2017), -('2017-09-13',201737,9,2017,13,37,201709,2017), -('2017-09-14',201737,9,2017,14,37,201709,2017), -('2017-09-15',201737,9,2017,15,37,201709,2017), -('2017-09-16',201737,9,2017,16,37,201709,2017), -('2017-09-17',201738,9,2017,17,38,201709,2017), -('2017-09-18',201738,9,2017,18,38,201709,2017), -('2017-09-19',201738,9,2017,19,38,201709,2017), -('2017-09-20',201738,9,2017,20,38,201709,2017), -('2017-09-21',201738,9,2017,21,38,201709,2017), -('2017-09-22',201738,9,2017,22,38,201709,2017), -('2017-09-23',201738,9,2017,23,38,201709,2017), -('2017-09-24',201739,9,2017,24,39,201709,2017), -('2017-09-25',201739,9,2017,25,39,201709,2017), -('2017-09-26',201739,9,2017,26,39,201709,2017), -('2017-09-27',201739,9,2017,27,39,201709,2017), -('2017-09-28',201739,9,2017,28,39,201709,2017), -('2017-09-29',201739,9,2017,29,39,201709,2017), -('2017-09-30',201739,9,2017,30,39,201709,2017), -('2017-10-01',201740,10,2017,1,40,201710,2017), -('2017-10-02',201740,10,2017,2,40,201710,2017), -('2017-10-03',201740,10,2017,3,40,201710,2017), -('2017-10-04',201740,10,2017,4,40,201710,2017), -('2017-10-05',201740,10,2017,5,40,201710,2017), -('2017-10-06',201740,10,2017,6,40,201710,2017), -('2017-10-07',201740,10,2017,7,40,201710,2017), -('2017-10-08',201741,10,2017,8,41,201710,2017), -('2017-10-09',201741,10,2017,9,41,201710,2017), -('2017-10-10',201741,10,2017,10,41,201710,2017), -('2017-10-11',201741,10,2017,11,41,201710,2017), -('2017-10-12',201741,10,2017,12,41,201710,2017), -('2017-10-13',201741,10,2017,13,41,201710,2017), -('2017-10-14',201741,10,2017,14,41,201710,2017), -('2017-10-15',201742,10,2017,15,42,201710,2017), -('2017-10-16',201742,10,2017,16,42,201710,2017), -('2017-10-17',201742,10,2017,17,42,201710,2017), -('2017-10-18',201742,10,2017,18,42,201710,2017), -('2017-10-19',201742,10,2017,19,42,201710,2017), -('2017-10-20',201742,10,2017,20,42,201710,2017), -('2017-10-21',201742,10,2017,21,42,201710,2017), -('2017-10-22',201743,10,2017,22,43,201710,2017), -('2017-10-23',201743,10,2017,23,43,201710,2017), -('2017-10-24',201743,10,2017,24,43,201710,2017), -('2017-10-25',201743,10,2017,25,43,201710,2017), -('2017-10-26',201743,10,2017,26,43,201710,2017), -('2017-10-27',201743,10,2017,27,43,201710,2017), -('2017-10-28',201743,10,2017,28,43,201710,2017), -('2017-10-29',201744,10,2017,29,44,201710,2017), -('2017-10-30',201744,10,2017,30,44,201710,2017), -('2017-10-31',201744,10,2017,31,44,201710,2017), -('2017-11-01',201744,11,2017,1,44,201711,2017), -('2017-11-02',201744,11,2017,2,44,201711,2017), -('2017-11-03',201744,11,2017,3,44,201711,2017), -('2017-11-04',201744,11,2017,4,44,201711,2017), -('2017-11-05',201745,11,2017,5,45,201711,2017), -('2017-11-06',201745,11,2017,6,45,201711,2017), -('2017-11-07',201745,11,2017,7,45,201711,2017), -('2017-11-08',201745,11,2017,8,45,201711,2017), -('2017-11-09',201745,11,2017,9,45,201711,2017), -('2017-11-10',201745,11,2017,10,45,201711,2017), -('2017-11-11',201745,11,2017,11,45,201711,2017), -('2017-11-12',201746,11,2017,12,46,201711,2017), -('2017-11-13',201746,11,2017,13,46,201711,2017), -('2017-11-14',201746,11,2017,14,46,201711,2017), -('2017-11-15',201746,11,2017,15,46,201711,2017), -('2017-11-16',201746,11,2017,16,46,201711,2017), -('2017-11-17',201746,11,2017,17,46,201711,2017), -('2017-11-18',201746,11,2017,18,46,201711,2017), -('2017-11-19',201747,11,2017,19,47,201711,2017), -('2017-11-20',201747,11,2017,20,47,201711,2017), -('2017-11-21',201747,11,2017,21,47,201711,2017), -('2017-11-22',201747,11,2017,22,47,201711,2017), -('2017-11-23',201747,11,2017,23,47,201711,2017), -('2017-11-24',201747,11,2017,24,47,201711,2017), -('2017-11-25',201747,11,2017,25,47,201711,2017), -('2017-11-26',201748,11,2017,26,48,201711,2017), -('2017-11-27',201748,11,2017,27,48,201711,2017), -('2017-11-28',201748,11,2017,28,48,201711,2017), -('2017-11-29',201748,11,2017,29,48,201711,2017), -('2017-11-30',201748,11,2017,30,48,201711,2017), -('2017-12-01',201748,12,2017,1,48,201712,2018), -('2017-12-02',201748,12,2017,2,48,201712,2018), -('2017-12-03',201749,12,2017,3,49,201712,2018), -('2017-12-04',201749,12,2017,4,49,201712,2018), -('2017-12-05',201749,12,2017,5,49,201712,2018), -('2017-12-06',201749,12,2017,6,49,201712,2018), -('2017-12-07',201749,12,2017,7,49,201712,2018), -('2017-12-08',201749,12,2017,8,49,201712,2018), -('2017-12-09',201749,12,2017,9,49,201712,2018), -('2017-12-10',201750,12,2017,10,50,201712,2018), -('2017-12-11',201750,12,2017,11,50,201712,2018), -('2017-12-12',201750,12,2017,12,50,201712,2018), -('2017-12-13',201750,12,2017,13,50,201712,2018), -('2017-12-14',201750,12,2017,14,50,201712,2018), -('2017-12-15',201750,12,2017,15,50,201712,2018), -('2017-12-16',201750,12,2017,16,50,201712,2018), -('2017-12-17',201751,12,2017,17,51,201712,2018), -('2017-12-18',201751,12,2017,18,51,201712,2018), -('2017-12-19',201751,12,2017,19,51,201712,2018), -('2017-12-20',201751,12,2017,20,51,201712,2018), -('2017-12-21',201751,12,2017,21,51,201712,2018), -('2017-12-22',201751,12,2017,22,51,201712,2018), -('2017-12-23',201751,12,2017,23,51,201712,2018), -('2017-12-24',201752,12,2017,24,52,201712,2018), -('2017-12-25',201752,12,2017,25,52,201712,2018), -('2017-12-26',201752,12,2017,26,52,201712,2018), -('2017-12-27',201752,12,2017,27,52,201712,2018), -('2017-12-28',201752,12,2017,28,52,201712,2018), -('2017-12-29',201752,12,2017,29,52,201712,2018), -('2017-12-30',201752,12,2017,30,52,201712,2018), -('2017-12-31',201801,12,2017,31,1,201712,2018), -('2018-01-01',201801,1,2018,1,1,201801,2018), -('2018-01-02',201801,1,2018,2,1,201801,2018), -('2018-01-03',201801,1,2018,3,1,201801,2018), -('2018-01-04',201801,1,2018,4,1,201801,2018), -('2018-01-05',201801,1,2018,5,1,201801,2018), -('2018-01-06',201801,1,2018,6,1,201801,2018), -('2018-01-07',201802,1,2018,7,2,201801,2018), -('2018-01-08',201802,1,2018,8,2,201801,2018), -('2018-01-09',201802,1,2018,9,2,201801,2018), -('2018-01-10',201802,1,2018,10,2,201801,2018), -('2018-01-11',201802,1,2018,11,2,201801,2018), -('2018-01-12',201802,1,2018,12,2,201801,2018), -('2018-01-13',201802,1,2018,13,2,201801,2018), -('2018-01-14',201803,1,2018,14,3,201801,2018), -('2018-01-15',201803,1,2018,15,3,201801,2018), -('2018-01-16',201803,1,2018,16,3,201801,2018), -('2018-01-17',201803,1,2018,17,3,201801,2018), -('2018-01-18',201803,1,2018,18,3,201801,2018), -('2018-01-19',201803,1,2018,19,3,201801,2018), -('2018-01-20',201803,1,2018,20,3,201801,2018), -('2018-01-21',201804,1,2018,21,4,201801,2018), -('2018-01-22',201804,1,2018,22,4,201801,2018), -('2018-01-23',201804,1,2018,23,4,201801,2018), -('2018-01-24',201804,1,2018,24,4,201801,2018), -('2018-01-25',201804,1,2018,25,4,201801,2018), -('2018-01-26',201804,1,2018,26,4,201801,2018), -('2018-01-27',201804,1,2018,27,4,201801,2018), -('2018-01-28',201805,1,2018,28,5,201801,2018), -('2018-01-29',201805,1,2018,29,5,201801,2018), -('2018-01-30',201805,1,2018,30,5,201801,2018), -('2018-01-31',201805,1,2018,31,5,201801,2018), -('2018-02-01',201805,2,2018,1,5,201802,2018), -('2018-02-02',201805,2,2018,2,5,201802,2018), -('2018-02-03',201805,2,2018,3,5,201802,2018), -('2018-02-04',201806,2,2018,4,6,201802,2018), -('2018-02-05',201806,2,2018,5,6,201802,2018), -('2018-02-06',201806,2,2018,6,6,201802,2018), -('2018-02-07',201806,2,2018,7,6,201802,2018), -('2018-02-08',201806,2,2018,8,6,201802,2018), -('2018-02-09',201806,2,2018,9,6,201802,2018), -('2018-02-10',201806,2,2018,10,6,201802,2018), -('2018-02-11',201807,2,2018,11,7,201802,2018), -('2018-02-12',201807,2,2018,12,7,201802,2018), -('2018-02-13',201807,2,2018,13,7,201802,2018), -('2018-02-14',201807,2,2018,14,7,201802,2018), -('2018-02-15',201807,2,2018,15,7,201802,2018), -('2018-02-16',201807,2,2018,16,7,201802,2018), -('2018-02-17',201807,2,2018,17,7,201802,2018), -('2018-02-18',201808,2,2018,18,8,201802,2018), -('2018-02-19',201808,2,2018,19,8,201802,2018), -('2018-02-20',201808,2,2018,20,8,201802,2018), -('2018-02-21',201808,2,2018,21,8,201802,2018), -('2018-02-22',201808,2,2018,22,8,201802,2018), -('2018-02-23',201808,2,2018,23,8,201802,2018), -('2018-02-24',201808,2,2018,24,8,201802,2018), -('2018-02-25',201809,2,2018,25,9,201802,2018), -('2018-02-26',201809,2,2018,26,9,201802,2018), -('2018-02-27',201809,2,2018,27,9,201802,2018), -('2018-02-28',201809,2,2018,28,9,201802,2018), -('2018-03-01',201809,3,2018,1,9,201803,2018), -('2018-03-02',201809,3,2018,2,9,201803,2018), -('2018-03-03',201809,3,2018,3,9,201803,2018), -('2018-03-04',201810,3,2018,4,10,201803,2018), -('2018-03-05',201810,3,2018,5,10,201803,2018), -('2018-03-06',201810,3,2018,6,10,201803,2018), -('2018-03-07',201810,3,2018,7,10,201803,2018), -('2018-03-08',201810,3,2018,8,10,201803,2018), -('2018-03-09',201810,3,2018,9,10,201803,2018), -('2018-03-10',201810,3,2018,10,10,201803,2018), -('2018-03-11',201811,3,2018,11,11,201803,2018), -('2018-03-12',201811,3,2018,12,11,201803,2018), -('2018-03-13',201811,3,2018,13,11,201803,2018), -('2018-03-14',201811,3,2018,14,11,201803,2018), -('2018-03-15',201811,3,2018,15,11,201803,2018), -('2018-03-16',201811,3,2018,16,11,201803,2018), -('2018-03-17',201811,3,2018,17,11,201803,2018), -('2018-03-18',201812,3,2018,18,12,201803,2018), -('2018-03-19',201812,3,2018,19,12,201803,2018), -('2018-03-20',201812,3,2018,20,12,201803,2018), -('2018-03-21',201812,3,2018,21,12,201803,2018), -('2018-03-22',201812,3,2018,22,12,201803,2018), -('2018-03-23',201812,3,2018,23,12,201803,2018), -('2018-03-24',201812,3,2018,24,12,201803,2018), -('2018-03-25',201813,3,2018,25,13,201803,2018), -('2018-03-26',201813,3,2018,26,13,201803,2018), -('2018-03-27',201813,3,2018,27,13,201803,2018), -('2018-03-28',201813,3,2018,28,13,201803,2018), -('2018-03-29',201813,3,2018,29,13,201803,2018), -('2018-03-30',201813,3,2018,30,13,201803,2018), -('2018-03-31',201813,3,2018,31,13,201803,2018), -('2018-04-01',201814,4,2018,1,14,201804,2018), -('2018-04-02',201814,4,2018,2,14,201804,2018), -('2018-04-03',201814,4,2018,3,14,201804,2018), -('2018-04-04',201814,4,2018,4,14,201804,2018), -('2018-04-05',201814,4,2018,5,14,201804,2018), -('2018-04-06',201814,4,2018,6,14,201804,2018), -('2018-04-07',201814,4,2018,7,14,201804,2018), -('2018-04-08',201815,4,2018,8,15,201804,2018), -('2018-04-09',201815,4,2018,9,15,201804,2018), -('2018-04-10',201815,4,2018,10,15,201804,2018), -('2018-04-11',201815,4,2018,11,15,201804,2018), -('2018-04-12',201815,4,2018,12,15,201804,2018), -('2018-04-13',201815,4,2018,13,15,201804,2018), -('2018-04-14',201815,4,2018,14,15,201804,2018), -('2018-04-15',201816,4,2018,15,16,201804,2018), -('2018-04-16',201816,4,2018,16,16,201804,2018), -('2018-04-17',201816,4,2018,17,16,201804,2018), -('2018-04-18',201816,4,2018,18,16,201804,2018), -('2018-04-19',201816,4,2018,19,16,201804,2018), -('2018-04-20',201816,4,2018,20,16,201804,2018), -('2018-04-21',201816,4,2018,21,16,201804,2018), -('2018-04-22',201817,4,2018,22,17,201804,2018), -('2018-04-23',201817,4,2018,23,17,201804,2018), -('2018-04-24',201817,4,2018,24,17,201804,2018), -('2018-04-25',201817,4,2018,25,17,201804,2018), -('2018-04-26',201817,4,2018,26,17,201804,2018), -('2018-04-27',201817,4,2018,27,17,201804,2018), -('2018-04-28',201817,4,2018,28,17,201804,2018), -('2018-04-29',201818,4,2018,29,18,201804,2018), -('2018-04-30',201818,4,2018,30,18,201804,2018), -('2018-05-01',201818,5,2018,1,18,201805,2018), -('2018-05-02',201818,5,2018,2,18,201805,2018), -('2018-05-03',201818,5,2018,3,18,201805,2018), -('2018-05-04',201818,5,2018,4,18,201805,2018), -('2018-05-05',201818,5,2018,5,18,201805,2018), -('2018-05-06',201819,5,2018,6,19,201805,2018), -('2018-05-07',201819,5,2018,7,19,201805,2018), -('2018-05-08',201819,5,2018,8,19,201805,2018), -('2018-05-09',201819,5,2018,9,19,201805,2018), -('2018-05-10',201819,5,2018,10,19,201805,2018), -('2018-05-11',201819,5,2018,11,19,201805,2018), -('2018-05-12',201819,5,2018,12,19,201805,2018), -('2018-05-13',201820,5,2018,13,20,201805,2018), -('2018-05-14',201820,5,2018,14,20,201805,2018), -('2018-05-15',201820,5,2018,15,20,201805,2018), -('2018-05-16',201820,5,2018,16,20,201805,2018), -('2018-05-17',201820,5,2018,17,20,201805,2018), -('2018-05-18',201820,5,2018,18,20,201805,2018), -('2018-05-19',201820,5,2018,19,20,201805,2018), -('2018-05-20',201821,5,2018,20,21,201805,2018), -('2018-05-21',201821,5,2018,21,21,201805,2018), -('2018-05-22',201821,5,2018,22,21,201805,2018), -('2018-05-23',201821,5,2018,23,21,201805,2018), -('2018-05-24',201821,5,2018,24,21,201805,2018), -('2018-05-25',201821,5,2018,25,21,201805,2018), -('2018-05-26',201821,5,2018,26,21,201805,2018), -('2018-05-27',201822,5,2018,27,22,201805,2018), -('2018-05-28',201822,5,2018,28,22,201805,2018), -('2018-05-29',201822,5,2018,29,22,201805,2018), -('2018-05-30',201822,5,2018,30,22,201805,2018), -('2018-05-31',201822,5,2018,31,22,201805,2018), -('2018-06-01',201822,6,2018,1,22,201806,2018), -('2018-06-02',201822,6,2018,2,22,201806,2018), -('2018-06-03',201823,6,2018,3,23,201806,2018), -('2018-06-04',201823,6,2018,4,23,201806,2018), -('2018-06-05',201823,6,2018,5,23,201806,2018), -('2018-06-06',201823,6,2018,6,23,201806,2018), -('2018-06-07',201823,6,2018,7,23,201806,2018), -('2018-06-08',201823,6,2018,8,23,201806,2018), -('2018-06-09',201823,6,2018,9,23,201806,2018), -('2018-06-10',201824,6,2018,10,24,201806,2018), -('2018-06-11',201824,6,2018,11,24,201806,2018), -('2018-06-12',201824,6,2018,12,24,201806,2018), -('2018-06-13',201824,6,2018,13,24,201806,2018), -('2018-06-14',201824,6,2018,14,24,201806,2018), -('2018-06-15',201824,6,2018,15,24,201806,2018), -('2018-06-16',201824,6,2018,16,24,201806,2018), -('2018-06-17',201825,6,2018,17,25,201806,2018), -('2018-06-18',201825,6,2018,18,25,201806,2018), -('2018-06-19',201825,6,2018,19,25,201806,2018), -('2018-06-20',201825,6,2018,20,25,201806,2018), -('2018-06-21',201825,6,2018,21,25,201806,2018), -('2018-06-22',201825,6,2018,22,25,201806,2018), -('2018-06-23',201825,6,2018,23,25,201806,2018), -('2018-06-24',201826,6,2018,24,26,201806,2018), -('2018-06-25',201826,6,2018,25,26,201806,2018), -('2018-06-26',201826,6,2018,26,26,201806,2018), -('2018-06-27',201826,6,2018,27,26,201806,2018), -('2018-06-28',201826,6,2018,28,26,201806,2018), -('2018-06-29',201826,6,2018,29,26,201806,2018), -('2018-06-30',201826,6,2018,30,26,201806,2018), -('2018-07-01',201827,7,2018,1,27,201807,2018), -('2018-07-02',201827,7,2018,2,27,201807,2018), -('2018-07-03',201827,7,2018,3,27,201807,2018), -('2018-07-04',201827,7,2018,4,27,201807,2018), -('2018-07-05',201827,7,2018,5,27,201807,2018), -('2018-07-06',201827,7,2018,6,27,201807,2018), -('2018-07-07',201827,7,2018,7,27,201807,2018), -('2018-07-08',201828,7,2018,8,28,201807,2018), -('2018-07-09',201828,7,2018,9,28,201807,2018), -('2018-07-10',201828,7,2018,10,28,201807,2018), -('2018-07-11',201828,7,2018,11,28,201807,2018), -('2018-07-12',201828,7,2018,12,28,201807,2018), -('2018-07-13',201828,7,2018,13,28,201807,2018), -('2018-07-14',201828,7,2018,14,28,201807,2018), -('2018-07-15',201829,7,2018,15,29,201807,2018), -('2018-07-16',201829,7,2018,16,29,201807,2018), -('2018-07-17',201829,7,2018,17,29,201807,2018), -('2018-07-18',201829,7,2018,18,29,201807,2018), -('2018-07-19',201829,7,2018,19,29,201807,2018), -('2018-07-20',201829,7,2018,20,29,201807,2018), -('2018-07-21',201829,7,2018,21,29,201807,2018), -('2018-07-22',201830,7,2018,22,30,201807,2018), -('2018-07-23',201830,7,2018,23,30,201807,2018), -('2018-07-24',201830,7,2018,24,30,201807,2018), -('2018-07-25',201830,7,2018,25,30,201807,2018), -('2018-07-26',201830,7,2018,26,30,201807,2018), -('2018-07-27',201830,7,2018,27,30,201807,2018), -('2018-07-28',201830,7,2018,28,30,201807,2018), -('2018-07-29',201831,7,2018,29,31,201807,2018), -('2018-07-30',201831,7,2018,30,31,201807,2018), -('2018-07-31',201831,7,2018,31,31,201807,2018), -('2018-08-01',201831,8,2018,1,31,201808,2018), -('2018-08-02',201831,8,2018,2,31,201808,2018), -('2018-08-03',201831,8,2018,3,31,201808,2018), -('2018-08-04',201831,8,2018,4,31,201808,2018), -('2018-08-05',201832,8,2018,5,32,201808,2018), -('2018-08-06',201832,8,2018,6,32,201808,2018), -('2018-08-07',201832,8,2018,7,32,201808,2018), -('2018-08-08',201832,8,2018,8,32,201808,2018), -('2018-08-09',201832,8,2018,9,32,201808,2018), -('2018-08-10',201832,8,2018,10,32,201808,2018), -('2018-08-11',201832,8,2018,11,32,201808,2018), -('2018-08-12',201833,8,2018,12,33,201808,2018), -('2018-08-13',201833,8,2018,13,33,201808,2018), -('2018-08-14',201833,8,2018,14,33,201808,2018), -('2018-08-15',201833,8,2018,15,33,201808,2018), -('2018-08-16',201833,8,2018,16,33,201808,2018), -('2018-08-17',201833,8,2018,17,33,201808,2018), -('2018-08-18',201833,8,2018,18,33,201808,2018), -('2018-08-19',201834,8,2018,19,34,201808,2018), -('2018-08-20',201834,8,2018,20,34,201808,2018), -('2018-08-21',201834,8,2018,21,34,201808,2018), -('2018-08-22',201834,8,2018,22,34,201808,2018), -('2018-08-23',201834,8,2018,23,34,201808,2018), -('2018-08-24',201834,8,2018,24,34,201808,2018), -('2018-08-25',201834,8,2018,25,34,201808,2018), -('2018-08-26',201835,8,2018,26,35,201808,2018), -('2018-08-27',201835,8,2018,27,35,201808,2018), -('2018-08-28',201835,8,2018,28,35,201808,2018), -('2018-08-29',201835,8,2018,29,35,201808,2018), -('2018-08-30',201835,8,2018,30,35,201808,2018), -('2018-08-31',201835,8,2018,31,35,201808,2018), -('2018-09-01',201835,9,2018,1,35,201809,2018), -('2018-09-02',201836,9,2018,2,36,201809,2018), -('2018-09-03',201836,9,2018,3,36,201809,2018), -('2018-09-04',201836,9,2018,4,36,201809,2018), -('2018-09-05',201836,9,2018,5,36,201809,2018), -('2018-09-06',201836,9,2018,6,36,201809,2018), -('2018-09-07',201836,9,2018,7,36,201809,2018), -('2018-09-08',201836,9,2018,8,36,201809,2018), -('2018-09-09',201837,9,2018,9,37,201809,2018), -('2018-09-10',201837,9,2018,10,37,201809,2018), -('2018-09-11',201837,9,2018,11,37,201809,2018), -('2018-09-12',201837,9,2018,12,37,201809,2018), -('2018-09-13',201837,9,2018,13,37,201809,2018), -('2018-09-14',201837,9,2018,14,37,201809,2018), -('2018-09-15',201837,9,2018,15,37,201809,2018), -('2018-09-16',201838,9,2018,16,38,201809,2018), -('2018-09-17',201838,9,2018,17,38,201809,2018), -('2018-09-18',201838,9,2018,18,38,201809,2018), -('2018-09-19',201838,9,2018,19,38,201809,2018), -('2018-09-20',201838,9,2018,20,38,201809,2018), -('2018-09-21',201838,9,2018,21,38,201809,2018), -('2018-09-22',201838,9,2018,22,38,201809,2018), -('2018-09-23',201839,9,2018,23,39,201809,2018), -('2018-09-24',201839,9,2018,24,39,201809,2018), -('2018-09-25',201839,9,2018,25,39,201809,2018), -('2018-09-26',201839,9,2018,26,39,201809,2018), -('2018-09-27',201839,9,2018,27,39,201809,2018), -('2018-09-28',201839,9,2018,28,39,201809,2018), -('2018-09-29',201839,9,2018,29,39,201809,2018), -('2018-09-30',201840,9,2018,30,40,201809,2018), -('2018-10-01',201840,10,2018,1,40,201810,2018), -('2018-10-02',201840,10,2018,2,40,201810,2018), -('2018-10-03',201840,10,2018,3,40,201810,2018), -('2018-10-04',201840,10,2018,4,40,201810,2018), -('2018-10-05',201840,10,2018,5,40,201810,2018), -('2018-10-06',201840,10,2018,6,40,201810,2018), -('2018-10-07',201841,10,2018,7,41,201810,2018), -('2018-10-08',201841,10,2018,8,41,201810,2018), -('2018-10-09',201841,10,2018,9,41,201810,2018), -('2018-10-10',201841,10,2018,10,41,201810,2018), -('2018-10-11',201841,10,2018,11,41,201810,2018), -('2018-10-12',201841,10,2018,12,41,201810,2018), -('2018-10-13',201841,10,2018,13,41,201810,2018), -('2018-10-14',201842,10,2018,14,42,201810,2018), -('2018-10-15',201842,10,2018,15,42,201810,2018), -('2018-10-16',201842,10,2018,16,42,201810,2018), -('2018-10-17',201842,10,2018,17,42,201810,2018), -('2018-10-18',201842,10,2018,18,42,201810,2018), -('2018-10-19',201842,10,2018,19,42,201810,2018), -('2018-10-20',201842,10,2018,20,42,201810,2018), -('2018-10-21',201843,10,2018,21,43,201810,2018), -('2018-10-22',201843,10,2018,22,43,201810,2018), -('2018-10-23',201843,10,2018,23,43,201810,2018), -('2018-10-24',201843,10,2018,24,43,201810,2018), -('2018-10-25',201843,10,2018,25,43,201810,2018), -('2018-10-26',201843,10,2018,26,43,201810,2018), -('2018-10-27',201843,10,2018,27,43,201810,2018), -('2018-10-28',201844,10,2018,28,44,201810,2018), -('2018-10-29',201844,10,2018,29,44,201810,2018), -('2018-10-30',201844,10,2018,30,44,201810,2018), -('2018-10-31',201844,10,2018,31,44,201810,2018), -('2018-11-01',201844,11,2018,1,44,201811,2018), -('2018-11-02',201844,11,2018,2,44,201811,2018), -('2018-11-03',201844,11,2018,3,44,201811,2018), -('2018-11-04',201845,11,2018,4,45,201811,2018), -('2018-11-05',201845,11,2018,5,45,201811,2018), -('2018-11-06',201845,11,2018,6,45,201811,2018), -('2018-11-07',201845,11,2018,7,45,201811,2018), -('2018-11-08',201845,11,2018,8,45,201811,2018), -('2018-11-09',201845,11,2018,9,45,201811,2018), -('2018-11-10',201845,11,2018,10,45,201811,2018), -('2018-11-11',201846,11,2018,11,46,201811,2018), -('2018-11-12',201846,11,2018,12,46,201811,2018), -('2018-11-13',201846,11,2018,13,46,201811,2018), -('2018-11-14',201846,11,2018,14,46,201811,2018), -('2018-11-15',201846,11,2018,15,46,201811,2018), -('2018-11-16',201846,11,2018,16,46,201811,2018), -('2018-11-17',201846,11,2018,17,46,201811,2018), -('2018-11-18',201847,11,2018,18,47,201811,2018), -('2018-11-19',201847,11,2018,19,47,201811,2018), -('2018-11-20',201847,11,2018,20,47,201811,2018), -('2018-11-21',201847,11,2018,21,47,201811,2018), -('2018-11-22',201847,11,2018,22,47,201811,2018), -('2018-11-23',201847,11,2018,23,47,201811,2018), -('2018-11-24',201847,11,2018,24,47,201811,2018), -('2018-11-25',201848,11,2018,25,48,201811,2018), -('2018-11-26',201848,11,2018,26,48,201811,2018), -('2018-11-27',201848,11,2018,27,48,201811,2018), -('2018-11-28',201848,11,2018,28,48,201811,2018), -('2018-11-29',201848,11,2018,29,48,201811,2018), -('2018-11-30',201848,11,2018,30,48,201811,2018), -('2018-12-01',201848,12,2018,1,48,201812,2019), -('2018-12-02',201849,12,2018,2,49,201812,2019), -('2018-12-03',201849,12,2018,3,49,201812,2019), -('2018-12-04',201849,12,2018,4,49,201812,2019), -('2018-12-05',201849,12,2018,5,49,201812,2019), -('2018-12-06',201849,12,2018,6,49,201812,2019), -('2018-12-07',201849,12,2018,7,49,201812,2019), -('2018-12-08',201849,12,2018,8,49,201812,2019), -('2018-12-09',201850,12,2018,9,50,201812,2019), -('2018-12-10',201850,12,2018,10,50,201812,2019), -('2018-12-11',201850,12,2018,11,50,201812,2019), -('2018-12-12',201850,12,2018,12,50,201812,2019), -('2018-12-13',201850,12,2018,13,50,201812,2019), -('2018-12-14',201850,12,2018,14,50,201812,2019), -('2018-12-15',201850,12,2018,15,50,201812,2019), -('2018-12-16',201851,12,2018,16,51,201812,2019), -('2018-12-17',201851,12,2018,17,51,201812,2019), -('2018-12-18',201851,12,2018,18,51,201812,2019), -('2018-12-19',201851,12,2018,19,51,201812,2019), -('2018-12-20',201851,12,2018,20,51,201812,2019), -('2018-12-21',201851,12,2018,21,51,201812,2019), -('2018-12-22',201851,12,2018,22,51,201812,2019), -('2018-12-23',201852,12,2018,23,52,201812,2019), -('2018-12-24',201852,12,2018,24,52,201812,2019), -('2018-12-25',201852,12,2018,25,52,201812,2019), -('2018-12-26',201852,12,2018,26,52,201812,2019), -('2018-12-27',201852,12,2018,27,52,201812,2019), -('2018-12-28',201852,12,2018,28,52,201812,2019), -('2018-12-29',201852,12,2018,29,52,201812,2019), -('2018-12-30',201901,12,2018,30,1,201812,2019), -('2018-12-31',201901,12,2018,31,1,201812,2019), -('2019-01-01',201901,1,2019,1,1,201901,2019), -('2019-01-02',201901,1,2019,2,1,201901,2019), -('2019-01-03',201901,1,2019,3,1,201901,2019), -('2019-01-04',201901,1,2019,4,1,201901,2019), -('2019-01-05',201901,1,2019,5,1,201901,2019), -('2019-01-06',201902,1,2019,6,2,201901,2019), -('2019-01-07',201902,1,2019,7,2,201901,2019), -('2019-01-08',201902,1,2019,8,2,201901,2019), -('2019-01-09',201902,1,2019,9,2,201901,2019), -('2019-01-10',201902,1,2019,10,2,201901,2019), -('2019-01-11',201902,1,2019,11,2,201901,2019), -('2019-01-12',201902,1,2019,12,2,201901,2019), -('2019-01-13',201903,1,2019,13,3,201901,2019), -('2019-01-14',201903,1,2019,14,3,201901,2019), -('2019-01-15',201903,1,2019,15,3,201901,2019), -('2019-01-16',201903,1,2019,16,3,201901,2019), -('2019-01-17',201903,1,2019,17,3,201901,2019), -('2019-01-18',201903,1,2019,18,3,201901,2019), -('2019-01-19',201903,1,2019,19,3,201901,2019), -('2019-01-20',201904,1,2019,20,4,201901,2019), -('2019-01-21',201904,1,2019,21,4,201901,2019), -('2019-01-22',201904,1,2019,22,4,201901,2019), -('2019-01-23',201904,1,2019,23,4,201901,2019), -('2019-01-24',201904,1,2019,24,4,201901,2019), -('2019-01-25',201904,1,2019,25,4,201901,2019), -('2019-01-26',201904,1,2019,26,4,201901,2019), -('2019-01-27',201905,1,2019,27,5,201901,2019), -('2019-01-28',201905,1,2019,28,5,201901,2019), -('2019-01-29',201905,1,2019,29,5,201901,2019), -('2019-01-30',201905,1,2019,30,5,201901,2019), -('2019-01-31',201905,1,2019,31,5,201901,2019), -('2019-02-01',201905,2,2019,1,5,201902,2019), -('2019-02-02',201905,2,2019,2,5,201902,2019), -('2019-02-03',201906,2,2019,3,6,201902,2019), -('2019-02-04',201906,2,2019,4,6,201902,2019), -('2019-02-05',201906,2,2019,5,6,201902,2019), -('2019-02-06',201906,2,2019,6,6,201902,2019), -('2019-02-07',201906,2,2019,7,6,201902,2019), -('2019-02-08',201906,2,2019,8,6,201902,2019), -('2019-02-09',201906,2,2019,9,6,201902,2019), -('2019-02-10',201907,2,2019,10,7,201902,2019), -('2019-02-11',201907,2,2019,11,7,201902,2019), -('2019-02-12',201907,2,2019,12,7,201902,2019), -('2019-02-13',201907,2,2019,13,7,201902,2019), -('2019-02-14',201907,2,2019,14,7,201902,2019), -('2019-02-15',201907,2,2019,15,7,201902,2019), -('2019-02-16',201907,2,2019,16,7,201902,2019), -('2019-02-17',201908,2,2019,17,8,201902,2019), -('2019-02-18',201908,2,2019,18,8,201902,2019), -('2019-02-19',201908,2,2019,19,8,201902,2019), -('2019-02-20',201908,2,2019,20,8,201902,2019), -('2019-02-21',201908,2,2019,21,8,201902,2019), -('2019-02-22',201908,2,2019,22,8,201902,2019), -('2019-02-23',201908,2,2019,23,8,201902,2019), -('2019-02-24',201909,2,2019,24,9,201902,2019), -('2019-02-25',201909,2,2019,25,9,201902,2019), -('2019-02-26',201909,2,2019,26,9,201902,2019), -('2019-02-27',201909,2,2019,27,9,201902,2019), -('2019-02-28',201909,2,2019,28,9,201902,2019), -('2019-03-01',201909,3,2019,1,9,201903,2019), -('2019-03-02',201909,3,2019,2,9,201903,2019), -('2019-03-03',201910,3,2019,3,10,201903,2019), -('2019-03-04',201910,3,2019,4,10,201903,2019), -('2019-03-05',201910,3,2019,5,10,201903,2019), -('2019-03-06',201910,3,2019,6,10,201903,2019), -('2019-03-07',201910,3,2019,7,10,201903,2019), -('2019-03-08',201910,3,2019,8,10,201903,2019), -('2019-03-09',201910,3,2019,9,10,201903,2019), -('2019-03-10',201911,3,2019,10,11,201903,2019), -('2019-03-11',201911,3,2019,11,11,201903,2019), -('2019-03-12',201911,3,2019,12,11,201903,2019), -('2019-03-13',201911,3,2019,13,11,201903,2019), -('2019-03-14',201911,3,2019,14,11,201903,2019), -('2019-03-15',201911,3,2019,15,11,201903,2019), -('2019-03-16',201911,3,2019,16,11,201903,2019), -('2019-03-17',201912,3,2019,17,12,201903,2019), -('2019-03-18',201912,3,2019,18,12,201903,2019), -('2019-03-19',201912,3,2019,19,12,201903,2019), -('2019-03-20',201912,3,2019,20,12,201903,2019), -('2019-03-21',201912,3,2019,21,12,201903,2019), -('2019-03-22',201912,3,2019,22,12,201903,2019), -('2019-03-23',201912,3,2019,23,12,201903,2019), -('2019-03-24',201913,3,2019,24,13,201903,2019), -('2019-03-25',201913,3,2019,25,13,201903,2019), -('2019-03-26',201913,3,2019,26,13,201903,2019), -('2019-03-27',201913,3,2019,27,13,201903,2019), -('2019-03-28',201913,3,2019,28,13,201903,2019), -('2019-03-29',201913,3,2019,29,13,201903,2019), -('2019-03-30',201913,3,2019,30,13,201903,2019), -('2019-03-31',201914,3,2019,31,14,201903,2019), -('2019-04-01',201914,4,2019,1,14,201904,2019), -('2019-04-02',201914,4,2019,2,14,201904,2019), -('2019-04-03',201914,4,2019,3,14,201904,2019), -('2019-04-04',201914,4,2019,4,14,201904,2019), -('2019-04-05',201914,4,2019,5,14,201904,2019), -('2019-04-06',201914,4,2019,6,14,201904,2019), -('2019-04-07',201915,4,2019,7,15,201904,2019), -('2019-04-08',201915,4,2019,8,15,201904,2019), -('2019-04-09',201915,4,2019,9,15,201904,2019), -('2019-04-10',201915,4,2019,10,15,201904,2019), -('2019-04-11',201915,4,2019,11,15,201904,2019), -('2019-04-12',201915,4,2019,12,15,201904,2019), -('2019-04-13',201915,4,2019,13,15,201904,2019), -('2019-04-14',201916,4,2019,14,16,201904,2019), -('2019-04-15',201916,4,2019,15,16,201904,2019), -('2019-04-16',201916,4,2019,16,16,201904,2019), -('2019-04-17',201916,4,2019,17,16,201904,2019), -('2019-04-18',201916,4,2019,18,16,201904,2019), -('2019-04-19',201916,4,2019,19,16,201904,2019), -('2019-04-20',201916,4,2019,20,16,201904,2019), -('2019-04-21',201917,4,2019,21,17,201904,2019), -('2019-04-22',201917,4,2019,22,17,201904,2019), -('2019-04-23',201917,4,2019,23,17,201904,2019), -('2019-04-24',201917,4,2019,24,17,201904,2019), -('2019-04-25',201917,4,2019,25,17,201904,2019), -('2019-04-26',201917,4,2019,26,17,201904,2019), -('2019-04-27',201917,4,2019,27,17,201904,2019), -('2019-04-28',201918,4,2019,28,18,201904,2019), -('2019-04-29',201918,4,2019,29,18,201904,2019), -('2019-04-30',201918,4,2019,30,18,201904,2019), -('2019-05-01',201918,5,2019,1,18,201905,2019), -('2019-05-02',201918,5,2019,2,18,201905,2019), -('2019-05-03',201918,5,2019,3,18,201905,2019), -('2019-05-04',201918,5,2019,4,18,201905,2019), -('2019-05-05',201919,5,2019,5,19,201905,2019), -('2019-05-06',201919,5,2019,6,19,201905,2019), -('2019-05-07',201919,5,2019,7,19,201905,2019), -('2019-05-08',201919,5,2019,8,19,201905,2019), -('2019-05-09',201919,5,2019,9,19,201905,2019), -('2019-05-10',201919,5,2019,10,19,201905,2019), -('2019-05-11',201919,5,2019,11,19,201905,2019), -('2019-05-12',201920,5,2019,12,20,201905,2019), -('2019-05-13',201920,5,2019,13,20,201905,2019), -('2019-05-14',201920,5,2019,14,20,201905,2019), -('2019-05-15',201920,5,2019,15,20,201905,2019), -('2019-05-16',201920,5,2019,16,20,201905,2019), -('2019-05-17',201920,5,2019,17,20,201905,2019), -('2019-05-18',201920,5,2019,18,20,201905,2019), -('2019-05-19',201921,5,2019,19,21,201905,2019), -('2019-05-20',201921,5,2019,20,21,201905,2019), -('2019-05-21',201921,5,2019,21,21,201905,2019), -('2019-05-22',201921,5,2019,22,21,201905,2019), -('2019-05-23',201921,5,2019,23,21,201905,2019), -('2019-05-24',201921,5,2019,24,21,201905,2019), -('2019-05-25',201921,5,2019,25,21,201905,2019), -('2019-05-26',201922,5,2019,26,22,201905,2019), -('2019-05-27',201922,5,2019,27,22,201905,2019), -('2019-05-28',201922,5,2019,28,22,201905,2019), -('2019-05-29',201922,5,2019,29,22,201905,2019), -('2019-05-30',201922,5,2019,30,22,201905,2019), -('2019-05-31',201922,5,2019,31,22,201905,2019), -('2019-06-01',201922,6,2019,1,22,201906,2019), -('2019-06-02',201923,6,2019,2,23,201906,2019), -('2019-06-03',201923,6,2019,3,23,201906,2019), -('2019-06-04',201923,6,2019,4,23,201906,2019), -('2019-06-05',201923,6,2019,5,23,201906,2019), -('2019-06-06',201923,6,2019,6,23,201906,2019), -('2019-06-07',201923,6,2019,7,23,201906,2019), -('2019-06-08',201923,6,2019,8,23,201906,2019), -('2019-06-09',201924,6,2019,9,24,201906,2019), -('2019-06-10',201924,6,2019,10,24,201906,2019), -('2019-06-11',201924,6,2019,11,24,201906,2019), -('2019-06-12',201924,6,2019,12,24,201906,2019), -('2019-06-13',201924,6,2019,13,24,201906,2019), -('2019-06-14',201924,6,2019,14,24,201906,2019), -('2019-06-15',201924,6,2019,15,24,201906,2019), -('2019-06-16',201925,6,2019,16,25,201906,2019), -('2019-06-17',201925,6,2019,17,25,201906,2019), -('2019-06-18',201925,6,2019,18,25,201906,2019), -('2019-06-19',201925,6,2019,19,25,201906,2019), -('2019-06-20',201925,6,2019,20,25,201906,2019), -('2019-06-21',201925,6,2019,21,25,201906,2019), -('2019-06-22',201925,6,2019,22,25,201906,2019), -('2019-06-23',201926,6,2019,23,26,201906,2019), -('2019-06-24',201926,6,2019,24,26,201906,2019), -('2019-06-25',201926,6,2019,25,26,201906,2019), -('2019-06-26',201926,6,2019,26,26,201906,2019), -('2019-06-27',201926,6,2019,27,26,201906,2019), -('2019-06-28',201926,6,2019,28,26,201906,2019), -('2019-06-29',201926,6,2019,29,26,201906,2019), -('2019-06-30',201927,6,2019,30,27,201906,2019), -('2019-07-01',201927,7,2019,1,27,201907,2019), -('2019-07-02',201927,7,2019,2,27,201907,2019), -('2019-07-03',201927,7,2019,3,27,201907,2019), -('2019-07-04',201927,7,2019,4,27,201907,2019), -('2019-07-05',201927,7,2019,5,27,201907,2019), -('2019-07-06',201927,7,2019,6,27,201907,2019), -('2019-07-07',201928,7,2019,7,28,201907,2019), -('2019-07-08',201928,7,2019,8,28,201907,2019), -('2019-07-09',201928,7,2019,9,28,201907,2019), -('2019-07-10',201928,7,2019,10,28,201907,2019), -('2019-07-11',201928,7,2019,11,28,201907,2019), -('2019-07-12',201928,7,2019,12,28,201907,2019), -('2019-07-13',201928,7,2019,13,28,201907,2019), -('2019-07-14',201929,7,2019,14,29,201907,2019), -('2019-07-15',201929,7,2019,15,29,201907,2019), -('2019-07-16',201929,7,2019,16,29,201907,2019), -('2019-07-17',201929,7,2019,17,29,201907,2019), -('2019-07-18',201929,7,2019,18,29,201907,2019), -('2019-07-19',201929,7,2019,19,29,201907,2019), -('2019-07-20',201929,7,2019,20,29,201907,2019), -('2019-07-21',201930,7,2019,21,30,201907,2019), -('2019-07-22',201930,7,2019,22,30,201907,2019), -('2019-07-23',201930,7,2019,23,30,201907,2019), -('2019-07-24',201930,7,2019,24,30,201907,2019), -('2019-07-25',201930,7,2019,25,30,201907,2019), -('2019-07-26',201930,7,2019,26,30,201907,2019), -('2019-07-27',201930,7,2019,27,30,201907,2019), -('2019-07-28',201931,7,2019,28,31,201907,2019), -('2019-07-29',201931,7,2019,29,31,201907,2019), -('2019-07-30',201931,7,2019,30,31,201907,2019), -('2019-07-31',201931,7,2019,31,31,201907,2019), -('2019-08-01',201931,8,2019,1,31,201908,2019), -('2019-08-02',201931,8,2019,2,31,201908,2019), -('2019-08-03',201931,8,2019,3,31,201908,2019), -('2019-08-04',201932,8,2019,4,32,201908,2019), -('2019-08-05',201932,8,2019,5,32,201908,2019), -('2019-08-06',201932,8,2019,6,32,201908,2019), -('2019-08-07',201932,8,2019,7,32,201908,2019), -('2019-08-08',201932,8,2019,8,32,201908,2019), -('2019-08-09',201932,8,2019,9,32,201908,2019), -('2019-08-10',201932,8,2019,10,32,201908,2019), -('2019-08-11',201933,8,2019,11,33,201908,2019), -('2019-08-12',201933,8,2019,12,33,201908,2019), -('2019-08-13',201933,8,2019,13,33,201908,2019), -('2019-08-14',201933,8,2019,14,33,201908,2019), -('2019-08-15',201933,8,2019,15,33,201908,2019), -('2019-08-16',201933,8,2019,16,33,201908,2019), -('2019-08-17',201933,8,2019,17,33,201908,2019), -('2019-08-18',201934,8,2019,18,34,201908,2019), -('2019-08-19',201934,8,2019,19,34,201908,2019), -('2019-08-20',201934,8,2019,20,34,201908,2019), -('2019-08-21',201934,8,2019,21,34,201908,2019), -('2019-08-22',201934,8,2019,22,34,201908,2019), -('2019-08-23',201934,8,2019,23,34,201908,2019), -('2019-08-24',201934,8,2019,24,34,201908,2019), -('2019-08-25',201935,8,2019,25,35,201908,2019), -('2019-08-26',201935,8,2019,26,35,201908,2019), -('2019-08-27',201935,8,2019,27,35,201908,2019), -('2019-08-28',201935,8,2019,28,35,201908,2019), -('2019-08-29',201935,8,2019,29,35,201908,2019), -('2019-08-30',201935,8,2019,30,35,201908,2019), -('2019-08-31',201935,8,2019,31,35,201908,2019), -('2019-09-01',201936,9,2019,1,36,201909,2019), -('2019-09-02',201936,9,2019,2,36,201909,2019), -('2019-09-03',201936,9,2019,3,36,201909,2019), -('2019-09-04',201936,9,2019,4,36,201909,2019), -('2019-09-05',201936,9,2019,5,36,201909,2019), -('2019-09-06',201936,9,2019,6,36,201909,2019), -('2019-09-07',201936,9,2019,7,36,201909,2019), -('2019-09-08',201937,9,2019,8,37,201909,2019), -('2019-09-09',201937,9,2019,9,37,201909,2019), -('2019-09-10',201937,9,2019,10,37,201909,2019), -('2019-09-11',201937,9,2019,11,37,201909,2019), -('2019-09-12',201937,9,2019,12,37,201909,2019), -('2019-09-13',201937,9,2019,13,37,201909,2019), -('2019-09-14',201937,9,2019,14,37,201909,2019), -('2019-09-15',201938,9,2019,15,38,201909,2019), -('2019-09-16',201938,9,2019,16,38,201909,2019), -('2019-09-17',201938,9,2019,17,38,201909,2019), -('2019-09-18',201938,9,2019,18,38,201909,2019), -('2019-09-19',201938,9,2019,19,38,201909,2019), -('2019-09-20',201938,9,2019,20,38,201909,2019), -('2019-09-21',201938,9,2019,21,38,201909,2019), -('2019-09-22',201939,9,2019,22,39,201909,2019), -('2019-09-23',201939,9,2019,23,39,201909,2019), -('2019-09-24',201939,9,2019,24,39,201909,2019), -('2019-09-25',201939,9,2019,25,39,201909,2019), -('2019-09-26',201939,9,2019,26,39,201909,2019), -('2019-09-27',201939,9,2019,27,39,201909,2019), -('2019-09-28',201939,9,2019,28,39,201909,2019), -('2019-09-29',201940,9,2019,29,40,201909,2019), -('2019-09-30',201940,9,2019,30,40,201909,2019), -('2019-10-01',201940,10,2019,1,40,201910,2019), -('2019-10-02',201940,10,2019,2,40,201910,2019), -('2019-10-03',201940,10,2019,3,40,201910,2019), -('2019-10-04',201940,10,2019,4,40,201910,2019), -('2019-10-05',201940,10,2019,5,40,201910,2019), -('2019-10-06',201941,10,2019,6,41,201910,2019), -('2019-10-07',201941,10,2019,7,41,201910,2019), -('2019-10-08',201941,10,2019,8,41,201910,2019), -('2019-10-09',201941,10,2019,9,41,201910,2019), -('2019-10-10',201941,10,2019,10,41,201910,2019), -('2019-10-11',201941,10,2019,11,41,201910,2019), -('2019-10-12',201941,10,2019,12,41,201910,2019), -('2019-10-13',201942,10,2019,13,42,201910,2019), -('2019-10-14',201942,10,2019,14,42,201910,2019), -('2019-10-15',201942,10,2019,15,42,201910,2019), -('2019-10-16',201942,10,2019,16,42,201910,2019), -('2019-10-17',201942,10,2019,17,42,201910,2019), -('2019-10-18',201942,10,2019,18,42,201910,2019), -('2019-10-19',201942,10,2019,19,42,201910,2019), -('2019-10-20',201943,10,2019,20,43,201910,2019), -('2019-10-21',201943,10,2019,21,43,201910,2019), -('2019-10-22',201943,10,2019,22,43,201910,2019), -('2019-10-23',201943,10,2019,23,43,201910,2019), -('2019-10-24',201943,10,2019,24,43,201910,2019), -('2019-10-25',201943,10,2019,25,43,201910,2019), -('2019-10-26',201943,10,2019,26,43,201910,2019), -('2019-10-27',201944,10,2019,27,44,201910,2019), -('2019-10-28',201944,10,2019,28,44,201910,2019), -('2019-10-29',201944,10,2019,29,44,201910,2019), -('2019-10-30',201944,10,2019,30,44,201910,2019), -('2019-10-31',201944,10,2019,31,44,201910,2019), -('2019-11-01',201944,11,2019,1,44,201911,2019), -('2019-11-02',201944,11,2019,2,44,201911,2019), -('2019-11-03',201945,11,2019,3,45,201911,2019), -('2019-11-04',201945,11,2019,4,45,201911,2019), -('2019-11-05',201945,11,2019,5,45,201911,2019), -('2019-11-06',201945,11,2019,6,45,201911,2019), -('2019-11-07',201945,11,2019,7,45,201911,2019), -('2019-11-08',201945,11,2019,8,45,201911,2019), -('2019-11-09',201945,11,2019,9,45,201911,2019), -('2019-11-10',201946,11,2019,10,46,201911,2019), -('2019-11-11',201946,11,2019,11,46,201911,2019), -('2019-11-12',201946,11,2019,12,46,201911,2019), -('2019-11-13',201946,11,2019,13,46,201911,2019), -('2019-11-14',201946,11,2019,14,46,201911,2019), -('2019-11-15',201946,11,2019,15,46,201911,2019), -('2019-11-16',201946,11,2019,16,46,201911,2019), -('2019-11-17',201947,11,2019,17,47,201911,2019), -('2019-11-18',201947,11,2019,18,47,201911,2019), -('2019-11-19',201947,11,2019,19,47,201911,2019), -('2019-11-20',201947,11,2019,20,47,201911,2019), -('2019-11-21',201947,11,2019,21,47,201911,2019), -('2019-11-22',201947,11,2019,22,47,201911,2019), -('2019-11-23',201947,11,2019,23,47,201911,2019), -('2019-11-24',201948,11,2019,24,48,201911,2019), -('2019-11-25',201948,11,2019,25,48,201911,2019), -('2019-11-26',201948,11,2019,26,48,201911,2019), -('2019-11-27',201948,11,2019,27,48,201911,2019), -('2019-11-28',201948,11,2019,28,48,201911,2019), -('2019-11-29',201948,11,2019,29,48,201911,2019), -('2019-11-30',201948,11,2019,30,48,201911,2019), -('2019-12-01',201949,12,2019,1,49,201912,2020), -('2019-12-02',201949,12,2019,2,49,201912,2020), -('2019-12-03',201949,12,2019,3,49,201912,2020), -('2019-12-04',201949,12,2019,4,49,201912,2020), -('2019-12-05',201949,12,2019,5,49,201912,2020), -('2019-12-06',201949,12,2019,6,49,201912,2020), -('2019-12-07',201949,12,2019,7,49,201912,2020), -('2019-12-08',201950,12,2019,8,50,201912,2020), -('2019-12-09',201950,12,2019,9,50,201912,2020), -('2019-12-10',201950,12,2019,10,50,201912,2020), -('2019-12-11',201950,12,2019,11,50,201912,2020), -('2019-12-12',201950,12,2019,12,50,201912,2020), -('2019-12-13',201950,12,2019,13,50,201912,2020), -('2019-12-14',201950,12,2019,14,50,201912,2020), -('2019-12-15',201951,12,2019,15,51,201912,2020), -('2019-12-16',201951,12,2019,16,51,201912,2020), -('2019-12-17',201951,12,2019,17,51,201912,2020), -('2019-12-18',201951,12,2019,18,51,201912,2020), -('2019-12-19',201951,12,2019,19,51,201912,2020), -('2019-12-20',201951,12,2019,20,51,201912,2020), -('2019-12-21',201951,12,2019,21,51,201912,2020), -('2019-12-22',201952,12,2019,22,52,201912,2020), -('2019-12-23',201952,12,2019,23,52,201912,2020), -('2019-12-24',201952,12,2019,24,52,201912,2020), -('2019-12-25',201952,12,2019,25,52,201912,2020), -('2019-12-26',201952,12,2019,26,52,201912,2020), -('2019-12-27',201952,12,2019,27,52,201912,2020), -('2019-12-28',201952,12,2019,28,52,201912,2020), -('2019-12-29',201953,12,2019,29,1,201912,2020), -('2019-12-30',201953,12,2019,30,1,201912,2020), -('2019-12-31',201953,12,2019,31,1,201912,2020), -('2020-01-01',201953,1,2020,1,1,202001,2020), -('2020-01-02',201953,1,2020,2,1,202001,2020), -('2020-01-03',201953,1,2020,3,1,202001,2020), -('2020-01-04',201953,1,2020,4,1,202001,2020), -('2020-01-05',202001,1,2020,5,2,202001,2020), -('2020-01-06',202001,1,2020,6,2,202001,2020), -('2020-01-07',202001,1,2020,7,2,202001,2020), -('2020-01-08',202001,1,2020,8,2,202001,2020), -('2020-01-09',202001,1,2020,9,2,202001,2020), -('2020-01-10',202001,1,2020,10,2,202001,2020), -('2020-01-11',202001,1,2020,11,2,202001,2020), -('2020-01-12',202002,1,2020,12,3,202001,2020), -('2020-01-13',202002,1,2020,13,3,202001,2020), -('2020-01-14',202002,1,2020,14,3,202001,2020), -('2020-01-15',202002,1,2020,15,3,202001,2020), -('2020-01-16',202002,1,2020,16,3,202001,2020), -('2020-01-17',202002,1,2020,17,3,202001,2020), -('2020-01-18',202002,1,2020,18,3,202001,2020), -('2020-01-19',202003,1,2020,19,4,202001,2020), -('2020-01-20',202003,1,2020,20,4,202001,2020), -('2020-01-21',202003,1,2020,21,4,202001,2020), -('2020-01-22',202003,1,2020,22,4,202001,2020), -('2020-01-23',202003,1,2020,23,4,202001,2020), -('2020-01-24',202003,1,2020,24,4,202001,2020), -('2020-01-25',202003,1,2020,25,4,202001,2020), -('2020-01-26',202004,1,2020,26,5,202001,2020), -('2020-01-27',202004,1,2020,27,5,202001,2020), -('2020-01-28',202004,1,2020,28,5,202001,2020), -('2020-01-29',202004,1,2020,29,5,202001,2020), -('2020-01-30',202004,1,2020,30,5,202001,2020), -('2020-01-31',202004,1,2020,31,5,202001,2020), -('2020-02-01',202004,2,2020,1,5,202002,2020), -('2020-02-02',202005,2,2020,2,6,202002,2020), -('2020-02-03',202005,2,2020,3,6,202002,2020), -('2020-02-04',202005,2,2020,4,6,202002,2020), -('2020-02-05',202005,2,2020,5,6,202002,2020), -('2020-02-06',202005,2,2020,6,6,202002,2020), -('2020-02-07',202005,2,2020,7,6,202002,2020), -('2020-02-08',202005,2,2020,8,6,202002,2020), -('2020-02-09',202006,2,2020,9,7,202002,2020), -('2020-02-10',202006,2,2020,10,7,202002,2020), -('2020-02-11',202006,2,2020,11,7,202002,2020), -('2020-02-12',202006,2,2020,12,7,202002,2020), -('2020-02-13',202006,2,2020,13,7,202002,2020), -('2020-02-14',202006,2,2020,14,7,202002,2020), -('2020-02-15',202006,2,2020,15,7,202002,2020), -('2020-02-16',202007,2,2020,16,8,202002,2020), -('2020-02-17',202007,2,2020,17,8,202002,2020), -('2020-02-18',202007,2,2020,18,8,202002,2020), -('2020-02-19',202007,2,2020,19,8,202002,2020), -('2020-02-20',202007,2,2020,20,8,202002,2020), -('2020-02-21',202007,2,2020,21,8,202002,2020), -('2020-02-22',202007,2,2020,22,8,202002,2020), -('2020-02-23',202008,2,2020,23,9,202002,2020), -('2020-02-24',202008,2,2020,24,9,202002,2020), -('2020-02-25',202008,2,2020,25,9,202002,2020), -('2020-02-26',202008,2,2020,26,9,202002,2020), -('2020-02-27',202008,2,2020,27,9,202002,2020), -('2020-02-28',202008,2,2020,28,9,202002,2020), -('2020-02-29',202008,2,2020,29,9,202002,2020), -('2020-03-01',202009,3,2020,1,10,202003,2020), -('2020-03-02',202009,3,2020,2,10,202003,2020), -('2020-03-03',202009,3,2020,3,10,202003,2020), -('2020-03-04',202009,3,2020,4,10,202003,2020), -('2020-03-05',202009,3,2020,5,10,202003,2020), -('2020-03-06',202009,3,2020,6,10,202003,2020), -('2020-03-07',202009,3,2020,7,10,202003,2020), -('2020-03-08',202010,3,2020,8,11,202003,2020), -('2020-03-09',202010,3,2020,9,11,202003,2020), -('2020-03-10',202010,3,2020,10,11,202003,2020), -('2020-03-11',202010,3,2020,11,11,202003,2020), -('2020-03-12',202010,3,2020,12,11,202003,2020), -('2020-03-13',202010,3,2020,13,11,202003,2020), -('2020-03-14',202010,3,2020,14,11,202003,2020), -('2020-03-15',202011,3,2020,15,12,202003,2020), -('2020-03-16',202011,3,2020,16,12,202003,2020), -('2020-03-17',202011,3,2020,17,12,202003,2020), -('2020-03-18',202011,3,2020,18,12,202003,2020), -('2020-03-19',202011,3,2020,19,12,202003,2020), -('2020-03-20',202011,3,2020,20,12,202003,2020), -('2020-03-21',202011,3,2020,21,12,202003,2020), -('2020-03-22',202012,3,2020,22,13,202003,2020), -('2020-03-23',202012,3,2020,23,13,202003,2020), -('2020-03-24',202012,3,2020,24,13,202003,2020), -('2020-03-25',202012,3,2020,25,13,202003,2020), -('2020-03-26',202012,3,2020,26,13,202003,2020), -('2020-03-27',202012,3,2020,27,13,202003,2020), -('2020-03-28',202012,3,2020,28,13,202003,2020), -('2020-03-29',202013,3,2020,29,14,202003,2020), -('2020-03-30',202013,3,2020,30,14,202003,2020), -('2020-03-31',202013,3,2020,31,14,202003,2020), -('2020-04-01',202013,4,2020,1,14,202004,2020), -('2020-04-02',202013,4,2020,2,14,202004,2020), -('2020-04-03',202013,4,2020,3,14,202004,2020), -('2020-04-04',202013,4,2020,4,14,202004,2020), -('2020-04-05',202014,4,2020,5,15,202004,2020), -('2020-04-06',202014,4,2020,6,15,202004,2020), -('2020-04-07',202014,4,2020,7,15,202004,2020), -('2020-04-08',202014,4,2020,8,15,202004,2020), -('2020-04-09',202014,4,2020,9,15,202004,2020), -('2020-04-10',202014,4,2020,10,15,202004,2020), -('2020-04-11',202014,4,2020,11,15,202004,2020), -('2020-04-12',202015,4,2020,12,16,202004,2020), -('2020-04-13',202015,4,2020,13,16,202004,2020), -('2020-04-14',202015,4,2020,14,16,202004,2020), -('2020-04-15',202015,4,2020,15,16,202004,2020), -('2020-04-16',202015,4,2020,16,16,202004,2020), -('2020-04-17',202015,4,2020,17,16,202004,2020), -('2020-04-18',202015,4,2020,18,16,202004,2020), -('2020-04-19',202016,4,2020,19,17,202004,2020), -('2020-04-20',202016,4,2020,20,17,202004,2020), -('2020-04-21',202016,4,2020,21,17,202004,2020), -('2020-04-22',202016,4,2020,22,17,202004,2020), -('2020-04-23',202016,4,2020,23,17,202004,2020), -('2020-04-24',202016,4,2020,24,17,202004,2020), -('2020-04-25',202016,4,2020,25,17,202004,2020), -('2020-04-26',202017,4,2020,26,18,202004,2020), -('2020-04-27',202017,4,2020,27,18,202004,2020), -('2020-04-28',202017,4,2020,28,18,202004,2020), -('2020-04-29',202017,4,2020,29,18,202004,2020), -('2020-04-30',202017,4,2020,30,18,202004,2020), -('2020-05-01',202017,5,2020,1,18,202005,2020), -('2020-05-02',202017,5,2020,2,18,202005,2020), -('2020-05-03',202018,5,2020,3,19,202005,2020), -('2020-05-04',202018,5,2020,4,19,202005,2020), -('2020-05-05',202018,5,2020,5,19,202005,2020), -('2020-05-06',202018,5,2020,6,19,202005,2020), -('2020-05-07',202018,5,2020,7,19,202005,2020), -('2020-05-08',202018,5,2020,8,19,202005,2020), -('2020-05-09',202018,5,2020,9,19,202005,2020), -('2020-05-10',202019,5,2020,10,20,202005,2020), -('2020-05-11',202019,5,2020,11,20,202005,2020), -('2020-05-12',202019,5,2020,12,20,202005,2020), -('2020-05-13',202019,5,2020,13,20,202005,2020), -('2020-05-14',202019,5,2020,14,20,202005,2020), -('2020-05-15',202019,5,2020,15,20,202005,2020), -('2020-05-16',202019,5,2020,16,20,202005,2020), -('2020-05-17',202020,5,2020,17,21,202005,2020), -('2020-05-18',202020,5,2020,18,21,202005,2020), -('2020-05-19',202020,5,2020,19,21,202005,2020), -('2020-05-20',202020,5,2020,20,21,202005,2020), -('2020-05-21',202020,5,2020,21,21,202005,2020), -('2020-05-22',202020,5,2020,22,21,202005,2020), -('2020-05-23',202020,5,2020,23,21,202005,2020), -('2020-05-24',202021,5,2020,24,22,202005,2020), -('2020-05-25',202021,5,2020,25,22,202005,2020), -('2020-05-26',202021,5,2020,26,22,202005,2020), -('2020-05-27',202021,5,2020,27,22,202005,2020), -('2020-05-28',202021,5,2020,28,22,202005,2020), -('2020-05-29',202021,5,2020,29,22,202005,2020), -('2020-05-30',202021,5,2020,30,22,202005,2020), -('2020-05-31',202022,5,2020,31,23,202005,2020), -('2020-06-01',202022,6,2020,1,23,202006,2020), -('2020-06-02',202022,6,2020,2,23,202006,2020), -('2020-06-03',202022,6,2020,3,23,202006,2020), -('2020-06-04',202022,6,2020,4,23,202006,2020), -('2020-06-05',202022,6,2020,5,23,202006,2020), -('2020-06-06',202022,6,2020,6,23,202006,2020), -('2020-06-07',202023,6,2020,7,24,202006,2020), -('2020-06-08',202023,6,2020,8,24,202006,2020), -('2020-06-09',202023,6,2020,9,24,202006,2020), -('2020-06-10',202023,6,2020,10,24,202006,2020), -('2020-06-11',202023,6,2020,11,24,202006,2020), -('2020-06-12',202023,6,2020,12,24,202006,2020), -('2020-06-13',202023,6,2020,13,24,202006,2020), -('2020-06-14',202024,6,2020,14,25,202006,2020), -('2020-06-15',202024,6,2020,15,25,202006,2020), -('2020-06-16',202024,6,2020,16,25,202006,2020), -('2020-06-17',202024,6,2020,17,25,202006,2020), -('2020-06-18',202024,6,2020,18,25,202006,2020), -('2020-06-19',202024,6,2020,19,25,202006,2020), -('2020-06-20',202024,6,2020,20,25,202006,2020), -('2020-06-21',202025,6,2020,21,26,202006,2020), -('2020-06-22',202025,6,2020,22,26,202006,2020), -('2020-06-23',202025,6,2020,23,26,202006,2020), -('2020-06-24',202025,6,2020,24,26,202006,2020), -('2020-06-25',202025,6,2020,25,26,202006,2020), -('2020-06-26',202025,6,2020,26,26,202006,2020), -('2020-06-27',202025,6,2020,27,26,202006,2020), -('2020-06-28',202026,6,2020,28,27,202006,2020), -('2020-06-29',202026,6,2020,29,27,202006,2020), -('2020-06-30',202026,6,2020,30,27,202006,2020), -('2020-07-01',202026,7,2020,1,27,202007,2020), -('2020-07-02',202026,7,2020,2,27,202007,2020), -('2020-07-03',202026,7,2020,3,27,202007,2020), -('2020-07-04',202026,7,2020,4,27,202007,2020), -('2020-07-05',202027,7,2020,5,28,202007,2020), -('2020-07-06',202027,7,2020,6,28,202007,2020), -('2020-07-07',202027,7,2020,7,28,202007,2020), -('2020-07-08',202027,7,2020,8,28,202007,2020), -('2020-07-09',202027,7,2020,9,28,202007,2020), -('2020-07-10',202027,7,2020,10,28,202007,2020), -('2020-07-11',202027,7,2020,11,28,202007,2020), -('2020-07-12',202028,7,2020,12,29,202007,2020), -('2020-07-13',202028,7,2020,13,29,202007,2020), -('2020-07-14',202028,7,2020,14,29,202007,2020), -('2020-07-15',202028,7,2020,15,29,202007,2020), -('2020-07-16',202028,7,2020,16,29,202007,2020), -('2020-07-17',202028,7,2020,17,29,202007,2020), -('2020-07-18',202028,7,2020,18,29,202007,2020), -('2020-07-19',202029,7,2020,19,30,202007,2020), -('2020-07-20',202029,7,2020,20,30,202007,2020), -('2020-07-21',202029,7,2020,21,30,202007,2020), -('2020-07-22',202029,7,2020,22,30,202007,2020), -('2020-07-23',202029,7,2020,23,30,202007,2020), -('2020-07-24',202029,7,2020,24,30,202007,2020), -('2020-07-25',202029,7,2020,25,30,202007,2020), -('2020-07-26',202030,7,2020,26,31,202007,2020), -('2020-07-27',202030,7,2020,27,31,202007,2020), -('2020-07-28',202030,7,2020,28,31,202007,2020), -('2020-07-29',202030,7,2020,29,31,202007,2020), -('2020-07-30',202030,7,2020,30,31,202007,2020), -('2020-07-31',202030,7,2020,31,31,202007,2020), -('2020-08-01',202030,8,2020,1,31,202008,2020), -('2020-08-02',202031,8,2020,2,32,202008,2020), -('2020-08-03',202031,8,2020,3,32,202008,2020), -('2020-08-04',202031,8,2020,4,32,202008,2020), -('2020-08-05',202031,8,2020,5,32,202008,2020), -('2020-08-06',202031,8,2020,6,32,202008,2020), -('2020-08-07',202031,8,2020,7,32,202008,2020), -('2020-08-08',202031,8,2020,8,32,202008,2020), -('2020-08-09',202032,8,2020,9,33,202008,2020), -('2020-08-10',202032,8,2020,10,33,202008,2020), -('2020-08-11',202032,8,2020,11,33,202008,2020), -('2020-08-12',202032,8,2020,12,33,202008,2020), -('2020-08-13',202032,8,2020,13,33,202008,2020), -('2020-08-14',202032,8,2020,14,33,202008,2020), -('2020-08-15',202032,8,2020,15,33,202008,2020), -('2020-08-16',202033,8,2020,16,34,202008,2020), -('2020-08-17',202033,8,2020,17,34,202008,2020), -('2020-08-18',202033,8,2020,18,34,202008,2020), -('2020-08-19',202033,8,2020,19,34,202008,2020), -('2020-08-20',202033,8,2020,20,34,202008,2020), -('2020-08-21',202033,8,2020,21,34,202008,2020), -('2020-08-22',202033,8,2020,22,34,202008,2020), -('2020-08-23',202034,8,2020,23,35,202008,2020), -('2020-08-24',202034,8,2020,24,35,202008,2020), -('2020-08-25',202034,8,2020,25,35,202008,2020), -('2020-08-26',202034,8,2020,26,35,202008,2020), -('2020-08-27',202034,8,2020,27,35,202008,2020), -('2020-08-28',202034,8,2020,28,35,202008,2020), -('2020-08-29',202034,8,2020,29,35,202008,2020), -('2020-08-30',202035,8,2020,30,36,202008,2020), -('2020-08-31',202035,8,2020,31,36,202008,2020), -('2020-09-01',202035,9,2020,1,36,202009,2020), -('2020-09-02',202035,9,2020,2,36,202009,2020), -('2020-09-03',202035,9,2020,3,36,202009,2020), -('2020-09-04',202035,9,2020,4,36,202009,2020), -('2020-09-05',202035,9,2020,5,36,202009,2020), -('2020-09-06',202036,9,2020,6,37,202009,2020), -('2020-09-07',202036,9,2020,7,37,202009,2020), -('2020-09-08',202036,9,2020,8,37,202009,2020), -('2020-09-09',202036,9,2020,9,37,202009,2020), -('2020-09-10',202036,9,2020,10,37,202009,2020), -('2020-09-11',202036,9,2020,11,37,202009,2020), -('2020-09-12',202036,9,2020,12,37,202009,2020), -('2020-09-13',202037,9,2020,13,38,202009,2020), -('2020-09-14',202037,9,2020,14,38,202009,2020), -('2020-09-15',202037,9,2020,15,38,202009,2020), -('2020-09-16',202037,9,2020,16,38,202009,2020), -('2020-09-17',202037,9,2020,17,38,202009,2020), -('2020-09-18',202037,9,2020,18,38,202009,2020), -('2020-09-19',202037,9,2020,19,38,202009,2020), -('2020-09-20',202038,9,2020,20,39,202009,2020), -('2020-09-21',202038,9,2020,21,39,202009,2020), -('2020-09-22',202038,9,2020,22,39,202009,2020), -('2020-09-23',202038,9,2020,23,39,202009,2020), -('2020-09-24',202038,9,2020,24,39,202009,2020), -('2020-09-25',202038,9,2020,25,39,202009,2020), -('2020-09-26',202038,9,2020,26,39,202009,2020), -('2020-09-27',202039,9,2020,27,40,202009,2020), -('2020-09-28',202039,9,2020,28,40,202009,2020), -('2020-09-29',202039,9,2020,29,40,202009,2020), -('2020-09-30',202039,9,2020,30,40,202009,2020), -('2020-10-01',202039,10,2020,1,40,202010,2020), -('2020-10-02',202039,10,2020,2,40,202010,2020), -('2020-10-03',202039,10,2020,3,40,202010,2020), -('2020-10-04',202040,10,2020,4,41,202010,2020), -('2020-10-05',202040,10,2020,5,41,202010,2020), -('2020-10-06',202040,10,2020,6,41,202010,2020), -('2020-10-07',202040,10,2020,7,41,202010,2020), -('2020-10-08',202040,10,2020,8,41,202010,2020), -('2020-10-09',202040,10,2020,9,41,202010,2020), -('2020-10-10',202040,10,2020,10,41,202010,2020), -('2020-10-11',202041,10,2020,11,42,202010,2020), -('2020-10-12',202041,10,2020,12,42,202010,2020), -('2020-10-13',202041,10,2020,13,42,202010,2020), -('2020-10-14',202041,10,2020,14,42,202010,2020), -('2020-10-15',202041,10,2020,15,42,202010,2020), -('2020-10-16',202041,10,2020,16,42,202010,2020), -('2020-10-17',202041,10,2020,17,42,202010,2020), -('2020-10-18',202042,10,2020,18,43,202010,2020), -('2020-10-19',202042,10,2020,19,43,202010,2020), -('2020-10-20',202042,10,2020,20,43,202010,2020), -('2020-10-21',202042,10,2020,21,43,202010,2020), -('2020-10-22',202042,10,2020,22,43,202010,2020), -('2020-10-23',202042,10,2020,23,43,202010,2020), -('2020-10-24',202042,10,2020,24,43,202010,2020), -('2020-10-25',202043,10,2020,25,44,202010,2020), -('2020-10-26',202043,10,2020,26,44,202010,2020), -('2020-10-27',202043,10,2020,27,44,202010,2020), -('2020-10-28',202043,10,2020,28,44,202010,2020), -('2020-10-29',202043,10,2020,29,44,202010,2020), -('2020-10-30',202043,10,2020,30,44,202010,2020), -('2020-10-31',202043,10,2020,31,44,202010,2020), -('2020-11-01',202044,11,2020,1,45,202011,2020), -('2020-11-02',202044,11,2020,2,45,202011,2020), -('2020-11-03',202044,11,2020,3,45,202011,2020), -('2020-11-04',202044,11,2020,4,45,202011,2020), -('2020-11-05',202044,11,2020,5,45,202011,2020), -('2020-11-06',202044,11,2020,6,45,202011,2020), -('2020-11-07',202044,11,2020,7,45,202011,2020), -('2020-11-08',202045,11,2020,8,46,202011,2020), -('2020-11-09',202045,11,2020,9,46,202011,2020), -('2020-11-10',202045,11,2020,10,46,202011,2020), -('2020-11-11',202045,11,2020,11,46,202011,2020), -('2020-11-12',202045,11,2020,12,46,202011,2020), -('2020-11-13',202045,11,2020,13,46,202011,2020), -('2020-11-14',202045,11,2020,14,46,202011,2020), -('2020-11-15',202046,11,2020,15,47,202011,2020), -('2020-11-16',202046,11,2020,16,47,202011,2020), -('2020-11-17',202046,11,2020,17,47,202011,2020), -('2020-11-18',202046,11,2020,18,47,202011,2020), -('2020-11-19',202046,11,2020,19,47,202011,2020), -('2020-11-20',202046,11,2020,20,47,202011,2020), -('2020-11-21',202046,11,2020,21,47,202011,2020), -('2020-11-22',202047,11,2020,22,48,202011,2020), -('2020-11-23',202047,11,2020,23,48,202011,2020), -('2020-11-24',202047,11,2020,24,48,202011,2020), -('2020-11-25',202047,11,2020,25,48,202011,2020), -('2020-11-26',202047,11,2020,26,48,202011,2020), -('2020-11-27',202047,11,2020,27,48,202011,2020), -('2020-11-28',202047,11,2020,28,48,202011,2020), -('2020-11-29',202048,11,2020,29,49,202011,2020), -('2020-11-30',202048,11,2020,30,49,202011,2020), -('2020-12-01',202048,12,2020,1,49,202012,2021), -('2020-12-02',202048,12,2020,2,49,202012,2021), -('2020-12-03',202048,12,2020,3,49,202012,2021), -('2020-12-04',202048,12,2020,4,49,202012,2021), -('2020-12-05',202048,12,2020,5,49,202012,2021), -('2020-12-06',202049,12,2020,6,50,202012,2021), -('2020-12-07',202049,12,2020,7,50,202012,2021), -('2020-12-08',202049,12,2020,8,50,202012,2021), -('2020-12-09',202049,12,2020,9,50,202012,2021), -('2020-12-10',202049,12,2020,10,50,202012,2021), -('2020-12-11',202049,12,2020,11,50,202012,2021), -('2020-12-12',202049,12,2020,12,50,202012,2021), -('2020-12-13',202050,12,2020,13,51,202012,2021), -('2020-12-14',202050,12,2020,14,51,202012,2021), -('2020-12-15',202050,12,2020,15,51,202012,2021), -('2020-12-16',202050,12,2020,16,51,202012,2021), -('2020-12-17',202050,12,2020,17,51,202012,2021), -('2020-12-18',202050,12,2020,18,51,202012,2021), -('2020-12-19',202050,12,2020,19,51,202012,2021), -('2020-12-20',202051,12,2020,20,52,202012,2021), -('2020-12-21',202051,12,2020,21,52,202012,2021), -('2020-12-22',202051,12,2020,22,52,202012,2021), -('2020-12-23',202051,12,2020,23,52,202012,2021), -('2020-12-24',202051,12,2020,24,52,202012,2021), -('2020-12-25',202051,12,2020,25,52,202012,2021), -('2020-12-26',202051,12,2020,26,52,202012,2021), -('2020-12-27',202052,12,2020,27,53,202012,2021), -('2020-12-28',202052,12,2020,28,53,202012,2021), -('2020-12-29',202052,12,2020,29,53,202012,2021), -('2020-12-30',202052,12,2020,30,53,202012,2021), -('2020-12-31',202052,12,2020,31,53,202012,2021), -('2021-01-01',202101,1,2021,1,1,202101,2021), -('2021-01-02',202101,1,2021,2,1,202101,2021), -('2021-01-03',202101,1,2021,3,1,202101,2021), -('2021-01-04',202101,1,2021,4,1,202101,2021), -('2021-01-05',202101,1,2021,5,1,202101,2021), -('2021-01-06',202101,1,2021,6,1,202101,2021), -('2021-01-07',202101,1,2021,7,1,202101,2021), -('2021-01-08',202101,1,2021,8,1,202101,2021), -('2021-01-09',202101,1,2021,9,1,202101,2021), -('2021-01-10',202102,1,2021,10,2,202101,2021), -('2021-01-11',202102,1,2021,11,2,202101,2021), -('2021-01-12',202102,1,2021,12,2,202101,2021), -('2021-01-13',202102,1,2021,13,2,202101,2021), -('2021-01-14',202102,1,2021,14,2,202101,2021), -('2021-01-15',202102,1,2021,15,2,202101,2021), -('2021-01-16',202102,1,2021,16,2,202101,2021), -('2021-01-17',202103,1,2021,17,3,202101,2021), -('2021-01-18',202103,1,2021,18,3,202101,2021), -('2021-01-19',202103,1,2021,19,3,202101,2021), -('2021-01-20',202103,1,2021,20,3,202101,2021), -('2021-01-21',202103,1,2021,21,3,202101,2021), -('2021-01-22',202103,1,2021,22,3,202101,2021), -('2021-01-23',202103,1,2021,23,3,202101,2021), -('2021-01-24',202104,1,2021,24,4,202101,2021), -('2021-01-25',202104,1,2021,25,4,202101,2021), -('2021-01-26',202104,1,2021,26,4,202101,2021), -('2021-01-27',202104,1,2021,27,4,202101,2021), -('2021-01-28',202104,1,2021,28,4,202101,2021), -('2021-01-29',202104,1,2021,29,4,202101,2021), -('2021-01-30',202104,1,2021,30,4,202101,2021), -('2021-01-31',202105,1,2021,31,5,202101,2021), -('2021-02-01',202105,2,2021,1,5,202102,2021), -('2021-02-02',202105,2,2021,2,5,202102,2021), -('2021-02-03',202105,2,2021,3,5,202102,2021), -('2021-02-04',202105,2,2021,4,5,202102,2021), -('2021-02-05',202105,2,2021,5,5,202102,2021), -('2021-02-06',202105,2,2021,6,5,202102,2021), -('2021-02-07',202106,2,2021,7,6,202102,2021), -('2021-02-08',202106,2,2021,8,6,202102,2021), -('2021-02-09',202106,2,2021,9,6,202102,2021), -('2021-02-10',202106,2,2021,10,6,202102,2021), -('2021-02-11',202106,2,2021,11,6,202102,2021), -('2021-02-12',202106,2,2021,12,6,202102,2021), -('2021-02-13',202106,2,2021,13,6,202102,2021), -('2021-02-14',202107,2,2021,14,7,202102,2021), -('2021-02-15',202107,2,2021,15,7,202102,2021), -('2021-02-16',202107,2,2021,16,7,202102,2021), -('2021-02-17',202107,2,2021,17,7,202102,2021), -('2021-02-18',202107,2,2021,18,7,202102,2021), -('2021-02-19',202107,2,2021,19,7,202102,2021), -('2021-02-20',202107,2,2021,20,7,202102,2021), -('2021-02-21',202108,2,2021,21,8,202102,2021), -('2021-02-22',202108,2,2021,22,8,202102,2021), -('2021-02-23',202108,2,2021,23,8,202102,2021), -('2021-02-24',202108,2,2021,24,8,202102,2021), -('2021-02-25',202108,2,2021,25,8,202102,2021), -('2021-02-26',202108,2,2021,26,8,202102,2021), -('2021-02-27',202108,2,2021,27,8,202102,2021), -('2021-02-28',202109,2,2021,28,9,202102,2021), -('2021-03-01',202109,3,2021,1,9,202103,2021), -('2021-03-02',202109,3,2021,2,9,202103,2021), -('2021-03-03',202109,3,2021,3,9,202103,2021), -('2021-03-04',202109,3,2021,4,9,202103,2021), -('2021-03-05',202109,3,2021,5,9,202103,2021), -('2021-03-06',202109,3,2021,6,9,202103,2021), -('2021-03-07',202110,3,2021,7,10,202103,2021), -('2021-03-08',202110,3,2021,8,10,202103,2021), -('2021-03-09',202110,3,2021,9,10,202103,2021), -('2021-03-10',202110,3,2021,10,10,202103,2021), -('2021-03-11',202110,3,2021,11,10,202103,2021), -('2021-03-12',202110,3,2021,12,10,202103,2021), -('2021-03-13',202110,3,2021,13,10,202103,2021), -('2021-03-14',202111,3,2021,14,11,202103,2021), -('2021-03-15',202111,3,2021,15,11,202103,2021), -('2021-03-16',202111,3,2021,16,11,202103,2021), -('2021-03-17',202111,3,2021,17,11,202103,2021), -('2021-03-18',202111,3,2021,18,11,202103,2021), -('2021-03-19',202111,3,2021,19,11,202103,2021), -('2021-03-20',202111,3,2021,20,11,202103,2021), -('2021-03-21',202112,3,2021,21,12,202103,2021), -('2021-03-22',202112,3,2021,22,12,202103,2021), -('2021-03-23',202112,3,2021,23,12,202103,2021), -('2021-03-24',202112,3,2021,24,12,202103,2021), -('2021-03-25',202112,3,2021,25,12,202103,2021), -('2021-03-26',202112,3,2021,26,12,202103,2021), -('2021-03-27',202112,3,2021,27,12,202103,2021), -('2021-03-28',202113,3,2021,28,13,202103,2021), -('2021-03-29',202113,3,2021,29,13,202103,2021), -('2021-03-30',202113,3,2021,30,13,202103,2021), -('2021-03-31',202113,3,2021,31,13,202103,2021), -('2021-04-01',202113,4,2021,1,13,202104,2021), -('2021-04-02',202113,4,2021,2,13,202104,2021), -('2021-04-03',202113,4,2021,3,13,202104,2021), -('2021-04-04',202114,4,2021,4,14,202104,2021), -('2021-04-05',202114,4,2021,5,14,202104,2021), -('2021-04-06',202114,4,2021,6,14,202104,2021), -('2021-04-07',202114,4,2021,7,14,202104,2021), -('2021-04-08',202114,4,2021,8,14,202104,2021), -('2021-04-09',202114,4,2021,9,14,202104,2021), -('2021-04-10',202114,4,2021,10,14,202104,2021), -('2021-04-11',202115,4,2021,11,15,202104,2021), -('2021-04-12',202115,4,2021,12,15,202104,2021), -('2021-04-13',202115,4,2021,13,15,202104,2021), -('2021-04-14',202115,4,2021,14,15,202104,2021), -('2021-04-15',202115,4,2021,15,15,202104,2021), -('2021-04-16',202115,4,2021,16,15,202104,2021), -('2021-04-17',202115,4,2021,17,15,202104,2021), -('2021-04-18',202116,4,2021,18,16,202104,2021), -('2021-04-19',202116,4,2021,19,16,202104,2021), -('2021-04-20',202116,4,2021,20,16,202104,2021), -('2021-04-21',202116,4,2021,21,16,202104,2021), -('2021-04-22',202116,4,2021,22,16,202104,2021), -('2021-04-23',202116,4,2021,23,16,202104,2021), -('2021-04-24',202116,4,2021,24,16,202104,2021), -('2021-04-25',202117,4,2021,25,17,202104,2021), -('2021-04-26',202117,4,2021,26,17,202104,2021), -('2021-04-27',202117,4,2021,27,17,202104,2021), -('2021-04-28',202117,4,2021,28,17,202104,2021), -('2021-04-29',202117,4,2021,29,17,202104,2021), -('2021-04-30',202117,4,2021,30,17,202104,2021), -('2021-05-01',202117,5,2021,1,17,202105,2021), -('2021-05-02',202118,5,2021,2,18,202105,2021), -('2021-05-03',202118,5,2021,3,18,202105,2021), -('2021-05-04',202118,5,2021,4,18,202105,2021), -('2021-05-05',202118,5,2021,5,18,202105,2021), -('2021-05-06',202118,5,2021,6,18,202105,2021), -('2021-05-07',202118,5,2021,7,18,202105,2021), -('2021-05-08',202118,5,2021,8,18,202105,2021), -('2021-05-09',202119,5,2021,9,19,202105,2021), -('2021-05-10',202119,5,2021,10,19,202105,2021), -('2021-05-11',202119,5,2021,11,19,202105,2021), -('2021-05-12',202119,5,2021,12,19,202105,2021), -('2021-05-13',202119,5,2021,13,19,202105,2021), -('2021-05-14',202119,5,2021,14,19,202105,2021), -('2021-05-15',202119,5,2021,15,19,202105,2021), -('2021-05-16',202120,5,2021,16,20,202105,2021), -('2021-05-17',202120,5,2021,17,20,202105,2021), -('2021-05-18',202120,5,2021,18,20,202105,2021), -('2021-05-19',202120,5,2021,19,20,202105,2021), -('2021-05-20',202120,5,2021,20,20,202105,2021), -('2021-05-21',202120,5,2021,21,20,202105,2021), -('2021-05-22',202120,5,2021,22,20,202105,2021), -('2021-05-23',202121,5,2021,23,21,202105,2021), -('2021-05-24',202121,5,2021,24,21,202105,2021), -('2021-05-25',202121,5,2021,25,21,202105,2021), -('2021-05-26',202121,5,2021,26,21,202105,2021), -('2021-05-27',202121,5,2021,27,21,202105,2021), -('2021-05-28',202121,5,2021,28,21,202105,2021), -('2021-05-29',202121,5,2021,29,21,202105,2021), -('2021-05-30',202122,5,2021,30,22,202105,2021), -('2021-05-31',202122,5,2021,31,22,202105,2021), -('2021-06-01',202122,6,2021,1,22,202106,2021), -('2021-06-02',202122,6,2021,2,22,202106,2021), -('2021-06-03',202122,6,2021,3,22,202106,2021), -('2021-06-04',202122,6,2021,4,22,202106,2021), -('2021-06-05',202122,6,2021,5,22,202106,2021), -('2021-06-06',202123,6,2021,6,23,202106,2021), -('2021-06-07',202123,6,2021,7,23,202106,2021), -('2021-06-08',202123,6,2021,8,23,202106,2021), -('2021-06-09',202123,6,2021,9,23,202106,2021), -('2021-06-10',202123,6,2021,10,23,202106,2021), -('2021-06-11',202123,6,2021,11,23,202106,2021), -('2021-06-12',202123,6,2021,12,23,202106,2021), -('2021-06-13',202124,6,2021,13,24,202106,2021), -('2021-06-14',202124,6,2021,14,24,202106,2021), -('2021-06-15',202124,6,2021,15,24,202106,2021), -('2021-06-16',202124,6,2021,16,24,202106,2021), -('2021-06-17',202124,6,2021,17,24,202106,2021), -('2021-06-18',202124,6,2021,18,24,202106,2021), -('2021-06-19',202124,6,2021,19,24,202106,2021), -('2021-06-20',202125,6,2021,20,25,202106,2021), -('2021-06-21',202125,6,2021,21,25,202106,2021), -('2021-06-22',202125,6,2021,22,25,202106,2021), -('2021-06-23',202125,6,2021,23,25,202106,2021), -('2021-06-24',202125,6,2021,24,25,202106,2021), -('2021-06-25',202125,6,2021,25,25,202106,2021), -('2021-06-26',202125,6,2021,26,25,202106,2021), -('2021-06-27',202126,6,2021,27,26,202106,2021), -('2021-06-28',202126,6,2021,28,26,202106,2021), -('2021-06-29',202126,6,2021,29,26,202106,2021), -('2021-06-30',202126,6,2021,30,26,202106,2021), -('2021-07-01',202126,7,2021,1,26,202107,2021), -('2021-07-02',202126,7,2021,2,26,202107,2021), -('2021-07-03',202126,7,2021,3,26,202107,2021), -('2021-07-04',202127,7,2021,4,27,202107,2021), -('2021-07-05',202127,7,2021,5,27,202107,2021), -('2021-07-06',202127,7,2021,6,27,202107,2021), -('2021-07-07',202127,7,2021,7,27,202107,2021), -('2021-07-08',202127,7,2021,8,27,202107,2021), -('2021-07-09',202127,7,2021,9,27,202107,2021), -('2021-07-10',202127,7,2021,10,27,202107,2021), -('2021-07-11',202128,7,2021,11,28,202107,2021), -('2021-07-12',202128,7,2021,12,28,202107,2021), -('2021-07-13',202128,7,2021,13,28,202107,2021), -('2021-07-14',202128,7,2021,14,28,202107,2021), -('2021-07-15',202128,7,2021,15,28,202107,2021), -('2021-07-16',202128,7,2021,16,28,202107,2021), -('2021-07-17',202128,7,2021,17,28,202107,2021), -('2021-07-18',202129,7,2021,18,29,202107,2021), -('2021-07-19',202129,7,2021,19,29,202107,2021), -('2021-07-20',202129,7,2021,20,29,202107,2021), -('2021-07-21',202129,7,2021,21,29,202107,2021), -('2021-07-22',202129,7,2021,22,29,202107,2021), -('2021-07-23',202129,7,2021,23,29,202107,2021), -('2021-07-24',202129,7,2021,24,29,202107,2021), -('2021-07-25',202130,7,2021,25,30,202107,2021), -('2021-07-26',202130,7,2021,26,30,202107,2021), -('2021-07-27',202130,7,2021,27,30,202107,2021), -('2021-07-28',202130,7,2021,28,30,202107,2021), -('2021-07-29',202130,7,2021,29,30,202107,2021), -('2021-07-30',202130,7,2021,30,30,202107,2021), -('2021-07-31',202130,7,2021,31,30,202107,2021), -('2021-08-01',202131,8,2021,1,31,202108,2021), -('2021-08-02',202131,8,2021,2,31,202108,2021), -('2021-08-03',202131,8,2021,3,31,202108,2021), -('2021-08-04',202131,8,2021,4,31,202108,2021), -('2021-08-05',202131,8,2021,5,31,202108,2021), -('2021-08-06',202131,8,2021,6,31,202108,2021), -('2021-08-07',202131,8,2021,7,31,202108,2021), -('2021-08-08',202132,8,2021,8,32,202108,2021), -('2021-08-09',202132,8,2021,9,32,202108,2021), -('2021-08-10',202132,8,2021,10,32,202108,2021), -('2021-08-11',202132,8,2021,11,32,202108,2021), -('2021-08-12',202132,8,2021,12,32,202108,2021), -('2021-08-13',202132,8,2021,13,32,202108,2021), -('2021-08-14',202132,8,2021,14,32,202108,2021), -('2021-08-15',202133,8,2021,15,33,202108,2021), -('2021-08-16',202133,8,2021,16,33,202108,2021), -('2021-08-17',202133,8,2021,17,33,202108,2021), -('2021-08-18',202133,8,2021,18,33,202108,2021), -('2021-08-19',202133,8,2021,19,33,202108,2021), -('2021-08-20',202133,8,2021,20,33,202108,2021), -('2021-08-21',202133,8,2021,21,33,202108,2021), -('2021-08-22',202134,8,2021,22,34,202108,2021), -('2021-08-23',202134,8,2021,23,34,202108,2021), -('2021-08-24',202134,8,2021,24,34,202108,2021), -('2021-08-25',202134,8,2021,25,34,202108,2021), -('2021-08-26',202134,8,2021,26,34,202108,2021), -('2021-08-27',202134,8,2021,27,34,202108,2021), -('2021-08-28',202134,8,2021,28,34,202108,2021), -('2021-08-29',202135,8,2021,29,35,202108,2021), -('2021-08-30',202135,8,2021,30,35,202108,2021), -('2021-08-31',202135,8,2021,31,35,202108,2021), -('2021-09-01',202135,9,2021,1,35,202109,2021), -('2021-09-02',202135,9,2021,2,35,202109,2021), -('2021-09-03',202135,9,2021,3,35,202109,2021), -('2021-09-04',202135,9,2021,4,35,202109,2021), -('2021-09-05',202136,9,2021,5,36,202109,2021), -('2021-09-06',202136,9,2021,6,36,202109,2021), -('2021-09-07',202136,9,2021,7,36,202109,2021), -('2021-09-08',202136,9,2021,8,36,202109,2021), -('2021-09-09',202136,9,2021,9,36,202109,2021), -('2021-09-10',202136,9,2021,10,36,202109,2021), -('2021-09-11',202136,9,2021,11,36,202109,2021), -('2021-09-12',202137,9,2021,12,37,202109,2021), -('2021-09-13',202137,9,2021,13,37,202109,2021), -('2021-09-14',202137,9,2021,14,37,202109,2021), -('2021-09-15',202137,9,2021,15,37,202109,2021), -('2021-09-16',202137,9,2021,16,37,202109,2021), -('2021-09-17',202137,9,2021,17,37,202109,2021), -('2021-09-18',202137,9,2021,18,37,202109,2021), -('2021-09-19',202138,9,2021,19,38,202109,2021), -('2021-09-20',202138,9,2021,20,38,202109,2021), -('2021-09-21',202138,9,2021,21,38,202109,2021), -('2021-09-22',202138,9,2021,22,38,202109,2021), -('2021-09-23',202138,9,2021,23,38,202109,2021), -('2021-09-24',202138,9,2021,24,38,202109,2021), -('2021-09-25',202138,9,2021,25,38,202109,2021), -('2021-09-26',202139,9,2021,26,39,202109,2021), -('2021-09-27',202139,9,2021,27,39,202109,2021), -('2021-09-28',202139,9,2021,28,39,202109,2021), -('2021-09-29',202139,9,2021,29,39,202109,2021), -('2021-09-30',202139,9,2021,30,39,202109,2021), -('2021-10-01',202139,10,2021,1,39,202110,2021), -('2021-10-02',202139,10,2021,2,39,202110,2021), -('2021-10-03',202140,10,2021,3,40,202110,2021), -('2021-10-04',202140,10,2021,4,40,202110,2021), -('2021-10-05',202140,10,2021,5,40,202110,2021), -('2021-10-06',202140,10,2021,6,40,202110,2021), -('2021-10-07',202140,10,2021,7,40,202110,2021), -('2021-10-08',202140,10,2021,8,40,202110,2021), -('2021-10-09',202140,10,2021,9,40,202110,2021), -('2021-10-10',202141,10,2021,10,41,202110,2021), -('2021-10-11',202141,10,2021,11,41,202110,2021), -('2021-10-12',202141,10,2021,12,41,202110,2021), -('2021-10-13',202141,10,2021,13,41,202110,2021), -('2021-10-14',202141,10,2021,14,41,202110,2021), -('2021-10-15',202141,10,2021,15,41,202110,2021), -('2021-10-16',202141,10,2021,16,41,202110,2021), -('2021-10-17',202142,10,2021,17,42,202110,2021), -('2021-10-18',202142,10,2021,18,42,202110,2021), -('2021-10-19',202142,10,2021,19,42,202110,2021), -('2021-10-20',202142,10,2021,20,42,202110,2021), -('2021-10-21',202142,10,2021,21,42,202110,2021), -('2021-10-22',202142,10,2021,22,42,202110,2021), -('2021-10-23',202142,10,2021,23,42,202110,2021), -('2021-10-24',202143,10,2021,24,43,202110,2021), -('2021-10-25',202143,10,2021,25,43,202110,2021), -('2021-10-26',202143,10,2021,26,43,202110,2021), -('2021-10-27',202143,10,2021,27,43,202110,2021), -('2021-10-28',202143,10,2021,28,43,202110,2021), -('2021-10-29',202143,10,2021,29,43,202110,2021), -('2021-10-30',202143,10,2021,30,43,202110,2021), -('2021-10-31',202144,10,2021,31,44,202110,2021), -('2021-11-01',202144,11,2021,1,44,202111,2021), -('2021-11-02',202144,11,2021,2,44,202111,2021), -('2021-11-03',202144,11,2021,3,44,202111,2021), -('2021-11-04',202144,11,2021,4,44,202111,2021), -('2021-11-05',202144,11,2021,5,44,202111,2021), -('2021-11-06',202144,11,2021,6,44,202111,2021), -('2021-11-07',202145,11,2021,7,45,202111,2021), -('2021-11-08',202145,11,2021,8,45,202111,2021), -('2021-11-09',202145,11,2021,9,45,202111,2021), -('2021-11-10',202145,11,2021,10,45,202111,2021), -('2021-11-11',202145,11,2021,11,45,202111,2021), -('2021-11-12',202145,11,2021,12,45,202111,2021), -('2021-11-13',202145,11,2021,13,45,202111,2021), -('2021-11-14',202146,11,2021,14,46,202111,2021), -('2021-11-15',202146,11,2021,15,46,202111,2021), -('2021-11-16',202146,11,2021,16,46,202111,2021), -('2021-11-17',202146,11,2021,17,46,202111,2021), -('2021-11-18',202146,11,2021,18,46,202111,2021), -('2021-11-19',202146,11,2021,19,46,202111,2021), -('2021-11-20',202146,11,2021,20,46,202111,2021), -('2021-11-21',202147,11,2021,21,47,202111,2021), -('2021-11-22',202147,11,2021,22,47,202111,2021), -('2021-11-23',202147,11,2021,23,47,202111,2021), -('2021-11-24',202147,11,2021,24,47,202111,2021), -('2021-11-25',202147,11,2021,25,47,202111,2021), -('2021-11-26',202147,11,2021,26,47,202111,2021), -('2021-11-27',202147,11,2021,27,47,202111,2021), -('2021-11-28',202148,11,2021,28,48,202111,2021), -('2021-11-29',202148,11,2021,29,48,202111,2021), -('2021-11-30',202148,11,2021,30,48,202111,2021), -('2021-12-01',202148,12,2021,1,48,202112,2022), -('2021-12-02',202148,12,2021,2,48,202112,2022), -('2021-12-03',202148,12,2021,3,48,202112,2022), -('2021-12-04',202148,12,2021,4,48,202112,2022), -('2021-12-05',202149,12,2021,5,49,202112,2022), -('2021-12-06',202149,12,2021,6,49,202112,2022), -('2021-12-07',202149,12,2021,7,49,202112,2022), -('2021-12-08',202149,12,2021,8,49,202112,2022), -('2021-12-09',202149,12,2021,9,49,202112,2022), -('2021-12-10',202149,12,2021,10,49,202112,2022), -('2021-12-11',202149,12,2021,11,49,202112,2022), -('2021-12-12',202150,12,2021,12,50,202112,2022), -('2021-12-13',202150,12,2021,13,50,202112,2022), -('2021-12-14',202150,12,2021,14,50,202112,2022), -('2021-12-15',202150,12,2021,15,50,202112,2022), -('2021-12-16',202150,12,2021,16,50,202112,2022), -('2021-12-17',202150,12,2021,17,50,202112,2022), -('2021-12-18',202150,12,2021,18,50,202112,2022), -('2021-12-19',202151,12,2021,19,51,202112,2022), -('2021-12-20',202151,12,2021,20,51,202112,2022), -('2021-12-21',202151,12,2021,21,51,202112,2022), -('2021-12-22',202151,12,2021,22,51,202112,2022), -('2021-12-23',202151,12,2021,23,51,202112,2022), -('2021-12-24',202151,12,2021,24,51,202112,2022), -('2021-12-25',202151,12,2021,25,51,202112,2022), -('2021-12-26',202152,12,2021,26,52,202112,2022), -('2021-12-27',202152,12,2021,27,52,202112,2022), -('2021-12-28',202152,12,2021,28,52,202112,2022), -('2021-12-29',202152,12,2021,29,52,202112,2022), -('2021-12-30',202152,12,2021,30,52,202112,2022), -('2021-12-31',202152,12,2021,31,52,202112,2022), -('2022-01-01',202152,1,2022,1,52,202201,2022), -('2022-01-02',202201,1,2022,2,1,202201,2022), -('2022-01-03',202201,1,2022,3,1,202201,2022), -('2022-01-04',202201,1,2022,4,1,202201,2022), -('2022-01-05',202201,1,2022,5,1,202201,2022), -('2022-01-06',202201,1,2022,6,1,202201,2022), -('2022-01-07',202201,1,2022,7,1,202201,2022), -('2022-01-08',202201,1,2022,8,1,202201,2022), -('2022-01-09',202202,1,2022,9,2,202201,2022), -('2022-01-10',202202,1,2022,10,2,202201,2022), -('2022-01-11',202202,1,2022,11,2,202201,2022), -('2022-01-12',202202,1,2022,12,2,202201,2022), -('2022-01-13',202202,1,2022,13,2,202201,2022), -('2022-01-14',202202,1,2022,14,2,202201,2022), -('2022-01-15',202202,1,2022,15,2,202201,2022), -('2022-01-16',202203,1,2022,16,3,202201,2022), -('2022-01-17',202203,1,2022,17,3,202201,2022), -('2022-01-18',202203,1,2022,18,3,202201,2022), -('2022-01-19',202203,1,2022,19,3,202201,2022), -('2022-01-20',202203,1,2022,20,3,202201,2022), -('2022-01-21',202203,1,2022,21,3,202201,2022), -('2022-01-22',202203,1,2022,22,3,202201,2022), -('2022-01-23',202204,1,2022,23,4,202201,2022), -('2022-01-24',202204,1,2022,24,4,202201,2022), -('2022-01-25',202204,1,2022,25,4,202201,2022), -('2022-01-26',202204,1,2022,26,4,202201,2022), -('2022-01-27',202204,1,2022,27,4,202201,2022), -('2022-01-28',202204,1,2022,28,4,202201,2022), -('2022-01-29',202204,1,2022,29,4,202201,2022), -('2022-01-30',202205,1,2022,30,5,202201,2022), -('2022-01-31',202205,1,2022,31,5,202201,2022), -('2022-02-01',202205,2,2022,1,5,202202,2022), -('2022-02-02',202205,2,2022,2,5,202202,2022), -('2022-02-03',202205,2,2022,3,5,202202,2022), -('2022-02-04',202205,2,2022,4,5,202202,2022), -('2022-02-05',202205,2,2022,5,5,202202,2022), -('2022-02-06',202206,2,2022,6,6,202202,2022), -('2022-02-07',202206,2,2022,7,6,202202,2022), -('2022-02-08',202206,2,2022,8,6,202202,2022), -('2022-02-09',202206,2,2022,9,6,202202,2022), -('2022-02-10',202206,2,2022,10,6,202202,2022), -('2022-02-11',202206,2,2022,11,6,202202,2022), -('2022-02-12',202206,2,2022,12,6,202202,2022), -('2022-02-13',202207,2,2022,13,7,202202,2022), -('2022-02-14',202207,2,2022,14,7,202202,2022), -('2022-02-15',202207,2,2022,15,7,202202,2022), -('2022-02-16',202207,2,2022,16,7,202202,2022), -('2022-02-17',202207,2,2022,17,7,202202,2022), -('2022-02-18',202207,2,2022,18,7,202202,2022), -('2022-02-19',202207,2,2022,19,7,202202,2022), -('2022-02-20',202208,2,2022,20,8,202202,2022), -('2022-02-21',202208,2,2022,21,8,202202,2022), -('2022-02-22',202208,2,2022,22,8,202202,2022), -('2022-02-23',202208,2,2022,23,8,202202,2022), -('2022-02-24',202208,2,2022,24,8,202202,2022), -('2022-02-25',202208,2,2022,25,8,202202,2022), -('2022-02-26',202208,2,2022,26,8,202202,2022), -('2022-02-27',202209,2,2022,27,9,202202,2022), -('2022-02-28',202209,2,2022,28,9,202202,2022), -('2022-03-01',202209,3,2022,1,9,202203,2022), -('2022-03-02',202209,3,2022,2,9,202203,2022), -('2022-03-03',202209,3,2022,3,9,202203,2022), -('2022-03-04',202209,3,2022,4,9,202203,2022), -('2022-03-05',202209,3,2022,5,9,202203,2022), -('2022-03-06',202210,3,2022,6,10,202203,2022), -('2022-03-07',202210,3,2022,7,10,202203,2022), -('2022-03-08',202210,3,2022,8,10,202203,2022), -('2022-03-09',202210,3,2022,9,10,202203,2022), -('2022-03-10',202210,3,2022,10,10,202203,2022), -('2022-03-11',202210,3,2022,11,10,202203,2022), -('2022-03-12',202210,3,2022,12,10,202203,2022), -('2022-03-13',202211,3,2022,13,11,202203,2022), -('2022-03-14',202211,3,2022,14,11,202203,2022), -('2022-03-15',202211,3,2022,15,11,202203,2022), -('2022-03-16',202211,3,2022,16,11,202203,2022), -('2022-03-17',202211,3,2022,17,11,202203,2022), -('2022-03-18',202211,3,2022,18,11,202203,2022), -('2022-03-19',202211,3,2022,19,11,202203,2022), -('2022-03-20',202212,3,2022,20,12,202203,2022), -('2022-03-21',202212,3,2022,21,12,202203,2022), -('2022-03-22',202212,3,2022,22,12,202203,2022), -('2022-03-23',202212,3,2022,23,12,202203,2022), -('2022-03-24',202212,3,2022,24,12,202203,2022), -('2022-03-25',202212,3,2022,25,12,202203,2022), -('2022-03-26',202212,3,2022,26,12,202203,2022), -('2022-03-27',202213,3,2022,27,13,202203,2022), -('2022-03-28',202213,3,2022,28,13,202203,2022), -('2022-03-29',202213,3,2022,29,13,202203,2022), -('2022-03-30',202213,3,2022,30,13,202203,2022), -('2022-03-31',202213,3,2022,31,13,202203,2022), -('2022-04-01',202213,4,2022,1,13,202204,2022), -('2022-04-02',202213,4,2022,2,13,202204,2022), -('2022-04-03',202214,4,2022,3,14,202204,2022), -('2022-04-04',202214,4,2022,4,14,202204,2022), -('2022-04-05',202214,4,2022,5,14,202204,2022), -('2022-04-06',202214,4,2022,6,14,202204,2022), -('2022-04-07',202214,4,2022,7,14,202204,2022), -('2022-04-08',202214,4,2022,8,14,202204,2022), -('2022-04-09',202214,4,2022,9,14,202204,2022), -('2022-04-10',202215,4,2022,10,15,202204,2022), -('2022-04-11',202215,4,2022,11,15,202204,2022), -('2022-04-12',202215,4,2022,12,15,202204,2022), -('2022-04-13',202215,4,2022,13,15,202204,2022), -('2022-04-14',202215,4,2022,14,15,202204,2022), -('2022-04-15',202215,4,2022,15,15,202204,2022), -('2022-04-16',202215,4,2022,16,15,202204,2022), -('2022-04-17',202216,4,2022,17,16,202204,2022), -('2022-04-18',202216,4,2022,18,16,202204,2022), -('2022-04-19',202216,4,2022,19,16,202204,2022), -('2022-04-20',202216,4,2022,20,16,202204,2022), -('2022-04-21',202216,4,2022,21,16,202204,2022), -('2022-04-22',202216,4,2022,22,16,202204,2022), -('2022-04-23',202216,4,2022,23,16,202204,2022), -('2022-04-24',202217,4,2022,24,17,202204,2022), -('2022-04-25',202217,4,2022,25,17,202204,2022), -('2022-04-26',202217,4,2022,26,17,202204,2022), -('2022-04-27',202217,4,2022,27,17,202204,2022), -('2022-04-28',202217,4,2022,28,17,202204,2022), -('2022-04-29',202217,4,2022,29,17,202204,2022), -('2022-04-30',202217,4,2022,30,17,202204,2022), -('2022-05-01',202218,5,2022,1,18,202205,2022), -('2022-05-02',202218,5,2022,2,18,202205,2022), -('2022-05-03',202218,5,2022,3,18,202205,2022), -('2022-05-04',202218,5,2022,4,18,202205,2022), -('2022-05-05',202218,5,2022,5,18,202205,2022), -('2022-05-06',202218,5,2022,6,18,202205,2022), -('2022-05-07',202218,5,2022,7,18,202205,2022), -('2022-05-08',202219,5,2022,8,19,202205,2022), -('2022-05-09',202219,5,2022,9,19,202205,2022), -('2022-05-10',202219,5,2022,10,19,202205,2022), -('2022-05-11',202219,5,2022,11,19,202205,2022), -('2022-05-12',202219,5,2022,12,19,202205,2022), -('2022-05-13',202219,5,2022,13,19,202205,2022), -('2022-05-14',202219,5,2022,14,19,202205,2022), -('2022-05-15',202220,5,2022,15,20,202205,2022), -('2022-05-16',202220,5,2022,16,20,202205,2022), -('2022-05-17',202220,5,2022,17,20,202205,2022), -('2022-05-18',202220,5,2022,18,20,202205,2022), -('2022-05-19',202220,5,2022,19,20,202205,2022), -('2022-05-20',202220,5,2022,20,20,202205,2022), -('2022-05-21',202220,5,2022,21,20,202205,2022), -('2022-05-22',202221,5,2022,22,21,202205,2022), -('2022-05-23',202221,5,2022,23,21,202205,2022), -('2022-05-24',202221,5,2022,24,21,202205,2022), -('2022-05-25',202221,5,2022,25,21,202205,2022), -('2022-05-26',202221,5,2022,26,21,202205,2022), -('2022-05-27',202221,5,2022,27,21,202205,2022), -('2022-05-28',202221,5,2022,28,21,202205,2022), -('2022-05-29',202222,5,2022,29,22,202205,2022), -('2022-05-30',202222,5,2022,30,22,202205,2022), -('2022-05-31',202222,5,2022,31,22,202205,2022), -('2022-06-01',202222,6,2022,1,22,202206,2022), -('2022-06-02',202222,6,2022,2,22,202206,2022), -('2022-06-03',202222,6,2022,3,22,202206,2022), -('2022-06-04',202222,6,2022,4,22,202206,2022), -('2022-06-05',202223,6,2022,5,23,202206,2022), -('2022-06-06',202223,6,2022,6,23,202206,2022), -('2022-06-07',202223,6,2022,7,23,202206,2022), -('2022-06-08',202223,6,2022,8,23,202206,2022), -('2022-06-09',202223,6,2022,9,23,202206,2022), -('2022-06-10',202223,6,2022,10,23,202206,2022), -('2022-06-11',202223,6,2022,11,23,202206,2022), -('2022-06-12',202224,6,2022,12,24,202206,2022), -('2022-06-13',202224,6,2022,13,24,202206,2022), -('2022-06-14',202224,6,2022,14,24,202206,2022), -('2022-06-15',202224,6,2022,15,24,202206,2022), -('2022-06-16',202224,6,2022,16,24,202206,2022), -('2022-06-17',202224,6,2022,17,24,202206,2022), -('2022-06-18',202224,6,2022,18,24,202206,2022), -('2022-06-19',202225,6,2022,19,25,202206,2022), -('2022-06-20',202225,6,2022,20,25,202206,2022), -('2022-06-21',202225,6,2022,21,25,202206,2022), -('2022-06-22',202225,6,2022,22,25,202206,2022), -('2022-06-23',202225,6,2022,23,25,202206,2022), -('2022-06-24',202225,6,2022,24,25,202206,2022), -('2022-06-25',202225,6,2022,25,25,202206,2022), -('2022-06-26',202226,6,2022,26,26,202206,2022), -('2022-06-27',202226,6,2022,27,26,202206,2022), -('2022-06-28',202226,6,2022,28,26,202206,2022), -('2022-06-29',202226,6,2022,29,26,202206,2022), -('2022-06-30',202226,6,2022,30,26,202206,2022), -('2022-07-01',202226,7,2022,1,26,202207,2022), -('2022-07-02',202226,7,2022,2,26,202207,2022), -('2022-07-03',202227,7,2022,3,27,202207,2022), -('2022-07-04',202227,7,2022,4,27,202207,2022), -('2022-07-05',202227,7,2022,5,27,202207,2022), -('2022-07-06',202227,7,2022,6,27,202207,2022), -('2022-07-07',202227,7,2022,7,27,202207,2022), -('2022-07-08',202227,7,2022,8,27,202207,2022), -('2022-07-09',202227,7,2022,9,27,202207,2022), -('2022-07-10',202228,7,2022,10,28,202207,2022), -('2022-07-11',202228,7,2022,11,28,202207,2022), -('2022-07-12',202228,7,2022,12,28,202207,2022), -('2022-07-13',202228,7,2022,13,28,202207,2022), -('2022-07-14',202228,7,2022,14,28,202207,2022), -('2022-07-15',202228,7,2022,15,28,202207,2022), -('2022-07-16',202228,7,2022,16,28,202207,2022), -('2022-07-17',202229,7,2022,17,29,202207,2022), -('2022-07-18',202229,7,2022,18,29,202207,2022), -('2022-07-19',202229,7,2022,19,29,202207,2022), -('2022-07-20',202229,7,2022,20,29,202207,2022), -('2022-07-21',202229,7,2022,21,29,202207,2022), -('2022-07-22',202229,7,2022,22,29,202207,2022), -('2022-07-23',202229,7,2022,23,29,202207,2022), -('2022-07-24',202230,7,2022,24,30,202207,2022), -('2022-07-25',202230,7,2022,25,30,202207,2022), -('2022-07-26',202230,7,2022,26,30,202207,2022), -('2022-07-27',202230,7,2022,27,30,202207,2022), -('2022-07-28',202230,7,2022,28,30,202207,2022), -('2022-07-29',202230,7,2022,29,30,202207,2022), -('2022-07-30',202230,7,2022,30,30,202207,2022), -('2022-07-31',202231,7,2022,31,31,202207,2022), -('2022-08-01',202231,8,2022,1,31,202208,2022), -('2022-08-02',202231,8,2022,2,31,202208,2022), -('2022-08-03',202231,8,2022,3,31,202208,2022), -('2022-08-04',202231,8,2022,4,31,202208,2022), -('2022-08-05',202231,8,2022,5,31,202208,2022), -('2022-08-06',202231,8,2022,6,31,202208,2022), -('2022-08-07',202232,8,2022,7,32,202208,2022), -('2022-08-08',202232,8,2022,8,32,202208,2022), -('2022-08-09',202232,8,2022,9,32,202208,2022), -('2022-08-10',202232,8,2022,10,32,202208,2022), -('2022-08-11',202232,8,2022,11,32,202208,2022), -('2022-08-12',202232,8,2022,12,32,202208,2022), -('2022-08-13',202232,8,2022,13,32,202208,2022), -('2022-08-14',202233,8,2022,14,33,202208,2022), -('2022-08-15',202233,8,2022,15,33,202208,2022), -('2022-08-16',202233,8,2022,16,33,202208,2022), -('2022-08-17',202233,8,2022,17,33,202208,2022), -('2022-08-18',202233,8,2022,18,33,202208,2022), -('2022-08-19',202233,8,2022,19,33,202208,2022), -('2022-08-20',202233,8,2022,20,33,202208,2022), -('2022-08-21',202234,8,2022,21,34,202208,2022), -('2022-08-22',202234,8,2022,22,34,202208,2022), -('2022-08-23',202234,8,2022,23,34,202208,2022), -('2022-08-24',202234,8,2022,24,34,202208,2022), -('2022-08-25',202234,8,2022,25,34,202208,2022), -('2022-08-26',202234,8,2022,26,34,202208,2022), -('2022-08-27',202234,8,2022,27,34,202208,2022), -('2022-08-28',202235,8,2022,28,35,202208,2022), -('2022-08-29',202235,8,2022,29,35,202208,2022), -('2022-08-30',202235,8,2022,30,35,202208,2022), -('2022-08-31',202235,8,2022,31,35,202208,2022), -('2022-09-01',202235,9,2022,1,35,202209,2022), -('2022-09-02',202235,9,2022,2,35,202209,2022), -('2022-09-03',202235,9,2022,3,35,202209,2022), -('2022-09-04',202236,9,2022,4,36,202209,2022), -('2022-09-05',202236,9,2022,5,36,202209,2022), -('2022-09-06',202236,9,2022,6,36,202209,2022), -('2022-09-07',202236,9,2022,7,36,202209,2022), -('2022-09-08',202236,9,2022,8,36,202209,2022), -('2022-09-09',202236,9,2022,9,36,202209,2022), -('2022-09-10',202236,9,2022,10,36,202209,2022), -('2022-09-11',202237,9,2022,11,37,202209,2022), -('2022-09-12',202237,9,2022,12,37,202209,2022), -('2022-09-13',202237,9,2022,13,37,202209,2022), -('2022-09-14',202237,9,2022,14,37,202209,2022), -('2022-09-15',202237,9,2022,15,37,202209,2022), -('2022-09-16',202237,9,2022,16,37,202209,2022), -('2022-09-17',202237,9,2022,17,37,202209,2022), -('2022-09-18',202238,9,2022,18,38,202209,2022), -('2022-09-19',202238,9,2022,19,38,202209,2022), -('2022-09-20',202238,9,2022,20,38,202209,2022), -('2022-09-21',202238,9,2022,21,38,202209,2022), -('2022-09-22',202238,9,2022,22,38,202209,2022), -('2022-09-23',202238,9,2022,23,38,202209,2022), -('2022-09-24',202238,9,2022,24,38,202209,2022), -('2022-09-25',202239,9,2022,25,39,202209,2022), -('2022-09-26',202239,9,2022,26,39,202209,2022), -('2022-09-27',202239,9,2022,27,39,202209,2022), -('2022-09-28',202239,9,2022,28,39,202209,2022), -('2022-09-29',202239,9,2022,29,39,202209,2022), -('2022-09-30',202239,9,2022,30,39,202209,2022), -('2022-10-01',202239,10,2022,1,39,202210,2022), -('2022-10-02',202240,10,2022,2,40,202210,2022), -('2022-10-03',202240,10,2022,3,40,202210,2022), -('2022-10-04',202240,10,2022,4,40,202210,2022), -('2022-10-05',202240,10,2022,5,40,202210,2022), -('2022-10-06',202240,10,2022,6,40,202210,2022), -('2022-10-07',202240,10,2022,7,40,202210,2022), -('2022-10-08',202240,10,2022,8,40,202210,2022), -('2022-10-09',202241,10,2022,9,41,202210,2022), -('2022-10-10',202241,10,2022,10,41,202210,2022), -('2022-10-11',202241,10,2022,11,41,202210,2022), -('2022-10-12',202241,10,2022,12,41,202210,2022), -('2022-10-13',202241,10,2022,13,41,202210,2022), -('2022-10-14',202241,10,2022,14,41,202210,2022), -('2022-10-15',202241,10,2022,15,41,202210,2022), -('2022-10-16',202242,10,2022,16,42,202210,2022), -('2022-10-17',202242,10,2022,17,42,202210,2022), -('2022-10-18',202242,10,2022,18,42,202210,2022), -('2022-10-19',202242,10,2022,19,42,202210,2022), -('2022-10-20',202242,10,2022,20,42,202210,2022), -('2022-10-21',202242,10,2022,21,42,202210,2022), -('2022-10-22',202242,10,2022,22,42,202210,2022), -('2022-10-23',202243,10,2022,23,43,202210,2022), -('2022-10-24',202243,10,2022,24,43,202210,2022), -('2022-10-25',202243,10,2022,25,43,202210,2022), -('2022-10-26',202243,10,2022,26,43,202210,2022), -('2022-10-27',202243,10,2022,27,43,202210,2022), -('2022-10-28',202243,10,2022,28,43,202210,2022), -('2022-10-29',202243,10,2022,29,43,202210,2022), -('2022-10-30',202244,10,2022,30,44,202210,2022), -('2022-10-31',202244,10,2022,31,44,202210,2022), -('2022-11-01',202244,11,2022,1,44,202211,2022), -('2022-11-02',202244,11,2022,2,44,202211,2022), -('2022-11-03',202244,11,2022,3,44,202211,2022), -('2022-11-04',202244,11,2022,4,44,202211,2022), -('2022-11-05',202244,11,2022,5,44,202211,2022), -('2022-11-06',202245,11,2022,6,45,202211,2022), -('2022-11-07',202245,11,2022,7,45,202211,2022), -('2022-11-08',202245,11,2022,8,45,202211,2022), -('2022-11-09',202245,11,2022,9,45,202211,2022), -('2022-11-10',202245,11,2022,10,45,202211,2022), -('2022-11-11',202245,11,2022,11,45,202211,2022), -('2022-11-12',202245,11,2022,12,45,202211,2022), -('2022-11-13',202246,11,2022,13,46,202211,2022), -('2022-11-14',202246,11,2022,14,46,202211,2022), -('2022-11-15',202246,11,2022,15,46,202211,2022), -('2022-11-16',202246,11,2022,16,46,202211,2022), -('2022-11-17',202246,11,2022,17,46,202211,2022), -('2022-11-18',202246,11,2022,18,46,202211,2022), -('2022-11-19',202246,11,2022,19,46,202211,2022), -('2022-11-20',202247,11,2022,20,47,202211,2022), -('2022-11-21',202247,11,2022,21,47,202211,2022), -('2022-11-22',202247,11,2022,22,47,202211,2022), -('2022-11-23',202247,11,2022,23,47,202211,2022), -('2022-11-24',202247,11,2022,24,47,202211,2022), -('2022-11-25',202247,11,2022,25,47,202211,2022), -('2022-11-26',202247,11,2022,26,47,202211,2022), -('2022-11-27',202248,11,2022,27,48,202211,2022), -('2022-11-28',202248,11,2022,28,48,202211,2022), -('2022-11-29',202248,11,2022,29,48,202211,2022), -('2022-11-30',202248,11,2022,30,48,202211,2022), -('2022-12-01',202248,12,2022,1,48,202212,2023), -('2022-12-02',202248,12,2022,2,48,202212,2023), -('2022-12-03',202248,12,2022,3,48,202212,2023), -('2022-12-04',202249,12,2022,4,49,202212,2023), -('2022-12-05',202249,12,2022,5,49,202212,2023), -('2022-12-06',202249,12,2022,6,49,202212,2023), -('2022-12-07',202249,12,2022,7,49,202212,2023), -('2022-12-08',202249,12,2022,8,49,202212,2023), -('2022-12-09',202249,12,2022,9,49,202212,2023), -('2022-12-10',202249,12,2022,10,49,202212,2023), -('2022-12-11',202250,12,2022,11,50,202212,2023), -('2022-12-12',202250,12,2022,12,50,202212,2023), -('2022-12-13',202250,12,2022,13,50,202212,2023), -('2022-12-14',202250,12,2022,14,50,202212,2023), -('2022-12-15',202250,12,2022,15,50,202212,2023), -('2022-12-16',202250,12,2022,16,50,202212,2023), -('2022-12-17',202250,12,2022,17,50,202212,2023), -('2022-12-18',202251,12,2022,18,51,202212,2023), -('2022-12-19',202251,12,2022,19,51,202212,2023), -('2022-12-20',202251,12,2022,20,51,202212,2023), -('2022-12-21',202251,12,2022,21,51,202212,2023), -('2022-12-22',202251,12,2022,22,51,202212,2023), -('2022-12-23',202251,12,2022,23,51,202212,2023), -('2022-12-24',202251,12,2022,24,51,202212,2023), -('2022-12-25',202252,12,2022,25,52,202212,2023), -('2022-12-26',202252,12,2022,26,52,202212,2023), -('2022-12-27',202252,12,2022,27,52,202212,2023), -('2022-12-28',202252,12,2022,28,52,202212,2023), -('2022-12-29',202252,12,2022,29,52,202212,2023), -('2022-12-30',202252,12,2022,30,52,202212,2023), -('2022-12-31',202252,12,2022,31,52,202212,2023), -('2023-01-01',202353,1,2023,1,1,202301,2023), -('2023-01-02',202301,1,2023,2,1,202301,2023), -('2023-01-03',202301,1,2023,3,1,202301,2023), -('2023-01-04',202301,1,2023,4,1,202301,2023), -('2023-01-05',202301,1,2023,5,1,202301,2023), -('2023-01-06',202301,1,2023,6,1,202301,2023), -('2023-01-07',202301,1,2023,7,1,202301,2023), -('2023-01-08',202302,1,2023,8,2,202301,2023), -('2023-01-09',202302,1,2023,9,2,202301,2023), -('2023-01-10',202302,1,2023,10,2,202301,2023), -('2023-01-11',202302,1,2023,11,2,202301,2023), -('2023-01-12',202302,1,2023,12,2,202301,2023), -('2023-01-13',202302,1,2023,13,2,202301,2023), -('2023-01-14',202302,1,2023,14,2,202301,2023), -('2023-01-15',202303,1,2023,15,3,202301,2023), -('2023-01-16',202303,1,2023,16,3,202301,2023), -('2023-01-17',202303,1,2023,17,3,202301,2023), -('2023-01-18',202303,1,2023,18,3,202301,2023), -('2023-01-19',202303,1,2023,19,3,202301,2023), -('2023-01-20',202303,1,2023,20,3,202301,2023), -('2023-01-21',202303,1,2023,21,3,202301,2023), -('2023-01-22',202304,1,2023,22,4,202301,2023), -('2023-01-23',202304,1,2023,23,4,202301,2023), -('2023-01-24',202304,1,2023,24,4,202301,2023), -('2023-01-25',202304,1,2023,25,4,202301,2023), -('2023-01-26',202304,1,2023,26,4,202301,2023), -('2023-01-27',202304,1,2023,27,4,202301,2023), -('2023-01-28',202304,1,2023,28,4,202301,2023), -('2023-01-29',202305,1,2023,29,5,202301,2023), -('2023-01-30',202305,1,2023,30,5,202301,2023), -('2023-01-31',202305,1,2023,31,5,202301,2023), -('2023-02-01',202305,2,2023,1,5,202302,2023), -('2023-02-02',202305,2,2023,2,5,202302,2023), -('2023-02-03',202305,2,2023,3,5,202302,2023), -('2023-02-04',202305,2,2023,4,5,202302,2023), -('2023-02-05',202306,2,2023,5,6,202302,2023), -('2023-02-06',202306,2,2023,6,6,202302,2023), -('2023-02-07',202306,2,2023,7,6,202302,2023), -('2023-02-08',202306,2,2023,8,6,202302,2023), -('2023-02-09',202306,2,2023,9,6,202302,2023), -('2023-02-10',202306,2,2023,10,6,202302,2023), -('2023-02-11',202306,2,2023,11,6,202302,2023), -('2023-02-12',202307,2,2023,12,7,202302,2023), -('2023-02-13',202307,2,2023,13,7,202302,2023), -('2023-02-14',202307,2,2023,14,7,202302,2023), -('2023-02-15',202307,2,2023,15,7,202302,2023), -('2023-02-16',202307,2,2023,16,7,202302,2023), -('2023-02-17',202307,2,2023,17,7,202302,2023), -('2023-02-18',202307,2,2023,18,7,202302,2023), -('2023-02-19',202308,2,2023,19,8,202302,2023), -('2023-02-20',202308,2,2023,20,8,202302,2023), -('2023-02-21',202308,2,2023,21,8,202302,2023), -('2023-02-22',202308,2,2023,22,8,202302,2023), -('2023-02-23',202308,2,2023,23,8,202302,2023), -('2023-02-24',202308,2,2023,24,8,202302,2023), -('2023-02-25',202308,2,2023,25,8,202302,2023), -('2023-02-26',202309,2,2023,26,9,202302,2023), -('2023-02-27',202309,2,2023,27,9,202302,2023), -('2023-02-28',202309,2,2023,28,9,202302,2023), -('2023-03-01',202309,3,2023,1,9,202303,2023), -('2023-03-02',202309,3,2023,2,9,202303,2023), -('2023-03-03',202309,3,2023,3,9,202303,2023), -('2023-03-04',202309,3,2023,4,9,202303,2023), -('2023-03-05',202310,3,2023,5,10,202303,2023), -('2023-03-06',202310,3,2023,6,10,202303,2023), -('2023-03-07',202310,3,2023,7,10,202303,2023), -('2023-03-08',202310,3,2023,8,10,202303,2023), -('2023-03-09',202310,3,2023,9,10,202303,2023), -('2023-03-10',202310,3,2023,10,10,202303,2023), -('2023-03-11',202310,3,2023,11,10,202303,2023), -('2023-03-12',202311,3,2023,12,11,202303,2023), -('2023-03-13',202311,3,2023,13,11,202303,2023), -('2023-03-14',202311,3,2023,14,11,202303,2023), -('2023-03-15',202311,3,2023,15,11,202303,2023), -('2023-03-16',202311,3,2023,16,11,202303,2023), -('2023-03-17',202311,3,2023,17,11,202303,2023), -('2023-03-18',202311,3,2023,18,11,202303,2023), -('2023-03-19',202312,3,2023,19,12,202303,2023), -('2023-03-20',202312,3,2023,20,12,202303,2023), -('2023-03-21',202312,3,2023,21,12,202303,2023), -('2023-03-22',202312,3,2023,22,12,202303,2023), -('2023-03-23',202312,3,2023,23,12,202303,2023), -('2023-03-24',202312,3,2023,24,12,202303,2023), -('2023-03-25',202312,3,2023,25,12,202303,2023), -('2023-03-26',202313,3,2023,26,13,202303,2023), -('2023-03-27',202313,3,2023,27,13,202303,2023), -('2023-03-28',202313,3,2023,28,13,202303,2023), -('2023-03-29',202313,3,2023,29,13,202303,2023), -('2023-03-30',202313,3,2023,30,13,202303,2023), -('2023-03-31',202313,3,2023,31,13,202303,2023), -('2023-04-01',202313,4,2023,1,13,202304,2023), -('2023-04-02',202314,4,2023,2,14,202304,2023), -('2023-04-03',202314,4,2023,3,14,202304,2023), -('2023-04-04',202314,4,2023,4,14,202304,2023), -('2023-04-05',202314,4,2023,5,14,202304,2023), -('2023-04-06',202314,4,2023,6,14,202304,2023), -('2023-04-07',202314,4,2023,7,14,202304,2023), -('2023-04-08',202314,4,2023,8,14,202304,2023), -('2023-04-09',202315,4,2023,9,15,202304,2023), -('2023-04-10',202315,4,2023,10,15,202304,2023), -('2023-04-11',202315,4,2023,11,15,202304,2023), -('2023-04-12',202315,4,2023,12,15,202304,2023), -('2023-04-13',202315,4,2023,13,15,202304,2023), -('2023-04-14',202315,4,2023,14,15,202304,2023), -('2023-04-15',202315,4,2023,15,15,202304,2023), -('2023-04-16',202316,4,2023,16,16,202304,2023), -('2023-04-17',202316,4,2023,17,16,202304,2023), -('2023-04-18',202316,4,2023,18,16,202304,2023), -('2023-04-19',202316,4,2023,19,16,202304,2023), -('2023-04-20',202316,4,2023,20,16,202304,2023), -('2023-04-21',202316,4,2023,21,16,202304,2023), -('2023-04-22',202316,4,2023,22,16,202304,2023), -('2023-04-23',202317,4,2023,23,17,202304,2023), -('2023-04-24',202317,4,2023,24,17,202304,2023), -('2023-04-25',202317,4,2023,25,17,202304,2023), -('2023-04-26',202317,4,2023,26,17,202304,2023), -('2023-04-27',202317,4,2023,27,17,202304,2023), -('2023-04-28',202317,4,2023,28,17,202304,2023), -('2023-04-29',202317,4,2023,29,17,202304,2023), -('2023-04-30',202318,4,2023,30,18,202304,2023), -('2023-05-01',202318,5,2023,1,18,202305,2023), -('2023-05-02',202318,5,2023,2,18,202305,2023), -('2023-05-03',202318,5,2023,3,18,202305,2023), -('2023-05-04',202318,5,2023,4,18,202305,2023), -('2023-05-05',202318,5,2023,5,18,202305,2023), -('2023-05-06',202318,5,2023,6,18,202305,2023), -('2023-05-07',202319,5,2023,7,19,202305,2023), -('2023-05-08',202319,5,2023,8,19,202305,2023), -('2023-05-09',202319,5,2023,9,19,202305,2023), -('2023-05-10',202319,5,2023,10,19,202305,2023), -('2023-05-11',202319,5,2023,11,19,202305,2023), -('2023-05-12',202319,5,2023,12,19,202305,2023), -('2023-05-13',202319,5,2023,13,19,202305,2023), -('2023-05-14',202320,5,2023,14,20,202305,2023), -('2023-05-15',202320,5,2023,15,20,202305,2023), -('2023-05-16',202320,5,2023,16,20,202305,2023), -('2023-05-17',202320,5,2023,17,20,202305,2023), -('2023-05-18',202320,5,2023,18,20,202305,2023), -('2023-05-19',202320,5,2023,19,20,202305,2023), -('2023-05-20',202320,5,2023,20,20,202305,2023), -('2023-05-21',202321,5,2023,21,21,202305,2023), -('2023-05-22',202321,5,2023,22,21,202305,2023), -('2023-05-23',202321,5,2023,23,21,202305,2023), -('2023-05-24',202321,5,2023,24,21,202305,2023), -('2023-05-25',202321,5,2023,25,21,202305,2023), -('2023-05-26',202321,5,2023,26,21,202305,2023), -('2023-05-27',202321,5,2023,27,21,202305,2023), -('2023-05-28',202322,5,2023,28,22,202305,2023), -('2023-05-29',202322,5,2023,29,22,202305,2023), -('2023-05-30',202322,5,2023,30,22,202305,2023), -('2023-05-31',202322,5,2023,31,22,202305,2023), -('2023-06-01',202322,6,2023,1,22,202306,2023), -('2023-06-02',202322,6,2023,2,22,202306,2023), -('2023-06-03',202322,6,2023,3,22,202306,2023), -('2023-06-04',202323,6,2023,4,23,202306,2023), -('2023-06-05',202323,6,2023,5,23,202306,2023), -('2023-06-06',202323,6,2023,6,23,202306,2023), -('2023-06-07',202323,6,2023,7,23,202306,2023), -('2023-06-08',202323,6,2023,8,23,202306,2023), -('2023-06-09',202323,6,2023,9,23,202306,2023), -('2023-06-10',202323,6,2023,10,23,202306,2023), -('2023-06-11',202324,6,2023,11,24,202306,2023), -('2023-06-12',202324,6,2023,12,24,202306,2023), -('2023-06-13',202324,6,2023,13,24,202306,2023), -('2023-06-14',202324,6,2023,14,24,202306,2023), -('2023-06-15',202324,6,2023,15,24,202306,2023), -('2023-06-16',202324,6,2023,16,24,202306,2023), -('2023-06-17',202324,6,2023,17,24,202306,2023), -('2023-06-18',202325,6,2023,18,25,202306,2023), -('2023-06-19',202325,6,2023,19,25,202306,2023), -('2023-06-20',202325,6,2023,20,25,202306,2023), -('2023-06-21',202325,6,2023,21,25,202306,2023), -('2023-06-22',202325,6,2023,22,25,202306,2023), -('2023-06-23',202325,6,2023,23,25,202306,2023), -('2023-06-24',202325,6,2023,24,25,202306,2023), -('2023-06-25',202326,6,2023,25,26,202306,2023), -('2023-06-26',202326,6,2023,26,26,202306,2023), -('2023-06-27',202326,6,2023,27,26,202306,2023), -('2023-06-28',202326,6,2023,28,26,202306,2023), -('2023-06-29',202326,6,2023,29,26,202306,2023), -('2023-06-30',202326,6,2023,30,26,202306,2023), -('2023-07-01',202326,7,2023,1,26,202307,2023), -('2023-07-02',202327,7,2023,2,27,202307,2023), -('2023-07-03',202327,7,2023,3,27,202307,2023), -('2023-07-04',202327,7,2023,4,27,202307,2023), -('2023-07-05',202327,7,2023,5,27,202307,2023), -('2023-07-06',202327,7,2023,6,27,202307,2023), -('2023-07-07',202327,7,2023,7,27,202307,2023), -('2023-07-08',202327,7,2023,8,27,202307,2023), -('2023-07-09',202328,7,2023,9,28,202307,2023), -('2023-07-10',202328,7,2023,10,28,202307,2023), -('2023-07-11',202328,7,2023,11,28,202307,2023), -('2023-07-12',202328,7,2023,12,28,202307,2023), -('2023-07-13',202328,7,2023,13,28,202307,2023), -('2023-07-14',202328,7,2023,14,28,202307,2023), -('2023-07-15',202328,7,2023,15,28,202307,2023), -('2023-07-16',202329,7,2023,16,29,202307,2023), -('2023-07-17',202329,7,2023,17,29,202307,2023), -('2023-07-18',202329,7,2023,18,29,202307,2023), -('2023-07-19',202329,7,2023,19,29,202307,2023), -('2023-07-20',202329,7,2023,20,29,202307,2023), -('2023-07-21',202329,7,2023,21,29,202307,2023), -('2023-07-22',202329,7,2023,22,29,202307,2023), -('2023-07-23',202330,7,2023,23,30,202307,2023), -('2023-07-24',202330,7,2023,24,30,202307,2023), -('2023-07-25',202330,7,2023,25,30,202307,2023), -('2023-07-26',202330,7,2023,26,30,202307,2023), -('2023-07-27',202330,7,2023,27,30,202307,2023), -('2023-07-28',202330,7,2023,28,30,202307,2023), -('2023-07-29',202330,7,2023,29,30,202307,2023), -('2023-07-30',202331,7,2023,30,31,202307,2023), -('2023-07-31',202331,7,2023,31,31,202307,2023), -('2023-08-01',202331,8,2023,1,31,202308,2023), -('2023-08-02',202331,8,2023,2,31,202308,2023), -('2023-08-03',202331,8,2023,3,31,202308,2023), -('2023-08-04',202331,8,2023,4,31,202308,2023), -('2023-08-05',202331,8,2023,5,31,202308,2023), -('2023-08-06',202332,8,2023,6,32,202308,2023), -('2023-08-07',202332,8,2023,7,32,202308,2023), -('2023-08-08',202332,8,2023,8,32,202308,2023), -('2023-08-09',202332,8,2023,9,32,202308,2023), -('2023-08-10',202332,8,2023,10,32,202308,2023), -('2023-08-11',202332,8,2023,11,32,202308,2023), -('2023-08-12',202332,8,2023,12,32,202308,2023), -('2023-08-13',202333,8,2023,13,33,202308,2023), -('2023-08-14',202333,8,2023,14,33,202308,2023), -('2023-08-15',202333,8,2023,15,33,202308,2023), -('2023-08-16',202333,8,2023,16,33,202308,2023), -('2023-08-17',202333,8,2023,17,33,202308,2023), -('2023-08-18',202333,8,2023,18,33,202308,2023), -('2023-08-19',202333,8,2023,19,33,202308,2023), -('2023-08-20',202334,8,2023,20,34,202308,2023), -('2023-08-21',202334,8,2023,21,34,202308,2023), -('2023-08-22',202334,8,2023,22,34,202308,2023), -('2023-08-23',202334,8,2023,23,34,202308,2023), -('2023-08-24',202334,8,2023,24,34,202308,2023), -('2023-08-25',202334,8,2023,25,34,202308,2023), -('2023-08-26',202334,8,2023,26,34,202308,2023), -('2023-08-27',202335,8,2023,27,35,202308,2023), -('2023-08-28',202335,8,2023,28,35,202308,2023), -('2023-08-29',202335,8,2023,29,35,202308,2023), -('2023-08-30',202335,8,2023,30,35,202308,2023), -('2023-08-31',202335,8,2023,31,35,202308,2023), -('2023-09-01',202335,9,2023,1,35,202309,2023), -('2023-09-02',202335,9,2023,2,35,202309,2023), -('2023-09-03',202336,9,2023,3,36,202309,2023), -('2023-09-04',202336,9,2023,4,36,202309,2023), -('2023-09-05',202336,9,2023,5,36,202309,2023), -('2023-09-06',202336,9,2023,6,36,202309,2023), -('2023-09-07',202336,9,2023,7,36,202309,2023), -('2023-09-08',202336,9,2023,8,36,202309,2023), -('2023-09-09',202336,9,2023,9,36,202309,2023), -('2023-09-10',202337,9,2023,10,37,202309,2023), -('2023-09-11',202337,9,2023,11,37,202309,2023), -('2023-09-12',202337,9,2023,12,37,202309,2023), -('2023-09-13',202337,9,2023,13,37,202309,2023), -('2023-09-14',202337,9,2023,14,37,202309,2023), -('2023-09-15',202337,9,2023,15,37,202309,2023), -('2023-09-16',202337,9,2023,16,37,202309,2023), -('2023-09-17',202338,9,2023,17,38,202309,2023), -('2023-09-18',202338,9,2023,18,38,202309,2023), -('2023-09-19',202338,9,2023,19,38,202309,2023), -('2023-09-20',202338,9,2023,20,38,202309,2023), -('2023-09-21',202338,9,2023,21,38,202309,2023), -('2023-09-22',202338,9,2023,22,38,202309,2023), -('2023-09-23',202338,9,2023,23,38,202309,2023), -('2023-09-24',202339,9,2023,24,39,202309,2023), -('2023-09-25',202339,9,2023,25,39,202309,2023), -('2023-09-26',202339,9,2023,26,39,202309,2023), -('2023-09-27',202339,9,2023,27,39,202309,2023), -('2023-09-28',202339,9,2023,28,39,202309,2023), -('2023-09-29',202339,9,2023,29,39,202309,2023), -('2023-09-30',202339,9,2023,30,39,202309,2023), -('2023-10-01',202340,10,2023,1,40,202310,2023), -('2023-10-02',202340,10,2023,2,40,202310,2023), -('2023-10-03',202340,10,2023,3,40,202310,2023), -('2023-10-04',202340,10,2023,4,40,202310,2023), -('2023-10-05',202340,10,2023,5,40,202310,2023), -('2023-10-06',202340,10,2023,6,40,202310,2023), -('2023-10-07',202340,10,2023,7,40,202310,2023), -('2023-10-08',202341,10,2023,8,41,202310,2023), -('2023-10-09',202341,10,2023,9,41,202310,2023), -('2023-10-10',202341,10,2023,10,41,202310,2023), -('2023-10-11',202341,10,2023,11,41,202310,2023), -('2023-10-12',202341,10,2023,12,41,202310,2023), -('2023-10-13',202341,10,2023,13,41,202310,2023), -('2023-10-14',202341,10,2023,14,41,202310,2023), -('2023-10-15',202342,10,2023,15,42,202310,2023), -('2023-10-16',202342,10,2023,16,42,202310,2023), -('2023-10-17',202342,10,2023,17,42,202310,2023), -('2023-10-18',202342,10,2023,18,42,202310,2023), -('2023-10-19',202342,10,2023,19,42,202310,2023), -('2023-10-20',202342,10,2023,20,42,202310,2023), -('2023-10-21',202342,10,2023,21,42,202310,2023), -('2023-10-22',202343,10,2023,22,43,202310,2023), -('2023-10-23',202343,10,2023,23,43,202310,2023), -('2023-10-24',202343,10,2023,24,43,202310,2023), -('2023-10-25',202343,10,2023,25,43,202310,2023), -('2023-10-26',202343,10,2023,26,43,202310,2023), -('2023-10-27',202343,10,2023,27,43,202310,2023), -('2023-10-28',202343,10,2023,28,43,202310,2023), -('2023-10-29',202344,10,2023,29,44,202310,2023), -('2023-10-30',202344,10,2023,30,44,202310,2023), -('2023-10-31',202344,10,2023,31,44,202310,2023), -('2023-11-01',202344,11,2023,1,44,202311,2023), -('2023-11-02',202344,11,2023,2,44,202311,2023), -('2023-11-03',202344,11,2023,3,44,202311,2023), -('2023-11-04',202344,11,2023,4,44,202311,2023), -('2023-11-05',202345,11,2023,5,45,202311,2023), -('2023-11-06',202345,11,2023,6,45,202311,2023), -('2023-11-07',202345,11,2023,7,45,202311,2023), -('2023-11-08',202345,11,2023,8,45,202311,2023), -('2023-11-09',202345,11,2023,9,45,202311,2023), -('2023-11-10',202345,11,2023,10,45,202311,2023), -('2023-11-11',202345,11,2023,11,45,202311,2023), -('2023-11-12',202346,11,2023,12,46,202311,2023), -('2023-11-13',202346,11,2023,13,46,202311,2023), -('2023-11-14',202346,11,2023,14,46,202311,2023), -('2023-11-15',202346,11,2023,15,46,202311,2023), -('2023-11-16',202346,11,2023,16,46,202311,2023), -('2023-11-17',202346,11,2023,17,46,202311,2023), -('2023-11-18',202346,11,2023,18,46,202311,2023), -('2023-11-19',202347,11,2023,19,47,202311,2023), -('2023-11-20',202347,11,2023,20,47,202311,2023), -('2023-11-21',202347,11,2023,21,47,202311,2023), -('2023-11-22',202347,11,2023,22,47,202311,2023), -('2023-11-23',202347,11,2023,23,47,202311,2023), -('2023-11-24',202347,11,2023,24,47,202311,2023), -('2023-11-25',202347,11,2023,25,47,202311,2023), -('2023-11-26',202348,11,2023,26,48,202311,2023), -('2023-11-27',202348,11,2023,27,48,202311,2023), -('2023-11-28',202348,11,2023,28,48,202311,2023), -('2023-11-29',202348,11,2023,29,48,202311,2023), -('2023-11-30',202348,11,2023,30,48,202311,2023), -('2023-12-01',202348,12,2023,1,48,202312,2024), -('2023-12-02',202348,12,2023,2,48,202312,2024), -('2023-12-03',202349,12,2023,3,49,202312,2024), -('2023-12-04',202349,12,2023,4,49,202312,2024), -('2023-12-05',202349,12,2023,5,49,202312,2024), -('2023-12-06',202349,12,2023,6,49,202312,2024), -('2023-12-07',202349,12,2023,7,49,202312,2024), -('2023-12-08',202349,12,2023,8,49,202312,2024), -('2023-12-09',202349,12,2023,9,49,202312,2024), -('2023-12-10',202350,12,2023,10,50,202312,2024), -('2023-12-11',202350,12,2023,11,50,202312,2024), -('2023-12-12',202350,12,2023,12,50,202312,2024), -('2023-12-13',202350,12,2023,13,50,202312,2024), -('2023-12-14',202350,12,2023,14,50,202312,2024), -('2023-12-15',202350,12,2023,15,50,202312,2024), -('2023-12-16',202350,12,2023,16,50,202312,2024), -('2023-12-17',202351,12,2023,17,51,202312,2024), -('2023-12-18',202351,12,2023,18,51,202312,2024), -('2023-12-19',202351,12,2023,19,51,202312,2024), -('2023-12-20',202351,12,2023,20,51,202312,2024), -('2023-12-21',202351,12,2023,21,51,202312,2024), -('2023-12-22',202351,12,2023,22,51,202312,2024), -('2023-12-23',202351,12,2023,23,51,202312,2024), -('2023-12-24',202352,12,2023,24,52,202312,2024), -('2023-12-25',202352,12,2023,25,52,202312,2024), -('2023-12-26',202352,12,2023,26,52,202312,2024), -('2023-12-27',202352,12,2023,27,52,202312,2024), -('2023-12-28',202352,12,2023,28,52,202312,2024), -('2023-12-29',202352,12,2023,29,52,202312,2024), -('2023-12-30',202352,12,2023,30,52,202312,2024), -('2023-12-31',202353,12,2023,31,1,202312,2024), -('2024-01-01',202401,1,2024,1,1,202401,2024), -('2024-01-02',202401,1,2024,2,1,202401,2024), -('2024-01-03',202401,1,2024,3,1,202401,2024), -('2024-01-04',202401,1,2024,4,1,202401,2024), -('2024-01-05',202401,1,2024,5,1,202401,2024), -('2024-01-06',202401,1,2024,6,1,202401,2024), -('2024-01-07',202402,1,2024,7,2,202401,2024), -('2024-01-08',202402,1,2024,8,2,202401,2024), -('2024-01-09',202402,1,2024,9,2,202401,2024), -('2024-01-10',202402,1,2024,10,2,202401,2024), -('2024-01-11',202402,1,2024,11,2,202401,2024), -('2024-01-12',202402,1,2024,12,2,202401,2024), -('2024-01-13',202402,1,2024,13,2,202401,2024), -('2024-01-14',202403,1,2024,14,3,202401,2024), -('2024-01-15',202403,1,2024,15,3,202401,2024), -('2024-01-16',202403,1,2024,16,3,202401,2024), -('2024-01-17',202403,1,2024,17,3,202401,2024), -('2024-01-18',202403,1,2024,18,3,202401,2024), -('2024-01-19',202403,1,2024,19,3,202401,2024), -('2024-01-20',202403,1,2024,20,3,202401,2024), -('2024-01-21',202404,1,2024,21,4,202401,2024), -('2024-01-22',202404,1,2024,22,4,202401,2024), -('2024-01-23',202404,1,2024,23,4,202401,2024), -('2024-01-24',202404,1,2024,24,4,202401,2024), -('2024-01-25',202404,1,2024,25,4,202401,2024), -('2024-01-26',202404,1,2024,26,4,202401,2024), -('2024-01-27',202404,1,2024,27,4,202401,2024), -('2024-01-28',202405,1,2024,28,5,202401,2024), -('2024-01-29',202405,1,2024,29,5,202401,2024), -('2024-01-30',202405,1,2024,30,5,202401,2024), -('2024-01-31',202405,1,2024,31,5,202401,2024), -('2024-02-01',202405,2,2024,1,5,202402,2024), -('2024-02-02',202405,2,2024,2,5,202402,2024), -('2024-02-03',202405,2,2024,3,5,202402,2024), -('2024-02-04',202406,2,2024,4,6,202402,2024), -('2024-02-05',202406,2,2024,5,6,202402,2024), -('2024-02-06',202406,2,2024,6,6,202402,2024), -('2024-02-07',202406,2,2024,7,6,202402,2024), -('2024-02-08',202406,2,2024,8,6,202402,2024), -('2024-02-09',202406,2,2024,9,6,202402,2024), -('2024-02-10',202406,2,2024,10,6,202402,2024), -('2024-02-11',202407,2,2024,11,7,202402,2024), -('2024-02-12',202407,2,2024,12,7,202402,2024), -('2024-02-13',202407,2,2024,13,7,202402,2024), -('2024-02-14',202407,2,2024,14,7,202402,2024), -('2024-02-15',202407,2,2024,15,7,202402,2024), -('2024-02-16',202407,2,2024,16,7,202402,2024), -('2024-02-17',202407,2,2024,17,7,202402,2024), -('2024-02-18',202408,2,2024,18,8,202402,2024), -('2024-02-19',202408,2,2024,19,8,202402,2024), -('2024-02-20',202408,2,2024,20,8,202402,2024), -('2024-02-21',202408,2,2024,21,8,202402,2024), -('2024-02-22',202408,2,2024,22,8,202402,2024), -('2024-02-23',202408,2,2024,23,8,202402,2024), -('2024-02-24',202408,2,2024,24,8,202402,2024), -('2024-02-25',202409,2,2024,25,9,202402,2024), -('2024-02-26',202409,2,2024,26,9,202402,2024), -('2024-02-27',202409,2,2024,27,9,202402,2024), -('2024-02-28',202409,2,2024,28,9,202402,2024), -('2024-02-29',202409,2,2024,29,9,202402,2024), -('2024-03-01',202409,3,2024,1,9,202403,2024), -('2024-03-02',202409,3,2024,2,9,202403,2024), -('2024-03-03',202410,3,2024,3,10,202403,2024), -('2024-03-04',202410,3,2024,4,10,202403,2024), -('2024-03-05',202410,3,2024,5,10,202403,2024), -('2024-03-06',202410,3,2024,6,10,202403,2024), -('2024-03-07',202410,3,2024,7,10,202403,2024), -('2024-03-08',202410,3,2024,8,10,202403,2024), -('2024-03-09',202410,3,2024,9,10,202403,2024), -('2024-03-10',202411,3,2024,10,11,202403,2024), -('2024-03-11',202411,3,2024,11,11,202403,2024), -('2024-03-12',202411,3,2024,12,11,202403,2024), -('2024-03-13',202411,3,2024,13,11,202403,2024), -('2024-03-14',202411,3,2024,14,11,202403,2024), -('2024-03-15',202411,3,2024,15,11,202403,2024), -('2024-03-16',202411,3,2024,16,11,202403,2024), -('2024-03-17',202412,3,2024,17,12,202403,2024), -('2024-03-18',202412,3,2024,18,12,202403,2024), -('2024-03-19',202412,3,2024,19,12,202403,2024), -('2024-03-20',202412,3,2024,20,12,202403,2024), -('2024-03-21',202412,3,2024,21,12,202403,2024), -('2024-03-22',202412,3,2024,22,12,202403,2024), -('2024-03-23',202412,3,2024,23,12,202403,2024), -('2024-03-24',202413,3,2024,24,13,202403,2024), -('2024-03-25',202413,3,2024,25,13,202403,2024), -('2024-03-26',202413,3,2024,26,13,202403,2024), -('2024-03-27',202413,3,2024,27,13,202403,2024), -('2024-03-28',202413,3,2024,28,13,202403,2024), -('2024-03-29',202413,3,2024,29,13,202403,2024), -('2024-03-30',202413,3,2024,30,13,202403,2024), -('2024-03-31',202414,3,2024,31,14,202403,2024), -('2024-04-01',202414,4,2024,1,14,202404,2024), -('2024-04-02',202414,4,2024,2,14,202404,2024), -('2024-04-03',202414,4,2024,3,14,202404,2024), -('2024-04-04',202414,4,2024,4,14,202404,2024), -('2024-04-05',202414,4,2024,5,14,202404,2024), -('2024-04-06',202414,4,2024,6,14,202404,2024), -('2024-04-07',202415,4,2024,7,15,202404,2024), -('2024-04-08',202415,4,2024,8,15,202404,2024), -('2024-04-09',202415,4,2024,9,15,202404,2024), -('2024-04-10',202415,4,2024,10,15,202404,2024), -('2024-04-11',202415,4,2024,11,15,202404,2024), -('2024-04-12',202415,4,2024,12,15,202404,2024), -('2024-04-13',202415,4,2024,13,15,202404,2024), -('2024-04-14',202416,4,2024,14,16,202404,2024), -('2024-04-15',202416,4,2024,15,16,202404,2024), -('2024-04-16',202416,4,2024,16,16,202404,2024), -('2024-04-17',202416,4,2024,17,16,202404,2024), -('2024-04-18',202416,4,2024,18,16,202404,2024), -('2024-04-19',202416,4,2024,19,16,202404,2024), -('2024-04-20',202416,4,2024,20,16,202404,2024), -('2024-04-21',202417,4,2024,21,17,202404,2024), -('2024-04-22',202417,4,2024,22,17,202404,2024), -('2024-04-23',202417,4,2024,23,17,202404,2024), -('2024-04-24',202417,4,2024,24,17,202404,2024), -('2024-04-25',202417,4,2024,25,17,202404,2024), -('2024-04-26',202417,4,2024,26,17,202404,2024), -('2024-04-27',202417,4,2024,27,17,202404,2024), -('2024-04-28',202418,4,2024,28,18,202404,2024), -('2024-04-29',202418,4,2024,29,18,202404,2024), -('2024-04-30',202418,4,2024,30,18,202404,2024), -('2024-05-01',202418,5,2024,1,18,202405,2024), -('2024-05-02',202418,5,2024,2,18,202405,2024), -('2024-05-03',202418,5,2024,3,18,202405,2024), -('2024-05-04',202418,5,2024,4,18,202405,2024), -('2024-05-05',202419,5,2024,5,19,202405,2024), -('2024-05-06',202419,5,2024,6,19,202405,2024), -('2024-05-07',202419,5,2024,7,19,202405,2024), -('2024-05-08',202419,5,2024,8,19,202405,2024), -('2024-05-09',202419,5,2024,9,19,202405,2024), -('2024-05-10',202419,5,2024,10,19,202405,2024), -('2024-05-11',202419,5,2024,11,19,202405,2024), -('2024-05-12',202420,5,2024,12,20,202405,2024), -('2024-05-13',202420,5,2024,13,20,202405,2024), -('2024-05-14',202420,5,2024,14,20,202405,2024), -('2024-05-15',202420,5,2024,15,20,202405,2024), -('2024-05-16',202420,5,2024,16,20,202405,2024), -('2024-05-17',202420,5,2024,17,20,202405,2024), -('2024-05-18',202420,5,2024,18,20,202405,2024), -('2024-05-19',202421,5,2024,19,21,202405,2024), -('2024-05-20',202421,5,2024,20,21,202405,2024), -('2024-05-21',202421,5,2024,21,21,202405,2024), -('2024-05-22',202421,5,2024,22,21,202405,2024), -('2024-05-23',202421,5,2024,23,21,202405,2024), -('2024-05-24',202421,5,2024,24,21,202405,2024), -('2024-05-25',202421,5,2024,25,21,202405,2024), -('2024-05-26',202422,5,2024,26,22,202405,2024), -('2024-05-27',202422,5,2024,27,22,202405,2024), -('2024-05-28',202422,5,2024,28,22,202405,2024), -('2024-05-29',202422,5,2024,29,22,202405,2024), -('2024-05-30',202422,5,2024,30,22,202405,2024), -('2024-05-31',202422,5,2024,31,22,202405,2024), -('2024-06-01',202422,6,2024,1,22,202406,2024), -('2024-06-02',202423,6,2024,2,23,202406,2024), -('2024-06-03',202423,6,2024,3,23,202406,2024), -('2024-06-04',202423,6,2024,4,23,202406,2024), -('2024-06-05',202423,6,2024,5,23,202406,2024), -('2024-06-06',202423,6,2024,6,23,202406,2024), -('2024-06-07',202423,6,2024,7,23,202406,2024), -('2024-06-08',202423,6,2024,8,23,202406,2024), -('2024-06-09',202424,6,2024,9,24,202406,2024), -('2024-06-10',202424,6,2024,10,24,202406,2024), -('2024-06-11',202424,6,2024,11,24,202406,2024), -('2024-06-12',202424,6,2024,12,24,202406,2024), -('2024-06-13',202424,6,2024,13,24,202406,2024), -('2024-06-14',202424,6,2024,14,24,202406,2024), -('2024-06-15',202424,6,2024,15,24,202406,2024), -('2024-06-16',202425,6,2024,16,25,202406,2024), -('2024-06-17',202425,6,2024,17,25,202406,2024), -('2024-06-18',202425,6,2024,18,25,202406,2024), -('2024-06-19',202425,6,2024,19,25,202406,2024), -('2024-06-20',202425,6,2024,20,25,202406,2024), -('2024-06-21',202425,6,2024,21,25,202406,2024), -('2024-06-22',202425,6,2024,22,25,202406,2024), -('2024-06-23',202426,6,2024,23,26,202406,2024), -('2024-06-24',202426,6,2024,24,26,202406,2024), -('2024-06-25',202426,6,2024,25,26,202406,2024), -('2024-06-26',202426,6,2024,26,26,202406,2024), -('2024-06-27',202426,6,2024,27,26,202406,2024), -('2024-06-28',202426,6,2024,28,26,202406,2024), -('2024-06-29',202426,6,2024,29,26,202406,2024), -('2024-06-30',202427,6,2024,30,27,202406,2024), -('2024-07-01',202427,7,2024,1,27,202407,2024), -('2024-07-02',202427,7,2024,2,27,202407,2024), -('2024-07-03',202427,7,2024,3,27,202407,2024), -('2024-07-04',202427,7,2024,4,27,202407,2024), -('2024-07-05',202427,7,2024,5,27,202407,2024), -('2024-07-06',202427,7,2024,6,27,202407,2024), -('2024-07-07',202428,7,2024,7,28,202407,2024), -('2024-07-08',202428,7,2024,8,28,202407,2024), -('2024-07-09',202428,7,2024,9,28,202407,2024), -('2024-07-10',202428,7,2024,10,28,202407,2024), -('2024-07-11',202428,7,2024,11,28,202407,2024), -('2024-07-12',202428,7,2024,12,28,202407,2024), -('2024-07-13',202428,7,2024,13,28,202407,2024), -('2024-07-14',202429,7,2024,14,29,202407,2024), -('2024-07-15',202429,7,2024,15,29,202407,2024), -('2024-07-16',202429,7,2024,16,29,202407,2024), -('2024-07-17',202429,7,2024,17,29,202407,2024), -('2024-07-18',202429,7,2024,18,29,202407,2024), -('2024-07-19',202429,7,2024,19,29,202407,2024), -('2024-07-20',202429,7,2024,20,29,202407,2024), -('2024-07-21',202430,7,2024,21,30,202407,2024), -('2024-07-22',202430,7,2024,22,30,202407,2024), -('2024-07-23',202430,7,2024,23,30,202407,2024), -('2024-07-24',202430,7,2024,24,30,202407,2024), -('2024-07-25',202430,7,2024,25,30,202407,2024), -('2024-07-26',202430,7,2024,26,30,202407,2024), -('2024-07-27',202430,7,2024,27,30,202407,2024), -('2024-07-28',202431,7,2024,28,31,202407,2024), -('2024-07-29',202431,7,2024,29,31,202407,2024), -('2024-07-30',202431,7,2024,30,31,202407,2024), -('2024-07-31',202431,7,2024,31,31,202407,2024), -('2024-08-01',202431,8,2024,1,31,202408,2024), -('2024-08-02',202431,8,2024,2,31,202408,2024), -('2024-08-03',202431,8,2024,3,31,202408,2024), -('2024-08-04',202432,8,2024,4,32,202408,2024), -('2024-08-05',202432,8,2024,5,32,202408,2024), -('2024-08-06',202432,8,2024,6,32,202408,2024), -('2024-08-07',202432,8,2024,7,32,202408,2024), -('2024-08-08',202432,8,2024,8,32,202408,2024), -('2024-08-09',202432,8,2024,9,32,202408,2024), -('2024-08-10',202432,8,2024,10,32,202408,2024), -('2024-08-11',202433,8,2024,11,33,202408,2024), -('2024-08-12',202433,8,2024,12,33,202408,2024), -('2024-08-13',202433,8,2024,13,33,202408,2024), -('2024-08-14',202433,8,2024,14,33,202408,2024), -('2024-08-15',202433,8,2024,15,33,202408,2024), -('2024-08-16',202433,8,2024,16,33,202408,2024), -('2024-08-17',202433,8,2024,17,33,202408,2024), -('2024-08-18',202434,8,2024,18,34,202408,2024), -('2024-08-19',202434,8,2024,19,34,202408,2024), -('2024-08-20',202434,8,2024,20,34,202408,2024), -('2024-08-21',202434,8,2024,21,34,202408,2024), -('2024-08-22',202434,8,2024,22,34,202408,2024), -('2024-08-23',202434,8,2024,23,34,202408,2024), -('2024-08-24',202434,8,2024,24,34,202408,2024), -('2024-08-25',202435,8,2024,25,35,202408,2024), -('2024-08-26',202435,8,2024,26,35,202408,2024), -('2024-08-27',202435,8,2024,27,35,202408,2024), -('2024-08-28',202435,8,2024,28,35,202408,2024), -('2024-08-29',202435,8,2024,29,35,202408,2024), -('2024-08-30',202435,8,2024,30,35,202408,2024), -('2024-08-31',202435,8,2024,31,35,202408,2024), -('2024-09-01',202436,9,2024,1,36,202409,2024), -('2024-09-02',202436,9,2024,2,36,202409,2024), -('2024-09-03',202436,9,2024,3,36,202409,2024), -('2024-09-04',202436,9,2024,4,36,202409,2024), -('2024-09-05',202436,9,2024,5,36,202409,2024), -('2024-09-06',202436,9,2024,6,36,202409,2024), -('2024-09-07',202436,9,2024,7,36,202409,2024), -('2024-09-08',202437,9,2024,8,37,202409,2024), -('2024-09-09',202437,9,2024,9,37,202409,2024), -('2024-09-10',202437,9,2024,10,37,202409,2024), -('2024-09-11',202437,9,2024,11,37,202409,2024), -('2024-09-12',202437,9,2024,12,37,202409,2024), -('2024-09-13',202437,9,2024,13,37,202409,2024), -('2024-09-14',202437,9,2024,14,37,202409,2024), -('2024-09-15',202438,9,2024,15,38,202409,2024), -('2024-09-16',202438,9,2024,16,38,202409,2024), -('2024-09-17',202438,9,2024,17,38,202409,2024), -('2024-09-18',202438,9,2024,18,38,202409,2024), -('2024-09-19',202438,9,2024,19,38,202409,2024), -('2024-09-20',202438,9,2024,20,38,202409,2024), -('2024-09-21',202438,9,2024,21,38,202409,2024), -('2024-09-22',202439,9,2024,22,39,202409,2024), -('2024-09-23',202439,9,2024,23,39,202409,2024), -('2024-09-24',202439,9,2024,24,39,202409,2024), -('2024-09-25',202439,9,2024,25,39,202409,2024), -('2024-09-26',202439,9,2024,26,39,202409,2024), -('2024-09-27',202439,9,2024,27,39,202409,2024), -('2024-09-28',202439,9,2024,28,39,202409,2024), -('2024-09-29',202440,9,2024,29,40,202409,2024), -('2024-09-30',202440,9,2024,30,40,202409,2024), -('2024-10-01',202440,10,2024,1,40,202410,2024), -('2024-10-02',202440,10,2024,2,40,202410,2024), -('2024-10-03',202440,10,2024,3,40,202410,2024), -('2024-10-04',202440,10,2024,4,40,202410,2024), -('2024-10-05',202440,10,2024,5,40,202410,2024), -('2024-10-06',202441,10,2024,6,41,202410,2024), -('2024-10-07',202441,10,2024,7,41,202410,2024), -('2024-10-08',202441,10,2024,8,41,202410,2024), -('2024-10-09',202441,10,2024,9,41,202410,2024), -('2024-10-10',202441,10,2024,10,41,202410,2024), -('2024-10-11',202441,10,2024,11,41,202410,2024), -('2024-10-12',202441,10,2024,12,41,202410,2024), -('2024-10-13',202442,10,2024,13,42,202410,2024), -('2024-10-14',202442,10,2024,14,42,202410,2024), -('2024-10-15',202442,10,2024,15,42,202410,2024), -('2024-10-16',202442,10,2024,16,42,202410,2024), -('2024-10-17',202442,10,2024,17,42,202410,2024), -('2024-10-18',202442,10,2024,18,42,202410,2024), -('2024-10-19',202442,10,2024,19,42,202410,2024), -('2024-10-20',202443,10,2024,20,43,202410,2024), -('2024-10-21',202443,10,2024,21,43,202410,2024), -('2024-10-22',202443,10,2024,22,43,202410,2024), -('2024-10-23',202443,10,2024,23,43,202410,2024), -('2024-10-24',202443,10,2024,24,43,202410,2024), -('2024-10-25',202443,10,2024,25,43,202410,2024), -('2024-10-26',202443,10,2024,26,43,202410,2024), -('2024-10-27',202444,10,2024,27,44,202410,2024), -('2024-10-28',202444,10,2024,28,44,202410,2024), -('2024-10-29',202444,10,2024,29,44,202410,2024), -('2024-10-30',202444,10,2024,30,44,202410,2024), -('2024-10-31',202444,10,2024,31,44,202410,2024), -('2024-11-01',202444,11,2024,1,44,202411,2024), -('2024-11-02',202444,11,2024,2,44,202411,2024), -('2024-11-03',202445,11,2024,3,45,202411,2024), -('2024-11-04',202445,11,2024,4,45,202411,2024), -('2024-11-05',202445,11,2024,5,45,202411,2024), -('2024-11-06',202445,11,2024,6,45,202411,2024), -('2024-11-07',202445,11,2024,7,45,202411,2024), -('2024-11-08',202445,11,2024,8,45,202411,2024), -('2024-11-09',202445,11,2024,9,45,202411,2024), -('2024-11-10',202446,11,2024,10,46,202411,2024), -('2024-11-11',202446,11,2024,11,46,202411,2024), -('2024-11-12',202446,11,2024,12,46,202411,2024), -('2024-11-13',202446,11,2024,13,46,202411,2024), -('2024-11-14',202446,11,2024,14,46,202411,2024), -('2024-11-15',202446,11,2024,15,46,202411,2024), -('2024-11-16',202446,11,2024,16,46,202411,2024), -('2024-11-17',202447,11,2024,17,47,202411,2024), -('2024-11-18',202447,11,2024,18,47,202411,2024), -('2024-11-19',202447,11,2024,19,47,202411,2024), -('2024-11-20',202447,11,2024,20,47,202411,2024), -('2024-11-21',202447,11,2024,21,47,202411,2024), -('2024-11-22',202447,11,2024,22,47,202411,2024), -('2024-11-23',202447,11,2024,23,47,202411,2024), -('2024-11-24',202448,11,2024,24,48,202411,2024), -('2024-11-25',202448,11,2024,25,48,202411,2024), -('2024-11-26',202448,11,2024,26,48,202411,2024), -('2024-11-27',202448,11,2024,27,48,202411,2024), -('2024-11-28',202448,11,2024,28,48,202411,2024), -('2024-11-29',202448,11,2024,29,48,202411,2024), -('2024-11-30',202448,11,2024,30,48,202411,2024), -('2024-12-01',202449,12,2024,1,49,202412,2025), -('2024-12-02',202449,12,2024,2,49,202412,2025), -('2024-12-03',202449,12,2024,3,49,202412,2025), -('2024-12-04',202449,12,2024,4,49,202412,2025), -('2024-12-05',202449,12,2024,5,49,202412,2025), -('2024-12-06',202449,12,2024,6,49,202412,2025), -('2024-12-07',202449,12,2024,7,49,202412,2025), -('2024-12-08',202450,12,2024,8,50,202412,2025), -('2024-12-09',202450,12,2024,9,50,202412,2025), -('2024-12-10',202450,12,2024,10,50,202412,2025), -('2024-12-11',202450,12,2024,11,50,202412,2025), -('2024-12-12',202450,12,2024,12,50,202412,2025), -('2024-12-13',202450,12,2024,13,50,202412,2025), -('2024-12-14',202450,12,2024,14,50,202412,2025), -('2024-12-15',202451,12,2024,15,51,202412,2025), -('2024-12-16',202451,12,2024,16,51,202412,2025), -('2024-12-17',202451,12,2024,17,51,202412,2025), -('2024-12-18',202451,12,2024,18,51,202412,2025), -('2024-12-19',202451,12,2024,19,51,202412,2025), -('2024-12-20',202451,12,2024,20,51,202412,2025), -('2024-12-21',202451,12,2024,21,51,202412,2025), -('2024-12-22',202452,12,2024,22,52,202412,2025), -('2024-12-23',202452,12,2024,23,52,202412,2025), -('2024-12-24',202452,12,2024,24,52,202412,2025), -('2024-12-25',202452,12,2024,25,52,202412,2025), -('2024-12-26',202452,12,2024,26,52,202412,2025), -('2024-12-27',202452,12,2024,27,52,202412,2025), -('2024-12-28',202452,12,2024,28,52,202412,2025), -('2024-12-29',202453,12,2024,29,1,202412,2025), -('2024-12-30',202401,12,2024,30,1,202412,2025), -('2024-12-31',202401,12,2024,31,1,202412,2025), -('2025-01-01',202501,1,2025,1,1,202501,2025), -('2025-01-02',202501,1,2025,2,1,202501,2025), -('2025-01-03',202501,1,2025,3,1,202501,2025), -('2025-01-04',202501,1,2025,4,1,202501,2025), -('2025-01-05',202502,1,2025,5,2,202501,2025), -('2025-01-06',202502,1,2025,6,2,202501,2025), -('2025-01-07',202502,1,2025,7,2,202501,2025), -('2025-01-08',202502,1,2025,8,2,202501,2025), -('2025-01-09',202502,1,2025,9,2,202501,2025), -('2025-01-10',202502,1,2025,10,2,202501,2025), -('2025-01-11',202502,1,2025,11,2,202501,2025), -('2025-01-12',202503,1,2025,12,3,202501,2025), -('2025-01-13',202503,1,2025,13,3,202501,2025), -('2025-01-14',202503,1,2025,14,3,202501,2025), -('2025-01-15',202503,1,2025,15,3,202501,2025), -('2025-01-16',202503,1,2025,16,3,202501,2025), -('2025-01-17',202503,1,2025,17,3,202501,2025), -('2025-01-18',202503,1,2025,18,3,202501,2025), -('2025-01-19',202504,1,2025,19,4,202501,2025), -('2025-01-20',202504,1,2025,20,4,202501,2025), -('2025-01-21',202504,1,2025,21,4,202501,2025), -('2025-01-22',202504,1,2025,22,4,202501,2025), -('2025-01-23',202504,1,2025,23,4,202501,2025), -('2025-01-24',202504,1,2025,24,4,202501,2025), -('2025-01-25',202504,1,2025,25,4,202501,2025), -('2025-01-26',202505,1,2025,26,5,202501,2025), -('2025-01-27',202505,1,2025,27,5,202501,2025), -('2025-01-28',202505,1,2025,28,5,202501,2025), -('2025-01-29',202505,1,2025,29,5,202501,2025), -('2025-01-30',202505,1,2025,30,5,202501,2025), -('2025-01-31',202505,1,2025,31,5,202501,2025), -('2025-02-01',202505,2,2025,1,5,202502,2025), -('2025-02-02',202506,2,2025,2,6,202502,2025), -('2025-02-03',202506,2,2025,3,6,202502,2025), -('2025-02-04',202506,2,2025,4,6,202502,2025), -('2025-02-05',202506,2,2025,5,6,202502,2025), -('2025-02-06',202506,2,2025,6,6,202502,2025), -('2025-02-07',202506,2,2025,7,6,202502,2025), -('2025-02-08',202506,2,2025,8,6,202502,2025), -('2025-02-09',202507,2,2025,9,7,202502,2025), -('2025-02-10',202507,2,2025,10,7,202502,2025), -('2025-02-11',202507,2,2025,11,7,202502,2025), -('2025-02-12',202507,2,2025,12,7,202502,2025), -('2025-02-13',202507,2,2025,13,7,202502,2025), -('2025-02-14',202507,2,2025,14,7,202502,2025), -('2025-02-15',202507,2,2025,15,7,202502,2025), -('2025-02-16',202508,2,2025,16,8,202502,2025), -('2025-02-17',202508,2,2025,17,8,202502,2025), -('2025-02-18',202508,2,2025,18,8,202502,2025), -('2025-02-19',202508,2,2025,19,8,202502,2025), -('2025-02-20',202508,2,2025,20,8,202502,2025), -('2025-02-21',202508,2,2025,21,8,202502,2025), -('2025-02-22',202508,2,2025,22,8,202502,2025), -('2025-02-23',202509,2,2025,23,9,202502,2025), -('2025-02-24',202509,2,2025,24,9,202502,2025), -('2025-02-25',202509,2,2025,25,9,202502,2025), -('2025-02-26',202509,2,2025,26,9,202502,2025), -('2025-02-27',202509,2,2025,27,9,202502,2025), -('2025-02-28',202509,2,2025,28,9,202502,2025), -('2025-03-01',202509,3,2025,1,9,202503,2025), -('2025-03-02',202510,3,2025,2,10,202503,2025), -('2025-03-03',202510,3,2025,3,10,202503,2025), -('2025-03-04',202510,3,2025,4,10,202503,2025), -('2025-03-05',202510,3,2025,5,10,202503,2025), -('2025-03-06',202510,3,2025,6,10,202503,2025), -('2025-03-07',202510,3,2025,7,10,202503,2025), -('2025-03-08',202510,3,2025,8,10,202503,2025), -('2025-03-09',202511,3,2025,9,11,202503,2025), -('2025-03-10',202511,3,2025,10,11,202503,2025), -('2025-03-11',202511,3,2025,11,11,202503,2025), -('2025-03-12',202511,3,2025,12,11,202503,2025), -('2025-03-13',202511,3,2025,13,11,202503,2025), -('2025-03-14',202511,3,2025,14,11,202503,2025), -('2025-03-15',202511,3,2025,15,11,202503,2025), -('2025-03-16',202512,3,2025,16,12,202503,2025), -('2025-03-17',202512,3,2025,17,12,202503,2025), -('2025-03-18',202512,3,2025,18,12,202503,2025), -('2025-03-19',202512,3,2025,19,12,202503,2025), -('2025-03-20',202512,3,2025,20,12,202503,2025), -('2025-03-21',202512,3,2025,21,12,202503,2025), -('2025-03-22',202512,3,2025,22,12,202503,2025), -('2025-03-23',202513,3,2025,23,13,202503,2025), -('2025-03-24',202513,3,2025,24,13,202503,2025), -('2025-03-25',202513,3,2025,25,13,202503,2025), -('2025-03-26',202513,3,2025,26,13,202503,2025), -('2025-03-27',202513,3,2025,27,13,202503,2025), -('2025-03-28',202513,3,2025,28,13,202503,2025), -('2025-03-29',202513,3,2025,29,13,202503,2025), -('2025-03-30',202514,3,2025,30,14,202503,2025), -('2025-03-31',202514,3,2025,31,14,202503,2025), -('2025-04-01',202514,4,2025,1,14,202504,2025), -('2025-04-02',202514,4,2025,2,14,202504,2025), -('2025-04-03',202514,4,2025,3,14,202504,2025), -('2025-04-04',202514,4,2025,4,14,202504,2025), -('2025-04-05',202514,4,2025,5,14,202504,2025), -('2025-04-06',202515,4,2025,6,15,202504,2025), -('2025-04-07',202515,4,2025,7,15,202504,2025), -('2025-04-08',202515,4,2025,8,15,202504,2025), -('2025-04-09',202515,4,2025,9,15,202504,2025), -('2025-04-10',202515,4,2025,10,15,202504,2025), -('2025-04-11',202515,4,2025,11,15,202504,2025), -('2025-04-12',202515,4,2025,12,15,202504,2025), -('2025-04-13',202516,4,2025,13,16,202504,2025), -('2025-04-14',202516,4,2025,14,16,202504,2025), -('2025-04-15',202516,4,2025,15,16,202504,2025), -('2025-04-16',202516,4,2025,16,16,202504,2025), -('2025-04-17',202516,4,2025,17,16,202504,2025), -('2025-04-18',202516,4,2025,18,16,202504,2025), -('2025-04-19',202516,4,2025,19,16,202504,2025), -('2025-04-20',202517,4,2025,20,17,202504,2025), -('2025-04-21',202517,4,2025,21,17,202504,2025), -('2025-04-22',202517,4,2025,22,17,202504,2025), -('2025-04-23',202517,4,2025,23,17,202504,2025), -('2025-04-24',202517,4,2025,24,17,202504,2025), -('2025-04-25',202517,4,2025,25,17,202504,2025), -('2025-04-26',202517,4,2025,26,17,202504,2025), -('2025-04-27',202518,4,2025,27,18,202504,2025), -('2025-04-28',202518,4,2025,28,18,202504,2025), -('2025-04-29',202518,4,2025,29,18,202504,2025), -('2025-04-30',202518,4,2025,30,18,202504,2025), -('2025-05-01',202518,5,2025,1,18,202505,2025), -('2025-05-02',202518,5,2025,2,18,202505,2025), -('2025-05-03',202518,5,2025,3,18,202505,2025), -('2025-05-04',202519,5,2025,4,19,202505,2025), -('2025-05-05',202519,5,2025,5,19,202505,2025), -('2025-05-06',202519,5,2025,6,19,202505,2025), -('2025-05-07',202519,5,2025,7,19,202505,2025), -('2025-05-08',202519,5,2025,8,19,202505,2025), -('2025-05-09',202519,5,2025,9,19,202505,2025), -('2025-05-10',202519,5,2025,10,19,202505,2025), -('2025-05-11',202520,5,2025,11,20,202505,2025), -('2025-05-12',202520,5,2025,12,20,202505,2025), -('2025-05-13',202520,5,2025,13,20,202505,2025), -('2025-05-14',202520,5,2025,14,20,202505,2025), -('2025-05-15',202520,5,2025,15,20,202505,2025), -('2025-05-16',202520,5,2025,16,20,202505,2025), -('2025-05-17',202520,5,2025,17,20,202505,2025), -('2025-05-18',202521,5,2025,18,21,202505,2025), -('2025-05-19',202521,5,2025,19,21,202505,2025), -('2025-05-20',202521,5,2025,20,21,202505,2025), -('2025-05-21',202521,5,2025,21,21,202505,2025), -('2025-05-22',202521,5,2025,22,21,202505,2025), -('2025-05-23',202521,5,2025,23,21,202505,2025), -('2025-05-24',202521,5,2025,24,21,202505,2025), -('2025-05-25',202522,5,2025,25,22,202505,2025), -('2025-05-26',202522,5,2025,26,22,202505,2025), -('2025-05-27',202522,5,2025,27,22,202505,2025), -('2025-05-28',202522,5,2025,28,22,202505,2025), -('2025-05-29',202522,5,2025,29,22,202505,2025), -('2025-05-30',202522,5,2025,30,22,202505,2025), -('2025-05-31',202522,5,2025,31,22,202505,2025), -('2025-06-01',202523,6,2025,1,23,202506,2025), -('2025-06-02',202523,6,2025,2,23,202506,2025), -('2025-06-03',202523,6,2025,3,23,202506,2025), -('2025-06-04',202523,6,2025,4,23,202506,2025), -('2025-06-05',202523,6,2025,5,23,202506,2025), -('2025-06-06',202523,6,2025,6,23,202506,2025), -('2025-06-07',202523,6,2025,7,23,202506,2025), -('2025-06-08',202524,6,2025,8,24,202506,2025), -('2025-06-09',202524,6,2025,9,24,202506,2025), -('2025-06-10',202524,6,2025,10,24,202506,2025), -('2025-06-11',202524,6,2025,11,24,202506,2025), -('2025-06-12',202524,6,2025,12,24,202506,2025), -('2025-06-13',202524,6,2025,13,24,202506,2025), -('2025-06-14',202524,6,2025,14,24,202506,2025), -('2025-06-15',202525,6,2025,15,25,202506,2025), -('2025-06-16',202525,6,2025,16,25,202506,2025), -('2025-06-17',202525,6,2025,17,25,202506,2025), -('2025-06-18',202525,6,2025,18,25,202506,2025), -('2025-06-19',202525,6,2025,19,25,202506,2025), -('2025-06-20',202525,6,2025,20,25,202506,2025), -('2025-06-21',202525,6,2025,21,25,202506,2025), -('2025-06-22',202526,6,2025,22,26,202506,2025), -('2025-06-23',202526,6,2025,23,26,202506,2025), -('2025-06-24',202526,6,2025,24,26,202506,2025), -('2025-06-25',202526,6,2025,25,26,202506,2025), -('2025-06-26',202526,6,2025,26,26,202506,2025), -('2025-06-27',202526,6,2025,27,26,202506,2025), -('2025-06-28',202526,6,2025,28,26,202506,2025), -('2025-06-29',202527,6,2025,29,27,202506,2025), -('2025-06-30',202527,6,2025,30,27,202506,2025), -('2025-07-01',202527,7,2025,1,27,202507,2025), -('2025-07-02',202527,7,2025,2,27,202507,2025), -('2025-07-03',202527,7,2025,3,27,202507,2025), -('2025-07-04',202527,7,2025,4,27,202507,2025), -('2025-07-05',202527,7,2025,5,27,202507,2025), -('2025-07-06',202528,7,2025,6,28,202507,2025), -('2025-07-07',202528,7,2025,7,28,202507,2025), -('2025-07-08',202528,7,2025,8,28,202507,2025), -('2025-07-09',202528,7,2025,9,28,202507,2025), -('2025-07-10',202528,7,2025,10,28,202507,2025), -('2025-07-11',202528,7,2025,11,28,202507,2025), -('2025-07-12',202528,7,2025,12,28,202507,2025), -('2025-07-13',202529,7,2025,13,29,202507,2025), -('2025-07-14',202529,7,2025,14,29,202507,2025), -('2025-07-15',202529,7,2025,15,29,202507,2025), -('2025-07-16',202529,7,2025,16,29,202507,2025), -('2025-07-17',202529,7,2025,17,29,202507,2025), -('2025-07-18',202529,7,2025,18,29,202507,2025), -('2025-07-19',202529,7,2025,19,29,202507,2025), -('2025-07-20',202530,7,2025,20,30,202507,2025), -('2025-07-21',202530,7,2025,21,30,202507,2025), -('2025-07-22',202530,7,2025,22,30,202507,2025), -('2025-07-23',202530,7,2025,23,30,202507,2025), -('2025-07-24',202530,7,2025,24,30,202507,2025), -('2025-07-25',202530,7,2025,25,30,202507,2025), -('2025-07-26',202530,7,2025,26,30,202507,2025), -('2025-07-27',202531,7,2025,27,31,202507,2025), -('2025-07-28',202531,7,2025,28,31,202507,2025), -('2025-07-29',202531,7,2025,29,31,202507,2025), -('2025-07-30',202531,7,2025,30,31,202507,2025), -('2025-07-31',202531,7,2025,31,31,202507,2025), -('2025-08-01',202531,8,2025,1,31,202508,2025), -('2025-08-02',202531,8,2025,2,31,202508,2025), -('2025-08-03',202532,8,2025,3,32,202508,2025), -('2025-08-04',202532,8,2025,4,32,202508,2025), -('2025-08-05',202532,8,2025,5,32,202508,2025), -('2025-08-06',202532,8,2025,6,32,202508,2025), -('2025-08-07',202532,8,2025,7,32,202508,2025), -('2025-08-08',202532,8,2025,8,32,202508,2025), -('2025-08-09',202532,8,2025,9,32,202508,2025), -('2025-08-10',202533,8,2025,10,33,202508,2025), -('2025-08-11',202533,8,2025,11,33,202508,2025), -('2025-08-12',202533,8,2025,12,33,202508,2025), -('2025-08-13',202533,8,2025,13,33,202508,2025), -('2025-08-14',202533,8,2025,14,33,202508,2025), -('2025-08-15',202533,8,2025,15,33,202508,2025), -('2025-08-16',202533,8,2025,16,33,202508,2025), -('2025-08-17',202534,8,2025,17,34,202508,2025), -('2025-08-18',202534,8,2025,18,34,202508,2025), -('2025-08-19',202534,8,2025,19,34,202508,2025), -('2025-08-20',202534,8,2025,20,34,202508,2025), -('2025-08-21',202534,8,2025,21,34,202508,2025), -('2025-08-22',202534,8,2025,22,34,202508,2025), -('2025-08-23',202534,8,2025,23,34,202508,2025), -('2025-08-24',202535,8,2025,24,35,202508,2025), -('2025-08-25',202535,8,2025,25,35,202508,2025), -('2025-08-26',202535,8,2025,26,35,202508,2025), -('2025-08-27',202535,8,2025,27,35,202508,2025), -('2025-08-28',202535,8,2025,28,35,202508,2025), -('2025-08-29',202535,8,2025,29,35,202508,2025), -('2025-08-30',202535,8,2025,30,35,202508,2025), -('2025-08-31',202536,8,2025,31,36,202508,2025), -('2025-09-01',202536,9,2025,1,36,202509,2025), -('2025-09-02',202536,9,2025,2,36,202509,2025), -('2025-09-03',202536,9,2025,3,36,202509,2025), -('2025-09-04',202536,9,2025,4,36,202509,2025), -('2025-09-05',202536,9,2025,5,36,202509,2025), -('2025-09-06',202536,9,2025,6,36,202509,2025), -('2025-09-07',202537,9,2025,7,37,202509,2025), -('2025-09-08',202537,9,2025,8,37,202509,2025), -('2025-09-09',202537,9,2025,9,37,202509,2025), -('2025-09-10',202537,9,2025,10,37,202509,2025), -('2025-09-11',202537,9,2025,11,37,202509,2025), -('2025-09-12',202537,9,2025,12,37,202509,2025), -('2025-09-13',202537,9,2025,13,37,202509,2025), -('2025-09-14',202538,9,2025,14,38,202509,2025), -('2025-09-15',202538,9,2025,15,38,202509,2025), -('2025-09-16',202538,9,2025,16,38,202509,2025), -('2025-09-17',202538,9,2025,17,38,202509,2025), -('2025-09-18',202538,9,2025,18,38,202509,2025), -('2025-09-19',202538,9,2025,19,38,202509,2025), -('2025-09-20',202538,9,2025,20,38,202509,2025), -('2025-09-21',202539,9,2025,21,39,202509,2025), -('2025-09-22',202539,9,2025,22,39,202509,2025), -('2025-09-23',202539,9,2025,23,39,202509,2025), -('2025-09-24',202539,9,2025,24,39,202509,2025), -('2025-09-25',202539,9,2025,25,39,202509,2025), -('2025-09-26',202539,9,2025,26,39,202509,2025), -('2025-09-27',202539,9,2025,27,39,202509,2025), -('2025-09-28',202540,9,2025,28,40,202509,2025), -('2025-09-29',202540,9,2025,29,40,202509,2025), -('2025-09-30',202540,9,2025,30,40,202509,2025), -('2025-10-01',202540,10,2025,1,40,202510,2025), -('2025-10-02',202540,10,2025,2,40,202510,2025), -('2025-10-03',202540,10,2025,3,40,202510,2025), -('2025-10-04',202540,10,2025,4,40,202510,2025), -('2025-10-05',202541,10,2025,5,41,202510,2025), -('2025-10-06',202541,10,2025,6,41,202510,2025), -('2025-10-07',202541,10,2025,7,41,202510,2025), -('2025-10-08',202541,10,2025,8,41,202510,2025), -('2025-10-09',202541,10,2025,9,41,202510,2025), -('2025-10-10',202541,10,2025,10,41,202510,2025), -('2025-10-11',202541,10,2025,11,41,202510,2025), -('2025-10-12',202542,10,2025,12,42,202510,2025), -('2025-10-13',202542,10,2025,13,42,202510,2025), -('2025-10-14',202542,10,2025,14,42,202510,2025), -('2025-10-15',202542,10,2025,15,42,202510,2025), -('2025-10-16',202542,10,2025,16,42,202510,2025), -('2025-10-17',202542,10,2025,17,42,202510,2025), -('2025-10-18',202542,10,2025,18,42,202510,2025), -('2025-10-19',202543,10,2025,19,43,202510,2025), -('2025-10-20',202543,10,2025,20,43,202510,2025), -('2025-10-21',202543,10,2025,21,43,202510,2025), -('2025-10-22',202543,10,2025,22,43,202510,2025), -('2025-10-23',202543,10,2025,23,43,202510,2025), -('2025-10-24',202543,10,2025,24,43,202510,2025), -('2025-10-25',202543,10,2025,25,43,202510,2025), -('2025-10-26',202544,10,2025,26,44,202510,2025), -('2025-10-27',202544,10,2025,27,44,202510,2025), -('2025-10-28',202544,10,2025,28,44,202510,2025), -('2025-10-29',202544,10,2025,29,44,202510,2025), -('2025-10-30',202544,10,2025,30,44,202510,2025), -('2025-10-31',202544,10,2025,31,44,202510,2025), -('2025-11-01',202544,11,2025,1,44,202511,2025), -('2025-11-02',202545,11,2025,2,45,202511,2025), -('2025-11-03',202545,11,2025,3,45,202511,2025), -('2025-11-04',202545,11,2025,4,45,202511,2025), -('2025-11-05',202545,11,2025,5,45,202511,2025), -('2025-11-06',202545,11,2025,6,45,202511,2025), -('2025-11-07',202545,11,2025,7,45,202511,2025), -('2025-11-08',202545,11,2025,8,45,202511,2025), -('2025-11-09',202546,11,2025,9,46,202511,2025), -('2025-11-10',202546,11,2025,10,46,202511,2025), -('2025-11-11',202546,11,2025,11,46,202511,2025), -('2025-11-12',202546,11,2025,12,46,202511,2025), -('2025-11-13',202546,11,2025,13,46,202511,2025), -('2025-11-14',202546,11,2025,14,46,202511,2025), -('2025-11-15',202546,11,2025,15,46,202511,2025), -('2025-11-16',202547,11,2025,16,47,202511,2025), -('2025-11-17',202547,11,2025,17,47,202511,2025), -('2025-11-18',202547,11,2025,18,47,202511,2025), -('2025-11-19',202547,11,2025,19,47,202511,2025), -('2025-11-20',202547,11,2025,20,47,202511,2025), -('2025-11-21',202547,11,2025,21,47,202511,2025), -('2025-11-22',202547,11,2025,22,47,202511,2025), -('2025-11-23',202548,11,2025,23,48,202511,2025), -('2025-11-24',202548,11,2025,24,48,202511,2025), -('2025-11-25',202548,11,2025,25,48,202511,2025), -('2025-11-26',202548,11,2025,26,48,202511,2025), -('2025-11-27',202548,11,2025,27,48,202511,2025), -('2025-11-28',202548,11,2025,28,48,202511,2025), -('2025-11-29',202548,11,2025,29,48,202511,2025), -('2025-11-30',202549,11,2025,30,49,202511,2025), -('2025-12-01',202549,12,2025,1,49,202512,2026), -('2025-12-02',202549,12,2025,2,49,202512,2026), -('2025-12-03',202549,12,2025,3,49,202512,2026), -('2025-12-04',202549,12,2025,4,49,202512,2026), -('2025-12-05',202549,12,2025,5,49,202512,2026), -('2025-12-06',202549,12,2025,6,49,202512,2026), -('2025-12-07',202550,12,2025,7,50,202512,2026), -('2025-12-08',202550,12,2025,8,50,202512,2026), -('2025-12-09',202550,12,2025,9,50,202512,2026), -('2025-12-10',202550,12,2025,10,50,202512,2026), -('2025-12-11',202550,12,2025,11,50,202512,2026), -('2025-12-12',202550,12,2025,12,50,202512,2026), -('2025-12-13',202550,12,2025,13,50,202512,2026), -('2025-12-14',202551,12,2025,14,51,202512,2026), -('2025-12-15',202551,12,2025,15,51,202512,2026), -('2025-12-16',202551,12,2025,16,51,202512,2026), -('2025-12-17',202551,12,2025,17,51,202512,2026), -('2025-12-18',202551,12,2025,18,51,202512,2026), -('2025-12-19',202551,12,2025,19,51,202512,2026), -('2025-12-20',202551,12,2025,20,51,202512,2026), -('2025-12-21',202552,12,2025,21,52,202512,2026), -('2025-12-22',202552,12,2025,22,52,202512,2026), -('2025-12-23',202552,12,2025,23,52,202512,2026), -('2025-12-24',202552,12,2025,24,52,202512,2026), -('2025-12-25',202552,12,2025,25,52,202512,2026), -('2025-12-26',202552,12,2025,26,52,202512,2026), -('2025-12-27',202552,12,2025,27,52,202512,2026), -('2025-12-28',202553,12,2025,28,53,202512,2026), -('2025-12-29',202501,12,2025,29,53,202512,2026), -('2025-12-30',202501,12,2025,30,53,202512,2026), -('2025-12-31',202501,12,2025,31,53,202512,2026), -('2026-01-01',202601,1,2026,1,53,202601,2026), -('2026-01-02',202601,1,2026,2,53,202601,2026), -('2026-01-03',202601,1,2026,3,53,202601,2026), -('2026-01-04',202602,1,2026,4,1,202601,2026), -('2026-01-05',202602,1,2026,5,1,202601,2026), -('2026-01-06',202602,1,2026,6,1,202601,2026), -('2026-01-07',202602,1,2026,7,1,202601,2026), -('2026-01-08',202602,1,2026,8,1,202601,2026), -('2026-01-09',202602,1,2026,9,1,202601,2026), -('2026-01-10',202602,1,2026,10,1,202601,2026), -('2026-01-11',202603,1,2026,11,2,202601,2026), -('2026-01-12',202603,1,2026,12,2,202601,2026), -('2026-01-13',202603,1,2026,13,2,202601,2026), -('2026-01-14',202603,1,2026,14,2,202601,2026), -('2026-01-15',202603,1,2026,15,2,202601,2026), -('2026-01-16',202603,1,2026,16,2,202601,2026), -('2026-01-17',202603,1,2026,17,2,202601,2026), -('2026-01-18',202604,1,2026,18,3,202601,2026), -('2026-01-19',202604,1,2026,19,3,202601,2026), -('2026-01-20',202604,1,2026,20,3,202601,2026), -('2026-01-21',202604,1,2026,21,3,202601,2026), -('2026-01-22',202604,1,2026,22,3,202601,2026), -('2026-01-23',202604,1,2026,23,3,202601,2026), -('2026-01-24',202604,1,2026,24,3,202601,2026), -('2026-01-25',202605,1,2026,25,4,202601,2026), -('2026-01-26',202605,1,2026,26,4,202601,2026), -('2026-01-27',202605,1,2026,27,4,202601,2026), -('2026-01-28',202605,1,2026,28,4,202601,2026), -('2026-01-29',202605,1,2026,29,4,202601,2026), -('2026-01-30',202605,1,2026,30,4,202601,2026), -('2026-01-31',202605,1,2026,31,4,202601,2026), -('2026-02-01',202606,2,2026,1,5,202602,2026), -('2026-02-02',202606,2,2026,2,5,202602,2026), -('2026-02-03',202606,2,2026,3,5,202602,2026), -('2026-02-04',202606,2,2026,4,5,202602,2026), -('2026-02-05',202606,2,2026,5,5,202602,2026), -('2026-02-06',202606,2,2026,6,5,202602,2026), -('2026-02-07',202606,2,2026,7,5,202602,2026), -('2026-02-08',202607,2,2026,8,6,202602,2026), -('2026-02-09',202607,2,2026,9,6,202602,2026), -('2026-02-10',202607,2,2026,10,6,202602,2026), -('2026-02-11',202607,2,2026,11,6,202602,2026), -('2026-02-12',202607,2,2026,12,6,202602,2026), -('2026-02-13',202607,2,2026,13,6,202602,2026), -('2026-02-14',202607,2,2026,14,6,202602,2026), -('2026-02-15',202608,2,2026,15,7,202602,2026), -('2026-02-16',202608,2,2026,16,7,202602,2026), -('2026-02-17',202608,2,2026,17,7,202602,2026), -('2026-02-18',202608,2,2026,18,7,202602,2026), -('2026-02-19',202608,2,2026,19,7,202602,2026), -('2026-02-20',202608,2,2026,20,7,202602,2026), -('2026-02-21',202608,2,2026,21,7,202602,2026), -('2026-02-22',202609,2,2026,22,8,202602,2026), -('2026-02-23',202609,2,2026,23,8,202602,2026), -('2026-02-24',202609,2,2026,24,8,202602,2026), -('2026-02-25',202609,2,2026,25,8,202602,2026), -('2026-02-26',202609,2,2026,26,8,202602,2026), -('2026-02-27',202609,2,2026,27,8,202602,2026), -('2026-02-28',202609,2,2026,28,8,202602,2026), -('2026-03-01',202610,3,2026,1,9,202603,2026), -('2026-03-02',202610,3,2026,2,9,202603,2026), -('2026-03-03',202610,3,2026,3,9,202603,2026), -('2026-03-04',202610,3,2026,4,9,202603,2026), -('2026-03-05',202610,3,2026,5,9,202603,2026), -('2026-03-06',202610,3,2026,6,9,202603,2026), -('2026-03-07',202610,3,2026,7,9,202603,2026), -('2026-03-08',202611,3,2026,8,10,202603,2026), -('2026-03-09',202611,3,2026,9,10,202603,2026), -('2026-03-10',202611,3,2026,10,10,202603,2026), -('2026-03-11',202611,3,2026,11,10,202603,2026), -('2026-03-12',202611,3,2026,12,10,202603,2026), -('2026-03-13',202611,3,2026,13,10,202603,2026), -('2026-03-14',202611,3,2026,14,10,202603,2026), -('2026-03-15',202612,3,2026,15,11,202603,2026), -('2026-03-16',202612,3,2026,16,11,202603,2026), -('2026-03-17',202612,3,2026,17,11,202603,2026), -('2026-03-18',202612,3,2026,18,11,202603,2026), -('2026-03-19',202612,3,2026,19,11,202603,2026), -('2026-03-20',202612,3,2026,20,11,202603,2026), -('2026-03-21',202612,3,2026,21,11,202603,2026), -('2026-03-22',202613,3,2026,22,12,202603,2026), -('2026-03-23',202613,3,2026,23,12,202603,2026), -('2026-03-24',202613,3,2026,24,12,202603,2026), -('2026-03-25',202613,3,2026,25,12,202603,2026), -('2026-03-26',202613,3,2026,26,12,202603,2026), -('2026-03-27',202613,3,2026,27,12,202603,2026), -('2026-03-28',202613,3,2026,28,12,202603,2026), -('2026-03-29',202614,3,2026,29,13,202603,2026), -('2026-03-30',202614,3,2026,30,13,202603,2026), -('2026-03-31',202614,3,2026,31,13,202603,2026), -('2026-04-01',202614,4,2026,1,13,202604,2026), -('2026-04-02',202614,4,2026,2,13,202604,2026), -('2026-04-03',202614,4,2026,3,13,202604,2026), -('2026-04-04',202614,4,2026,4,13,202604,2026), -('2026-04-05',202615,4,2026,5,14,202604,2026), -('2026-04-06',202615,4,2026,6,14,202604,2026), -('2026-04-07',202615,4,2026,7,14,202604,2026), -('2026-04-08',202615,4,2026,8,14,202604,2026), -('2026-04-09',202615,4,2026,9,14,202604,2026), -('2026-04-10',202615,4,2026,10,14,202604,2026), -('2026-04-11',202615,4,2026,11,14,202604,2026), -('2026-04-12',202616,4,2026,12,15,202604,2026), -('2026-04-13',202616,4,2026,13,15,202604,2026), -('2026-04-14',202616,4,2026,14,15,202604,2026), -('2026-04-15',202616,4,2026,15,15,202604,2026), -('2026-04-16',202616,4,2026,16,15,202604,2026), -('2026-04-17',202616,4,2026,17,15,202604,2026), -('2026-04-18',202616,4,2026,18,15,202604,2026), -('2026-04-19',202617,4,2026,19,16,202604,2026), -('2026-04-20',202617,4,2026,20,16,202604,2026), -('2026-04-21',202617,4,2026,21,16,202604,2026), -('2026-04-22',202617,4,2026,22,16,202604,2026), -('2026-04-23',202617,4,2026,23,16,202604,2026), -('2026-04-24',202617,4,2026,24,16,202604,2026), -('2026-04-25',202617,4,2026,25,16,202604,2026), -('2026-04-26',202618,4,2026,26,17,202604,2026), -('2026-04-27',202618,4,2026,27,17,202604,2026), -('2026-04-28',202618,4,2026,28,17,202604,2026), -('2026-04-29',202618,4,2026,29,17,202604,2026), -('2026-04-30',202618,4,2026,30,17,202604,2026), -('2026-05-01',202618,5,2026,1,17,202605,2026), -('2026-05-02',202618,5,2026,2,17,202605,2026), -('2026-05-03',202619,5,2026,3,18,202605,2026), -('2026-05-04',202619,5,2026,4,18,202605,2026), -('2026-05-05',202619,5,2026,5,18,202605,2026), -('2026-05-06',202619,5,2026,6,18,202605,2026), -('2026-05-07',202619,5,2026,7,18,202605,2026), -('2026-05-08',202619,5,2026,8,18,202605,2026), -('2026-05-09',202619,5,2026,9,18,202605,2026), -('2026-05-10',202620,5,2026,10,19,202605,2026), -('2026-05-11',202620,5,2026,11,19,202605,2026), -('2026-05-12',202620,5,2026,12,19,202605,2026), -('2026-05-13',202620,5,2026,13,19,202605,2026), -('2026-05-14',202620,5,2026,14,19,202605,2026), -('2026-05-15',202620,5,2026,15,19,202605,2026), -('2026-05-16',202620,5,2026,16,19,202605,2026), -('2026-05-17',202621,5,2026,17,20,202605,2026), -('2026-05-18',202621,5,2026,18,20,202605,2026), -('2026-05-19',202621,5,2026,19,20,202605,2026), -('2026-05-20',202621,5,2026,20,20,202605,2026), -('2026-05-21',202621,5,2026,21,20,202605,2026), -('2026-05-22',202621,5,2026,22,20,202605,2026), -('2026-05-23',202621,5,2026,23,20,202605,2026), -('2026-05-24',202622,5,2026,24,21,202605,2026), -('2026-05-25',202622,5,2026,25,21,202605,2026), -('2026-05-26',202622,5,2026,26,21,202605,2026), -('2026-05-27',202622,5,2026,27,21,202605,2026), -('2026-05-28',202622,5,2026,28,21,202605,2026), -('2026-05-29',202622,5,2026,29,21,202605,2026), -('2026-05-30',202622,5,2026,30,21,202605,2026), -('2026-05-31',202623,5,2026,31,22,202605,2026), -('2026-06-01',202623,6,2026,1,22,202606,2026), -('2026-06-02',202623,6,2026,2,22,202606,2026), -('2026-06-03',202623,6,2026,3,22,202606,2026), -('2026-06-04',202623,6,2026,4,22,202606,2026), -('2026-06-05',202623,6,2026,5,22,202606,2026), -('2026-06-06',202623,6,2026,6,22,202606,2026), -('2026-06-07',202624,6,2026,7,23,202606,2026), -('2026-06-08',202624,6,2026,8,23,202606,2026), -('2026-06-09',202624,6,2026,9,23,202606,2026), -('2026-06-10',202624,6,2026,10,23,202606,2026), -('2026-06-11',202624,6,2026,11,23,202606,2026), -('2026-06-12',202624,6,2026,12,23,202606,2026), -('2026-06-13',202624,6,2026,13,23,202606,2026), -('2026-06-14',202625,6,2026,14,24,202606,2026), -('2026-06-15',202625,6,2026,15,24,202606,2026), -('2026-06-16',202625,6,2026,16,24,202606,2026), -('2026-06-17',202625,6,2026,17,24,202606,2026), -('2026-06-18',202625,6,2026,18,24,202606,2026), -('2026-06-19',202625,6,2026,19,24,202606,2026), -('2026-06-20',202625,6,2026,20,24,202606,2026), -('2026-06-21',202626,6,2026,21,25,202606,2026), -('2026-06-22',202626,6,2026,22,25,202606,2026), -('2026-06-23',202626,6,2026,23,25,202606,2026), -('2026-06-24',202626,6,2026,24,25,202606,2026), -('2026-06-25',202626,6,2026,25,25,202606,2026), -('2026-06-26',202626,6,2026,26,25,202606,2026), -('2026-06-27',202626,6,2026,27,25,202606,2026), -('2026-06-28',202627,6,2026,28,26,202606,2026), -('2026-06-29',202627,6,2026,29,26,202606,2026), -('2026-06-30',202627,6,2026,30,26,202606,2026), -('2026-07-01',202627,7,2026,1,26,202607,2026), -('2026-07-02',202627,7,2026,2,26,202607,2026), -('2026-07-03',202627,7,2026,3,26,202607,2026), -('2026-07-04',202627,7,2026,4,26,202607,2026), -('2026-07-05',202628,7,2026,5,27,202607,2026), -('2026-07-06',202628,7,2026,6,27,202607,2026), -('2026-07-07',202628,7,2026,7,27,202607,2026), -('2026-07-08',202628,7,2026,8,27,202607,2026), -('2026-07-09',202628,7,2026,9,27,202607,2026), -('2026-07-10',202628,7,2026,10,27,202607,2026), -('2026-07-11',202628,7,2026,11,27,202607,2026), -('2026-07-12',202629,7,2026,12,28,202607,2026), -('2026-07-13',202629,7,2026,13,28,202607,2026), -('2026-07-14',202629,7,2026,14,28,202607,2026), -('2026-07-15',202629,7,2026,15,28,202607,2026), -('2026-07-16',202629,7,2026,16,28,202607,2026), -('2026-07-17',202629,7,2026,17,28,202607,2026), -('2026-07-18',202629,7,2026,18,28,202607,2026), -('2026-07-19',202630,7,2026,19,29,202607,2026), -('2026-07-20',202630,7,2026,20,29,202607,2026), -('2026-07-21',202630,7,2026,21,29,202607,2026), -('2026-07-22',202630,7,2026,22,29,202607,2026), -('2026-07-23',202630,7,2026,23,29,202607,2026), -('2026-07-24',202630,7,2026,24,29,202607,2026), -('2026-07-25',202630,7,2026,25,29,202607,2026), -('2026-07-26',202631,7,2026,26,30,202607,2026), -('2026-07-27',202631,7,2026,27,30,202607,2026), -('2026-07-28',202631,7,2026,28,30,202607,2026), -('2026-07-29',202631,7,2026,29,30,202607,2026), -('2026-07-30',202631,7,2026,30,30,202607,2026), -('2026-07-31',202631,7,2026,31,30,202607,2026), -('2026-08-01',202631,8,2026,1,30,202608,2026), -('2026-08-02',202632,8,2026,2,31,202608,2026), -('2026-08-03',202632,8,2026,3,31,202608,2026), -('2026-08-04',202632,8,2026,4,31,202608,2026), -('2026-08-05',202632,8,2026,5,31,202608,2026), -('2026-08-06',202632,8,2026,6,31,202608,2026), -('2026-08-07',202632,8,2026,7,31,202608,2026), -('2026-08-08',202632,8,2026,8,31,202608,2026), -('2026-08-09',202633,8,2026,9,32,202608,2026), -('2026-08-10',202633,8,2026,10,32,202608,2026), -('2026-08-11',202633,8,2026,11,32,202608,2026), -('2026-08-12',202633,8,2026,12,32,202608,2026), -('2026-08-13',202633,8,2026,13,32,202608,2026), -('2026-08-14',202633,8,2026,14,32,202608,2026), -('2026-08-15',202633,8,2026,15,32,202608,2026), -('2026-08-16',202634,8,2026,16,33,202608,2026), -('2026-08-17',202634,8,2026,17,33,202608,2026), -('2026-08-18',202634,8,2026,18,33,202608,2026), -('2026-08-19',202634,8,2026,19,33,202608,2026), -('2026-08-20',202634,8,2026,20,33,202608,2026), -('2026-08-21',202634,8,2026,21,33,202608,2026), -('2026-08-22',202634,8,2026,22,33,202608,2026), -('2026-08-23',202635,8,2026,23,34,202608,2026), -('2026-08-24',202635,8,2026,24,34,202608,2026), -('2026-08-25',202635,8,2026,25,34,202608,2026), -('2026-08-26',202635,8,2026,26,34,202608,2026), -('2026-08-27',202635,8,2026,27,34,202608,2026), -('2026-08-28',202635,8,2026,28,34,202608,2026), -('2026-08-29',202635,8,2026,29,34,202608,2026), -('2026-08-30',202636,8,2026,30,35,202608,2026), -('2026-08-31',202636,8,2026,31,35,202608,2026), -('2026-09-01',202636,9,2026,1,35,202609,2026), -('2026-09-02',202636,9,2026,2,35,202609,2026), -('2026-09-03',202636,9,2026,3,35,202609,2026), -('2026-09-04',202636,9,2026,4,35,202609,2026), -('2026-09-05',202636,9,2026,5,35,202609,2026), -('2026-09-06',202637,9,2026,6,36,202609,2026), -('2026-09-07',202637,9,2026,7,36,202609,2026), -('2026-09-08',202637,9,2026,8,36,202609,2026), -('2026-09-09',202637,9,2026,9,36,202609,2026), -('2026-09-10',202637,9,2026,10,36,202609,2026), -('2026-09-11',202637,9,2026,11,36,202609,2026), -('2026-09-12',202637,9,2026,12,36,202609,2026), -('2026-09-13',202638,9,2026,13,37,202609,2026), -('2026-09-14',202638,9,2026,14,37,202609,2026), -('2026-09-15',202638,9,2026,15,37,202609,2026), -('2026-09-16',202638,9,2026,16,37,202609,2026), -('2026-09-17',202638,9,2026,17,37,202609,2026), -('2026-09-18',202638,9,2026,18,37,202609,2026), -('2026-09-19',202638,9,2026,19,37,202609,2026), -('2026-09-20',202639,9,2026,20,38,202609,2026), -('2026-09-21',202639,9,2026,21,38,202609,2026), -('2026-09-22',202639,9,2026,22,38,202609,2026), -('2026-09-23',202639,9,2026,23,38,202609,2026), -('2026-09-24',202639,9,2026,24,38,202609,2026), -('2026-09-25',202639,9,2026,25,38,202609,2026), -('2026-09-26',202639,9,2026,26,38,202609,2026), -('2026-09-27',202640,9,2026,27,39,202609,2026), -('2026-09-28',202640,9,2026,28,39,202609,2026), -('2026-09-29',202640,9,2026,29,39,202609,2026), -('2026-09-30',202640,9,2026,30,39,202609,2026), -('2026-10-01',202640,10,2026,1,39,202610,2026), -('2026-10-02',202640,10,2026,2,39,202610,2026), -('2026-10-03',202640,10,2026,3,39,202610,2026), -('2026-10-04',202641,10,2026,4,40,202610,2026), -('2026-10-05',202641,10,2026,5,40,202610,2026), -('2026-10-06',202641,10,2026,6,40,202610,2026), -('2026-10-07',202641,10,2026,7,40,202610,2026), -('2026-10-08',202641,10,2026,8,40,202610,2026), -('2026-10-09',202641,10,2026,9,40,202610,2026), -('2026-10-10',202641,10,2026,10,40,202610,2026), -('2026-10-11',202642,10,2026,11,41,202610,2026), -('2026-10-12',202642,10,2026,12,41,202610,2026), -('2026-10-13',202642,10,2026,13,41,202610,2026), -('2026-10-14',202642,10,2026,14,41,202610,2026), -('2026-10-15',202642,10,2026,15,41,202610,2026), -('2026-10-16',202642,10,2026,16,41,202610,2026), -('2026-10-17',202642,10,2026,17,41,202610,2026), -('2026-10-18',202643,10,2026,18,42,202610,2026), -('2026-10-19',202643,10,2026,19,42,202610,2026), -('2026-10-20',202643,10,2026,20,42,202610,2026), -('2026-10-21',202643,10,2026,21,42,202610,2026), -('2026-10-22',202643,10,2026,22,42,202610,2026), -('2026-10-23',202643,10,2026,23,42,202610,2026), -('2026-10-24',202643,10,2026,24,42,202610,2026), -('2026-10-25',202644,10,2026,25,43,202610,2026), -('2026-10-26',202644,10,2026,26,43,202610,2026), -('2026-10-27',202644,10,2026,27,43,202610,2026), -('2026-10-28',202644,10,2026,28,43,202610,2026), -('2026-10-29',202644,10,2026,29,43,202610,2026), -('2026-10-30',202644,10,2026,30,43,202610,2026), -('2026-10-31',202644,10,2026,31,43,202610,2026), -('2026-11-01',202645,11,2026,1,44,202611,2026), -('2026-11-02',202645,11,2026,2,44,202611,2026), -('2026-11-03',202645,11,2026,3,44,202611,2026), -('2026-11-04',202645,11,2026,4,44,202611,2026), -('2026-11-05',202645,11,2026,5,44,202611,2026), -('2026-11-06',202645,11,2026,6,44,202611,2026), -('2026-11-07',202645,11,2026,7,44,202611,2026), -('2026-11-08',202646,11,2026,8,45,202611,2026), -('2026-11-09',202646,11,2026,9,45,202611,2026), -('2026-11-10',202646,11,2026,10,45,202611,2026), -('2026-11-11',202646,11,2026,11,45,202611,2026), -('2026-11-12',202646,11,2026,12,45,202611,2026), -('2026-11-13',202646,11,2026,13,45,202611,2026), -('2026-11-14',202646,11,2026,14,45,202611,2026), -('2026-11-15',202647,11,2026,15,46,202611,2026), -('2026-11-16',202647,11,2026,16,46,202611,2026), -('2026-11-17',202647,11,2026,17,46,202611,2026), -('2026-11-18',202647,11,2026,18,46,202611,2026), -('2026-11-19',202647,11,2026,19,46,202611,2026), -('2026-11-20',202647,11,2026,20,46,202611,2026), -('2026-11-21',202647,11,2026,21,46,202611,2026), -('2026-11-22',202648,11,2026,22,47,202611,2026), -('2026-11-23',202648,11,2026,23,47,202611,2026), -('2026-11-24',202648,11,2026,24,47,202611,2026), -('2026-11-25',202648,11,2026,25,47,202611,2026), -('2026-11-26',202648,11,2026,26,47,202611,2026), -('2026-11-27',202648,11,2026,27,47,202611,2026), -('2026-11-28',202648,11,2026,28,47,202611,2026), -('2026-11-29',202649,11,2026,29,48,202611,2026), -('2026-11-30',202649,11,2026,30,48,202611,2026), -('2026-12-01',202649,12,2026,1,48,202612,2027), -('2026-12-02',202649,12,2026,2,48,202612,2027), -('2026-12-03',202649,12,2026,3,48,202612,2027), -('2026-12-04',202649,12,2026,4,48,202612,2027), -('2026-12-05',202649,12,2026,5,48,202612,2027), -('2026-12-06',202650,12,2026,6,49,202612,2027), -('2026-12-07',202650,12,2026,7,49,202612,2027), -('2026-12-08',202650,12,2026,8,49,202612,2027), -('2026-12-09',202650,12,2026,9,49,202612,2027), -('2026-12-10',202650,12,2026,10,49,202612,2027), -('2026-12-11',202650,12,2026,11,49,202612,2027), -('2026-12-12',202650,12,2026,12,49,202612,2027), -('2026-12-13',202651,12,2026,13,50,202612,2027), -('2026-12-14',202651,12,2026,14,50,202612,2027), -('2026-12-15',202651,12,2026,15,50,202612,2027), -('2026-12-16',202651,12,2026,16,50,202612,2027), -('2026-12-17',202651,12,2026,17,50,202612,2027), -('2026-12-18',202651,12,2026,18,50,202612,2027), -('2026-12-19',202651,12,2026,19,50,202612,2027), -('2026-12-20',202652,12,2026,20,51,202612,2027), -('2026-12-21',202652,12,2026,21,51,202612,2027), -('2026-12-22',202652,12,2026,22,51,202612,2027), -('2026-12-23',202652,12,2026,23,51,202612,2027), -('2026-12-24',202652,12,2026,24,51,202612,2027), -('2026-12-25',202652,12,2026,25,51,202612,2027), -('2026-12-26',202652,12,2026,26,51,202612,2027), -('2026-12-27',202653,12,2026,27,52,202612,2027), -('2026-12-28',202653,12,2026,28,52,202612,2027), -('2026-12-29',202653,12,2026,29,52,202612,2027), -('2026-12-30',202653,12,2026,30,52,202612,2027), -('2026-12-31',202653,12,2026,31,52,202612,2027), -('2027-01-01',202753,1,2027,1,52,202701,2027), -('2027-01-02',202753,1,2027,2,52,202701,2027), -('2027-01-03',202754,1,2027,3,1,202701,2027), -('2027-01-04',202701,1,2027,4,1,202701,2027), -('2027-01-05',202701,1,2027,5,1,202701,2027), -('2027-01-06',202701,1,2027,6,1,202701,2027), -('2027-01-07',202701,1,2027,7,1,202701,2027), -('2027-01-08',202701,1,2027,8,1,202701,2027), -('2027-01-09',202701,1,2027,9,1,202701,2027), -('2027-01-10',202702,1,2027,10,2,202701,2027), -('2027-01-11',202702,1,2027,11,2,202701,2027), -('2027-01-12',202702,1,2027,12,2,202701,2027), -('2027-01-13',202702,1,2027,13,2,202701,2027), -('2027-01-14',202702,1,2027,14,2,202701,2027), -('2027-01-15',202702,1,2027,15,2,202701,2027), -('2027-01-16',202702,1,2027,16,2,202701,2027), -('2027-01-17',202703,1,2027,17,3,202701,2027), -('2027-01-18',202703,1,2027,18,3,202701,2027), -('2027-01-19',202703,1,2027,19,3,202701,2027), -('2027-01-20',202703,1,2027,20,3,202701,2027), -('2027-01-21',202703,1,2027,21,3,202701,2027), -('2027-01-22',202703,1,2027,22,3,202701,2027), -('2027-01-23',202703,1,2027,23,3,202701,2027), -('2027-01-24',202704,1,2027,24,4,202701,2027), -('2027-01-25',202704,1,2027,25,4,202701,2027), -('2027-01-26',202704,1,2027,26,4,202701,2027), -('2027-01-27',202704,1,2027,27,4,202701,2027), -('2027-01-28',202704,1,2027,28,4,202701,2027), -('2027-01-29',202704,1,2027,29,4,202701,2027), -('2027-01-30',202704,1,2027,30,4,202701,2027), -('2027-01-31',202705,1,2027,31,5,202701,2027), -('2027-02-01',202705,2,2027,1,5,202702,2027), -('2027-02-02',202705,2,2027,2,5,202702,2027), -('2027-02-03',202705,2,2027,3,5,202702,2027), -('2027-02-04',202705,2,2027,4,5,202702,2027), -('2027-02-05',202705,2,2027,5,5,202702,2027), -('2027-02-06',202705,2,2027,6,5,202702,2027), -('2027-02-07',202706,2,2027,7,6,202702,2027), -('2027-02-08',202706,2,2027,8,6,202702,2027), -('2027-02-09',202706,2,2027,9,6,202702,2027), -('2027-02-10',202706,2,2027,10,6,202702,2027), -('2027-02-11',202706,2,2027,11,6,202702,2027), -('2027-02-12',202706,2,2027,12,6,202702,2027), -('2027-02-13',202706,2,2027,13,6,202702,2027), -('2027-02-14',202707,2,2027,14,7,202702,2027), -('2027-02-15',202707,2,2027,15,7,202702,2027), -('2027-02-16',202707,2,2027,16,7,202702,2027), -('2027-02-17',202707,2,2027,17,7,202702,2027), -('2027-02-18',202707,2,2027,18,7,202702,2027), -('2027-02-19',202707,2,2027,19,7,202702,2027), -('2027-02-20',202707,2,2027,20,7,202702,2027), -('2027-02-21',202708,2,2027,21,8,202702,2027), -('2027-02-22',202708,2,2027,22,8,202702,2027), -('2027-02-23',202708,2,2027,23,8,202702,2027), -('2027-02-24',202708,2,2027,24,8,202702,2027), -('2027-02-25',202708,2,2027,25,8,202702,2027), -('2027-02-26',202708,2,2027,26,8,202702,2027), -('2027-02-27',202708,2,2027,27,8,202702,2027), -('2027-02-28',202709,2,2027,28,9,202702,2027), -('2027-03-01',202709,3,2027,1,9,202703,2027), -('2027-03-02',202709,3,2027,2,9,202703,2027), -('2027-03-03',202709,3,2027,3,9,202703,2027), -('2027-03-04',202709,3,2027,4,9,202703,2027), -('2027-03-05',202709,3,2027,5,9,202703,2027), -('2027-03-06',202709,3,2027,6,9,202703,2027), -('2027-03-07',202710,3,2027,7,10,202703,2027), -('2027-03-08',202710,3,2027,8,10,202703,2027), -('2027-03-09',202710,3,2027,9,10,202703,2027), -('2027-03-10',202710,3,2027,10,10,202703,2027), -('2027-03-11',202710,3,2027,11,10,202703,2027), -('2027-03-12',202710,3,2027,12,10,202703,2027), -('2027-03-13',202710,3,2027,13,10,202703,2027), -('2027-03-14',202711,3,2027,14,11,202703,2027), -('2027-03-15',202711,3,2027,15,11,202703,2027), -('2027-03-16',202711,3,2027,16,11,202703,2027), -('2027-03-17',202711,3,2027,17,11,202703,2027), -('2027-03-18',202711,3,2027,18,11,202703,2027), -('2027-03-19',202711,3,2027,19,11,202703,2027), -('2027-03-20',202711,3,2027,20,11,202703,2027), -('2027-03-21',202712,3,2027,21,12,202703,2027), -('2027-03-22',202712,3,2027,22,12,202703,2027), -('2027-03-23',202712,3,2027,23,12,202703,2027), -('2027-03-24',202712,3,2027,24,12,202703,2027), -('2027-03-25',202712,3,2027,25,12,202703,2027), -('2027-03-26',202712,3,2027,26,12,202703,2027), -('2027-03-27',202712,3,2027,27,12,202703,2027), -('2027-03-28',202713,3,2027,28,13,202703,2027), -('2027-03-29',202713,3,2027,29,13,202703,2027), -('2027-03-30',202713,3,2027,30,13,202703,2027), -('2027-03-31',202713,3,2027,31,13,202703,2027), -('2027-04-01',202713,4,2027,1,13,202704,2027), -('2027-04-02',202713,4,2027,2,13,202704,2027), -('2027-04-03',202713,4,2027,3,13,202704,2027), -('2027-04-04',202714,4,2027,4,14,202704,2027), -('2027-04-05',202714,4,2027,5,14,202704,2027), -('2027-04-06',202714,4,2027,6,14,202704,2027), -('2027-04-07',202714,4,2027,7,14,202704,2027), -('2027-04-08',202714,4,2027,8,14,202704,2027), -('2027-04-09',202714,4,2027,9,14,202704,2027), -('2027-04-10',202714,4,2027,10,14,202704,2027), -('2027-04-11',202715,4,2027,11,15,202704,2027), -('2027-04-12',202715,4,2027,12,15,202704,2027), -('2027-04-13',202715,4,2027,13,15,202704,2027), -('2027-04-14',202715,4,2027,14,15,202704,2027), -('2027-04-15',202715,4,2027,15,15,202704,2027), -('2027-04-16',202715,4,2027,16,15,202704,2027), -('2027-04-17',202715,4,2027,17,15,202704,2027), -('2027-04-18',202716,4,2027,18,16,202704,2027), -('2027-04-19',202716,4,2027,19,16,202704,2027), -('2027-04-20',202716,4,2027,20,16,202704,2027), -('2027-04-21',202716,4,2027,21,16,202704,2027), -('2027-04-22',202716,4,2027,22,16,202704,2027), -('2027-04-23',202716,4,2027,23,16,202704,2027), -('2027-04-24',202716,4,2027,24,16,202704,2027), -('2027-04-25',202717,4,2027,25,17,202704,2027), -('2027-04-26',202717,4,2027,26,17,202704,2027), -('2027-04-27',202717,4,2027,27,17,202704,2027), -('2027-04-28',202717,4,2027,28,17,202704,2027), -('2027-04-29',202717,4,2027,29,17,202704,2027), -('2027-04-30',202717,4,2027,30,17,202704,2027), -('2027-05-01',202717,5,2027,1,17,202705,2027), -('2027-05-02',202718,5,2027,2,18,202705,2027), -('2027-05-03',202718,5,2027,3,18,202705,2027), -('2027-05-04',202718,5,2027,4,18,202705,2027), -('2027-05-05',202718,5,2027,5,18,202705,2027), -('2027-05-06',202718,5,2027,6,18,202705,2027), -('2027-05-07',202718,5,2027,7,18,202705,2027), -('2027-05-08',202718,5,2027,8,18,202705,2027), -('2027-05-09',202719,5,2027,9,19,202705,2027), -('2027-05-10',202719,5,2027,10,19,202705,2027), -('2027-05-11',202719,5,2027,11,19,202705,2027), -('2027-05-12',202719,5,2027,12,19,202705,2027), -('2027-05-13',202719,5,2027,13,19,202705,2027), -('2027-05-14',202719,5,2027,14,19,202705,2027), -('2027-05-15',202719,5,2027,15,19,202705,2027), -('2027-05-16',202720,5,2027,16,20,202705,2027), -('2027-05-17',202720,5,2027,17,20,202705,2027), -('2027-05-18',202720,5,2027,18,20,202705,2027), -('2027-05-19',202720,5,2027,19,20,202705,2027), -('2027-05-20',202720,5,2027,20,20,202705,2027), -('2027-05-21',202720,5,2027,21,20,202705,2027), -('2027-05-22',202720,5,2027,22,20,202705,2027), -('2027-05-23',202721,5,2027,23,21,202705,2027), -('2027-05-24',202721,5,2027,24,21,202705,2027), -('2027-05-25',202721,5,2027,25,21,202705,2027), -('2027-05-26',202721,5,2027,26,21,202705,2027), -('2027-05-27',202721,5,2027,27,21,202705,2027), -('2027-05-28',202721,5,2027,28,21,202705,2027), -('2027-05-29',202721,5,2027,29,21,202705,2027), -('2027-05-30',202722,5,2027,30,22,202705,2027), -('2027-05-31',202722,5,2027,31,22,202705,2027), -('2027-06-01',202722,6,2027,1,22,202706,2027), -('2027-06-02',202722,6,2027,2,22,202706,2027), -('2027-06-03',202722,6,2027,3,22,202706,2027), -('2027-06-04',202722,6,2027,4,22,202706,2027), -('2027-06-05',202722,6,2027,5,22,202706,2027), -('2027-06-06',202723,6,2027,6,23,202706,2027), -('2027-06-07',202723,6,2027,7,23,202706,2027), -('2027-06-08',202723,6,2027,8,23,202706,2027), -('2027-06-09',202723,6,2027,9,23,202706,2027), -('2027-06-10',202723,6,2027,10,23,202706,2027), -('2027-06-11',202723,6,2027,11,23,202706,2027), -('2027-06-12',202723,6,2027,12,23,202706,2027), -('2027-06-13',202724,6,2027,13,24,202706,2027), -('2027-06-14',202724,6,2027,14,24,202706,2027), -('2027-06-15',202724,6,2027,15,24,202706,2027), -('2027-06-16',202724,6,2027,16,24,202706,2027), -('2027-06-17',202724,6,2027,17,24,202706,2027), -('2027-06-18',202724,6,2027,18,24,202706,2027), -('2027-06-19',202724,6,2027,19,24,202706,2027), -('2027-06-20',202725,6,2027,20,25,202706,2027), -('2027-06-21',202725,6,2027,21,25,202706,2027), -('2027-06-22',202725,6,2027,22,25,202706,2027), -('2027-06-23',202725,6,2027,23,25,202706,2027), -('2027-06-24',202725,6,2027,24,25,202706,2027), -('2027-06-25',202725,6,2027,25,25,202706,2027), -('2027-06-26',202725,6,2027,26,25,202706,2027), -('2027-06-27',202726,6,2027,27,26,202706,2027), -('2027-06-28',202726,6,2027,28,26,202706,2027), -('2027-06-29',202726,6,2027,29,26,202706,2027), -('2027-06-30',202726,6,2027,30,26,202706,2027), -('2027-07-01',202726,7,2027,1,26,202707,2027), -('2027-07-02',202726,7,2027,2,26,202707,2027), -('2027-07-03',202726,7,2027,3,26,202707,2027), -('2027-07-04',202727,7,2027,4,27,202707,2027), -('2027-07-05',202727,7,2027,5,27,202707,2027), -('2027-07-06',202727,7,2027,6,27,202707,2027), -('2027-07-07',202727,7,2027,7,27,202707,2027), -('2027-07-08',202727,7,2027,8,27,202707,2027), -('2027-07-09',202727,7,2027,9,27,202707,2027), -('2027-07-10',202727,7,2027,10,27,202707,2027), -('2027-07-11',202728,7,2027,11,28,202707,2027), -('2027-07-12',202728,7,2027,12,28,202707,2027), -('2027-07-13',202728,7,2027,13,28,202707,2027), -('2027-07-14',202728,7,2027,14,28,202707,2027), -('2027-07-15',202728,7,2027,15,28,202707,2027), -('2027-07-16',202728,7,2027,16,28,202707,2027), -('2027-07-17',202728,7,2027,17,28,202707,2027), -('2027-07-18',202729,7,2027,18,29,202707,2027), -('2027-07-19',202729,7,2027,19,29,202707,2027), -('2027-07-20',202729,7,2027,20,29,202707,2027), -('2027-07-21',202729,7,2027,21,29,202707,2027), -('2027-07-22',202729,7,2027,22,29,202707,2027), -('2027-07-23',202729,7,2027,23,29,202707,2027), -('2027-07-24',202729,7,2027,24,29,202707,2027), -('2027-07-25',202730,7,2027,25,30,202707,2027), -('2027-07-26',202730,7,2027,26,30,202707,2027), -('2027-07-27',202730,7,2027,27,30,202707,2027), -('2027-07-28',202730,7,2027,28,30,202707,2027), -('2027-07-29',202730,7,2027,29,30,202707,2027), -('2027-07-30',202730,7,2027,30,30,202707,2027), -('2027-07-31',202730,7,2027,31,30,202707,2027), -('2027-08-01',202731,8,2027,1,31,202708,2027), -('2027-08-02',202731,8,2027,2,31,202708,2027), -('2027-08-03',202731,8,2027,3,31,202708,2027), -('2027-08-04',202731,8,2027,4,31,202708,2027), -('2027-08-05',202731,8,2027,5,31,202708,2027), -('2027-08-06',202731,8,2027,6,31,202708,2027), -('2027-08-07',202731,8,2027,7,31,202708,2027), -('2027-08-08',202732,8,2027,8,32,202708,2027), -('2027-08-09',202732,8,2027,9,32,202708,2027), -('2027-08-10',202732,8,2027,10,32,202708,2027), -('2027-08-11',202732,8,2027,11,32,202708,2027), -('2027-08-12',202732,8,2027,12,32,202708,2027), -('2027-08-13',202732,8,2027,13,32,202708,2027), -('2027-08-14',202732,8,2027,14,32,202708,2027), -('2027-08-15',202733,8,2027,15,33,202708,2027), -('2027-08-16',202733,8,2027,16,33,202708,2027), -('2027-08-17',202733,8,2027,17,33,202708,2027), -('2027-08-18',202733,8,2027,18,33,202708,2027), -('2027-08-19',202733,8,2027,19,33,202708,2027), -('2027-08-20',202733,8,2027,20,33,202708,2027), -('2027-08-21',202733,8,2027,21,33,202708,2027), -('2027-08-22',202734,8,2027,22,34,202708,2027), -('2027-08-23',202734,8,2027,23,34,202708,2027), -('2027-08-24',202734,8,2027,24,34,202708,2027), -('2027-08-25',202734,8,2027,25,34,202708,2027), -('2027-08-26',202734,8,2027,26,34,202708,2027), -('2027-08-27',202734,8,2027,27,34,202708,2027), -('2027-08-28',202734,8,2027,28,34,202708,2027), -('2027-08-29',202735,8,2027,29,35,202708,2027), -('2027-08-30',202735,8,2027,30,35,202708,2027), -('2027-08-31',202735,8,2027,31,35,202708,2027), -('2027-09-01',202735,9,2027,1,35,202709,2027), -('2027-09-02',202735,9,2027,2,35,202709,2027), -('2027-09-03',202735,9,2027,3,35,202709,2027), -('2027-09-04',202735,9,2027,4,35,202709,2027), -('2027-09-05',202736,9,2027,5,36,202709,2027), -('2027-09-06',202736,9,2027,6,36,202709,2027), -('2027-09-07',202736,9,2027,7,36,202709,2027), -('2027-09-08',202736,9,2027,8,36,202709,2027), -('2027-09-09',202736,9,2027,9,36,202709,2027), -('2027-09-10',202736,9,2027,10,36,202709,2027), -('2027-09-11',202736,9,2027,11,36,202709,2027), -('2027-09-12',202737,9,2027,12,37,202709,2027), -('2027-09-13',202737,9,2027,13,37,202709,2027), -('2027-09-14',202737,9,2027,14,37,202709,2027), -('2027-09-15',202737,9,2027,15,37,202709,2027), -('2027-09-16',202737,9,2027,16,37,202709,2027), -('2027-09-17',202737,9,2027,17,37,202709,2027), -('2027-09-18',202737,9,2027,18,37,202709,2027), -('2027-09-19',202738,9,2027,19,38,202709,2027), -('2027-09-20',202738,9,2027,20,38,202709,2027), -('2027-09-21',202738,9,2027,21,38,202709,2027), -('2027-09-22',202738,9,2027,22,38,202709,2027), -('2027-09-23',202738,9,2027,23,38,202709,2027), -('2027-09-24',202738,9,2027,24,38,202709,2027), -('2027-09-25',202738,9,2027,25,38,202709,2027), -('2027-09-26',202739,9,2027,26,39,202709,2027), -('2027-09-27',202739,9,2027,27,39,202709,2027), -('2027-09-28',202739,9,2027,28,39,202709,2027), -('2027-09-29',202739,9,2027,29,39,202709,2027), -('2027-09-30',202739,9,2027,30,39,202709,2027), -('2027-10-01',202739,10,2027,1,39,202710,2027), -('2027-10-02',202739,10,2027,2,39,202710,2027), -('2027-10-03',202740,10,2027,3,40,202710,2027), -('2027-10-04',202740,10,2027,4,40,202710,2027), -('2027-10-05',202740,10,2027,5,40,202710,2027), -('2027-10-06',202740,10,2027,6,40,202710,2027), -('2027-10-07',202740,10,2027,7,40,202710,2027), -('2027-10-08',202740,10,2027,8,40,202710,2027), -('2027-10-09',202740,10,2027,9,40,202710,2027), -('2027-10-10',202741,10,2027,10,41,202710,2027), -('2027-10-11',202741,10,2027,11,41,202710,2027), -('2027-10-12',202741,10,2027,12,41,202710,2027), -('2027-10-13',202741,10,2027,13,41,202710,2027), -('2027-10-14',202741,10,2027,14,41,202710,2027), -('2027-10-15',202741,10,2027,15,41,202710,2027), -('2027-10-16',202741,10,2027,16,41,202710,2027), -('2027-10-17',202742,10,2027,17,42,202710,2027), -('2027-10-18',202742,10,2027,18,42,202710,2027), -('2027-10-19',202742,10,2027,19,42,202710,2027), -('2027-10-20',202742,10,2027,20,42,202710,2027), -('2027-10-21',202742,10,2027,21,42,202710,2027), -('2027-10-22',202742,10,2027,22,42,202710,2027), -('2027-10-23',202742,10,2027,23,42,202710,2027), -('2027-10-24',202743,10,2027,24,43,202710,2027), -('2027-10-25',202743,10,2027,25,43,202710,2027), -('2027-10-26',202743,10,2027,26,43,202710,2027), -('2027-10-27',202743,10,2027,27,43,202710,2027), -('2027-10-28',202743,10,2027,28,43,202710,2027), -('2027-10-29',202743,10,2027,29,43,202710,2027), -('2027-10-30',202743,10,2027,30,43,202710,2027), -('2027-10-31',202744,10,2027,31,44,202710,2027), -('2027-11-01',202744,11,2027,1,44,202711,2027), -('2027-11-02',202744,11,2027,2,44,202711,2027), -('2027-11-03',202744,11,2027,3,44,202711,2027), -('2027-11-04',202744,11,2027,4,44,202711,2027), -('2027-11-05',202744,11,2027,5,44,202711,2027), -('2027-11-06',202744,11,2027,6,44,202711,2027), -('2027-11-07',202745,11,2027,7,45,202711,2027), -('2027-11-08',202745,11,2027,8,45,202711,2027), -('2027-11-09',202745,11,2027,9,45,202711,2027), -('2027-11-10',202745,11,2027,10,45,202711,2027), -('2027-11-11',202745,11,2027,11,45,202711,2027), -('2027-11-12',202745,11,2027,12,45,202711,2027), -('2027-11-13',202745,11,2027,13,45,202711,2027), -('2027-11-14',202746,11,2027,14,46,202711,2027), -('2027-11-15',202746,11,2027,15,46,202711,2027), -('2027-11-16',202746,11,2027,16,46,202711,2027), -('2027-11-17',202746,11,2027,17,46,202711,2027), -('2027-11-18',202746,11,2027,18,46,202711,2027), -('2027-11-19',202746,11,2027,19,46,202711,2027), -('2027-11-20',202746,11,2027,20,46,202711,2027), -('2027-11-21',202747,11,2027,21,47,202711,2027), -('2027-11-22',202747,11,2027,22,47,202711,2027), -('2027-11-23',202747,11,2027,23,47,202711,2027), -('2027-11-24',202747,11,2027,24,47,202711,2027), -('2027-11-25',202747,11,2027,25,47,202711,2027), -('2027-11-26',202747,11,2027,26,47,202711,2027), -('2027-11-27',202747,11,2027,27,47,202711,2027), -('2027-11-28',202748,11,2027,28,48,202711,2027), -('2027-11-29',202748,11,2027,29,48,202711,2027), -('2027-11-30',202748,11,2027,30,48,202711,2027), -('2027-12-01',202748,12,2027,1,48,202712,2028), -('2027-12-02',202748,12,2027,2,48,202712,2028), -('2027-12-03',202748,12,2027,3,48,202712,2028), -('2027-12-04',202748,12,2027,4,48,202712,2028), -('2027-12-05',202749,12,2027,5,49,202712,2028), -('2027-12-06',202749,12,2027,6,49,202712,2028), -('2027-12-07',202749,12,2027,7,49,202712,2028), -('2027-12-08',202749,12,2027,8,49,202712,2028), -('2027-12-09',202749,12,2027,9,49,202712,2028), -('2027-12-10',202749,12,2027,10,49,202712,2028), -('2027-12-11',202749,12,2027,11,49,202712,2028), -('2027-12-12',202750,12,2027,12,50,202712,2028), -('2027-12-13',202750,12,2027,13,50,202712,2028), -('2027-12-14',202750,12,2027,14,50,202712,2028), -('2027-12-15',202750,12,2027,15,50,202712,2028), -('2027-12-16',202750,12,2027,16,50,202712,2028), -('2027-12-17',202750,12,2027,17,50,202712,2028), -('2027-12-18',202750,12,2027,18,50,202712,2028), -('2027-12-19',202751,12,2027,19,51,202712,2028), -('2027-12-20',202751,12,2027,20,51,202712,2028), -('2027-12-21',202751,12,2027,21,51,202712,2028), -('2027-12-22',202751,12,2027,22,51,202712,2028), -('2027-12-23',202751,12,2027,23,51,202712,2028), -('2027-12-24',202751,12,2027,24,51,202712,2028), -('2027-12-25',202751,12,2027,25,51,202712,2028), -('2027-12-26',202752,12,2027,26,52,202712,2028), -('2027-12-27',202752,12,2027,27,52,202712,2028), -('2027-12-28',202752,12,2027,28,52,202712,2028), -('2027-12-29',202752,12,2027,29,52,202712,2028), -('2027-12-30',202752,12,2027,30,52,202712,2028), -('2027-12-31',202752,12,2027,31,52,202712,2028), -('2028-01-01',202852,1,2028,1,52,202801,2028), -('2028-01-02',202853,1,2028,2,1,202801,2028), -('2028-01-03',202801,1,2028,3,1,202801,2028), -('2028-01-04',202801,1,2028,4,1,202801,2028), -('2028-01-05',202801,1,2028,5,1,202801,2028), -('2028-01-06',202801,1,2028,6,1,202801,2028), -('2028-01-07',202801,1,2028,7,1,202801,2028), -('2028-01-08',202801,1,2028,8,1,202801,2028), -('2028-01-09',202802,1,2028,9,2,202801,2028), -('2028-01-10',202802,1,2028,10,2,202801,2028), -('2028-01-11',202802,1,2028,11,2,202801,2028), -('2028-01-12',202802,1,2028,12,2,202801,2028), -('2028-01-13',202802,1,2028,13,2,202801,2028), -('2028-01-14',202802,1,2028,14,2,202801,2028), -('2028-01-15',202802,1,2028,15,2,202801,2028), -('2028-01-16',202803,1,2028,16,3,202801,2028), -('2028-01-17',202803,1,2028,17,3,202801,2028), -('2028-01-18',202803,1,2028,18,3,202801,2028), -('2028-01-19',202803,1,2028,19,3,202801,2028), -('2028-01-20',202803,1,2028,20,3,202801,2028), -('2028-01-21',202803,1,2028,21,3,202801,2028), -('2028-01-22',202803,1,2028,22,3,202801,2028), -('2028-01-23',202804,1,2028,23,4,202801,2028), -('2028-01-24',202804,1,2028,24,4,202801,2028), -('2028-01-25',202804,1,2028,25,4,202801,2028), -('2028-01-26',202804,1,2028,26,4,202801,2028), -('2028-01-27',202804,1,2028,27,4,202801,2028), -('2028-01-28',202804,1,2028,28,4,202801,2028), -('2028-01-29',202804,1,2028,29,4,202801,2028), -('2028-01-30',202805,1,2028,30,5,202801,2028), -('2028-01-31',202805,1,2028,31,5,202801,2028), -('2028-02-01',202805,2,2028,1,5,202802,2028), -('2028-02-02',202805,2,2028,2,5,202802,2028), -('2028-02-03',202805,2,2028,3,5,202802,2028), -('2028-02-04',202805,2,2028,4,5,202802,2028), -('2028-02-05',202805,2,2028,5,5,202802,2028), -('2028-02-06',202806,2,2028,6,6,202802,2028), -('2028-02-07',202806,2,2028,7,6,202802,2028), -('2028-02-08',202806,2,2028,8,6,202802,2028), -('2028-02-09',202806,2,2028,9,6,202802,2028), -('2028-02-10',202806,2,2028,10,6,202802,2028), -('2028-02-11',202806,2,2028,11,6,202802,2028), -('2028-02-12',202806,2,2028,12,6,202802,2028), -('2028-02-13',202807,2,2028,13,7,202802,2028), -('2028-02-14',202807,2,2028,14,7,202802,2028), -('2028-02-15',202807,2,2028,15,7,202802,2028), -('2028-02-16',202807,2,2028,16,7,202802,2028), -('2028-02-17',202807,2,2028,17,7,202802,2028), -('2028-02-18',202807,2,2028,18,7,202802,2028), -('2028-02-19',202807,2,2028,19,7,202802,2028), -('2028-02-20',202808,2,2028,20,8,202802,2028), -('2028-02-21',202808,2,2028,21,8,202802,2028), -('2028-02-22',202808,2,2028,22,8,202802,2028), -('2028-02-23',202808,2,2028,23,8,202802,2028), -('2028-02-24',202808,2,2028,24,8,202802,2028), -('2028-02-25',202808,2,2028,25,8,202802,2028), -('2028-02-26',202808,2,2028,26,8,202802,2028), -('2028-02-27',202809,2,2028,27,9,202802,2028), -('2028-02-28',202809,2,2028,28,9,202802,2028), -('2028-02-29',202809,2,2028,29,9,202802,2028), -('2028-03-01',202809,3,2028,1,9,202803,2028), -('2028-03-02',202809,3,2028,2,9,202803,2028), -('2028-03-03',202809,3,2028,3,9,202803,2028), -('2028-03-04',202809,3,2028,4,9,202803,2028), -('2028-03-05',202810,3,2028,5,10,202803,2028), -('2028-03-06',202810,3,2028,6,10,202803,2028), -('2028-03-07',202810,3,2028,7,10,202803,2028), -('2028-03-08',202810,3,2028,8,10,202803,2028), -('2028-03-09',202810,3,2028,9,10,202803,2028), -('2028-03-10',202810,3,2028,10,10,202803,2028), -('2028-03-11',202810,3,2028,11,10,202803,2028), -('2028-03-12',202811,3,2028,12,11,202803,2028), -('2028-03-13',202811,3,2028,13,11,202803,2028), -('2028-03-14',202811,3,2028,14,11,202803,2028), -('2028-03-15',202811,3,2028,15,11,202803,2028), -('2028-03-16',202811,3,2028,16,11,202803,2028), -('2028-03-17',202811,3,2028,17,11,202803,2028), -('2028-03-18',202811,3,2028,18,11,202803,2028), -('2028-03-19',202812,3,2028,19,12,202803,2028), -('2028-03-20',202812,3,2028,20,12,202803,2028), -('2028-03-21',202812,3,2028,21,12,202803,2028), -('2028-03-22',202812,3,2028,22,12,202803,2028), -('2028-03-23',202812,3,2028,23,12,202803,2028), -('2028-03-24',202812,3,2028,24,12,202803,2028), -('2028-03-25',202812,3,2028,25,12,202803,2028), -('2028-03-26',202813,3,2028,26,13,202803,2028), -('2028-03-27',202813,3,2028,27,13,202803,2028), -('2028-03-28',202813,3,2028,28,13,202803,2028), -('2028-03-29',202813,3,2028,29,13,202803,2028), -('2028-03-30',202813,3,2028,30,13,202803,2028), -('2028-03-31',202813,3,2028,31,13,202803,2028), -('2028-04-01',202813,4,2028,1,13,202804,2028), -('2028-04-02',202814,4,2028,2,14,202804,2028), -('2028-04-03',202814,4,2028,3,14,202804,2028), -('2028-04-04',202814,4,2028,4,14,202804,2028), -('2028-04-05',202814,4,2028,5,14,202804,2028), -('2028-04-06',202814,4,2028,6,14,202804,2028), -('2028-04-07',202814,4,2028,7,14,202804,2028), -('2028-04-08',202814,4,2028,8,14,202804,2028), -('2028-04-09',202815,4,2028,9,15,202804,2028), -('2028-04-10',202815,4,2028,10,15,202804,2028), -('2028-04-11',202815,4,2028,11,15,202804,2028), -('2028-04-12',202815,4,2028,12,15,202804,2028), -('2028-04-13',202815,4,2028,13,15,202804,2028), -('2028-04-14',202815,4,2028,14,15,202804,2028), -('2028-04-15',202815,4,2028,15,15,202804,2028), -('2028-04-16',202816,4,2028,16,16,202804,2028), -('2028-04-17',202816,4,2028,17,16,202804,2028), -('2028-04-18',202816,4,2028,18,16,202804,2028), -('2028-04-19',202816,4,2028,19,16,202804,2028), -('2028-04-20',202816,4,2028,20,16,202804,2028), -('2028-04-21',202816,4,2028,21,16,202804,2028), -('2028-04-22',202816,4,2028,22,16,202804,2028), -('2028-04-23',202817,4,2028,23,17,202804,2028), -('2028-04-24',202817,4,2028,24,17,202804,2028), -('2028-04-25',202817,4,2028,25,17,202804,2028), -('2028-04-26',202817,4,2028,26,17,202804,2028), -('2028-04-27',202817,4,2028,27,17,202804,2028), -('2028-04-28',202817,4,2028,28,17,202804,2028), -('2028-04-29',202817,4,2028,29,17,202804,2028), -('2028-04-30',202818,4,2028,30,18,202804,2028), -('2028-05-01',202818,5,2028,1,18,202805,2028), -('2028-05-02',202818,5,2028,2,18,202805,2028), -('2028-05-03',202818,5,2028,3,18,202805,2028), -('2028-05-04',202818,5,2028,4,18,202805,2028), -('2028-05-05',202818,5,2028,5,18,202805,2028), -('2028-05-06',202818,5,2028,6,18,202805,2028), -('2028-05-07',202819,5,2028,7,19,202805,2028), -('2028-05-08',202819,5,2028,8,19,202805,2028), -('2028-05-09',202819,5,2028,9,19,202805,2028), -('2028-05-10',202819,5,2028,10,19,202805,2028), -('2028-05-11',202819,5,2028,11,19,202805,2028), -('2028-05-12',202819,5,2028,12,19,202805,2028), -('2028-05-13',202819,5,2028,13,19,202805,2028), -('2028-05-14',202820,5,2028,14,20,202805,2028), -('2028-05-15',202820,5,2028,15,20,202805,2028), -('2028-05-16',202820,5,2028,16,20,202805,2028), -('2028-05-17',202820,5,2028,17,20,202805,2028), -('2028-05-18',202820,5,2028,18,20,202805,2028), -('2028-05-19',202820,5,2028,19,20,202805,2028), -('2028-05-20',202820,5,2028,20,20,202805,2028), -('2028-05-21',202821,5,2028,21,21,202805,2028), -('2028-05-22',202821,5,2028,22,21,202805,2028), -('2028-05-23',202821,5,2028,23,21,202805,2028), -('2028-05-24',202821,5,2028,24,21,202805,2028), -('2028-05-25',202821,5,2028,25,21,202805,2028), -('2028-05-26',202821,5,2028,26,21,202805,2028), -('2028-05-27',202821,5,2028,27,21,202805,2028), -('2028-05-28',202822,5,2028,28,22,202805,2028), -('2028-05-29',202822,5,2028,29,22,202805,2028), -('2028-05-30',202822,5,2028,30,22,202805,2028), -('2028-05-31',202822,5,2028,31,22,202805,2028), -('2028-06-01',202822,6,2028,1,22,202806,2028), -('2028-06-02',202822,6,2028,2,22,202806,2028), -('2028-06-03',202822,6,2028,3,22,202806,2028), -('2028-06-04',202823,6,2028,4,23,202806,2028), -('2028-06-05',202823,6,2028,5,23,202806,2028), -('2028-06-06',202823,6,2028,6,23,202806,2028), -('2028-06-07',202823,6,2028,7,23,202806,2028), -('2028-06-08',202823,6,2028,8,23,202806,2028), -('2028-06-09',202823,6,2028,9,23,202806,2028), -('2028-06-10',202823,6,2028,10,23,202806,2028), -('2028-06-11',202824,6,2028,11,24,202806,2028), -('2028-06-12',202824,6,2028,12,24,202806,2028), -('2028-06-13',202824,6,2028,13,24,202806,2028), -('2028-06-14',202824,6,2028,14,24,202806,2028), -('2028-06-15',202824,6,2028,15,24,202806,2028), -('2028-06-16',202824,6,2028,16,24,202806,2028), -('2028-06-17',202824,6,2028,17,24,202806,2028), -('2028-06-18',202825,6,2028,18,25,202806,2028), -('2028-06-19',202825,6,2028,19,25,202806,2028), -('2028-06-20',202825,6,2028,20,25,202806,2028), -('2028-06-21',202825,6,2028,21,25,202806,2028), -('2028-06-22',202825,6,2028,22,25,202806,2028), -('2028-06-23',202825,6,2028,23,25,202806,2028), -('2028-06-24',202825,6,2028,24,25,202806,2028), -('2028-06-25',202826,6,2028,25,26,202806,2028), -('2028-06-26',202826,6,2028,26,26,202806,2028), -('2028-06-27',202826,6,2028,27,26,202806,2028), -('2028-06-28',202826,6,2028,28,26,202806,2028), -('2028-06-29',202826,6,2028,29,26,202806,2028), -('2028-06-30',202826,6,2028,30,26,202806,2028), -('2028-07-01',202826,7,2028,1,26,202807,2028), -('2028-07-02',202827,7,2028,2,27,202807,2028), -('2028-07-03',202827,7,2028,3,27,202807,2028), -('2028-07-04',202827,7,2028,4,27,202807,2028), -('2028-07-05',202827,7,2028,5,27,202807,2028), -('2028-07-06',202827,7,2028,6,27,202807,2028), -('2028-07-07',202827,7,2028,7,27,202807,2028), -('2028-07-08',202827,7,2028,8,27,202807,2028), -('2028-07-09',202828,7,2028,9,28,202807,2028), -('2028-07-10',202828,7,2028,10,28,202807,2028), -('2028-07-11',202828,7,2028,11,28,202807,2028), -('2028-07-12',202828,7,2028,12,28,202807,2028), -('2028-07-13',202828,7,2028,13,28,202807,2028), -('2028-07-14',202828,7,2028,14,28,202807,2028), -('2028-07-15',202828,7,2028,15,28,202807,2028), -('2028-07-16',202829,7,2028,16,29,202807,2028), -('2028-07-17',202829,7,2028,17,29,202807,2028), -('2028-07-18',202829,7,2028,18,29,202807,2028), -('2028-07-19',202829,7,2028,19,29,202807,2028), -('2028-07-20',202829,7,2028,20,29,202807,2028), -('2028-07-21',202829,7,2028,21,29,202807,2028), -('2028-07-22',202829,7,2028,22,29,202807,2028), -('2028-07-23',202830,7,2028,23,30,202807,2028), -('2028-07-24',202830,7,2028,24,30,202807,2028), -('2028-07-25',202830,7,2028,25,30,202807,2028), -('2028-07-26',202830,7,2028,26,30,202807,2028), -('2028-07-27',202830,7,2028,27,30,202807,2028), -('2028-07-28',202830,7,2028,28,30,202807,2028), -('2028-07-29',202830,7,2028,29,30,202807,2028), -('2028-07-30',202831,7,2028,30,31,202807,2028), -('2028-07-31',202831,7,2028,31,31,202807,2028), -('2028-08-01',202831,8,2028,1,31,202808,2028), -('2028-08-02',202831,8,2028,2,31,202808,2028), -('2028-08-03',202831,8,2028,3,31,202808,2028), -('2028-08-04',202831,8,2028,4,31,202808,2028), -('2028-08-05',202831,8,2028,5,31,202808,2028), -('2028-08-06',202832,8,2028,6,32,202808,2028), -('2028-08-07',202832,8,2028,7,32,202808,2028), -('2028-08-08',202832,8,2028,8,32,202808,2028), -('2028-08-09',202832,8,2028,9,32,202808,2028), -('2028-08-10',202832,8,2028,10,32,202808,2028), -('2028-08-11',202832,8,2028,11,32,202808,2028), -('2028-08-12',202832,8,2028,12,32,202808,2028), -('2028-08-13',202833,8,2028,13,33,202808,2028), -('2028-08-14',202833,8,2028,14,33,202808,2028), -('2028-08-15',202833,8,2028,15,33,202808,2028), -('2028-08-16',202833,8,2028,16,33,202808,2028), -('2028-08-17',202833,8,2028,17,33,202808,2028), -('2028-08-18',202833,8,2028,18,33,202808,2028), -('2028-08-19',202833,8,2028,19,33,202808,2028), -('2028-08-20',202834,8,2028,20,34,202808,2028), -('2028-08-21',202834,8,2028,21,34,202808,2028), -('2028-08-22',202834,8,2028,22,34,202808,2028), -('2028-08-23',202834,8,2028,23,34,202808,2028), -('2028-08-24',202834,8,2028,24,34,202808,2028), -('2028-08-25',202834,8,2028,25,34,202808,2028), -('2028-08-26',202834,8,2028,26,34,202808,2028), -('2028-08-27',202835,8,2028,27,35,202808,2028), -('2028-08-28',202835,8,2028,28,35,202808,2028), -('2028-08-29',202835,8,2028,29,35,202808,2028), -('2028-08-30',202835,8,2028,30,35,202808,2028), -('2028-08-31',202835,8,2028,31,35,202808,2028), -('2028-09-01',202835,9,2028,1,35,202809,2028), -('2028-09-02',202835,9,2028,2,35,202809,2028), -('2028-09-03',202836,9,2028,3,36,202809,2028), -('2028-09-04',202836,9,2028,4,36,202809,2028), -('2028-09-05',202836,9,2028,5,36,202809,2028), -('2028-09-06',202836,9,2028,6,36,202809,2028), -('2028-09-07',202836,9,2028,7,36,202809,2028), -('2028-09-08',202836,9,2028,8,36,202809,2028), -('2028-09-09',202836,9,2028,9,36,202809,2028), -('2028-09-10',202837,9,2028,10,37,202809,2028), -('2028-09-11',202837,9,2028,11,37,202809,2028), -('2028-09-12',202837,9,2028,12,37,202809,2028), -('2028-09-13',202837,9,2028,13,37,202809,2028), -('2028-09-14',202837,9,2028,14,37,202809,2028), -('2028-09-15',202837,9,2028,15,37,202809,2028), -('2028-09-16',202837,9,2028,16,37,202809,2028), -('2028-09-17',202838,9,2028,17,38,202809,2028), -('2028-09-18',202838,9,2028,18,38,202809,2028), -('2028-09-19',202838,9,2028,19,38,202809,2028), -('2028-09-20',202838,9,2028,20,38,202809,2028), -('2028-09-21',202838,9,2028,21,38,202809,2028), -('2028-09-22',202838,9,2028,22,38,202809,2028), -('2028-09-23',202838,9,2028,23,38,202809,2028), -('2028-09-24',202839,9,2028,24,39,202809,2028), -('2028-09-25',202839,9,2028,25,39,202809,2028), -('2028-09-26',202839,9,2028,26,39,202809,2028), -('2028-09-27',202839,9,2028,27,39,202809,2028), -('2028-09-28',202839,9,2028,28,39,202809,2028), -('2028-09-29',202839,9,2028,29,39,202809,2028), -('2028-09-30',202839,9,2028,30,39,202809,2028), -('2028-10-01',202840,10,2028,1,40,202810,2028), -('2028-10-02',202840,10,2028,2,40,202810,2028), -('2028-10-03',202840,10,2028,3,40,202810,2028), -('2028-10-04',202840,10,2028,4,40,202810,2028), -('2028-10-05',202840,10,2028,5,40,202810,2028), -('2028-10-06',202840,10,2028,6,40,202810,2028), -('2028-10-07',202840,10,2028,7,40,202810,2028), -('2028-10-08',202841,10,2028,8,41,202810,2028), -('2028-10-09',202841,10,2028,9,41,202810,2028), -('2028-10-10',202841,10,2028,10,41,202810,2028), -('2028-10-11',202841,10,2028,11,41,202810,2028), -('2028-10-12',202841,10,2028,12,41,202810,2028), -('2028-10-13',202841,10,2028,13,41,202810,2028), -('2028-10-14',202841,10,2028,14,41,202810,2028), -('2028-10-15',202842,10,2028,15,42,202810,2028), -('2028-10-16',202842,10,2028,16,42,202810,2028), -('2028-10-17',202842,10,2028,17,42,202810,2028), -('2028-10-18',202842,10,2028,18,42,202810,2028), -('2028-10-19',202842,10,2028,19,42,202810,2028), -('2028-10-20',202842,10,2028,20,42,202810,2028), -('2028-10-21',202842,10,2028,21,42,202810,2028), -('2028-10-22',202843,10,2028,22,43,202810,2028), -('2028-10-23',202843,10,2028,23,43,202810,2028), -('2028-10-24',202843,10,2028,24,43,202810,2028), -('2028-10-25',202843,10,2028,25,43,202810,2028), -('2028-10-26',202843,10,2028,26,43,202810,2028), -('2028-10-27',202843,10,2028,27,43,202810,2028), -('2028-10-28',202843,10,2028,28,43,202810,2028), -('2028-10-29',202844,10,2028,29,44,202810,2028), -('2028-10-30',202844,10,2028,30,44,202810,2028), -('2028-10-31',202844,10,2028,31,44,202810,2028), -('2028-11-01',202844,11,2028,1,44,202811,2028), -('2028-11-02',202844,11,2028,2,44,202811,2028), -('2028-11-03',202844,11,2028,3,44,202811,2028), -('2028-11-04',202844,11,2028,4,44,202811,2028), -('2028-11-05',202845,11,2028,5,45,202811,2028), -('2028-11-06',202845,11,2028,6,45,202811,2028), -('2028-11-07',202845,11,2028,7,45,202811,2028), -('2028-11-08',202845,11,2028,8,45,202811,2028), -('2028-11-09',202845,11,2028,9,45,202811,2028), -('2028-11-10',202845,11,2028,10,45,202811,2028), -('2028-11-11',202845,11,2028,11,45,202811,2028), -('2028-11-12',202846,11,2028,12,46,202811,2028), -('2028-11-13',202846,11,2028,13,46,202811,2028), -('2028-11-14',202846,11,2028,14,46,202811,2028), -('2028-11-15',202846,11,2028,15,46,202811,2028), -('2028-11-16',202846,11,2028,16,46,202811,2028), -('2028-11-17',202846,11,2028,17,46,202811,2028), -('2028-11-18',202846,11,2028,18,46,202811,2028), -('2028-11-19',202847,11,2028,19,47,202811,2028), -('2028-11-20',202847,11,2028,20,47,202811,2028), -('2028-11-21',202847,11,2028,21,47,202811,2028), -('2028-11-22',202847,11,2028,22,47,202811,2028), -('2028-11-23',202847,11,2028,23,47,202811,2028), -('2028-11-24',202847,11,2028,24,47,202811,2028), -('2028-11-25',202847,11,2028,25,47,202811,2028), -('2028-11-26',202848,11,2028,26,48,202811,2028), -('2028-11-27',202848,11,2028,27,48,202811,2028), -('2028-11-28',202848,11,2028,28,48,202811,2028), -('2028-11-29',202848,11,2028,29,48,202811,2028), -('2028-11-30',202848,11,2028,30,48,202811,2028), -('2028-12-01',202848,12,2028,1,48,202812,2029), -('2028-12-02',202848,12,2028,2,48,202812,2029), -('2028-12-03',202849,12,2028,3,49,202812,2029), -('2028-12-04',202849,12,2028,4,49,202812,2029), -('2028-12-05',202849,12,2028,5,49,202812,2029), -('2028-12-06',202849,12,2028,6,49,202812,2029), -('2028-12-07',202849,12,2028,7,49,202812,2029), -('2028-12-08',202849,12,2028,8,49,202812,2029), -('2028-12-09',202849,12,2028,9,49,202812,2029), -('2028-12-10',202850,12,2028,10,50,202812,2029), -('2028-12-11',202850,12,2028,11,50,202812,2029), -('2028-12-12',202850,12,2028,12,50,202812,2029), -('2028-12-13',202850,12,2028,13,50,202812,2029), -('2028-12-14',202850,12,2028,14,50,202812,2029), -('2028-12-15',202850,12,2028,15,50,202812,2029), -('2028-12-16',202850,12,2028,16,50,202812,2029), -('2028-12-17',202851,12,2028,17,51,202812,2029), -('2028-12-18',202851,12,2028,18,51,202812,2029), -('2028-12-19',202851,12,2028,19,51,202812,2029), -('2028-12-20',202851,12,2028,20,51,202812,2029), -('2028-12-21',202851,12,2028,21,51,202812,2029), -('2028-12-22',202851,12,2028,22,51,202812,2029), -('2028-12-23',202851,12,2028,23,51,202812,2029), -('2028-12-24',202852,12,2028,24,52,202812,2029), -('2028-12-25',202852,12,2028,25,52,202812,2029), -('2028-12-26',202852,12,2028,26,52,202812,2029), -('2028-12-27',202852,12,2028,27,52,202812,2029), -('2028-12-28',202852,12,2028,28,52,202812,2029), -('2028-12-29',202852,12,2028,29,52,202812,2029), -('2028-12-30',202852,12,2028,30,52,202812,2029), -('2028-12-31',202853,12,2028,31,1,202812,2029), -('2029-01-01',202901,1,2029,1,1,202901,2029), -('2029-01-02',202901,1,2029,2,1,202901,2029), -('2029-01-03',202901,1,2029,3,1,202901,2029), -('2029-01-04',202901,1,2029,4,1,202901,2029), -('2029-01-05',202901,1,2029,5,1,202901,2029), -('2029-01-06',202901,1,2029,6,1,202901,2029), -('2029-01-07',202902,1,2029,7,2,202901,2029), -('2029-01-08',202902,1,2029,8,2,202901,2029), -('2029-01-09',202902,1,2029,9,2,202901,2029), -('2029-01-10',202902,1,2029,10,2,202901,2029), -('2029-01-11',202902,1,2029,11,2,202901,2029), -('2029-01-12',202902,1,2029,12,2,202901,2029), -('2029-01-13',202902,1,2029,13,2,202901,2029), -('2029-01-14',202903,1,2029,14,3,202901,2029), -('2029-01-15',202903,1,2029,15,3,202901,2029), -('2029-01-16',202903,1,2029,16,3,202901,2029), -('2029-01-17',202903,1,2029,17,3,202901,2029), -('2029-01-18',202903,1,2029,18,3,202901,2029), -('2029-01-19',202903,1,2029,19,3,202901,2029), -('2029-01-20',202903,1,2029,20,3,202901,2029), -('2029-01-21',202904,1,2029,21,4,202901,2029), -('2029-01-22',202904,1,2029,22,4,202901,2029), -('2029-01-23',202904,1,2029,23,4,202901,2029), -('2029-01-24',202904,1,2029,24,4,202901,2029), -('2029-01-25',202904,1,2029,25,4,202901,2029), -('2029-01-26',202904,1,2029,26,4,202901,2029), -('2029-01-27',202904,1,2029,27,4,202901,2029), -('2029-01-28',202905,1,2029,28,5,202901,2029), -('2029-01-29',202905,1,2029,29,5,202901,2029), -('2029-01-30',202905,1,2029,30,5,202901,2029), -('2029-01-31',202905,1,2029,31,5,202901,2029), -('2029-02-01',202905,2,2029,1,5,202902,2029), -('2029-02-02',202905,2,2029,2,5,202902,2029), -('2029-02-03',202905,2,2029,3,5,202902,2029), -('2029-02-04',202906,2,2029,4,6,202902,2029), -('2029-02-05',202906,2,2029,5,6,202902,2029), -('2029-02-06',202906,2,2029,6,6,202902,2029), -('2029-02-07',202906,2,2029,7,6,202902,2029), -('2029-02-08',202906,2,2029,8,6,202902,2029), -('2029-02-09',202906,2,2029,9,6,202902,2029), -('2029-02-10',202906,2,2029,10,6,202902,2029), -('2029-02-11',202907,2,2029,11,7,202902,2029), -('2029-02-12',202907,2,2029,12,7,202902,2029), -('2029-02-13',202907,2,2029,13,7,202902,2029), -('2029-02-14',202907,2,2029,14,7,202902,2029), -('2029-02-15',202907,2,2029,15,7,202902,2029), -('2029-02-16',202907,2,2029,16,7,202902,2029), -('2029-02-17',202907,2,2029,17,7,202902,2029), -('2029-02-18',202908,2,2029,18,8,202902,2029), -('2029-02-19',202908,2,2029,19,8,202902,2029), -('2029-02-20',202908,2,2029,20,8,202902,2029), -('2029-02-21',202908,2,2029,21,8,202902,2029), -('2029-02-22',202908,2,2029,22,8,202902,2029), -('2029-02-23',202908,2,2029,23,8,202902,2029), -('2029-02-24',202908,2,2029,24,8,202902,2029), -('2029-02-25',202909,2,2029,25,9,202902,2029), -('2029-02-26',202909,2,2029,26,9,202902,2029), -('2029-02-27',202909,2,2029,27,9,202902,2029), -('2029-02-28',202909,2,2029,28,9,202902,2029), -('2029-03-01',202909,3,2029,1,9,202903,2029), -('2029-03-02',202909,3,2029,2,9,202903,2029), -('2029-03-03',202909,3,2029,3,9,202903,2029), -('2029-03-04',202910,3,2029,4,10,202903,2029), -('2029-03-05',202910,3,2029,5,10,202903,2029), -('2029-03-06',202910,3,2029,6,10,202903,2029), -('2029-03-07',202910,3,2029,7,10,202903,2029), -('2029-03-08',202910,3,2029,8,10,202903,2029), -('2029-03-09',202910,3,2029,9,10,202903,2029), -('2029-03-10',202910,3,2029,10,10,202903,2029), -('2029-03-11',202911,3,2029,11,11,202903,2029), -('2029-03-12',202911,3,2029,12,11,202903,2029), -('2029-03-13',202911,3,2029,13,11,202903,2029), -('2029-03-14',202911,3,2029,14,11,202903,2029), -('2029-03-15',202911,3,2029,15,11,202903,2029), -('2029-03-16',202911,3,2029,16,11,202903,2029), -('2029-03-17',202911,3,2029,17,11,202903,2029), -('2029-03-18',202912,3,2029,18,12,202903,2029), -('2029-03-19',202912,3,2029,19,12,202903,2029), -('2029-03-20',202912,3,2029,20,12,202903,2029), -('2029-03-21',202912,3,2029,21,12,202903,2029), -('2029-03-22',202912,3,2029,22,12,202903,2029), -('2029-03-23',202912,3,2029,23,12,202903,2029), -('2029-03-24',202912,3,2029,24,12,202903,2029), -('2029-03-25',202913,3,2029,25,13,202903,2029), -('2029-03-26',202913,3,2029,26,13,202903,2029), -('2029-03-27',202913,3,2029,27,13,202903,2029), -('2029-03-28',202913,3,2029,28,13,202903,2029), -('2029-03-29',202913,3,2029,29,13,202903,2029), -('2029-03-30',202913,3,2029,30,13,202903,2029), -('2029-03-31',202913,3,2029,31,13,202903,2029), -('2029-04-01',202914,4,2029,1,14,202904,2029), -('2029-04-02',202914,4,2029,2,14,202904,2029), -('2029-04-03',202914,4,2029,3,14,202904,2029), -('2029-04-04',202914,4,2029,4,14,202904,2029), -('2029-04-05',202914,4,2029,5,14,202904,2029), -('2029-04-06',202914,4,2029,6,14,202904,2029), -('2029-04-07',202914,4,2029,7,14,202904,2029), -('2029-04-08',202915,4,2029,8,15,202904,2029), -('2029-04-09',202915,4,2029,9,15,202904,2029), -('2029-04-10',202915,4,2029,10,15,202904,2029), -('2029-04-11',202915,4,2029,11,15,202904,2029), -('2029-04-12',202915,4,2029,12,15,202904,2029), -('2029-04-13',202915,4,2029,13,15,202904,2029), -('2029-04-14',202915,4,2029,14,15,202904,2029), -('2029-04-15',202916,4,2029,15,16,202904,2029), -('2029-04-16',202916,4,2029,16,16,202904,2029), -('2029-04-17',202916,4,2029,17,16,202904,2029), -('2029-04-18',202916,4,2029,18,16,202904,2029), -('2029-04-19',202916,4,2029,19,16,202904,2029), -('2029-04-20',202916,4,2029,20,16,202904,2029), -('2029-04-21',202916,4,2029,21,16,202904,2029), -('2029-04-22',202917,4,2029,22,17,202904,2029), -('2029-04-23',202917,4,2029,23,17,202904,2029), -('2029-04-24',202917,4,2029,24,17,202904,2029), -('2029-04-25',202917,4,2029,25,17,202904,2029), -('2029-04-26',202917,4,2029,26,17,202904,2029), -('2029-04-27',202917,4,2029,27,17,202904,2029), -('2029-04-28',202917,4,2029,28,17,202904,2029), -('2029-04-29',202918,4,2029,29,18,202904,2029), -('2029-04-30',202918,4,2029,30,18,202904,2029), -('2029-05-01',202918,5,2029,1,18,202905,2029), -('2029-05-02',202918,5,2029,2,18,202905,2029), -('2029-05-03',202918,5,2029,3,18,202905,2029), -('2029-05-04',202918,5,2029,4,18,202905,2029), -('2029-05-05',202918,5,2029,5,18,202905,2029), -('2029-05-06',202919,5,2029,6,19,202905,2029), -('2029-05-07',202919,5,2029,7,19,202905,2029), -('2029-05-08',202919,5,2029,8,19,202905,2029), -('2029-05-09',202919,5,2029,9,19,202905,2029), -('2029-05-10',202919,5,2029,10,19,202905,2029), -('2029-05-11',202919,5,2029,11,19,202905,2029), -('2029-05-12',202919,5,2029,12,19,202905,2029), -('2029-05-13',202920,5,2029,13,20,202905,2029), -('2029-05-14',202920,5,2029,14,20,202905,2029), -('2029-05-15',202920,5,2029,15,20,202905,2029), -('2029-05-16',202920,5,2029,16,20,202905,2029), -('2029-05-17',202920,5,2029,17,20,202905,2029), -('2029-05-18',202920,5,2029,18,20,202905,2029), -('2029-05-19',202920,5,2029,19,20,202905,2029), -('2029-05-20',202921,5,2029,20,21,202905,2029), -('2029-05-21',202921,5,2029,21,21,202905,2029), -('2029-05-22',202921,5,2029,22,21,202905,2029), -('2029-05-23',202921,5,2029,23,21,202905,2029), -('2029-05-24',202921,5,2029,24,21,202905,2029), -('2029-05-25',202921,5,2029,25,21,202905,2029), -('2029-05-26',202921,5,2029,26,21,202905,2029), -('2029-05-27',202922,5,2029,27,22,202905,2029), -('2029-05-28',202922,5,2029,28,22,202905,2029), -('2029-05-29',202922,5,2029,29,22,202905,2029), -('2029-05-30',202922,5,2029,30,22,202905,2029), -('2029-05-31',202922,5,2029,31,22,202905,2029), -('2029-06-01',202922,6,2029,1,22,202906,2029), -('2029-06-02',202922,6,2029,2,22,202906,2029), -('2029-06-03',202923,6,2029,3,23,202906,2029), -('2029-06-04',202923,6,2029,4,23,202906,2029), -('2029-06-05',202923,6,2029,5,23,202906,2029), -('2029-06-06',202923,6,2029,6,23,202906,2029), -('2029-06-07',202923,6,2029,7,23,202906,2029), -('2029-06-08',202923,6,2029,8,23,202906,2029), -('2029-06-09',202923,6,2029,9,23,202906,2029), -('2029-06-10',202924,6,2029,10,24,202906,2029), -('2029-06-11',202924,6,2029,11,24,202906,2029), -('2029-06-12',202924,6,2029,12,24,202906,2029), -('2029-06-13',202924,6,2029,13,24,202906,2029), -('2029-06-14',202924,6,2029,14,24,202906,2029), -('2029-06-15',202924,6,2029,15,24,202906,2029), -('2029-06-16',202924,6,2029,16,24,202906,2029), -('2029-06-17',202925,6,2029,17,25,202906,2029), -('2029-06-18',202925,6,2029,18,25,202906,2029), -('2029-06-19',202925,6,2029,19,25,202906,2029), -('2029-06-20',202925,6,2029,20,25,202906,2029), -('2029-06-21',202925,6,2029,21,25,202906,2029), -('2029-06-22',202925,6,2029,22,25,202906,2029), -('2029-06-23',202925,6,2029,23,25,202906,2029), -('2029-06-24',202926,6,2029,24,26,202906,2029), -('2029-06-25',202926,6,2029,25,26,202906,2029), -('2029-06-26',202926,6,2029,26,26,202906,2029), -('2029-06-27',202926,6,2029,27,26,202906,2029), -('2029-06-28',202926,6,2029,28,26,202906,2029), -('2029-06-29',202926,6,2029,29,26,202906,2029), -('2029-06-30',202926,6,2029,30,26,202906,2029), -('2029-07-01',202927,7,2029,1,27,202907,2029), -('2029-07-02',202927,7,2029,2,27,202907,2029), -('2029-07-03',202927,7,2029,3,27,202907,2029), -('2029-07-04',202927,7,2029,4,27,202907,2029), -('2029-07-05',202927,7,2029,5,27,202907,2029), -('2029-07-06',202927,7,2029,6,27,202907,2029), -('2029-07-07',202927,7,2029,7,27,202907,2029), -('2029-07-08',202928,7,2029,8,28,202907,2029), -('2029-07-09',202928,7,2029,9,28,202907,2029), -('2029-07-10',202928,7,2029,10,28,202907,2029), -('2029-07-11',202928,7,2029,11,28,202907,2029), -('2029-07-12',202928,7,2029,12,28,202907,2029), -('2029-07-13',202928,7,2029,13,28,202907,2029), -('2029-07-14',202928,7,2029,14,28,202907,2029), -('2029-07-15',202929,7,2029,15,29,202907,2029), -('2029-07-16',202929,7,2029,16,29,202907,2029), -('2029-07-17',202929,7,2029,17,29,202907,2029), -('2029-07-18',202929,7,2029,18,29,202907,2029), -('2029-07-19',202929,7,2029,19,29,202907,2029), -('2029-07-20',202929,7,2029,20,29,202907,2029), -('2029-07-21',202929,7,2029,21,29,202907,2029), -('2029-07-22',202930,7,2029,22,30,202907,2029), -('2029-07-23',202930,7,2029,23,30,202907,2029), -('2029-07-24',202930,7,2029,24,30,202907,2029), -('2029-07-25',202930,7,2029,25,30,202907,2029), -('2029-07-26',202930,7,2029,26,30,202907,2029), -('2029-07-27',202930,7,2029,27,30,202907,2029), -('2029-07-28',202930,7,2029,28,30,202907,2029), -('2029-07-29',202931,7,2029,29,31,202907,2029), -('2029-07-30',202931,7,2029,30,31,202907,2029), -('2029-07-31',202931,7,2029,31,31,202907,2029), -('2029-08-01',202931,8,2029,1,31,202908,2029), -('2029-08-02',202931,8,2029,2,31,202908,2029), -('2029-08-03',202931,8,2029,3,31,202908,2029), -('2029-08-04',202931,8,2029,4,31,202908,2029), -('2029-08-05',202932,8,2029,5,32,202908,2029), -('2029-08-06',202932,8,2029,6,32,202908,2029), -('2029-08-07',202932,8,2029,7,32,202908,2029), -('2029-08-08',202932,8,2029,8,32,202908,2029), -('2029-08-09',202932,8,2029,9,32,202908,2029), -('2029-08-10',202932,8,2029,10,32,202908,2029), -('2029-08-11',202932,8,2029,11,32,202908,2029), -('2029-08-12',202933,8,2029,12,33,202908,2029), -('2029-08-13',202933,8,2029,13,33,202908,2029), -('2029-08-14',202933,8,2029,14,33,202908,2029), -('2029-08-15',202933,8,2029,15,33,202908,2029), -('2029-08-16',202933,8,2029,16,33,202908,2029), -('2029-08-17',202933,8,2029,17,33,202908,2029), -('2029-08-18',202933,8,2029,18,33,202908,2029), -('2029-08-19',202934,8,2029,19,34,202908,2029), -('2029-08-20',202934,8,2029,20,34,202908,2029), -('2029-08-21',202934,8,2029,21,34,202908,2029), -('2029-08-22',202934,8,2029,22,34,202908,2029), -('2029-08-23',202934,8,2029,23,34,202908,2029), -('2029-08-24',202934,8,2029,24,34,202908,2029), -('2029-08-25',202934,8,2029,25,34,202908,2029), -('2029-08-26',202935,8,2029,26,35,202908,2029), -('2029-08-27',202935,8,2029,27,35,202908,2029), -('2029-08-28',202935,8,2029,28,35,202908,2029), -('2029-08-29',202935,8,2029,29,35,202908,2029), -('2029-08-30',202935,8,2029,30,35,202908,2029), -('2029-08-31',202935,8,2029,31,35,202908,2029), -('2029-09-01',202935,9,2029,1,35,202909,2029), -('2029-09-02',202936,9,2029,2,36,202909,2029), -('2029-09-03',202936,9,2029,3,36,202909,2029), -('2029-09-04',202936,9,2029,4,36,202909,2029), -('2029-09-05',202936,9,2029,5,36,202909,2029), -('2029-09-06',202936,9,2029,6,36,202909,2029), -('2029-09-07',202936,9,2029,7,36,202909,2029), -('2029-09-08',202936,9,2029,8,36,202909,2029), -('2029-09-09',202937,9,2029,9,37,202909,2029), -('2029-09-10',202937,9,2029,10,37,202909,2029), -('2029-09-11',202937,9,2029,11,37,202909,2029), -('2029-09-12',202937,9,2029,12,37,202909,2029), -('2029-09-13',202937,9,2029,13,37,202909,2029), -('2029-09-14',202937,9,2029,14,37,202909,2029), -('2029-09-15',202937,9,2029,15,37,202909,2029), -('2029-09-16',202938,9,2029,16,38,202909,2029), -('2029-09-17',202938,9,2029,17,38,202909,2029), -('2029-09-18',202938,9,2029,18,38,202909,2029), -('2029-09-19',202938,9,2029,19,38,202909,2029), -('2029-09-20',202938,9,2029,20,38,202909,2029), -('2029-09-21',202938,9,2029,21,38,202909,2029), -('2029-09-22',202938,9,2029,22,38,202909,2029), -('2029-09-23',202939,9,2029,23,39,202909,2029), -('2029-09-24',202939,9,2029,24,39,202909,2029), -('2029-09-25',202939,9,2029,25,39,202909,2029), -('2029-09-26',202939,9,2029,26,39,202909,2029), -('2029-09-27',202939,9,2029,27,39,202909,2029), -('2029-09-28',202939,9,2029,28,39,202909,2029), -('2029-09-29',202939,9,2029,29,39,202909,2029), -('2029-09-30',202940,9,2029,30,40,202909,2029), -('2029-10-01',202940,10,2029,1,40,202910,2029), -('2029-10-02',202940,10,2029,2,40,202910,2029), -('2029-10-03',202940,10,2029,3,40,202910,2029), -('2029-10-04',202940,10,2029,4,40,202910,2029), -('2029-10-05',202940,10,2029,5,40,202910,2029), -('2029-10-06',202940,10,2029,6,40,202910,2029), -('2029-10-07',202941,10,2029,7,41,202910,2029), -('2029-10-08',202941,10,2029,8,41,202910,2029), -('2029-10-09',202941,10,2029,9,41,202910,2029), -('2029-10-10',202941,10,2029,10,41,202910,2029), -('2029-10-11',202941,10,2029,11,41,202910,2029), -('2029-10-12',202941,10,2029,12,41,202910,2029), -('2029-10-13',202941,10,2029,13,41,202910,2029), -('2029-10-14',202942,10,2029,14,42,202910,2029), -('2029-10-15',202942,10,2029,15,42,202910,2029), -('2029-10-16',202942,10,2029,16,42,202910,2029), -('2029-10-17',202942,10,2029,17,42,202910,2029), -('2029-10-18',202942,10,2029,18,42,202910,2029), -('2029-10-19',202942,10,2029,19,42,202910,2029), -('2029-10-20',202942,10,2029,20,42,202910,2029), -('2029-10-21',202943,10,2029,21,43,202910,2029), -('2029-10-22',202943,10,2029,22,43,202910,2029), -('2029-10-23',202943,10,2029,23,43,202910,2029), -('2029-10-24',202943,10,2029,24,43,202910,2029), -('2029-10-25',202943,10,2029,25,43,202910,2029), -('2029-10-26',202943,10,2029,26,43,202910,2029), -('2029-10-27',202943,10,2029,27,43,202910,2029), -('2029-10-28',202944,10,2029,28,44,202910,2029), -('2029-10-29',202944,10,2029,29,44,202910,2029), -('2029-10-30',202944,10,2029,30,44,202910,2029), -('2029-10-31',202944,10,2029,31,44,202910,2029), -('2029-11-01',202944,11,2029,1,44,202911,2029), -('2029-11-02',202944,11,2029,2,44,202911,2029), -('2029-11-03',202944,11,2029,3,44,202911,2029), -('2029-11-04',202945,11,2029,4,45,202911,2029), -('2029-11-05',202945,11,2029,5,45,202911,2029), -('2029-11-06',202945,11,2029,6,45,202911,2029), -('2029-11-07',202945,11,2029,7,45,202911,2029), -('2029-11-08',202945,11,2029,8,45,202911,2029), -('2029-11-09',202945,11,2029,9,45,202911,2029), -('2029-11-10',202945,11,2029,10,45,202911,2029), -('2029-11-11',202946,11,2029,11,46,202911,2029), -('2029-11-12',202946,11,2029,12,46,202911,2029), -('2029-11-13',202946,11,2029,13,46,202911,2029), -('2029-11-14',202946,11,2029,14,46,202911,2029), -('2029-11-15',202946,11,2029,15,46,202911,2029), -('2029-11-16',202946,11,2029,16,46,202911,2029), -('2029-11-17',202946,11,2029,17,46,202911,2029), -('2029-11-18',202947,11,2029,18,47,202911,2029), -('2029-11-19',202947,11,2029,19,47,202911,2029), -('2029-11-20',202947,11,2029,20,47,202911,2029), -('2029-11-21',202947,11,2029,21,47,202911,2029), -('2029-11-22',202947,11,2029,22,47,202911,2029), -('2029-11-23',202947,11,2029,23,47,202911,2029), -('2029-11-24',202947,11,2029,24,47,202911,2029), -('2029-11-25',202948,11,2029,25,48,202911,2029), -('2029-11-26',202948,11,2029,26,48,202911,2029), -('2029-11-27',202948,11,2029,27,48,202911,2029), -('2029-11-28',202948,11,2029,28,48,202911,2029), -('2029-11-29',202948,11,2029,29,48,202911,2029), -('2029-11-30',202948,11,2029,30,48,202911,2029), -('2029-12-01',202948,12,2029,1,48,202912,2030), -('2029-12-02',202949,12,2029,2,49,202912,2030), -('2029-12-03',202949,12,2029,3,49,202912,2030), -('2029-12-04',202949,12,2029,4,49,202912,2030), -('2029-12-05',202949,12,2029,5,49,202912,2030), -('2029-12-06',202949,12,2029,6,49,202912,2030), -('2029-12-07',202949,12,2029,7,49,202912,2030), -('2029-12-08',202949,12,2029,8,49,202912,2030), -('2029-12-09',202950,12,2029,9,50,202912,2030), -('2029-12-10',202950,12,2029,10,50,202912,2030), -('2029-12-11',202950,12,2029,11,50,202912,2030), -('2029-12-12',202950,12,2029,12,50,202912,2030), -('2029-12-13',202950,12,2029,13,50,202912,2030), -('2029-12-14',202950,12,2029,14,50,202912,2030), -('2029-12-15',202950,12,2029,15,50,202912,2030), -('2029-12-16',202951,12,2029,16,51,202912,2030), -('2029-12-17',202951,12,2029,17,51,202912,2030), -('2029-12-18',202951,12,2029,18,51,202912,2030), -('2029-12-19',202951,12,2029,19,51,202912,2030), -('2029-12-20',202951,12,2029,20,51,202912,2030), -('2029-12-21',202951,12,2029,21,51,202912,2030), -('2029-12-22',202951,12,2029,22,51,202912,2030), -('2029-12-23',202952,12,2029,23,52,202912,2030), -('2029-12-24',202952,12,2029,24,52,202912,2030), -('2029-12-25',202952,12,2029,25,52,202912,2030), -('2029-12-26',202952,12,2029,26,52,202912,2030), -('2029-12-27',202952,12,2029,27,52,202912,2030), -('2029-12-28',202952,12,2029,28,52,202912,2030), -('2029-12-29',202952,12,2029,29,52,202912,2030), -('2029-12-30',202953,12,2029,30,1,202912,2030), -('2029-12-31',202901,12,2029,31,1,202912,2030), -('2030-01-01',203001,1,2030,1,1,203001,2030), -('2030-01-02',203001,1,2030,2,1,203001,2030), -('2030-01-03',203001,1,2030,3,1,203001,2030), -('2030-01-04',203001,1,2030,4,1,203001,2030), -('2030-01-05',203001,1,2030,5,1,203001,2030), -('2030-01-06',203002,1,2030,6,2,203001,2030), -('2030-01-07',203002,1,2030,7,2,203001,2030), -('2030-01-08',203002,1,2030,8,2,203001,2030), -('2030-01-09',203002,1,2030,9,2,203001,2030), -('2030-01-10',203002,1,2030,10,2,203001,2030), -('2030-01-11',203002,1,2030,11,2,203001,2030), -('2030-01-12',203002,1,2030,12,2,203001,2030), -('2030-01-13',203003,1,2030,13,3,203001,2030), -('2030-01-14',203003,1,2030,14,3,203001,2030), -('2030-01-15',203003,1,2030,15,3,203001,2030), -('2030-01-16',203003,1,2030,16,3,203001,2030), -('2030-01-17',203003,1,2030,17,3,203001,2030), -('2030-01-18',203003,1,2030,18,3,203001,2030), -('2030-01-19',203003,1,2030,19,3,203001,2030), -('2030-01-20',203004,1,2030,20,4,203001,2030), -('2030-01-21',203004,1,2030,21,4,203001,2030), -('2030-01-22',203004,1,2030,22,4,203001,2030), -('2030-01-23',203004,1,2030,23,4,203001,2030), -('2030-01-24',203004,1,2030,24,4,203001,2030), -('2030-01-25',203004,1,2030,25,4,203001,2030), -('2030-01-26',203004,1,2030,26,4,203001,2030), -('2030-01-27',203005,1,2030,27,5,203001,2030), -('2030-01-28',203005,1,2030,28,5,203001,2030), -('2030-01-29',203005,1,2030,29,5,203001,2030), -('2030-01-30',203005,1,2030,30,5,203001,2030), -('2030-01-31',203005,1,2030,31,5,203001,2030), -('2030-02-01',203005,2,2030,1,5,203002,2030), -('2030-02-02',203005,2,2030,2,5,203002,2030), -('2030-02-03',203006,2,2030,3,6,203002,2030), -('2030-02-04',203006,2,2030,4,6,203002,2030), -('2030-02-05',203006,2,2030,5,6,203002,2030), -('2030-02-06',203006,2,2030,6,6,203002,2030), -('2030-02-07',203006,2,2030,7,6,203002,2030), -('2030-02-08',203006,2,2030,8,6,203002,2030), -('2030-02-09',203006,2,2030,9,6,203002,2030), -('2030-02-10',203007,2,2030,10,7,203002,2030), -('2030-02-11',203007,2,2030,11,7,203002,2030), -('2030-02-12',203007,2,2030,12,7,203002,2030), -('2030-02-13',203007,2,2030,13,7,203002,2030), -('2030-02-14',203007,2,2030,14,7,203002,2030), -('2030-02-15',203007,2,2030,15,7,203002,2030), -('2030-02-16',203007,2,2030,16,7,203002,2030), -('2030-02-17',203008,2,2030,17,8,203002,2030), -('2030-02-18',203008,2,2030,18,8,203002,2030), -('2030-02-19',203008,2,2030,19,8,203002,2030), -('2030-02-20',203008,2,2030,20,8,203002,2030), -('2030-02-21',203008,2,2030,21,8,203002,2030), -('2030-02-22',203008,2,2030,22,8,203002,2030), -('2030-02-23',203008,2,2030,23,8,203002,2030), -('2030-02-24',203009,2,2030,24,9,203002,2030), -('2030-02-25',203009,2,2030,25,9,203002,2030), -('2030-02-26',203009,2,2030,26,9,203002,2030), -('2030-02-27',203009,2,2030,27,9,203002,2030), -('2030-02-28',203009,2,2030,28,9,203002,2030), -('2030-03-01',203009,3,2030,1,9,203003,2030), -('2030-03-02',203009,3,2030,2,9,203003,2030), -('2030-03-03',203010,3,2030,3,10,203003,2030), -('2030-03-04',203010,3,2030,4,10,203003,2030), -('2030-03-05',203010,3,2030,5,10,203003,2030), -('2030-03-06',203010,3,2030,6,10,203003,2030), -('2030-03-07',203010,3,2030,7,10,203003,2030), -('2030-03-08',203010,3,2030,8,10,203003,2030), -('2030-03-09',203010,3,2030,9,10,203003,2030), -('2030-03-10',203011,3,2030,10,11,203003,2030), -('2030-03-11',203011,3,2030,11,11,203003,2030), -('2030-03-12',203011,3,2030,12,11,203003,2030), -('2030-03-13',203011,3,2030,13,11,203003,2030), -('2030-03-14',203011,3,2030,14,11,203003,2030), -('2030-03-15',203011,3,2030,15,11,203003,2030), -('2030-03-16',203011,3,2030,16,11,203003,2030), -('2030-03-17',203012,3,2030,17,12,203003,2030), -('2030-03-18',203012,3,2030,18,12,203003,2030), -('2030-03-19',203012,3,2030,19,12,203003,2030), -('2030-03-20',203012,3,2030,20,12,203003,2030), -('2030-03-21',203012,3,2030,21,12,203003,2030), -('2030-03-22',203012,3,2030,22,12,203003,2030), -('2030-03-23',203012,3,2030,23,12,203003,2030), -('2030-03-24',203013,3,2030,24,13,203003,2030), -('2030-03-25',203013,3,2030,25,13,203003,2030), -('2030-03-26',203013,3,2030,26,13,203003,2030), -('2030-03-27',203013,3,2030,27,13,203003,2030), -('2030-03-28',203013,3,2030,28,13,203003,2030), -('2030-03-29',203013,3,2030,29,13,203003,2030), -('2030-03-30',203013,3,2030,30,13,203003,2030), -('2030-03-31',203014,3,2030,31,14,203003,2030), -('2030-04-01',203014,4,2030,1,14,203004,2030), -('2030-04-02',203014,4,2030,2,14,203004,2030), -('2030-04-03',203014,4,2030,3,14,203004,2030), -('2030-04-04',203014,4,2030,4,14,203004,2030), -('2030-04-05',203014,4,2030,5,14,203004,2030), -('2030-04-06',203014,4,2030,6,14,203004,2030), -('2030-04-07',203015,4,2030,7,15,203004,2030), -('2030-04-08',203015,4,2030,8,15,203004,2030), -('2030-04-09',203015,4,2030,9,15,203004,2030), -('2030-04-10',203015,4,2030,10,15,203004,2030), -('2030-04-11',203015,4,2030,11,15,203004,2030), -('2030-04-12',203015,4,2030,12,15,203004,2030), -('2030-04-13',203015,4,2030,13,15,203004,2030), -('2030-04-14',203016,4,2030,14,16,203004,2030), -('2030-04-15',203016,4,2030,15,16,203004,2030), -('2030-04-16',203016,4,2030,16,16,203004,2030), -('2030-04-17',203016,4,2030,17,16,203004,2030), -('2030-04-18',203016,4,2030,18,16,203004,2030), -('2030-04-19',203016,4,2030,19,16,203004,2030), -('2030-04-20',203016,4,2030,20,16,203004,2030), -('2030-04-21',203017,4,2030,21,17,203004,2030), -('2030-04-22',203017,4,2030,22,17,203004,2030), -('2030-04-23',203017,4,2030,23,17,203004,2030), -('2030-04-24',203017,4,2030,24,17,203004,2030), -('2030-04-25',203017,4,2030,25,17,203004,2030), -('2030-04-26',203017,4,2030,26,17,203004,2030), -('2030-04-27',203017,4,2030,27,17,203004,2030), -('2030-04-28',203018,4,2030,28,18,203004,2030), -('2030-04-29',203018,4,2030,29,18,203004,2030), -('2030-04-30',203018,4,2030,30,18,203004,2030), -('2030-05-01',203018,5,2030,1,18,203005,2030), -('2030-05-02',203018,5,2030,2,18,203005,2030), -('2030-05-03',203018,5,2030,3,18,203005,2030), -('2030-05-04',203018,5,2030,4,18,203005,2030), -('2030-05-05',203019,5,2030,5,19,203005,2030), -('2030-05-06',203019,5,2030,6,19,203005,2030), -('2030-05-07',203019,5,2030,7,19,203005,2030), -('2030-05-08',203019,5,2030,8,19,203005,2030), -('2030-05-09',203019,5,2030,9,19,203005,2030), -('2030-05-10',203019,5,2030,10,19,203005,2030), -('2030-05-11',203019,5,2030,11,19,203005,2030), -('2030-05-12',203020,5,2030,12,20,203005,2030), -('2030-05-13',203020,5,2030,13,20,203005,2030), -('2030-05-14',203020,5,2030,14,20,203005,2030), -('2030-05-15',203020,5,2030,15,20,203005,2030), -('2030-05-16',203020,5,2030,16,20,203005,2030), -('2030-05-17',203020,5,2030,17,20,203005,2030), -('2030-05-18',203020,5,2030,18,20,203005,2030), -('2030-05-19',203021,5,2030,19,21,203005,2030), -('2030-05-20',203021,5,2030,20,21,203005,2030), -('2030-05-21',203021,5,2030,21,21,203005,2030), -('2030-05-22',203021,5,2030,22,21,203005,2030), -('2030-05-23',203021,5,2030,23,21,203005,2030), -('2030-05-24',203021,5,2030,24,21,203005,2030), -('2030-05-25',203021,5,2030,25,21,203005,2030), -('2030-05-26',203022,5,2030,26,22,203005,2030), -('2030-05-27',203022,5,2030,27,22,203005,2030), -('2030-05-28',203022,5,2030,28,22,203005,2030), -('2030-05-29',203022,5,2030,29,22,203005,2030), -('2030-05-30',203022,5,2030,30,22,203005,2030), -('2030-05-31',203022,5,2030,31,22,203005,2030), -('2030-06-01',203022,6,2030,1,22,203006,2030), -('2030-06-02',203023,6,2030,2,23,203006,2030), -('2030-06-03',203023,6,2030,3,23,203006,2030), -('2030-06-04',203023,6,2030,4,23,203006,2030), -('2030-06-05',203023,6,2030,5,23,203006,2030), -('2030-06-06',203023,6,2030,6,23,203006,2030), -('2030-06-07',203023,6,2030,7,23,203006,2030), -('2030-06-08',203023,6,2030,8,23,203006,2030), -('2030-06-09',203024,6,2030,9,24,203006,2030), -('2030-06-10',203024,6,2030,10,24,203006,2030), -('2030-06-11',203024,6,2030,11,24,203006,2030), -('2030-06-12',203024,6,2030,12,24,203006,2030), -('2030-06-13',203024,6,2030,13,24,203006,2030), -('2030-06-14',203024,6,2030,14,24,203006,2030), -('2030-06-15',203024,6,2030,15,24,203006,2030), -('2030-06-16',203025,6,2030,16,25,203006,2030), -('2030-06-17',203025,6,2030,17,25,203006,2030), -('2030-06-18',203025,6,2030,18,25,203006,2030), -('2030-06-19',203025,6,2030,19,25,203006,2030), -('2030-06-20',203025,6,2030,20,25,203006,2030), -('2030-06-21',203025,6,2030,21,25,203006,2030), -('2030-06-22',203025,6,2030,22,25,203006,2030), -('2030-06-23',203026,6,2030,23,26,203006,2030), -('2030-06-24',203026,6,2030,24,26,203006,2030), -('2030-06-25',203026,6,2030,25,26,203006,2030), -('2030-06-26',203026,6,2030,26,26,203006,2030), -('2030-06-27',203026,6,2030,27,26,203006,2030), -('2030-06-28',203026,6,2030,28,26,203006,2030), -('2030-06-29',203026,6,2030,29,26,203006,2030), -('2030-06-30',203027,6,2030,30,27,203006,2030), -('2030-07-01',203027,7,2030,1,27,203007,2030), -('2030-07-02',203027,7,2030,2,27,203007,2030), -('2030-07-03',203027,7,2030,3,27,203007,2030), -('2030-07-04',203027,7,2030,4,27,203007,2030), -('2030-07-05',203027,7,2030,5,27,203007,2030), -('2030-07-06',203027,7,2030,6,27,203007,2030), -('2030-07-07',203028,7,2030,7,28,203007,2030), -('2030-07-08',203028,7,2030,8,28,203007,2030), -('2030-07-09',203028,7,2030,9,28,203007,2030), -('2030-07-10',203028,7,2030,10,28,203007,2030), -('2030-07-11',203028,7,2030,11,28,203007,2030), -('2030-07-12',203028,7,2030,12,28,203007,2030), -('2030-07-13',203028,7,2030,13,28,203007,2030), -('2030-07-14',203029,7,2030,14,29,203007,2030), -('2030-07-15',203029,7,2030,15,29,203007,2030), -('2030-07-16',203029,7,2030,16,29,203007,2030), -('2030-07-17',203029,7,2030,17,29,203007,2030), -('2030-07-18',203029,7,2030,18,29,203007,2030), -('2030-07-19',203029,7,2030,19,29,203007,2030), -('2030-07-20',203029,7,2030,20,29,203007,2030), -('2030-07-21',203030,7,2030,21,30,203007,2030), -('2030-07-22',203030,7,2030,22,30,203007,2030), -('2030-07-23',203030,7,2030,23,30,203007,2030), -('2030-07-24',203030,7,2030,24,30,203007,2030), -('2030-07-25',203030,7,2030,25,30,203007,2030), -('2030-07-26',203030,7,2030,26,30,203007,2030), -('2030-07-27',203030,7,2030,27,30,203007,2030), -('2030-07-28',203031,7,2030,28,31,203007,2030), -('2030-07-29',203031,7,2030,29,31,203007,2030), -('2030-07-30',203031,7,2030,30,31,203007,2030), -('2030-07-31',203031,7,2030,31,31,203007,2030), -('2030-08-01',203031,8,2030,1,31,203008,2030), -('2030-08-02',203031,8,2030,2,31,203008,2030), -('2030-08-03',203031,8,2030,3,31,203008,2030), -('2030-08-04',203032,8,2030,4,32,203008,2030), -('2030-08-05',203032,8,2030,5,32,203008,2030), -('2030-08-06',203032,8,2030,6,32,203008,2030), -('2030-08-07',203032,8,2030,7,32,203008,2030), -('2030-08-08',203032,8,2030,8,32,203008,2030), -('2030-08-09',203032,8,2030,9,32,203008,2030), -('2030-08-10',203032,8,2030,10,32,203008,2030), -('2030-08-11',203033,8,2030,11,33,203008,2030), -('2030-08-12',203033,8,2030,12,33,203008,2030), -('2030-08-13',203033,8,2030,13,33,203008,2030), -('2030-08-14',203033,8,2030,14,33,203008,2030), -('2030-08-15',203033,8,2030,15,33,203008,2030), -('2030-08-16',203033,8,2030,16,33,203008,2030), -('2030-08-17',203033,8,2030,17,33,203008,2030), -('2030-08-18',203034,8,2030,18,34,203008,2030), -('2030-08-19',203034,8,2030,19,34,203008,2030), -('2030-08-20',203034,8,2030,20,34,203008,2030), -('2030-08-21',203034,8,2030,21,34,203008,2030), -('2030-08-22',203034,8,2030,22,34,203008,2030), -('2030-08-23',203034,8,2030,23,34,203008,2030), -('2030-08-24',203034,8,2030,24,34,203008,2030), -('2030-08-25',203035,8,2030,25,35,203008,2030), -('2030-08-26',203035,8,2030,26,35,203008,2030), -('2030-08-27',203035,8,2030,27,35,203008,2030), -('2030-08-28',203035,8,2030,28,35,203008,2030), -('2030-08-29',203035,8,2030,29,35,203008,2030), -('2030-08-30',203035,8,2030,30,35,203008,2030), -('2030-08-31',203035,8,2030,31,35,203008,2030), -('2030-09-01',203036,9,2030,1,36,203009,2030), -('2030-09-02',203036,9,2030,2,36,203009,2030), -('2030-09-03',203036,9,2030,3,36,203009,2030), -('2030-09-04',203036,9,2030,4,36,203009,2030), -('2030-09-05',203036,9,2030,5,36,203009,2030), -('2030-09-06',203036,9,2030,6,36,203009,2030), -('2030-09-07',203036,9,2030,7,36,203009,2030), -('2030-09-08',203037,9,2030,8,37,203009,2030), -('2030-09-09',203037,9,2030,9,37,203009,2030), -('2030-09-10',203037,9,2030,10,37,203009,2030), -('2030-09-11',203037,9,2030,11,37,203009,2030), -('2030-09-12',203037,9,2030,12,37,203009,2030), -('2030-09-13',203037,9,2030,13,37,203009,2030), -('2030-09-14',203037,9,2030,14,37,203009,2030), -('2030-09-15',203038,9,2030,15,38,203009,2030), -('2030-09-16',203038,9,2030,16,38,203009,2030), -('2030-09-17',203038,9,2030,17,38,203009,2030), -('2030-09-18',203038,9,2030,18,38,203009,2030), -('2030-09-19',203038,9,2030,19,38,203009,2030), -('2030-09-20',203038,9,2030,20,38,203009,2030), -('2030-09-21',203038,9,2030,21,38,203009,2030), -('2030-09-22',203039,9,2030,22,39,203009,2030), -('2030-09-23',203039,9,2030,23,39,203009,2030), -('2030-09-24',203039,9,2030,24,39,203009,2030), -('2030-09-25',203039,9,2030,25,39,203009,2030), -('2030-09-26',203039,9,2030,26,39,203009,2030), -('2030-09-27',203039,9,2030,27,39,203009,2030), -('2030-09-28',203039,9,2030,28,39,203009,2030), -('2030-09-29',203040,9,2030,29,40,203009,2030), -('2030-09-30',203040,9,2030,30,40,203009,2030), -('2030-10-01',203040,10,2030,1,40,203010,2030), -('2030-10-02',203040,10,2030,2,40,203010,2030), -('2030-10-03',203040,10,2030,3,40,203010,2030), -('2030-10-04',203040,10,2030,4,40,203010,2030), -('2030-10-05',203040,10,2030,5,40,203010,2030), -('2030-10-06',203041,10,2030,6,41,203010,2030), -('2030-10-07',203041,10,2030,7,41,203010,2030), -('2030-10-08',203041,10,2030,8,41,203010,2030), -('2030-10-09',203041,10,2030,9,41,203010,2030), -('2030-10-10',203041,10,2030,10,41,203010,2030), -('2030-10-11',203041,10,2030,11,41,203010,2030), -('2030-10-12',203041,10,2030,12,41,203010,2030), -('2030-10-13',203042,10,2030,13,42,203010,2030), -('2030-10-14',203042,10,2030,14,42,203010,2030), -('2030-10-15',203042,10,2030,15,42,203010,2030), -('2030-10-16',203042,10,2030,16,42,203010,2030), -('2030-10-17',203042,10,2030,17,42,203010,2030), -('2030-10-18',203042,10,2030,18,42,203010,2030), -('2030-10-19',203042,10,2030,19,42,203010,2030), -('2030-10-20',203043,10,2030,20,43,203010,2030), -('2030-10-21',203043,10,2030,21,43,203010,2030), -('2030-10-22',203043,10,2030,22,43,203010,2030), -('2030-10-23',203043,10,2030,23,43,203010,2030), -('2030-10-24',203043,10,2030,24,43,203010,2030), -('2030-10-25',203043,10,2030,25,43,203010,2030), -('2030-10-26',203043,10,2030,26,43,203010,2030), -('2030-10-27',203044,10,2030,27,44,203010,2030), -('2030-10-28',203044,10,2030,28,44,203010,2030), -('2030-10-29',203044,10,2030,29,44,203010,2030), -('2030-10-30',203044,10,2030,30,44,203010,2030), -('2030-10-31',203044,10,2030,31,44,203010,2030), -('2030-11-01',203044,11,2030,1,44,203011,2030), -('2030-11-02',203044,11,2030,2,44,203011,2030), -('2030-11-03',203045,11,2030,3,45,203011,2030), -('2030-11-04',203045,11,2030,4,45,203011,2030), -('2030-11-05',203045,11,2030,5,45,203011,2030), -('2030-11-06',203045,11,2030,6,45,203011,2030), -('2030-11-07',203045,11,2030,7,45,203011,2030), -('2030-11-08',203045,11,2030,8,45,203011,2030), -('2030-11-09',203045,11,2030,9,45,203011,2030), -('2030-11-10',203046,11,2030,10,46,203011,2030), -('2030-11-11',203046,11,2030,11,46,203011,2030), -('2030-11-12',203046,11,2030,12,46,203011,2030), -('2030-11-13',203046,11,2030,13,46,203011,2030), -('2030-11-14',203046,11,2030,14,46,203011,2030), -('2030-11-15',203046,11,2030,15,46,203011,2030), -('2030-11-16',203046,11,2030,16,46,203011,2030), -('2030-11-17',203047,11,2030,17,47,203011,2030), -('2030-11-18',203047,11,2030,18,47,203011,2030), -('2030-11-19',203047,11,2030,19,47,203011,2030), -('2030-11-20',203047,11,2030,20,47,203011,2030), -('2030-11-21',203047,11,2030,21,47,203011,2030), -('2030-11-22',203047,11,2030,22,47,203011,2030), -('2030-11-23',203047,11,2030,23,47,203011,2030), -('2030-11-24',203048,11,2030,24,48,203011,2030), -('2030-11-25',203048,11,2030,25,48,203011,2030), -('2030-11-26',203048,11,2030,26,48,203011,2030), -('2030-11-27',203048,11,2030,27,48,203011,2030), -('2030-11-28',203048,11,2030,28,48,203011,2030), -('2030-11-29',203048,11,2030,29,48,203011,2030), -('2030-11-30',203048,11,2030,30,48,203011,2030), -('2030-12-01',203049,12,2030,1,49,203012,2031), -('2030-12-02',203049,12,2030,2,49,203012,2031), -('2030-12-03',203049,12,2030,3,49,203012,2031), -('2030-12-04',203049,12,2030,4,49,203012,2031), -('2030-12-05',203049,12,2030,5,49,203012,2031), -('2030-12-06',203049,12,2030,6,49,203012,2031), -('2030-12-07',203049,12,2030,7,49,203012,2031), -('2030-12-08',203050,12,2030,8,50,203012,2031), -('2030-12-09',203050,12,2030,9,50,203012,2031), -('2030-12-10',203050,12,2030,10,50,203012,2031), -('2030-12-11',203050,12,2030,11,50,203012,2031), -('2030-12-12',203050,12,2030,12,50,203012,2031), -('2030-12-13',203050,12,2030,13,50,203012,2031), -('2030-12-14',203050,12,2030,14,50,203012,2031), -('2030-12-15',203051,12,2030,15,51,203012,2031), -('2030-12-16',203051,12,2030,16,51,203012,2031), -('2030-12-17',203051,12,2030,17,51,203012,2031), -('2030-12-18',203051,12,2030,18,51,203012,2031), -('2030-12-19',203051,12,2030,19,51,203012,2031), -('2030-12-20',203051,12,2030,20,51,203012,2031), -('2030-12-21',203051,12,2030,21,51,203012,2031), -('2030-12-22',203052,12,2030,22,52,203012,2031), -('2030-12-23',203052,12,2030,23,52,203012,2031), -('2030-12-24',203052,12,2030,24,52,203012,2031), -('2030-12-25',203052,12,2030,25,52,203012,2031), -('2030-12-26',203052,12,2030,26,52,203012,2031), -('2030-12-27',203052,12,2030,27,52,203012,2031), -('2030-12-28',203052,12,2030,28,52,203012,2031), -('2030-12-29',203053,12,2030,29,1,203012,2031), -('2030-12-30',203001,12,2030,30,1,203012,2031), -('2030-12-31',203001,12,2030,31,1,203012,2031), -('2031-01-01',203101,1,2031,1,1,203101,2031), -('2031-01-02',203101,1,2031,2,1,203101,2031), -('2031-01-03',203101,1,2031,3,1,203101,2031), -('2031-01-04',203101,1,2031,4,1,203101,2031), -('2031-01-05',203102,1,2031,5,2,203101,2031), -('2031-01-06',203102,1,2031,6,2,203101,2031), -('2031-01-07',203102,1,2031,7,2,203101,2031), -('2031-01-08',203102,1,2031,8,2,203101,2031), -('2031-01-09',203102,1,2031,9,2,203101,2031), -('2031-01-10',203102,1,2031,10,2,203101,2031), -('2031-01-11',203102,1,2031,11,2,203101,2031), -('2031-01-12',203103,1,2031,12,3,203101,2031), -('2031-01-13',203103,1,2031,13,3,203101,2031), -('2031-01-14',203103,1,2031,14,3,203101,2031), -('2031-01-15',203103,1,2031,15,3,203101,2031), -('2031-01-16',203103,1,2031,16,3,203101,2031), -('2031-01-17',203103,1,2031,17,3,203101,2031), -('2031-01-18',203103,1,2031,18,3,203101,2031), -('2031-01-19',203104,1,2031,19,4,203101,2031), -('2031-01-20',203104,1,2031,20,4,203101,2031), -('2031-01-21',203104,1,2031,21,4,203101,2031), -('2031-01-22',203104,1,2031,22,4,203101,2031), -('2031-01-23',203104,1,2031,23,4,203101,2031), -('2031-01-24',203104,1,2031,24,4,203101,2031), -('2031-01-25',203104,1,2031,25,4,203101,2031), -('2031-01-26',203105,1,2031,26,5,203101,2031), -('2031-01-27',203105,1,2031,27,5,203101,2031), -('2031-01-28',203105,1,2031,28,5,203101,2031), -('2031-01-29',203105,1,2031,29,5,203101,2031), -('2031-01-30',203105,1,2031,30,5,203101,2031), -('2031-01-31',203105,1,2031,31,5,203101,2031), -('2031-02-01',203105,2,2031,1,5,203102,2031), -('2031-02-02',203106,2,2031,2,6,203102,2031), -('2031-02-03',203106,2,2031,3,6,203102,2031), -('2031-02-04',203106,2,2031,4,6,203102,2031), -('2031-02-05',203106,2,2031,5,6,203102,2031), -('2031-02-06',203106,2,2031,6,6,203102,2031), -('2031-02-07',203106,2,2031,7,6,203102,2031), -('2031-02-08',203106,2,2031,8,6,203102,2031), -('2031-02-09',203107,2,2031,9,7,203102,2031), -('2031-02-10',203107,2,2031,10,7,203102,2031), -('2031-02-11',203107,2,2031,11,7,203102,2031), -('2031-02-12',203107,2,2031,12,7,203102,2031), -('2031-02-13',203107,2,2031,13,7,203102,2031), -('2031-02-14',203107,2,2031,14,7,203102,2031), -('2031-02-15',203107,2,2031,15,7,203102,2031), -('2031-02-16',203108,2,2031,16,8,203102,2031), -('2031-02-17',203108,2,2031,17,8,203102,2031), -('2031-02-18',203108,2,2031,18,8,203102,2031), -('2031-02-19',203108,2,2031,19,8,203102,2031), -('2031-02-20',203108,2,2031,20,8,203102,2031), -('2031-02-21',203108,2,2031,21,8,203102,2031), -('2031-02-22',203108,2,2031,22,8,203102,2031), -('2031-02-23',203109,2,2031,23,9,203102,2031), -('2031-02-24',203109,2,2031,24,9,203102,2031), -('2031-02-25',203109,2,2031,25,9,203102,2031), -('2031-02-26',203109,2,2031,26,9,203102,2031), -('2031-02-27',203109,2,2031,27,9,203102,2031), -('2031-02-28',203109,2,2031,28,9,203102,2031), -('2031-03-01',203109,3,2031,1,9,203103,2031), -('2031-03-02',203110,3,2031,2,10,203103,2031), -('2031-03-03',203110,3,2031,3,10,203103,2031), -('2031-03-04',203110,3,2031,4,10,203103,2031), -('2031-03-05',203110,3,2031,5,10,203103,2031), -('2031-03-06',203110,3,2031,6,10,203103,2031), -('2031-03-07',203110,3,2031,7,10,203103,2031), -('2031-03-08',203110,3,2031,8,10,203103,2031), -('2031-03-09',203111,3,2031,9,11,203103,2031), -('2031-03-10',203111,3,2031,10,11,203103,2031), -('2031-03-11',203111,3,2031,11,11,203103,2031), -('2031-03-12',203111,3,2031,12,11,203103,2031), -('2031-03-13',203111,3,2031,13,11,203103,2031), -('2031-03-14',203111,3,2031,14,11,203103,2031), -('2031-03-15',203111,3,2031,15,11,203103,2031), -('2031-03-16',203112,3,2031,16,12,203103,2031), -('2031-03-17',203112,3,2031,17,12,203103,2031), -('2031-03-18',203112,3,2031,18,12,203103,2031), -('2031-03-19',203112,3,2031,19,12,203103,2031), -('2031-03-20',203112,3,2031,20,12,203103,2031), -('2031-03-21',203112,3,2031,21,12,203103,2031), -('2031-03-22',203112,3,2031,22,12,203103,2031), -('2031-03-23',203113,3,2031,23,13,203103,2031), -('2031-03-24',203113,3,2031,24,13,203103,2031), -('2031-03-25',203113,3,2031,25,13,203103,2031), -('2031-03-26',203113,3,2031,26,13,203103,2031), -('2031-03-27',203113,3,2031,27,13,203103,2031), -('2031-03-28',203113,3,2031,28,13,203103,2031), -('2031-03-29',203113,3,2031,29,13,203103,2031), -('2031-03-30',203114,3,2031,30,14,203103,2031), -('2031-03-31',203114,3,2031,31,14,203103,2031), -('2031-04-01',203114,4,2031,1,14,203104,2031), -('2031-04-02',203114,4,2031,2,14,203104,2031), -('2031-04-03',203114,4,2031,3,14,203104,2031), -('2031-04-04',203114,4,2031,4,14,203104,2031), -('2031-04-05',203114,4,2031,5,14,203104,2031), -('2031-04-06',203115,4,2031,6,15,203104,2031), -('2031-04-07',203115,4,2031,7,15,203104,2031), -('2031-04-08',203115,4,2031,8,15,203104,2031), -('2031-04-09',203115,4,2031,9,15,203104,2031), -('2031-04-10',203115,4,2031,10,15,203104,2031), -('2031-04-11',203115,4,2031,11,15,203104,2031), -('2031-04-12',203115,4,2031,12,15,203104,2031), -('2031-04-13',203116,4,2031,13,16,203104,2031), -('2031-04-14',203116,4,2031,14,16,203104,2031), -('2031-04-15',203116,4,2031,15,16,203104,2031), -('2031-04-16',203116,4,2031,16,16,203104,2031), -('2031-04-17',203116,4,2031,17,16,203104,2031), -('2031-04-18',203116,4,2031,18,16,203104,2031), -('2031-04-19',203116,4,2031,19,16,203104,2031), -('2031-04-20',203117,4,2031,20,17,203104,2031), -('2031-04-21',203117,4,2031,21,17,203104,2031), -('2031-04-22',203117,4,2031,22,17,203104,2031), -('2031-04-23',203117,4,2031,23,17,203104,2031), -('2031-04-24',203117,4,2031,24,17,203104,2031), -('2031-04-25',203117,4,2031,25,17,203104,2031), -('2031-04-26',203117,4,2031,26,17,203104,2031), -('2031-04-27',203118,4,2031,27,18,203104,2031), -('2031-04-28',203118,4,2031,28,18,203104,2031), -('2031-04-29',203118,4,2031,29,18,203104,2031), -('2031-04-30',203118,4,2031,30,18,203104,2031), -('2031-05-01',203118,5,2031,1,18,203105,2031), -('2031-05-02',203118,5,2031,2,18,203105,2031), -('2031-05-03',203118,5,2031,3,18,203105,2031), -('2031-05-04',203119,5,2031,4,19,203105,2031), -('2031-05-05',203119,5,2031,5,19,203105,2031), -('2031-05-06',203119,5,2031,6,19,203105,2031), -('2031-05-07',203119,5,2031,7,19,203105,2031), -('2031-05-08',203119,5,2031,8,19,203105,2031), -('2031-05-09',203119,5,2031,9,19,203105,2031), -('2031-05-10',203119,5,2031,10,19,203105,2031), -('2031-05-11',203120,5,2031,11,20,203105,2031), -('2031-05-12',203120,5,2031,12,20,203105,2031), -('2031-05-13',203120,5,2031,13,20,203105,2031), -('2031-05-14',203120,5,2031,14,20,203105,2031), -('2031-05-15',203120,5,2031,15,20,203105,2031), -('2031-05-16',203120,5,2031,16,20,203105,2031), -('2031-05-17',203120,5,2031,17,20,203105,2031), -('2031-05-18',203121,5,2031,18,21,203105,2031), -('2031-05-19',203121,5,2031,19,21,203105,2031), -('2031-05-20',203121,5,2031,20,21,203105,2031), -('2031-05-21',203121,5,2031,21,21,203105,2031), -('2031-05-22',203121,5,2031,22,21,203105,2031), -('2031-05-23',203121,5,2031,23,21,203105,2031), -('2031-05-24',203121,5,2031,24,21,203105,2031), -('2031-05-25',203122,5,2031,25,22,203105,2031), -('2031-05-26',203122,5,2031,26,22,203105,2031), -('2031-05-27',203122,5,2031,27,22,203105,2031), -('2031-05-28',203122,5,2031,28,22,203105,2031), -('2031-05-29',203122,5,2031,29,22,203105,2031), -('2031-05-30',203122,5,2031,30,22,203105,2031), -('2031-05-31',203122,5,2031,31,22,203105,2031), -('2031-06-01',203123,6,2031,1,23,203106,2031), -('2031-06-02',203123,6,2031,2,23,203106,2031), -('2031-06-03',203123,6,2031,3,23,203106,2031), -('2031-06-04',203123,6,2031,4,23,203106,2031), -('2031-06-05',203123,6,2031,5,23,203106,2031), -('2031-06-06',203123,6,2031,6,23,203106,2031), -('2031-06-07',203123,6,2031,7,23,203106,2031), -('2031-06-08',203124,6,2031,8,24,203106,2031), -('2031-06-09',203124,6,2031,9,24,203106,2031), -('2031-06-10',203124,6,2031,10,24,203106,2031), -('2031-06-11',203124,6,2031,11,24,203106,2031), -('2031-06-12',203124,6,2031,12,24,203106,2031), -('2031-06-13',203124,6,2031,13,24,203106,2031), -('2031-06-14',203124,6,2031,14,24,203106,2031), -('2031-06-15',203125,6,2031,15,25,203106,2031), -('2031-06-16',203125,6,2031,16,25,203106,2031), -('2031-06-17',203125,6,2031,17,25,203106,2031), -('2031-06-18',203125,6,2031,18,25,203106,2031), -('2031-06-19',203125,6,2031,19,25,203106,2031), -('2031-06-20',203125,6,2031,20,25,203106,2031), -('2031-06-21',203125,6,2031,21,25,203106,2031), -('2031-06-22',203126,6,2031,22,26,203106,2031), -('2031-06-23',203126,6,2031,23,26,203106,2031), -('2031-06-24',203126,6,2031,24,26,203106,2031), -('2031-06-25',203126,6,2031,25,26,203106,2031), -('2031-06-26',203126,6,2031,26,26,203106,2031), -('2031-06-27',203126,6,2031,27,26,203106,2031), -('2031-06-28',203126,6,2031,28,26,203106,2031), -('2031-06-29',203127,6,2031,29,27,203106,2031), -('2031-06-30',203127,6,2031,30,27,203106,2031), -('2031-07-01',203127,7,2031,1,27,203107,2031), -('2031-07-02',203127,7,2031,2,27,203107,2031), -('2031-07-03',203127,7,2031,3,27,203107,2031), -('2031-07-04',203127,7,2031,4,27,203107,2031), -('2031-07-05',203127,7,2031,5,27,203107,2031), -('2031-07-06',203128,7,2031,6,28,203107,2031), -('2031-07-07',203128,7,2031,7,28,203107,2031), -('2031-07-08',203128,7,2031,8,28,203107,2031), -('2031-07-09',203128,7,2031,9,28,203107,2031), -('2031-07-10',203128,7,2031,10,28,203107,2031), -('2031-07-11',203128,7,2031,11,28,203107,2031), -('2031-07-12',203128,7,2031,12,28,203107,2031), -('2031-07-13',203129,7,2031,13,29,203107,2031), -('2031-07-14',203129,7,2031,14,29,203107,2031), -('2031-07-15',203129,7,2031,15,29,203107,2031), -('2031-07-16',203129,7,2031,16,29,203107,2031), -('2031-07-17',203129,7,2031,17,29,203107,2031), -('2031-07-18',203129,7,2031,18,29,203107,2031), -('2031-07-19',203129,7,2031,19,29,203107,2031), -('2031-07-20',203130,7,2031,20,30,203107,2031), -('2031-07-21',203130,7,2031,21,30,203107,2031), -('2031-07-22',203130,7,2031,22,30,203107,2031), -('2031-07-23',203130,7,2031,23,30,203107,2031), -('2031-07-24',203130,7,2031,24,30,203107,2031), -('2031-07-25',203130,7,2031,25,30,203107,2031), -('2031-07-26',203130,7,2031,26,30,203107,2031), -('2031-07-27',203131,7,2031,27,31,203107,2031), -('2031-07-28',203131,7,2031,28,31,203107,2031), -('2031-07-29',203131,7,2031,29,31,203107,2031), -('2031-07-30',203131,7,2031,30,31,203107,2031), -('2031-07-31',203131,7,2031,31,31,203107,2031), -('2031-08-01',203131,8,2031,1,31,203108,2031), -('2031-08-02',203131,8,2031,2,31,203108,2031), -('2031-08-03',203132,8,2031,3,32,203108,2031), -('2031-08-04',203132,8,2031,4,32,203108,2031), -('2031-08-05',203132,8,2031,5,32,203108,2031), -('2031-08-06',203132,8,2031,6,32,203108,2031), -('2031-08-07',203132,8,2031,7,32,203108,2031), -('2031-08-08',203132,8,2031,8,32,203108,2031), -('2031-08-09',203132,8,2031,9,32,203108,2031), -('2031-08-10',203133,8,2031,10,33,203108,2031), -('2031-08-11',203133,8,2031,11,33,203108,2031), -('2031-08-12',203133,8,2031,12,33,203108,2031), -('2031-08-13',203133,8,2031,13,33,203108,2031), -('2031-08-14',203133,8,2031,14,33,203108,2031), -('2031-08-15',203133,8,2031,15,33,203108,2031), -('2031-08-16',203133,8,2031,16,33,203108,2031), -('2031-08-17',203134,8,2031,17,34,203108,2031), -('2031-08-18',203134,8,2031,18,34,203108,2031), -('2031-08-19',203134,8,2031,19,34,203108,2031), -('2031-08-20',203134,8,2031,20,34,203108,2031), -('2031-08-21',203134,8,2031,21,34,203108,2031), -('2031-08-22',203134,8,2031,22,34,203108,2031), -('2031-08-23',203134,8,2031,23,34,203108,2031), -('2031-08-24',203135,8,2031,24,35,203108,2031), -('2031-08-25',203135,8,2031,25,35,203108,2031), -('2031-08-26',203135,8,2031,26,35,203108,2031), -('2031-08-27',203135,8,2031,27,35,203108,2031), -('2031-08-28',203135,8,2031,28,35,203108,2031), -('2031-08-29',203135,8,2031,29,35,203108,2031), -('2031-08-30',203135,8,2031,30,35,203108,2031), -('2031-08-31',203136,8,2031,31,36,203108,2031), -('2031-09-01',203136,9,2031,1,36,203109,2031), -('2031-09-02',203136,9,2031,2,36,203109,2031), -('2031-09-03',203136,9,2031,3,36,203109,2031), -('2031-09-04',203136,9,2031,4,36,203109,2031), -('2031-09-05',203136,9,2031,5,36,203109,2031), -('2031-09-06',203136,9,2031,6,36,203109,2031), -('2031-09-07',203137,9,2031,7,37,203109,2031), -('2031-09-08',203137,9,2031,8,37,203109,2031), -('2031-09-09',203137,9,2031,9,37,203109,2031), -('2031-09-10',203137,9,2031,10,37,203109,2031), -('2031-09-11',203137,9,2031,11,37,203109,2031), -('2031-09-12',203137,9,2031,12,37,203109,2031), -('2031-09-13',203137,9,2031,13,37,203109,2031), -('2031-09-14',203138,9,2031,14,38,203109,2031), -('2031-09-15',203138,9,2031,15,38,203109,2031), -('2031-09-16',203138,9,2031,16,38,203109,2031), -('2031-09-17',203138,9,2031,17,38,203109,2031), -('2031-09-18',203138,9,2031,18,38,203109,2031), -('2031-09-19',203138,9,2031,19,38,203109,2031), -('2031-09-20',203138,9,2031,20,38,203109,2031), -('2031-09-21',203139,9,2031,21,39,203109,2031), -('2031-09-22',203139,9,2031,22,39,203109,2031), -('2031-09-23',203139,9,2031,23,39,203109,2031), -('2031-09-24',203139,9,2031,24,39,203109,2031), -('2031-09-25',203139,9,2031,25,39,203109,2031), -('2031-09-26',203139,9,2031,26,39,203109,2031), -('2031-09-27',203139,9,2031,27,39,203109,2031), -('2031-09-28',203140,9,2031,28,40,203109,2031), -('2031-09-29',203140,9,2031,29,40,203109,2031), -('2031-09-30',203140,9,2031,30,40,203109,2031), -('2031-10-01',203140,10,2031,1,40,203110,2031), -('2031-10-02',203140,10,2031,2,40,203110,2031), -('2031-10-03',203140,10,2031,3,40,203110,2031), -('2031-10-04',203140,10,2031,4,40,203110,2031), -('2031-10-05',203141,10,2031,5,41,203110,2031), -('2031-10-06',203141,10,2031,6,41,203110,2031), -('2031-10-07',203141,10,2031,7,41,203110,2031), -('2031-10-08',203141,10,2031,8,41,203110,2031), -('2031-10-09',203141,10,2031,9,41,203110,2031), -('2031-10-10',203141,10,2031,10,41,203110,2031), -('2031-10-11',203141,10,2031,11,41,203110,2031), -('2031-10-12',203142,10,2031,12,42,203110,2031), -('2031-10-13',203142,10,2031,13,42,203110,2031), -('2031-10-14',203142,10,2031,14,42,203110,2031), -('2031-10-15',203142,10,2031,15,42,203110,2031), -('2031-10-16',203142,10,2031,16,42,203110,2031), -('2031-10-17',203142,10,2031,17,42,203110,2031), -('2031-10-18',203142,10,2031,18,42,203110,2031), -('2031-10-19',203143,10,2031,19,43,203110,2031), -('2031-10-20',203143,10,2031,20,43,203110,2031), -('2031-10-21',203143,10,2031,21,43,203110,2031), -('2031-10-22',203143,10,2031,22,43,203110,2031), -('2031-10-23',203143,10,2031,23,43,203110,2031), -('2031-10-24',203143,10,2031,24,43,203110,2031), -('2031-10-25',203143,10,2031,25,43,203110,2031), -('2031-10-26',203144,10,2031,26,44,203110,2031), -('2031-10-27',203144,10,2031,27,44,203110,2031), -('2031-10-28',203144,10,2031,28,44,203110,2031), -('2031-10-29',203144,10,2031,29,44,203110,2031), -('2031-10-30',203144,10,2031,30,44,203110,2031), -('2031-10-31',203144,10,2031,31,44,203110,2031), -('2031-11-01',203144,11,2031,1,44,203111,2031), -('2031-11-02',203145,11,2031,2,45,203111,2031), -('2031-11-03',203145,11,2031,3,45,203111,2031), -('2031-11-04',203145,11,2031,4,45,203111,2031), -('2031-11-05',203145,11,2031,5,45,203111,2031), -('2031-11-06',203145,11,2031,6,45,203111,2031), -('2031-11-07',203145,11,2031,7,45,203111,2031), -('2031-11-08',203145,11,2031,8,45,203111,2031), -('2031-11-09',203146,11,2031,9,46,203111,2031), -('2031-11-10',203146,11,2031,10,46,203111,2031), -('2031-11-11',203146,11,2031,11,46,203111,2031), -('2031-11-12',203146,11,2031,12,46,203111,2031), -('2031-11-13',203146,11,2031,13,46,203111,2031), -('2031-11-14',203146,11,2031,14,46,203111,2031), -('2031-11-15',203146,11,2031,15,46,203111,2031), -('2031-11-16',203147,11,2031,16,47,203111,2031), -('2031-11-17',203147,11,2031,17,47,203111,2031), -('2031-11-18',203147,11,2031,18,47,203111,2031), -('2031-11-19',203147,11,2031,19,47,203111,2031), -('2031-11-20',203147,11,2031,20,47,203111,2031), -('2031-11-21',203147,11,2031,21,47,203111,2031), -('2031-11-22',203147,11,2031,22,47,203111,2031), -('2031-11-23',203148,11,2031,23,48,203111,2031), -('2031-11-24',203148,11,2031,24,48,203111,2031), -('2031-11-25',203148,11,2031,25,48,203111,2031), -('2031-11-26',203148,11,2031,26,48,203111,2031), -('2031-11-27',203148,11,2031,27,48,203111,2031), -('2031-11-28',203148,11,2031,28,48,203111,2031), -('2031-11-29',203148,11,2031,29,48,203111,2031), -('2031-11-30',203149,11,2031,30,49,203111,2031), -('2031-12-01',203149,12,2031,1,49,203112,2032), -('2031-12-02',203149,12,2031,2,49,203112,2032), -('2031-12-03',203149,12,2031,3,49,203112,2032), -('2031-12-04',203149,12,2031,4,49,203112,2032), -('2031-12-05',203149,12,2031,5,49,203112,2032), -('2031-12-06',203149,12,2031,6,49,203112,2032), -('2031-12-07',203150,12,2031,7,50,203112,2032), -('2031-12-08',203150,12,2031,8,50,203112,2032), -('2031-12-09',203150,12,2031,9,50,203112,2032), -('2031-12-10',203150,12,2031,10,50,203112,2032), -('2031-12-11',203150,12,2031,11,50,203112,2032), -('2031-12-12',203150,12,2031,12,50,203112,2032), -('2031-12-13',203150,12,2031,13,50,203112,2032), -('2031-12-14',203151,12,2031,14,51,203112,2032), -('2031-12-15',203151,12,2031,15,51,203112,2032), -('2031-12-16',203151,12,2031,16,51,203112,2032), -('2031-12-17',203151,12,2031,17,51,203112,2032), -('2031-12-18',203151,12,2031,18,51,203112,2032), -('2031-12-19',203151,12,2031,19,51,203112,2032), -('2031-12-20',203151,12,2031,20,51,203112,2032), -('2031-12-21',203152,12,2031,21,52,203112,2032), -('2031-12-22',203152,12,2031,22,52,203112,2032), -('2031-12-23',203152,12,2031,23,52,203112,2032), -('2031-12-24',203152,12,2031,24,52,203112,2032), -('2031-12-25',203152,12,2031,25,52,203112,2032), -('2031-12-26',203152,12,2031,26,52,203112,2032), -('2031-12-27',203152,12,2031,27,52,203112,2032), -('2031-12-28',203153,12,2031,28,53,203112,2032), -('2031-12-29',203101,12,2031,29,53,203112,2032), -('2031-12-30',203101,12,2031,30,53,203112,2032), -('2031-12-31',203101,12,2031,31,53,203112,2032), -('2032-01-01',203201,1,2032,1,53,203201,2032), -('2032-01-02',203201,1,2032,2,53,203201,2032), -('2032-01-03',203201,1,2032,3,53,203201,2032), -('2032-01-04',203202,1,2032,4,1,203201,2032), -('2032-01-05',203202,1,2032,5,1,203201,2032), -('2032-01-06',203202,1,2032,6,1,203201,2032), -('2032-01-07',203202,1,2032,7,1,203201,2032), -('2032-01-08',203202,1,2032,8,1,203201,2032), -('2032-01-09',203202,1,2032,9,1,203201,2032), -('2032-01-10',203202,1,2032,10,1,203201,2032), -('2032-01-11',203203,1,2032,11,2,203201,2032), -('2032-01-12',203203,1,2032,12,2,203201,2032), -('2032-01-13',203203,1,2032,13,2,203201,2032), -('2032-01-14',203203,1,2032,14,2,203201,2032), -('2032-01-15',203203,1,2032,15,2,203201,2032), -('2032-01-16',203203,1,2032,16,2,203201,2032), -('2032-01-17',203203,1,2032,17,2,203201,2032), -('2032-01-18',203204,1,2032,18,3,203201,2032), -('2032-01-19',203204,1,2032,19,3,203201,2032), -('2032-01-20',203204,1,2032,20,3,203201,2032), -('2032-01-21',203204,1,2032,21,3,203201,2032), -('2032-01-22',203204,1,2032,22,3,203201,2032), -('2032-01-23',203204,1,2032,23,3,203201,2032), -('2032-01-24',203204,1,2032,24,3,203201,2032), -('2032-01-25',203205,1,2032,25,4,203201,2032), -('2032-01-26',203205,1,2032,26,4,203201,2032), -('2032-01-27',203205,1,2032,27,4,203201,2032), -('2032-01-28',203205,1,2032,28,4,203201,2032), -('2032-01-29',203205,1,2032,29,4,203201,2032), -('2032-01-30',203205,1,2032,30,4,203201,2032), -('2032-01-31',203205,1,2032,31,4,203201,2032), -('2032-02-01',203206,2,2032,1,5,203202,2032), -('2032-02-02',203206,2,2032,2,5,203202,2032), -('2032-02-03',203206,2,2032,3,5,203202,2032), -('2032-02-04',203206,2,2032,4,5,203202,2032), -('2032-02-05',203206,2,2032,5,5,203202,2032), -('2032-02-06',203206,2,2032,6,5,203202,2032), -('2032-02-07',203206,2,2032,7,5,203202,2032), -('2032-02-08',203207,2,2032,8,6,203202,2032), -('2032-02-09',203207,2,2032,9,6,203202,2032), -('2032-02-10',203207,2,2032,10,6,203202,2032), -('2032-02-11',203207,2,2032,11,6,203202,2032), -('2032-02-12',203207,2,2032,12,6,203202,2032), -('2032-02-13',203207,2,2032,13,6,203202,2032), -('2032-02-14',203207,2,2032,14,6,203202,2032), -('2032-02-15',203208,2,2032,15,7,203202,2032), -('2032-02-16',203208,2,2032,16,7,203202,2032), -('2032-02-17',203208,2,2032,17,7,203202,2032), -('2032-02-18',203208,2,2032,18,7,203202,2032), -('2032-02-19',203208,2,2032,19,7,203202,2032), -('2032-02-20',203208,2,2032,20,7,203202,2032), -('2032-02-21',203208,2,2032,21,7,203202,2032), -('2032-02-22',203209,2,2032,22,8,203202,2032), -('2032-02-23',203209,2,2032,23,8,203202,2032), -('2032-02-24',203209,2,2032,24,8,203202,2032), -('2032-02-25',203209,2,2032,25,8,203202,2032), -('2032-02-26',203209,2,2032,26,8,203202,2032), -('2032-02-27',203209,2,2032,27,8,203202,2032), -('2032-02-28',203209,2,2032,28,8,203202,2032), -('2032-02-29',203210,2,2032,29,9,203202,2032), -('2032-03-01',203210,3,2032,1,9,203203,2032), -('2032-03-02',203210,3,2032,2,9,203203,2032), -('2032-03-03',203210,3,2032,3,9,203203,2032), -('2032-03-04',203210,3,2032,4,9,203203,2032), -('2032-03-05',203210,3,2032,5,9,203203,2032), -('2032-03-06',203210,3,2032,6,9,203203,2032), -('2032-03-07',203211,3,2032,7,10,203203,2032), -('2032-03-08',203211,3,2032,8,10,203203,2032), -('2032-03-09',203211,3,2032,9,10,203203,2032), -('2032-03-10',203211,3,2032,10,10,203203,2032), -('2032-03-11',203211,3,2032,11,10,203203,2032), -('2032-03-12',203211,3,2032,12,10,203203,2032), -('2032-03-13',203211,3,2032,13,10,203203,2032), -('2032-03-14',203212,3,2032,14,11,203203,2032), -('2032-03-15',203212,3,2032,15,11,203203,2032), -('2032-03-16',203212,3,2032,16,11,203203,2032), -('2032-03-17',203212,3,2032,17,11,203203,2032), -('2032-03-18',203212,3,2032,18,11,203203,2032), -('2032-03-19',203212,3,2032,19,11,203203,2032), -('2032-03-20',203212,3,2032,20,11,203203,2032), -('2032-03-21',203213,3,2032,21,12,203203,2032), -('2032-03-22',203213,3,2032,22,12,203203,2032), -('2032-03-23',203213,3,2032,23,12,203203,2032), -('2032-03-24',203213,3,2032,24,12,203203,2032), -('2032-03-25',203213,3,2032,25,12,203203,2032), -('2032-03-26',203213,3,2032,26,12,203203,2032), -('2032-03-27',203213,3,2032,27,12,203203,2032), -('2032-03-28',203214,3,2032,28,13,203203,2032), -('2032-03-29',203214,3,2032,29,13,203203,2032), -('2032-03-30',203214,3,2032,30,13,203203,2032), -('2032-03-31',203214,3,2032,31,13,203203,2032), -('2032-04-01',203214,4,2032,1,13,203204,2032), -('2032-04-02',203214,4,2032,2,13,203204,2032), -('2032-04-03',203214,4,2032,3,13,203204,2032), -('2032-04-04',203215,4,2032,4,14,203204,2032), -('2032-04-05',203215,4,2032,5,14,203204,2032), -('2032-04-06',203215,4,2032,6,14,203204,2032), -('2032-04-07',203215,4,2032,7,14,203204,2032), -('2032-04-08',203215,4,2032,8,14,203204,2032), -('2032-04-09',203215,4,2032,9,14,203204,2032), -('2032-04-10',203215,4,2032,10,14,203204,2032), -('2032-04-11',203216,4,2032,11,15,203204,2032), -('2032-04-12',203216,4,2032,12,15,203204,2032), -('2032-04-13',203216,4,2032,13,15,203204,2032), -('2032-04-14',203216,4,2032,14,15,203204,2032), -('2032-04-15',203216,4,2032,15,15,203204,2032), -('2032-04-16',203216,4,2032,16,15,203204,2032), -('2032-04-17',203216,4,2032,17,15,203204,2032), -('2032-04-18',203217,4,2032,18,16,203204,2032), -('2032-04-19',203217,4,2032,19,16,203204,2032), -('2032-04-20',203217,4,2032,20,16,203204,2032), -('2032-04-21',203217,4,2032,21,16,203204,2032), -('2032-04-22',203217,4,2032,22,16,203204,2032), -('2032-04-23',203217,4,2032,23,16,203204,2032), -('2032-04-24',203217,4,2032,24,16,203204,2032), -('2032-04-25',203218,4,2032,25,17,203204,2032), -('2032-04-26',203218,4,2032,26,17,203204,2032), -('2032-04-27',203218,4,2032,27,17,203204,2032), -('2032-04-28',203218,4,2032,28,17,203204,2032), -('2032-04-29',203218,4,2032,29,17,203204,2032), -('2032-04-30',203218,4,2032,30,17,203204,2032), -('2032-05-01',203218,5,2032,1,17,203205,2032), -('2032-05-02',203219,5,2032,2,18,203205,2032), -('2032-05-03',203219,5,2032,3,18,203205,2032), -('2032-05-04',203219,5,2032,4,18,203205,2032), -('2032-05-05',203219,5,2032,5,18,203205,2032), -('2032-05-06',203219,5,2032,6,18,203205,2032), -('2032-05-07',203219,5,2032,7,18,203205,2032), -('2032-05-08',203219,5,2032,8,18,203205,2032), -('2032-05-09',203220,5,2032,9,19,203205,2032), -('2032-05-10',203220,5,2032,10,19,203205,2032), -('2032-05-11',203220,5,2032,11,19,203205,2032), -('2032-05-12',203220,5,2032,12,19,203205,2032), -('2032-05-13',203220,5,2032,13,19,203205,2032), -('2032-05-14',203220,5,2032,14,19,203205,2032), -('2032-05-15',203220,5,2032,15,19,203205,2032), -('2032-05-16',203221,5,2032,16,20,203205,2032), -('2032-05-17',203221,5,2032,17,20,203205,2032), -('2032-05-18',203221,5,2032,18,20,203205,2032), -('2032-05-19',203221,5,2032,19,20,203205,2032), -('2032-05-20',203221,5,2032,20,20,203205,2032), -('2032-05-21',203221,5,2032,21,20,203205,2032), -('2032-05-22',203221,5,2032,22,20,203205,2032), -('2032-05-23',203222,5,2032,23,21,203205,2032), -('2032-05-24',203222,5,2032,24,21,203205,2032), -('2032-05-25',203222,5,2032,25,21,203205,2032), -('2032-05-26',203222,5,2032,26,21,203205,2032), -('2032-05-27',203222,5,2032,27,21,203205,2032), -('2032-05-28',203222,5,2032,28,21,203205,2032), -('2032-05-29',203222,5,2032,29,21,203205,2032), -('2032-05-30',203223,5,2032,30,22,203205,2032), -('2032-05-31',203223,5,2032,31,22,203205,2032), -('2032-06-01',203223,6,2032,1,22,203206,2032), -('2032-06-02',203223,6,2032,2,22,203206,2032), -('2032-06-03',203223,6,2032,3,22,203206,2032), -('2032-06-04',203223,6,2032,4,22,203206,2032), -('2032-06-05',203223,6,2032,5,22,203206,2032), -('2032-06-06',203224,6,2032,6,23,203206,2032), -('2032-06-07',203224,6,2032,7,23,203206,2032), -('2032-06-08',203224,6,2032,8,23,203206,2032), -('2032-06-09',203224,6,2032,9,23,203206,2032), -('2032-06-10',203224,6,2032,10,23,203206,2032), -('2032-06-11',203224,6,2032,11,23,203206,2032), -('2032-06-12',203224,6,2032,12,23,203206,2032), -('2032-06-13',203225,6,2032,13,24,203206,2032), -('2032-06-14',203225,6,2032,14,24,203206,2032), -('2032-06-15',203225,6,2032,15,24,203206,2032), -('2032-06-16',203225,6,2032,16,24,203206,2032), -('2032-06-17',203225,6,2032,17,24,203206,2032), -('2032-06-18',203225,6,2032,18,24,203206,2032), -('2032-06-19',203225,6,2032,19,24,203206,2032), -('2032-06-20',203226,6,2032,20,25,203206,2032), -('2032-06-21',203226,6,2032,21,25,203206,2032), -('2032-06-22',203226,6,2032,22,25,203206,2032), -('2032-06-23',203226,6,2032,23,25,203206,2032), -('2032-06-24',203226,6,2032,24,25,203206,2032), -('2032-06-25',203226,6,2032,25,25,203206,2032), -('2032-06-26',203226,6,2032,26,25,203206,2032), -('2032-06-27',203227,6,2032,27,26,203206,2032), -('2032-06-28',203227,6,2032,28,26,203206,2032), -('2032-06-29',203227,6,2032,29,26,203206,2032), -('2032-06-30',203227,6,2032,30,26,203206,2032), -('2032-07-01',203227,7,2032,1,26,203207,2032), -('2032-07-02',203227,7,2032,2,26,203207,2032), -('2032-07-03',203227,7,2032,3,26,203207,2032), -('2032-07-04',203228,7,2032,4,27,203207,2032), -('2032-07-05',203228,7,2032,5,27,203207,2032), -('2032-07-06',203228,7,2032,6,27,203207,2032), -('2032-07-07',203228,7,2032,7,27,203207,2032), -('2032-07-08',203228,7,2032,8,27,203207,2032), -('2032-07-09',203228,7,2032,9,27,203207,2032), -('2032-07-10',203228,7,2032,10,27,203207,2032), -('2032-07-11',203229,7,2032,11,28,203207,2032), -('2032-07-12',203229,7,2032,12,28,203207,2032), -('2032-07-13',203229,7,2032,13,28,203207,2032), -('2032-07-14',203229,7,2032,14,28,203207,2032), -('2032-07-15',203229,7,2032,15,28,203207,2032), -('2032-07-16',203229,7,2032,16,28,203207,2032), -('2032-07-17',203229,7,2032,17,28,203207,2032), -('2032-07-18',203230,7,2032,18,29,203207,2032), -('2032-07-19',203230,7,2032,19,29,203207,2032), -('2032-07-20',203230,7,2032,20,29,203207,2032), -('2032-07-21',203230,7,2032,21,29,203207,2032), -('2032-07-22',203230,7,2032,22,29,203207,2032), -('2032-07-23',203230,7,2032,23,29,203207,2032), -('2032-07-24',203230,7,2032,24,29,203207,2032), -('2032-07-25',203231,7,2032,25,30,203207,2032), -('2032-07-26',203231,7,2032,26,30,203207,2032), -('2032-07-27',203231,7,2032,27,30,203207,2032), -('2032-07-28',203231,7,2032,28,30,203207,2032), -('2032-07-29',203231,7,2032,29,30,203207,2032), -('2032-07-30',203231,7,2032,30,30,203207,2032), -('2032-07-31',203231,7,2032,31,30,203207,2032), -('2032-08-01',203232,8,2032,1,31,203208,2032), -('2032-08-02',203232,8,2032,2,31,203208,2032), -('2032-08-03',203232,8,2032,3,31,203208,2032), -('2032-08-04',203232,8,2032,4,31,203208,2032), -('2032-08-05',203232,8,2032,5,31,203208,2032), -('2032-08-06',203232,8,2032,6,31,203208,2032), -('2032-08-07',203232,8,2032,7,31,203208,2032), -('2032-08-08',203233,8,2032,8,32,203208,2032), -('2032-08-09',203233,8,2032,9,32,203208,2032), -('2032-08-10',203233,8,2032,10,32,203208,2032), -('2032-08-11',203233,8,2032,11,32,203208,2032), -('2032-08-12',203233,8,2032,12,32,203208,2032), -('2032-08-13',203233,8,2032,13,32,203208,2032), -('2032-08-14',203233,8,2032,14,32,203208,2032), -('2032-08-15',203234,8,2032,15,33,203208,2032), -('2032-08-16',203234,8,2032,16,33,203208,2032), -('2032-08-17',203234,8,2032,17,33,203208,2032), -('2032-08-18',203234,8,2032,18,33,203208,2032), -('2032-08-19',203234,8,2032,19,33,203208,2032), -('2032-08-20',203234,8,2032,20,33,203208,2032), -('2032-08-21',203234,8,2032,21,33,203208,2032), -('2032-08-22',203235,8,2032,22,34,203208,2032), -('2032-08-23',203235,8,2032,23,34,203208,2032), -('2032-08-24',203235,8,2032,24,34,203208,2032), -('2032-08-25',203235,8,2032,25,34,203208,2032), -('2032-08-26',203235,8,2032,26,34,203208,2032), -('2032-08-27',203235,8,2032,27,34,203208,2032), -('2032-08-28',203235,8,2032,28,34,203208,2032), -('2032-08-29',203236,8,2032,29,35,203208,2032), -('2032-08-30',203236,8,2032,30,35,203208,2032), -('2032-08-31',203236,8,2032,31,35,203208,2032), -('2032-09-01',203236,9,2032,1,35,203209,2032), -('2032-09-02',203236,9,2032,2,35,203209,2032), -('2032-09-03',203236,9,2032,3,35,203209,2032), -('2032-09-04',203236,9,2032,4,35,203209,2032), -('2032-09-05',203237,9,2032,5,36,203209,2032), -('2032-09-06',203237,9,2032,6,36,203209,2032), -('2032-09-07',203237,9,2032,7,36,203209,2032), -('2032-09-08',203237,9,2032,8,36,203209,2032), -('2032-09-09',203237,9,2032,9,36,203209,2032), -('2032-09-10',203237,9,2032,10,36,203209,2032), -('2032-09-11',203237,9,2032,11,36,203209,2032), -('2032-09-12',203238,9,2032,12,37,203209,2032), -('2032-09-13',203238,9,2032,13,37,203209,2032), -('2032-09-14',203238,9,2032,14,37,203209,2032), -('2032-09-15',203238,9,2032,15,37,203209,2032), -('2032-09-16',203238,9,2032,16,37,203209,2032), -('2032-09-17',203238,9,2032,17,37,203209,2032), -('2032-09-18',203238,9,2032,18,37,203209,2032), -('2032-09-19',203239,9,2032,19,38,203209,2032), -('2032-09-20',203239,9,2032,20,38,203209,2032), -('2032-09-21',203239,9,2032,21,38,203209,2032), -('2032-09-22',203239,9,2032,22,38,203209,2032), -('2032-09-23',203239,9,2032,23,38,203209,2032), -('2032-09-24',203239,9,2032,24,38,203209,2032), -('2032-09-25',203239,9,2032,25,38,203209,2032), -('2032-09-26',203240,9,2032,26,39,203209,2032), -('2032-09-27',203240,9,2032,27,39,203209,2032), -('2032-09-28',203240,9,2032,28,39,203209,2032), -('2032-09-29',203240,9,2032,29,39,203209,2032), -('2032-09-30',203240,9,2032,30,39,203209,2032), -('2032-10-01',203240,10,2032,1,39,203210,2032), -('2032-10-02',203240,10,2032,2,39,203210,2032), -('2032-10-03',203241,10,2032,3,40,203210,2032), -('2032-10-04',203241,10,2032,4,40,203210,2032), -('2032-10-05',203241,10,2032,5,40,203210,2032), -('2032-10-06',203241,10,2032,6,40,203210,2032), -('2032-10-07',203241,10,2032,7,40,203210,2032), -('2032-10-08',203241,10,2032,8,40,203210,2032), -('2032-10-09',203241,10,2032,9,40,203210,2032), -('2032-10-10',203242,10,2032,10,41,203210,2032), -('2032-10-11',203242,10,2032,11,41,203210,2032), -('2032-10-12',203242,10,2032,12,41,203210,2032), -('2032-10-13',203242,10,2032,13,41,203210,2032), -('2032-10-14',203242,10,2032,14,41,203210,2032), -('2032-10-15',203242,10,2032,15,41,203210,2032), -('2032-10-16',203242,10,2032,16,41,203210,2032), -('2032-10-17',203243,10,2032,17,42,203210,2032), -('2032-10-18',203243,10,2032,18,42,203210,2032), -('2032-10-19',203243,10,2032,19,42,203210,2032), -('2032-10-20',203243,10,2032,20,42,203210,2032), -('2032-10-21',203243,10,2032,21,42,203210,2032), -('2032-10-22',203243,10,2032,22,42,203210,2032), -('2032-10-23',203243,10,2032,23,42,203210,2032), -('2032-10-24',203244,10,2032,24,43,203210,2032), -('2032-10-25',203244,10,2032,25,43,203210,2032), -('2032-10-26',203244,10,2032,26,43,203210,2032), -('2032-10-27',203244,10,2032,27,43,203210,2032), -('2032-10-28',203244,10,2032,28,43,203210,2032), -('2032-10-29',203244,10,2032,29,43,203210,2032), -('2032-10-30',203244,10,2032,30,43,203210,2032), -('2032-10-31',203245,10,2032,31,44,203210,2032), -('2032-11-01',203245,11,2032,1,44,203211,2032), -('2032-11-02',203245,11,2032,2,44,203211,2032), -('2032-11-03',203245,11,2032,3,44,203211,2032), -('2032-11-04',203245,11,2032,4,44,203211,2032), -('2032-11-05',203245,11,2032,5,44,203211,2032), -('2032-11-06',203245,11,2032,6,44,203211,2032), -('2032-11-07',203246,11,2032,7,45,203211,2032), -('2032-11-08',203246,11,2032,8,45,203211,2032), -('2032-11-09',203246,11,2032,9,45,203211,2032), -('2032-11-10',203246,11,2032,10,45,203211,2032), -('2032-11-11',203246,11,2032,11,45,203211,2032), -('2032-11-12',203246,11,2032,12,45,203211,2032), -('2032-11-13',203246,11,2032,13,45,203211,2032), -('2032-11-14',203247,11,2032,14,46,203211,2032), -('2032-11-15',203247,11,2032,15,46,203211,2032), -('2032-11-16',203247,11,2032,16,46,203211,2032), -('2032-11-17',203247,11,2032,17,46,203211,2032), -('2032-11-18',203247,11,2032,18,46,203211,2032), -('2032-11-19',203247,11,2032,19,46,203211,2032), -('2032-11-20',203247,11,2032,20,46,203211,2032), -('2032-11-21',203248,11,2032,21,47,203211,2032), -('2032-11-22',203248,11,2032,22,47,203211,2032), -('2032-11-23',203248,11,2032,23,47,203211,2032), -('2032-11-24',203248,11,2032,24,47,203211,2032), -('2032-11-25',203248,11,2032,25,47,203211,2032), -('2032-11-26',203248,11,2032,26,47,203211,2032), -('2032-11-27',203248,11,2032,27,47,203211,2032), -('2032-11-28',203249,11,2032,28,48,203211,2032), -('2032-11-29',203249,11,2032,29,48,203211,2032), -('2032-11-30',203249,11,2032,30,48,203211,2032), -('2032-12-01',203249,12,2032,1,48,203212,2033), -('2032-12-02',203249,12,2032,2,48,203212,2033), -('2032-12-03',203249,12,2032,3,48,203212,2033), -('2032-12-04',203249,12,2032,4,48,203212,2033), -('2032-12-05',203250,12,2032,5,49,203212,2033), -('2032-12-06',203250,12,2032,6,49,203212,2033), -('2032-12-07',203250,12,2032,7,49,203212,2033), -('2032-12-08',203250,12,2032,8,49,203212,2033), -('2032-12-09',203250,12,2032,9,49,203212,2033), -('2032-12-10',203250,12,2032,10,49,203212,2033), -('2032-12-11',203250,12,2032,11,49,203212,2033), -('2032-12-12',203251,12,2032,12,50,203212,2033), -('2032-12-13',203251,12,2032,13,50,203212,2033), -('2032-12-14',203251,12,2032,14,50,203212,2033), -('2032-12-15',203251,12,2032,15,50,203212,2033), -('2032-12-16',203251,12,2032,16,50,203212,2033), -('2032-12-17',203251,12,2032,17,50,203212,2033), -('2032-12-18',203251,12,2032,18,50,203212,2033), -('2032-12-19',203252,12,2032,19,51,203212,2033), -('2032-12-20',203252,12,2032,20,51,203212,2033), -('2032-12-21',203252,12,2032,21,51,203212,2033), -('2032-12-22',203252,12,2032,22,51,203212,2033), -('2032-12-23',203252,12,2032,23,51,203212,2033), -('2032-12-24',203252,12,2032,24,51,203212,2033), -('2032-12-25',203252,12,2032,25,51,203212,2033), -('2032-12-26',203253,12,2032,26,52,203212,2033), -('2032-12-27',203253,12,2032,27,52,203212,2033), -('2032-12-28',203253,12,2032,28,52,203212,2033), -('2032-12-29',203253,12,2032,29,52,203212,2033), -('2032-12-30',203253,12,2032,30,52,203212,2033), -('2032-12-31',203253,12,2032,31,52,203212,2033), -('2033-01-01',203353,1,2033,1,52,203301,2033), -('2033-01-02',203354,1,2033,2,1,203301,2033), -('2033-01-03',203301,1,2033,3,1,203301,2033), -('2033-01-04',203301,1,2033,4,1,203301,2033), -('2033-01-05',203301,1,2033,5,1,203301,2033), -('2033-01-06',203301,1,2033,6,1,203301,2033), -('2033-01-07',203301,1,2033,7,1,203301,2033), -('2033-01-08',203301,1,2033,8,1,203301,2033), -('2033-01-09',203302,1,2033,9,2,203301,2033), -('2033-01-10',203302,1,2033,10,2,203301,2033), -('2033-01-11',203302,1,2033,11,2,203301,2033), -('2033-01-12',203302,1,2033,12,2,203301,2033), -('2033-01-13',203302,1,2033,13,2,203301,2033), -('2033-01-14',203302,1,2033,14,2,203301,2033), -('2033-01-15',203302,1,2033,15,2,203301,2033), -('2033-01-16',203303,1,2033,16,3,203301,2033), -('2033-01-17',203303,1,2033,17,3,203301,2033), -('2033-01-18',203303,1,2033,18,3,203301,2033), -('2033-01-19',203303,1,2033,19,3,203301,2033), -('2033-01-20',203303,1,2033,20,3,203301,2033), -('2033-01-21',203303,1,2033,21,3,203301,2033), -('2033-01-22',203303,1,2033,22,3,203301,2033), -('2033-01-23',203304,1,2033,23,4,203301,2033), -('2033-01-24',203304,1,2033,24,4,203301,2033), -('2033-01-25',203304,1,2033,25,4,203301,2033), -('2033-01-26',203304,1,2033,26,4,203301,2033), -('2033-01-27',203304,1,2033,27,4,203301,2033), -('2033-01-28',203304,1,2033,28,4,203301,2033), -('2033-01-29',203304,1,2033,29,4,203301,2033), -('2033-01-30',203305,1,2033,30,5,203301,2033), -('2033-01-31',203305,1,2033,31,5,203301,2033), -('2033-02-01',203305,2,2033,1,5,203302,2033), -('2033-02-02',203305,2,2033,2,5,203302,2033), -('2033-02-03',203305,2,2033,3,5,203302,2033), -('2033-02-04',203305,2,2033,4,5,203302,2033), -('2033-02-05',203305,2,2033,5,5,203302,2033), -('2033-02-06',203306,2,2033,6,6,203302,2033), -('2033-02-07',203306,2,2033,7,6,203302,2033), -('2033-02-08',203306,2,2033,8,6,203302,2033), -('2033-02-09',203306,2,2033,9,6,203302,2033), -('2033-02-10',203306,2,2033,10,6,203302,2033), -('2033-02-11',203306,2,2033,11,6,203302,2033), -('2033-02-12',203306,2,2033,12,6,203302,2033), -('2033-02-13',203307,2,2033,13,7,203302,2033), -('2033-02-14',203307,2,2033,14,7,203302,2033), -('2033-02-15',203307,2,2033,15,7,203302,2033), -('2033-02-16',203307,2,2033,16,7,203302,2033), -('2033-02-17',203307,2,2033,17,7,203302,2033), -('2033-02-18',203307,2,2033,18,7,203302,2033), -('2033-02-19',203307,2,2033,19,7,203302,2033), -('2033-02-20',203308,2,2033,20,8,203302,2033), -('2033-02-21',203308,2,2033,21,8,203302,2033), -('2033-02-22',203308,2,2033,22,8,203302,2033), -('2033-02-23',203308,2,2033,23,8,203302,2033), -('2033-02-24',203308,2,2033,24,8,203302,2033), -('2033-02-25',203308,2,2033,25,8,203302,2033), -('2033-02-26',203308,2,2033,26,8,203302,2033), -('2033-02-27',203309,2,2033,27,9,203302,2033), -('2033-02-28',203309,2,2033,28,9,203302,2033), -('2033-03-01',203309,3,2033,1,9,203303,2033), -('2033-03-02',203309,3,2033,2,9,203303,2033), -('2033-03-03',203309,3,2033,3,9,203303,2033), -('2033-03-04',203309,3,2033,4,9,203303,2033), -('2033-03-05',203309,3,2033,5,9,203303,2033), -('2033-03-06',203310,3,2033,6,10,203303,2033), -('2033-03-07',203310,3,2033,7,10,203303,2033), -('2033-03-08',203310,3,2033,8,10,203303,2033), -('2033-03-09',203310,3,2033,9,10,203303,2033), -('2033-03-10',203310,3,2033,10,10,203303,2033), -('2033-03-11',203310,3,2033,11,10,203303,2033), -('2033-03-12',203310,3,2033,12,10,203303,2033), -('2033-03-13',203311,3,2033,13,11,203303,2033), -('2033-03-14',203311,3,2033,14,11,203303,2033), -('2033-03-15',203311,3,2033,15,11,203303,2033), -('2033-03-16',203311,3,2033,16,11,203303,2033), -('2033-03-17',203311,3,2033,17,11,203303,2033), -('2033-03-18',203311,3,2033,18,11,203303,2033), -('2033-03-19',203311,3,2033,19,11,203303,2033), -('2033-03-20',203312,3,2033,20,12,203303,2033), -('2033-03-21',203312,3,2033,21,12,203303,2033), -('2033-03-22',203312,3,2033,22,12,203303,2033), -('2033-03-23',203312,3,2033,23,12,203303,2033), -('2033-03-24',203312,3,2033,24,12,203303,2033), -('2033-03-25',203312,3,2033,25,12,203303,2033), -('2033-03-26',203312,3,2033,26,12,203303,2033), -('2033-03-27',203313,3,2033,27,13,203303,2033), -('2033-03-28',203313,3,2033,28,13,203303,2033), -('2033-03-29',203313,3,2033,29,13,203303,2033), -('2033-03-30',203313,3,2033,30,13,203303,2033), -('2033-03-31',203313,3,2033,31,13,203303,2033), -('2033-04-01',203313,4,2033,1,13,203304,2033), -('2033-04-02',203313,4,2033,2,13,203304,2033), -('2033-04-03',203314,4,2033,3,14,203304,2033), -('2033-04-04',203314,4,2033,4,14,203304,2033), -('2033-04-05',203314,4,2033,5,14,203304,2033), -('2033-04-06',203314,4,2033,6,14,203304,2033), -('2033-04-07',203314,4,2033,7,14,203304,2033), -('2033-04-08',203314,4,2033,8,14,203304,2033), -('2033-04-09',203314,4,2033,9,14,203304,2033), -('2033-04-10',203315,4,2033,10,15,203304,2033), -('2033-04-11',203315,4,2033,11,15,203304,2033), -('2033-04-12',203315,4,2033,12,15,203304,2033), -('2033-04-13',203315,4,2033,13,15,203304,2033), -('2033-04-14',203315,4,2033,14,15,203304,2033), -('2033-04-15',203315,4,2033,15,15,203304,2033), -('2033-04-16',203315,4,2033,16,15,203304,2033), -('2033-04-17',203316,4,2033,17,16,203304,2033), -('2033-04-18',203316,4,2033,18,16,203304,2033), -('2033-04-19',203316,4,2033,19,16,203304,2033), -('2033-04-20',203316,4,2033,20,16,203304,2033), -('2033-04-21',203316,4,2033,21,16,203304,2033), -('2033-04-22',203316,4,2033,22,16,203304,2033), -('2033-04-23',203316,4,2033,23,16,203304,2033), -('2033-04-24',203317,4,2033,24,17,203304,2033), -('2033-04-25',203317,4,2033,25,17,203304,2033), -('2033-04-26',203317,4,2033,26,17,203304,2033), -('2033-04-27',203317,4,2033,27,17,203304,2033), -('2033-04-28',203317,4,2033,28,17,203304,2033), -('2033-04-29',203317,4,2033,29,17,203304,2033), -('2033-04-30',203317,4,2033,30,17,203304,2033), -('2033-05-01',203318,5,2033,1,18,203305,2033), -('2033-05-02',203318,5,2033,2,18,203305,2033), -('2033-05-03',203318,5,2033,3,18,203305,2033), -('2033-05-04',203318,5,2033,4,18,203305,2033), -('2033-05-05',203318,5,2033,5,18,203305,2033), -('2033-05-06',203318,5,2033,6,18,203305,2033), -('2033-05-07',203318,5,2033,7,18,203305,2033), -('2033-05-08',203319,5,2033,8,19,203305,2033), -('2033-05-09',203319,5,2033,9,19,203305,2033), -('2033-05-10',203319,5,2033,10,19,203305,2033), -('2033-05-11',203319,5,2033,11,19,203305,2033), -('2033-05-12',203319,5,2033,12,19,203305,2033), -('2033-05-13',203319,5,2033,13,19,203305,2033), -('2033-05-14',203319,5,2033,14,19,203305,2033), -('2033-05-15',203320,5,2033,15,20,203305,2033), -('2033-05-16',203320,5,2033,16,20,203305,2033), -('2033-05-17',203320,5,2033,17,20,203305,2033), -('2033-05-18',203320,5,2033,18,20,203305,2033), -('2033-05-19',203320,5,2033,19,20,203305,2033), -('2033-05-20',203320,5,2033,20,20,203305,2033), -('2033-05-21',203320,5,2033,21,20,203305,2033), -('2033-05-22',203321,5,2033,22,21,203305,2033), -('2033-05-23',203321,5,2033,23,21,203305,2033), -('2033-05-24',203321,5,2033,24,21,203305,2033), -('2033-05-25',203321,5,2033,25,21,203305,2033), -('2033-05-26',203321,5,2033,26,21,203305,2033), -('2033-05-27',203321,5,2033,27,21,203305,2033), -('2033-05-28',203321,5,2033,28,21,203305,2033), -('2033-05-29',203322,5,2033,29,22,203305,2033), -('2033-05-30',203322,5,2033,30,22,203305,2033), -('2033-05-31',203322,5,2033,31,22,203305,2033), -('2033-06-01',203322,6,2033,1,22,203306,2033), -('2033-06-02',203322,6,2033,2,22,203306,2033), -('2033-06-03',203322,6,2033,3,22,203306,2033), -('2033-06-04',203322,6,2033,4,22,203306,2033), -('2033-06-05',203323,6,2033,5,23,203306,2033), -('2033-06-06',203323,6,2033,6,23,203306,2033), -('2033-06-07',203323,6,2033,7,23,203306,2033), -('2033-06-08',203323,6,2033,8,23,203306,2033), -('2033-06-09',203323,6,2033,9,23,203306,2033), -('2033-06-10',203323,6,2033,10,23,203306,2033), -('2033-06-11',203323,6,2033,11,23,203306,2033), -('2033-06-12',203324,6,2033,12,24,203306,2033), -('2033-06-13',203324,6,2033,13,24,203306,2033), -('2033-06-14',203324,6,2033,14,24,203306,2033), -('2033-06-15',203324,6,2033,15,24,203306,2033), -('2033-06-16',203324,6,2033,16,24,203306,2033), -('2033-06-17',203324,6,2033,17,24,203306,2033), -('2033-06-18',203324,6,2033,18,24,203306,2033), -('2033-06-19',203325,6,2033,19,25,203306,2033), -('2033-06-20',203325,6,2033,20,25,203306,2033), -('2033-06-21',203325,6,2033,21,25,203306,2033), -('2033-06-22',203325,6,2033,22,25,203306,2033), -('2033-06-23',203325,6,2033,23,25,203306,2033), -('2033-06-24',203325,6,2033,24,25,203306,2033), -('2033-06-25',203325,6,2033,25,25,203306,2033), -('2033-06-26',203326,6,2033,26,26,203306,2033), -('2033-06-27',203326,6,2033,27,26,203306,2033), -('2033-06-28',203326,6,2033,28,26,203306,2033), -('2033-06-29',203326,6,2033,29,26,203306,2033), -('2033-06-30',203326,6,2033,30,26,203306,2033), -('2033-07-01',203326,7,2033,1,26,203307,2033), -('2033-07-02',203326,7,2033,2,26,203307,2033), -('2033-07-03',203327,7,2033,3,27,203307,2033), -('2033-07-04',203327,7,2033,4,27,203307,2033), -('2033-07-05',203327,7,2033,5,27,203307,2033), -('2033-07-06',203327,7,2033,6,27,203307,2033), -('2033-07-07',203327,7,2033,7,27,203307,2033), -('2033-07-08',203327,7,2033,8,27,203307,2033), -('2033-07-09',203327,7,2033,9,27,203307,2033), -('2033-07-10',203328,7,2033,10,28,203307,2033), -('2033-07-11',203328,7,2033,11,28,203307,2033), -('2033-07-12',203328,7,2033,12,28,203307,2033), -('2033-07-13',203328,7,2033,13,28,203307,2033), -('2033-07-14',203328,7,2033,14,28,203307,2033), -('2033-07-15',203328,7,2033,15,28,203307,2033), -('2033-07-16',203328,7,2033,16,28,203307,2033), -('2033-07-17',203329,7,2033,17,29,203307,2033), -('2033-07-18',203329,7,2033,18,29,203307,2033), -('2033-07-19',203329,7,2033,19,29,203307,2033), -('2033-07-20',203329,7,2033,20,29,203307,2033), -('2033-07-21',203329,7,2033,21,29,203307,2033), -('2033-07-22',203329,7,2033,22,29,203307,2033), -('2033-07-23',203329,7,2033,23,29,203307,2033), -('2033-07-24',203330,7,2033,24,30,203307,2033), -('2033-07-25',203330,7,2033,25,30,203307,2033), -('2033-07-26',203330,7,2033,26,30,203307,2033), -('2033-07-27',203330,7,2033,27,30,203307,2033), -('2033-07-28',203330,7,2033,28,30,203307,2033), -('2033-07-29',203330,7,2033,29,30,203307,2033), -('2033-07-30',203330,7,2033,30,30,203307,2033), -('2033-07-31',203331,7,2033,31,31,203307,2033), -('2033-08-01',203331,8,2033,1,31,203308,2033), -('2033-08-02',203331,8,2033,2,31,203308,2033), -('2033-08-03',203331,8,2033,3,31,203308,2033), -('2033-08-04',203331,8,2033,4,31,203308,2033), -('2033-08-05',203331,8,2033,5,31,203308,2033), -('2033-08-06',203331,8,2033,6,31,203308,2033), -('2033-08-07',203332,8,2033,7,32,203308,2033), -('2033-08-08',203332,8,2033,8,32,203308,2033), -('2033-08-09',203332,8,2033,9,32,203308,2033), -('2033-08-10',203332,8,2033,10,32,203308,2033), -('2033-08-11',203332,8,2033,11,32,203308,2033), -('2033-08-12',203332,8,2033,12,32,203308,2033), -('2033-08-13',203332,8,2033,13,32,203308,2033), -('2033-08-14',203333,8,2033,14,33,203308,2033), -('2033-08-15',203333,8,2033,15,33,203308,2033), -('2033-08-16',203333,8,2033,16,33,203308,2033), -('2033-08-17',203333,8,2033,17,33,203308,2033), -('2033-08-18',203333,8,2033,18,33,203308,2033), -('2033-08-19',203333,8,2033,19,33,203308,2033), -('2033-08-20',203333,8,2033,20,33,203308,2033), -('2033-08-21',203334,8,2033,21,34,203308,2033), -('2033-08-22',203334,8,2033,22,34,203308,2033), -('2033-08-23',203334,8,2033,23,34,203308,2033), -('2033-08-24',203334,8,2033,24,34,203308,2033), -('2033-08-25',203334,8,2033,25,34,203308,2033), -('2033-08-26',203334,8,2033,26,34,203308,2033), -('2033-08-27',203334,8,2033,27,34,203308,2033), -('2033-08-28',203335,8,2033,28,35,203308,2033), -('2033-08-29',203335,8,2033,29,35,203308,2033), -('2033-08-30',203335,8,2033,30,35,203308,2033), -('2033-08-31',203335,8,2033,31,35,203308,2033), -('2033-09-01',203335,9,2033,1,35,203309,2033), -('2033-09-02',203335,9,2033,2,35,203309,2033), -('2033-09-03',203335,9,2033,3,35,203309,2033), -('2033-09-04',203336,9,2033,4,36,203309,2033), -('2033-09-05',203336,9,2033,5,36,203309,2033), -('2033-09-06',203336,9,2033,6,36,203309,2033), -('2033-09-07',203336,9,2033,7,36,203309,2033), -('2033-09-08',203336,9,2033,8,36,203309,2033), -('2033-09-09',203336,9,2033,9,36,203309,2033), -('2033-09-10',203336,9,2033,10,36,203309,2033), -('2033-09-11',203337,9,2033,11,37,203309,2033), -('2033-09-12',203337,9,2033,12,37,203309,2033), -('2033-09-13',203337,9,2033,13,37,203309,2033), -('2033-09-14',203337,9,2033,14,37,203309,2033), -('2033-09-15',203337,9,2033,15,37,203309,2033), -('2033-09-16',203337,9,2033,16,37,203309,2033), -('2033-09-17',203337,9,2033,17,37,203309,2033), -('2033-09-18',203338,9,2033,18,38,203309,2033), -('2033-09-19',203338,9,2033,19,38,203309,2033), -('2033-09-20',203338,9,2033,20,38,203309,2033), -('2033-09-21',203338,9,2033,21,38,203309,2033), -('2033-09-22',203338,9,2033,22,38,203309,2033), -('2033-09-23',203338,9,2033,23,38,203309,2033), -('2033-09-24',203338,9,2033,24,38,203309,2033), -('2033-09-25',203339,9,2033,25,39,203309,2033), -('2033-09-26',203339,9,2033,26,39,203309,2033), -('2033-09-27',203339,9,2033,27,39,203309,2033), -('2033-09-28',203339,9,2033,28,39,203309,2033), -('2033-09-29',203339,9,2033,29,39,203309,2033), -('2033-09-30',203339,9,2033,30,39,203309,2033), -('2033-10-01',203339,10,2033,1,39,203310,2033), -('2033-10-02',203340,10,2033,2,40,203310,2033), -('2033-10-03',203340,10,2033,3,40,203310,2033), -('2033-10-04',203340,10,2033,4,40,203310,2033), -('2033-10-05',203340,10,2033,5,40,203310,2033), -('2033-10-06',203340,10,2033,6,40,203310,2033), -('2033-10-07',203340,10,2033,7,40,203310,2033), -('2033-10-08',203340,10,2033,8,40,203310,2033), -('2033-10-09',203341,10,2033,9,41,203310,2033), -('2033-10-10',203341,10,2033,10,41,203310,2033), -('2033-10-11',203341,10,2033,11,41,203310,2033), -('2033-10-12',203341,10,2033,12,41,203310,2033), -('2033-10-13',203341,10,2033,13,41,203310,2033), -('2033-10-14',203341,10,2033,14,41,203310,2033), -('2033-10-15',203341,10,2033,15,41,203310,2033), -('2033-10-16',203342,10,2033,16,42,203310,2033), -('2033-10-17',203342,10,2033,17,42,203310,2033), -('2033-10-18',203342,10,2033,18,42,203310,2033), -('2033-10-19',203342,10,2033,19,42,203310,2033), -('2033-10-20',203342,10,2033,20,42,203310,2033), -('2033-10-21',203342,10,2033,21,42,203310,2033), -('2033-10-22',203342,10,2033,22,42,203310,2033), -('2033-10-23',203343,10,2033,23,43,203310,2033), -('2033-10-24',203343,10,2033,24,43,203310,2033), -('2033-10-25',203343,10,2033,25,43,203310,2033), -('2033-10-26',203343,10,2033,26,43,203310,2033), -('2033-10-27',203343,10,2033,27,43,203310,2033), -('2033-10-28',203343,10,2033,28,43,203310,2033), -('2033-10-29',203343,10,2033,29,43,203310,2033), -('2033-10-30',203344,10,2033,30,44,203310,2033), -('2033-10-31',203344,10,2033,31,44,203310,2033), -('2033-11-01',203344,11,2033,1,44,203311,2033), -('2033-11-02',203344,11,2033,2,44,203311,2033), -('2033-11-03',203344,11,2033,3,44,203311,2033), -('2033-11-04',203344,11,2033,4,44,203311,2033), -('2033-11-05',203344,11,2033,5,44,203311,2033), -('2033-11-06',203345,11,2033,6,45,203311,2033), -('2033-11-07',203345,11,2033,7,45,203311,2033), -('2033-11-08',203345,11,2033,8,45,203311,2033), -('2033-11-09',203345,11,2033,9,45,203311,2033), -('2033-11-10',203345,11,2033,10,45,203311,2033), -('2033-11-11',203345,11,2033,11,45,203311,2033), -('2033-11-12',203345,11,2033,12,45,203311,2033), -('2033-11-13',203346,11,2033,13,46,203311,2033), -('2033-11-14',203346,11,2033,14,46,203311,2033), -('2033-11-15',203346,11,2033,15,46,203311,2033), -('2033-11-16',203346,11,2033,16,46,203311,2033), -('2033-11-17',203346,11,2033,17,46,203311,2033), -('2033-11-18',203346,11,2033,18,46,203311,2033), -('2033-11-19',203346,11,2033,19,46,203311,2033), -('2033-11-20',203347,11,2033,20,47,203311,2033), -('2033-11-21',203347,11,2033,21,47,203311,2033), -('2033-11-22',203347,11,2033,22,47,203311,2033), -('2033-11-23',203347,11,2033,23,47,203311,2033), -('2033-11-24',203347,11,2033,24,47,203311,2033), -('2033-11-25',203347,11,2033,25,47,203311,2033), -('2033-11-26',203347,11,2033,26,47,203311,2033), -('2033-11-27',203348,11,2033,27,48,203311,2033), -('2033-11-28',203348,11,2033,28,48,203311,2033), -('2033-11-29',203348,11,2033,29,48,203311,2033), -('2033-11-30',203348,11,2033,30,48,203311,2033), -('2033-12-01',203348,12,2033,1,48,203312,2034), -('2033-12-02',203348,12,2033,2,48,203312,2034), -('2033-12-03',203348,12,2033,3,48,203312,2034), -('2033-12-04',203349,12,2033,4,49,203312,2034), -('2033-12-05',203349,12,2033,5,49,203312,2034), -('2033-12-06',203349,12,2033,6,49,203312,2034), -('2033-12-07',203349,12,2033,7,49,203312,2034), -('2033-12-08',203349,12,2033,8,49,203312,2034), -('2033-12-09',203349,12,2033,9,49,203312,2034), -('2033-12-10',203349,12,2033,10,49,203312,2034), -('2033-12-11',203350,12,2033,11,50,203312,2034), -('2033-12-12',203350,12,2033,12,50,203312,2034), -('2033-12-13',203350,12,2033,13,50,203312,2034), -('2033-12-14',203350,12,2033,14,50,203312,2034), -('2033-12-15',203350,12,2033,15,50,203312,2034), -('2033-12-16',203350,12,2033,16,50,203312,2034), -('2033-12-17',203350,12,2033,17,50,203312,2034), -('2033-12-18',203351,12,2033,18,51,203312,2034), -('2033-12-19',203351,12,2033,19,51,203312,2034), -('2033-12-20',203351,12,2033,20,51,203312,2034), -('2033-12-21',203351,12,2033,21,51,203312,2034), -('2033-12-22',203351,12,2033,22,51,203312,2034), -('2033-12-23',203351,12,2033,23,51,203312,2034), -('2033-12-24',203351,12,2033,24,51,203312,2034), -('2033-12-25',203352,12,2033,25,52,203312,2034), -('2033-12-26',203352,12,2033,26,52,203312,2034), -('2033-12-27',203352,12,2033,27,52,203312,2034), -('2033-12-28',203352,12,2033,28,52,203312,2034), -('2033-12-29',203352,12,2033,29,52,203312,2034), -('2033-12-30',203352,12,2033,30,52,203312,2034), -('2033-12-31',203352,12,2033,31,52,203312,2034), -('2034-01-01',203453,1,2034,1,1,203401,2034), -('2034-01-02',203401,1,2034,2,1,203401,2034), -('2034-01-03',203401,1,2034,3,1,203401,2034), -('2034-01-04',203401,1,2034,4,1,203401,2034), -('2034-01-05',203401,1,2034,5,1,203401,2034), -('2034-01-06',203401,1,2034,6,1,203401,2034), -('2034-01-07',203401,1,2034,7,1,203401,2034), -('2034-01-08',203402,1,2034,8,2,203401,2034), -('2034-01-09',203402,1,2034,9,2,203401,2034), -('2034-01-10',203402,1,2034,10,2,203401,2034), -('2034-01-11',203402,1,2034,11,2,203401,2034), -('2034-01-12',203402,1,2034,12,2,203401,2034), -('2034-01-13',203402,1,2034,13,2,203401,2034), -('2034-01-14',203402,1,2034,14,2,203401,2034), -('2034-01-15',203403,1,2034,15,3,203401,2034), -('2034-01-16',203403,1,2034,16,3,203401,2034), -('2034-01-17',203403,1,2034,17,3,203401,2034), -('2034-01-18',203403,1,2034,18,3,203401,2034), -('2034-01-19',203403,1,2034,19,3,203401,2034), -('2034-01-20',203403,1,2034,20,3,203401,2034), -('2034-01-21',203403,1,2034,21,3,203401,2034), -('2034-01-22',203404,1,2034,22,4,203401,2034), -('2034-01-23',203404,1,2034,23,4,203401,2034), -('2034-01-24',203404,1,2034,24,4,203401,2034), -('2034-01-25',203404,1,2034,25,4,203401,2034), -('2034-01-26',203404,1,2034,26,4,203401,2034), -('2034-01-27',203404,1,2034,27,4,203401,2034), -('2034-01-28',203404,1,2034,28,4,203401,2034), -('2034-01-29',203405,1,2034,29,5,203401,2034), -('2034-01-30',203405,1,2034,30,5,203401,2034), -('2034-01-31',203405,1,2034,31,5,203401,2034), -('2034-02-01',203405,2,2034,1,5,203402,2034), -('2034-02-02',203405,2,2034,2,5,203402,2034), -('2034-02-03',203405,2,2034,3,5,203402,2034), -('2034-02-04',203405,2,2034,4,5,203402,2034), -('2034-02-05',203406,2,2034,5,6,203402,2034), -('2034-02-06',203406,2,2034,6,6,203402,2034), -('2034-02-07',203406,2,2034,7,6,203402,2034), -('2034-02-08',203406,2,2034,8,6,203402,2034), -('2034-02-09',203406,2,2034,9,6,203402,2034), -('2034-02-10',203406,2,2034,10,6,203402,2034), -('2034-02-11',203406,2,2034,11,6,203402,2034), -('2034-02-12',203407,2,2034,12,7,203402,2034), -('2034-02-13',203407,2,2034,13,7,203402,2034), -('2034-02-14',203407,2,2034,14,7,203402,2034), -('2034-02-15',203407,2,2034,15,7,203402,2034), -('2034-02-16',203407,2,2034,16,7,203402,2034), -('2034-02-17',203407,2,2034,17,7,203402,2034), -('2034-02-18',203407,2,2034,18,7,203402,2034), -('2034-02-19',203408,2,2034,19,8,203402,2034), -('2034-02-20',203408,2,2034,20,8,203402,2034), -('2034-02-21',203408,2,2034,21,8,203402,2034), -('2034-02-22',203408,2,2034,22,8,203402,2034), -('2034-02-23',203408,2,2034,23,8,203402,2034), -('2034-02-24',203408,2,2034,24,8,203402,2034), -('2034-02-25',203408,2,2034,25,8,203402,2034), -('2034-02-26',203409,2,2034,26,9,203402,2034), -('2034-02-27',203409,2,2034,27,9,203402,2034), -('2034-02-28',203409,2,2034,28,9,203402,2034), -('2034-03-01',203409,3,2034,1,9,203403,2034), -('2034-03-02',203409,3,2034,2,9,203403,2034), -('2034-03-03',203409,3,2034,3,9,203403,2034), -('2034-03-04',203409,3,2034,4,9,203403,2034), -('2034-03-05',203410,3,2034,5,10,203403,2034), -('2034-03-06',203410,3,2034,6,10,203403,2034), -('2034-03-07',203410,3,2034,7,10,203403,2034), -('2034-03-08',203410,3,2034,8,10,203403,2034), -('2034-03-09',203410,3,2034,9,10,203403,2034), -('2034-03-10',203410,3,2034,10,10,203403,2034), -('2034-03-11',203410,3,2034,11,10,203403,2034), -('2034-03-12',203411,3,2034,12,11,203403,2034), -('2034-03-13',203411,3,2034,13,11,203403,2034), -('2034-03-14',203411,3,2034,14,11,203403,2034), -('2034-03-15',203411,3,2034,15,11,203403,2034), -('2034-03-16',203411,3,2034,16,11,203403,2034), -('2034-03-17',203411,3,2034,17,11,203403,2034), -('2034-03-18',203411,3,2034,18,11,203403,2034), -('2034-03-19',203412,3,2034,19,12,203403,2034), -('2034-03-20',203412,3,2034,20,12,203403,2034), -('2034-03-21',203412,3,2034,21,12,203403,2034), -('2034-03-22',203412,3,2034,22,12,203403,2034), -('2034-03-23',203412,3,2034,23,12,203403,2034), -('2034-03-24',203412,3,2034,24,12,203403,2034), -('2034-03-25',203412,3,2034,25,12,203403,2034), -('2034-03-26',203413,3,2034,26,13,203403,2034), -('2034-03-27',203413,3,2034,27,13,203403,2034), -('2034-03-28',203413,3,2034,28,13,203403,2034), -('2034-03-29',203413,3,2034,29,13,203403,2034), -('2034-03-30',203413,3,2034,30,13,203403,2034), -('2034-03-31',203413,3,2034,31,13,203403,2034), -('2034-04-01',203413,4,2034,1,13,203404,2034), -('2034-04-02',203414,4,2034,2,14,203404,2034), -('2034-04-03',203414,4,2034,3,14,203404,2034), -('2034-04-04',203414,4,2034,4,14,203404,2034), -('2034-04-05',203414,4,2034,5,14,203404,2034), -('2034-04-06',203414,4,2034,6,14,203404,2034), -('2034-04-07',203414,4,2034,7,14,203404,2034), -('2034-04-08',203414,4,2034,8,14,203404,2034), -('2034-04-09',203415,4,2034,9,15,203404,2034), -('2034-04-10',203415,4,2034,10,15,203404,2034), -('2034-04-11',203415,4,2034,11,15,203404,2034), -('2034-04-12',203415,4,2034,12,15,203404,2034), -('2034-04-13',203415,4,2034,13,15,203404,2034), -('2034-04-14',203415,4,2034,14,15,203404,2034), -('2034-04-15',203415,4,2034,15,15,203404,2034), -('2034-04-16',203416,4,2034,16,16,203404,2034), -('2034-04-17',203416,4,2034,17,16,203404,2034), -('2034-04-18',203416,4,2034,18,16,203404,2034), -('2034-04-19',203416,4,2034,19,16,203404,2034), -('2034-04-20',203416,4,2034,20,16,203404,2034), -('2034-04-21',203416,4,2034,21,16,203404,2034), -('2034-04-22',203416,4,2034,22,16,203404,2034), -('2034-04-23',203417,4,2034,23,17,203404,2034), -('2034-04-24',203417,4,2034,24,17,203404,2034), -('2034-04-25',203417,4,2034,25,17,203404,2034), -('2034-04-26',203417,4,2034,26,17,203404,2034), -('2034-04-27',203417,4,2034,27,17,203404,2034), -('2034-04-28',203417,4,2034,28,17,203404,2034), -('2034-04-29',203417,4,2034,29,17,203404,2034), -('2034-04-30',203418,4,2034,30,18,203404,2034), -('2034-05-01',203418,5,2034,1,18,203405,2034), -('2034-05-02',203418,5,2034,2,18,203405,2034), -('2034-05-03',203418,5,2034,3,18,203405,2034), -('2034-05-04',203418,5,2034,4,18,203405,2034), -('2034-05-05',203418,5,2034,5,18,203405,2034), -('2034-05-06',203418,5,2034,6,18,203405,2034), -('2034-05-07',203419,5,2034,7,19,203405,2034), -('2034-05-08',203419,5,2034,8,19,203405,2034), -('2034-05-09',203419,5,2034,9,19,203405,2034), -('2034-05-10',203419,5,2034,10,19,203405,2034), -('2034-05-11',203419,5,2034,11,19,203405,2034), -('2034-05-12',203419,5,2034,12,19,203405,2034), -('2034-05-13',203419,5,2034,13,19,203405,2034), -('2034-05-14',203420,5,2034,14,20,203405,2034), -('2034-05-15',203420,5,2034,15,20,203405,2034), -('2034-05-16',203420,5,2034,16,20,203405,2034), -('2034-05-17',203420,5,2034,17,20,203405,2034), -('2034-05-18',203420,5,2034,18,20,203405,2034), -('2034-05-19',203420,5,2034,19,20,203405,2034), -('2034-05-20',203420,5,2034,20,20,203405,2034), -('2034-05-21',203421,5,2034,21,21,203405,2034), -('2034-05-22',203421,5,2034,22,21,203405,2034), -('2034-05-23',203421,5,2034,23,21,203405,2034), -('2034-05-24',203421,5,2034,24,21,203405,2034), -('2034-05-25',203421,5,2034,25,21,203405,2034), -('2034-05-26',203421,5,2034,26,21,203405,2034), -('2034-05-27',203421,5,2034,27,21,203405,2034), -('2034-05-28',203422,5,2034,28,22,203405,2034), -('2034-05-29',203422,5,2034,29,22,203405,2034), -('2034-05-30',203422,5,2034,30,22,203405,2034), -('2034-05-31',203422,5,2034,31,22,203405,2034), -('2034-06-01',203422,6,2034,1,22,203406,2034), -('2034-06-02',203422,6,2034,2,22,203406,2034), -('2034-06-03',203422,6,2034,3,22,203406,2034), -('2034-06-04',203423,6,2034,4,23,203406,2034), -('2034-06-05',203423,6,2034,5,23,203406,2034), -('2034-06-06',203423,6,2034,6,23,203406,2034), -('2034-06-07',203423,6,2034,7,23,203406,2034), -('2034-06-08',203423,6,2034,8,23,203406,2034), -('2034-06-09',203423,6,2034,9,23,203406,2034), -('2034-06-10',203423,6,2034,10,23,203406,2034), -('2034-06-11',203424,6,2034,11,24,203406,2034), -('2034-06-12',203424,6,2034,12,24,203406,2034), -('2034-06-13',203424,6,2034,13,24,203406,2034), -('2034-06-14',203424,6,2034,14,24,203406,2034), -('2034-06-15',203424,6,2034,15,24,203406,2034), -('2034-06-16',203424,6,2034,16,24,203406,2034), -('2034-06-17',203424,6,2034,17,24,203406,2034), -('2034-06-18',203425,6,2034,18,25,203406,2034), -('2034-06-19',203425,6,2034,19,25,203406,2034), -('2034-06-20',203425,6,2034,20,25,203406,2034), -('2034-06-21',203425,6,2034,21,25,203406,2034), -('2034-06-22',203425,6,2034,22,25,203406,2034), -('2034-06-23',203425,6,2034,23,25,203406,2034), -('2034-06-24',203425,6,2034,24,25,203406,2034), -('2034-06-25',203426,6,2034,25,26,203406,2034), -('2034-06-26',203426,6,2034,26,26,203406,2034), -('2034-06-27',203426,6,2034,27,26,203406,2034), -('2034-06-28',203426,6,2034,28,26,203406,2034), -('2034-06-29',203426,6,2034,29,26,203406,2034), -('2034-06-30',203426,6,2034,30,26,203406,2034), -('2034-07-01',203426,7,2034,1,26,203407,2034), -('2034-07-02',203427,7,2034,2,27,203407,2034), -('2034-07-03',203427,7,2034,3,27,203407,2034), -('2034-07-04',203427,7,2034,4,27,203407,2034), -('2034-07-05',203427,7,2034,5,27,203407,2034), -('2034-07-06',203427,7,2034,6,27,203407,2034), -('2034-07-07',203427,7,2034,7,27,203407,2034), -('2034-07-08',203427,7,2034,8,27,203407,2034), -('2034-07-09',203428,7,2034,9,28,203407,2034), -('2034-07-10',203428,7,2034,10,28,203407,2034), -('2034-07-11',203428,7,2034,11,28,203407,2034), -('2034-07-12',203428,7,2034,12,28,203407,2034), -('2034-07-13',203428,7,2034,13,28,203407,2034), -('2034-07-14',203428,7,2034,14,28,203407,2034), -('2034-07-15',203428,7,2034,15,28,203407,2034), -('2034-07-16',203429,7,2034,16,29,203407,2034), -('2034-07-17',203429,7,2034,17,29,203407,2034), -('2034-07-18',203429,7,2034,18,29,203407,2034), -('2034-07-19',203429,7,2034,19,29,203407,2034), -('2034-07-20',203429,7,2034,20,29,203407,2034), -('2034-07-21',203429,7,2034,21,29,203407,2034), -('2034-07-22',203429,7,2034,22,29,203407,2034), -('2034-07-23',203430,7,2034,23,30,203407,2034), -('2034-07-24',203430,7,2034,24,30,203407,2034), -('2034-07-25',203430,7,2034,25,30,203407,2034), -('2034-07-26',203430,7,2034,26,30,203407,2034), -('2034-07-27',203430,7,2034,27,30,203407,2034), -('2034-07-28',203430,7,2034,28,30,203407,2034), -('2034-07-29',203430,7,2034,29,30,203407,2034), -('2034-07-30',203431,7,2034,30,31,203407,2034), -('2034-07-31',203431,7,2034,31,31,203407,2034), -('2034-08-01',203431,8,2034,1,31,203408,2034), -('2034-08-02',203431,8,2034,2,31,203408,2034), -('2034-08-03',203431,8,2034,3,31,203408,2034), -('2034-08-04',203431,8,2034,4,31,203408,2034), -('2034-08-05',203431,8,2034,5,31,203408,2034), -('2034-08-06',203432,8,2034,6,32,203408,2034), -('2034-08-07',203432,8,2034,7,32,203408,2034), -('2034-08-08',203432,8,2034,8,32,203408,2034), -('2034-08-09',203432,8,2034,9,32,203408,2034), -('2034-08-10',203432,8,2034,10,32,203408,2034), -('2034-08-11',203432,8,2034,11,32,203408,2034), -('2034-08-12',203432,8,2034,12,32,203408,2034), -('2034-08-13',203433,8,2034,13,33,203408,2034), -('2034-08-14',203433,8,2034,14,33,203408,2034), -('2034-08-15',203433,8,2034,15,33,203408,2034), -('2034-08-16',203433,8,2034,16,33,203408,2034), -('2034-08-17',203433,8,2034,17,33,203408,2034), -('2034-08-18',203433,8,2034,18,33,203408,2034), -('2034-08-19',203433,8,2034,19,33,203408,2034), -('2034-08-20',203434,8,2034,20,34,203408,2034), -('2034-08-21',203434,8,2034,21,34,203408,2034), -('2034-08-22',203434,8,2034,22,34,203408,2034), -('2034-08-23',203434,8,2034,23,34,203408,2034), -('2034-08-24',203434,8,2034,24,34,203408,2034), -('2034-08-25',203434,8,2034,25,34,203408,2034), -('2034-08-26',203434,8,2034,26,34,203408,2034), -('2034-08-27',203435,8,2034,27,35,203408,2034), -('2034-08-28',203435,8,2034,28,35,203408,2034), -('2034-08-29',203435,8,2034,29,35,203408,2034), -('2034-08-30',203435,8,2034,30,35,203408,2034), -('2034-08-31',203435,8,2034,31,35,203408,2034), -('2034-09-01',203435,9,2034,1,35,203409,2034), -('2034-09-02',203435,9,2034,2,35,203409,2034), -('2034-09-03',203436,9,2034,3,36,203409,2034), -('2034-09-04',203436,9,2034,4,36,203409,2034), -('2034-09-05',203436,9,2034,5,36,203409,2034), -('2034-09-06',203436,9,2034,6,36,203409,2034), -('2034-09-07',203436,9,2034,7,36,203409,2034), -('2034-09-08',203436,9,2034,8,36,203409,2034), -('2034-09-09',203436,9,2034,9,36,203409,2034), -('2034-09-10',203437,9,2034,10,37,203409,2034), -('2034-09-11',203437,9,2034,11,37,203409,2034), -('2034-09-12',203437,9,2034,12,37,203409,2034), -('2034-09-13',203437,9,2034,13,37,203409,2034), -('2034-09-14',203437,9,2034,14,37,203409,2034), -('2034-09-15',203437,9,2034,15,37,203409,2034), -('2034-09-16',203437,9,2034,16,37,203409,2034), -('2034-09-17',203438,9,2034,17,38,203409,2034), -('2034-09-18',203438,9,2034,18,38,203409,2034), -('2034-09-19',203438,9,2034,19,38,203409,2034), -('2034-09-20',203438,9,2034,20,38,203409,2034), -('2034-09-21',203438,9,2034,21,38,203409,2034), -('2034-09-22',203438,9,2034,22,38,203409,2034), -('2034-09-23',203438,9,2034,23,38,203409,2034), -('2034-09-24',203439,9,2034,24,39,203409,2034), -('2034-09-25',203439,9,2034,25,39,203409,2034), -('2034-09-26',203439,9,2034,26,39,203409,2034), -('2034-09-27',203439,9,2034,27,39,203409,2034), -('2034-09-28',203439,9,2034,28,39,203409,2034), -('2034-09-29',203439,9,2034,29,39,203409,2034), -('2034-09-30',203439,9,2034,30,39,203409,2034), -('2034-10-01',203440,10,2034,1,40,203410,2034), -('2034-10-02',203440,10,2034,2,40,203410,2034), -('2034-10-03',203440,10,2034,3,40,203410,2034), -('2034-10-04',203440,10,2034,4,40,203410,2034), -('2034-10-05',203440,10,2034,5,40,203410,2034), -('2034-10-06',203440,10,2034,6,40,203410,2034), -('2034-10-07',203440,10,2034,7,40,203410,2034), -('2034-10-08',203441,10,2034,8,41,203410,2034), -('2034-10-09',203441,10,2034,9,41,203410,2034), -('2034-10-10',203441,10,2034,10,41,203410,2034), -('2034-10-11',203441,10,2034,11,41,203410,2034), -('2034-10-12',203441,10,2034,12,41,203410,2034), -('2034-10-13',203441,10,2034,13,41,203410,2034), -('2034-10-14',203441,10,2034,14,41,203410,2034), -('2034-10-15',203442,10,2034,15,42,203410,2034), -('2034-10-16',203442,10,2034,16,42,203410,2034), -('2034-10-17',203442,10,2034,17,42,203410,2034), -('2034-10-18',203442,10,2034,18,42,203410,2034), -('2034-10-19',203442,10,2034,19,42,203410,2034), -('2034-10-20',203442,10,2034,20,42,203410,2034), -('2034-10-21',203442,10,2034,21,42,203410,2034), -('2034-10-22',203443,10,2034,22,43,203410,2034), -('2034-10-23',203443,10,2034,23,43,203410,2034), -('2034-10-24',203443,10,2034,24,43,203410,2034), -('2034-10-25',203443,10,2034,25,43,203410,2034), -('2034-10-26',203443,10,2034,26,43,203410,2034), -('2034-10-27',203443,10,2034,27,43,203410,2034), -('2034-10-28',203443,10,2034,28,43,203410,2034), -('2034-10-29',203444,10,2034,29,44,203410,2034), -('2034-10-30',203444,10,2034,30,44,203410,2034), -('2034-10-31',203444,10,2034,31,44,203410,2034), -('2034-11-01',203444,11,2034,1,44,203411,2034), -('2034-11-02',203444,11,2034,2,44,203411,2034), -('2034-11-03',203444,11,2034,3,44,203411,2034), -('2034-11-04',203444,11,2034,4,44,203411,2034), -('2034-11-05',203445,11,2034,5,45,203411,2034), -('2034-11-06',203445,11,2034,6,45,203411,2034), -('2034-11-07',203445,11,2034,7,45,203411,2034), -('2034-11-08',203445,11,2034,8,45,203411,2034), -('2034-11-09',203445,11,2034,9,45,203411,2034), -('2034-11-10',203445,11,2034,10,45,203411,2034), -('2034-11-11',203445,11,2034,11,45,203411,2034), -('2034-11-12',203446,11,2034,12,46,203411,2034), -('2034-11-13',203446,11,2034,13,46,203411,2034), -('2034-11-14',203446,11,2034,14,46,203411,2034), -('2034-11-15',203446,11,2034,15,46,203411,2034), -('2034-11-16',203446,11,2034,16,46,203411,2034), -('2034-11-17',203446,11,2034,17,46,203411,2034), -('2034-11-18',203446,11,2034,18,46,203411,2034), -('2034-11-19',203447,11,2034,19,47,203411,2034), -('2034-11-20',203447,11,2034,20,47,203411,2034), -('2034-11-21',203447,11,2034,21,47,203411,2034), -('2034-11-22',203447,11,2034,22,47,203411,2034), -('2034-11-23',203447,11,2034,23,47,203411,2034), -('2034-11-24',203447,11,2034,24,47,203411,2034), -('2034-11-25',203447,11,2034,25,47,203411,2034), -('2034-11-26',203448,11,2034,26,48,203411,2034), -('2034-11-27',203448,11,2034,27,48,203411,2034), -('2034-11-28',203448,11,2034,28,48,203411,2034), -('2034-11-29',203448,11,2034,29,48,203411,2034), -('2034-11-30',203448,11,2034,30,48,203411,2034), -('2034-12-01',203448,12,2034,1,48,203412,2035), -('2034-12-02',203448,12,2034,2,48,203412,2035), -('2034-12-03',203449,12,2034,3,49,203412,2035), -('2034-12-04',203449,12,2034,4,49,203412,2035), -('2034-12-05',203449,12,2034,5,49,203412,2035), -('2034-12-06',203449,12,2034,6,49,203412,2035), -('2034-12-07',203449,12,2034,7,49,203412,2035), -('2034-12-08',203449,12,2034,8,49,203412,2035), -('2034-12-09',203449,12,2034,9,49,203412,2035), -('2034-12-10',203450,12,2034,10,50,203412,2035), -('2034-12-11',203450,12,2034,11,50,203412,2035), -('2034-12-12',203450,12,2034,12,50,203412,2035), -('2034-12-13',203450,12,2034,13,50,203412,2035), -('2034-12-14',203450,12,2034,14,50,203412,2035), -('2034-12-15',203450,12,2034,15,50,203412,2035), -('2034-12-16',203450,12,2034,16,50,203412,2035), -('2034-12-17',203451,12,2034,17,51,203412,2035), -('2034-12-18',203451,12,2034,18,51,203412,2035), -('2034-12-19',203451,12,2034,19,51,203412,2035), -('2034-12-20',203451,12,2034,20,51,203412,2035), -('2034-12-21',203451,12,2034,21,51,203412,2035), -('2034-12-22',203451,12,2034,22,51,203412,2035), -('2034-12-23',203451,12,2034,23,51,203412,2035), -('2034-12-24',203452,12,2034,24,52,203412,2035), -('2034-12-25',203452,12,2034,25,52,203412,2035), -('2034-12-26',203452,12,2034,26,52,203412,2035), -('2034-12-27',203452,12,2034,27,52,203412,2035), -('2034-12-28',203452,12,2034,28,52,203412,2035), -('2034-12-29',203452,12,2034,29,52,203412,2035), -('2034-12-30',203452,12,2034,30,52,203412,2035), -('2034-12-31',203453,12,2034,31,1,203412,2035), -('2035-01-01',203501,1,2035,1,1,203501,2035), -('2035-01-02',203501,1,2035,2,1,203501,2035), -('2035-01-03',203501,1,2035,3,1,203501,2035), -('2035-01-04',203501,1,2035,4,1,203501,2035), -('2035-01-05',203501,1,2035,5,1,203501,2035), -('2035-01-06',203501,1,2035,6,1,203501,2035), -('2035-01-07',203502,1,2035,7,2,203501,2035), -('2035-01-08',203502,1,2035,8,2,203501,2035), -('2035-01-09',203502,1,2035,9,2,203501,2035), -('2035-01-10',203502,1,2035,10,2,203501,2035), -('2035-01-11',203502,1,2035,11,2,203501,2035), -('2035-01-12',203502,1,2035,12,2,203501,2035), -('2035-01-13',203502,1,2035,13,2,203501,2035), -('2035-01-14',203503,1,2035,14,3,203501,2035), -('2035-01-15',203503,1,2035,15,3,203501,2035), -('2035-01-16',203503,1,2035,16,3,203501,2035), -('2035-01-17',203503,1,2035,17,3,203501,2035), -('2035-01-18',203503,1,2035,18,3,203501,2035), -('2035-01-19',203503,1,2035,19,3,203501,2035), -('2035-01-20',203503,1,2035,20,3,203501,2035), -('2035-01-21',203504,1,2035,21,4,203501,2035), -('2035-01-22',203504,1,2035,22,4,203501,2035), -('2035-01-23',203504,1,2035,23,4,203501,2035), -('2035-01-24',203504,1,2035,24,4,203501,2035), -('2035-01-25',203504,1,2035,25,4,203501,2035), -('2035-01-26',203504,1,2035,26,4,203501,2035), -('2035-01-27',203504,1,2035,27,4,203501,2035), -('2035-01-28',203505,1,2035,28,5,203501,2035), -('2035-01-29',203505,1,2035,29,5,203501,2035), -('2035-01-30',203505,1,2035,30,5,203501,2035), -('2035-01-31',203505,1,2035,31,5,203501,2035), -('2035-02-01',203505,2,2035,1,5,203502,2035), -('2035-02-02',203505,2,2035,2,5,203502,2035), -('2035-02-03',203505,2,2035,3,5,203502,2035), -('2035-02-04',203506,2,2035,4,6,203502,2035), -('2035-02-05',203506,2,2035,5,6,203502,2035), -('2035-02-06',203506,2,2035,6,6,203502,2035), -('2035-02-07',203506,2,2035,7,6,203502,2035), -('2035-02-08',203506,2,2035,8,6,203502,2035), -('2035-02-09',203506,2,2035,9,6,203502,2035), -('2035-02-10',203506,2,2035,10,6,203502,2035), -('2035-02-11',203507,2,2035,11,7,203502,2035), -('2035-02-12',203507,2,2035,12,7,203502,2035), -('2035-02-13',203507,2,2035,13,7,203502,2035), -('2035-02-14',203507,2,2035,14,7,203502,2035), -('2035-02-15',203507,2,2035,15,7,203502,2035), -('2035-02-16',203507,2,2035,16,7,203502,2035), -('2035-02-17',203507,2,2035,17,7,203502,2035), -('2035-02-18',203508,2,2035,18,8,203502,2035), -('2035-02-19',203508,2,2035,19,8,203502,2035), -('2035-02-20',203508,2,2035,20,8,203502,2035), -('2035-02-21',203508,2,2035,21,8,203502,2035), -('2035-02-22',203508,2,2035,22,8,203502,2035), -('2035-02-23',203508,2,2035,23,8,203502,2035), -('2035-02-24',203508,2,2035,24,8,203502,2035), -('2035-02-25',203509,2,2035,25,9,203502,2035), -('2035-02-26',203509,2,2035,26,9,203502,2035), -('2035-02-27',203509,2,2035,27,9,203502,2035), -('2035-02-28',203509,2,2035,28,9,203502,2035), -('2035-03-01',203509,3,2035,1,9,203503,2035), -('2035-03-02',203509,3,2035,2,9,203503,2035), -('2035-03-03',203509,3,2035,3,9,203503,2035), -('2035-03-04',203510,3,2035,4,10,203503,2035), -('2035-03-05',203510,3,2035,5,10,203503,2035), -('2035-03-06',203510,3,2035,6,10,203503,2035), -('2035-03-07',203510,3,2035,7,10,203503,2035), -('2035-03-08',203510,3,2035,8,10,203503,2035), -('2035-03-09',203510,3,2035,9,10,203503,2035), -('2035-03-10',203510,3,2035,10,10,203503,2035), -('2035-03-11',203511,3,2035,11,11,203503,2035), -('2035-03-12',203511,3,2035,12,11,203503,2035), -('2035-03-13',203511,3,2035,13,11,203503,2035), -('2035-03-14',203511,3,2035,14,11,203503,2035), -('2035-03-15',203511,3,2035,15,11,203503,2035), -('2035-03-16',203511,3,2035,16,11,203503,2035), -('2035-03-17',203511,3,2035,17,11,203503,2035), -('2035-03-18',203512,3,2035,18,12,203503,2035), -('2035-03-19',203512,3,2035,19,12,203503,2035), -('2035-03-20',203512,3,2035,20,12,203503,2035), -('2035-03-21',203512,3,2035,21,12,203503,2035), -('2035-03-22',203512,3,2035,22,12,203503,2035), -('2035-03-23',203512,3,2035,23,12,203503,2035), -('2035-03-24',203512,3,2035,24,12,203503,2035), -('2035-03-25',203513,3,2035,25,13,203503,2035), -('2035-03-26',203513,3,2035,26,13,203503,2035), -('2035-03-27',203513,3,2035,27,13,203503,2035), -('2035-03-28',203513,3,2035,28,13,203503,2035), -('2035-03-29',203513,3,2035,29,13,203503,2035), -('2035-03-30',203513,3,2035,30,13,203503,2035), -('2035-03-31',203513,3,2035,31,13,203503,2035), -('2035-04-01',203514,4,2035,1,14,203504,2035), -('2035-04-02',203514,4,2035,2,14,203504,2035), -('2035-04-03',203514,4,2035,3,14,203504,2035), -('2035-04-04',203514,4,2035,4,14,203504,2035), -('2035-04-05',203514,4,2035,5,14,203504,2035), -('2035-04-06',203514,4,2035,6,14,203504,2035), -('2035-04-07',203514,4,2035,7,14,203504,2035), -('2035-04-08',203515,4,2035,8,15,203504,2035), -('2035-04-09',203515,4,2035,9,15,203504,2035), -('2035-04-10',203515,4,2035,10,15,203504,2035), -('2035-04-11',203515,4,2035,11,15,203504,2035), -('2035-04-12',203515,4,2035,12,15,203504,2035), -('2035-04-13',203515,4,2035,13,15,203504,2035), -('2035-04-14',203515,4,2035,14,15,203504,2035), -('2035-04-15',203516,4,2035,15,16,203504,2035), -('2035-04-16',203516,4,2035,16,16,203504,2035), -('2035-04-17',203516,4,2035,17,16,203504,2035), -('2035-04-18',203516,4,2035,18,16,203504,2035), -('2035-04-19',203516,4,2035,19,16,203504,2035), -('2035-04-20',203516,4,2035,20,16,203504,2035), -('2035-04-21',203516,4,2035,21,16,203504,2035), -('2035-04-22',203517,4,2035,22,17,203504,2035), -('2035-04-23',203517,4,2035,23,17,203504,2035), -('2035-04-24',203517,4,2035,24,17,203504,2035), -('2035-04-25',203517,4,2035,25,17,203504,2035), -('2035-04-26',203517,4,2035,26,17,203504,2035), -('2035-04-27',203517,4,2035,27,17,203504,2035), -('2035-04-28',203517,4,2035,28,17,203504,2035), -('2035-04-29',203518,4,2035,29,18,203504,2035), -('2035-04-30',203518,4,2035,30,18,203504,2035), -('2035-05-01',203518,5,2035,1,18,203505,2035), -('2035-05-02',203518,5,2035,2,18,203505,2035), -('2035-05-03',203518,5,2035,3,18,203505,2035), -('2035-05-04',203518,5,2035,4,18,203505,2035), -('2035-05-05',203518,5,2035,5,18,203505,2035), -('2035-05-06',203519,5,2035,6,19,203505,2035), -('2035-05-07',203519,5,2035,7,19,203505,2035), -('2035-05-08',203519,5,2035,8,19,203505,2035), -('2035-05-09',203519,5,2035,9,19,203505,2035), -('2035-05-10',203519,5,2035,10,19,203505,2035), -('2035-05-11',203519,5,2035,11,19,203505,2035), -('2035-05-12',203519,5,2035,12,19,203505,2035), -('2035-05-13',203520,5,2035,13,20,203505,2035), -('2035-05-14',203520,5,2035,14,20,203505,2035), -('2035-05-15',203520,5,2035,15,20,203505,2035), -('2035-05-16',203520,5,2035,16,20,203505,2035), -('2035-05-17',203520,5,2035,17,20,203505,2035), -('2035-05-18',203520,5,2035,18,20,203505,2035), -('2035-05-19',203520,5,2035,19,20,203505,2035), -('2035-05-20',203521,5,2035,20,21,203505,2035), -('2035-05-21',203521,5,2035,21,21,203505,2035), -('2035-05-22',203521,5,2035,22,21,203505,2035), -('2035-05-23',203521,5,2035,23,21,203505,2035), -('2035-05-24',203521,5,2035,24,21,203505,2035), -('2035-05-25',203521,5,2035,25,21,203505,2035), -('2035-05-26',203521,5,2035,26,21,203505,2035), -('2035-05-27',203522,5,2035,27,22,203505,2035), -('2035-05-28',203522,5,2035,28,22,203505,2035), -('2035-05-29',203522,5,2035,29,22,203505,2035), -('2035-05-30',203522,5,2035,30,22,203505,2035), -('2035-05-31',203522,5,2035,31,22,203505,2035), -('2035-06-01',203522,6,2035,1,22,203506,2035), -('2035-06-02',203522,6,2035,2,22,203506,2035), -('2035-06-03',203523,6,2035,3,23,203506,2035), -('2035-06-04',203523,6,2035,4,23,203506,2035), -('2035-06-05',203523,6,2035,5,23,203506,2035), -('2035-06-06',203523,6,2035,6,23,203506,2035), -('2035-06-07',203523,6,2035,7,23,203506,2035), -('2035-06-08',203523,6,2035,8,23,203506,2035), -('2035-06-09',203523,6,2035,9,23,203506,2035), -('2035-06-10',203524,6,2035,10,24,203506,2035), -('2035-06-11',203524,6,2035,11,24,203506,2035), -('2035-06-12',203524,6,2035,12,24,203506,2035), -('2035-06-13',203524,6,2035,13,24,203506,2035), -('2035-06-14',203524,6,2035,14,24,203506,2035), -('2035-06-15',203524,6,2035,15,24,203506,2035), -('2035-06-16',203524,6,2035,16,24,203506,2035), -('2035-06-17',203525,6,2035,17,25,203506,2035), -('2035-06-18',203525,6,2035,18,25,203506,2035), -('2035-06-19',203525,6,2035,19,25,203506,2035), -('2035-06-20',203525,6,2035,20,25,203506,2035), -('2035-06-21',203525,6,2035,21,25,203506,2035), -('2035-06-22',203525,6,2035,22,25,203506,2035), -('2035-06-23',203525,6,2035,23,25,203506,2035), -('2035-06-24',203526,6,2035,24,26,203506,2035), -('2035-06-25',203526,6,2035,25,26,203506,2035), -('2035-06-26',203526,6,2035,26,26,203506,2035), -('2035-06-27',203526,6,2035,27,26,203506,2035), -('2035-06-28',203526,6,2035,28,26,203506,2035), -('2035-06-29',203526,6,2035,29,26,203506,2035), -('2035-06-30',203526,6,2035,30,26,203506,2035), -('2035-07-01',203527,7,2035,1,27,203507,2035), -('2035-07-02',203527,7,2035,2,27,203507,2035), -('2035-07-03',203527,7,2035,3,27,203507,2035), -('2035-07-04',203527,7,2035,4,27,203507,2035), -('2035-07-05',203527,7,2035,5,27,203507,2035), -('2035-07-06',203527,7,2035,6,27,203507,2035), -('2035-07-07',203527,7,2035,7,27,203507,2035), -('2035-07-08',203528,7,2035,8,28,203507,2035), -('2035-07-09',203528,7,2035,9,28,203507,2035), -('2035-07-10',203528,7,2035,10,28,203507,2035), -('2035-07-11',203528,7,2035,11,28,203507,2035), -('2035-07-12',203528,7,2035,12,28,203507,2035), -('2035-07-13',203528,7,2035,13,28,203507,2035), -('2035-07-14',203528,7,2035,14,28,203507,2035), -('2035-07-15',203529,7,2035,15,29,203507,2035), -('2035-07-16',203529,7,2035,16,29,203507,2035), -('2035-07-17',203529,7,2035,17,29,203507,2035), -('2035-07-18',203529,7,2035,18,29,203507,2035), -('2035-07-19',203529,7,2035,19,29,203507,2035), -('2035-07-20',203529,7,2035,20,29,203507,2035), -('2035-07-21',203529,7,2035,21,29,203507,2035), -('2035-07-22',203530,7,2035,22,30,203507,2035), -('2035-07-23',203530,7,2035,23,30,203507,2035), -('2035-07-24',203530,7,2035,24,30,203507,2035), -('2035-07-25',203530,7,2035,25,30,203507,2035), -('2035-07-26',203530,7,2035,26,30,203507,2035), -('2035-07-27',203530,7,2035,27,30,203507,2035), -('2035-07-28',203530,7,2035,28,30,203507,2035), -('2035-07-29',203531,7,2035,29,31,203507,2035), -('2035-07-30',203531,7,2035,30,31,203507,2035), -('2035-07-31',203531,7,2035,31,31,203507,2035), -('2035-08-01',203531,8,2035,1,31,203508,2035), -('2035-08-02',203531,8,2035,2,31,203508,2035), -('2035-08-03',203531,8,2035,3,31,203508,2035), -('2035-08-04',203531,8,2035,4,31,203508,2035), -('2035-08-05',203532,8,2035,5,32,203508,2035), -('2035-08-06',203532,8,2035,6,32,203508,2035), -('2035-08-07',203532,8,2035,7,32,203508,2035), -('2035-08-08',203532,8,2035,8,32,203508,2035), -('2035-08-09',203532,8,2035,9,32,203508,2035), -('2035-08-10',203532,8,2035,10,32,203508,2035), -('2035-08-11',203532,8,2035,11,32,203508,2035), -('2035-08-12',203533,8,2035,12,33,203508,2035), -('2035-08-13',203533,8,2035,13,33,203508,2035), -('2035-08-14',203533,8,2035,14,33,203508,2035), -('2035-08-15',203533,8,2035,15,33,203508,2035), -('2035-08-16',203533,8,2035,16,33,203508,2035), -('2035-08-17',203533,8,2035,17,33,203508,2035), -('2035-08-18',203533,8,2035,18,33,203508,2035), -('2035-08-19',203534,8,2035,19,34,203508,2035), -('2035-08-20',203534,8,2035,20,34,203508,2035), -('2035-08-21',203534,8,2035,21,34,203508,2035), -('2035-08-22',203534,8,2035,22,34,203508,2035), -('2035-08-23',203534,8,2035,23,34,203508,2035), -('2035-08-24',203534,8,2035,24,34,203508,2035), -('2035-08-25',203534,8,2035,25,34,203508,2035), -('2035-08-26',203535,8,2035,26,35,203508,2035), -('2035-08-27',203535,8,2035,27,35,203508,2035), -('2035-08-28',203535,8,2035,28,35,203508,2035), -('2035-08-29',203535,8,2035,29,35,203508,2035), -('2035-08-30',203535,8,2035,30,35,203508,2035), -('2035-08-31',203535,8,2035,31,35,203508,2035), -('2035-09-01',203535,9,2035,1,35,203509,2035), -('2035-09-02',203536,9,2035,2,36,203509,2035), -('2035-09-03',203536,9,2035,3,36,203509,2035), -('2035-09-04',203536,9,2035,4,36,203509,2035), -('2035-09-05',203536,9,2035,5,36,203509,2035), -('2035-09-06',203536,9,2035,6,36,203509,2035), -('2035-09-07',203536,9,2035,7,36,203509,2035), -('2035-09-08',203536,9,2035,8,36,203509,2035), -('2035-09-09',203537,9,2035,9,37,203509,2035), -('2035-09-10',203537,9,2035,10,37,203509,2035), -('2035-09-11',203537,9,2035,11,37,203509,2035), -('2035-09-12',203537,9,2035,12,37,203509,2035), -('2035-09-13',203537,9,2035,13,37,203509,2035), -('2035-09-14',203537,9,2035,14,37,203509,2035), -('2035-09-15',203537,9,2035,15,37,203509,2035), -('2035-09-16',203538,9,2035,16,38,203509,2035), -('2035-09-17',203538,9,2035,17,38,203509,2035), -('2035-09-18',203538,9,2035,18,38,203509,2035), -('2035-09-19',203538,9,2035,19,38,203509,2035), -('2035-09-20',203538,9,2035,20,38,203509,2035), -('2035-09-21',203538,9,2035,21,38,203509,2035), -('2035-09-22',203538,9,2035,22,38,203509,2035), -('2035-09-23',203539,9,2035,23,39,203509,2035), -('2035-09-24',203539,9,2035,24,39,203509,2035), -('2035-09-25',203539,9,2035,25,39,203509,2035), -('2035-09-26',203539,9,2035,26,39,203509,2035), -('2035-09-27',203539,9,2035,27,39,203509,2035), -('2035-09-28',203539,9,2035,28,39,203509,2035), -('2035-09-29',203539,9,2035,29,39,203509,2035), -('2035-09-30',203540,9,2035,30,40,203509,2035), -('2035-10-01',203540,10,2035,1,40,203510,2035), -('2035-10-02',203540,10,2035,2,40,203510,2035), -('2035-10-03',203540,10,2035,3,40,203510,2035), -('2035-10-04',203540,10,2035,4,40,203510,2035), -('2035-10-05',203540,10,2035,5,40,203510,2035), -('2035-10-06',203540,10,2035,6,40,203510,2035), -('2035-10-07',203541,10,2035,7,41,203510,2035), -('2035-10-08',203541,10,2035,8,41,203510,2035), -('2035-10-09',203541,10,2035,9,41,203510,2035), -('2035-10-10',203541,10,2035,10,41,203510,2035), -('2035-10-11',203541,10,2035,11,41,203510,2035), -('2035-10-12',203541,10,2035,12,41,203510,2035), -('2035-10-13',203541,10,2035,13,41,203510,2035), -('2035-10-14',203542,10,2035,14,42,203510,2035), -('2035-10-15',203542,10,2035,15,42,203510,2035), -('2035-10-16',203542,10,2035,16,42,203510,2035), -('2035-10-17',203542,10,2035,17,42,203510,2035), -('2035-10-18',203542,10,2035,18,42,203510,2035), -('2035-10-19',203542,10,2035,19,42,203510,2035), -('2035-10-20',203542,10,2035,20,42,203510,2035), -('2035-10-21',203543,10,2035,21,43,203510,2035), -('2035-10-22',203543,10,2035,22,43,203510,2035), -('2035-10-23',203543,10,2035,23,43,203510,2035), -('2035-10-24',203543,10,2035,24,43,203510,2035), -('2035-10-25',203543,10,2035,25,43,203510,2035), -('2035-10-26',203543,10,2035,26,43,203510,2035), -('2035-10-27',203543,10,2035,27,43,203510,2035), -('2035-10-28',203544,10,2035,28,44,203510,2035), -('2035-10-29',203544,10,2035,29,44,203510,2035), -('2035-10-30',203544,10,2035,30,44,203510,2035), -('2035-10-31',203544,10,2035,31,44,203510,2035), -('2035-11-01',203544,11,2035,1,44,203511,2035), -('2035-11-02',203544,11,2035,2,44,203511,2035), -('2035-11-03',203544,11,2035,3,44,203511,2035), -('2035-11-04',203545,11,2035,4,45,203511,2035), -('2035-11-05',203545,11,2035,5,45,203511,2035), -('2035-11-06',203545,11,2035,6,45,203511,2035), -('2035-11-07',203545,11,2035,7,45,203511,2035), -('2035-11-08',203545,11,2035,8,45,203511,2035), -('2035-11-09',203545,11,2035,9,45,203511,2035), -('2035-11-10',203545,11,2035,10,45,203511,2035), -('2035-11-11',203546,11,2035,11,46,203511,2035), -('2035-11-12',203546,11,2035,12,46,203511,2035), -('2035-11-13',203546,11,2035,13,46,203511,2035), -('2035-11-14',203546,11,2035,14,46,203511,2035), -('2035-11-15',203546,11,2035,15,46,203511,2035), -('2035-11-16',203546,11,2035,16,46,203511,2035), -('2035-11-17',203546,11,2035,17,46,203511,2035), -('2035-11-18',203547,11,2035,18,47,203511,2035), -('2035-11-19',203547,11,2035,19,47,203511,2035), -('2035-11-20',203547,11,2035,20,47,203511,2035), -('2035-11-21',203547,11,2035,21,47,203511,2035), -('2035-11-22',203547,11,2035,22,47,203511,2035), -('2035-11-23',203547,11,2035,23,47,203511,2035), -('2035-11-24',203547,11,2035,24,47,203511,2035), -('2035-11-25',203548,11,2035,25,48,203511,2035), -('2035-11-26',203548,11,2035,26,48,203511,2035), -('2035-11-27',203548,11,2035,27,48,203511,2035), -('2035-11-28',203548,11,2035,28,48,203511,2035), -('2035-11-29',203548,11,2035,29,48,203511,2035), -('2035-11-30',203548,11,2035,30,48,203511,2035), -('2035-12-01',203548,12,2035,1,48,203512,2036), -('2035-12-02',203549,12,2035,2,49,203512,2036), -('2035-12-03',203549,12,2035,3,49,203512,2036), -('2035-12-04',203549,12,2035,4,49,203512,2036), -('2035-12-05',203549,12,2035,5,49,203512,2036), -('2035-12-06',203549,12,2035,6,49,203512,2036), -('2035-12-07',203549,12,2035,7,49,203512,2036), -('2035-12-08',203549,12,2035,8,49,203512,2036), -('2035-12-09',203550,12,2035,9,50,203512,2036), -('2035-12-10',203550,12,2035,10,50,203512,2036), -('2035-12-11',203550,12,2035,11,50,203512,2036), -('2035-12-12',203550,12,2035,12,50,203512,2036), -('2035-12-13',203550,12,2035,13,50,203512,2036), -('2035-12-14',203550,12,2035,14,50,203512,2036), -('2035-12-15',203550,12,2035,15,50,203512,2036), -('2035-12-16',203551,12,2035,16,51,203512,2036), -('2035-12-17',203551,12,2035,17,51,203512,2036), -('2035-12-18',203551,12,2035,18,51,203512,2036), -('2035-12-19',203551,12,2035,19,51,203512,2036), -('2035-12-20',203551,12,2035,20,51,203512,2036), -('2035-12-21',203551,12,2035,21,51,203512,2036), -('2035-12-22',203551,12,2035,22,51,203512,2036), -('2035-12-23',203552,12,2035,23,52,203512,2036), -('2035-12-24',203552,12,2035,24,52,203512,2036), -('2035-12-25',203552,12,2035,25,52,203512,2036), -('2035-12-26',203552,12,2035,26,52,203512,2036), -('2035-12-27',203552,12,2035,27,52,203512,2036), -('2035-12-28',203552,12,2035,28,52,203512,2036), -('2035-12-29',203552,12,2035,29,52,203512,2036), -('2035-12-30',203553,12,2035,30,1,203512,2036), -('2035-12-31',203501,12,2035,31,1,203512,2036), -('2036-01-01',203601,1,2036,1,1,203601,2036), -('2036-01-02',203601,1,2036,2,1,203601,2036), -('2036-01-03',203601,1,2036,3,1,203601,2036), -('2036-01-04',203601,1,2036,4,1,203601,2036), -('2036-01-05',203601,1,2036,5,1,203601,2036), -('2036-01-06',203602,1,2036,6,2,203601,2036), -('2036-01-07',203602,1,2036,7,2,203601,2036), -('2036-01-08',203602,1,2036,8,2,203601,2036), -('2036-01-09',203602,1,2036,9,2,203601,2036), -('2036-01-10',203602,1,2036,10,2,203601,2036), -('2036-01-11',203602,1,2036,11,2,203601,2036), -('2036-01-12',203602,1,2036,12,2,203601,2036), -('2036-01-13',203603,1,2036,13,3,203601,2036), -('2036-01-14',203603,1,2036,14,3,203601,2036), -('2036-01-15',203603,1,2036,15,3,203601,2036), -('2036-01-16',203603,1,2036,16,3,203601,2036), -('2036-01-17',203603,1,2036,17,3,203601,2036), -('2036-01-18',203603,1,2036,18,3,203601,2036), -('2036-01-19',203603,1,2036,19,3,203601,2036), -('2036-01-20',203604,1,2036,20,4,203601,2036), -('2036-01-21',203604,1,2036,21,4,203601,2036), -('2036-01-22',203604,1,2036,22,4,203601,2036), -('2036-01-23',203604,1,2036,23,4,203601,2036), -('2036-01-24',203604,1,2036,24,4,203601,2036), -('2036-01-25',203604,1,2036,25,4,203601,2036), -('2036-01-26',203604,1,2036,26,4,203601,2036), -('2036-01-27',203605,1,2036,27,5,203601,2036), -('2036-01-28',203605,1,2036,28,5,203601,2036), -('2036-01-29',203605,1,2036,29,5,203601,2036), -('2036-01-30',203605,1,2036,30,5,203601,2036), -('2036-01-31',203605,1,2036,31,5,203601,2036), -('2036-02-01',203605,2,2036,1,5,203602,2036), -('2036-02-02',203605,2,2036,2,5,203602,2036), -('2036-02-03',203606,2,2036,3,6,203602,2036), -('2036-02-04',203606,2,2036,4,6,203602,2036), -('2036-02-05',203606,2,2036,5,6,203602,2036), -('2036-02-06',203606,2,2036,6,6,203602,2036), -('2036-02-07',203606,2,2036,7,6,203602,2036), -('2036-02-08',203606,2,2036,8,6,203602,2036), -('2036-02-09',203606,2,2036,9,6,203602,2036), -('2036-02-10',203607,2,2036,10,7,203602,2036), -('2036-02-11',203607,2,2036,11,7,203602,2036), -('2036-02-12',203607,2,2036,12,7,203602,2036), -('2036-02-13',203607,2,2036,13,7,203602,2036), -('2036-02-14',203607,2,2036,14,7,203602,2036), -('2036-02-15',203607,2,2036,15,7,203602,2036), -('2036-02-16',203607,2,2036,16,7,203602,2036), -('2036-02-17',203608,2,2036,17,8,203602,2036), -('2036-02-18',203608,2,2036,18,8,203602,2036), -('2036-02-19',203608,2,2036,19,8,203602,2036), -('2036-02-20',203608,2,2036,20,8,203602,2036), -('2036-02-21',203608,2,2036,21,8,203602,2036), -('2036-02-22',203608,2,2036,22,8,203602,2036), -('2036-02-23',203608,2,2036,23,8,203602,2036), -('2036-02-24',203609,2,2036,24,9,203602,2036), -('2036-02-25',203609,2,2036,25,9,203602,2036), -('2036-02-26',203609,2,2036,26,9,203602,2036), -('2036-02-27',203609,2,2036,27,9,203602,2036), -('2036-02-28',203609,2,2036,28,9,203602,2036), -('2036-02-29',203609,2,2036,29,9,203602,2036), -('2036-03-01',203609,3,2036,1,9,203603,2036), -('2036-03-02',203610,3,2036,2,10,203603,2036), -('2036-03-03',203610,3,2036,3,10,203603,2036), -('2036-03-04',203610,3,2036,4,10,203603,2036), -('2036-03-05',203610,3,2036,5,10,203603,2036), -('2036-03-06',203610,3,2036,6,10,203603,2036), -('2036-03-07',203610,3,2036,7,10,203603,2036), -('2036-03-08',203610,3,2036,8,10,203603,2036), -('2036-03-09',203611,3,2036,9,11,203603,2036), -('2036-03-10',203611,3,2036,10,11,203603,2036), -('2036-03-11',203611,3,2036,11,11,203603,2036), -('2036-03-12',203611,3,2036,12,11,203603,2036), -('2036-03-13',203611,3,2036,13,11,203603,2036), -('2036-03-14',203611,3,2036,14,11,203603,2036), -('2036-03-15',203611,3,2036,15,11,203603,2036), -('2036-03-16',203612,3,2036,16,12,203603,2036), -('2036-03-17',203612,3,2036,17,12,203603,2036), -('2036-03-18',203612,3,2036,18,12,203603,2036), -('2036-03-19',203612,3,2036,19,12,203603,2036), -('2036-03-20',203612,3,2036,20,12,203603,2036), -('2036-03-21',203612,3,2036,21,12,203603,2036), -('2036-03-22',203612,3,2036,22,12,203603,2036), -('2036-03-23',203613,3,2036,23,13,203603,2036), -('2036-03-24',203613,3,2036,24,13,203603,2036), -('2036-03-25',203613,3,2036,25,13,203603,2036), -('2036-03-26',203613,3,2036,26,13,203603,2036), -('2036-03-27',203613,3,2036,27,13,203603,2036), -('2036-03-28',203613,3,2036,28,13,203603,2036), -('2036-03-29',203613,3,2036,29,13,203603,2036), -('2036-03-30',203614,3,2036,30,14,203603,2036), -('2036-03-31',203614,3,2036,31,14,203603,2036), -('2036-04-01',203614,4,2036,1,14,203604,2036), -('2036-04-02',203614,4,2036,2,14,203604,2036), -('2036-04-03',203614,4,2036,3,14,203604,2036), -('2036-04-04',203614,4,2036,4,14,203604,2036), -('2036-04-05',203614,4,2036,5,14,203604,2036), -('2036-04-06',203615,4,2036,6,15,203604,2036), -('2036-04-07',203615,4,2036,7,15,203604,2036), -('2036-04-08',203615,4,2036,8,15,203604,2036), -('2036-04-09',203615,4,2036,9,15,203604,2036), -('2036-04-10',203615,4,2036,10,15,203604,2036), -('2036-04-11',203615,4,2036,11,15,203604,2036), -('2036-04-12',203615,4,2036,12,15,203604,2036), -('2036-04-13',203616,4,2036,13,16,203604,2036), -('2036-04-14',203616,4,2036,14,16,203604,2036), -('2036-04-15',203616,4,2036,15,16,203604,2036), -('2036-04-16',203616,4,2036,16,16,203604,2036), -('2036-04-17',203616,4,2036,17,16,203604,2036), -('2036-04-18',203616,4,2036,18,16,203604,2036), -('2036-04-19',203616,4,2036,19,16,203604,2036), -('2036-04-20',203617,4,2036,20,17,203604,2036), -('2036-04-21',203617,4,2036,21,17,203604,2036), -('2036-04-22',203617,4,2036,22,17,203604,2036), -('2036-04-23',203617,4,2036,23,17,203604,2036), -('2036-04-24',203617,4,2036,24,17,203604,2036), -('2036-04-25',203617,4,2036,25,17,203604,2036), -('2036-04-26',203617,4,2036,26,17,203604,2036), -('2036-04-27',203618,4,2036,27,18,203604,2036), -('2036-04-28',203618,4,2036,28,18,203604,2036), -('2036-04-29',203618,4,2036,29,18,203604,2036), -('2036-04-30',203618,4,2036,30,18,203604,2036), -('2036-05-01',203618,5,2036,1,18,203605,2036), -('2036-05-02',203618,5,2036,2,18,203605,2036), -('2036-05-03',203618,5,2036,3,18,203605,2036), -('2036-05-04',203619,5,2036,4,19,203605,2036), -('2036-05-05',203619,5,2036,5,19,203605,2036), -('2036-05-06',203619,5,2036,6,19,203605,2036), -('2036-05-07',203619,5,2036,7,19,203605,2036), -('2036-05-08',203619,5,2036,8,19,203605,2036), -('2036-05-09',203619,5,2036,9,19,203605,2036), -('2036-05-10',203619,5,2036,10,19,203605,2036), -('2036-05-11',203620,5,2036,11,20,203605,2036), -('2036-05-12',203620,5,2036,12,20,203605,2036), -('2036-05-13',203620,5,2036,13,20,203605,2036), -('2036-05-14',203620,5,2036,14,20,203605,2036), -('2036-05-15',203620,5,2036,15,20,203605,2036), -('2036-05-16',203620,5,2036,16,20,203605,2036), -('2036-05-17',203620,5,2036,17,20,203605,2036), -('2036-05-18',203621,5,2036,18,21,203605,2036), -('2036-05-19',203621,5,2036,19,21,203605,2036), -('2036-05-20',203621,5,2036,20,21,203605,2036), -('2036-05-21',203621,5,2036,21,21,203605,2036), -('2036-05-22',203621,5,2036,22,21,203605,2036), -('2036-05-23',203621,5,2036,23,21,203605,2036), -('2036-05-24',203621,5,2036,24,21,203605,2036), -('2036-05-25',203622,5,2036,25,22,203605,2036), -('2036-05-26',203622,5,2036,26,22,203605,2036), -('2036-05-27',203622,5,2036,27,22,203605,2036), -('2036-05-28',203622,5,2036,28,22,203605,2036), -('2036-05-29',203622,5,2036,29,22,203605,2036), -('2036-05-30',203622,5,2036,30,22,203605,2036), -('2036-05-31',203622,5,2036,31,22,203605,2036), -('2036-06-01',203623,6,2036,1,23,203606,2036), -('2036-06-02',203623,6,2036,2,23,203606,2036), -('2036-06-03',203623,6,2036,3,23,203606,2036), -('2036-06-04',203623,6,2036,4,23,203606,2036), -('2036-06-05',203623,6,2036,5,23,203606,2036), -('2036-06-06',203623,6,2036,6,23,203606,2036), -('2036-06-07',203623,6,2036,7,23,203606,2036), -('2036-06-08',203624,6,2036,8,24,203606,2036), -('2036-06-09',203624,6,2036,9,24,203606,2036), -('2036-06-10',203624,6,2036,10,24,203606,2036), -('2036-06-11',203624,6,2036,11,24,203606,2036), -('2036-06-12',203624,6,2036,12,24,203606,2036), -('2036-06-13',203624,6,2036,13,24,203606,2036), -('2036-06-14',203624,6,2036,14,24,203606,2036), -('2036-06-15',203625,6,2036,15,25,203606,2036), -('2036-06-16',203625,6,2036,16,25,203606,2036), -('2036-06-17',203625,6,2036,17,25,203606,2036), -('2036-06-18',203625,6,2036,18,25,203606,2036), -('2036-06-19',203625,6,2036,19,25,203606,2036), -('2036-06-20',203625,6,2036,20,25,203606,2036), -('2036-06-21',203625,6,2036,21,25,203606,2036), -('2036-06-22',203626,6,2036,22,26,203606,2036), -('2036-06-23',203626,6,2036,23,26,203606,2036), -('2036-06-24',203626,6,2036,24,26,203606,2036), -('2036-06-25',203626,6,2036,25,26,203606,2036), -('2036-06-26',203626,6,2036,26,26,203606,2036), -('2036-06-27',203626,6,2036,27,26,203606,2036), -('2036-06-28',203626,6,2036,28,26,203606,2036), -('2036-06-29',203627,6,2036,29,27,203606,2036), -('2036-06-30',203627,6,2036,30,27,203606,2036), -('2036-07-01',203627,7,2036,1,27,203607,2036), -('2036-07-02',203627,7,2036,2,27,203607,2036), -('2036-07-03',203627,7,2036,3,27,203607,2036), -('2036-07-04',203627,7,2036,4,27,203607,2036), -('2036-07-05',203627,7,2036,5,27,203607,2036), -('2036-07-06',203628,7,2036,6,28,203607,2036), -('2036-07-07',203628,7,2036,7,28,203607,2036), -('2036-07-08',203628,7,2036,8,28,203607,2036), -('2036-07-09',203628,7,2036,9,28,203607,2036), -('2036-07-10',203628,7,2036,10,28,203607,2036), -('2036-07-11',203628,7,2036,11,28,203607,2036), -('2036-07-12',203628,7,2036,12,28,203607,2036), -('2036-07-13',203629,7,2036,13,29,203607,2036), -('2036-07-14',203629,7,2036,14,29,203607,2036), -('2036-07-15',203629,7,2036,15,29,203607,2036), -('2036-07-16',203629,7,2036,16,29,203607,2036), -('2036-07-17',203629,7,2036,17,29,203607,2036), -('2036-07-18',203629,7,2036,18,29,203607,2036), -('2036-07-19',203629,7,2036,19,29,203607,2036), -('2036-07-20',203630,7,2036,20,30,203607,2036), -('2036-07-21',203630,7,2036,21,30,203607,2036), -('2036-07-22',203630,7,2036,22,30,203607,2036), -('2036-07-23',203630,7,2036,23,30,203607,2036), -('2036-07-24',203630,7,2036,24,30,203607,2036), -('2036-07-25',203630,7,2036,25,30,203607,2036), -('2036-07-26',203630,7,2036,26,30,203607,2036), -('2036-07-27',203631,7,2036,27,31,203607,2036), -('2036-07-28',203631,7,2036,28,31,203607,2036), -('2036-07-29',203631,7,2036,29,31,203607,2036), -('2036-07-30',203631,7,2036,30,31,203607,2036), -('2036-07-31',203631,7,2036,31,31,203607,2036), -('2036-08-01',203631,8,2036,1,31,203608,2036), -('2036-08-02',203631,8,2036,2,31,203608,2036), -('2036-08-03',203632,8,2036,3,32,203608,2036), -('2036-08-04',203632,8,2036,4,32,203608,2036), -('2036-08-05',203632,8,2036,5,32,203608,2036), -('2036-08-06',203632,8,2036,6,32,203608,2036), -('2036-08-07',203632,8,2036,7,32,203608,2036), -('2036-08-08',203632,8,2036,8,32,203608,2036), -('2036-08-09',203632,8,2036,9,32,203608,2036), -('2036-08-10',203633,8,2036,10,33,203608,2036), -('2036-08-11',203633,8,2036,11,33,203608,2036), -('2036-08-12',203633,8,2036,12,33,203608,2036), -('2036-08-13',203633,8,2036,13,33,203608,2036), -('2036-08-14',203633,8,2036,14,33,203608,2036), -('2036-08-15',203633,8,2036,15,33,203608,2036), -('2036-08-16',203633,8,2036,16,33,203608,2036), -('2036-08-17',203634,8,2036,17,34,203608,2036), -('2036-08-18',203634,8,2036,18,34,203608,2036), -('2036-08-19',203634,8,2036,19,34,203608,2036), -('2036-08-20',203634,8,2036,20,34,203608,2036), -('2036-08-21',203634,8,2036,21,34,203608,2036), -('2036-08-22',203634,8,2036,22,34,203608,2036), -('2036-08-23',203634,8,2036,23,34,203608,2036), -('2036-08-24',203635,8,2036,24,35,203608,2036), -('2036-08-25',203635,8,2036,25,35,203608,2036), -('2036-08-26',203635,8,2036,26,35,203608,2036), -('2036-08-27',203635,8,2036,27,35,203608,2036), -('2036-08-28',203635,8,2036,28,35,203608,2036), -('2036-08-29',203635,8,2036,29,35,203608,2036), -('2036-08-30',203635,8,2036,30,35,203608,2036), -('2036-08-31',203636,8,2036,31,36,203608,2036), -('2036-09-01',203636,9,2036,1,36,203609,2036), -('2036-09-02',203636,9,2036,2,36,203609,2036), -('2036-09-03',203636,9,2036,3,36,203609,2036), -('2036-09-04',203636,9,2036,4,36,203609,2036), -('2036-09-05',203636,9,2036,5,36,203609,2036), -('2036-09-06',203636,9,2036,6,36,203609,2036), -('2036-09-07',203637,9,2036,7,37,203609,2036), -('2036-09-08',203637,9,2036,8,37,203609,2036), -('2036-09-09',203637,9,2036,9,37,203609,2036), -('2036-09-10',203637,9,2036,10,37,203609,2036), -('2036-09-11',203637,9,2036,11,37,203609,2036), -('2036-09-12',203637,9,2036,12,37,203609,2036), -('2036-09-13',203637,9,2036,13,37,203609,2036), -('2036-09-14',203638,9,2036,14,38,203609,2036), -('2036-09-15',203638,9,2036,15,38,203609,2036), -('2036-09-16',203638,9,2036,16,38,203609,2036), -('2036-09-17',203638,9,2036,17,38,203609,2036), -('2036-09-18',203638,9,2036,18,38,203609,2036), -('2036-09-19',203638,9,2036,19,38,203609,2036), -('2036-09-20',203638,9,2036,20,38,203609,2036), -('2036-09-21',203639,9,2036,21,39,203609,2036), -('2036-09-22',203639,9,2036,22,39,203609,2036), -('2036-09-23',203639,9,2036,23,39,203609,2036), -('2036-09-24',203639,9,2036,24,39,203609,2036), -('2036-09-25',203639,9,2036,25,39,203609,2036), -('2036-09-26',203639,9,2036,26,39,203609,2036), -('2036-09-27',203639,9,2036,27,39,203609,2036), -('2036-09-28',203640,9,2036,28,40,203609,2036), -('2036-09-29',203640,9,2036,29,40,203609,2036), -('2036-09-30',203640,9,2036,30,40,203609,2036), -('2036-10-01',203640,10,2036,1,40,203610,2036), -('2036-10-02',203640,10,2036,2,40,203610,2036), -('2036-10-03',203640,10,2036,3,40,203610,2036), -('2036-10-04',203640,10,2036,4,40,203610,2036), -('2036-10-05',203641,10,2036,5,41,203610,2036), -('2036-10-06',203641,10,2036,6,41,203610,2036), -('2036-10-07',203641,10,2036,7,41,203610,2036), -('2036-10-08',203641,10,2036,8,41,203610,2036), -('2036-10-09',203641,10,2036,9,41,203610,2036), -('2036-10-10',203641,10,2036,10,41,203610,2036), -('2036-10-11',203641,10,2036,11,41,203610,2036), -('2036-10-12',203642,10,2036,12,42,203610,2036), -('2036-10-13',203642,10,2036,13,42,203610,2036), -('2036-10-14',203642,10,2036,14,42,203610,2036), -('2036-10-15',203642,10,2036,15,42,203610,2036), -('2036-10-16',203642,10,2036,16,42,203610,2036), -('2036-10-17',203642,10,2036,17,42,203610,2036), -('2036-10-18',203642,10,2036,18,42,203610,2036), -('2036-10-19',203643,10,2036,19,43,203610,2036), -('2036-10-20',203643,10,2036,20,43,203610,2036), -('2036-10-21',203643,10,2036,21,43,203610,2036), -('2036-10-22',203643,10,2036,22,43,203610,2036), -('2036-10-23',203643,10,2036,23,43,203610,2036), -('2036-10-24',203643,10,2036,24,43,203610,2036), -('2036-10-25',203643,10,2036,25,43,203610,2036), -('2036-10-26',203644,10,2036,26,44,203610,2036), -('2036-10-27',203644,10,2036,27,44,203610,2036), -('2036-10-28',203644,10,2036,28,44,203610,2036), -('2036-10-29',203644,10,2036,29,44,203610,2036), -('2036-10-30',203644,10,2036,30,44,203610,2036), -('2036-10-31',203644,10,2036,31,44,203610,2036), -('2036-11-01',203644,11,2036,1,44,203611,2036), -('2036-11-02',203645,11,2036,2,45,203611,2036), -('2036-11-03',203645,11,2036,3,45,203611,2036), -('2036-11-04',203645,11,2036,4,45,203611,2036), -('2036-11-05',203645,11,2036,5,45,203611,2036), -('2036-11-06',203645,11,2036,6,45,203611,2036), -('2036-11-07',203645,11,2036,7,45,203611,2036), -('2036-11-08',203645,11,2036,8,45,203611,2036), -('2036-11-09',203646,11,2036,9,46,203611,2036), -('2036-11-10',203646,11,2036,10,46,203611,2036), -('2036-11-11',203646,11,2036,11,46,203611,2036), -('2036-11-12',203646,11,2036,12,46,203611,2036), -('2036-11-13',203646,11,2036,13,46,203611,2036), -('2036-11-14',203646,11,2036,14,46,203611,2036), -('2036-11-15',203646,11,2036,15,46,203611,2036), -('2036-11-16',203647,11,2036,16,47,203611,2036), -('2036-11-17',203647,11,2036,17,47,203611,2036), -('2036-11-18',203647,11,2036,18,47,203611,2036), -('2036-11-19',203647,11,2036,19,47,203611,2036), -('2036-11-20',203647,11,2036,20,47,203611,2036), -('2036-11-21',203647,11,2036,21,47,203611,2036), -('2036-11-22',203647,11,2036,22,47,203611,2036), -('2036-11-23',203648,11,2036,23,48,203611,2036), -('2036-11-24',203648,11,2036,24,48,203611,2036), -('2036-11-25',203648,11,2036,25,48,203611,2036), -('2036-11-26',203648,11,2036,26,48,203611,2036), -('2036-11-27',203648,11,2036,27,48,203611,2036), -('2036-11-28',203648,11,2036,28,48,203611,2036), -('2036-11-29',203648,11,2036,29,48,203611,2036), -('2036-11-30',203649,11,2036,30,49,203611,2036), -('2036-12-01',203649,12,2036,1,49,203612,2037), -('2036-12-02',203649,12,2036,2,49,203612,2037), -('2036-12-03',203649,12,2036,3,49,203612,2037), -('2036-12-04',203649,12,2036,4,49,203612,2037), -('2036-12-05',203649,12,2036,5,49,203612,2037), -('2036-12-06',203649,12,2036,6,49,203612,2037), -('2036-12-07',203650,12,2036,7,50,203612,2037), -('2036-12-08',203650,12,2036,8,50,203612,2037), -('2036-12-09',203650,12,2036,9,50,203612,2037), -('2036-12-10',203650,12,2036,10,50,203612,2037), -('2036-12-11',203650,12,2036,11,50,203612,2037), -('2036-12-12',203650,12,2036,12,50,203612,2037), -('2036-12-13',203650,12,2036,13,50,203612,2037), -('2036-12-14',203651,12,2036,14,51,203612,2037), -('2036-12-15',203651,12,2036,15,51,203612,2037), -('2036-12-16',203651,12,2036,16,51,203612,2037), -('2036-12-17',203651,12,2036,17,51,203612,2037), -('2036-12-18',203651,12,2036,18,51,203612,2037), -('2036-12-19',203651,12,2036,19,51,203612,2037), -('2036-12-20',203651,12,2036,20,51,203612,2037), -('2036-12-21',203652,12,2036,21,52,203612,2037), -('2036-12-22',203652,12,2036,22,52,203612,2037), -('2036-12-23',203652,12,2036,23,52,203612,2037), -('2036-12-24',203652,12,2036,24,52,203612,2037), -('2036-12-25',203652,12,2036,25,52,203612,2037), -('2036-12-26',203652,12,2036,26,52,203612,2037), -('2036-12-27',203652,12,2036,27,52,203612,2037), -('2036-12-28',203653,12,2036,28,53,203612,2037), -('2036-12-29',203601,12,2036,29,53,203612,2037), -('2036-12-30',203601,12,2036,30,53,203612,2037); +INSERT INTO `time` VALUES ('2007-12-31',200801,12,2007,31,1,200712,2008),('2008-01-01',200801,1,2008,1,1,200801,2008),('2008-01-02',200801,1,2008,2,1,200801,2008),('2008-01-03',200801,1,2008,3,1,200801,2008),('2008-01-04',200801,1,2008,4,1,200801,2008),('2008-01-05',200801,1,2008,5,1,200801,2008),('2008-01-06',200802,1,2008,6,2,200801,2008),('2008-01-07',200802,1,2008,7,2,200801,2008),('2008-01-08',200802,1,2008,8,2,200801,2008),('2008-01-09',200802,1,2008,9,2,200801,2008),('2008-01-10',200802,1,2008,10,2,200801,2008),('2008-01-11',200802,1,2008,11,2,200801,2008),('2008-01-12',200802,1,2008,12,2,200801,2008),('2008-01-13',200803,1,2008,13,3,200801,2008),('2008-01-14',200803,1,2008,14,3,200801,2008),('2008-01-15',200803,1,2008,15,3,200801,2008),('2008-01-16',200803,1,2008,16,3,200801,2008),('2008-01-17',200803,1,2008,17,3,200801,2008),('2008-01-18',200803,1,2008,18,3,200801,2008),('2008-01-19',200803,1,2008,19,3,200801,2008),('2008-01-20',200804,1,2008,20,4,200801,2008),('2008-01-21',200804,1,2008,21,4,200801,2008),('2008-01-22',200804,1,2008,22,4,200801,2008),('2008-01-23',200804,1,2008,23,4,200801,2008),('2008-01-24',200804,1,2008,24,4,200801,2008),('2008-01-25',200804,1,2008,25,4,200801,2008),('2008-01-26',200804,1,2008,26,4,200801,2008),('2008-01-27',200805,1,2008,27,5,200801,2008),('2008-01-28',200805,1,2008,28,5,200801,2008),('2008-01-29',200805,1,2008,29,5,200801,2008),('2008-01-30',200805,1,2008,30,5,200801,2008),('2008-01-31',200805,1,2008,31,5,200801,2008),('2008-02-01',200805,2,2008,1,5,200802,2008),('2008-02-02',200805,2,2008,2,5,200802,2008),('2008-02-03',200806,2,2008,3,6,200802,2008),('2008-02-04',200806,2,2008,4,6,200802,2008),('2008-02-05',200806,2,2008,5,6,200802,2008),('2008-02-06',200806,2,2008,6,6,200802,2008),('2008-02-07',200806,2,2008,7,6,200802,2008),('2008-02-08',200806,2,2008,8,6,200802,2008),('2008-02-09',200806,2,2008,9,6,200802,2008),('2008-02-10',200807,2,2008,10,7,200802,2008),('2008-02-11',200807,2,2008,11,7,200802,2008),('2008-02-12',200807,2,2008,12,7,200802,2008),('2008-02-13',200807,2,2008,13,7,200802,2008),('2008-02-14',200807,2,2008,14,7,200802,2008),('2008-02-15',200807,2,2008,15,7,200802,2008),('2008-02-16',200807,2,2008,16,7,200802,2008),('2008-02-17',200808,2,2008,17,8,200802,2008),('2008-02-18',200808,2,2008,18,8,200802,2008),('2008-02-19',200808,2,2008,19,8,200802,2008),('2008-02-20',200808,2,2008,20,8,200802,2008),('2008-02-21',200808,2,2008,21,8,200802,2008),('2008-02-22',200808,2,2008,22,8,200802,2008),('2008-02-23',200808,2,2008,23,8,200802,2008),('2008-02-24',200809,2,2008,24,9,200802,2008),('2008-02-25',200809,2,2008,25,9,200802,2008),('2008-02-26',200809,2,2008,26,9,200802,2008),('2008-02-27',200809,2,2008,27,9,200802,2008),('2008-02-28',200809,2,2008,28,9,200802,2008),('2008-02-29',200809,2,2008,29,9,200802,2008),('2008-03-01',200809,3,2008,1,9,200803,2008),('2008-03-02',200810,3,2008,2,10,200803,2008),('2008-03-03',200810,3,2008,3,10,200803,2008),('2008-03-04',200810,3,2008,4,10,200803,2008),('2008-03-05',200810,3,2008,5,10,200803,2008),('2008-03-06',200810,3,2008,6,10,200803,2008),('2008-03-07',200810,3,2008,7,10,200803,2008),('2008-03-08',200810,3,2008,8,10,200803,2008),('2008-03-09',200811,3,2008,9,11,200803,2008),('2008-03-10',200811,3,2008,10,11,200803,2008),('2008-03-11',200811,3,2008,11,11,200803,2008),('2008-03-12',200811,3,2008,12,11,200803,2008),('2008-03-13',200811,3,2008,13,11,200803,2008),('2008-03-14',200811,3,2008,14,11,200803,2008),('2008-03-15',200811,3,2008,15,11,200803,2008),('2008-03-16',200812,3,2008,16,12,200803,2008),('2008-03-17',200812,3,2008,17,12,200803,2008),('2008-03-18',200812,3,2008,18,12,200803,2008),('2008-03-19',200812,3,2008,19,12,200803,2008),('2008-03-20',200812,3,2008,20,12,200803,2008),('2008-03-21',200812,3,2008,21,12,200803,2008),('2008-03-22',200812,3,2008,22,12,200803,2008),('2008-03-23',200813,3,2008,23,13,200803,2008),('2008-03-24',200813,3,2008,24,13,200803,2008),('2008-03-25',200813,3,2008,25,13,200803,2008),('2008-03-26',200813,3,2008,26,13,200803,2008),('2008-03-27',200813,3,2008,27,13,200803,2008),('2008-03-28',200813,3,2008,28,13,200803,2008),('2008-03-29',200813,3,2008,29,13,200803,2008),('2008-03-30',200814,3,2008,30,14,200803,2008),('2008-03-31',200814,3,2008,31,14,200803,2008),('2008-04-01',200814,4,2008,1,14,200804,2008),('2008-04-02',200814,4,2008,2,14,200804,2008),('2008-04-03',200814,4,2008,3,14,200804,2008),('2008-04-04',200814,4,2008,4,14,200804,2008),('2008-04-05',200814,4,2008,5,14,200804,2008),('2008-04-06',200815,4,2008,6,15,200804,2008),('2008-04-07',200815,4,2008,7,15,200804,2008),('2008-04-08',200815,4,2008,8,15,200804,2008),('2008-04-09',200815,4,2008,9,15,200804,2008),('2008-04-10',200815,4,2008,10,15,200804,2008),('2008-04-11',200815,4,2008,11,15,200804,2008),('2008-04-12',200815,4,2008,12,15,200804,2008),('2008-04-13',200816,4,2008,13,16,200804,2008),('2008-04-14',200816,4,2008,14,16,200804,2008),('2008-04-15',200816,4,2008,15,16,200804,2008),('2008-04-16',200816,4,2008,16,16,200804,2008),('2008-04-17',200816,4,2008,17,16,200804,2008),('2008-04-18',200816,4,2008,18,16,200804,2008),('2008-04-19',200816,4,2008,19,16,200804,2008),('2008-04-20',200817,4,2008,20,17,200804,2008),('2008-04-21',200817,4,2008,21,17,200804,2008),('2008-04-22',200817,4,2008,22,17,200804,2008),('2008-04-23',200817,4,2008,23,17,200804,2008),('2008-04-24',200817,4,2008,24,17,200804,2008),('2008-04-25',200817,4,2008,25,17,200804,2008),('2008-04-26',200817,4,2008,26,17,200804,2008),('2008-04-27',200818,4,2008,27,18,200804,2008),('2008-04-28',200818,4,2008,28,18,200804,2008),('2008-04-29',200818,4,2008,29,18,200804,2008),('2008-04-30',200818,4,2008,30,18,200804,2008),('2008-05-01',200818,5,2008,1,18,200805,2008),('2008-05-02',200818,5,2008,2,18,200805,2008),('2008-05-03',200818,5,2008,3,18,200805,2008),('2008-05-04',200819,5,2008,4,19,200805,2008),('2008-05-05',200819,5,2008,5,19,200805,2008),('2008-05-06',200819,5,2008,6,19,200805,2008),('2008-05-07',200819,5,2008,7,19,200805,2008),('2008-05-08',200819,5,2008,8,19,200805,2008),('2008-05-09',200819,5,2008,9,19,200805,2008),('2008-05-10',200819,5,2008,10,19,200805,2008),('2008-05-11',200820,5,2008,11,20,200805,2008),('2008-05-12',200820,5,2008,12,20,200805,2008),('2008-05-13',200820,5,2008,13,20,200805,2008),('2008-05-14',200820,5,2008,14,20,200805,2008),('2008-05-15',200820,5,2008,15,20,200805,2008),('2008-05-16',200820,5,2008,16,20,200805,2008),('2008-05-17',200820,5,2008,17,20,200805,2008),('2008-05-18',200821,5,2008,18,21,200805,2008),('2008-05-19',200821,5,2008,19,21,200805,2008),('2008-05-20',200821,5,2008,20,21,200805,2008),('2008-05-21',200821,5,2008,21,21,200805,2008),('2008-05-22',200821,5,2008,22,21,200805,2008),('2008-05-23',200821,5,2008,23,21,200805,2008),('2008-05-24',200821,5,2008,24,21,200805,2008),('2008-05-25',200822,5,2008,25,22,200805,2008),('2008-05-26',200822,5,2008,26,22,200805,2008),('2008-05-27',200822,5,2008,27,22,200805,2008),('2008-05-28',200822,5,2008,28,22,200805,2008),('2008-05-29',200822,5,2008,29,22,200805,2008),('2008-05-30',200822,5,2008,30,22,200805,2008),('2008-05-31',200822,5,2008,31,22,200805,2008),('2008-06-01',200823,6,2008,1,23,200806,2008),('2008-06-02',200823,6,2008,2,23,200806,2008),('2008-06-03',200823,6,2008,3,23,200806,2008),('2008-06-04',200823,6,2008,4,23,200806,2008),('2008-06-05',200823,6,2008,5,23,200806,2008),('2008-06-06',200823,6,2008,6,23,200806,2008),('2008-06-07',200823,6,2008,7,23,200806,2008),('2008-06-08',200824,6,2008,8,24,200806,2008),('2008-06-09',200824,6,2008,9,24,200806,2008),('2008-06-10',200824,6,2008,10,24,200806,2008),('2008-06-11',200824,6,2008,11,24,200806,2008),('2008-06-12',200824,6,2008,12,24,200806,2008),('2008-06-13',200824,6,2008,13,24,200806,2008),('2008-06-14',200824,6,2008,14,24,200806,2008),('2008-06-15',200825,6,2008,15,25,200806,2008),('2008-06-16',200825,6,2008,16,25,200806,2008),('2008-06-17',200825,6,2008,17,25,200806,2008),('2008-06-18',200825,6,2008,18,25,200806,2008),('2008-06-19',200825,6,2008,19,25,200806,2008),('2008-06-20',200825,6,2008,20,25,200806,2008),('2008-06-21',200825,6,2008,21,25,200806,2008),('2008-06-22',200826,6,2008,22,26,200806,2008),('2008-06-23',200826,6,2008,23,26,200806,2008),('2008-06-24',200826,6,2008,24,26,200806,2008),('2008-06-25',200826,6,2008,25,26,200806,2008),('2008-06-26',200826,6,2008,26,26,200806,2008),('2008-06-27',200826,6,2008,27,26,200806,2008),('2008-06-28',200826,6,2008,28,26,200806,2008),('2008-06-29',200827,6,2008,29,27,200806,2008),('2008-06-30',200827,6,2008,30,27,200806,2008),('2008-07-01',200827,7,2008,1,27,200807,2008),('2008-07-02',200827,7,2008,2,27,200807,2008),('2008-07-03',200827,7,2008,3,27,200807,2008),('2008-07-04',200827,7,2008,4,27,200807,2008),('2008-07-05',200827,7,2008,5,27,200807,2008),('2008-07-06',200828,7,2008,6,28,200807,2008),('2008-07-07',200828,7,2008,7,28,200807,2008),('2008-07-08',200828,7,2008,8,28,200807,2008),('2008-07-09',200828,7,2008,9,28,200807,2008),('2008-07-10',200828,7,2008,10,28,200807,2008),('2008-07-11',200828,7,2008,11,28,200807,2008),('2008-07-12',200828,7,2008,12,28,200807,2008),('2008-07-13',200829,7,2008,13,29,200807,2008),('2008-07-14',200829,7,2008,14,29,200807,2008),('2008-07-15',200829,7,2008,15,29,200807,2008),('2008-07-16',200829,7,2008,16,29,200807,2008),('2008-07-17',200829,7,2008,17,29,200807,2008),('2008-07-18',200829,7,2008,18,29,200807,2008),('2008-07-19',200829,7,2008,19,29,200807,2008),('2008-07-20',200830,7,2008,20,30,200807,2008),('2008-07-21',200830,7,2008,21,30,200807,2008),('2008-07-22',200830,7,2008,22,30,200807,2008),('2008-07-23',200830,7,2008,23,30,200807,2008),('2008-07-24',200830,7,2008,24,30,200807,2008),('2008-07-25',200830,7,2008,25,30,200807,2008),('2008-07-26',200830,7,2008,26,30,200807,2008),('2008-07-27',200831,7,2008,27,31,200807,2008),('2008-07-28',200831,7,2008,28,31,200807,2008),('2008-07-29',200831,7,2008,29,31,200807,2008),('2008-07-30',200831,7,2008,30,31,200807,2008),('2008-07-31',200831,7,2008,31,31,200807,2008),('2008-08-01',200831,8,2008,1,31,200808,2008),('2008-08-02',200831,8,2008,2,31,200808,2008),('2008-08-03',200832,8,2008,3,32,200808,2008),('2008-08-04',200832,8,2008,4,32,200808,2008),('2008-08-05',200832,8,2008,5,32,200808,2008),('2008-08-06',200832,8,2008,6,32,200808,2008),('2008-08-07',200832,8,2008,7,32,200808,2008),('2008-08-08',200832,8,2008,8,32,200808,2008),('2008-08-09',200832,8,2008,9,32,200808,2008),('2008-08-10',200833,8,2008,10,33,200808,2008),('2008-08-11',200833,8,2008,11,33,200808,2008),('2008-08-12',200833,8,2008,12,33,200808,2008),('2008-08-13',200833,8,2008,13,33,200808,2008),('2008-08-14',200833,8,2008,14,33,200808,2008),('2008-08-15',200833,8,2008,15,33,200808,2008),('2008-08-16',200833,8,2008,16,33,200808,2008),('2008-08-17',200834,8,2008,17,34,200808,2008),('2008-08-18',200834,8,2008,18,34,200808,2008),('2008-08-19',200834,8,2008,19,34,200808,2008),('2008-08-20',200834,8,2008,20,34,200808,2008),('2008-08-21',200834,8,2008,21,34,200808,2008),('2008-08-22',200834,8,2008,22,34,200808,2008),('2008-08-23',200834,8,2008,23,34,200808,2008),('2008-08-24',200835,8,2008,24,35,200808,2008),('2008-08-25',200835,8,2008,25,35,200808,2008),('2008-08-26',200835,8,2008,26,35,200808,2008),('2008-08-27',200835,8,2008,27,35,200808,2008),('2008-08-28',200835,8,2008,28,35,200808,2008),('2008-08-29',200835,8,2008,29,35,200808,2008),('2008-08-30',200835,8,2008,30,35,200808,2008),('2008-08-31',200836,8,2008,31,36,200808,2008),('2008-09-01',200836,9,2008,1,36,200809,2008),('2008-09-02',200836,9,2008,2,36,200809,2008),('2008-09-03',200836,9,2008,3,36,200809,2008),('2008-09-04',200836,9,2008,4,36,200809,2008),('2008-09-05',200836,9,2008,5,36,200809,2008),('2008-09-06',200836,9,2008,6,36,200809,2008),('2008-09-07',200837,9,2008,7,37,200809,2008),('2008-09-08',200837,9,2008,8,37,200809,2008),('2008-09-09',200837,9,2008,9,37,200809,2008),('2008-09-10',200837,9,2008,10,37,200809,2008),('2008-09-11',200837,9,2008,11,37,200809,2008),('2008-09-12',200837,9,2008,12,37,200809,2008),('2008-09-13',200837,9,2008,13,37,200809,2008),('2008-09-14',200838,9,2008,14,38,200809,2008),('2008-09-15',200838,9,2008,15,38,200809,2008),('2008-09-16',200838,9,2008,16,38,200809,2008),('2008-09-17',200838,9,2008,17,38,200809,2008),('2008-09-18',200838,9,2008,18,38,200809,2008),('2008-09-19',200838,9,2008,19,38,200809,2008),('2008-09-20',200838,9,2008,20,38,200809,2008),('2008-09-21',200839,9,2008,21,39,200809,2008),('2008-09-22',200839,9,2008,22,39,200809,2008),('2008-09-23',200839,9,2008,23,39,200809,2008),('2008-09-24',200839,9,2008,24,39,200809,2008),('2008-09-25',200839,9,2008,25,39,200809,2008),('2008-09-26',200839,9,2008,26,39,200809,2008),('2008-09-27',200839,9,2008,27,39,200809,2008),('2008-09-28',200840,9,2008,28,40,200809,2008),('2008-09-29',200840,9,2008,29,40,200809,2008),('2008-09-30',200840,9,2008,30,40,200809,2008),('2008-10-01',200840,10,2008,1,40,200810,2008),('2008-10-02',200840,10,2008,2,40,200810,2008),('2008-10-03',200840,10,2008,3,40,200810,2008),('2008-10-04',200840,10,2008,4,40,200810,2008),('2008-10-05',200841,10,2008,5,41,200810,2008),('2008-10-06',200841,10,2008,6,41,200810,2008),('2008-10-07',200841,10,2008,7,41,200810,2008),('2008-10-08',200841,10,2008,8,41,200810,2008),('2008-10-09',200841,10,2008,9,41,200810,2008),('2008-10-10',200841,10,2008,10,41,200810,2008),('2008-10-11',200841,10,2008,11,41,200810,2008),('2008-10-12',200842,10,2008,12,42,200810,2008),('2008-10-13',200842,10,2008,13,42,200810,2008),('2008-10-14',200842,10,2008,14,42,200810,2008),('2008-10-15',200842,10,2008,15,42,200810,2008),('2008-10-16',200842,10,2008,16,42,200810,2008),('2008-10-17',200842,10,2008,17,42,200810,2008),('2008-10-18',200842,10,2008,18,42,200810,2008),('2008-10-19',200843,10,2008,19,43,200810,2008),('2008-10-20',200843,10,2008,20,43,200810,2008),('2008-10-21',200843,10,2008,21,43,200810,2008),('2008-10-22',200843,10,2008,22,43,200810,2008),('2008-10-23',200843,10,2008,23,43,200810,2008),('2008-10-24',200843,10,2008,24,43,200810,2008),('2008-10-25',200843,10,2008,25,43,200810,2008),('2008-10-26',200844,10,2008,26,44,200810,2008),('2008-10-27',200844,10,2008,27,44,200810,2008),('2008-10-28',200844,10,2008,28,44,200810,2008),('2008-10-29',200844,10,2008,29,44,200810,2008),('2008-10-30',200844,10,2008,30,44,200810,2008),('2008-10-31',200844,10,2008,31,44,200810,2008),('2008-11-01',200844,11,2008,1,44,200811,2008),('2008-11-02',200845,11,2008,2,45,200811,2008),('2008-11-03',200845,11,2008,3,45,200811,2008),('2008-11-04',200845,11,2008,4,45,200811,2008),('2008-11-05',200845,11,2008,5,45,200811,2008),('2008-11-06',200845,11,2008,6,45,200811,2008),('2008-11-07',200845,11,2008,7,45,200811,2008),('2008-11-08',200845,11,2008,8,45,200811,2008),('2008-11-09',200846,11,2008,9,46,200811,2008),('2008-11-10',200846,11,2008,10,46,200811,2008),('2008-11-11',200846,11,2008,11,46,200811,2008),('2008-11-12',200846,11,2008,12,46,200811,2008),('2008-11-13',200846,11,2008,13,46,200811,2008),('2008-11-14',200846,11,2008,14,46,200811,2008),('2008-11-15',200846,11,2008,15,46,200811,2008),('2008-11-16',200847,11,2008,16,47,200811,2008),('2008-11-17',200847,11,2008,17,47,200811,2008),('2008-11-18',200847,11,2008,18,47,200811,2008),('2008-11-19',200847,11,2008,19,47,200811,2008),('2008-11-20',200847,11,2008,20,47,200811,2008),('2008-11-21',200847,11,2008,21,47,200811,2008),('2008-11-22',200847,11,2008,22,47,200811,2008),('2008-11-23',200848,11,2008,23,48,200811,2008),('2008-11-24',200848,11,2008,24,48,200811,2008),('2008-11-25',200848,11,2008,25,48,200811,2008),('2008-11-26',200848,11,2008,26,48,200811,2008),('2008-11-27',200848,11,2008,27,48,200811,2008),('2008-11-28',200848,11,2008,28,48,200811,2008),('2008-11-29',200848,11,2008,29,48,200811,2008),('2008-11-30',200849,11,2008,30,49,200811,2008),('2008-12-01',200849,12,2008,1,49,200812,2009),('2008-12-02',200849,12,2008,2,49,200812,2009),('2008-12-03',200849,12,2008,3,49,200812,2009),('2008-12-04',200849,12,2008,4,49,200812,2009),('2008-12-05',200849,12,2008,5,49,200812,2009),('2008-12-06',200849,12,2008,6,49,200812,2009),('2008-12-07',200850,12,2008,7,50,200812,2009),('2008-12-08',200850,12,2008,8,50,200812,2009),('2008-12-09',200850,12,2008,9,50,200812,2009),('2008-12-10',200850,12,2008,10,50,200812,2009),('2008-12-11',200850,12,2008,11,50,200812,2009),('2008-12-12',200850,12,2008,12,50,200812,2009),('2008-12-13',200850,12,2008,13,50,200812,2009),('2008-12-14',200851,12,2008,14,51,200812,2009),('2008-12-15',200851,12,2008,15,51,200812,2009),('2008-12-16',200851,12,2008,16,51,200812,2009),('2008-12-17',200851,12,2008,17,51,200812,2009),('2008-12-18',200851,12,2008,18,51,200812,2009),('2008-12-19',200851,12,2008,19,51,200812,2009),('2008-12-20',200851,12,2008,20,51,200812,2009),('2008-12-21',200852,12,2008,21,52,200812,2009),('2008-12-22',200852,12,2008,22,52,200812,2009),('2008-12-23',200852,12,2008,23,52,200812,2009),('2008-12-24',200852,12,2008,24,52,200812,2009),('2008-12-25',200852,12,2008,25,52,200812,2009),('2008-12-26',200852,12,2008,26,52,200812,2009),('2008-12-27',200852,12,2008,27,52,200812,2009),('2008-12-28',200853,12,2008,28,53,200812,2009),('2008-12-29',200901,12,2008,29,53,200812,2009),('2008-12-30',200901,12,2008,30,53,200812,2009),('2008-12-31',200901,12,2008,31,53,200812,2009),('2009-01-01',200901,1,2009,1,53,200901,2009),('2009-01-02',200901,1,2009,2,53,200901,2009),('2009-01-03',200901,1,2009,3,53,200901,2009),('2009-01-04',200902,1,2009,4,1,200901,2009),('2009-01-05',200902,1,2009,5,1,200901,2009),('2009-01-06',200902,1,2009,6,1,200901,2009),('2009-01-07',200902,1,2009,7,1,200901,2009),('2009-01-08',200902,1,2009,8,1,200901,2009),('2009-01-09',200902,1,2009,9,1,200901,2009),('2009-01-10',200902,1,2009,10,1,200901,2009),('2009-01-11',200903,1,2009,11,2,200901,2009),('2009-01-12',200903,1,2009,12,2,200901,2009),('2009-01-13',200903,1,2009,13,2,200901,2009),('2009-01-14',200903,1,2009,14,2,200901,2009),('2009-01-15',200903,1,2009,15,2,200901,2009),('2009-01-16',200903,1,2009,16,2,200901,2009),('2009-01-17',200903,1,2009,17,2,200901,2009),('2009-01-18',200904,1,2009,18,3,200901,2009),('2009-01-19',200904,1,2009,19,3,200901,2009),('2009-01-20',200904,1,2009,20,3,200901,2009),('2009-01-21',200904,1,2009,21,3,200901,2009),('2009-01-22',200904,1,2009,22,3,200901,2009),('2009-01-23',200904,1,2009,23,3,200901,2009),('2009-01-24',200904,1,2009,24,3,200901,2009),('2009-01-25',200905,1,2009,25,4,200901,2009),('2009-01-26',200905,1,2009,26,4,200901,2009),('2009-01-27',200905,1,2009,27,4,200901,2009),('2009-01-28',200905,1,2009,28,4,200901,2009),('2009-01-29',200905,1,2009,29,4,200901,2009),('2009-01-30',200905,1,2009,30,4,200901,2009),('2009-01-31',200905,1,2009,31,4,200901,2009),('2009-02-01',200906,2,2009,1,5,200902,2009),('2009-02-02',200906,2,2009,2,5,200902,2009),('2009-02-03',200906,2,2009,3,5,200902,2009),('2009-02-04',200906,2,2009,4,5,200902,2009),('2009-02-05',200906,2,2009,5,5,200902,2009),('2009-02-06',200906,2,2009,6,5,200902,2009),('2009-02-07',200906,2,2009,7,5,200902,2009),('2009-02-08',200907,2,2009,8,6,200902,2009),('2009-02-09',200907,2,2009,9,6,200902,2009),('2009-02-10',200907,2,2009,10,6,200902,2009),('2009-02-11',200907,2,2009,11,6,200902,2009),('2009-02-12',200907,2,2009,12,6,200902,2009),('2009-02-13',200907,2,2009,13,6,200902,2009),('2009-02-14',200907,2,2009,14,6,200902,2009),('2009-02-15',200908,2,2009,15,7,200902,2009),('2009-02-16',200908,2,2009,16,7,200902,2009),('2009-02-17',200908,2,2009,17,7,200902,2009),('2009-02-18',200908,2,2009,18,7,200902,2009),('2009-02-19',200908,2,2009,19,7,200902,2009),('2009-02-20',200908,2,2009,20,7,200902,2009),('2009-02-21',200908,2,2009,21,7,200902,2009),('2009-02-22',200909,2,2009,22,8,200902,2009),('2009-02-23',200909,2,2009,23,8,200902,2009),('2009-02-24',200909,2,2009,24,8,200902,2009),('2009-02-25',200909,2,2009,25,8,200902,2009),('2009-02-26',200909,2,2009,26,8,200902,2009),('2009-02-27',200909,2,2009,27,8,200902,2009),('2009-02-28',200909,2,2009,28,8,200902,2009),('2009-03-01',200910,3,2009,1,9,200903,2009),('2009-03-02',200910,3,2009,2,9,200903,2009),('2009-03-03',200910,3,2009,3,9,200903,2009),('2009-03-04',200910,3,2009,4,9,200903,2009),('2009-03-05',200910,3,2009,5,9,200903,2009),('2009-03-06',200910,3,2009,6,9,200903,2009),('2009-03-07',200910,3,2009,7,9,200903,2009),('2009-03-08',200911,3,2009,8,10,200903,2009),('2009-03-09',200911,3,2009,9,10,200903,2009),('2009-03-10',200911,3,2009,10,10,200903,2009),('2009-03-11',200911,3,2009,11,10,200903,2009),('2009-03-12',200911,3,2009,12,10,200903,2009),('2009-03-13',200911,3,2009,13,10,200903,2009),('2009-03-14',200911,3,2009,14,10,200903,2009),('2009-03-15',200912,3,2009,15,11,200903,2009),('2009-03-16',200912,3,2009,16,11,200903,2009),('2009-03-17',200912,3,2009,17,11,200903,2009),('2009-03-18',200912,3,2009,18,11,200903,2009),('2009-03-19',200912,3,2009,19,11,200903,2009),('2009-03-20',200912,3,2009,20,11,200903,2009),('2009-03-21',200912,3,2009,21,11,200903,2009),('2009-03-22',200913,3,2009,22,12,200903,2009),('2009-03-23',200913,3,2009,23,12,200903,2009),('2009-03-24',200913,3,2009,24,12,200903,2009),('2009-03-25',200913,3,2009,25,12,200903,2009),('2009-03-26',200913,3,2009,26,12,200903,2009),('2009-03-27',200913,3,2009,27,12,200903,2009),('2009-03-28',200913,3,2009,28,12,200903,2009),('2009-03-29',200914,3,2009,29,13,200903,2009),('2009-03-30',200914,3,2009,30,13,200903,2009),('2009-03-31',200914,3,2009,31,13,200903,2009),('2009-04-01',200914,4,2009,1,13,200904,2009),('2009-04-02',200914,4,2009,2,13,200904,2009),('2009-04-03',200914,4,2009,3,13,200904,2009),('2009-04-04',200914,4,2009,4,13,200904,2009),('2009-04-05',200915,4,2009,5,14,200904,2009),('2009-04-06',200915,4,2009,6,14,200904,2009),('2009-04-07',200915,4,2009,7,14,200904,2009),('2009-04-08',200915,4,2009,8,14,200904,2009),('2009-04-09',200915,4,2009,9,14,200904,2009),('2009-04-10',200915,4,2009,10,14,200904,2009),('2009-04-11',200915,4,2009,11,14,200904,2009),('2009-04-12',200916,4,2009,12,15,200904,2009),('2009-04-13',200916,4,2009,13,15,200904,2009),('2009-04-14',200916,4,2009,14,15,200904,2009),('2009-04-15',200916,4,2009,15,15,200904,2009),('2009-04-16',200916,4,2009,16,15,200904,2009),('2009-04-17',200916,4,2009,17,15,200904,2009),('2009-04-18',200916,4,2009,18,15,200904,2009),('2009-04-19',200917,4,2009,19,16,200904,2009),('2009-04-20',200917,4,2009,20,16,200904,2009),('2009-04-21',200917,4,2009,21,16,200904,2009),('2009-04-22',200917,4,2009,22,16,200904,2009),('2009-04-23',200917,4,2009,23,16,200904,2009),('2009-04-24',200917,4,2009,24,16,200904,2009),('2009-04-25',200917,4,2009,25,16,200904,2009),('2009-04-26',200918,4,2009,26,17,200904,2009),('2009-04-27',200918,4,2009,27,17,200904,2009),('2009-04-28',200918,4,2009,28,17,200904,2009),('2009-04-29',200918,4,2009,29,17,200904,2009),('2009-04-30',200918,4,2009,30,17,200904,2009),('2009-05-01',200918,5,2009,1,17,200905,2009),('2009-05-02',200918,5,2009,2,17,200905,2009),('2009-05-03',200919,5,2009,3,18,200905,2009),('2009-05-04',200919,5,2009,4,18,200905,2009),('2009-05-05',200919,5,2009,5,18,200905,2009),('2009-05-06',200919,5,2009,6,18,200905,2009),('2009-05-07',200919,5,2009,7,18,200905,2009),('2009-05-08',200919,5,2009,8,18,200905,2009),('2009-05-09',200919,5,2009,9,18,200905,2009),('2009-05-10',200920,5,2009,10,19,200905,2009),('2009-05-11',200920,5,2009,11,19,200905,2009),('2009-05-12',200920,5,2009,12,19,200905,2009),('2009-05-13',200920,5,2009,13,19,200905,2009),('2009-05-14',200920,5,2009,14,19,200905,2009),('2009-05-15',200920,5,2009,15,19,200905,2009),('2009-05-16',200920,5,2009,16,19,200905,2009),('2009-05-17',200921,5,2009,17,20,200905,2009),('2009-05-18',200921,5,2009,18,20,200905,2009),('2009-05-19',200921,5,2009,19,20,200905,2009),('2009-05-20',200921,5,2009,20,20,200905,2009),('2009-05-21',200921,5,2009,21,20,200905,2009),('2009-05-22',200921,5,2009,22,20,200905,2009),('2009-05-23',200921,5,2009,23,20,200905,2009),('2009-05-24',200922,5,2009,24,21,200905,2009),('2009-05-25',200922,5,2009,25,21,200905,2009),('2009-05-26',200922,5,2009,26,21,200905,2009),('2009-05-27',200922,5,2009,27,21,200905,2009),('2009-05-28',200922,5,2009,28,21,200905,2009),('2009-05-29',200922,5,2009,29,21,200905,2009),('2009-05-30',200922,5,2009,30,21,200905,2009),('2009-05-31',200923,5,2009,31,22,200905,2009),('2009-06-01',200923,6,2009,1,22,200906,2009),('2009-06-02',200923,6,2009,2,22,200906,2009),('2009-06-03',200923,6,2009,3,22,200906,2009),('2009-06-04',200923,6,2009,4,22,200906,2009),('2009-06-05',200923,6,2009,5,22,200906,2009),('2009-06-06',200923,6,2009,6,22,200906,2009),('2009-06-07',200924,6,2009,7,23,200906,2009),('2009-06-08',200924,6,2009,8,23,200906,2009),('2009-06-09',200924,6,2009,9,23,200906,2009),('2009-06-10',200924,6,2009,10,23,200906,2009),('2009-06-11',200924,6,2009,11,23,200906,2009),('2009-06-12',200924,6,2009,12,23,200906,2009),('2009-06-13',200924,6,2009,13,23,200906,2009),('2009-06-14',200925,6,2009,14,24,200906,2009),('2009-06-15',200925,6,2009,15,24,200906,2009),('2009-06-16',200925,6,2009,16,24,200906,2009),('2009-06-17',200925,6,2009,17,24,200906,2009),('2009-06-18',200925,6,2009,18,24,200906,2009),('2009-06-19',200925,6,2009,19,24,200906,2009),('2009-06-20',200925,6,2009,20,24,200906,2009),('2009-06-21',200926,6,2009,21,25,200906,2009),('2009-06-22',200926,6,2009,22,25,200906,2009),('2009-06-23',200926,6,2009,23,25,200906,2009),('2009-06-24',200926,6,2009,24,25,200906,2009),('2009-06-25',200926,6,2009,25,25,200906,2009),('2009-06-26',200926,6,2009,26,25,200906,2009),('2009-06-27',200926,6,2009,27,25,200906,2009),('2009-06-28',200927,6,2009,28,26,200906,2009),('2009-06-29',200927,6,2009,29,26,200906,2009),('2009-06-30',200927,6,2009,30,26,200906,2009),('2009-07-01',200927,7,2009,1,26,200907,2009),('2009-07-02',200927,7,2009,2,26,200907,2009),('2009-07-03',200927,7,2009,3,26,200907,2009),('2009-07-04',200927,7,2009,4,26,200907,2009),('2009-07-05',200928,7,2009,5,27,200907,2009),('2009-07-06',200928,7,2009,6,27,200907,2009),('2009-07-07',200928,7,2009,7,27,200907,2009),('2009-07-08',200928,7,2009,8,27,200907,2009),('2009-07-09',200928,7,2009,9,27,200907,2009),('2009-07-10',200928,7,2009,10,27,200907,2009),('2009-07-11',200928,7,2009,11,27,200907,2009),('2009-07-12',200929,7,2009,12,28,200907,2009),('2009-07-13',200929,7,2009,13,28,200907,2009),('2009-07-14',200929,7,2009,14,28,200907,2009),('2009-07-15',200929,7,2009,15,28,200907,2009),('2009-07-16',200929,7,2009,16,28,200907,2009),('2009-07-17',200929,7,2009,17,28,200907,2009),('2009-07-18',200929,7,2009,18,28,200907,2009),('2009-07-19',200930,7,2009,19,29,200907,2009),('2009-07-20',200930,7,2009,20,29,200907,2009),('2009-07-21',200930,7,2009,21,29,200907,2009),('2009-07-22',200930,7,2009,22,29,200907,2009),('2009-07-23',200930,7,2009,23,29,200907,2009),('2009-07-24',200930,7,2009,24,29,200907,2009),('2009-07-25',200930,7,2009,25,29,200907,2009),('2009-07-26',200931,7,2009,26,30,200907,2009),('2009-07-27',200931,7,2009,27,30,200907,2009),('2009-07-28',200931,7,2009,28,30,200907,2009),('2009-07-29',200931,7,2009,29,30,200907,2009),('2009-07-30',200931,7,2009,30,30,200907,2009),('2009-07-31',200931,7,2009,31,30,200907,2009),('2009-08-01',200931,8,2009,1,30,200908,2009),('2009-08-02',200932,8,2009,2,31,200908,2009),('2009-08-03',200932,8,2009,3,31,200908,2009),('2009-08-04',200932,8,2009,4,31,200908,2009),('2009-08-05',200932,8,2009,5,31,200908,2009),('2009-08-06',200932,8,2009,6,31,200908,2009),('2009-08-07',200932,8,2009,7,31,200908,2009),('2009-08-08',200932,8,2009,8,31,200908,2009),('2009-08-09',200933,8,2009,9,32,200908,2009),('2009-08-10',200933,8,2009,10,32,200908,2009),('2009-08-11',200933,8,2009,11,32,200908,2009),('2009-08-12',200933,8,2009,12,32,200908,2009),('2009-08-13',200933,8,2009,13,32,200908,2009),('2009-08-14',200933,8,2009,14,32,200908,2009),('2009-08-15',200933,8,2009,15,32,200908,2009),('2009-08-16',200934,8,2009,16,33,200908,2009),('2009-08-17',200934,8,2009,17,33,200908,2009),('2009-08-18',200934,8,2009,18,33,200908,2009),('2009-08-19',200934,8,2009,19,33,200908,2009),('2009-08-20',200934,8,2009,20,33,200908,2009),('2009-08-21',200934,8,2009,21,33,200908,2009),('2009-08-22',200934,8,2009,22,33,200908,2009),('2009-08-23',200935,8,2009,23,34,200908,2009),('2009-08-24',200935,8,2009,24,34,200908,2009),('2009-08-25',200935,8,2009,25,34,200908,2009),('2009-08-26',200935,8,2009,26,34,200908,2009),('2009-08-27',200935,8,2009,27,34,200908,2009),('2009-08-28',200935,8,2009,28,34,200908,2009),('2009-08-29',200935,8,2009,29,34,200908,2009),('2009-08-30',200936,8,2009,30,35,200908,2009),('2009-08-31',200936,8,2009,31,35,200908,2009),('2009-09-01',200936,9,2009,1,35,200909,2009),('2009-09-02',200936,9,2009,2,35,200909,2009),('2009-09-03',200936,9,2009,3,35,200909,2009),('2009-09-04',200936,9,2009,4,35,200909,2009),('2009-09-05',200936,9,2009,5,35,200909,2009),('2009-09-06',200937,9,2009,6,36,200909,2009),('2009-09-07',200937,9,2009,7,36,200909,2009),('2009-09-08',200937,9,2009,8,36,200909,2009),('2009-09-09',200937,9,2009,9,36,200909,2009),('2009-09-10',200937,9,2009,10,36,200909,2009),('2009-09-11',200937,9,2009,11,36,200909,2009),('2009-09-12',200937,9,2009,12,36,200909,2009),('2009-09-13',200938,9,2009,13,37,200909,2009),('2009-09-14',200938,9,2009,14,37,200909,2009),('2009-09-15',200938,9,2009,15,37,200909,2009),('2009-09-16',200938,9,2009,16,37,200909,2009),('2009-09-17',200938,9,2009,17,37,200909,2009),('2009-09-18',200938,9,2009,18,37,200909,2009),('2009-09-19',200938,9,2009,19,37,200909,2009),('2009-09-20',200939,9,2009,20,38,200909,2009),('2009-09-21',200939,9,2009,21,38,200909,2009),('2009-09-22',200939,9,2009,22,38,200909,2009),('2009-09-23',200939,9,2009,23,38,200909,2009),('2009-09-24',200939,9,2009,24,38,200909,2009),('2009-09-25',200939,9,2009,25,38,200909,2009),('2009-09-26',200939,9,2009,26,38,200909,2009),('2009-09-27',200940,9,2009,27,39,200909,2009),('2009-09-28',200940,9,2009,28,39,200909,2009),('2009-09-29',200940,9,2009,29,39,200909,2009),('2009-09-30',200940,9,2009,30,39,200909,2009),('2009-10-01',200940,10,2009,1,39,200910,2009),('2009-10-02',200940,10,2009,2,39,200910,2009),('2009-10-03',200940,10,2009,3,39,200910,2009),('2009-10-04',200941,10,2009,4,40,200910,2009),('2009-10-05',200941,10,2009,5,40,200910,2009),('2009-10-06',200941,10,2009,6,40,200910,2009),('2009-10-07',200941,10,2009,7,40,200910,2009),('2009-10-08',200941,10,2009,8,40,200910,2009),('2009-10-09',200941,10,2009,9,40,200910,2009),('2009-10-10',200941,10,2009,10,40,200910,2009),('2009-10-11',200942,10,2009,11,41,200910,2009),('2009-10-12',200942,10,2009,12,41,200910,2009),('2009-10-13',200942,10,2009,13,41,200910,2009),('2009-10-14',200942,10,2009,14,41,200910,2009),('2009-10-15',200942,10,2009,15,41,200910,2009),('2009-10-16',200942,10,2009,16,41,200910,2009),('2009-10-17',200942,10,2009,17,41,200910,2009),('2009-10-18',200943,10,2009,18,42,200910,2009),('2009-10-19',200943,10,2009,19,42,200910,2009),('2009-10-20',200943,10,2009,20,42,200910,2009),('2009-10-21',200943,10,2009,21,42,200910,2009),('2009-10-22',200943,10,2009,22,42,200910,2009),('2009-10-23',200943,10,2009,23,42,200910,2009),('2009-10-24',200943,10,2009,24,42,200910,2009),('2009-10-25',200944,10,2009,25,43,200910,2009),('2009-10-26',200944,10,2009,26,43,200910,2009),('2009-10-27',200944,10,2009,27,43,200910,2009),('2009-10-28',200944,10,2009,28,43,200910,2009),('2009-10-29',200944,10,2009,29,43,200910,2009),('2009-10-30',200944,10,2009,30,43,200910,2009),('2009-10-31',200944,10,2009,31,43,200910,2009),('2009-11-01',200945,11,2009,1,44,200911,2009),('2009-11-02',200945,11,2009,2,44,200911,2009),('2009-11-03',200945,11,2009,3,44,200911,2009),('2009-11-04',200945,11,2009,4,44,200911,2009),('2009-11-05',200945,11,2009,5,44,200911,2009),('2009-11-06',200945,11,2009,6,44,200911,2009),('2009-11-07',200945,11,2009,7,44,200911,2009),('2009-11-08',200946,11,2009,8,45,200911,2009),('2009-11-09',200946,11,2009,9,45,200911,2009),('2009-11-10',200946,11,2009,10,45,200911,2009),('2009-11-11',200946,11,2009,11,45,200911,2009),('2009-11-12',200946,11,2009,12,45,200911,2009),('2009-11-13',200946,11,2009,13,45,200911,2009),('2009-11-14',200946,11,2009,14,45,200911,2009),('2009-11-15',200947,11,2009,15,46,200911,2009),('2009-11-16',200947,11,2009,16,46,200911,2009),('2009-11-17',200947,11,2009,17,46,200911,2009),('2009-11-18',200947,11,2009,18,46,200911,2009),('2009-11-19',200947,11,2009,19,46,200911,2009),('2009-11-20',200947,11,2009,20,46,200911,2009),('2009-11-21',200947,11,2009,21,46,200911,2009),('2009-11-22',200948,11,2009,22,47,200911,2009),('2009-11-23',200948,11,2009,23,47,200911,2009),('2009-11-24',200948,11,2009,24,47,200911,2009),('2009-11-25',200948,11,2009,25,47,200911,2009),('2009-11-26',200948,11,2009,26,47,200911,2009),('2009-11-27',200948,11,2009,27,47,200911,2009),('2009-11-28',200948,11,2009,28,47,200911,2009),('2009-11-29',200949,11,2009,29,48,200911,2009),('2009-11-30',200949,11,2009,30,48,200911,2009),('2009-12-01',200949,12,2009,1,48,200912,2010),('2009-12-02',200949,12,2009,2,48,200912,2010),('2009-12-03',200949,12,2009,3,48,200912,2010),('2009-12-04',200949,12,2009,4,48,200912,2010),('2009-12-05',200949,12,2009,5,48,200912,2010),('2009-12-06',200950,12,2009,6,49,200912,2010),('2009-12-07',200950,12,2009,7,49,200912,2010),('2009-12-08',200950,12,2009,8,49,200912,2010),('2009-12-09',200950,12,2009,9,49,200912,2010),('2009-12-10',200950,12,2009,10,49,200912,2010),('2009-12-11',200950,12,2009,11,49,200912,2010),('2009-12-12',200950,12,2009,12,49,200912,2010),('2009-12-13',200951,12,2009,13,50,200912,2010),('2009-12-14',200951,12,2009,14,50,200912,2010),('2009-12-15',200951,12,2009,15,50,200912,2010),('2009-12-16',200951,12,2009,16,50,200912,2010),('2009-12-17',200951,12,2009,17,50,200912,2010),('2009-12-18',200951,12,2009,18,50,200912,2010),('2009-12-19',200951,12,2009,19,50,200912,2010),('2009-12-20',200952,12,2009,20,51,200912,2010),('2009-12-21',200952,12,2009,21,51,200912,2010),('2009-12-22',200952,12,2009,22,51,200912,2010),('2009-12-23',200952,12,2009,23,51,200912,2010),('2009-12-24',200952,12,2009,24,51,200912,2010),('2009-12-25',200952,12,2009,25,51,200912,2010),('2009-12-26',200952,12,2009,26,51,200912,2010),('2009-12-27',200953,12,2009,27,52,200912,2010),('2009-12-28',200952,12,2009,28,52,200912,2010),('2009-12-29',200952,12,2009,29,52,200912,2010),('2009-12-30',200952,12,2009,30,52,200912,2010),('2009-12-31',200952,12,2009,31,52,200912,2010),('2010-01-01',201001,1,2010,1,52,201001,2010),('2010-01-02',201001,1,2010,2,52,201001,2010),('2010-01-03',201002,1,2010,3,1,201001,2010),('2010-01-04',201001,1,2010,4,1,201001,2010),('2010-01-05',201001,1,2010,5,1,201001,2010),('2010-01-06',201001,1,2010,6,1,201001,2010),('2010-01-07',201001,1,2010,7,1,201001,2010),('2010-01-08',201001,1,2010,8,1,201001,2010),('2010-01-09',201001,1,2010,9,1,201001,2010),('2010-01-10',201002,1,2010,10,2,201001,2010),('2010-01-11',201002,1,2010,11,2,201001,2010),('2010-01-12',201002,1,2010,12,2,201001,2010),('2010-01-13',201002,1,2010,13,2,201001,2010),('2010-01-14',201002,1,2010,14,2,201001,2010),('2010-01-15',201002,1,2010,15,2,201001,2010),('2010-01-16',201002,1,2010,16,2,201001,2010),('2010-01-17',201003,1,2010,17,3,201001,2010),('2010-01-18',201003,1,2010,18,3,201001,2010),('2010-01-19',201003,1,2010,19,3,201001,2010),('2010-01-20',201003,1,2010,20,3,201001,2010),('2010-01-21',201003,1,2010,21,3,201001,2010),('2010-01-22',201003,1,2010,22,3,201001,2010),('2010-01-23',201003,1,2010,23,3,201001,2010),('2010-01-24',201004,1,2010,24,4,201001,2010),('2010-01-25',201004,1,2010,25,4,201001,2010),('2010-01-26',201004,1,2010,26,4,201001,2010),('2010-01-27',201004,1,2010,27,4,201001,2010),('2010-01-28',201004,1,2010,28,4,201001,2010),('2010-01-29',201004,1,2010,29,4,201001,2010),('2010-01-30',201004,1,2010,30,4,201001,2010),('2010-01-31',201005,1,2010,31,5,201001,2010),('2010-02-01',201005,2,2010,1,5,201002,2010),('2010-02-02',201005,2,2010,2,5,201002,2010),('2010-02-03',201005,2,2010,3,5,201002,2010),('2010-02-04',201005,2,2010,4,5,201002,2010),('2010-02-05',201005,2,2010,5,5,201002,2010),('2010-02-06',201005,2,2010,6,5,201002,2010),('2010-02-07',201006,2,2010,7,6,201002,2010),('2010-02-08',201006,2,2010,8,6,201002,2010),('2010-02-09',201006,2,2010,9,6,201002,2010),('2010-02-10',201006,2,2010,10,6,201002,2010),('2010-02-11',201006,2,2010,11,6,201002,2010),('2010-02-12',201006,2,2010,12,6,201002,2010),('2010-02-13',201006,2,2010,13,6,201002,2010),('2010-02-14',201007,2,2010,14,7,201002,2010),('2010-02-15',201007,2,2010,15,7,201002,2010),('2010-02-16',201007,2,2010,16,7,201002,2010),('2010-02-17',201007,2,2010,17,7,201002,2010),('2010-02-18',201007,2,2010,18,7,201002,2010),('2010-02-19',201007,2,2010,19,7,201002,2010),('2010-02-20',201007,2,2010,20,7,201002,2010),('2010-02-21',201008,2,2010,21,8,201002,2010),('2010-02-22',201008,2,2010,22,8,201002,2010),('2010-02-23',201008,2,2010,23,8,201002,2010),('2010-02-24',201008,2,2010,24,8,201002,2010),('2010-02-25',201008,2,2010,25,8,201002,2010),('2010-02-26',201008,2,2010,26,8,201002,2010),('2010-02-27',201008,2,2010,27,8,201002,2010),('2010-02-28',201009,2,2010,28,9,201002,2010),('2010-03-01',201009,3,2010,1,9,201003,2010),('2010-03-02',201009,3,2010,2,9,201003,2010),('2010-03-03',201009,3,2010,3,9,201003,2010),('2010-03-04',201009,3,2010,4,9,201003,2010),('2010-03-05',201009,3,2010,5,9,201003,2010),('2010-03-06',201009,3,2010,6,9,201003,2010),('2010-03-07',201010,3,2010,7,10,201003,2010),('2010-03-08',201010,3,2010,8,10,201003,2010),('2010-03-09',201010,3,2010,9,10,201003,2010),('2010-03-10',201010,3,2010,10,10,201003,2010),('2010-03-11',201010,3,2010,11,10,201003,2010),('2010-03-12',201010,3,2010,12,10,201003,2010),('2010-03-13',201010,3,2010,13,10,201003,2010),('2010-03-14',201011,3,2010,14,11,201003,2010),('2010-03-15',201011,3,2010,15,11,201003,2010),('2010-03-16',201011,3,2010,16,11,201003,2010),('2010-03-17',201011,3,2010,17,11,201003,2010),('2010-03-18',201011,3,2010,18,11,201003,2010),('2010-03-19',201011,3,2010,19,11,201003,2010),('2010-03-20',201011,3,2010,20,11,201003,2010),('2010-03-21',201012,3,2010,21,12,201003,2010),('2010-03-22',201012,3,2010,22,12,201003,2010),('2010-03-23',201012,3,2010,23,12,201003,2010),('2010-03-24',201012,3,2010,24,12,201003,2010),('2010-03-25',201012,3,2010,25,12,201003,2010),('2010-03-26',201012,3,2010,26,12,201003,2010),('2010-03-27',201012,3,2010,27,12,201003,2010),('2010-03-28',201013,3,2010,28,13,201003,2010),('2010-03-29',201013,3,2010,29,13,201003,2010),('2010-03-30',201013,3,2010,30,13,201003,2010),('2010-03-31',201013,3,2010,31,13,201003,2010),('2010-04-01',201013,4,2010,1,13,201004,2010),('2010-04-02',201013,4,2010,2,13,201004,2010),('2010-04-03',201013,4,2010,3,13,201004,2010),('2010-04-04',201014,4,2010,4,14,201004,2010),('2010-04-05',201014,4,2010,5,14,201004,2010),('2010-04-06',201014,4,2010,6,14,201004,2010),('2010-04-07',201014,4,2010,7,14,201004,2010),('2010-04-08',201014,4,2010,8,14,201004,2010),('2010-04-09',201014,4,2010,9,14,201004,2010),('2010-04-10',201014,4,2010,10,14,201004,2010),('2010-04-11',201015,4,2010,11,15,201004,2010),('2010-04-12',201015,4,2010,12,15,201004,2010),('2010-04-13',201015,4,2010,13,15,201004,2010),('2010-04-14',201015,4,2010,14,15,201004,2010),('2010-04-15',201015,4,2010,15,15,201004,2010),('2010-04-16',201015,4,2010,16,15,201004,2010),('2010-04-17',201015,4,2010,17,15,201004,2010),('2010-04-18',201016,4,2010,18,16,201004,2010),('2010-04-19',201016,4,2010,19,16,201004,2010),('2010-04-20',201016,4,2010,20,16,201004,2010),('2010-04-21',201016,4,2010,21,16,201004,2010),('2010-04-22',201016,4,2010,22,16,201004,2010),('2010-04-23',201016,4,2010,23,16,201004,2010),('2010-04-24',201016,4,2010,24,16,201004,2010),('2010-04-25',201017,4,2010,25,17,201004,2010),('2010-04-26',201017,4,2010,26,17,201004,2010),('2010-04-27',201017,4,2010,27,17,201004,2010),('2010-04-28',201017,4,2010,28,17,201004,2010),('2010-04-29',201017,4,2010,29,17,201004,2010),('2010-04-30',201017,4,2010,30,17,201004,2010),('2010-05-01',201017,5,2010,1,17,201005,2010),('2010-05-02',201018,5,2010,2,18,201005,2010),('2010-05-03',201018,5,2010,3,18,201005,2010),('2010-05-04',201018,5,2010,4,18,201005,2010),('2010-05-05',201018,5,2010,5,18,201005,2010),('2010-05-06',201018,5,2010,6,18,201005,2010),('2010-05-07',201018,5,2010,7,18,201005,2010),('2010-05-08',201018,5,2010,8,18,201005,2010),('2010-05-09',201019,5,2010,9,19,201005,2010),('2010-05-10',201019,5,2010,10,19,201005,2010),('2010-05-11',201019,5,2010,11,19,201005,2010),('2010-05-12',201019,5,2010,12,19,201005,2010),('2010-05-13',201019,5,2010,13,19,201005,2010),('2010-05-14',201019,5,2010,14,19,201005,2010),('2010-05-15',201019,5,2010,15,19,201005,2010),('2010-05-16',201020,5,2010,16,20,201005,2010),('2010-05-17',201020,5,2010,17,20,201005,2010),('2010-05-18',201020,5,2010,18,20,201005,2010),('2010-05-19',201020,5,2010,19,20,201005,2010),('2010-05-20',201020,5,2010,20,20,201005,2010),('2010-05-21',201020,5,2010,21,20,201005,2010),('2010-05-22',201020,5,2010,22,20,201005,2010),('2010-05-23',201021,5,2010,23,21,201005,2010),('2010-05-24',201021,5,2010,24,21,201005,2010),('2010-05-25',201021,5,2010,25,21,201005,2010),('2010-05-26',201021,5,2010,26,21,201005,2010),('2010-05-27',201021,5,2010,27,21,201005,2010),('2010-05-28',201021,5,2010,28,21,201005,2010),('2010-05-29',201021,5,2010,29,21,201005,2010),('2010-05-30',201022,5,2010,30,22,201005,2010),('2010-05-31',201022,5,2010,31,22,201005,2010),('2010-06-01',201022,6,2010,1,22,201006,2010),('2010-06-02',201022,6,2010,2,22,201006,2010),('2010-06-03',201022,6,2010,3,22,201006,2010),('2010-06-04',201022,6,2010,4,22,201006,2010),('2010-06-05',201022,6,2010,5,22,201006,2010),('2010-06-06',201023,6,2010,6,23,201006,2010),('2010-06-07',201023,6,2010,7,23,201006,2010),('2010-06-08',201023,6,2010,8,23,201006,2010),('2010-06-09',201023,6,2010,9,23,201006,2010),('2010-06-10',201023,6,2010,10,23,201006,2010),('2010-06-11',201023,6,2010,11,23,201006,2010),('2010-06-12',201023,6,2010,12,23,201006,2010),('2010-06-13',201024,6,2010,13,24,201006,2010),('2010-06-14',201024,6,2010,14,24,201006,2010),('2010-06-15',201024,6,2010,15,24,201006,2010),('2010-06-16',201024,6,2010,16,24,201006,2010),('2010-06-17',201024,6,2010,17,24,201006,2010),('2010-06-18',201024,6,2010,18,24,201006,2010),('2010-06-19',201024,6,2010,19,24,201006,2010),('2010-06-20',201025,6,2010,20,25,201006,2010),('2010-06-21',201025,6,2010,21,25,201006,2010),('2010-06-22',201025,6,2010,22,25,201006,2010),('2010-06-23',201025,6,2010,23,25,201006,2010),('2010-06-24',201025,6,2010,24,25,201006,2010),('2010-06-25',201025,6,2010,25,25,201006,2010),('2010-06-26',201025,6,2010,26,25,201006,2010),('2010-06-27',201026,6,2010,27,26,201006,2010),('2010-06-28',201026,6,2010,28,26,201006,2010),('2010-06-29',201026,6,2010,29,26,201006,2010),('2010-06-30',201026,6,2010,30,26,201006,2010),('2010-07-01',201026,7,2010,1,26,201007,2010),('2010-07-02',201026,7,2010,2,26,201007,2010),('2010-07-03',201026,7,2010,3,26,201007,2010),('2010-07-04',201027,7,2010,4,27,201007,2010),('2010-07-05',201027,7,2010,5,27,201007,2010),('2010-07-06',201027,7,2010,6,27,201007,2010),('2010-07-07',201027,7,2010,7,27,201007,2010),('2010-07-08',201027,7,2010,8,27,201007,2010),('2010-07-09',201027,7,2010,9,27,201007,2010),('2010-07-10',201027,7,2010,10,27,201007,2010),('2010-07-11',201028,7,2010,11,28,201007,2010),('2010-07-12',201028,7,2010,12,28,201007,2010),('2010-07-13',201028,7,2010,13,28,201007,2010),('2010-07-14',201028,7,2010,14,28,201007,2010),('2010-07-15',201028,7,2010,15,28,201007,2010),('2010-07-16',201028,7,2010,16,28,201007,2010),('2010-07-17',201028,7,2010,17,28,201007,2010),('2010-07-18',201029,7,2010,18,29,201007,2010),('2010-07-19',201029,7,2010,19,29,201007,2010),('2010-07-20',201029,7,2010,20,29,201007,2010),('2010-07-21',201029,7,2010,21,29,201007,2010),('2010-07-22',201029,7,2010,22,29,201007,2010),('2010-07-23',201029,7,2010,23,29,201007,2010),('2010-07-24',201029,7,2010,24,29,201007,2010),('2010-07-25',201030,7,2010,25,30,201007,2010),('2010-07-26',201030,7,2010,26,30,201007,2010),('2010-07-27',201030,7,2010,27,30,201007,2010),('2010-07-28',201030,7,2010,28,30,201007,2010),('2010-07-29',201030,7,2010,29,30,201007,2010),('2010-07-30',201030,7,2010,30,30,201007,2010),('2010-07-31',201030,7,2010,31,30,201007,2010),('2010-08-01',201031,8,2010,1,31,201008,2010),('2010-08-02',201031,8,2010,2,31,201008,2010),('2010-08-03',201031,8,2010,3,31,201008,2010),('2010-08-04',201031,8,2010,4,31,201008,2010),('2010-08-05',201031,8,2010,5,31,201008,2010),('2010-08-06',201031,8,2010,6,31,201008,2010),('2010-08-07',201031,8,2010,7,31,201008,2010),('2010-08-08',201032,8,2010,8,32,201008,2010),('2010-08-09',201032,8,2010,9,32,201008,2010),('2010-08-10',201032,8,2010,10,32,201008,2010),('2010-08-11',201032,8,2010,11,32,201008,2010),('2010-08-12',201032,8,2010,12,32,201008,2010),('2010-08-13',201032,8,2010,13,32,201008,2010),('2010-08-14',201032,8,2010,14,32,201008,2010),('2010-08-15',201033,8,2010,15,33,201008,2010),('2010-08-16',201033,8,2010,16,33,201008,2010),('2010-08-17',201033,8,2010,17,33,201008,2010),('2010-08-18',201033,8,2010,18,33,201008,2010),('2010-08-19',201033,8,2010,19,33,201008,2010),('2010-08-20',201033,8,2010,20,33,201008,2010),('2010-08-21',201033,8,2010,21,33,201008,2010),('2010-08-22',201034,8,2010,22,34,201008,2010),('2010-08-23',201034,8,2010,23,34,201008,2010),('2010-08-24',201034,8,2010,24,34,201008,2010),('2010-08-25',201034,8,2010,25,34,201008,2010),('2010-08-26',201034,8,2010,26,34,201008,2010),('2010-08-27',201034,8,2010,27,34,201008,2010),('2010-08-28',201034,8,2010,28,34,201008,2010),('2010-08-29',201035,8,2010,29,35,201008,2010),('2010-08-30',201035,8,2010,30,35,201008,2010),('2010-08-31',201035,8,2010,31,35,201008,2010),('2010-09-01',201035,9,2010,1,35,201009,2010),('2010-09-02',201035,9,2010,2,35,201009,2010),('2010-09-03',201035,9,2010,3,35,201009,2010),('2010-09-04',201035,9,2010,4,35,201009,2010),('2010-09-05',201036,9,2010,5,36,201009,2010),('2010-09-06',201036,9,2010,6,36,201009,2010),('2010-09-07',201036,9,2010,7,36,201009,2010),('2010-09-08',201036,9,2010,8,36,201009,2010),('2010-09-09',201036,9,2010,9,36,201009,2010),('2010-09-10',201036,9,2010,10,36,201009,2010),('2010-09-11',201036,9,2010,11,36,201009,2010),('2010-09-12',201037,9,2010,12,37,201009,2010),('2010-09-13',201037,9,2010,13,37,201009,2010),('2010-09-14',201037,9,2010,14,37,201009,2010),('2010-09-15',201037,9,2010,15,37,201009,2010),('2010-09-16',201037,9,2010,16,37,201009,2010),('2010-09-17',201037,9,2010,17,37,201009,2010),('2010-09-18',201037,9,2010,18,37,201009,2010),('2010-09-19',201038,9,2010,19,38,201009,2010),('2010-09-20',201038,9,2010,20,38,201009,2010),('2010-09-21',201038,9,2010,21,38,201009,2010),('2010-09-22',201038,9,2010,22,38,201009,2010),('2010-09-23',201038,9,2010,23,38,201009,2010),('2010-09-24',201038,9,2010,24,38,201009,2010),('2010-09-25',201038,9,2010,25,38,201009,2010),('2010-09-26',201039,9,2010,26,39,201009,2010),('2010-09-27',201039,9,2010,27,39,201009,2010),('2010-09-28',201039,9,2010,28,39,201009,2010),('2010-09-29',201039,9,2010,29,39,201009,2010),('2010-09-30',201039,9,2010,30,39,201009,2010),('2010-10-01',201039,10,2010,1,39,201010,2010),('2010-10-02',201039,10,2010,2,39,201010,2010),('2010-10-03',201040,10,2010,3,40,201010,2010),('2010-10-04',201040,10,2010,4,40,201010,2010),('2010-10-05',201040,10,2010,5,40,201010,2010),('2010-10-06',201040,10,2010,6,40,201010,2010),('2010-10-07',201040,10,2010,7,40,201010,2010),('2010-10-08',201040,10,2010,8,40,201010,2010),('2010-10-09',201040,10,2010,9,40,201010,2010),('2010-10-10',201041,10,2010,10,41,201010,2010),('2010-10-11',201041,10,2010,11,41,201010,2010),('2010-10-12',201041,10,2010,12,41,201010,2010),('2010-10-13',201041,10,2010,13,41,201010,2010),('2010-10-14',201041,10,2010,14,41,201010,2010),('2010-10-15',201041,10,2010,15,41,201010,2010),('2010-10-16',201041,10,2010,16,41,201010,2010),('2010-10-17',201042,10,2010,17,42,201010,2010),('2010-10-18',201042,10,2010,18,42,201010,2010),('2010-10-19',201042,10,2010,19,42,201010,2010),('2010-10-20',201042,10,2010,20,42,201010,2010),('2010-10-21',201042,10,2010,21,42,201010,2010),('2010-10-22',201042,10,2010,22,42,201010,2010),('2010-10-23',201042,10,2010,23,42,201010,2010),('2010-10-24',201043,10,2010,24,43,201010,2010),('2010-10-25',201043,10,2010,25,43,201010,2010),('2010-10-26',201043,10,2010,26,43,201010,2010),('2010-10-27',201043,10,2010,27,43,201010,2010),('2010-10-28',201043,10,2010,28,43,201010,2010),('2010-10-29',201043,10,2010,29,43,201010,2010),('2010-10-30',201043,10,2010,30,43,201010,2010),('2010-10-31',201044,10,2010,31,44,201010,2010),('2010-11-01',201044,11,2010,1,44,201011,2010),('2010-11-02',201044,11,2010,2,44,201011,2010),('2010-11-03',201044,11,2010,3,44,201011,2010),('2010-11-04',201044,11,2010,4,44,201011,2010),('2010-11-05',201044,11,2010,5,44,201011,2010),('2010-11-06',201044,11,2010,6,44,201011,2010),('2010-11-07',201045,11,2010,7,45,201011,2010),('2010-11-08',201045,11,2010,8,45,201011,2010),('2010-11-09',201045,11,2010,9,45,201011,2010),('2010-11-10',201045,11,2010,10,45,201011,2010),('2010-11-11',201045,11,2010,11,45,201011,2010),('2010-11-12',201045,11,2010,12,45,201011,2010),('2010-11-13',201045,11,2010,13,45,201011,2010),('2010-11-14',201046,11,2010,14,46,201011,2010),('2010-11-15',201046,11,2010,15,46,201011,2010),('2010-11-16',201046,11,2010,16,46,201011,2010),('2010-11-17',201046,11,2010,17,46,201011,2010),('2010-11-18',201046,11,2010,18,46,201011,2010),('2010-11-19',201046,11,2010,19,46,201011,2010),('2010-11-20',201046,11,2010,20,46,201011,2010),('2010-11-21',201047,11,2010,21,47,201011,2010),('2010-11-22',201047,11,2010,22,47,201011,2010),('2010-11-23',201047,11,2010,23,47,201011,2010),('2010-11-24',201047,11,2010,24,47,201011,2010),('2010-11-25',201047,11,2010,25,47,201011,2010),('2010-11-26',201047,11,2010,26,47,201011,2010),('2010-11-27',201047,11,2010,27,47,201011,2010),('2010-11-28',201048,11,2010,28,48,201011,2010),('2010-11-29',201048,11,2010,29,48,201011,2010),('2010-11-30',201048,11,2010,30,48,201011,2010),('2010-12-01',201048,12,2010,1,48,201012,2011),('2010-12-02',201048,12,2010,2,48,201012,2011),('2010-12-03',201048,12,2010,3,48,201012,2011),('2010-12-04',201048,12,2010,4,48,201012,2011),('2010-12-05',201049,12,2010,5,49,201012,2011),('2010-12-06',201049,12,2010,6,49,201012,2011),('2010-12-07',201049,12,2010,7,49,201012,2011),('2010-12-08',201049,12,2010,8,49,201012,2011),('2010-12-09',201049,12,2010,9,49,201012,2011),('2010-12-10',201049,12,2010,10,49,201012,2011),('2010-12-11',201049,12,2010,11,49,201012,2011),('2010-12-12',201050,12,2010,12,50,201012,2011),('2010-12-13',201050,12,2010,13,50,201012,2011),('2010-12-14',201050,12,2010,14,50,201012,2011),('2010-12-15',201050,12,2010,15,50,201012,2011),('2010-12-16',201050,12,2010,16,50,201012,2011),('2010-12-17',201050,12,2010,17,50,201012,2011),('2010-12-18',201050,12,2010,18,50,201012,2011),('2010-12-19',201051,12,2010,19,51,201012,2011),('2010-12-20',201051,12,2010,20,51,201012,2011),('2010-12-21',201051,12,2010,21,51,201012,2011),('2010-12-22',201051,12,2010,22,51,201012,2011),('2010-12-23',201051,12,2010,23,51,201012,2011),('2010-12-24',201051,12,2010,24,51,201012,2011),('2010-12-25',201051,12,2010,25,51,201012,2011),('2010-12-26',201052,12,2010,26,52,201012,2011),('2010-12-27',201052,12,2010,27,52,201012,2011),('2010-12-28',201052,12,2010,28,52,201012,2011),('2010-12-29',201052,12,2010,29,52,201012,2011),('2010-12-30',201052,12,2010,30,52,201012,2011),('2010-12-31',201052,12,2010,31,52,201012,2011),('2011-01-01',201052,1,2011,1,52,201101,2011),('2011-01-02',201053,1,2011,2,1,201101,2011),('2011-01-03',201101,1,2011,3,1,201101,2011),('2011-01-04',201101,1,2011,4,1,201101,2011),('2011-01-05',201101,1,2011,5,1,201101,2011),('2011-01-06',201101,1,2011,6,1,201101,2011),('2011-01-07',201101,1,2011,7,1,201101,2011),('2011-01-08',201101,1,2011,8,1,201101,2011),('2011-01-09',201102,1,2011,9,2,201101,2011),('2011-01-10',201102,1,2011,10,2,201101,2011),('2011-01-11',201102,1,2011,11,2,201101,2011),('2011-01-12',201102,1,2011,12,2,201101,2011),('2011-01-13',201102,1,2011,13,2,201101,2011),('2011-01-14',201102,1,2011,14,2,201101,2011),('2011-01-15',201102,1,2011,15,2,201101,2011),('2011-01-16',201103,1,2011,16,3,201101,2011),('2011-01-17',201103,1,2011,17,3,201101,2011),('2011-01-18',201103,1,2011,18,3,201101,2011),('2011-01-19',201103,1,2011,19,3,201101,2011),('2011-01-20',201103,1,2011,20,3,201101,2011),('2011-01-21',201103,1,2011,21,3,201101,2011),('2011-01-22',201103,1,2011,22,3,201101,2011),('2011-01-23',201104,1,2011,23,4,201101,2011),('2011-01-24',201104,1,2011,24,4,201101,2011),('2011-01-25',201104,1,2011,25,4,201101,2011),('2011-01-26',201104,1,2011,26,4,201101,2011),('2011-01-27',201104,1,2011,27,4,201101,2011),('2011-01-28',201104,1,2011,28,4,201101,2011),('2011-01-29',201104,1,2011,29,4,201101,2011),('2011-01-30',201105,1,2011,30,5,201101,2011),('2011-01-31',201105,1,2011,31,5,201101,2011),('2011-02-01',201105,2,2011,1,5,201102,2011),('2011-02-02',201105,2,2011,2,5,201102,2011),('2011-02-03',201105,2,2011,3,5,201102,2011),('2011-02-04',201105,2,2011,4,5,201102,2011),('2011-02-05',201105,2,2011,5,5,201102,2011),('2011-02-06',201106,2,2011,6,6,201102,2011),('2011-02-07',201106,2,2011,7,6,201102,2011),('2011-02-08',201106,2,2011,8,6,201102,2011),('2011-02-09',201106,2,2011,9,6,201102,2011),('2011-02-10',201106,2,2011,10,6,201102,2011),('2011-02-11',201106,2,2011,11,6,201102,2011),('2011-02-12',201106,2,2011,12,6,201102,2011),('2011-02-13',201107,2,2011,13,7,201102,2011),('2011-02-14',201107,2,2011,14,7,201102,2011),('2011-02-15',201107,2,2011,15,7,201102,2011),('2011-02-16',201107,2,2011,16,7,201102,2011),('2011-02-17',201107,2,2011,17,7,201102,2011),('2011-02-18',201107,2,2011,18,7,201102,2011),('2011-02-19',201107,2,2011,19,7,201102,2011),('2011-02-20',201108,2,2011,20,8,201102,2011),('2011-02-21',201108,2,2011,21,8,201102,2011),('2011-02-22',201108,2,2011,22,8,201102,2011),('2011-02-23',201108,2,2011,23,8,201102,2011),('2011-02-24',201108,2,2011,24,8,201102,2011),('2011-02-25',201108,2,2011,25,8,201102,2011),('2011-02-26',201108,2,2011,26,8,201102,2011),('2011-02-27',201109,2,2011,27,9,201102,2011),('2011-02-28',201109,2,2011,28,9,201102,2011),('2011-03-01',201109,3,2011,1,9,201103,2011),('2011-03-02',201109,3,2011,2,9,201103,2011),('2011-03-03',201109,3,2011,3,9,201103,2011),('2011-03-04',201109,3,2011,4,9,201103,2011),('2011-03-05',201109,3,2011,5,9,201103,2011),('2011-03-06',201110,3,2011,6,10,201103,2011),('2011-03-07',201110,3,2011,7,10,201103,2011),('2011-03-08',201110,3,2011,8,10,201103,2011),('2011-03-09',201110,3,2011,9,10,201103,2011),('2011-03-10',201110,3,2011,10,10,201103,2011),('2011-03-11',201110,3,2011,11,10,201103,2011),('2011-03-12',201110,3,2011,12,10,201103,2011),('2011-03-13',201111,3,2011,13,11,201103,2011),('2011-03-14',201111,3,2011,14,11,201103,2011),('2011-03-15',201111,3,2011,15,11,201103,2011),('2011-03-16',201111,3,2011,16,11,201103,2011),('2011-03-17',201111,3,2011,17,11,201103,2011),('2011-03-18',201111,3,2011,18,11,201103,2011),('2011-03-19',201111,3,2011,19,11,201103,2011),('2011-03-20',201112,3,2011,20,12,201103,2011),('2011-03-21',201112,3,2011,21,12,201103,2011),('2011-03-22',201112,3,2011,22,12,201103,2011),('2011-03-23',201112,3,2011,23,12,201103,2011),('2011-03-24',201112,3,2011,24,12,201103,2011),('2011-03-25',201112,3,2011,25,12,201103,2011),('2011-03-26',201112,3,2011,26,12,201103,2011),('2011-03-27',201113,3,2011,27,13,201103,2011),('2011-03-28',201113,3,2011,28,13,201103,2011),('2011-03-29',201113,3,2011,29,13,201103,2011),('2011-03-30',201113,3,2011,30,13,201103,2011),('2011-03-31',201113,3,2011,31,13,201103,2011),('2011-04-01',201113,4,2011,1,13,201104,2011),('2011-04-02',201113,4,2011,2,13,201104,2011),('2011-04-03',201114,4,2011,3,14,201104,2011),('2011-04-04',201114,4,2011,4,14,201104,2011),('2011-04-05',201114,4,2011,5,14,201104,2011),('2011-04-06',201114,4,2011,6,14,201104,2011),('2011-04-07',201114,4,2011,7,14,201104,2011),('2011-04-08',201114,4,2011,8,14,201104,2011),('2011-04-09',201114,4,2011,9,14,201104,2011),('2011-04-10',201115,4,2011,10,15,201104,2011),('2011-04-11',201115,4,2011,11,15,201104,2011),('2011-04-12',201115,4,2011,12,15,201104,2011),('2011-04-13',201115,4,2011,13,15,201104,2011),('2011-04-14',201115,4,2011,14,15,201104,2011),('2011-04-15',201115,4,2011,15,15,201104,2011),('2011-04-16',201115,4,2011,16,15,201104,2011),('2011-04-17',201116,4,2011,17,16,201104,2011),('2011-04-18',201116,4,2011,18,16,201104,2011),('2011-04-19',201116,4,2011,19,16,201104,2011),('2011-04-20',201116,4,2011,20,16,201104,2011),('2011-04-21',201116,4,2011,21,16,201104,2011),('2011-04-22',201116,4,2011,22,16,201104,2011),('2011-04-23',201116,4,2011,23,16,201104,2011),('2011-04-24',201117,4,2011,24,17,201104,2011),('2011-04-25',201117,4,2011,25,17,201104,2011),('2011-04-26',201117,4,2011,26,17,201104,2011),('2011-04-27',201117,4,2011,27,17,201104,2011),('2011-04-28',201117,4,2011,28,17,201104,2011),('2011-04-29',201117,4,2011,29,17,201104,2011),('2011-04-30',201117,4,2011,30,17,201104,2011),('2011-05-01',201118,5,2011,1,18,201105,2011),('2011-05-02',201118,5,2011,2,18,201105,2011),('2011-05-03',201118,5,2011,3,18,201105,2011),('2011-05-04',201118,5,2011,4,18,201105,2011),('2011-05-05',201118,5,2011,5,18,201105,2011),('2011-05-06',201118,5,2011,6,18,201105,2011),('2011-05-07',201118,5,2011,7,18,201105,2011),('2011-05-08',201119,5,2011,8,19,201105,2011),('2011-05-09',201119,5,2011,9,19,201105,2011),('2011-05-10',201119,5,2011,10,19,201105,2011),('2011-05-11',201119,5,2011,11,19,201105,2011),('2011-05-12',201119,5,2011,12,19,201105,2011),('2011-05-13',201119,5,2011,13,19,201105,2011),('2011-05-14',201119,5,2011,14,19,201105,2011),('2011-05-15',201120,5,2011,15,20,201105,2011),('2011-05-16',201120,5,2011,16,20,201105,2011),('2011-05-17',201120,5,2011,17,20,201105,2011),('2011-05-18',201120,5,2011,18,20,201105,2011),('2011-05-19',201120,5,2011,19,20,201105,2011),('2011-05-20',201120,5,2011,20,20,201105,2011),('2011-05-21',201120,5,2011,21,20,201105,2011),('2011-05-22',201121,5,2011,22,21,201105,2011),('2011-05-23',201121,5,2011,23,21,201105,2011),('2011-05-24',201121,5,2011,24,21,201105,2011),('2011-05-25',201121,5,2011,25,21,201105,2011),('2011-05-26',201121,5,2011,26,21,201105,2011),('2011-05-27',201121,5,2011,27,21,201105,2011),('2011-05-28',201121,5,2011,28,21,201105,2011),('2011-05-29',201122,5,2011,29,22,201105,2011),('2011-05-30',201122,5,2011,30,22,201105,2011),('2011-05-31',201122,5,2011,31,22,201105,2011),('2011-06-01',201122,6,2011,1,22,201106,2011),('2011-06-02',201122,6,2011,2,22,201106,2011),('2011-06-03',201122,6,2011,3,22,201106,2011),('2011-06-04',201122,6,2011,4,22,201106,2011),('2011-06-05',201123,6,2011,5,23,201106,2011),('2011-06-06',201123,6,2011,6,23,201106,2011),('2011-06-07',201123,6,2011,7,23,201106,2011),('2011-06-08',201123,6,2011,8,23,201106,2011),('2011-06-09',201123,6,2011,9,23,201106,2011),('2011-06-10',201123,6,2011,10,23,201106,2011),('2011-06-11',201123,6,2011,11,23,201106,2011),('2011-06-12',201124,6,2011,12,24,201106,2011),('2011-06-13',201124,6,2011,13,24,201106,2011),('2011-06-14',201124,6,2011,14,24,201106,2011),('2011-06-15',201124,6,2011,15,24,201106,2011),('2011-06-16',201124,6,2011,16,24,201106,2011),('2011-06-17',201124,6,2011,17,24,201106,2011),('2011-06-18',201124,6,2011,18,24,201106,2011),('2011-06-19',201125,6,2011,19,25,201106,2011),('2011-06-20',201125,6,2011,20,25,201106,2011),('2011-06-21',201125,6,2011,21,25,201106,2011),('2011-06-22',201125,6,2011,22,25,201106,2011),('2011-06-23',201125,6,2011,23,25,201106,2011),('2011-06-24',201125,6,2011,24,25,201106,2011),('2011-06-25',201125,6,2011,25,25,201106,2011),('2011-06-26',201126,6,2011,26,26,201106,2011),('2011-06-27',201126,6,2011,27,26,201106,2011),('2011-06-28',201126,6,2011,28,26,201106,2011),('2011-06-29',201126,6,2011,29,26,201106,2011),('2011-06-30',201126,6,2011,30,26,201106,2011),('2011-07-01',201126,7,2011,1,26,201107,2011),('2011-07-02',201126,7,2011,2,26,201107,2011),('2011-07-03',201127,7,2011,3,27,201107,2011),('2011-07-04',201127,7,2011,4,27,201107,2011),('2011-07-05',201127,7,2011,5,27,201107,2011),('2011-07-06',201127,7,2011,6,27,201107,2011),('2011-07-07',201127,7,2011,7,27,201107,2011),('2011-07-08',201127,7,2011,8,27,201107,2011),('2011-07-09',201127,7,2011,9,27,201107,2011),('2011-07-10',201128,7,2011,10,28,201107,2011),('2011-07-11',201128,7,2011,11,28,201107,2011),('2011-07-12',201128,7,2011,12,28,201107,2011),('2011-07-13',201128,7,2011,13,28,201107,2011),('2011-07-14',201128,7,2011,14,28,201107,2011),('2011-07-15',201128,7,2011,15,28,201107,2011),('2011-07-16',201128,7,2011,16,28,201107,2011),('2011-07-17',201129,7,2011,17,29,201107,2011),('2011-07-18',201129,7,2011,18,29,201107,2011),('2011-07-19',201129,7,2011,19,29,201107,2011),('2011-07-20',201129,7,2011,20,29,201107,2011),('2011-07-21',201129,7,2011,21,29,201107,2011),('2011-07-22',201129,7,2011,22,29,201107,2011),('2011-07-23',201129,7,2011,23,29,201107,2011),('2011-07-24',201130,7,2011,24,30,201107,2011),('2011-07-25',201130,7,2011,25,30,201107,2011),('2011-07-26',201130,7,2011,26,30,201107,2011),('2011-07-27',201130,7,2011,27,30,201107,2011),('2011-07-28',201130,7,2011,28,30,201107,2011),('2011-07-29',201130,7,2011,29,30,201107,2011),('2011-07-30',201130,7,2011,30,30,201107,2011),('2011-07-31',201131,7,2011,31,31,201107,2011),('2011-08-01',201131,8,2011,1,31,201108,2011),('2011-08-02',201131,8,2011,2,31,201108,2011),('2011-08-03',201131,8,2011,3,31,201108,2011),('2011-08-04',201131,8,2011,4,31,201108,2011),('2011-08-05',201131,8,2011,5,31,201108,2011),('2011-08-06',201131,8,2011,6,31,201108,2011),('2011-08-07',201132,8,2011,7,32,201108,2011),('2011-08-08',201132,8,2011,8,32,201108,2011),('2011-08-09',201132,8,2011,9,32,201108,2011),('2011-08-10',201132,8,2011,10,32,201108,2011),('2011-08-11',201132,8,2011,11,32,201108,2011),('2011-08-12',201132,8,2011,12,32,201108,2011),('2011-08-13',201132,8,2011,13,32,201108,2011),('2011-08-14',201133,8,2011,14,33,201108,2011),('2011-08-15',201133,8,2011,15,33,201108,2011),('2011-08-16',201133,8,2011,16,33,201108,2011),('2011-08-17',201133,8,2011,17,33,201108,2011),('2011-08-18',201133,8,2011,18,33,201108,2011),('2011-08-19',201133,8,2011,19,33,201108,2011),('2011-08-20',201133,8,2011,20,33,201108,2011),('2011-08-21',201134,8,2011,21,34,201108,2011),('2011-08-22',201134,8,2011,22,34,201108,2011),('2011-08-23',201134,8,2011,23,34,201108,2011),('2011-08-24',201134,8,2011,24,34,201108,2011),('2011-08-25',201134,8,2011,25,34,201108,2011),('2011-08-26',201134,8,2011,26,34,201108,2011),('2011-08-27',201134,8,2011,27,34,201108,2011),('2011-08-28',201135,8,2011,28,35,201108,2011),('2011-08-29',201135,8,2011,29,35,201108,2011),('2011-08-30',201135,8,2011,30,35,201108,2011),('2011-08-31',201135,8,2011,31,35,201108,2011),('2011-09-01',201135,9,2011,1,35,201109,2011),('2011-09-02',201135,9,2011,2,35,201109,2011),('2011-09-03',201135,9,2011,3,35,201109,2011),('2011-09-04',201136,9,2011,4,36,201109,2011),('2011-09-05',201136,9,2011,5,36,201109,2011),('2011-09-06',201136,9,2011,6,36,201109,2011),('2011-09-07',201136,9,2011,7,36,201109,2011),('2011-09-08',201136,9,2011,8,36,201109,2011),('2011-09-09',201136,9,2011,9,36,201109,2011),('2011-09-10',201136,9,2011,10,36,201109,2011),('2011-09-11',201137,9,2011,11,37,201109,2011),('2011-09-12',201137,9,2011,12,37,201109,2011),('2011-09-13',201137,9,2011,13,37,201109,2011),('2011-09-14',201137,9,2011,14,37,201109,2011),('2011-09-15',201137,9,2011,15,37,201109,2011),('2011-09-16',201137,9,2011,16,37,201109,2011),('2011-09-17',201137,9,2011,17,37,201109,2011),('2011-09-18',201138,9,2011,18,38,201109,2011),('2011-09-19',201138,9,2011,19,38,201109,2011),('2011-09-20',201138,9,2011,20,38,201109,2011),('2011-09-21',201138,9,2011,21,38,201109,2011),('2011-09-22',201138,9,2011,22,38,201109,2011),('2011-09-23',201138,9,2011,23,38,201109,2011),('2011-09-24',201138,9,2011,24,38,201109,2011),('2011-09-25',201139,9,2011,25,39,201109,2011),('2011-09-26',201139,9,2011,26,39,201109,2011),('2011-09-27',201139,9,2011,27,39,201109,2011),('2011-09-28',201139,9,2011,28,39,201109,2011),('2011-09-29',201139,9,2011,29,39,201109,2011),('2011-09-30',201139,9,2011,30,39,201109,2011),('2011-10-01',201139,10,2011,1,39,201110,2011),('2011-10-02',201140,10,2011,2,40,201110,2011),('2011-10-03',201140,10,2011,3,40,201110,2011),('2011-10-04',201140,10,2011,4,40,201110,2011),('2011-10-05',201140,10,2011,5,40,201110,2011),('2011-10-06',201140,10,2011,6,40,201110,2011),('2011-10-07',201140,10,2011,7,40,201110,2011),('2011-10-08',201140,10,2011,8,40,201110,2011),('2011-10-09',201141,10,2011,9,41,201110,2011),('2011-10-10',201141,10,2011,10,41,201110,2011),('2011-10-11',201141,10,2011,11,41,201110,2011),('2011-10-12',201141,10,2011,12,41,201110,2011),('2011-10-13',201141,10,2011,13,41,201110,2011),('2011-10-14',201141,10,2011,14,41,201110,2011),('2011-10-15',201141,10,2011,15,41,201110,2011),('2011-10-16',201142,10,2011,16,42,201110,2011),('2011-10-17',201142,10,2011,17,42,201110,2011),('2011-10-18',201142,10,2011,18,42,201110,2011),('2011-10-19',201142,10,2011,19,42,201110,2011),('2011-10-20',201142,10,2011,20,42,201110,2011),('2011-10-21',201142,10,2011,21,42,201110,2011),('2011-10-22',201142,10,2011,22,42,201110,2011),('2011-10-23',201143,10,2011,23,43,201110,2011),('2011-10-24',201143,10,2011,24,43,201110,2011),('2011-10-25',201143,10,2011,25,43,201110,2011),('2011-10-26',201143,10,2011,26,43,201110,2011),('2011-10-27',201143,10,2011,27,43,201110,2011),('2011-10-28',201143,10,2011,28,43,201110,2011),('2011-10-29',201143,10,2011,29,43,201110,2011),('2011-10-30',201144,10,2011,30,44,201110,2011),('2011-10-31',201144,10,2011,31,44,201110,2011),('2011-11-01',201144,11,2011,1,44,201111,2011),('2011-11-02',201144,11,2011,2,44,201111,2011),('2011-11-03',201144,11,2011,3,44,201111,2011),('2011-11-04',201144,11,2011,4,44,201111,2011),('2011-11-05',201144,11,2011,5,44,201111,2011),('2011-11-06',201145,11,2011,6,45,201111,2011),('2011-11-07',201145,11,2011,7,45,201111,2011),('2011-11-08',201145,11,2011,8,45,201111,2011),('2011-11-09',201145,11,2011,9,45,201111,2011),('2011-11-10',201145,11,2011,10,45,201111,2011),('2011-11-11',201145,11,2011,11,45,201111,2011),('2011-11-12',201145,11,2011,12,45,201111,2011),('2011-11-13',201146,11,2011,13,46,201111,2011),('2011-11-14',201146,11,2011,14,46,201111,2011),('2011-11-15',201146,11,2011,15,46,201111,2011),('2011-11-16',201146,11,2011,16,46,201111,2011),('2011-11-17',201146,11,2011,17,46,201111,2011),('2011-11-18',201146,11,2011,18,46,201111,2011),('2011-11-19',201146,11,2011,19,46,201111,2011),('2011-11-20',201147,11,2011,20,47,201111,2011),('2011-11-21',201147,11,2011,21,47,201111,2011),('2011-11-22',201147,11,2011,22,47,201111,2011),('2011-11-23',201147,11,2011,23,47,201111,2011),('2011-11-24',201147,11,2011,24,47,201111,2011),('2011-11-25',201147,11,2011,25,47,201111,2011),('2011-11-26',201147,11,2011,26,47,201111,2011),('2011-11-27',201148,11,2011,27,48,201111,2011),('2011-11-28',201148,11,2011,28,48,201111,2011),('2011-11-29',201148,11,2011,29,48,201111,2011),('2011-11-30',201148,11,2011,30,48,201111,2011),('2011-12-01',201148,12,2011,1,48,201112,2012),('2011-12-02',201148,12,2011,2,48,201112,2012),('2011-12-03',201148,12,2011,3,48,201112,2012),('2011-12-04',201149,12,2011,4,49,201112,2012),('2011-12-05',201149,12,2011,5,49,201112,2012),('2011-12-06',201149,12,2011,6,49,201112,2012),('2011-12-07',201149,12,2011,7,49,201112,2012),('2011-12-08',201149,12,2011,8,49,201112,2012),('2011-12-09',201149,12,2011,9,49,201112,2012),('2011-12-10',201149,12,2011,10,49,201112,2012),('2011-12-11',201150,12,2011,11,50,201112,2012),('2011-12-12',201150,12,2011,12,50,201112,2012),('2011-12-13',201150,12,2011,13,50,201112,2012),('2011-12-14',201150,12,2011,14,50,201112,2012),('2011-12-15',201150,12,2011,15,50,201112,2012),('2011-12-16',201150,12,2011,16,50,201112,2012),('2011-12-17',201150,12,2011,17,50,201112,2012),('2011-12-18',201151,12,2011,18,51,201112,2012),('2011-12-19',201151,12,2011,19,51,201112,2012),('2011-12-20',201151,12,2011,20,51,201112,2012),('2011-12-21',201151,12,2011,21,51,201112,2012),('2011-12-22',201151,12,2011,22,51,201112,2012),('2011-12-23',201151,12,2011,23,51,201112,2012),('2011-12-24',201151,12,2011,24,51,201112,2012),('2011-12-25',201152,12,2011,25,52,201112,2012),('2011-12-26',201152,12,2011,26,52,201112,2012),('2011-12-27',201152,12,2011,27,52,201112,2012),('2011-12-28',201152,12,2011,28,52,201112,2012),('2011-12-29',201152,12,2011,29,52,201112,2012),('2011-12-30',201152,12,2011,30,52,201112,2012),('2011-12-31',201152,12,2011,31,52,201112,2012),('2012-01-01',201153,1,2012,1,1,201201,2012),('2012-01-02',201201,1,2012,2,1,201201,2012),('2012-01-03',201201,1,2012,3,1,201201,2012),('2012-01-04',201201,1,2012,4,1,201201,2012),('2012-01-05',201201,1,2012,5,1,201201,2012),('2012-01-06',201201,1,2012,6,1,201201,2012),('2012-01-07',201201,1,2012,7,1,201201,2012),('2012-01-08',201202,1,2012,8,2,201201,2012),('2012-01-09',201202,1,2012,9,2,201201,2012),('2012-01-10',201202,1,2012,10,2,201201,2012),('2012-01-11',201202,1,2012,11,2,201201,2012),('2012-01-12',201202,1,2012,12,2,201201,2012),('2012-01-13',201202,1,2012,13,2,201201,2012),('2012-01-14',201202,1,2012,14,2,201201,2012),('2012-01-15',201203,1,2012,15,3,201201,2012),('2012-01-16',201203,1,2012,16,3,201201,2012),('2012-01-17',201203,1,2012,17,3,201201,2012),('2012-01-18',201203,1,2012,18,3,201201,2012),('2012-01-19',201203,1,2012,19,3,201201,2012),('2012-01-20',201203,1,2012,20,3,201201,2012),('2012-01-21',201203,1,2012,21,3,201201,2012),('2012-01-22',201204,1,2012,22,4,201201,2012),('2012-01-23',201204,1,2012,23,4,201201,2012),('2012-01-24',201204,1,2012,24,4,201201,2012),('2012-01-25',201204,1,2012,25,4,201201,2012),('2012-01-26',201204,1,2012,26,4,201201,2012),('2012-01-27',201204,1,2012,27,4,201201,2012),('2012-01-28',201204,1,2012,28,4,201201,2012),('2012-01-29',201205,1,2012,29,5,201201,2012),('2012-01-30',201205,1,2012,30,5,201201,2012),('2012-01-31',201205,1,2012,31,5,201201,2012),('2012-02-01',201205,2,2012,1,5,201202,2012),('2012-02-02',201205,2,2012,2,5,201202,2012),('2012-02-03',201205,2,2012,3,5,201202,2012),('2012-02-04',201205,2,2012,4,5,201202,2012),('2012-02-05',201206,2,2012,5,6,201202,2012),('2012-02-06',201206,2,2012,6,6,201202,2012),('2012-02-07',201206,2,2012,7,6,201202,2012),('2012-02-08',201206,2,2012,8,6,201202,2012),('2012-02-09',201206,2,2012,9,6,201202,2012),('2012-02-10',201206,2,2012,10,6,201202,2012),('2012-02-11',201206,2,2012,11,6,201202,2012),('2012-02-12',201207,2,2012,12,7,201202,2012),('2012-02-13',201207,2,2012,13,7,201202,2012),('2012-02-14',201207,2,2012,14,7,201202,2012),('2012-02-15',201207,2,2012,15,7,201202,2012),('2012-02-16',201207,2,2012,16,7,201202,2012),('2012-02-17',201207,2,2012,17,7,201202,2012),('2012-02-18',201207,2,2012,18,7,201202,2012),('2012-02-19',201208,2,2012,19,8,201202,2012),('2012-02-20',201208,2,2012,20,8,201202,2012),('2012-02-21',201208,2,2012,21,8,201202,2012),('2012-02-22',201208,2,2012,22,8,201202,2012),('2012-02-23',201208,2,2012,23,8,201202,2012),('2012-02-24',201208,2,2012,24,8,201202,2012),('2012-02-25',201208,2,2012,25,8,201202,2012),('2012-02-26',201209,2,2012,26,9,201202,2012),('2012-02-27',201209,2,2012,27,9,201202,2012),('2012-02-28',201209,2,2012,28,9,201202,2012),('2012-02-29',201209,2,2012,29,9,201202,2012),('2012-03-01',201209,3,2012,1,9,201203,2012),('2012-03-02',201209,3,2012,2,9,201203,2012),('2012-03-03',201209,3,2012,3,9,201203,2012),('2012-03-04',201210,3,2012,4,10,201203,2012),('2012-03-05',201210,3,2012,5,10,201203,2012),('2012-03-06',201210,3,2012,6,10,201203,2012),('2012-03-07',201210,3,2012,7,10,201203,2012),('2012-03-08',201210,3,2012,8,10,201203,2012),('2012-03-09',201210,3,2012,9,10,201203,2012),('2012-03-10',201210,3,2012,10,10,201203,2012),('2012-03-11',201211,3,2012,11,11,201203,2012),('2012-03-12',201211,3,2012,12,11,201203,2012),('2012-03-13',201211,3,2012,13,11,201203,2012),('2012-03-14',201211,3,2012,14,11,201203,2012),('2012-03-15',201211,3,2012,15,11,201203,2012),('2012-03-16',201211,3,2012,16,11,201203,2012),('2012-03-17',201211,3,2012,17,11,201203,2012),('2012-03-18',201212,3,2012,18,12,201203,2012),('2012-03-19',201212,3,2012,19,12,201203,2012),('2012-03-20',201212,3,2012,20,12,201203,2012),('2012-03-21',201212,3,2012,21,12,201203,2012),('2012-03-22',201212,3,2012,22,12,201203,2012),('2012-03-23',201212,3,2012,23,12,201203,2012),('2012-03-24',201212,3,2012,24,12,201203,2012),('2012-03-25',201213,3,2012,25,13,201203,2012),('2012-03-26',201213,3,2012,26,13,201203,2012),('2012-03-27',201213,3,2012,27,13,201203,2012),('2012-03-28',201213,3,2012,28,13,201203,2012),('2012-03-29',201213,3,2012,29,13,201203,2012),('2012-03-30',201213,3,2012,30,13,201203,2012),('2012-03-31',201213,3,2012,31,13,201203,2012),('2012-04-01',201214,4,2012,1,14,201204,2012),('2012-04-02',201214,4,2012,2,14,201204,2012),('2012-04-03',201214,4,2012,3,14,201204,2012),('2012-04-04',201214,4,2012,4,14,201204,2012),('2012-04-05',201214,4,2012,5,14,201204,2012),('2012-04-06',201214,4,2012,6,14,201204,2012),('2012-04-07',201214,4,2012,7,14,201204,2012),('2012-04-08',201215,4,2012,8,15,201204,2012),('2012-04-09',201215,4,2012,9,15,201204,2012),('2012-04-10',201215,4,2012,10,15,201204,2012),('2012-04-11',201215,4,2012,11,15,201204,2012),('2012-04-12',201215,4,2012,12,15,201204,2012),('2012-04-13',201215,4,2012,13,15,201204,2012),('2012-04-14',201215,4,2012,14,15,201204,2012),('2012-04-15',201216,4,2012,15,16,201204,2012),('2012-04-16',201216,4,2012,16,16,201204,2012),('2012-04-17',201216,4,2012,17,16,201204,2012),('2012-04-18',201216,4,2012,18,16,201204,2012),('2012-04-19',201216,4,2012,19,16,201204,2012),('2012-04-20',201216,4,2012,20,16,201204,2012),('2012-04-21',201216,4,2012,21,16,201204,2012),('2012-04-22',201217,4,2012,22,17,201204,2012),('2012-04-23',201217,4,2012,23,17,201204,2012),('2012-04-24',201217,4,2012,24,17,201204,2012),('2012-04-25',201217,4,2012,25,17,201204,2012),('2012-04-26',201217,4,2012,26,17,201204,2012),('2012-04-27',201217,4,2012,27,17,201204,2012),('2012-04-28',201217,4,2012,28,17,201204,2012),('2012-04-29',201218,4,2012,29,18,201204,2012),('2012-04-30',201218,4,2012,30,18,201204,2012),('2012-05-01',201218,5,2012,1,18,201205,2012),('2012-05-02',201218,5,2012,2,18,201205,2012),('2012-05-03',201218,5,2012,3,18,201205,2012),('2012-05-04',201218,5,2012,4,18,201205,2012),('2012-05-05',201218,5,2012,5,18,201205,2012),('2012-05-06',201219,5,2012,6,19,201205,2012),('2012-05-07',201219,5,2012,7,19,201205,2012),('2012-05-08',201219,5,2012,8,19,201205,2012),('2012-05-09',201219,5,2012,9,19,201205,2012),('2012-05-10',201219,5,2012,10,19,201205,2012),('2012-05-11',201219,5,2012,11,19,201205,2012),('2012-05-12',201219,5,2012,12,19,201205,2012),('2012-05-13',201220,5,2012,13,20,201205,2012),('2012-05-14',201220,5,2012,14,20,201205,2012),('2012-05-15',201220,5,2012,15,20,201205,2012),('2012-05-16',201220,5,2012,16,20,201205,2012),('2012-05-17',201220,5,2012,17,20,201205,2012),('2012-05-18',201220,5,2012,18,20,201205,2012),('2012-05-19',201220,5,2012,19,20,201205,2012),('2012-05-20',201221,5,2012,20,21,201205,2012),('2012-05-21',201221,5,2012,21,21,201205,2012),('2012-05-22',201221,5,2012,22,21,201205,2012),('2012-05-23',201221,5,2012,23,21,201205,2012),('2012-05-24',201221,5,2012,24,21,201205,2012),('2012-05-25',201221,5,2012,25,21,201205,2012),('2012-05-26',201221,5,2012,26,21,201205,2012),('2012-05-27',201222,5,2012,27,22,201205,2012),('2012-05-28',201222,5,2012,28,22,201205,2012),('2012-05-29',201222,5,2012,29,22,201205,2012),('2012-05-30',201222,5,2012,30,22,201205,2012),('2012-05-31',201222,5,2012,31,22,201205,2012),('2012-06-01',201222,6,2012,1,22,201206,2012),('2012-06-02',201222,6,2012,2,22,201206,2012),('2012-06-03',201223,6,2012,3,23,201206,2012),('2012-06-04',201223,6,2012,4,23,201206,2012),('2012-06-05',201223,6,2012,5,23,201206,2012),('2012-06-06',201223,6,2012,6,23,201206,2012),('2012-06-07',201223,6,2012,7,23,201206,2012),('2012-06-08',201223,6,2012,8,23,201206,2012),('2012-06-09',201223,6,2012,9,23,201206,2012),('2012-06-10',201224,6,2012,10,24,201206,2012),('2012-06-11',201224,6,2012,11,24,201206,2012),('2012-06-12',201224,6,2012,12,24,201206,2012),('2012-06-13',201224,6,2012,13,24,201206,2012),('2012-06-14',201224,6,2012,14,24,201206,2012),('2012-06-15',201224,6,2012,15,24,201206,2012),('2012-06-16',201224,6,2012,16,24,201206,2012),('2012-06-17',201225,6,2012,17,25,201206,2012),('2012-06-18',201225,6,2012,18,25,201206,2012),('2012-06-19',201225,6,2012,19,25,201206,2012),('2012-06-20',201225,6,2012,20,25,201206,2012),('2012-06-21',201225,6,2012,21,25,201206,2012),('2012-06-22',201225,6,2012,22,25,201206,2012),('2012-06-23',201225,6,2012,23,25,201206,2012),('2012-06-24',201226,6,2012,24,26,201206,2012),('2012-06-25',201226,6,2012,25,26,201206,2012),('2012-06-26',201226,6,2012,26,26,201206,2012),('2012-06-27',201226,6,2012,27,26,201206,2012),('2012-06-28',201226,6,2012,28,26,201206,2012),('2012-06-29',201226,6,2012,29,26,201206,2012),('2012-06-30',201226,6,2012,30,26,201206,2012),('2012-07-01',201227,7,2012,1,27,201207,2012),('2012-07-02',201227,7,2012,2,27,201207,2012),('2012-07-03',201227,7,2012,3,27,201207,2012),('2012-07-04',201227,7,2012,4,27,201207,2012),('2012-07-05',201227,7,2012,5,27,201207,2012),('2012-07-06',201227,7,2012,6,27,201207,2012),('2012-07-07',201227,7,2012,7,27,201207,2012),('2012-07-08',201228,7,2012,8,28,201207,2012),('2012-07-09',201228,7,2012,9,28,201207,2012),('2012-07-10',201228,7,2012,10,28,201207,2012),('2012-07-11',201228,7,2012,11,28,201207,2012),('2012-07-12',201228,7,2012,12,28,201207,2012),('2012-07-13',201228,7,2012,13,28,201207,2012),('2012-07-14',201228,7,2012,14,28,201207,2012),('2012-07-15',201229,7,2012,15,29,201207,2012),('2012-07-16',201229,7,2012,16,29,201207,2012),('2012-07-17',201229,7,2012,17,29,201207,2012),('2012-07-18',201229,7,2012,18,29,201207,2012),('2012-07-19',201229,7,2012,19,29,201207,2012),('2012-07-20',201229,7,2012,20,29,201207,2012),('2012-07-21',201229,7,2012,21,29,201207,2012),('2012-07-22',201230,7,2012,22,30,201207,2012),('2012-07-23',201230,7,2012,23,30,201207,2012),('2012-07-24',201230,7,2012,24,30,201207,2012),('2012-07-25',201230,7,2012,25,30,201207,2012),('2012-07-26',201230,7,2012,26,30,201207,2012),('2012-07-27',201230,7,2012,27,30,201207,2012),('2012-07-28',201230,7,2012,28,30,201207,2012),('2012-07-29',201231,7,2012,29,31,201207,2012),('2012-07-30',201231,7,2012,30,31,201207,2012),('2012-07-31',201231,7,2012,31,31,201207,2012),('2012-08-01',201231,8,2012,1,31,201208,2012),('2012-08-02',201231,8,2012,2,31,201208,2012),('2012-08-03',201231,8,2012,3,31,201208,2012),('2012-08-04',201231,8,2012,4,31,201208,2012),('2012-08-05',201232,8,2012,5,32,201208,2012),('2012-08-06',201232,8,2012,6,32,201208,2012),('2012-08-07',201232,8,2012,7,32,201208,2012),('2012-08-08',201232,8,2012,8,32,201208,2012),('2012-08-09',201232,8,2012,9,32,201208,2012),('2012-08-10',201232,8,2012,10,32,201208,2012),('2012-08-11',201232,8,2012,11,32,201208,2012),('2012-08-12',201233,8,2012,12,33,201208,2012),('2012-08-13',201233,8,2012,13,33,201208,2012),('2012-08-14',201233,8,2012,14,33,201208,2012),('2012-08-15',201233,8,2012,15,33,201208,2012),('2012-08-16',201233,8,2012,16,33,201208,2012),('2012-08-17',201233,8,2012,17,33,201208,2012),('2012-08-18',201233,8,2012,18,33,201208,2012),('2012-08-19',201234,8,2012,19,34,201208,2012),('2012-08-20',201234,8,2012,20,34,201208,2012),('2012-08-21',201234,8,2012,21,34,201208,2012),('2012-08-22',201234,8,2012,22,34,201208,2012),('2012-08-23',201234,8,2012,23,34,201208,2012),('2012-08-24',201234,8,2012,24,34,201208,2012),('2012-08-25',201234,8,2012,25,34,201208,2012),('2012-08-26',201235,8,2012,26,35,201208,2012),('2012-08-27',201235,8,2012,27,35,201208,2012),('2012-08-28',201235,8,2012,28,35,201208,2012),('2012-08-29',201235,8,2012,29,35,201208,2012),('2012-08-30',201235,8,2012,30,35,201208,2012),('2012-08-31',201235,8,2012,31,35,201208,2012),('2012-09-01',201235,9,2012,1,35,201209,2012),('2012-09-02',201236,9,2012,2,36,201209,2012),('2012-09-03',201236,9,2012,3,36,201209,2012),('2012-09-04',201236,9,2012,4,36,201209,2012),('2012-09-05',201236,9,2012,5,36,201209,2012),('2012-09-06',201236,9,2012,6,36,201209,2012),('2012-09-07',201236,9,2012,7,36,201209,2012),('2012-09-08',201236,9,2012,8,36,201209,2012),('2012-09-09',201237,9,2012,9,37,201209,2012),('2012-09-10',201237,9,2012,10,37,201209,2012),('2012-09-11',201237,9,2012,11,37,201209,2012),('2012-09-12',201237,9,2012,12,37,201209,2012),('2012-09-13',201237,9,2012,13,37,201209,2012),('2012-09-14',201237,9,2012,14,37,201209,2012),('2012-09-15',201237,9,2012,15,37,201209,2012),('2012-09-16',201238,9,2012,16,38,201209,2012),('2012-09-17',201238,9,2012,17,38,201209,2012),('2012-09-18',201238,9,2012,18,38,201209,2012),('2012-09-19',201238,9,2012,19,38,201209,2012),('2012-09-20',201238,9,2012,20,38,201209,2012),('2012-09-21',201238,9,2012,21,38,201209,2012),('2012-09-22',201238,9,2012,22,38,201209,2012),('2012-09-23',201239,9,2012,23,39,201209,2012),('2012-09-24',201239,9,2012,24,39,201209,2012),('2012-09-25',201239,9,2012,25,39,201209,2012),('2012-09-26',201239,9,2012,26,39,201209,2012),('2012-09-27',201239,9,2012,27,39,201209,2012),('2012-09-28',201239,9,2012,28,39,201209,2012),('2012-09-29',201239,9,2012,29,39,201209,2012),('2012-09-30',201240,9,2012,30,40,201209,2012),('2012-10-01',201240,10,2012,1,40,201210,2012),('2012-10-02',201240,10,2012,2,40,201210,2012),('2012-10-03',201240,10,2012,3,40,201210,2012),('2012-10-04',201240,10,2012,4,40,201210,2012),('2012-10-05',201240,10,2012,5,40,201210,2012),('2012-10-06',201240,10,2012,6,40,201210,2012),('2012-10-07',201241,10,2012,7,41,201210,2012),('2012-10-08',201241,10,2012,8,41,201210,2012),('2012-10-09',201241,10,2012,9,41,201210,2012),('2012-10-10',201241,10,2012,10,41,201210,2012),('2012-10-11',201241,10,2012,11,41,201210,2012),('2012-10-12',201241,10,2012,12,41,201210,2012),('2012-10-13',201241,10,2012,13,41,201210,2012),('2012-10-14',201242,10,2012,14,42,201210,2012),('2012-10-15',201242,10,2012,15,42,201210,2012),('2012-10-16',201242,10,2012,16,42,201210,2012),('2012-10-17',201242,10,2012,17,42,201210,2012),('2012-10-18',201242,10,2012,18,42,201210,2012),('2012-10-19',201242,10,2012,19,42,201210,2012),('2012-10-20',201242,10,2012,20,42,201210,2012),('2012-10-21',201243,10,2012,21,43,201210,2012),('2012-10-22',201243,10,2012,22,43,201210,2012),('2012-10-23',201243,10,2012,23,43,201210,2012),('2012-10-24',201243,10,2012,24,43,201210,2012),('2012-10-25',201243,10,2012,25,43,201210,2012),('2012-10-26',201243,10,2012,26,43,201210,2012),('2012-10-27',201243,10,2012,27,43,201210,2012),('2012-10-28',201244,10,2012,28,44,201210,2012),('2012-10-29',201244,10,2012,29,44,201210,2012),('2012-10-30',201244,10,2012,30,44,201210,2012),('2012-10-31',201244,10,2012,31,44,201210,2012),('2012-11-01',201244,11,2012,1,44,201211,2012),('2012-11-02',201244,11,2012,2,44,201211,2012),('2012-11-03',201244,11,2012,3,44,201211,2012),('2012-11-04',201245,11,2012,4,45,201211,2012),('2012-11-05',201245,11,2012,5,45,201211,2012),('2012-11-06',201245,11,2012,6,45,201211,2012),('2012-11-07',201245,11,2012,7,45,201211,2012),('2012-11-08',201245,11,2012,8,45,201211,2012),('2012-11-09',201245,11,2012,9,45,201211,2012),('2012-11-10',201245,11,2012,10,45,201211,2012),('2012-11-11',201246,11,2012,11,46,201211,2012),('2012-11-12',201246,11,2012,12,46,201211,2012),('2012-11-13',201246,11,2012,13,46,201211,2012),('2012-11-14',201246,11,2012,14,46,201211,2012),('2012-11-15',201246,11,2012,15,46,201211,2012),('2012-11-16',201246,11,2012,16,46,201211,2012),('2012-11-17',201246,11,2012,17,46,201211,2012),('2012-11-18',201247,11,2012,18,47,201211,2012),('2012-11-19',201247,11,2012,19,47,201211,2012),('2012-11-20',201247,11,2012,20,47,201211,2012),('2012-11-21',201247,11,2012,21,47,201211,2012),('2012-11-22',201247,11,2012,22,47,201211,2012),('2012-11-23',201247,11,2012,23,47,201211,2012),('2012-11-24',201247,11,2012,24,47,201211,2012),('2012-11-25',201248,11,2012,25,48,201211,2012),('2012-11-26',201248,11,2012,26,48,201211,2012),('2012-11-27',201248,11,2012,27,48,201211,2012),('2012-11-28',201248,11,2012,28,48,201211,2012),('2012-11-29',201248,11,2012,29,48,201211,2012),('2012-11-30',201248,11,2012,30,48,201211,2012),('2012-12-01',201248,12,2012,1,48,201212,2013),('2012-12-02',201249,12,2012,2,49,201212,2013),('2012-12-03',201249,12,2012,3,49,201212,2013),('2012-12-04',201249,12,2012,4,49,201212,2013),('2012-12-05',201249,12,2012,5,49,201212,2013),('2012-12-06',201249,12,2012,6,49,201212,2013),('2012-12-07',201249,12,2012,7,49,201212,2013),('2012-12-08',201249,12,2012,8,49,201212,2013),('2012-12-09',201250,12,2012,9,50,201212,2013),('2012-12-10',201250,12,2012,10,50,201212,2013),('2012-12-11',201250,12,2012,11,50,201212,2013),('2012-12-12',201250,12,2012,12,50,201212,2013),('2012-12-13',201250,12,2012,13,50,201212,2013),('2012-12-14',201250,12,2012,14,50,201212,2013),('2012-12-15',201250,12,2012,15,50,201212,2013),('2012-12-16',201251,12,2012,16,51,201212,2013),('2012-12-17',201251,12,2012,17,51,201212,2013),('2012-12-18',201251,12,2012,18,51,201212,2013),('2012-12-19',201251,12,2012,19,51,201212,2013),('2012-12-20',201251,12,2012,20,51,201212,2013),('2012-12-21',201251,12,2012,21,51,201212,2013),('2012-12-22',201251,12,2012,22,51,201212,2013),('2012-12-23',201252,12,2012,23,52,201212,2013),('2012-12-24',201252,12,2012,24,52,201212,2013),('2012-12-25',201252,12,2012,25,52,201212,2013),('2012-12-26',201252,12,2012,26,52,201212,2013),('2012-12-27',201252,12,2012,27,52,201212,2013),('2012-12-28',201252,12,2012,28,52,201212,2013),('2012-12-29',201252,12,2012,29,52,201212,2013),('2012-12-30',201301,12,2012,30,1,201212,2013),('2012-12-31',201301,12,2012,31,1,201212,2013),('2013-01-01',201301,1,2013,1,1,201301,2013),('2013-01-02',201301,1,2013,2,1,201301,2013),('2013-01-03',201301,1,2013,3,1,201301,2013),('2013-01-04',201301,1,2013,4,1,201301,2013),('2013-01-05',201301,1,2013,5,1,201301,2013),('2013-01-06',201302,1,2013,6,2,201301,2013),('2013-01-07',201302,1,2013,7,2,201301,2013),('2013-01-08',201302,1,2013,8,2,201301,2013),('2013-01-09',201302,1,2013,9,2,201301,2013),('2013-01-10',201302,1,2013,10,2,201301,2013),('2013-01-11',201302,1,2013,11,2,201301,2013),('2013-01-12',201302,1,2013,12,2,201301,2013),('2013-01-13',201303,1,2013,13,3,201301,2013),('2013-01-14',201303,1,2013,14,3,201301,2013),('2013-01-15',201303,1,2013,15,3,201301,2013),('2013-01-16',201303,1,2013,16,3,201301,2013),('2013-01-17',201303,1,2013,17,3,201301,2013),('2013-01-18',201303,1,2013,18,3,201301,2013),('2013-01-19',201303,1,2013,19,3,201301,2013),('2013-01-20',201304,1,2013,20,4,201301,2013),('2013-01-21',201304,1,2013,21,4,201301,2013),('2013-01-22',201304,1,2013,22,4,201301,2013),('2013-01-23',201304,1,2013,23,4,201301,2013),('2013-01-24',201304,1,2013,24,4,201301,2013),('2013-01-25',201304,1,2013,25,4,201301,2013),('2013-01-26',201304,1,2013,26,4,201301,2013),('2013-01-27',201305,1,2013,27,5,201301,2013),('2013-01-28',201305,1,2013,28,5,201301,2013),('2013-01-29',201305,1,2013,29,5,201301,2013),('2013-01-30',201305,1,2013,30,5,201301,2013),('2013-01-31',201305,1,2013,31,5,201301,2013),('2013-02-01',201305,2,2013,1,5,201302,2013),('2013-02-02',201305,2,2013,2,5,201302,2013),('2013-02-03',201306,2,2013,3,6,201302,2013),('2013-02-04',201306,2,2013,4,6,201302,2013),('2013-02-05',201306,2,2013,5,6,201302,2013),('2013-02-06',201306,2,2013,6,6,201302,2013),('2013-02-07',201306,2,2013,7,6,201302,2013),('2013-02-08',201306,2,2013,8,6,201302,2013),('2013-02-09',201306,2,2013,9,6,201302,2013),('2013-02-10',201307,2,2013,10,7,201302,2013),('2013-02-11',201307,2,2013,11,7,201302,2013),('2013-02-12',201307,2,2013,12,7,201302,2013),('2013-02-13',201307,2,2013,13,7,201302,2013),('2013-02-14',201307,2,2013,14,7,201302,2013),('2013-02-15',201307,2,2013,15,7,201302,2013),('2013-02-16',201307,2,2013,16,7,201302,2013),('2013-02-17',201308,2,2013,17,8,201302,2013),('2013-02-18',201308,2,2013,18,8,201302,2013),('2013-02-19',201308,2,2013,19,8,201302,2013),('2013-02-20',201308,2,2013,20,8,201302,2013),('2013-02-21',201308,2,2013,21,8,201302,2013),('2013-02-22',201308,2,2013,22,8,201302,2013),('2013-02-23',201308,2,2013,23,8,201302,2013),('2013-02-24',201309,2,2013,24,9,201302,2013),('2013-02-25',201309,2,2013,25,9,201302,2013),('2013-02-26',201309,2,2013,26,9,201302,2013),('2013-02-27',201309,2,2013,27,9,201302,2013),('2013-02-28',201309,2,2013,28,9,201302,2013),('2013-03-01',201309,3,2013,1,9,201303,2013),('2013-03-02',201309,3,2013,2,9,201303,2013),('2013-03-03',201310,3,2013,3,10,201303,2013),('2013-03-04',201310,3,2013,4,10,201303,2013),('2013-03-05',201310,3,2013,5,10,201303,2013),('2013-03-06',201310,3,2013,6,10,201303,2013),('2013-03-07',201310,3,2013,7,10,201303,2013),('2013-03-08',201310,3,2013,8,10,201303,2013),('2013-03-09',201310,3,2013,9,10,201303,2013),('2013-03-10',201311,3,2013,10,11,201303,2013),('2013-03-11',201311,3,2013,11,11,201303,2013),('2013-03-12',201311,3,2013,12,11,201303,2013),('2013-03-13',201311,3,2013,13,11,201303,2013),('2013-03-14',201311,3,2013,14,11,201303,2013),('2013-03-15',201311,3,2013,15,11,201303,2013),('2013-03-16',201311,3,2013,16,11,201303,2013),('2013-03-17',201312,3,2013,17,12,201303,2013),('2013-03-18',201312,3,2013,18,12,201303,2013),('2013-03-19',201312,3,2013,19,12,201303,2013),('2013-03-20',201312,3,2013,20,12,201303,2013),('2013-03-21',201312,3,2013,21,12,201303,2013),('2013-03-22',201312,3,2013,22,12,201303,2013),('2013-03-23',201312,3,2013,23,12,201303,2013),('2013-03-24',201313,3,2013,24,13,201303,2013),('2013-03-25',201313,3,2013,25,13,201303,2013),('2013-03-26',201313,3,2013,26,13,201303,2013),('2013-03-27',201313,3,2013,27,13,201303,2013),('2013-03-28',201313,3,2013,28,13,201303,2013),('2013-03-29',201313,3,2013,29,13,201303,2013),('2013-03-30',201313,3,2013,30,13,201303,2013),('2013-03-31',201314,3,2013,31,14,201303,2013),('2013-04-01',201314,4,2013,1,14,201304,2013),('2013-04-02',201314,4,2013,2,14,201304,2013),('2013-04-03',201314,4,2013,3,14,201304,2013),('2013-04-04',201314,4,2013,4,14,201304,2013),('2013-04-05',201314,4,2013,5,14,201304,2013),('2013-04-06',201314,4,2013,6,14,201304,2013),('2013-04-07',201315,4,2013,7,15,201304,2013),('2013-04-08',201315,4,2013,8,15,201304,2013),('2013-04-09',201315,4,2013,9,15,201304,2013),('2013-04-10',201315,4,2013,10,15,201304,2013),('2013-04-11',201315,4,2013,11,15,201304,2013),('2013-04-12',201315,4,2013,12,15,201304,2013),('2013-04-13',201315,4,2013,13,15,201304,2013),('2013-04-14',201316,4,2013,14,16,201304,2013),('2013-04-15',201316,4,2013,15,16,201304,2013),('2013-04-16',201316,4,2013,16,16,201304,2013),('2013-04-17',201316,4,2013,17,16,201304,2013),('2013-04-18',201316,4,2013,18,16,201304,2013),('2013-04-19',201316,4,2013,19,16,201304,2013),('2013-04-20',201316,4,2013,20,16,201304,2013),('2013-04-21',201317,4,2013,21,17,201304,2013),('2013-04-22',201317,4,2013,22,17,201304,2013),('2013-04-23',201317,4,2013,23,17,201304,2013),('2013-04-24',201317,4,2013,24,17,201304,2013),('2013-04-25',201317,4,2013,25,17,201304,2013),('2013-04-26',201317,4,2013,26,17,201304,2013),('2013-04-27',201317,4,2013,27,17,201304,2013),('2013-04-28',201318,4,2013,28,18,201304,2013),('2013-04-29',201318,4,2013,29,18,201304,2013),('2013-04-30',201318,4,2013,30,18,201304,2013),('2013-05-01',201318,5,2013,1,18,201305,2013),('2013-05-02',201318,5,2013,2,18,201305,2013),('2013-05-03',201318,5,2013,3,18,201305,2013),('2013-05-04',201318,5,2013,4,18,201305,2013),('2013-05-05',201319,5,2013,5,19,201305,2013),('2013-05-06',201319,5,2013,6,19,201305,2013),('2013-05-07',201319,5,2013,7,19,201305,2013),('2013-05-08',201319,5,2013,8,19,201305,2013),('2013-05-09',201319,5,2013,9,19,201305,2013),('2013-05-10',201319,5,2013,10,19,201305,2013),('2013-05-11',201319,5,2013,11,19,201305,2013),('2013-05-12',201320,5,2013,12,20,201305,2013),('2013-05-13',201320,5,2013,13,20,201305,2013),('2013-05-14',201320,5,2013,14,20,201305,2013),('2013-05-15',201320,5,2013,15,20,201305,2013),('2013-05-16',201320,5,2013,16,20,201305,2013),('2013-05-17',201320,5,2013,17,20,201305,2013),('2013-05-18',201320,5,2013,18,20,201305,2013),('2013-05-19',201321,5,2013,19,21,201305,2013),('2013-05-20',201321,5,2013,20,21,201305,2013),('2013-05-21',201321,5,2013,21,21,201305,2013),('2013-05-22',201321,5,2013,22,21,201305,2013),('2013-05-23',201321,5,2013,23,21,201305,2013),('2013-05-24',201321,5,2013,24,21,201305,2013),('2013-05-25',201321,5,2013,25,21,201305,2013),('2013-05-26',201322,5,2013,26,22,201305,2013),('2013-05-27',201322,5,2013,27,22,201305,2013),('2013-05-28',201322,5,2013,28,22,201305,2013),('2013-05-29',201322,5,2013,29,22,201305,2013),('2013-05-30',201322,5,2013,30,22,201305,2013),('2013-05-31',201322,5,2013,31,22,201305,2013),('2013-06-01',201322,6,2013,1,22,201306,2013),('2013-06-02',201323,6,2013,2,23,201306,2013),('2013-06-03',201323,6,2013,3,23,201306,2013),('2013-06-04',201323,6,2013,4,23,201306,2013),('2013-06-05',201323,6,2013,5,23,201306,2013),('2013-06-06',201323,6,2013,6,23,201306,2013),('2013-06-07',201323,6,2013,7,23,201306,2013),('2013-06-08',201323,6,2013,8,23,201306,2013),('2013-06-09',201324,6,2013,9,24,201306,2013),('2013-06-10',201324,6,2013,10,24,201306,2013),('2013-06-11',201324,6,2013,11,24,201306,2013),('2013-06-12',201324,6,2013,12,24,201306,2013),('2013-06-13',201324,6,2013,13,24,201306,2013),('2013-06-14',201324,6,2013,14,24,201306,2013),('2013-06-15',201324,6,2013,15,24,201306,2013),('2013-06-16',201325,6,2013,16,25,201306,2013),('2013-06-17',201325,6,2013,17,25,201306,2013),('2013-06-18',201325,6,2013,18,25,201306,2013),('2013-06-19',201325,6,2013,19,25,201306,2013),('2013-06-20',201325,6,2013,20,25,201306,2013),('2013-06-21',201325,6,2013,21,25,201306,2013),('2013-06-22',201325,6,2013,22,25,201306,2013),('2013-06-23',201326,6,2013,23,26,201306,2013),('2013-06-24',201326,6,2013,24,26,201306,2013),('2013-06-25',201326,6,2013,25,26,201306,2013),('2013-06-26',201326,6,2013,26,26,201306,2013),('2013-06-27',201326,6,2013,27,26,201306,2013),('2013-06-28',201326,6,2013,28,26,201306,2013),('2013-06-29',201326,6,2013,29,26,201306,2013),('2013-06-30',201327,6,2013,30,27,201306,2013),('2013-07-01',201327,7,2013,1,27,201307,2013),('2013-07-02',201327,7,2013,2,27,201307,2013),('2013-07-03',201327,7,2013,3,27,201307,2013),('2013-07-04',201327,7,2013,4,27,201307,2013),('2013-07-05',201327,7,2013,5,27,201307,2013),('2013-07-06',201327,7,2013,6,27,201307,2013),('2013-07-07',201328,7,2013,7,28,201307,2013),('2013-07-08',201328,7,2013,8,28,201307,2013),('2013-07-09',201328,7,2013,9,28,201307,2013),('2013-07-10',201328,7,2013,10,28,201307,2013),('2013-07-11',201328,7,2013,11,28,201307,2013),('2013-07-12',201328,7,2013,12,28,201307,2013),('2013-07-13',201328,7,2013,13,28,201307,2013),('2013-07-14',201329,7,2013,14,29,201307,2013),('2013-07-15',201329,7,2013,15,29,201307,2013),('2013-07-16',201329,7,2013,16,29,201307,2013),('2013-07-17',201329,7,2013,17,29,201307,2013),('2013-07-18',201329,7,2013,18,29,201307,2013),('2013-07-19',201329,7,2013,19,29,201307,2013),('2013-07-20',201329,7,2013,20,29,201307,2013),('2013-07-21',201330,7,2013,21,30,201307,2013),('2013-07-22',201330,7,2013,22,30,201307,2013),('2013-07-23',201330,7,2013,23,30,201307,2013),('2013-07-24',201330,7,2013,24,30,201307,2013),('2013-07-25',201330,7,2013,25,30,201307,2013),('2013-07-26',201330,7,2013,26,30,201307,2013),('2013-07-27',201330,7,2013,27,30,201307,2013),('2013-07-28',201331,7,2013,28,31,201307,2013),('2013-07-29',201331,7,2013,29,31,201307,2013),('2013-07-30',201331,7,2013,30,31,201307,2013),('2013-07-31',201331,7,2013,31,31,201307,2013),('2013-08-01',201331,8,2013,1,31,201308,2013),('2013-08-02',201331,8,2013,2,31,201308,2013),('2013-08-03',201331,8,2013,3,31,201308,2013),('2013-08-04',201332,8,2013,4,32,201308,2013),('2013-08-05',201332,8,2013,5,32,201308,2013),('2013-08-06',201332,8,2013,6,32,201308,2013),('2013-08-07',201332,8,2013,7,32,201308,2013),('2013-08-08',201332,8,2013,8,32,201308,2013),('2013-08-09',201332,8,2013,9,32,201308,2013),('2013-08-10',201332,8,2013,10,32,201308,2013),('2013-08-11',201333,8,2013,11,33,201308,2013),('2013-08-12',201333,8,2013,12,33,201308,2013),('2013-08-13',201333,8,2013,13,33,201308,2013),('2013-08-14',201333,8,2013,14,33,201308,2013),('2013-08-15',201333,8,2013,15,33,201308,2013),('2013-08-16',201333,8,2013,16,33,201308,2013),('2013-08-17',201333,8,2013,17,33,201308,2013),('2013-08-18',201334,8,2013,18,34,201308,2013),('2013-08-19',201334,8,2013,19,34,201308,2013),('2013-08-20',201334,8,2013,20,34,201308,2013),('2013-08-21',201334,8,2013,21,34,201308,2013),('2013-08-22',201334,8,2013,22,34,201308,2013),('2013-08-23',201334,8,2013,23,34,201308,2013),('2013-08-24',201334,8,2013,24,34,201308,2013),('2013-08-25',201335,8,2013,25,35,201308,2013),('2013-08-26',201335,8,2013,26,35,201308,2013),('2013-08-27',201335,8,2013,27,35,201308,2013),('2013-08-28',201335,8,2013,28,35,201308,2013),('2013-08-29',201335,8,2013,29,35,201308,2013),('2013-08-30',201335,8,2013,30,35,201308,2013),('2013-08-31',201335,8,2013,31,35,201308,2013),('2013-09-01',201336,9,2013,1,36,201309,2013),('2013-09-02',201336,9,2013,2,36,201309,2013),('2013-09-03',201336,9,2013,3,36,201309,2013),('2013-09-04',201336,9,2013,4,36,201309,2013),('2013-09-05',201336,9,2013,5,36,201309,2013),('2013-09-06',201336,9,2013,6,36,201309,2013),('2013-09-07',201336,9,2013,7,36,201309,2013),('2013-09-08',201337,9,2013,8,37,201309,2013),('2013-09-09',201337,9,2013,9,37,201309,2013),('2013-09-10',201337,9,2013,10,37,201309,2013),('2013-09-11',201337,9,2013,11,37,201309,2013),('2013-09-12',201337,9,2013,12,37,201309,2013),('2013-09-13',201337,9,2013,13,37,201309,2013),('2013-09-14',201337,9,2013,14,37,201309,2013),('2013-09-15',201338,9,2013,15,38,201309,2013),('2013-09-16',201338,9,2013,16,38,201309,2013),('2013-09-17',201338,9,2013,17,38,201309,2013),('2013-09-18',201338,9,2013,18,38,201309,2013),('2013-09-19',201338,9,2013,19,38,201309,2013),('2013-09-20',201338,9,2013,20,38,201309,2013),('2013-09-21',201338,9,2013,21,38,201309,2013),('2013-09-22',201339,9,2013,22,39,201309,2013),('2013-09-23',201339,9,2013,23,39,201309,2013),('2013-09-24',201339,9,2013,24,39,201309,2013),('2013-09-25',201339,9,2013,25,39,201309,2013),('2013-09-26',201339,9,2013,26,39,201309,2013),('2013-09-27',201339,9,2013,27,39,201309,2013),('2013-09-28',201339,9,2013,28,39,201309,2013),('2013-09-29',201340,9,2013,29,40,201309,2013),('2013-09-30',201340,9,2013,30,40,201309,2013),('2013-10-01',201340,10,2013,1,40,201310,2013),('2013-10-02',201340,10,2013,2,40,201310,2013),('2013-10-03',201340,10,2013,3,40,201310,2013),('2013-10-04',201340,10,2013,4,40,201310,2013),('2013-10-05',201340,10,2013,5,40,201310,2013),('2013-10-06',201341,10,2013,6,41,201310,2013),('2013-10-07',201341,10,2013,7,41,201310,2013),('2013-10-08',201341,10,2013,8,41,201310,2013),('2013-10-09',201341,10,2013,9,41,201310,2013),('2013-10-10',201341,10,2013,10,41,201310,2013),('2013-10-11',201341,10,2013,11,41,201310,2013),('2013-10-12',201341,10,2013,12,41,201310,2013),('2013-10-13',201342,10,2013,13,42,201310,2013),('2013-10-14',201342,10,2013,14,42,201310,2013),('2013-10-15',201342,10,2013,15,42,201310,2013),('2013-10-16',201342,10,2013,16,42,201310,2013),('2013-10-17',201342,10,2013,17,42,201310,2013),('2013-10-18',201342,10,2013,18,42,201310,2013),('2013-10-19',201342,10,2013,19,42,201310,2013),('2013-10-20',201343,10,2013,20,43,201310,2013),('2013-10-21',201343,10,2013,21,43,201310,2013),('2013-10-22',201343,10,2013,22,43,201310,2013),('2013-10-23',201343,10,2013,23,43,201310,2013),('2013-10-24',201343,10,2013,24,43,201310,2013),('2013-10-25',201343,10,2013,25,43,201310,2013),('2013-10-26',201343,10,2013,26,43,201310,2013),('2013-10-27',201344,10,2013,27,44,201310,2013),('2013-10-28',201344,10,2013,28,44,201310,2013),('2013-10-29',201344,10,2013,29,44,201310,2013),('2013-10-30',201344,10,2013,30,44,201310,2013),('2013-10-31',201344,10,2013,31,44,201310,2013),('2013-11-01',201344,11,2013,1,44,201311,2013),('2013-11-02',201344,11,2013,2,44,201311,2013),('2013-11-03',201345,11,2013,3,45,201311,2013),('2013-11-04',201345,11,2013,4,45,201311,2013),('2013-11-05',201345,11,2013,5,45,201311,2013),('2013-11-06',201345,11,2013,6,45,201311,2013),('2013-11-07',201345,11,2013,7,45,201311,2013),('2013-11-08',201345,11,2013,8,45,201311,2013),('2013-11-09',201345,11,2013,9,45,201311,2013),('2013-11-10',201346,11,2013,10,46,201311,2013),('2013-11-11',201346,11,2013,11,46,201311,2013),('2013-11-12',201346,11,2013,12,46,201311,2013),('2013-11-13',201346,11,2013,13,46,201311,2013),('2013-11-14',201346,11,2013,14,46,201311,2013),('2013-11-15',201346,11,2013,15,46,201311,2013),('2013-11-16',201346,11,2013,16,46,201311,2013),('2013-11-17',201347,11,2013,17,47,201311,2013),('2013-11-18',201347,11,2013,18,47,201311,2013),('2013-11-19',201347,11,2013,19,47,201311,2013),('2013-11-20',201347,11,2013,20,47,201311,2013),('2013-11-21',201347,11,2013,21,47,201311,2013),('2013-11-22',201347,11,2013,22,47,201311,2013),('2013-11-23',201347,11,2013,23,47,201311,2013),('2013-11-24',201348,11,2013,24,48,201311,2013),('2013-11-25',201348,11,2013,25,48,201311,2013),('2013-11-26',201348,11,2013,26,48,201311,2013),('2013-11-27',201348,11,2013,27,48,201311,2013),('2013-11-28',201348,11,2013,28,48,201311,2013),('2013-11-29',201348,11,2013,29,48,201311,2013),('2013-11-30',201348,11,2013,30,48,201311,2013),('2013-12-01',201349,12,2013,1,49,201312,2014),('2013-12-02',201349,12,2013,2,49,201312,2014),('2013-12-03',201349,12,2013,3,49,201312,2014),('2013-12-04',201349,12,2013,4,49,201312,2014),('2013-12-05',201349,12,2013,5,49,201312,2014),('2013-12-06',201349,12,2013,6,49,201312,2014),('2013-12-07',201349,12,2013,7,49,201312,2014),('2013-12-08',201350,12,2013,8,50,201312,2014),('2013-12-09',201350,12,2013,9,50,201312,2014),('2013-12-10',201350,12,2013,10,50,201312,2014),('2013-12-11',201350,12,2013,11,50,201312,2014),('2013-12-12',201350,12,2013,12,50,201312,2014),('2013-12-13',201350,12,2013,13,50,201312,2014),('2013-12-14',201350,12,2013,14,50,201312,2014),('2013-12-15',201351,12,2013,15,51,201312,2014),('2013-12-16',201351,12,2013,16,51,201312,2014),('2013-12-17',201351,12,2013,17,51,201312,2014),('2013-12-18',201351,12,2013,18,51,201312,2014),('2013-12-19',201351,12,2013,19,51,201312,2014),('2013-12-20',201351,12,2013,20,51,201312,2014),('2013-12-21',201351,12,2013,21,51,201312,2014),('2013-12-22',201352,12,2013,22,52,201312,2014),('2013-12-23',201352,12,2013,23,52,201312,2014),('2013-12-24',201352,12,2013,24,52,201312,2014),('2013-12-25',201352,12,2013,25,52,201312,2014),('2013-12-26',201352,12,2013,26,52,201312,2014),('2013-12-27',201352,12,2013,27,52,201312,2014),('2013-12-28',201352,12,2013,28,52,201312,2014),('2013-12-29',201401,12,2013,29,1,201312,2014),('2013-12-30',201401,12,2013,30,1,201312,2014),('2013-12-31',201401,12,2013,31,1,201312,2014),('2014-01-01',201401,1,2014,1,1,201401,2014),('2014-01-02',201401,1,2014,2,1,201401,2014),('2014-01-03',201401,1,2014,3,1,201401,2014),('2014-01-04',201401,1,2014,4,1,201401,2014),('2014-01-05',201402,1,2014,5,2,201401,2014),('2014-01-06',201402,1,2014,6,2,201401,2014),('2014-01-07',201402,1,2014,7,2,201401,2014),('2014-01-08',201402,1,2014,8,2,201401,2014),('2014-01-09',201402,1,2014,9,2,201401,2014),('2014-01-10',201402,1,2014,10,2,201401,2014),('2014-01-11',201402,1,2014,11,2,201401,2014),('2014-01-12',201403,1,2014,12,3,201401,2014),('2014-01-13',201403,1,2014,13,3,201401,2014),('2014-01-14',201403,1,2014,14,3,201401,2014),('2014-01-15',201403,1,2014,15,3,201401,2014),('2014-01-16',201403,1,2014,16,3,201401,2014),('2014-01-17',201403,1,2014,17,3,201401,2014),('2014-01-18',201403,1,2014,18,3,201401,2014),('2014-01-19',201404,1,2014,19,4,201401,2014),('2014-01-20',201404,1,2014,20,4,201401,2014),('2014-01-21',201404,1,2014,21,4,201401,2014),('2014-01-22',201404,1,2014,22,4,201401,2014),('2014-01-23',201404,1,2014,23,4,201401,2014),('2014-01-24',201404,1,2014,24,4,201401,2014),('2014-01-25',201404,1,2014,25,4,201401,2014),('2014-01-26',201405,1,2014,26,5,201401,2014),('2014-01-27',201405,1,2014,27,5,201401,2014),('2014-01-28',201405,1,2014,28,5,201401,2014),('2014-01-29',201405,1,2014,29,5,201401,2014),('2014-01-30',201405,1,2014,30,5,201401,2014),('2014-01-31',201405,1,2014,31,5,201401,2014),('2014-02-01',201405,2,2014,1,5,201402,2014),('2014-02-02',201406,2,2014,2,6,201402,2014),('2014-02-03',201406,2,2014,3,6,201402,2014),('2014-02-04',201406,2,2014,4,6,201402,2014),('2014-02-05',201406,2,2014,5,6,201402,2014),('2014-02-06',201406,2,2014,6,6,201402,2014),('2014-02-07',201406,2,2014,7,6,201402,2014),('2014-02-08',201406,2,2014,8,6,201402,2014),('2014-02-09',201407,2,2014,9,7,201402,2014),('2014-02-10',201407,2,2014,10,7,201402,2014),('2014-02-11',201407,2,2014,11,7,201402,2014),('2014-02-12',201407,2,2014,12,7,201402,2014),('2014-02-13',201407,2,2014,13,7,201402,2014),('2014-02-14',201407,2,2014,14,7,201402,2014),('2014-02-15',201407,2,2014,15,7,201402,2014),('2014-02-16',201408,2,2014,16,8,201402,2014),('2014-02-17',201408,2,2014,17,8,201402,2014),('2014-02-18',201408,2,2014,18,8,201402,2014),('2014-02-19',201408,2,2014,19,8,201402,2014),('2014-02-20',201408,2,2014,20,8,201402,2014),('2014-02-21',201408,2,2014,21,8,201402,2014),('2014-02-22',201408,2,2014,22,8,201402,2014),('2014-02-23',201409,2,2014,23,9,201402,2014),('2014-02-24',201409,2,2014,24,9,201402,2014),('2014-02-25',201409,2,2014,25,9,201402,2014),('2014-02-26',201409,2,2014,26,9,201402,2014),('2014-02-27',201409,2,2014,27,9,201402,2014),('2014-02-28',201409,2,2014,28,9,201402,2014),('2014-03-01',201409,3,2014,1,9,201403,2014),('2014-03-02',201410,3,2014,2,10,201403,2014),('2014-03-03',201410,3,2014,3,10,201403,2014),('2014-03-04',201410,3,2014,4,10,201403,2014),('2014-03-05',201410,3,2014,5,10,201403,2014),('2014-03-06',201410,3,2014,6,10,201403,2014),('2014-03-07',201410,3,2014,7,10,201403,2014),('2014-03-08',201410,3,2014,8,10,201403,2014),('2014-03-09',201411,3,2014,9,11,201403,2014),('2014-03-10',201411,3,2014,10,11,201403,2014),('2014-03-11',201411,3,2014,11,11,201403,2014),('2014-03-12',201411,3,2014,12,11,201403,2014),('2014-03-13',201411,3,2014,13,11,201403,2014),('2014-03-14',201411,3,2014,14,11,201403,2014),('2014-03-15',201411,3,2014,15,11,201403,2014),('2014-03-16',201412,3,2014,16,12,201403,2014),('2014-03-17',201412,3,2014,17,12,201403,2014),('2014-03-18',201412,3,2014,18,12,201403,2014),('2014-03-19',201412,3,2014,19,12,201403,2014),('2014-03-20',201412,3,2014,20,12,201403,2014),('2014-03-21',201412,3,2014,21,12,201403,2014),('2014-03-22',201412,3,2014,22,12,201403,2014),('2014-03-23',201413,3,2014,23,13,201403,2014),('2014-03-24',201413,3,2014,24,13,201403,2014),('2014-03-25',201413,3,2014,25,13,201403,2014),('2014-03-26',201413,3,2014,26,13,201403,2014),('2014-03-27',201413,3,2014,27,13,201403,2014),('2014-03-28',201413,3,2014,28,13,201403,2014),('2014-03-29',201413,3,2014,29,13,201403,2014),('2014-03-30',201414,3,2014,30,14,201403,2014),('2014-03-31',201414,3,2014,31,14,201403,2014),('2014-04-01',201414,4,2014,1,14,201404,2014),('2014-04-02',201414,4,2014,2,14,201404,2014),('2014-04-03',201414,4,2014,3,14,201404,2014),('2014-04-04',201414,4,2014,4,14,201404,2014),('2014-04-05',201414,4,2014,5,14,201404,2014),('2014-04-06',201415,4,2014,6,15,201404,2014),('2014-04-07',201415,4,2014,7,15,201404,2014),('2014-04-08',201415,4,2014,8,15,201404,2014),('2014-04-09',201415,4,2014,9,15,201404,2014),('2014-04-10',201415,4,2014,10,15,201404,2014),('2014-04-11',201415,4,2014,11,15,201404,2014),('2014-04-12',201415,4,2014,12,15,201404,2014),('2014-04-13',201416,4,2014,13,16,201404,2014),('2014-04-14',201416,4,2014,14,16,201404,2014),('2014-04-15',201416,4,2014,15,16,201404,2014),('2014-04-16',201416,4,2014,16,16,201404,2014),('2014-04-17',201416,4,2014,17,16,201404,2014),('2014-04-18',201416,4,2014,18,16,201404,2014),('2014-04-19',201416,4,2014,19,16,201404,2014),('2014-04-20',201417,4,2014,20,17,201404,2014),('2014-04-21',201417,4,2014,21,17,201404,2014),('2014-04-22',201417,4,2014,22,17,201404,2014),('2014-04-23',201417,4,2014,23,17,201404,2014),('2014-04-24',201417,4,2014,24,17,201404,2014),('2014-04-25',201417,4,2014,25,17,201404,2014),('2014-04-26',201417,4,2014,26,17,201404,2014),('2014-04-27',201418,4,2014,27,18,201404,2014),('2014-04-28',201418,4,2014,28,18,201404,2014),('2014-04-29',201418,4,2014,29,18,201404,2014),('2014-04-30',201418,4,2014,30,18,201404,2014),('2014-05-01',201418,5,2014,1,18,201405,2014),('2014-05-02',201418,5,2014,2,18,201405,2014),('2014-05-03',201418,5,2014,3,18,201405,2014),('2014-05-04',201419,5,2014,4,19,201405,2014),('2014-05-05',201419,5,2014,5,19,201405,2014),('2014-05-06',201419,5,2014,6,19,201405,2014),('2014-05-07',201419,5,2014,7,19,201405,2014),('2014-05-08',201419,5,2014,8,19,201405,2014),('2014-05-09',201419,5,2014,9,19,201405,2014),('2014-05-10',201419,5,2014,10,19,201405,2014),('2014-05-11',201420,5,2014,11,20,201405,2014),('2014-05-12',201420,5,2014,12,20,201405,2014),('2014-05-13',201420,5,2014,13,20,201405,2014),('2014-05-14',201420,5,2014,14,20,201405,2014),('2014-05-15',201420,5,2014,15,20,201405,2014),('2014-05-16',201420,5,2014,16,20,201405,2014),('2014-05-17',201420,5,2014,17,20,201405,2014),('2014-05-18',201421,5,2014,18,21,201405,2014),('2014-05-19',201421,5,2014,19,21,201405,2014),('2014-05-20',201421,5,2014,20,21,201405,2014),('2014-05-21',201421,5,2014,21,21,201405,2014),('2014-05-22',201421,5,2014,22,21,201405,2014),('2014-05-23',201421,5,2014,23,21,201405,2014),('2014-05-24',201421,5,2014,24,21,201405,2014),('2014-05-25',201422,5,2014,25,22,201405,2014),('2014-05-26',201422,5,2014,26,22,201405,2014),('2014-05-27',201422,5,2014,27,22,201405,2014),('2014-05-28',201422,5,2014,28,22,201405,2014),('2014-05-29',201422,5,2014,29,22,201405,2014),('2014-05-30',201422,5,2014,30,22,201405,2014),('2014-05-31',201422,5,2014,31,22,201405,2014),('2014-06-01',201423,6,2014,1,23,201406,2014),('2014-06-02',201423,6,2014,2,23,201406,2014),('2014-06-03',201423,6,2014,3,23,201406,2014),('2014-06-04',201423,6,2014,4,23,201406,2014),('2014-06-05',201423,6,2014,5,23,201406,2014),('2014-06-06',201423,6,2014,6,23,201406,2014),('2014-06-07',201423,6,2014,7,23,201406,2014),('2014-06-08',201424,6,2014,8,24,201406,2014),('2014-06-09',201424,6,2014,9,24,201406,2014),('2014-06-10',201424,6,2014,10,24,201406,2014),('2014-06-11',201424,6,2014,11,24,201406,2014),('2014-06-12',201424,6,2014,12,24,201406,2014),('2014-06-13',201424,6,2014,13,24,201406,2014),('2014-06-14',201424,6,2014,14,24,201406,2014),('2014-06-15',201425,6,2014,15,25,201406,2014),('2014-06-16',201425,6,2014,16,25,201406,2014),('2014-06-17',201425,6,2014,17,25,201406,2014),('2014-06-18',201425,6,2014,18,25,201406,2014),('2014-06-19',201425,6,2014,19,25,201406,2014),('2014-06-20',201425,6,2014,20,25,201406,2014),('2014-06-21',201425,6,2014,21,25,201406,2014),('2014-06-22',201426,6,2014,22,26,201406,2014),('2014-06-23',201426,6,2014,23,26,201406,2014),('2014-06-24',201426,6,2014,24,26,201406,2014),('2014-06-25',201426,6,2014,25,26,201406,2014),('2014-06-26',201426,6,2014,26,26,201406,2014),('2014-06-27',201426,6,2014,27,26,201406,2014),('2014-06-28',201426,6,2014,28,26,201406,2014),('2014-06-29',201427,6,2014,29,27,201406,2014),('2014-06-30',201427,6,2014,30,27,201406,2014),('2014-07-01',201427,7,2014,1,27,201407,2014),('2014-07-02',201427,7,2014,2,27,201407,2014),('2014-07-03',201427,7,2014,3,27,201407,2014),('2014-07-04',201427,7,2014,4,27,201407,2014),('2014-07-05',201427,7,2014,5,27,201407,2014),('2014-07-06',201428,7,2014,6,28,201407,2014),('2014-07-07',201428,7,2014,7,28,201407,2014),('2014-07-08',201428,7,2014,8,28,201407,2014),('2014-07-09',201428,7,2014,9,28,201407,2014),('2014-07-10',201428,7,2014,10,28,201407,2014),('2014-07-11',201428,7,2014,11,28,201407,2014),('2014-07-12',201428,7,2014,12,28,201407,2014),('2014-07-13',201429,7,2014,13,29,201407,2014),('2014-07-14',201429,7,2014,14,29,201407,2014),('2014-07-15',201429,7,2014,15,29,201407,2014),('2014-07-16',201429,7,2014,16,29,201407,2014),('2014-07-17',201429,7,2014,17,29,201407,2014),('2014-07-18',201429,7,2014,18,29,201407,2014),('2014-07-19',201429,7,2014,19,29,201407,2014),('2014-07-20',201430,7,2014,20,30,201407,2014),('2014-07-21',201430,7,2014,21,30,201407,2014),('2014-07-22',201430,7,2014,22,30,201407,2014),('2014-07-23',201430,7,2014,23,30,201407,2014),('2014-07-24',201430,7,2014,24,30,201407,2014),('2014-07-25',201430,7,2014,25,30,201407,2014),('2014-07-26',201430,7,2014,26,30,201407,2014),('2014-07-27',201431,7,2014,27,31,201407,2014),('2014-07-28',201431,7,2014,28,31,201407,2014),('2014-07-29',201431,7,2014,29,31,201407,2014),('2014-07-30',201431,7,2014,30,31,201407,2014),('2014-07-31',201431,7,2014,31,31,201407,2014),('2014-08-01',201431,8,2014,1,31,201408,2014),('2014-08-02',201431,8,2014,2,31,201408,2014),('2014-08-03',201432,8,2014,3,32,201408,2014),('2014-08-04',201432,8,2014,4,32,201408,2014),('2014-08-05',201432,8,2014,5,32,201408,2014),('2014-08-06',201432,8,2014,6,32,201408,2014),('2014-08-07',201432,8,2014,7,32,201408,2014),('2014-08-08',201432,8,2014,8,32,201408,2014),('2014-08-09',201432,8,2014,9,32,201408,2014),('2014-08-10',201433,8,2014,10,33,201408,2014),('2014-08-11',201433,8,2014,11,33,201408,2014),('2014-08-12',201433,8,2014,12,33,201408,2014),('2014-08-13',201433,8,2014,13,33,201408,2014),('2014-08-14',201433,8,2014,14,33,201408,2014),('2014-08-15',201433,8,2014,15,33,201408,2014),('2014-08-16',201433,8,2014,16,33,201408,2014),('2014-08-17',201434,8,2014,17,34,201408,2014),('2014-08-18',201434,8,2014,18,34,201408,2014),('2014-08-19',201434,8,2014,19,34,201408,2014),('2014-08-20',201434,8,2014,20,34,201408,2014),('2014-08-21',201434,8,2014,21,34,201408,2014),('2014-08-22',201434,8,2014,22,34,201408,2014),('2014-08-23',201434,8,2014,23,34,201408,2014),('2014-08-24',201435,8,2014,24,35,201408,2014),('2014-08-25',201435,8,2014,25,35,201408,2014),('2014-08-26',201435,8,2014,26,35,201408,2014),('2014-08-27',201435,8,2014,27,35,201408,2014),('2014-08-28',201435,8,2014,28,35,201408,2014),('2014-08-29',201435,8,2014,29,35,201408,2014),('2014-08-30',201435,8,2014,30,35,201408,2014),('2014-08-31',201436,8,2014,31,36,201408,2014),('2014-09-01',201436,9,2014,1,36,201409,2014),('2014-09-02',201436,9,2014,2,36,201409,2014),('2014-09-03',201436,9,2014,3,36,201409,2014),('2014-09-04',201436,9,2014,4,36,201409,2014),('2014-09-05',201436,9,2014,5,36,201409,2014),('2014-09-06',201436,9,2014,6,36,201409,2014),('2014-09-07',201437,9,2014,7,37,201409,2014),('2014-09-08',201437,9,2014,8,37,201409,2014),('2014-09-09',201437,9,2014,9,37,201409,2014),('2014-09-10',201437,9,2014,10,37,201409,2014),('2014-09-11',201437,9,2014,11,37,201409,2014),('2014-09-12',201437,9,2014,12,37,201409,2014),('2014-09-13',201437,9,2014,13,37,201409,2014),('2014-09-14',201438,9,2014,14,38,201409,2014),('2014-09-15',201438,9,2014,15,38,201409,2014),('2014-09-16',201438,9,2014,16,38,201409,2014),('2014-09-17',201438,9,2014,17,38,201409,2014),('2014-09-18',201438,9,2014,18,38,201409,2014),('2014-09-19',201438,9,2014,19,38,201409,2014),('2014-09-20',201438,9,2014,20,38,201409,2014),('2014-09-21',201439,9,2014,21,39,201409,2014),('2014-09-22',201439,9,2014,22,39,201409,2014),('2014-09-23',201439,9,2014,23,39,201409,2014),('2014-09-24',201439,9,2014,24,39,201409,2014),('2014-09-25',201439,9,2014,25,39,201409,2014),('2014-09-26',201439,9,2014,26,39,201409,2014),('2014-09-27',201439,9,2014,27,39,201409,2014),('2014-09-28',201440,9,2014,28,40,201409,2014),('2014-09-29',201440,9,2014,29,40,201409,2014),('2014-09-30',201440,9,2014,30,40,201409,2014),('2014-10-01',201440,10,2014,1,40,201410,2014),('2014-10-02',201440,10,2014,2,40,201410,2014),('2014-10-03',201440,10,2014,3,40,201410,2014),('2014-10-04',201440,10,2014,4,40,201410,2014),('2014-10-05',201441,10,2014,5,41,201410,2014),('2014-10-06',201441,10,2014,6,41,201410,2014),('2014-10-07',201441,10,2014,7,41,201410,2014),('2014-10-08',201441,10,2014,8,41,201410,2014),('2014-10-09',201441,10,2014,9,41,201410,2014),('2014-10-10',201441,10,2014,10,41,201410,2014),('2014-10-11',201441,10,2014,11,41,201410,2014),('2014-10-12',201442,10,2014,12,42,201410,2014),('2014-10-13',201442,10,2014,13,42,201410,2014),('2014-10-14',201442,10,2014,14,42,201410,2014),('2014-10-15',201442,10,2014,15,42,201410,2014),('2014-10-16',201442,10,2014,16,42,201410,2014),('2014-10-17',201442,10,2014,17,42,201410,2014),('2014-10-18',201442,10,2014,18,42,201410,2014),('2014-10-19',201443,10,2014,19,43,201410,2014),('2014-10-20',201443,10,2014,20,43,201410,2014),('2014-10-21',201443,10,2014,21,43,201410,2014),('2014-10-22',201443,10,2014,22,43,201410,2014),('2014-10-23',201443,10,2014,23,43,201410,2014),('2014-10-24',201443,10,2014,24,43,201410,2014),('2014-10-25',201443,10,2014,25,43,201410,2014),('2014-10-26',201444,10,2014,26,44,201410,2014),('2014-10-27',201444,10,2014,27,44,201410,2014),('2014-10-28',201444,10,2014,28,44,201410,2014),('2014-10-29',201444,10,2014,29,44,201410,2014),('2014-10-30',201444,10,2014,30,44,201410,2014),('2014-10-31',201444,10,2014,31,44,201410,2014),('2014-11-01',201444,11,2014,1,44,201411,2014),('2014-11-02',201445,11,2014,2,45,201411,2014),('2014-11-03',201445,11,2014,3,45,201411,2014),('2014-11-04',201445,11,2014,4,45,201411,2014),('2014-11-05',201445,11,2014,5,45,201411,2014),('2014-11-06',201445,11,2014,6,45,201411,2014),('2014-11-07',201445,11,2014,7,45,201411,2014),('2014-11-08',201445,11,2014,8,45,201411,2014),('2014-11-09',201446,11,2014,9,46,201411,2014),('2014-11-10',201446,11,2014,10,46,201411,2014),('2014-11-11',201446,11,2014,11,46,201411,2014),('2014-11-12',201446,11,2014,12,46,201411,2014),('2014-11-13',201446,11,2014,13,46,201411,2014),('2014-11-14',201446,11,2014,14,46,201411,2014),('2014-11-15',201446,11,2014,15,46,201411,2014),('2014-11-16',201447,11,2014,16,47,201411,2014),('2014-11-17',201447,11,2014,17,47,201411,2014),('2014-11-18',201447,11,2014,18,47,201411,2014),('2014-11-19',201447,11,2014,19,47,201411,2014),('2014-11-20',201447,11,2014,20,47,201411,2014),('2014-11-21',201447,11,2014,21,47,201411,2014),('2014-11-22',201447,11,2014,22,47,201411,2014),('2014-11-23',201448,11,2014,23,48,201411,2014),('2014-11-24',201448,11,2014,24,48,201411,2014),('2014-11-25',201448,11,2014,25,48,201411,2014),('2014-11-26',201448,11,2014,26,48,201411,2014),('2014-11-27',201448,11,2014,27,48,201411,2014),('2014-11-28',201448,11,2014,28,48,201411,2014),('2014-11-29',201448,11,2014,29,48,201411,2014),('2014-11-30',201449,11,2014,30,49,201411,2014),('2014-12-01',201449,12,2014,1,49,201412,2015),('2014-12-02',201449,12,2014,2,49,201412,2015),('2014-12-03',201449,12,2014,3,49,201412,2015),('2014-12-04',201449,12,2014,4,49,201412,2015),('2014-12-05',201449,12,2014,5,49,201412,2015),('2014-12-06',201449,12,2014,6,49,201412,2015),('2014-12-07',201450,12,2014,7,50,201412,2015),('2014-12-08',201450,12,2014,8,50,201412,2015),('2014-12-09',201450,12,2014,9,50,201412,2015),('2014-12-10',201450,12,2014,10,50,201412,2015),('2014-12-11',201450,12,2014,11,50,201412,2015),('2014-12-12',201450,12,2014,12,50,201412,2015),('2014-12-13',201450,12,2014,13,50,201412,2015),('2014-12-14',201451,12,2014,14,51,201412,2015),('2014-12-15',201451,12,2014,15,51,201412,2015),('2014-12-16',201451,12,2014,16,51,201412,2015),('2014-12-17',201451,12,2014,17,51,201412,2015),('2014-12-18',201451,12,2014,18,51,201412,2015),('2014-12-19',201451,12,2014,19,51,201412,2015),('2014-12-20',201451,12,2014,20,51,201412,2015),('2014-12-21',201452,12,2014,21,52,201412,2015),('2014-12-22',201452,12,2014,22,52,201412,2015),('2014-12-23',201452,12,2014,23,52,201412,2015),('2014-12-24',201452,12,2014,24,52,201412,2015),('2014-12-25',201452,12,2014,25,52,201412,2015),('2014-12-26',201452,12,2014,26,52,201412,2015),('2014-12-27',201452,12,2014,27,52,201412,2015),('2014-12-28',201453,12,2014,28,53,201412,2015),('2014-12-29',201453,12,2014,29,53,201412,2015),('2014-12-30',201453,12,2014,30,53,201412,2015),('2014-12-31',201453,12,2014,31,53,201412,2015),('2015-01-01',201453,1,2015,1,53,201501,2015),('2015-01-02',201453,1,2015,2,53,201501,2015),('2015-01-03',201453,1,2015,3,53,201501,2015),('2015-01-04',201501,1,2015,4,1,201501,2015),('2015-01-05',201501,1,2015,5,1,201501,2015),('2015-01-06',201501,1,2015,6,1,201501,2015),('2015-01-07',201501,1,2015,7,1,201501,2015),('2015-01-08',201501,1,2015,8,1,201501,2015),('2015-01-09',201501,1,2015,9,1,201501,2015),('2015-01-10',201501,1,2015,10,1,201501,2015),('2015-01-11',201502,1,2015,11,2,201501,2015),('2015-01-12',201502,1,2015,12,2,201501,2015),('2015-01-13',201502,1,2015,13,2,201501,2015),('2015-01-14',201502,1,2015,14,2,201501,2015),('2015-01-15',201502,1,2015,15,2,201501,2015),('2015-01-16',201502,1,2015,16,2,201501,2015),('2015-01-17',201502,1,2015,17,2,201501,2015),('2015-01-18',201503,1,2015,18,3,201501,2015),('2015-01-19',201503,1,2015,19,3,201501,2015),('2015-01-20',201503,1,2015,20,3,201501,2015),('2015-01-21',201503,1,2015,21,3,201501,2015),('2015-01-22',201503,1,2015,22,3,201501,2015),('2015-01-23',201503,1,2015,23,3,201501,2015),('2015-01-24',201503,1,2015,24,3,201501,2015),('2015-01-25',201504,1,2015,25,4,201501,2015),('2015-01-26',201504,1,2015,26,4,201501,2015),('2015-01-27',201504,1,2015,27,4,201501,2015),('2015-01-28',201504,1,2015,28,4,201501,2015),('2015-01-29',201504,1,2015,29,4,201501,2015),('2015-01-30',201504,1,2015,30,4,201501,2015),('2015-01-31',201504,1,2015,31,4,201501,2015),('2015-02-01',201505,2,2015,1,5,201502,2015),('2015-02-02',201505,2,2015,2,5,201502,2015),('2015-02-03',201505,2,2015,3,5,201502,2015),('2015-02-04',201505,2,2015,4,5,201502,2015),('2015-02-05',201505,2,2015,5,5,201502,2015),('2015-02-06',201505,2,2015,6,5,201502,2015),('2015-02-07',201505,2,2015,7,5,201502,2015),('2015-02-08',201506,2,2015,8,6,201502,2015),('2015-02-09',201506,2,2015,9,6,201502,2015),('2015-02-10',201506,2,2015,10,6,201502,2015),('2015-02-11',201506,2,2015,11,6,201502,2015),('2015-02-12',201506,2,2015,12,6,201502,2015),('2015-02-13',201506,2,2015,13,6,201502,2015),('2015-02-14',201506,2,2015,14,6,201502,2015),('2015-02-15',201507,2,2015,15,7,201502,2015),('2015-02-16',201507,2,2015,16,7,201502,2015),('2015-02-17',201507,2,2015,17,7,201502,2015),('2015-02-18',201507,2,2015,18,7,201502,2015),('2015-02-19',201507,2,2015,19,7,201502,2015),('2015-02-20',201507,2,2015,20,7,201502,2015),('2015-02-21',201507,2,2015,21,7,201502,2015),('2015-02-22',201508,2,2015,22,8,201502,2015),('2015-02-23',201508,2,2015,23,8,201502,2015),('2015-02-24',201508,2,2015,24,8,201502,2015),('2015-02-25',201508,2,2015,25,8,201502,2015),('2015-02-26',201508,2,2015,26,8,201502,2015),('2015-02-27',201508,2,2015,27,8,201502,2015),('2015-02-28',201508,2,2015,28,8,201502,2015),('2015-03-01',201509,3,2015,1,9,201503,2015),('2015-03-02',201509,3,2015,2,9,201503,2015),('2015-03-03',201509,3,2015,3,9,201503,2015),('2015-03-04',201509,3,2015,4,9,201503,2015),('2015-03-05',201509,3,2015,5,9,201503,2015),('2015-03-06',201509,3,2015,6,9,201503,2015),('2015-03-07',201509,3,2015,7,9,201503,2015),('2015-03-08',201510,3,2015,8,10,201503,2015),('2015-03-09',201510,3,2015,9,10,201503,2015),('2015-03-10',201510,3,2015,10,10,201503,2015),('2015-03-11',201510,3,2015,11,10,201503,2015),('2015-03-12',201510,3,2015,12,10,201503,2015),('2015-03-13',201510,3,2015,13,10,201503,2015),('2015-03-14',201510,3,2015,14,10,201503,2015),('2015-03-15',201511,3,2015,15,11,201503,2015),('2015-03-16',201511,3,2015,16,11,201503,2015),('2015-03-17',201511,3,2015,17,11,201503,2015),('2015-03-18',201511,3,2015,18,11,201503,2015),('2015-03-19',201511,3,2015,19,11,201503,2015),('2015-03-20',201511,3,2015,20,11,201503,2015),('2015-03-21',201511,3,2015,21,11,201503,2015),('2015-03-22',201512,3,2015,22,12,201503,2015),('2015-03-23',201512,3,2015,23,12,201503,2015),('2015-03-24',201512,3,2015,24,12,201503,2015),('2015-03-25',201512,3,2015,25,12,201503,2015),('2015-03-26',201512,3,2015,26,12,201503,2015),('2015-03-27',201512,3,2015,27,12,201503,2015),('2015-03-28',201512,3,2015,28,12,201503,2015),('2015-03-29',201513,3,2015,29,13,201503,2015),('2015-03-30',201513,3,2015,30,13,201503,2015),('2015-03-31',201513,3,2015,31,13,201503,2015),('2015-04-01',201513,4,2015,1,13,201504,2015),('2015-04-02',201513,4,2015,2,13,201504,2015),('2015-04-03',201513,4,2015,3,13,201504,2015),('2015-04-04',201513,4,2015,4,13,201504,2015),('2015-04-05',201514,4,2015,5,14,201504,2015),('2015-04-06',201514,4,2015,6,14,201504,2015),('2015-04-07',201514,4,2015,7,14,201504,2015),('2015-04-08',201514,4,2015,8,14,201504,2015),('2015-04-09',201514,4,2015,9,14,201504,2015),('2015-04-10',201514,4,2015,10,14,201504,2015),('2015-04-11',201514,4,2015,11,14,201504,2015),('2015-04-12',201515,4,2015,12,15,201504,2015),('2015-04-13',201515,4,2015,13,15,201504,2015),('2015-04-14',201515,4,2015,14,15,201504,2015),('2015-04-15',201515,4,2015,15,15,201504,2015),('2015-04-16',201515,4,2015,16,15,201504,2015),('2015-04-17',201515,4,2015,17,15,201504,2015),('2015-04-18',201515,4,2015,18,15,201504,2015),('2015-04-19',201516,4,2015,19,16,201504,2015),('2015-04-20',201516,4,2015,20,16,201504,2015),('2015-04-21',201516,4,2015,21,16,201504,2015),('2015-04-22',201516,4,2015,22,16,201504,2015),('2015-04-23',201516,4,2015,23,16,201504,2015),('2015-04-24',201516,4,2015,24,16,201504,2015),('2015-04-25',201516,4,2015,25,16,201504,2015),('2015-04-26',201517,4,2015,26,17,201504,2015),('2015-04-27',201517,4,2015,27,17,201504,2015),('2015-04-28',201517,4,2015,28,17,201504,2015),('2015-04-29',201517,4,2015,29,17,201504,2015),('2015-04-30',201517,4,2015,30,17,201504,2015),('2015-05-01',201517,5,2015,1,17,201505,2015),('2015-05-02',201517,5,2015,2,17,201505,2015),('2015-05-03',201518,5,2015,3,18,201505,2015),('2015-05-04',201518,5,2015,4,18,201505,2015),('2015-05-05',201518,5,2015,5,18,201505,2015),('2015-05-06',201518,5,2015,6,18,201505,2015),('2015-05-07',201518,5,2015,7,18,201505,2015),('2015-05-08',201518,5,2015,8,18,201505,2015),('2015-05-09',201518,5,2015,9,18,201505,2015),('2015-05-10',201519,5,2015,10,19,201505,2015),('2015-05-11',201519,5,2015,11,19,201505,2015),('2015-05-12',201519,5,2015,12,19,201505,2015),('2015-05-13',201519,5,2015,13,19,201505,2015),('2015-05-14',201519,5,2015,14,19,201505,2015),('2015-05-15',201519,5,2015,15,19,201505,2015),('2015-05-16',201519,5,2015,16,19,201505,2015),('2015-05-17',201520,5,2015,17,20,201505,2015),('2015-05-18',201520,5,2015,18,20,201505,2015),('2015-05-19',201520,5,2015,19,20,201505,2015),('2015-05-20',201520,5,2015,20,20,201505,2015),('2015-05-21',201520,5,2015,21,20,201505,2015),('2015-05-22',201520,5,2015,22,20,201505,2015),('2015-05-23',201520,5,2015,23,20,201505,2015),('2015-05-24',201521,5,2015,24,21,201505,2015),('2015-05-25',201521,5,2015,25,21,201505,2015),('2015-05-26',201521,5,2015,26,21,201505,2015),('2015-05-27',201521,5,2015,27,21,201505,2015),('2015-05-28',201521,5,2015,28,21,201505,2015),('2015-05-29',201521,5,2015,29,21,201505,2015),('2015-05-30',201521,5,2015,30,21,201505,2015),('2015-05-31',201522,5,2015,31,22,201505,2015),('2015-06-01',201522,6,2015,1,22,201506,2015),('2015-06-02',201522,6,2015,2,22,201506,2015),('2015-06-03',201522,6,2015,3,22,201506,2015),('2015-06-04',201522,6,2015,4,22,201506,2015),('2015-06-05',201522,6,2015,5,22,201506,2015),('2015-06-06',201522,6,2015,6,22,201506,2015),('2015-06-07',201523,6,2015,7,23,201506,2015),('2015-06-08',201523,6,2015,8,23,201506,2015),('2015-06-09',201523,6,2015,9,23,201506,2015),('2015-06-10',201523,6,2015,10,23,201506,2015),('2015-06-11',201523,6,2015,11,23,201506,2015),('2015-06-12',201523,6,2015,12,23,201506,2015),('2015-06-13',201523,6,2015,13,23,201506,2015),('2015-06-14',201524,6,2015,14,24,201506,2015),('2015-06-15',201524,6,2015,15,24,201506,2015),('2015-06-16',201524,6,2015,16,24,201506,2015),('2015-06-17',201524,6,2015,17,24,201506,2015),('2015-06-18',201524,6,2015,18,24,201506,2015),('2015-06-19',201524,6,2015,19,24,201506,2015),('2015-06-20',201524,6,2015,20,24,201506,2015),('2015-06-21',201525,6,2015,21,25,201506,2015),('2015-06-22',201525,6,2015,22,25,201506,2015),('2015-06-23',201525,6,2015,23,25,201506,2015),('2015-06-24',201525,6,2015,24,25,201506,2015),('2015-06-25',201525,6,2015,25,25,201506,2015),('2015-06-26',201525,6,2015,26,25,201506,2015),('2015-06-27',201525,6,2015,27,25,201506,2015),('2015-06-28',201526,6,2015,28,26,201506,2015),('2015-06-29',201526,6,2015,29,26,201506,2015),('2015-06-30',201526,6,2015,30,26,201506,2015),('2015-07-01',201526,7,2015,1,26,201507,2015),('2015-07-02',201526,7,2015,2,26,201507,2015),('2015-07-03',201526,7,2015,3,26,201507,2015),('2015-07-04',201526,7,2015,4,26,201507,2015),('2015-07-05',201527,7,2015,5,27,201507,2015),('2015-07-06',201527,7,2015,6,27,201507,2015),('2015-07-07',201527,7,2015,7,27,201507,2015),('2015-07-08',201527,7,2015,8,27,201507,2015),('2015-07-09',201527,7,2015,9,27,201507,2015),('2015-07-10',201527,7,2015,10,27,201507,2015),('2015-07-11',201527,7,2015,11,27,201507,2015),('2015-07-12',201528,7,2015,12,28,201507,2015),('2015-07-13',201528,7,2015,13,28,201507,2015),('2015-07-14',201528,7,2015,14,28,201507,2015),('2015-07-15',201528,7,2015,15,28,201507,2015),('2015-07-16',201528,7,2015,16,28,201507,2015),('2015-07-17',201528,7,2015,17,28,201507,2015),('2015-07-18',201528,7,2015,18,28,201507,2015),('2015-07-19',201529,7,2015,19,29,201507,2015),('2015-07-20',201529,7,2015,20,29,201507,2015),('2015-07-21',201529,7,2015,21,29,201507,2015),('2015-07-22',201529,7,2015,22,29,201507,2015),('2015-07-23',201529,7,2015,23,29,201507,2015),('2015-07-24',201529,7,2015,24,29,201507,2015),('2015-07-25',201529,7,2015,25,29,201507,2015),('2015-07-26',201530,7,2015,26,30,201507,2015),('2015-07-27',201530,7,2015,27,30,201507,2015),('2015-07-28',201530,7,2015,28,30,201507,2015),('2015-07-29',201530,7,2015,29,30,201507,2015),('2015-07-30',201530,7,2015,30,30,201507,2015),('2015-07-31',201530,7,2015,31,30,201507,2015),('2015-08-01',201530,8,2015,1,30,201508,2015),('2015-08-02',201531,8,2015,2,31,201508,2015),('2015-08-03',201531,8,2015,3,31,201508,2015),('2015-08-04',201531,8,2015,4,31,201508,2015),('2015-08-05',201531,8,2015,5,31,201508,2015),('2015-08-06',201531,8,2015,6,31,201508,2015),('2015-08-07',201531,8,2015,7,31,201508,2015),('2015-08-08',201531,8,2015,8,31,201508,2015),('2015-08-09',201532,8,2015,9,32,201508,2015),('2015-08-10',201532,8,2015,10,32,201508,2015),('2015-08-11',201532,8,2015,11,32,201508,2015),('2015-08-12',201532,8,2015,12,32,201508,2015),('2015-08-13',201532,8,2015,13,32,201508,2015),('2015-08-14',201532,8,2015,14,32,201508,2015),('2015-08-15',201532,8,2015,15,32,201508,2015),('2015-08-16',201533,8,2015,16,33,201508,2015),('2015-08-17',201533,8,2015,17,33,201508,2015),('2015-08-18',201533,8,2015,18,33,201508,2015),('2015-08-19',201533,8,2015,19,33,201508,2015),('2015-08-20',201533,8,2015,20,33,201508,2015),('2015-08-21',201533,8,2015,21,33,201508,2015),('2015-08-22',201533,8,2015,22,33,201508,2015),('2015-08-23',201534,8,2015,23,34,201508,2015),('2015-08-24',201534,8,2015,24,34,201508,2015),('2015-08-25',201534,8,2015,25,34,201508,2015),('2015-08-26',201534,8,2015,26,34,201508,2015),('2015-08-27',201534,8,2015,27,34,201508,2015),('2015-08-28',201534,8,2015,28,34,201508,2015),('2015-08-29',201534,8,2015,29,34,201508,2015),('2015-08-30',201535,8,2015,30,35,201508,2015),('2015-08-31',201535,8,2015,31,35,201508,2015),('2015-09-01',201535,9,2015,1,35,201509,2015),('2015-09-02',201535,9,2015,2,35,201509,2015),('2015-09-03',201535,9,2015,3,35,201509,2015),('2015-09-04',201535,9,2015,4,35,201509,2015),('2015-09-05',201535,9,2015,5,35,201509,2015),('2015-09-06',201536,9,2015,6,36,201509,2015),('2015-09-07',201536,9,2015,7,36,201509,2015),('2015-09-08',201536,9,2015,8,36,201509,2015),('2015-09-09',201536,9,2015,9,36,201509,2015),('2015-09-10',201536,9,2015,10,36,201509,2015),('2015-09-11',201536,9,2015,11,36,201509,2015),('2015-09-12',201536,9,2015,12,36,201509,2015),('2015-09-13',201537,9,2015,13,37,201509,2015),('2015-09-14',201537,9,2015,14,37,201509,2015),('2015-09-15',201537,9,2015,15,37,201509,2015),('2015-09-16',201537,9,2015,16,37,201509,2015),('2015-09-17',201537,9,2015,17,37,201509,2015),('2015-09-18',201537,9,2015,18,37,201509,2015),('2015-09-19',201537,9,2015,19,37,201509,2015),('2015-09-20',201538,9,2015,20,38,201509,2015),('2015-09-21',201538,9,2015,21,38,201509,2015),('2015-09-22',201538,9,2015,22,38,201509,2015),('2015-09-23',201538,9,2015,23,38,201509,2015),('2015-09-24',201538,9,2015,24,38,201509,2015),('2015-09-25',201538,9,2015,25,38,201509,2015),('2015-09-26',201538,9,2015,26,38,201509,2015),('2015-09-27',201539,9,2015,27,39,201509,2015),('2015-09-28',201539,9,2015,28,39,201509,2015),('2015-09-29',201539,9,2015,29,39,201509,2015),('2015-09-30',201539,9,2015,30,39,201509,2015),('2015-10-01',201539,10,2015,1,39,201510,2015),('2015-10-02',201539,10,2015,2,39,201510,2015),('2015-10-03',201539,10,2015,3,39,201510,2015),('2015-10-04',201540,10,2015,4,40,201510,2015),('2015-10-05',201540,10,2015,5,40,201510,2015),('2015-10-06',201540,10,2015,6,40,201510,2015),('2015-10-07',201540,10,2015,7,40,201510,2015),('2015-10-08',201540,10,2015,8,40,201510,2015),('2015-10-09',201540,10,2015,9,40,201510,2015),('2015-10-10',201540,10,2015,10,40,201510,2015),('2015-10-11',201541,10,2015,11,41,201510,2015),('2015-10-12',201541,10,2015,12,41,201510,2015),('2015-10-13',201541,10,2015,13,41,201510,2015),('2015-10-14',201541,10,2015,14,41,201510,2015),('2015-10-15',201541,10,2015,15,41,201510,2015),('2015-10-16',201541,10,2015,16,41,201510,2015),('2015-10-17',201541,10,2015,17,41,201510,2015),('2015-10-18',201542,10,2015,18,42,201510,2015),('2015-10-19',201542,10,2015,19,42,201510,2015),('2015-10-20',201542,10,2015,20,42,201510,2015),('2015-10-21',201542,10,2015,21,42,201510,2015),('2015-10-22',201542,10,2015,22,42,201510,2015),('2015-10-23',201542,10,2015,23,42,201510,2015),('2015-10-24',201542,10,2015,24,42,201510,2015),('2015-10-25',201543,10,2015,25,43,201510,2015),('2015-10-26',201543,10,2015,26,43,201510,2015),('2015-10-27',201543,10,2015,27,43,201510,2015),('2015-10-28',201543,10,2015,28,43,201510,2015),('2015-10-29',201543,10,2015,29,43,201510,2015),('2015-10-30',201543,10,2015,30,43,201510,2015),('2015-10-31',201543,10,2015,31,43,201510,2015),('2015-11-01',201544,11,2015,1,44,201511,2015),('2015-11-02',201544,11,2015,2,44,201511,2015),('2015-11-03',201544,11,2015,3,44,201511,2015),('2015-11-04',201544,11,2015,4,44,201511,2015),('2015-11-05',201544,11,2015,5,44,201511,2015),('2015-11-06',201544,11,2015,6,44,201511,2015),('2015-11-07',201544,11,2015,7,44,201511,2015),('2015-11-08',201545,11,2015,8,45,201511,2015),('2015-11-09',201545,11,2015,9,45,201511,2015),('2015-11-10',201545,11,2015,10,45,201511,2015),('2015-11-11',201545,11,2015,11,45,201511,2015),('2015-11-12',201545,11,2015,12,45,201511,2015),('2015-11-13',201545,11,2015,13,45,201511,2015),('2015-11-14',201545,11,2015,14,45,201511,2015),('2015-11-15',201546,11,2015,15,46,201511,2015),('2015-11-16',201546,11,2015,16,46,201511,2015),('2015-11-17',201546,11,2015,17,46,201511,2015),('2015-11-18',201546,11,2015,18,46,201511,2015),('2015-11-19',201546,11,2015,19,46,201511,2015),('2015-11-20',201546,11,2015,20,46,201511,2015),('2015-11-21',201546,11,2015,21,46,201511,2015),('2015-11-22',201547,11,2015,22,47,201511,2015),('2015-11-23',201547,11,2015,23,47,201511,2015),('2015-11-24',201547,11,2015,24,47,201511,2015),('2015-11-25',201547,11,2015,25,47,201511,2015),('2015-11-26',201547,11,2015,26,47,201511,2015),('2015-11-27',201547,11,2015,27,47,201511,2015),('2015-11-28',201547,11,2015,28,47,201511,2015),('2015-11-29',201548,11,2015,29,48,201511,2015),('2015-11-30',201548,11,2015,30,48,201511,2015),('2015-12-01',201548,12,2015,1,48,201512,2016),('2015-12-02',201548,12,2015,2,48,201512,2016),('2015-12-03',201548,12,2015,3,48,201512,2016),('2015-12-04',201548,12,2015,4,48,201512,2016),('2015-12-05',201548,12,2015,5,48,201512,2016),('2015-12-06',201549,12,2015,6,49,201512,2016),('2015-12-07',201549,12,2015,7,49,201512,2016),('2015-12-08',201549,12,2015,8,49,201512,2016),('2015-12-09',201549,12,2015,9,49,201512,2016),('2015-12-10',201549,12,2015,10,49,201512,2016),('2015-12-11',201549,12,2015,11,49,201512,2016),('2015-12-12',201549,12,2015,12,49,201512,2016),('2015-12-13',201550,12,2015,13,50,201512,2016),('2015-12-14',201550,12,2015,14,50,201512,2016),('2015-12-15',201550,12,2015,15,50,201512,2016),('2015-12-16',201550,12,2015,16,50,201512,2016),('2015-12-17',201550,12,2015,17,50,201512,2016),('2015-12-18',201550,12,2015,18,50,201512,2016),('2015-12-19',201550,12,2015,19,50,201512,2016),('2015-12-20',201551,12,2015,20,51,201512,2016),('2015-12-21',201551,12,2015,21,51,201512,2016),('2015-12-22',201551,12,2015,22,51,201512,2016),('2015-12-23',201551,12,2015,23,51,201512,2016),('2015-12-24',201551,12,2015,24,51,201512,2016),('2015-12-25',201551,12,2015,25,51,201512,2016),('2015-12-26',201551,12,2015,26,51,201512,2016),('2015-12-27',201552,12,2015,27,52,201512,2016),('2015-12-28',201552,12,2015,28,52,201512,2016),('2015-12-29',201552,12,2015,29,52,201512,2016),('2015-12-30',201552,12,2015,30,52,201512,2016),('2015-12-31',201552,12,2015,31,52,201512,2016),('2016-01-01',201552,1,2016,1,1,201601,2016),('2016-01-02',201552,1,2016,2,1,201601,2016),('2016-01-03',201601,1,2016,3,1,201601,2016),('2016-01-04',201601,1,2016,4,1,201601,2016),('2016-01-05',201601,1,2016,5,1,201601,2016),('2016-01-06',201601,1,2016,6,1,201601,2016),('2016-01-07',201601,1,2016,7,1,201601,2016),('2016-01-08',201601,1,2016,8,1,201601,2016),('2016-01-09',201601,1,2016,9,1,201601,2016),('2016-01-10',201602,1,2016,10,2,201601,2016),('2016-01-11',201602,1,2016,11,2,201601,2016),('2016-01-12',201602,1,2016,12,2,201601,2016),('2016-01-13',201602,1,2016,13,2,201601,2016),('2016-01-14',201602,1,2016,14,2,201601,2016),('2016-01-15',201602,1,2016,15,2,201601,2016),('2016-01-16',201602,1,2016,16,2,201601,2016),('2016-01-17',201603,1,2016,17,3,201601,2016),('2016-01-18',201603,1,2016,18,3,201601,2016),('2016-01-19',201603,1,2016,19,3,201601,2016),('2016-01-20',201603,1,2016,20,3,201601,2016),('2016-01-21',201603,1,2016,21,3,201601,2016),('2016-01-22',201603,1,2016,22,3,201601,2016),('2016-01-23',201603,1,2016,23,3,201601,2016),('2016-01-24',201604,1,2016,24,4,201601,2016),('2016-01-25',201604,1,2016,25,4,201601,2016),('2016-01-26',201604,1,2016,26,4,201601,2016),('2016-01-27',201604,1,2016,27,4,201601,2016),('2016-01-28',201604,1,2016,28,4,201601,2016),('2016-01-29',201604,1,2016,29,4,201601,2016),('2016-01-30',201604,1,2016,30,4,201601,2016),('2016-01-31',201605,1,2016,31,5,201601,2016),('2016-02-01',201605,2,2016,1,5,201602,2016),('2016-02-02',201605,2,2016,2,5,201602,2016),('2016-02-03',201605,2,2016,3,5,201602,2016),('2016-02-04',201605,2,2016,4,5,201602,2016),('2016-02-05',201605,2,2016,5,5,201602,2016),('2016-02-06',201605,2,2016,6,5,201602,2016),('2016-02-07',201606,2,2016,7,6,201602,2016),('2016-02-08',201606,2,2016,8,6,201602,2016),('2016-02-09',201606,2,2016,9,6,201602,2016),('2016-02-10',201606,2,2016,10,6,201602,2016),('2016-02-11',201606,2,2016,11,6,201602,2016),('2016-02-12',201606,2,2016,12,6,201602,2016),('2016-02-13',201606,2,2016,13,6,201602,2016),('2016-02-14',201607,2,2016,14,7,201602,2016),('2016-02-15',201607,2,2016,15,7,201602,2016),('2016-02-16',201607,2,2016,16,7,201602,2016),('2016-02-17',201607,2,2016,17,7,201602,2016),('2016-02-18',201607,2,2016,18,7,201602,2016),('2016-02-19',201607,2,2016,19,7,201602,2016),('2016-02-20',201607,2,2016,20,7,201602,2016),('2016-02-21',201608,2,2016,21,8,201602,2016),('2016-02-22',201608,2,2016,22,8,201602,2016),('2016-02-23',201608,2,2016,23,8,201602,2016),('2016-02-24',201608,2,2016,24,8,201602,2016),('2016-02-25',201608,2,2016,25,8,201602,2016),('2016-02-26',201608,2,2016,26,8,201602,2016),('2016-02-27',201608,2,2016,27,8,201602,2016),('2016-02-28',201609,2,2016,28,9,201602,2016),('2016-02-29',201609,2,2016,29,9,201602,2016),('2016-03-01',201609,3,2016,1,9,201603,2016),('2016-03-02',201609,3,2016,2,9,201603,2016),('2016-03-03',201609,3,2016,3,9,201603,2016),('2016-03-04',201609,3,2016,4,9,201603,2016),('2016-03-05',201609,3,2016,5,9,201603,2016),('2016-03-06',201610,3,2016,6,10,201603,2016),('2016-03-07',201610,3,2016,7,10,201603,2016),('2016-03-08',201610,3,2016,8,10,201603,2016),('2016-03-09',201610,3,2016,9,10,201603,2016),('2016-03-10',201610,3,2016,10,10,201603,2016),('2016-03-11',201610,3,2016,11,10,201603,2016),('2016-03-12',201610,3,2016,12,10,201603,2016),('2016-03-13',201611,3,2016,13,11,201603,2016),('2016-03-14',201611,3,2016,14,11,201603,2016),('2016-03-15',201611,3,2016,15,11,201603,2016),('2016-03-16',201611,3,2016,16,11,201603,2016),('2016-03-17',201611,3,2016,17,11,201603,2016),('2016-03-18',201611,3,2016,18,11,201603,2016),('2016-03-19',201611,3,2016,19,11,201603,2016),('2016-03-20',201612,3,2016,20,12,201603,2016),('2016-03-21',201612,3,2016,21,12,201603,2016),('2016-03-22',201612,3,2016,22,12,201603,2016),('2016-03-23',201612,3,2016,23,12,201603,2016),('2016-03-24',201612,3,2016,24,12,201603,2016),('2016-03-25',201612,3,2016,25,12,201603,2016),('2016-03-26',201612,3,2016,26,12,201603,2016),('2016-03-27',201613,3,2016,27,13,201603,2016),('2016-03-28',201613,3,2016,28,13,201603,2016),('2016-03-29',201613,3,2016,29,13,201603,2016),('2016-03-30',201613,3,2016,30,13,201603,2016),('2016-03-31',201613,3,2016,31,13,201603,2016),('2016-04-01',201613,4,2016,1,13,201604,2016),('2016-04-02',201613,4,2016,2,13,201604,2016),('2016-04-03',201614,4,2016,3,14,201604,2016),('2016-04-04',201614,4,2016,4,14,201604,2016),('2016-04-05',201614,4,2016,5,14,201604,2016),('2016-04-06',201614,4,2016,6,14,201604,2016),('2016-04-07',201614,4,2016,7,14,201604,2016),('2016-04-08',201614,4,2016,8,14,201604,2016),('2016-04-09',201614,4,2016,9,14,201604,2016),('2016-04-10',201615,4,2016,10,15,201604,2016),('2016-04-11',201615,4,2016,11,15,201604,2016),('2016-04-12',201615,4,2016,12,15,201604,2016),('2016-04-13',201615,4,2016,13,15,201604,2016),('2016-04-14',201615,4,2016,14,15,201604,2016),('2016-04-15',201615,4,2016,15,15,201604,2016),('2016-04-16',201615,4,2016,16,15,201604,2016),('2016-04-17',201616,4,2016,17,16,201604,2016),('2016-04-18',201616,4,2016,18,16,201604,2016),('2016-04-19',201616,4,2016,19,16,201604,2016),('2016-04-20',201616,4,2016,20,16,201604,2016),('2016-04-21',201616,4,2016,21,16,201604,2016),('2016-04-22',201616,4,2016,22,16,201604,2016),('2016-04-23',201616,4,2016,23,16,201604,2016),('2016-04-24',201617,4,2016,24,17,201604,2016),('2016-04-25',201617,4,2016,25,17,201604,2016),('2016-04-26',201617,4,2016,26,17,201604,2016),('2016-04-27',201617,4,2016,27,17,201604,2016),('2016-04-28',201617,4,2016,28,17,201604,2016),('2016-04-29',201617,4,2016,29,17,201604,2016),('2016-04-30',201617,4,2016,30,17,201604,2016),('2016-05-01',201618,5,2016,1,18,201605,2016),('2016-05-02',201618,5,2016,2,18,201605,2016),('2016-05-03',201618,5,2016,3,18,201605,2016),('2016-05-04',201618,5,2016,4,18,201605,2016),('2016-05-05',201618,5,2016,5,18,201605,2016),('2016-05-06',201618,5,2016,6,18,201605,2016),('2016-05-07',201618,5,2016,7,18,201605,2016),('2016-05-08',201619,5,2016,8,19,201605,2016),('2016-05-09',201619,5,2016,9,19,201605,2016),('2016-05-10',201619,5,2016,10,19,201605,2016),('2016-05-11',201619,5,2016,11,19,201605,2016),('2016-05-12',201619,5,2016,12,19,201605,2016),('2016-05-13',201619,5,2016,13,19,201605,2016),('2016-05-14',201619,5,2016,14,19,201605,2016),('2016-05-15',201620,5,2016,15,20,201605,2016),('2016-05-16',201620,5,2016,16,20,201605,2016),('2016-05-17',201620,5,2016,17,20,201605,2016),('2016-05-18',201620,5,2016,18,20,201605,2016),('2016-05-19',201620,5,2016,19,20,201605,2016),('2016-05-20',201620,5,2016,20,20,201605,2016),('2016-05-21',201620,5,2016,21,20,201605,2016),('2016-05-22',201621,5,2016,22,21,201605,2016),('2016-05-23',201621,5,2016,23,21,201605,2016),('2016-05-24',201621,5,2016,24,21,201605,2016),('2016-05-25',201621,5,2016,25,21,201605,2016),('2016-05-26',201621,5,2016,26,21,201605,2016),('2016-05-27',201621,5,2016,27,21,201605,2016),('2016-05-28',201621,5,2016,28,21,201605,2016),('2016-05-29',201622,5,2016,29,22,201605,2016),('2016-05-30',201622,5,2016,30,22,201605,2016),('2016-05-31',201622,5,2016,31,22,201605,2016),('2016-06-01',201622,6,2016,1,22,201606,2016),('2016-06-02',201622,6,2016,2,22,201606,2016),('2016-06-03',201622,6,2016,3,22,201606,2016),('2016-06-04',201622,6,2016,4,22,201606,2016),('2016-06-05',201623,6,2016,5,23,201606,2016),('2016-06-06',201623,6,2016,6,23,201606,2016),('2016-06-07',201623,6,2016,7,23,201606,2016),('2016-06-08',201623,6,2016,8,23,201606,2016),('2016-06-09',201623,6,2016,9,23,201606,2016),('2016-06-10',201623,6,2016,10,23,201606,2016),('2016-06-11',201623,6,2016,11,23,201606,2016),('2016-06-12',201624,6,2016,12,24,201606,2016),('2016-06-13',201624,6,2016,13,24,201606,2016),('2016-06-14',201624,6,2016,14,24,201606,2016),('2016-06-15',201624,6,2016,15,24,201606,2016),('2016-06-16',201624,6,2016,16,24,201606,2016),('2016-06-17',201624,6,2016,17,24,201606,2016),('2016-06-18',201624,6,2016,18,24,201606,2016),('2016-06-19',201625,6,2016,19,25,201606,2016),('2016-06-20',201625,6,2016,20,25,201606,2016),('2016-06-21',201625,6,2016,21,25,201606,2016),('2016-06-22',201625,6,2016,22,25,201606,2016),('2016-06-23',201625,6,2016,23,25,201606,2016),('2016-06-24',201625,6,2016,24,25,201606,2016),('2016-06-25',201625,6,2016,25,25,201606,2016),('2016-06-26',201626,6,2016,26,26,201606,2016),('2016-06-27',201626,6,2016,27,26,201606,2016),('2016-06-28',201626,6,2016,28,26,201606,2016),('2016-06-29',201626,6,2016,29,26,201606,2016),('2016-06-30',201626,6,2016,30,26,201606,2016),('2016-07-01',201626,7,2016,1,26,201607,2016),('2016-07-02',201626,7,2016,2,26,201607,2016),('2016-07-03',201627,7,2016,3,27,201607,2016),('2016-07-04',201627,7,2016,4,27,201607,2016),('2016-07-05',201627,7,2016,5,27,201607,2016),('2016-07-06',201627,7,2016,6,27,201607,2016),('2016-07-07',201627,7,2016,7,27,201607,2016),('2016-07-08',201627,7,2016,8,27,201607,2016),('2016-07-09',201627,7,2016,9,27,201607,2016),('2016-07-10',201628,7,2016,10,28,201607,2016),('2016-07-11',201628,7,2016,11,28,201607,2016),('2016-07-12',201628,7,2016,12,28,201607,2016),('2016-07-13',201628,7,2016,13,28,201607,2016),('2016-07-14',201628,7,2016,14,28,201607,2016),('2016-07-15',201628,7,2016,15,28,201607,2016),('2016-07-16',201628,7,2016,16,28,201607,2016),('2016-07-17',201629,7,2016,17,29,201607,2016),('2016-07-18',201629,7,2016,18,29,201607,2016),('2016-07-19',201629,7,2016,19,29,201607,2016),('2016-07-20',201629,7,2016,20,29,201607,2016),('2016-07-21',201629,7,2016,21,29,201607,2016),('2016-07-22',201629,7,2016,22,29,201607,2016),('2016-07-23',201629,7,2016,23,29,201607,2016),('2016-07-24',201630,7,2016,24,30,201607,2016),('2016-07-25',201630,7,2016,25,30,201607,2016),('2016-07-26',201630,7,2016,26,30,201607,2016),('2016-07-27',201630,7,2016,27,30,201607,2016),('2016-07-28',201630,7,2016,28,30,201607,2016),('2016-07-29',201630,7,2016,29,30,201607,2016),('2016-07-30',201630,7,2016,30,30,201607,2016),('2016-07-31',201631,7,2016,31,31,201607,2016),('2016-08-01',201631,8,2016,1,31,201608,2016),('2016-08-02',201631,8,2016,2,31,201608,2016),('2016-08-03',201631,8,2016,3,31,201608,2016),('2016-08-04',201631,8,2016,4,31,201608,2016),('2016-08-05',201631,8,2016,5,31,201608,2016),('2016-08-06',201631,8,2016,6,31,201608,2016),('2016-08-07',201632,8,2016,7,32,201608,2016),('2016-08-08',201632,8,2016,8,32,201608,2016),('2016-08-09',201632,8,2016,9,32,201608,2016),('2016-08-10',201632,8,2016,10,32,201608,2016),('2016-08-11',201632,8,2016,11,32,201608,2016),('2016-08-12',201632,8,2016,12,32,201608,2016),('2016-08-13',201632,8,2016,13,32,201608,2016),('2016-08-14',201633,8,2016,14,33,201608,2016),('2016-08-15',201633,8,2016,15,33,201608,2016),('2016-08-16',201633,8,2016,16,33,201608,2016),('2016-08-17',201633,8,2016,17,33,201608,2016),('2016-08-18',201633,8,2016,18,33,201608,2016),('2016-08-19',201633,8,2016,19,33,201608,2016),('2016-08-20',201633,8,2016,20,33,201608,2016),('2016-08-21',201634,8,2016,21,34,201608,2016),('2016-08-22',201634,8,2016,22,34,201608,2016),('2016-08-23',201634,8,2016,23,34,201608,2016),('2016-08-24',201634,8,2016,24,34,201608,2016),('2016-08-25',201634,8,2016,25,34,201608,2016),('2016-08-26',201634,8,2016,26,34,201608,2016),('2016-08-27',201634,8,2016,27,34,201608,2016),('2016-08-28',201635,8,2016,28,35,201608,2016),('2016-08-29',201635,8,2016,29,35,201608,2016),('2016-08-30',201635,8,2016,30,35,201608,2016),('2016-08-31',201635,8,2016,31,35,201608,2016),('2016-09-01',201635,9,2016,1,35,201609,2016),('2016-09-02',201635,9,2016,2,35,201609,2016),('2016-09-03',201635,9,2016,3,35,201609,2016),('2016-09-04',201636,9,2016,4,36,201609,2016),('2016-09-05',201636,9,2016,5,36,201609,2016),('2016-09-06',201636,9,2016,6,36,201609,2016),('2016-09-07',201636,9,2016,7,36,201609,2016),('2016-09-08',201636,9,2016,8,36,201609,2016),('2016-09-09',201636,9,2016,9,36,201609,2016),('2016-09-10',201636,9,2016,10,36,201609,2016),('2016-09-11',201637,9,2016,11,37,201609,2016),('2016-09-12',201637,9,2016,12,37,201609,2016),('2016-09-13',201637,9,2016,13,37,201609,2016),('2016-09-14',201637,9,2016,14,37,201609,2016),('2016-09-15',201637,9,2016,15,37,201609,2016),('2016-09-16',201637,9,2016,16,37,201609,2016),('2016-09-17',201637,9,2016,17,37,201609,2016),('2016-09-18',201638,9,2016,18,38,201609,2016),('2016-09-19',201638,9,2016,19,38,201609,2016),('2016-09-20',201638,9,2016,20,38,201609,2016),('2016-09-21',201638,9,2016,21,38,201609,2016),('2016-09-22',201638,9,2016,22,38,201609,2016),('2016-09-23',201638,9,2016,23,38,201609,2016),('2016-09-24',201638,9,2016,24,38,201609,2016),('2016-09-25',201639,9,2016,25,39,201609,2016),('2016-09-26',201639,9,2016,26,39,201609,2016),('2016-09-27',201639,9,2016,27,39,201609,2016),('2016-09-28',201639,9,2016,28,39,201609,2016),('2016-09-29',201639,9,2016,29,39,201609,2016),('2016-09-30',201639,9,2016,30,39,201609,2016),('2016-10-01',201639,10,2016,1,39,201610,2016),('2016-10-02',201640,10,2016,2,40,201610,2016),('2016-10-03',201640,10,2016,3,40,201610,2016),('2016-10-04',201640,10,2016,4,40,201610,2016),('2016-10-05',201640,10,2016,5,40,201610,2016),('2016-10-06',201640,10,2016,6,40,201610,2016),('2016-10-07',201640,10,2016,7,40,201610,2016),('2016-10-08',201640,10,2016,8,40,201610,2016),('2016-10-09',201641,10,2016,9,41,201610,2016),('2016-10-10',201641,10,2016,10,41,201610,2016),('2016-10-11',201641,10,2016,11,41,201610,2016),('2016-10-12',201641,10,2016,12,41,201610,2016),('2016-10-13',201641,10,2016,13,41,201610,2016),('2016-10-14',201641,10,2016,14,41,201610,2016),('2016-10-15',201641,10,2016,15,41,201610,2016),('2016-10-16',201642,10,2016,16,42,201610,2016),('2016-10-17',201642,10,2016,17,42,201610,2016),('2016-10-18',201642,10,2016,18,42,201610,2016),('2016-10-19',201642,10,2016,19,42,201610,2016),('2016-10-20',201642,10,2016,20,42,201610,2016),('2016-10-21',201642,10,2016,21,42,201610,2016),('2016-10-22',201642,10,2016,22,42,201610,2016),('2016-10-23',201643,10,2016,23,43,201610,2016),('2016-10-24',201643,10,2016,24,43,201610,2016),('2016-10-25',201643,10,2016,25,43,201610,2016),('2016-10-26',201643,10,2016,26,43,201610,2016),('2016-10-27',201643,10,2016,27,43,201610,2016),('2016-10-28',201643,10,2016,28,43,201610,2016),('2016-10-29',201643,10,2016,29,43,201610,2016),('2016-10-30',201644,10,2016,30,44,201610,2016),('2016-10-31',201644,10,2016,31,44,201610,2016),('2016-11-01',201644,11,2016,1,44,201611,2016),('2016-11-02',201644,11,2016,2,44,201611,2016),('2016-11-03',201644,11,2016,3,44,201611,2016),('2016-11-04',201644,11,2016,4,44,201611,2016),('2016-11-05',201644,11,2016,5,44,201611,2016),('2016-11-06',201645,11,2016,6,45,201611,2016),('2016-11-07',201645,11,2016,7,45,201611,2016),('2016-11-08',201645,11,2016,8,45,201611,2016),('2016-11-09',201645,11,2016,9,45,201611,2016),('2016-11-10',201645,11,2016,10,45,201611,2016),('2016-11-11',201645,11,2016,11,45,201611,2016),('2016-11-12',201645,11,2016,12,45,201611,2016),('2016-11-13',201646,11,2016,13,46,201611,2016),('2016-11-14',201646,11,2016,14,46,201611,2016),('2016-11-15',201646,11,2016,15,46,201611,2016),('2016-11-16',201646,11,2016,16,46,201611,2016),('2016-11-17',201646,11,2016,17,46,201611,2016),('2016-11-18',201646,11,2016,18,46,201611,2016),('2016-11-19',201646,11,2016,19,46,201611,2016),('2016-11-20',201647,11,2016,20,47,201611,2016),('2016-11-21',201647,11,2016,21,47,201611,2016),('2016-11-22',201647,11,2016,22,47,201611,2016),('2016-11-23',201647,11,2016,23,47,201611,2016),('2016-11-24',201647,11,2016,24,47,201611,2016),('2016-11-25',201647,11,2016,25,47,201611,2016),('2016-11-26',201647,11,2016,26,47,201611,2016),('2016-11-27',201648,11,2016,27,48,201611,2016),('2016-11-28',201648,11,2016,28,48,201611,2016),('2016-11-29',201648,11,2016,29,48,201611,2016),('2016-11-30',201648,11,2016,30,48,201611,2016),('2016-12-01',201648,12,2016,1,48,201612,2017),('2016-12-02',201648,12,2016,2,48,201612,2017),('2016-12-03',201648,12,2016,3,48,201612,2017),('2016-12-04',201649,12,2016,4,49,201612,2017),('2016-12-05',201649,12,2016,5,49,201612,2017),('2016-12-06',201649,12,2016,6,49,201612,2017),('2016-12-07',201649,12,2016,7,49,201612,2017),('2016-12-08',201649,12,2016,8,49,201612,2017),('2016-12-09',201649,12,2016,9,49,201612,2017),('2016-12-10',201649,12,2016,10,49,201612,2017),('2016-12-11',201650,12,2016,11,50,201612,2017),('2016-12-12',201650,12,2016,12,50,201612,2017),('2016-12-13',201650,12,2016,13,50,201612,2017),('2016-12-14',201650,12,2016,14,50,201612,2017),('2016-12-15',201650,12,2016,15,50,201612,2017),('2016-12-16',201650,12,2016,16,50,201612,2017),('2016-12-17',201650,12,2016,17,50,201612,2017),('2016-12-18',201651,12,2016,18,51,201612,2017),('2016-12-19',201651,12,2016,19,51,201612,2017),('2016-12-20',201651,12,2016,20,51,201612,2017),('2016-12-21',201651,12,2016,21,51,201612,2017),('2016-12-22',201651,12,2016,22,51,201612,2017),('2016-12-23',201651,12,2016,23,51,201612,2017),('2016-12-24',201651,12,2016,24,51,201612,2017),('2016-12-25',201652,12,2016,25,52,201612,2017),('2016-12-26',201652,12,2016,26,52,201612,2017),('2016-12-27',201652,12,2016,27,52,201612,2017),('2016-12-28',201652,12,2016,28,52,201612,2017),('2016-12-29',201652,12,2016,29,52,201612,2017),('2016-12-30',201652,12,2016,30,52,201612,2017),('2016-12-31',201652,12,2016,31,52,201612,2017),('2017-01-01',201701,1,2017,1,1,201701,2017),('2017-01-02',201701,1,2017,2,1,201701,2017),('2017-01-03',201701,1,2017,3,1,201701,2017),('2017-01-04',201701,1,2017,4,1,201701,2017),('2017-01-05',201701,1,2017,5,1,201701,2017),('2017-01-06',201701,1,2017,6,1,201701,2017),('2017-01-07',201701,1,2017,7,1,201701,2017),('2017-01-08',201702,1,2017,8,2,201701,2017),('2017-01-09',201702,1,2017,9,2,201701,2017),('2017-01-10',201702,1,2017,10,2,201701,2017),('2017-01-11',201702,1,2017,11,2,201701,2017),('2017-01-12',201702,1,2017,12,2,201701,2017),('2017-01-13',201702,1,2017,13,2,201701,2017),('2017-01-14',201702,1,2017,14,2,201701,2017),('2017-01-15',201703,1,2017,15,3,201701,2017),('2017-01-16',201703,1,2017,16,3,201701,2017),('2017-01-17',201703,1,2017,17,3,201701,2017),('2017-01-18',201703,1,2017,18,3,201701,2017),('2017-01-19',201703,1,2017,19,3,201701,2017),('2017-01-20',201703,1,2017,20,3,201701,2017),('2017-01-21',201703,1,2017,21,3,201701,2017),('2017-01-22',201704,1,2017,22,4,201701,2017),('2017-01-23',201704,1,2017,23,4,201701,2017),('2017-01-24',201704,1,2017,24,4,201701,2017),('2017-01-25',201704,1,2017,25,4,201701,2017),('2017-01-26',201704,1,2017,26,4,201701,2017),('2017-01-27',201704,1,2017,27,4,201701,2017),('2017-01-28',201704,1,2017,28,4,201701,2017),('2017-01-29',201705,1,2017,29,5,201701,2017),('2017-01-30',201705,1,2017,30,5,201701,2017),('2017-01-31',201705,1,2017,31,5,201701,2017),('2017-02-01',201705,2,2017,1,5,201702,2017),('2017-02-02',201705,2,2017,2,5,201702,2017),('2017-02-03',201705,2,2017,3,5,201702,2017),('2017-02-04',201705,2,2017,4,5,201702,2017),('2017-02-05',201706,2,2017,5,6,201702,2017),('2017-02-06',201706,2,2017,6,6,201702,2017),('2017-02-07',201706,2,2017,7,6,201702,2017),('2017-02-08',201706,2,2017,8,6,201702,2017),('2017-02-09',201706,2,2017,9,6,201702,2017),('2017-02-10',201706,2,2017,10,6,201702,2017),('2017-02-11',201706,2,2017,11,6,201702,2017),('2017-02-12',201707,2,2017,12,7,201702,2017),('2017-02-13',201707,2,2017,13,7,201702,2017),('2017-02-14',201707,2,2017,14,7,201702,2017),('2017-02-15',201707,2,2017,15,7,201702,2017),('2017-02-16',201707,2,2017,16,7,201702,2017),('2017-02-17',201707,2,2017,17,7,201702,2017),('2017-02-18',201707,2,2017,18,7,201702,2017),('2017-02-19',201708,2,2017,19,8,201702,2017),('2017-02-20',201708,2,2017,20,8,201702,2017),('2017-02-21',201708,2,2017,21,8,201702,2017),('2017-02-22',201708,2,2017,22,8,201702,2017),('2017-02-23',201708,2,2017,23,8,201702,2017),('2017-02-24',201708,2,2017,24,8,201702,2017),('2017-02-25',201708,2,2017,25,8,201702,2017),('2017-02-26',201709,2,2017,26,9,201702,2017),('2017-02-27',201709,2,2017,27,9,201702,2017),('2017-02-28',201709,2,2017,28,9,201702,2017),('2017-03-01',201709,3,2017,1,9,201703,2017),('2017-03-02',201709,3,2017,2,9,201703,2017),('2017-03-03',201709,3,2017,3,9,201703,2017),('2017-03-04',201709,3,2017,4,9,201703,2017),('2017-03-05',201710,3,2017,5,10,201703,2017),('2017-03-06',201710,3,2017,6,10,201703,2017),('2017-03-07',201710,3,2017,7,10,201703,2017),('2017-03-08',201710,3,2017,8,10,201703,2017),('2017-03-09',201710,3,2017,9,10,201703,2017),('2017-03-10',201710,3,2017,10,10,201703,2017),('2017-03-11',201710,3,2017,11,10,201703,2017),('2017-03-12',201711,3,2017,12,11,201703,2017),('2017-03-13',201711,3,2017,13,11,201703,2017),('2017-03-14',201711,3,2017,14,11,201703,2017),('2017-03-15',201711,3,2017,15,11,201703,2017),('2017-03-16',201711,3,2017,16,11,201703,2017),('2017-03-17',201711,3,2017,17,11,201703,2017),('2017-03-18',201711,3,2017,18,11,201703,2017),('2017-03-19',201712,3,2017,19,12,201703,2017),('2017-03-20',201712,3,2017,20,12,201703,2017),('2017-03-21',201712,3,2017,21,12,201703,2017),('2017-03-22',201712,3,2017,22,12,201703,2017),('2017-03-23',201712,3,2017,23,12,201703,2017),('2017-03-24',201712,3,2017,24,12,201703,2017),('2017-03-25',201712,3,2017,25,12,201703,2017),('2017-03-26',201713,3,2017,26,13,201703,2017),('2017-03-27',201713,3,2017,27,13,201703,2017),('2017-03-28',201713,3,2017,28,13,201703,2017),('2017-03-29',201713,3,2017,29,13,201703,2017),('2017-03-30',201713,3,2017,30,13,201703,2017),('2017-03-31',201713,3,2017,31,13,201703,2017),('2017-04-01',201713,4,2017,1,13,201704,2017),('2017-04-02',201714,4,2017,2,14,201704,2017),('2017-04-03',201714,4,2017,3,14,201704,2017),('2017-04-04',201714,4,2017,4,14,201704,2017),('2017-04-05',201714,4,2017,5,14,201704,2017),('2017-04-06',201714,4,2017,6,14,201704,2017),('2017-04-07',201714,4,2017,7,14,201704,2017),('2017-04-08',201714,4,2017,8,14,201704,2017),('2017-04-09',201715,4,2017,9,15,201704,2017),('2017-04-10',201715,4,2017,10,15,201704,2017),('2017-04-11',201715,4,2017,11,15,201704,2017),('2017-04-12',201715,4,2017,12,15,201704,2017),('2017-04-13',201715,4,2017,13,15,201704,2017),('2017-04-14',201715,4,2017,14,15,201704,2017),('2017-04-15',201715,4,2017,15,15,201704,2017),('2017-04-16',201716,4,2017,16,16,201704,2017),('2017-04-17',201716,4,2017,17,16,201704,2017),('2017-04-18',201716,4,2017,18,16,201704,2017),('2017-04-19',201716,4,2017,19,16,201704,2017),('2017-04-20',201716,4,2017,20,16,201704,2017),('2017-04-21',201716,4,2017,21,16,201704,2017),('2017-04-22',201716,4,2017,22,16,201704,2017),('2017-04-23',201717,4,2017,23,17,201704,2017),('2017-04-24',201717,4,2017,24,17,201704,2017),('2017-04-25',201717,4,2017,25,17,201704,2017),('2017-04-26',201717,4,2017,26,17,201704,2017),('2017-04-27',201717,4,2017,27,17,201704,2017),('2017-04-28',201717,4,2017,28,17,201704,2017),('2017-04-29',201717,4,2017,29,17,201704,2017),('2017-04-30',201718,4,2017,30,18,201704,2017),('2017-05-01',201718,5,2017,1,18,201705,2017),('2017-05-02',201718,5,2017,2,18,201705,2017),('2017-05-03',201718,5,2017,3,18,201705,2017),('2017-05-04',201718,5,2017,4,18,201705,2017),('2017-05-05',201718,5,2017,5,18,201705,2017),('2017-05-06',201718,5,2017,6,18,201705,2017),('2017-05-07',201719,5,2017,7,19,201705,2017),('2017-05-08',201719,5,2017,8,19,201705,2017),('2017-05-09',201719,5,2017,9,19,201705,2017),('2017-05-10',201719,5,2017,10,19,201705,2017),('2017-05-11',201719,5,2017,11,19,201705,2017),('2017-05-12',201719,5,2017,12,19,201705,2017),('2017-05-13',201719,5,2017,13,19,201705,2017),('2017-05-14',201720,5,2017,14,20,201705,2017),('2017-05-15',201720,5,2017,15,20,201705,2017),('2017-05-16',201720,5,2017,16,20,201705,2017),('2017-05-17',201720,5,2017,17,20,201705,2017),('2017-05-18',201720,5,2017,18,20,201705,2017),('2017-05-19',201720,5,2017,19,20,201705,2017),('2017-05-20',201720,5,2017,20,20,201705,2017),('2017-05-21',201721,5,2017,21,21,201705,2017),('2017-05-22',201721,5,2017,22,21,201705,2017),('2017-05-23',201721,5,2017,23,21,201705,2017),('2017-05-24',201721,5,2017,24,21,201705,2017),('2017-05-25',201721,5,2017,25,21,201705,2017),('2017-05-26',201721,5,2017,26,21,201705,2017),('2017-05-27',201721,5,2017,27,21,201705,2017),('2017-05-28',201722,5,2017,28,22,201705,2017),('2017-05-29',201722,5,2017,29,22,201705,2017),('2017-05-30',201722,5,2017,30,22,201705,2017),('2017-05-31',201722,5,2017,31,22,201705,2017),('2017-06-01',201722,6,2017,1,22,201706,2017),('2017-06-02',201722,6,2017,2,22,201706,2017),('2017-06-03',201722,6,2017,3,22,201706,2017),('2017-06-04',201723,6,2017,4,23,201706,2017),('2017-06-05',201723,6,2017,5,23,201706,2017),('2017-06-06',201723,6,2017,6,23,201706,2017),('2017-06-07',201723,6,2017,7,23,201706,2017),('2017-06-08',201723,6,2017,8,23,201706,2017),('2017-06-09',201723,6,2017,9,23,201706,2017),('2017-06-10',201723,6,2017,10,23,201706,2017),('2017-06-11',201724,6,2017,11,24,201706,2017),('2017-06-12',201724,6,2017,12,24,201706,2017),('2017-06-13',201724,6,2017,13,24,201706,2017),('2017-06-14',201724,6,2017,14,24,201706,2017),('2017-06-15',201724,6,2017,15,24,201706,2017),('2017-06-16',201724,6,2017,16,24,201706,2017),('2017-06-17',201724,6,2017,17,24,201706,2017),('2017-06-18',201725,6,2017,18,25,201706,2017),('2017-06-19',201725,6,2017,19,25,201706,2017),('2017-06-20',201725,6,2017,20,25,201706,2017),('2017-06-21',201725,6,2017,21,25,201706,2017),('2017-06-22',201725,6,2017,22,25,201706,2017),('2017-06-23',201725,6,2017,23,25,201706,2017),('2017-06-24',201725,6,2017,24,25,201706,2017),('2017-06-25',201726,6,2017,25,26,201706,2017),('2017-06-26',201726,6,2017,26,26,201706,2017),('2017-06-27',201726,6,2017,27,26,201706,2017),('2017-06-28',201726,6,2017,28,26,201706,2017),('2017-06-29',201726,6,2017,29,26,201706,2017),('2017-06-30',201726,6,2017,30,26,201706,2017),('2017-07-01',201726,7,2017,1,26,201707,2017),('2017-07-02',201727,7,2017,2,27,201707,2017),('2017-07-03',201727,7,2017,3,27,201707,2017),('2017-07-04',201727,7,2017,4,27,201707,2017),('2017-07-05',201727,7,2017,5,27,201707,2017),('2017-07-06',201727,7,2017,6,27,201707,2017),('2017-07-07',201727,7,2017,7,27,201707,2017),('2017-07-08',201727,7,2017,8,27,201707,2017),('2017-07-09',201728,7,2017,9,28,201707,2017),('2017-07-10',201728,7,2017,10,28,201707,2017),('2017-07-11',201728,7,2017,11,28,201707,2017),('2017-07-12',201728,7,2017,12,28,201707,2017),('2017-07-13',201728,7,2017,13,28,201707,2017),('2017-07-14',201728,7,2017,14,28,201707,2017),('2017-07-15',201728,7,2017,15,28,201707,2017),('2017-07-16',201729,7,2017,16,29,201707,2017),('2017-07-17',201729,7,2017,17,29,201707,2017),('2017-07-18',201729,7,2017,18,29,201707,2017),('2017-07-19',201729,7,2017,19,29,201707,2017),('2017-07-20',201729,7,2017,20,29,201707,2017),('2017-07-21',201729,7,2017,21,29,201707,2017),('2017-07-22',201729,7,2017,22,29,201707,2017),('2017-07-23',201730,7,2017,23,30,201707,2017),('2017-07-24',201730,7,2017,24,30,201707,2017),('2017-07-25',201730,7,2017,25,30,201707,2017),('2017-07-26',201730,7,2017,26,30,201707,2017),('2017-07-27',201730,7,2017,27,30,201707,2017),('2017-07-28',201730,7,2017,28,30,201707,2017),('2017-07-29',201730,7,2017,29,30,201707,2017),('2017-07-30',201731,7,2017,30,31,201707,2017),('2017-07-31',201731,7,2017,31,31,201707,2017),('2017-08-01',201731,8,2017,1,31,201708,2017),('2017-08-02',201731,8,2017,2,31,201708,2017),('2017-08-03',201731,8,2017,3,31,201708,2017),('2017-08-04',201731,8,2017,4,31,201708,2017),('2017-08-05',201731,8,2017,5,31,201708,2017),('2017-08-06',201732,8,2017,6,32,201708,2017),('2017-08-07',201732,8,2017,7,32,201708,2017),('2017-08-08',201732,8,2017,8,32,201708,2017),('2017-08-09',201732,8,2017,9,32,201708,2017),('2017-08-10',201732,8,2017,10,32,201708,2017),('2017-08-11',201732,8,2017,11,32,201708,2017),('2017-08-12',201732,8,2017,12,32,201708,2017),('2017-08-13',201733,8,2017,13,33,201708,2017),('2017-08-14',201733,8,2017,14,33,201708,2017),('2017-08-15',201733,8,2017,15,33,201708,2017),('2017-08-16',201733,8,2017,16,33,201708,2017),('2017-08-17',201733,8,2017,17,33,201708,2017),('2017-08-18',201733,8,2017,18,33,201708,2017),('2017-08-19',201733,8,2017,19,33,201708,2017),('2017-08-20',201734,8,2017,20,34,201708,2017),('2017-08-21',201734,8,2017,21,34,201708,2017),('2017-08-22',201734,8,2017,22,34,201708,2017),('2017-08-23',201734,8,2017,23,34,201708,2017),('2017-08-24',201734,8,2017,24,34,201708,2017),('2017-08-25',201734,8,2017,25,34,201708,2017),('2017-08-26',201734,8,2017,26,34,201708,2017),('2017-08-27',201735,8,2017,27,35,201708,2017),('2017-08-28',201735,8,2017,28,35,201708,2017),('2017-08-29',201735,8,2017,29,35,201708,2017),('2017-08-30',201735,8,2017,30,35,201708,2017),('2017-08-31',201735,8,2017,31,35,201708,2017),('2017-09-01',201735,9,2017,1,35,201709,2017),('2017-09-02',201735,9,2017,2,35,201709,2017),('2017-09-03',201736,9,2017,3,36,201709,2017),('2017-09-04',201736,9,2017,4,36,201709,2017),('2017-09-05',201736,9,2017,5,36,201709,2017),('2017-09-06',201736,9,2017,6,36,201709,2017),('2017-09-07',201736,9,2017,7,36,201709,2017),('2017-09-08',201736,9,2017,8,36,201709,2017),('2017-09-09',201736,9,2017,9,36,201709,2017),('2017-09-10',201737,9,2017,10,37,201709,2017),('2017-09-11',201737,9,2017,11,37,201709,2017),('2017-09-12',201737,9,2017,12,37,201709,2017),('2017-09-13',201737,9,2017,13,37,201709,2017),('2017-09-14',201737,9,2017,14,37,201709,2017),('2017-09-15',201737,9,2017,15,37,201709,2017),('2017-09-16',201737,9,2017,16,37,201709,2017),('2017-09-17',201738,9,2017,17,38,201709,2017),('2017-09-18',201738,9,2017,18,38,201709,2017),('2017-09-19',201738,9,2017,19,38,201709,2017),('2017-09-20',201738,9,2017,20,38,201709,2017),('2017-09-21',201738,9,2017,21,38,201709,2017),('2017-09-22',201738,9,2017,22,38,201709,2017),('2017-09-23',201738,9,2017,23,38,201709,2017),('2017-09-24',201739,9,2017,24,39,201709,2017),('2017-09-25',201739,9,2017,25,39,201709,2017),('2017-09-26',201739,9,2017,26,39,201709,2017),('2017-09-27',201739,9,2017,27,39,201709,2017),('2017-09-28',201739,9,2017,28,39,201709,2017),('2017-09-29',201739,9,2017,29,39,201709,2017),('2017-09-30',201739,9,2017,30,39,201709,2017),('2017-10-01',201740,10,2017,1,40,201710,2017),('2017-10-02',201740,10,2017,2,40,201710,2017),('2017-10-03',201740,10,2017,3,40,201710,2017),('2017-10-04',201740,10,2017,4,40,201710,2017),('2017-10-05',201740,10,2017,5,40,201710,2017),('2017-10-06',201740,10,2017,6,40,201710,2017),('2017-10-07',201740,10,2017,7,40,201710,2017),('2017-10-08',201741,10,2017,8,41,201710,2017),('2017-10-09',201741,10,2017,9,41,201710,2017),('2017-10-10',201741,10,2017,10,41,201710,2017),('2017-10-11',201741,10,2017,11,41,201710,2017),('2017-10-12',201741,10,2017,12,41,201710,2017),('2017-10-13',201741,10,2017,13,41,201710,2017),('2017-10-14',201741,10,2017,14,41,201710,2017),('2017-10-15',201742,10,2017,15,42,201710,2017),('2017-10-16',201742,10,2017,16,42,201710,2017),('2017-10-17',201742,10,2017,17,42,201710,2017),('2017-10-18',201742,10,2017,18,42,201710,2017),('2017-10-19',201742,10,2017,19,42,201710,2017),('2017-10-20',201742,10,2017,20,42,201710,2017),('2017-10-21',201742,10,2017,21,42,201710,2017),('2017-10-22',201743,10,2017,22,43,201710,2017),('2017-10-23',201743,10,2017,23,43,201710,2017),('2017-10-24',201743,10,2017,24,43,201710,2017),('2017-10-25',201743,10,2017,25,43,201710,2017),('2017-10-26',201743,10,2017,26,43,201710,2017),('2017-10-27',201743,10,2017,27,43,201710,2017),('2017-10-28',201743,10,2017,28,43,201710,2017),('2017-10-29',201744,10,2017,29,44,201710,2017),('2017-10-30',201744,10,2017,30,44,201710,2017),('2017-10-31',201744,10,2017,31,44,201710,2017),('2017-11-01',201744,11,2017,1,44,201711,2017),('2017-11-02',201744,11,2017,2,44,201711,2017),('2017-11-03',201744,11,2017,3,44,201711,2017),('2017-11-04',201744,11,2017,4,44,201711,2017),('2017-11-05',201745,11,2017,5,45,201711,2017),('2017-11-06',201745,11,2017,6,45,201711,2017),('2017-11-07',201745,11,2017,7,45,201711,2017),('2017-11-08',201745,11,2017,8,45,201711,2017),('2017-11-09',201745,11,2017,9,45,201711,2017),('2017-11-10',201745,11,2017,10,45,201711,2017),('2017-11-11',201745,11,2017,11,45,201711,2017),('2017-11-12',201746,11,2017,12,46,201711,2017),('2017-11-13',201746,11,2017,13,46,201711,2017),('2017-11-14',201746,11,2017,14,46,201711,2017),('2017-11-15',201746,11,2017,15,46,201711,2017),('2017-11-16',201746,11,2017,16,46,201711,2017),('2017-11-17',201746,11,2017,17,46,201711,2017),('2017-11-18',201746,11,2017,18,46,201711,2017),('2017-11-19',201747,11,2017,19,47,201711,2017),('2017-11-20',201747,11,2017,20,47,201711,2017),('2017-11-21',201747,11,2017,21,47,201711,2017),('2017-11-22',201747,11,2017,22,47,201711,2017),('2017-11-23',201747,11,2017,23,47,201711,2017),('2017-11-24',201747,11,2017,24,47,201711,2017),('2017-11-25',201747,11,2017,25,47,201711,2017),('2017-11-26',201748,11,2017,26,48,201711,2017),('2017-11-27',201748,11,2017,27,48,201711,2017),('2017-11-28',201748,11,2017,28,48,201711,2017),('2017-11-29',201748,11,2017,29,48,201711,2017),('2017-11-30',201748,11,2017,30,48,201711,2017),('2017-12-01',201748,12,2017,1,48,201712,2018),('2017-12-02',201748,12,2017,2,48,201712,2018),('2017-12-03',201749,12,2017,3,49,201712,2018),('2017-12-04',201749,12,2017,4,49,201712,2018),('2017-12-05',201749,12,2017,5,49,201712,2018),('2017-12-06',201749,12,2017,6,49,201712,2018),('2017-12-07',201749,12,2017,7,49,201712,2018),('2017-12-08',201749,12,2017,8,49,201712,2018),('2017-12-09',201749,12,2017,9,49,201712,2018),('2017-12-10',201750,12,2017,10,50,201712,2018),('2017-12-11',201750,12,2017,11,50,201712,2018),('2017-12-12',201750,12,2017,12,50,201712,2018),('2017-12-13',201750,12,2017,13,50,201712,2018),('2017-12-14',201750,12,2017,14,50,201712,2018),('2017-12-15',201750,12,2017,15,50,201712,2018),('2017-12-16',201750,12,2017,16,50,201712,2018),('2017-12-17',201751,12,2017,17,51,201712,2018),('2017-12-18',201751,12,2017,18,51,201712,2018),('2017-12-19',201751,12,2017,19,51,201712,2018),('2017-12-20',201751,12,2017,20,51,201712,2018),('2017-12-21',201751,12,2017,21,51,201712,2018),('2017-12-22',201751,12,2017,22,51,201712,2018),('2017-12-23',201751,12,2017,23,51,201712,2018),('2017-12-24',201752,12,2017,24,52,201712,2018),('2017-12-25',201752,12,2017,25,52,201712,2018),('2017-12-26',201752,12,2017,26,52,201712,2018),('2017-12-27',201752,12,2017,27,52,201712,2018),('2017-12-28',201752,12,2017,28,52,201712,2018),('2017-12-29',201752,12,2017,29,52,201712,2018),('2017-12-30',201752,12,2017,30,52,201712,2018),('2017-12-31',201801,12,2017,31,1,201712,2018),('2018-01-01',201801,1,2018,1,1,201801,2018),('2018-01-02',201801,1,2018,2,1,201801,2018),('2018-01-03',201801,1,2018,3,1,201801,2018),('2018-01-04',201801,1,2018,4,1,201801,2018),('2018-01-05',201801,1,2018,5,1,201801,2018),('2018-01-06',201801,1,2018,6,1,201801,2018),('2018-01-07',201802,1,2018,7,2,201801,2018),('2018-01-08',201802,1,2018,8,2,201801,2018),('2018-01-09',201802,1,2018,9,2,201801,2018),('2018-01-10',201802,1,2018,10,2,201801,2018),('2018-01-11',201802,1,2018,11,2,201801,2018),('2018-01-12',201802,1,2018,12,2,201801,2018),('2018-01-13',201802,1,2018,13,2,201801,2018),('2018-01-14',201803,1,2018,14,3,201801,2018),('2018-01-15',201803,1,2018,15,3,201801,2018),('2018-01-16',201803,1,2018,16,3,201801,2018),('2018-01-17',201803,1,2018,17,3,201801,2018),('2018-01-18',201803,1,2018,18,3,201801,2018),('2018-01-19',201803,1,2018,19,3,201801,2018),('2018-01-20',201803,1,2018,20,3,201801,2018),('2018-01-21',201804,1,2018,21,4,201801,2018),('2018-01-22',201804,1,2018,22,4,201801,2018),('2018-01-23',201804,1,2018,23,4,201801,2018),('2018-01-24',201804,1,2018,24,4,201801,2018),('2018-01-25',201804,1,2018,25,4,201801,2018),('2018-01-26',201804,1,2018,26,4,201801,2018),('2018-01-27',201804,1,2018,27,4,201801,2018),('2018-01-28',201805,1,2018,28,5,201801,2018),('2018-01-29',201805,1,2018,29,5,201801,2018),('2018-01-30',201805,1,2018,30,5,201801,2018),('2018-01-31',201805,1,2018,31,5,201801,2018),('2018-02-01',201805,2,2018,1,5,201802,2018),('2018-02-02',201805,2,2018,2,5,201802,2018),('2018-02-03',201805,2,2018,3,5,201802,2018),('2018-02-04',201806,2,2018,4,6,201802,2018),('2018-02-05',201806,2,2018,5,6,201802,2018),('2018-02-06',201806,2,2018,6,6,201802,2018),('2018-02-07',201806,2,2018,7,6,201802,2018),('2018-02-08',201806,2,2018,8,6,201802,2018),('2018-02-09',201806,2,2018,9,6,201802,2018),('2018-02-10',201806,2,2018,10,6,201802,2018),('2018-02-11',201807,2,2018,11,7,201802,2018),('2018-02-12',201807,2,2018,12,7,201802,2018),('2018-02-13',201807,2,2018,13,7,201802,2018),('2018-02-14',201807,2,2018,14,7,201802,2018),('2018-02-15',201807,2,2018,15,7,201802,2018),('2018-02-16',201807,2,2018,16,7,201802,2018),('2018-02-17',201807,2,2018,17,7,201802,2018),('2018-02-18',201808,2,2018,18,8,201802,2018),('2018-02-19',201808,2,2018,19,8,201802,2018),('2018-02-20',201808,2,2018,20,8,201802,2018),('2018-02-21',201808,2,2018,21,8,201802,2018),('2018-02-22',201808,2,2018,22,8,201802,2018),('2018-02-23',201808,2,2018,23,8,201802,2018),('2018-02-24',201808,2,2018,24,8,201802,2018),('2018-02-25',201809,2,2018,25,9,201802,2018),('2018-02-26',201809,2,2018,26,9,201802,2018),('2018-02-27',201809,2,2018,27,9,201802,2018),('2018-02-28',201809,2,2018,28,9,201802,2018),('2018-03-01',201809,3,2018,1,9,201803,2018),('2018-03-02',201809,3,2018,2,9,201803,2018),('2018-03-03',201809,3,2018,3,9,201803,2018),('2018-03-04',201810,3,2018,4,10,201803,2018),('2018-03-05',201810,3,2018,5,10,201803,2018),('2018-03-06',201810,3,2018,6,10,201803,2018),('2018-03-07',201810,3,2018,7,10,201803,2018),('2018-03-08',201810,3,2018,8,10,201803,2018),('2018-03-09',201810,3,2018,9,10,201803,2018),('2018-03-10',201810,3,2018,10,10,201803,2018),('2018-03-11',201811,3,2018,11,11,201803,2018),('2018-03-12',201811,3,2018,12,11,201803,2018),('2018-03-13',201811,3,2018,13,11,201803,2018),('2018-03-14',201811,3,2018,14,11,201803,2018),('2018-03-15',201811,3,2018,15,11,201803,2018),('2018-03-16',201811,3,2018,16,11,201803,2018),('2018-03-17',201811,3,2018,17,11,201803,2018),('2018-03-18',201812,3,2018,18,12,201803,2018),('2018-03-19',201812,3,2018,19,12,201803,2018),('2018-03-20',201812,3,2018,20,12,201803,2018),('2018-03-21',201812,3,2018,21,12,201803,2018),('2018-03-22',201812,3,2018,22,12,201803,2018),('2018-03-23',201812,3,2018,23,12,201803,2018),('2018-03-24',201812,3,2018,24,12,201803,2018),('2018-03-25',201813,3,2018,25,13,201803,2018),('2018-03-26',201813,3,2018,26,13,201803,2018),('2018-03-27',201813,3,2018,27,13,201803,2018),('2018-03-28',201813,3,2018,28,13,201803,2018),('2018-03-29',201813,3,2018,29,13,201803,2018),('2018-03-30',201813,3,2018,30,13,201803,2018),('2018-03-31',201813,3,2018,31,13,201803,2018),('2018-04-01',201814,4,2018,1,14,201804,2018),('2018-04-02',201814,4,2018,2,14,201804,2018),('2018-04-03',201814,4,2018,3,14,201804,2018),('2018-04-04',201814,4,2018,4,14,201804,2018),('2018-04-05',201814,4,2018,5,14,201804,2018),('2018-04-06',201814,4,2018,6,14,201804,2018),('2018-04-07',201814,4,2018,7,14,201804,2018),('2018-04-08',201815,4,2018,8,15,201804,2018),('2018-04-09',201815,4,2018,9,15,201804,2018),('2018-04-10',201815,4,2018,10,15,201804,2018),('2018-04-11',201815,4,2018,11,15,201804,2018),('2018-04-12',201815,4,2018,12,15,201804,2018),('2018-04-13',201815,4,2018,13,15,201804,2018),('2018-04-14',201815,4,2018,14,15,201804,2018),('2018-04-15',201816,4,2018,15,16,201804,2018),('2018-04-16',201816,4,2018,16,16,201804,2018),('2018-04-17',201816,4,2018,17,16,201804,2018),('2018-04-18',201816,4,2018,18,16,201804,2018),('2018-04-19',201816,4,2018,19,16,201804,2018),('2018-04-20',201816,4,2018,20,16,201804,2018),('2018-04-21',201816,4,2018,21,16,201804,2018),('2018-04-22',201817,4,2018,22,17,201804,2018),('2018-04-23',201817,4,2018,23,17,201804,2018),('2018-04-24',201817,4,2018,24,17,201804,2018),('2018-04-25',201817,4,2018,25,17,201804,2018),('2018-04-26',201817,4,2018,26,17,201804,2018),('2018-04-27',201817,4,2018,27,17,201804,2018),('2018-04-28',201817,4,2018,28,17,201804,2018),('2018-04-29',201818,4,2018,29,18,201804,2018),('2018-04-30',201818,4,2018,30,18,201804,2018),('2018-05-01',201818,5,2018,1,18,201805,2018),('2018-05-02',201818,5,2018,2,18,201805,2018),('2018-05-03',201818,5,2018,3,18,201805,2018),('2018-05-04',201818,5,2018,4,18,201805,2018),('2018-05-05',201818,5,2018,5,18,201805,2018),('2018-05-06',201819,5,2018,6,19,201805,2018),('2018-05-07',201819,5,2018,7,19,201805,2018),('2018-05-08',201819,5,2018,8,19,201805,2018),('2018-05-09',201819,5,2018,9,19,201805,2018),('2018-05-10',201819,5,2018,10,19,201805,2018),('2018-05-11',201819,5,2018,11,19,201805,2018),('2018-05-12',201819,5,2018,12,19,201805,2018),('2018-05-13',201820,5,2018,13,20,201805,2018),('2018-05-14',201820,5,2018,14,20,201805,2018),('2018-05-15',201820,5,2018,15,20,201805,2018),('2018-05-16',201820,5,2018,16,20,201805,2018),('2018-05-17',201820,5,2018,17,20,201805,2018),('2018-05-18',201820,5,2018,18,20,201805,2018),('2018-05-19',201820,5,2018,19,20,201805,2018),('2018-05-20',201821,5,2018,20,21,201805,2018),('2018-05-21',201821,5,2018,21,21,201805,2018),('2018-05-22',201821,5,2018,22,21,201805,2018),('2018-05-23',201821,5,2018,23,21,201805,2018),('2018-05-24',201821,5,2018,24,21,201805,2018),('2018-05-25',201821,5,2018,25,21,201805,2018),('2018-05-26',201821,5,2018,26,21,201805,2018),('2018-05-27',201822,5,2018,27,22,201805,2018),('2018-05-28',201822,5,2018,28,22,201805,2018),('2018-05-29',201822,5,2018,29,22,201805,2018),('2018-05-30',201822,5,2018,30,22,201805,2018),('2018-05-31',201822,5,2018,31,22,201805,2018),('2018-06-01',201822,6,2018,1,22,201806,2018),('2018-06-02',201822,6,2018,2,22,201806,2018),('2018-06-03',201823,6,2018,3,23,201806,2018),('2018-06-04',201823,6,2018,4,23,201806,2018),('2018-06-05',201823,6,2018,5,23,201806,2018),('2018-06-06',201823,6,2018,6,23,201806,2018),('2018-06-07',201823,6,2018,7,23,201806,2018),('2018-06-08',201823,6,2018,8,23,201806,2018),('2018-06-09',201823,6,2018,9,23,201806,2018),('2018-06-10',201824,6,2018,10,24,201806,2018),('2018-06-11',201824,6,2018,11,24,201806,2018),('2018-06-12',201824,6,2018,12,24,201806,2018),('2018-06-13',201824,6,2018,13,24,201806,2018),('2018-06-14',201824,6,2018,14,24,201806,2018),('2018-06-15',201824,6,2018,15,24,201806,2018),('2018-06-16',201824,6,2018,16,24,201806,2018),('2018-06-17',201825,6,2018,17,25,201806,2018),('2018-06-18',201825,6,2018,18,25,201806,2018),('2018-06-19',201825,6,2018,19,25,201806,2018),('2018-06-20',201825,6,2018,20,25,201806,2018),('2018-06-21',201825,6,2018,21,25,201806,2018),('2018-06-22',201825,6,2018,22,25,201806,2018),('2018-06-23',201825,6,2018,23,25,201806,2018),('2018-06-24',201826,6,2018,24,26,201806,2018),('2018-06-25',201826,6,2018,25,26,201806,2018),('2018-06-26',201826,6,2018,26,26,201806,2018),('2018-06-27',201826,6,2018,27,26,201806,2018),('2018-06-28',201826,6,2018,28,26,201806,2018),('2018-06-29',201826,6,2018,29,26,201806,2018),('2018-06-30',201826,6,2018,30,26,201806,2018),('2018-07-01',201827,7,2018,1,27,201807,2018),('2018-07-02',201827,7,2018,2,27,201807,2018),('2018-07-03',201827,7,2018,3,27,201807,2018),('2018-07-04',201827,7,2018,4,27,201807,2018),('2018-07-05',201827,7,2018,5,27,201807,2018),('2018-07-06',201827,7,2018,6,27,201807,2018),('2018-07-07',201827,7,2018,7,27,201807,2018),('2018-07-08',201828,7,2018,8,28,201807,2018),('2018-07-09',201828,7,2018,9,28,201807,2018),('2018-07-10',201828,7,2018,10,28,201807,2018),('2018-07-11',201828,7,2018,11,28,201807,2018),('2018-07-12',201828,7,2018,12,28,201807,2018),('2018-07-13',201828,7,2018,13,28,201807,2018),('2018-07-14',201828,7,2018,14,28,201807,2018),('2018-07-15',201829,7,2018,15,29,201807,2018),('2018-07-16',201829,7,2018,16,29,201807,2018),('2018-07-17',201829,7,2018,17,29,201807,2018),('2018-07-18',201829,7,2018,18,29,201807,2018),('2018-07-19',201829,7,2018,19,29,201807,2018),('2018-07-20',201829,7,2018,20,29,201807,2018),('2018-07-21',201829,7,2018,21,29,201807,2018),('2018-07-22',201830,7,2018,22,30,201807,2018),('2018-07-23',201830,7,2018,23,30,201807,2018),('2018-07-24',201830,7,2018,24,30,201807,2018),('2018-07-25',201830,7,2018,25,30,201807,2018),('2018-07-26',201830,7,2018,26,30,201807,2018),('2018-07-27',201830,7,2018,27,30,201807,2018),('2018-07-28',201830,7,2018,28,30,201807,2018),('2018-07-29',201831,7,2018,29,31,201807,2018),('2018-07-30',201831,7,2018,30,31,201807,2018),('2018-07-31',201831,7,2018,31,31,201807,2018),('2018-08-01',201831,8,2018,1,31,201808,2018),('2018-08-02',201831,8,2018,2,31,201808,2018),('2018-08-03',201831,8,2018,3,31,201808,2018),('2018-08-04',201831,8,2018,4,31,201808,2018),('2018-08-05',201832,8,2018,5,32,201808,2018),('2018-08-06',201832,8,2018,6,32,201808,2018),('2018-08-07',201832,8,2018,7,32,201808,2018),('2018-08-08',201832,8,2018,8,32,201808,2018),('2018-08-09',201832,8,2018,9,32,201808,2018),('2018-08-10',201832,8,2018,10,32,201808,2018),('2018-08-11',201832,8,2018,11,32,201808,2018),('2018-08-12',201833,8,2018,12,33,201808,2018),('2018-08-13',201833,8,2018,13,33,201808,2018),('2018-08-14',201833,8,2018,14,33,201808,2018),('2018-08-15',201833,8,2018,15,33,201808,2018),('2018-08-16',201833,8,2018,16,33,201808,2018),('2018-08-17',201833,8,2018,17,33,201808,2018),('2018-08-18',201833,8,2018,18,33,201808,2018),('2018-08-19',201834,8,2018,19,34,201808,2018),('2018-08-20',201834,8,2018,20,34,201808,2018),('2018-08-21',201834,8,2018,21,34,201808,2018),('2018-08-22',201834,8,2018,22,34,201808,2018),('2018-08-23',201834,8,2018,23,34,201808,2018),('2018-08-24',201834,8,2018,24,34,201808,2018),('2018-08-25',201834,8,2018,25,34,201808,2018),('2018-08-26',201835,8,2018,26,35,201808,2018),('2018-08-27',201835,8,2018,27,35,201808,2018),('2018-08-28',201835,8,2018,28,35,201808,2018),('2018-08-29',201835,8,2018,29,35,201808,2018),('2018-08-30',201835,8,2018,30,35,201808,2018),('2018-08-31',201835,8,2018,31,35,201808,2018),('2018-09-01',201835,9,2018,1,35,201809,2018),('2018-09-02',201836,9,2018,2,36,201809,2018),('2018-09-03',201836,9,2018,3,36,201809,2018),('2018-09-04',201836,9,2018,4,36,201809,2018),('2018-09-05',201836,9,2018,5,36,201809,2018),('2018-09-06',201836,9,2018,6,36,201809,2018),('2018-09-07',201836,9,2018,7,36,201809,2018),('2018-09-08',201836,9,2018,8,36,201809,2018),('2018-09-09',201837,9,2018,9,37,201809,2018),('2018-09-10',201837,9,2018,10,37,201809,2018),('2018-09-11',201837,9,2018,11,37,201809,2018),('2018-09-12',201837,9,2018,12,37,201809,2018),('2018-09-13',201837,9,2018,13,37,201809,2018),('2018-09-14',201837,9,2018,14,37,201809,2018),('2018-09-15',201837,9,2018,15,37,201809,2018),('2018-09-16',201838,9,2018,16,38,201809,2018),('2018-09-17',201838,9,2018,17,38,201809,2018),('2018-09-18',201838,9,2018,18,38,201809,2018),('2018-09-19',201838,9,2018,19,38,201809,2018),('2018-09-20',201838,9,2018,20,38,201809,2018),('2018-09-21',201838,9,2018,21,38,201809,2018),('2018-09-22',201838,9,2018,22,38,201809,2018),('2018-09-23',201839,9,2018,23,39,201809,2018),('2018-09-24',201839,9,2018,24,39,201809,2018),('2018-09-25',201839,9,2018,25,39,201809,2018),('2018-09-26',201839,9,2018,26,39,201809,2018),('2018-09-27',201839,9,2018,27,39,201809,2018),('2018-09-28',201839,9,2018,28,39,201809,2018),('2018-09-29',201839,9,2018,29,39,201809,2018),('2018-09-30',201840,9,2018,30,40,201809,2018),('2018-10-01',201840,10,2018,1,40,201810,2018),('2018-10-02',201840,10,2018,2,40,201810,2018),('2018-10-03',201840,10,2018,3,40,201810,2018),('2018-10-04',201840,10,2018,4,40,201810,2018),('2018-10-05',201840,10,2018,5,40,201810,2018),('2018-10-06',201840,10,2018,6,40,201810,2018),('2018-10-07',201841,10,2018,7,41,201810,2018),('2018-10-08',201841,10,2018,8,41,201810,2018),('2018-10-09',201841,10,2018,9,41,201810,2018),('2018-10-10',201841,10,2018,10,41,201810,2018),('2018-10-11',201841,10,2018,11,41,201810,2018),('2018-10-12',201841,10,2018,12,41,201810,2018),('2018-10-13',201841,10,2018,13,41,201810,2018),('2018-10-14',201842,10,2018,14,42,201810,2018),('2018-10-15',201842,10,2018,15,42,201810,2018),('2018-10-16',201842,10,2018,16,42,201810,2018),('2018-10-17',201842,10,2018,17,42,201810,2018),('2018-10-18',201842,10,2018,18,42,201810,2018),('2018-10-19',201842,10,2018,19,42,201810,2018),('2018-10-20',201842,10,2018,20,42,201810,2018),('2018-10-21',201843,10,2018,21,43,201810,2018),('2018-10-22',201843,10,2018,22,43,201810,2018),('2018-10-23',201843,10,2018,23,43,201810,2018),('2018-10-24',201843,10,2018,24,43,201810,2018),('2018-10-25',201843,10,2018,25,43,201810,2018),('2018-10-26',201843,10,2018,26,43,201810,2018),('2018-10-27',201843,10,2018,27,43,201810,2018),('2018-10-28',201844,10,2018,28,44,201810,2018),('2018-10-29',201844,10,2018,29,44,201810,2018),('2018-10-30',201844,10,2018,30,44,201810,2018),('2018-10-31',201844,10,2018,31,44,201810,2018),('2018-11-01',201844,11,2018,1,44,201811,2018),('2018-11-02',201844,11,2018,2,44,201811,2018),('2018-11-03',201844,11,2018,3,44,201811,2018),('2018-11-04',201845,11,2018,4,45,201811,2018),('2018-11-05',201845,11,2018,5,45,201811,2018),('2018-11-06',201845,11,2018,6,45,201811,2018),('2018-11-07',201845,11,2018,7,45,201811,2018),('2018-11-08',201845,11,2018,8,45,201811,2018),('2018-11-09',201845,11,2018,9,45,201811,2018),('2018-11-10',201845,11,2018,10,45,201811,2018),('2018-11-11',201846,11,2018,11,46,201811,2018),('2018-11-12',201846,11,2018,12,46,201811,2018),('2018-11-13',201846,11,2018,13,46,201811,2018),('2018-11-14',201846,11,2018,14,46,201811,2018),('2018-11-15',201846,11,2018,15,46,201811,2018),('2018-11-16',201846,11,2018,16,46,201811,2018),('2018-11-17',201846,11,2018,17,46,201811,2018),('2018-11-18',201847,11,2018,18,47,201811,2018),('2018-11-19',201847,11,2018,19,47,201811,2018),('2018-11-20',201847,11,2018,20,47,201811,2018),('2018-11-21',201847,11,2018,21,47,201811,2018),('2018-11-22',201847,11,2018,22,47,201811,2018),('2018-11-23',201847,11,2018,23,47,201811,2018),('2018-11-24',201847,11,2018,24,47,201811,2018),('2018-11-25',201848,11,2018,25,48,201811,2018),('2018-11-26',201848,11,2018,26,48,201811,2018),('2018-11-27',201848,11,2018,27,48,201811,2018),('2018-11-28',201848,11,2018,28,48,201811,2018),('2018-11-29',201848,11,2018,29,48,201811,2018),('2018-11-30',201848,11,2018,30,48,201811,2018),('2018-12-01',201848,12,2018,1,48,201812,2019),('2018-12-02',201849,12,2018,2,49,201812,2019),('2018-12-03',201849,12,2018,3,49,201812,2019),('2018-12-04',201849,12,2018,4,49,201812,2019),('2018-12-05',201849,12,2018,5,49,201812,2019),('2018-12-06',201849,12,2018,6,49,201812,2019),('2018-12-07',201849,12,2018,7,49,201812,2019),('2018-12-08',201849,12,2018,8,49,201812,2019),('2018-12-09',201850,12,2018,9,50,201812,2019),('2018-12-10',201850,12,2018,10,50,201812,2019),('2018-12-11',201850,12,2018,11,50,201812,2019),('2018-12-12',201850,12,2018,12,50,201812,2019),('2018-12-13',201850,12,2018,13,50,201812,2019),('2018-12-14',201850,12,2018,14,50,201812,2019),('2018-12-15',201850,12,2018,15,50,201812,2019),('2018-12-16',201851,12,2018,16,51,201812,2019),('2018-12-17',201851,12,2018,17,51,201812,2019),('2018-12-18',201851,12,2018,18,51,201812,2019),('2018-12-19',201851,12,2018,19,51,201812,2019),('2018-12-20',201851,12,2018,20,51,201812,2019),('2018-12-21',201851,12,2018,21,51,201812,2019),('2018-12-22',201851,12,2018,22,51,201812,2019),('2018-12-23',201852,12,2018,23,52,201812,2019),('2018-12-24',201852,12,2018,24,52,201812,2019),('2018-12-25',201852,12,2018,25,52,201812,2019),('2018-12-26',201852,12,2018,26,52,201812,2019),('2018-12-27',201852,12,2018,27,52,201812,2019),('2018-12-28',201852,12,2018,28,52,201812,2019),('2018-12-29',201852,12,2018,29,52,201812,2019),('2018-12-30',201901,12,2018,30,1,201812,2019),('2018-12-31',201901,12,2018,31,1,201812,2019),('2019-01-01',201901,1,2019,1,1,201901,2019),('2019-01-02',201901,1,2019,2,1,201901,2019),('2019-01-03',201901,1,2019,3,1,201901,2019),('2019-01-04',201901,1,2019,4,1,201901,2019),('2019-01-05',201901,1,2019,5,1,201901,2019),('2019-01-06',201902,1,2019,6,2,201901,2019),('2019-01-07',201902,1,2019,7,2,201901,2019),('2019-01-08',201902,1,2019,8,2,201901,2019),('2019-01-09',201902,1,2019,9,2,201901,2019),('2019-01-10',201902,1,2019,10,2,201901,2019),('2019-01-11',201902,1,2019,11,2,201901,2019),('2019-01-12',201902,1,2019,12,2,201901,2019),('2019-01-13',201903,1,2019,13,3,201901,2019),('2019-01-14',201903,1,2019,14,3,201901,2019),('2019-01-15',201903,1,2019,15,3,201901,2019),('2019-01-16',201903,1,2019,16,3,201901,2019),('2019-01-17',201903,1,2019,17,3,201901,2019),('2019-01-18',201903,1,2019,18,3,201901,2019),('2019-01-19',201903,1,2019,19,3,201901,2019),('2019-01-20',201904,1,2019,20,4,201901,2019),('2019-01-21',201904,1,2019,21,4,201901,2019),('2019-01-22',201904,1,2019,22,4,201901,2019),('2019-01-23',201904,1,2019,23,4,201901,2019),('2019-01-24',201904,1,2019,24,4,201901,2019),('2019-01-25',201904,1,2019,25,4,201901,2019),('2019-01-26',201904,1,2019,26,4,201901,2019),('2019-01-27',201905,1,2019,27,5,201901,2019),('2019-01-28',201905,1,2019,28,5,201901,2019),('2019-01-29',201905,1,2019,29,5,201901,2019),('2019-01-30',201905,1,2019,30,5,201901,2019),('2019-01-31',201905,1,2019,31,5,201901,2019),('2019-02-01',201905,2,2019,1,5,201902,2019),('2019-02-02',201905,2,2019,2,5,201902,2019),('2019-02-03',201906,2,2019,3,6,201902,2019),('2019-02-04',201906,2,2019,4,6,201902,2019),('2019-02-05',201906,2,2019,5,6,201902,2019),('2019-02-06',201906,2,2019,6,6,201902,2019),('2019-02-07',201906,2,2019,7,6,201902,2019),('2019-02-08',201906,2,2019,8,6,201902,2019),('2019-02-09',201906,2,2019,9,6,201902,2019),('2019-02-10',201907,2,2019,10,7,201902,2019),('2019-02-11',201907,2,2019,11,7,201902,2019),('2019-02-12',201907,2,2019,12,7,201902,2019),('2019-02-13',201907,2,2019,13,7,201902,2019),('2019-02-14',201907,2,2019,14,7,201902,2019),('2019-02-15',201907,2,2019,15,7,201902,2019),('2019-02-16',201907,2,2019,16,7,201902,2019),('2019-02-17',201908,2,2019,17,8,201902,2019),('2019-02-18',201908,2,2019,18,8,201902,2019),('2019-02-19',201908,2,2019,19,8,201902,2019),('2019-02-20',201908,2,2019,20,8,201902,2019),('2019-02-21',201908,2,2019,21,8,201902,2019),('2019-02-22',201908,2,2019,22,8,201902,2019),('2019-02-23',201908,2,2019,23,8,201902,2019),('2019-02-24',201909,2,2019,24,9,201902,2019),('2019-02-25',201909,2,2019,25,9,201902,2019),('2019-02-26',201909,2,2019,26,9,201902,2019),('2019-02-27',201909,2,2019,27,9,201902,2019),('2019-02-28',201909,2,2019,28,9,201902,2019),('2019-03-01',201909,3,2019,1,9,201903,2019),('2019-03-02',201909,3,2019,2,9,201903,2019),('2019-03-03',201910,3,2019,3,10,201903,2019),('2019-03-04',201910,3,2019,4,10,201903,2019),('2019-03-05',201910,3,2019,5,10,201903,2019),('2019-03-06',201910,3,2019,6,10,201903,2019),('2019-03-07',201910,3,2019,7,10,201903,2019),('2019-03-08',201910,3,2019,8,10,201903,2019),('2019-03-09',201910,3,2019,9,10,201903,2019),('2019-03-10',201911,3,2019,10,11,201903,2019),('2019-03-11',201911,3,2019,11,11,201903,2019),('2019-03-12',201911,3,2019,12,11,201903,2019),('2019-03-13',201911,3,2019,13,11,201903,2019),('2019-03-14',201911,3,2019,14,11,201903,2019),('2019-03-15',201911,3,2019,15,11,201903,2019),('2019-03-16',201911,3,2019,16,11,201903,2019),('2019-03-17',201912,3,2019,17,12,201903,2019),('2019-03-18',201912,3,2019,18,12,201903,2019),('2019-03-19',201912,3,2019,19,12,201903,2019),('2019-03-20',201912,3,2019,20,12,201903,2019),('2019-03-21',201912,3,2019,21,12,201903,2019),('2019-03-22',201912,3,2019,22,12,201903,2019),('2019-03-23',201912,3,2019,23,12,201903,2019),('2019-03-24',201913,3,2019,24,13,201903,2019),('2019-03-25',201913,3,2019,25,13,201903,2019),('2019-03-26',201913,3,2019,26,13,201903,2019),('2019-03-27',201913,3,2019,27,13,201903,2019),('2019-03-28',201913,3,2019,28,13,201903,2019),('2019-03-29',201913,3,2019,29,13,201903,2019),('2019-03-30',201913,3,2019,30,13,201903,2019),('2019-03-31',201914,3,2019,31,14,201903,2019),('2019-04-01',201914,4,2019,1,14,201904,2019),('2019-04-02',201914,4,2019,2,14,201904,2019),('2019-04-03',201914,4,2019,3,14,201904,2019),('2019-04-04',201914,4,2019,4,14,201904,2019),('2019-04-05',201914,4,2019,5,14,201904,2019),('2019-04-06',201914,4,2019,6,14,201904,2019),('2019-04-07',201915,4,2019,7,15,201904,2019),('2019-04-08',201915,4,2019,8,15,201904,2019),('2019-04-09',201915,4,2019,9,15,201904,2019),('2019-04-10',201915,4,2019,10,15,201904,2019),('2019-04-11',201915,4,2019,11,15,201904,2019),('2019-04-12',201915,4,2019,12,15,201904,2019),('2019-04-13',201915,4,2019,13,15,201904,2019),('2019-04-14',201916,4,2019,14,16,201904,2019),('2019-04-15',201916,4,2019,15,16,201904,2019),('2019-04-16',201916,4,2019,16,16,201904,2019),('2019-04-17',201916,4,2019,17,16,201904,2019),('2019-04-18',201916,4,2019,18,16,201904,2019),('2019-04-19',201916,4,2019,19,16,201904,2019),('2019-04-20',201916,4,2019,20,16,201904,2019),('2019-04-21',201917,4,2019,21,17,201904,2019),('2019-04-22',201917,4,2019,22,17,201904,2019),('2019-04-23',201917,4,2019,23,17,201904,2019),('2019-04-24',201917,4,2019,24,17,201904,2019),('2019-04-25',201917,4,2019,25,17,201904,2019),('2019-04-26',201917,4,2019,26,17,201904,2019),('2019-04-27',201917,4,2019,27,17,201904,2019),('2019-04-28',201918,4,2019,28,18,201904,2019),('2019-04-29',201918,4,2019,29,18,201904,2019),('2019-04-30',201918,4,2019,30,18,201904,2019),('2019-05-01',201918,5,2019,1,18,201905,2019),('2019-05-02',201918,5,2019,2,18,201905,2019),('2019-05-03',201918,5,2019,3,18,201905,2019),('2019-05-04',201918,5,2019,4,18,201905,2019),('2019-05-05',201919,5,2019,5,19,201905,2019),('2019-05-06',201919,5,2019,6,19,201905,2019),('2019-05-07',201919,5,2019,7,19,201905,2019),('2019-05-08',201919,5,2019,8,19,201905,2019),('2019-05-09',201919,5,2019,9,19,201905,2019),('2019-05-10',201919,5,2019,10,19,201905,2019),('2019-05-11',201919,5,2019,11,19,201905,2019),('2019-05-12',201920,5,2019,12,20,201905,2019),('2019-05-13',201920,5,2019,13,20,201905,2019),('2019-05-14',201920,5,2019,14,20,201905,2019),('2019-05-15',201920,5,2019,15,20,201905,2019),('2019-05-16',201920,5,2019,16,20,201905,2019),('2019-05-17',201920,5,2019,17,20,201905,2019),('2019-05-18',201920,5,2019,18,20,201905,2019),('2019-05-19',201921,5,2019,19,21,201905,2019),('2019-05-20',201921,5,2019,20,21,201905,2019),('2019-05-21',201921,5,2019,21,21,201905,2019),('2019-05-22',201921,5,2019,22,21,201905,2019),('2019-05-23',201921,5,2019,23,21,201905,2019),('2019-05-24',201921,5,2019,24,21,201905,2019),('2019-05-25',201921,5,2019,25,21,201905,2019),('2019-05-26',201922,5,2019,26,22,201905,2019),('2019-05-27',201922,5,2019,27,22,201905,2019),('2019-05-28',201922,5,2019,28,22,201905,2019),('2019-05-29',201922,5,2019,29,22,201905,2019),('2019-05-30',201922,5,2019,30,22,201905,2019),('2019-05-31',201922,5,2019,31,22,201905,2019),('2019-06-01',201922,6,2019,1,22,201906,2019),('2019-06-02',201923,6,2019,2,23,201906,2019),('2019-06-03',201923,6,2019,3,23,201906,2019),('2019-06-04',201923,6,2019,4,23,201906,2019),('2019-06-05',201923,6,2019,5,23,201906,2019),('2019-06-06',201923,6,2019,6,23,201906,2019),('2019-06-07',201923,6,2019,7,23,201906,2019),('2019-06-08',201923,6,2019,8,23,201906,2019),('2019-06-09',201924,6,2019,9,24,201906,2019),('2019-06-10',201924,6,2019,10,24,201906,2019),('2019-06-11',201924,6,2019,11,24,201906,2019),('2019-06-12',201924,6,2019,12,24,201906,2019),('2019-06-13',201924,6,2019,13,24,201906,2019),('2019-06-14',201924,6,2019,14,24,201906,2019),('2019-06-15',201924,6,2019,15,24,201906,2019),('2019-06-16',201925,6,2019,16,25,201906,2019),('2019-06-17',201925,6,2019,17,25,201906,2019),('2019-06-18',201925,6,2019,18,25,201906,2019),('2019-06-19',201925,6,2019,19,25,201906,2019),('2019-06-20',201925,6,2019,20,25,201906,2019),('2019-06-21',201925,6,2019,21,25,201906,2019),('2019-06-22',201925,6,2019,22,25,201906,2019),('2019-06-23',201926,6,2019,23,26,201906,2019),('2019-06-24',201926,6,2019,24,26,201906,2019),('2019-06-25',201926,6,2019,25,26,201906,2019),('2019-06-26',201926,6,2019,26,26,201906,2019),('2019-06-27',201926,6,2019,27,26,201906,2019),('2019-06-28',201926,6,2019,28,26,201906,2019),('2019-06-29',201926,6,2019,29,26,201906,2019),('2019-06-30',201927,6,2019,30,27,201906,2019),('2019-07-01',201927,7,2019,1,27,201907,2019),('2019-07-02',201927,7,2019,2,27,201907,2019),('2019-07-03',201927,7,2019,3,27,201907,2019),('2019-07-04',201927,7,2019,4,27,201907,2019),('2019-07-05',201927,7,2019,5,27,201907,2019),('2019-07-06',201927,7,2019,6,27,201907,2019),('2019-07-07',201928,7,2019,7,28,201907,2019),('2019-07-08',201928,7,2019,8,28,201907,2019),('2019-07-09',201928,7,2019,9,28,201907,2019),('2019-07-10',201928,7,2019,10,28,201907,2019),('2019-07-11',201928,7,2019,11,28,201907,2019),('2019-07-12',201928,7,2019,12,28,201907,2019),('2019-07-13',201928,7,2019,13,28,201907,2019),('2019-07-14',201929,7,2019,14,29,201907,2019),('2019-07-15',201929,7,2019,15,29,201907,2019),('2019-07-16',201929,7,2019,16,29,201907,2019),('2019-07-17',201929,7,2019,17,29,201907,2019),('2019-07-18',201929,7,2019,18,29,201907,2019),('2019-07-19',201929,7,2019,19,29,201907,2019),('2019-07-20',201929,7,2019,20,29,201907,2019),('2019-07-21',201930,7,2019,21,30,201907,2019),('2019-07-22',201930,7,2019,22,30,201907,2019),('2019-07-23',201930,7,2019,23,30,201907,2019),('2019-07-24',201930,7,2019,24,30,201907,2019),('2019-07-25',201930,7,2019,25,30,201907,2019),('2019-07-26',201930,7,2019,26,30,201907,2019),('2019-07-27',201930,7,2019,27,30,201907,2019),('2019-07-28',201931,7,2019,28,31,201907,2019),('2019-07-29',201931,7,2019,29,31,201907,2019),('2019-07-30',201931,7,2019,30,31,201907,2019),('2019-07-31',201931,7,2019,31,31,201907,2019),('2019-08-01',201931,8,2019,1,31,201908,2019),('2019-08-02',201931,8,2019,2,31,201908,2019),('2019-08-03',201931,8,2019,3,31,201908,2019),('2019-08-04',201932,8,2019,4,32,201908,2019),('2019-08-05',201932,8,2019,5,32,201908,2019),('2019-08-06',201932,8,2019,6,32,201908,2019),('2019-08-07',201932,8,2019,7,32,201908,2019),('2019-08-08',201932,8,2019,8,32,201908,2019),('2019-08-09',201932,8,2019,9,32,201908,2019),('2019-08-10',201932,8,2019,10,32,201908,2019),('2019-08-11',201933,8,2019,11,33,201908,2019),('2019-08-12',201933,8,2019,12,33,201908,2019),('2019-08-13',201933,8,2019,13,33,201908,2019),('2019-08-14',201933,8,2019,14,33,201908,2019),('2019-08-15',201933,8,2019,15,33,201908,2019),('2019-08-16',201933,8,2019,16,33,201908,2019),('2019-08-17',201933,8,2019,17,33,201908,2019),('2019-08-18',201934,8,2019,18,34,201908,2019),('2019-08-19',201934,8,2019,19,34,201908,2019),('2019-08-20',201934,8,2019,20,34,201908,2019),('2019-08-21',201934,8,2019,21,34,201908,2019),('2019-08-22',201934,8,2019,22,34,201908,2019),('2019-08-23',201934,8,2019,23,34,201908,2019),('2019-08-24',201934,8,2019,24,34,201908,2019),('2019-08-25',201935,8,2019,25,35,201908,2019),('2019-08-26',201935,8,2019,26,35,201908,2019),('2019-08-27',201935,8,2019,27,35,201908,2019),('2019-08-28',201935,8,2019,28,35,201908,2019),('2019-08-29',201935,8,2019,29,35,201908,2019),('2019-08-30',201935,8,2019,30,35,201908,2019),('2019-08-31',201935,8,2019,31,35,201908,2019),('2019-09-01',201936,9,2019,1,36,201909,2019),('2019-09-02',201936,9,2019,2,36,201909,2019),('2019-09-03',201936,9,2019,3,36,201909,2019),('2019-09-04',201936,9,2019,4,36,201909,2019),('2019-09-05',201936,9,2019,5,36,201909,2019),('2019-09-06',201936,9,2019,6,36,201909,2019),('2019-09-07',201936,9,2019,7,36,201909,2019),('2019-09-08',201937,9,2019,8,37,201909,2019),('2019-09-09',201937,9,2019,9,37,201909,2019),('2019-09-10',201937,9,2019,10,37,201909,2019),('2019-09-11',201937,9,2019,11,37,201909,2019),('2019-09-12',201937,9,2019,12,37,201909,2019),('2019-09-13',201937,9,2019,13,37,201909,2019),('2019-09-14',201937,9,2019,14,37,201909,2019),('2019-09-15',201938,9,2019,15,38,201909,2019),('2019-09-16',201938,9,2019,16,38,201909,2019),('2019-09-17',201938,9,2019,17,38,201909,2019),('2019-09-18',201938,9,2019,18,38,201909,2019),('2019-09-19',201938,9,2019,19,38,201909,2019),('2019-09-20',201938,9,2019,20,38,201909,2019),('2019-09-21',201938,9,2019,21,38,201909,2019),('2019-09-22',201939,9,2019,22,39,201909,2019),('2019-09-23',201939,9,2019,23,39,201909,2019),('2019-09-24',201939,9,2019,24,39,201909,2019),('2019-09-25',201939,9,2019,25,39,201909,2019),('2019-09-26',201939,9,2019,26,39,201909,2019),('2019-09-27',201939,9,2019,27,39,201909,2019),('2019-09-28',201939,9,2019,28,39,201909,2019),('2019-09-29',201940,9,2019,29,40,201909,2019),('2019-09-30',201940,9,2019,30,40,201909,2019),('2019-10-01',201940,10,2019,1,40,201910,2019),('2019-10-02',201940,10,2019,2,40,201910,2019),('2019-10-03',201940,10,2019,3,40,201910,2019),('2019-10-04',201940,10,2019,4,40,201910,2019),('2019-10-05',201940,10,2019,5,40,201910,2019),('2019-10-06',201941,10,2019,6,41,201910,2019),('2019-10-07',201941,10,2019,7,41,201910,2019),('2019-10-08',201941,10,2019,8,41,201910,2019),('2019-10-09',201941,10,2019,9,41,201910,2019),('2019-10-10',201941,10,2019,10,41,201910,2019),('2019-10-11',201941,10,2019,11,41,201910,2019),('2019-10-12',201941,10,2019,12,41,201910,2019),('2019-10-13',201942,10,2019,13,42,201910,2019),('2019-10-14',201942,10,2019,14,42,201910,2019),('2019-10-15',201942,10,2019,15,42,201910,2019),('2019-10-16',201942,10,2019,16,42,201910,2019),('2019-10-17',201942,10,2019,17,42,201910,2019),('2019-10-18',201942,10,2019,18,42,201910,2019),('2019-10-19',201942,10,2019,19,42,201910,2019),('2019-10-20',201943,10,2019,20,43,201910,2019),('2019-10-21',201943,10,2019,21,43,201910,2019),('2019-10-22',201943,10,2019,22,43,201910,2019),('2019-10-23',201943,10,2019,23,43,201910,2019),('2019-10-24',201943,10,2019,24,43,201910,2019),('2019-10-25',201943,10,2019,25,43,201910,2019),('2019-10-26',201943,10,2019,26,43,201910,2019),('2019-10-27',201944,10,2019,27,44,201910,2019),('2019-10-28',201944,10,2019,28,44,201910,2019),('2019-10-29',201944,10,2019,29,44,201910,2019),('2019-10-30',201944,10,2019,30,44,201910,2019),('2019-10-31',201944,10,2019,31,44,201910,2019),('2019-11-01',201944,11,2019,1,44,201911,2019),('2019-11-02',201944,11,2019,2,44,201911,2019),('2019-11-03',201945,11,2019,3,45,201911,2019),('2019-11-04',201945,11,2019,4,45,201911,2019),('2019-11-05',201945,11,2019,5,45,201911,2019),('2019-11-06',201945,11,2019,6,45,201911,2019),('2019-11-07',201945,11,2019,7,45,201911,2019),('2019-11-08',201945,11,2019,8,45,201911,2019),('2019-11-09',201945,11,2019,9,45,201911,2019),('2019-11-10',201946,11,2019,10,46,201911,2019),('2019-11-11',201946,11,2019,11,46,201911,2019),('2019-11-12',201946,11,2019,12,46,201911,2019),('2019-11-13',201946,11,2019,13,46,201911,2019),('2019-11-14',201946,11,2019,14,46,201911,2019),('2019-11-15',201946,11,2019,15,46,201911,2019),('2019-11-16',201946,11,2019,16,46,201911,2019),('2019-11-17',201947,11,2019,17,47,201911,2019),('2019-11-18',201947,11,2019,18,47,201911,2019),('2019-11-19',201947,11,2019,19,47,201911,2019),('2019-11-20',201947,11,2019,20,47,201911,2019),('2019-11-21',201947,11,2019,21,47,201911,2019),('2019-11-22',201947,11,2019,22,47,201911,2019),('2019-11-23',201947,11,2019,23,47,201911,2019),('2019-11-24',201948,11,2019,24,48,201911,2019),('2019-11-25',201948,11,2019,25,48,201911,2019),('2019-11-26',201948,11,2019,26,48,201911,2019),('2019-11-27',201948,11,2019,27,48,201911,2019),('2019-11-28',201948,11,2019,28,48,201911,2019),('2019-11-29',201948,11,2019,29,48,201911,2019),('2019-11-30',201948,11,2019,30,48,201911,2019),('2019-12-01',201949,12,2019,1,49,201912,2020),('2019-12-02',201949,12,2019,2,49,201912,2020),('2019-12-03',201949,12,2019,3,49,201912,2020),('2019-12-04',201949,12,2019,4,49,201912,2020),('2019-12-05',201949,12,2019,5,49,201912,2020),('2019-12-06',201949,12,2019,6,49,201912,2020),('2019-12-07',201949,12,2019,7,49,201912,2020),('2019-12-08',201950,12,2019,8,50,201912,2020),('2019-12-09',201950,12,2019,9,50,201912,2020),('2019-12-10',201950,12,2019,10,50,201912,2020),('2019-12-11',201950,12,2019,11,50,201912,2020),('2019-12-12',201950,12,2019,12,50,201912,2020),('2019-12-13',201950,12,2019,13,50,201912,2020),('2019-12-14',201950,12,2019,14,50,201912,2020),('2019-12-15',201951,12,2019,15,51,201912,2020),('2019-12-16',201951,12,2019,16,51,201912,2020),('2019-12-17',201951,12,2019,17,51,201912,2020),('2019-12-18',201951,12,2019,18,51,201912,2020),('2019-12-19',201951,12,2019,19,51,201912,2020),('2019-12-20',201951,12,2019,20,51,201912,2020),('2019-12-21',201951,12,2019,21,51,201912,2020),('2019-12-22',201952,12,2019,22,52,201912,2020),('2019-12-23',201952,12,2019,23,52,201912,2020),('2019-12-24',201952,12,2019,24,52,201912,2020),('2019-12-25',201952,12,2019,25,52,201912,2020),('2019-12-26',201952,12,2019,26,52,201912,2020),('2019-12-27',201952,12,2019,27,52,201912,2020),('2019-12-28',201952,12,2019,28,52,201912,2020),('2019-12-29',201953,12,2019,29,1,201912,2020),('2019-12-30',201953,12,2019,30,1,201912,2020),('2019-12-31',201953,12,2019,31,1,201912,2020),('2020-01-01',201953,1,2020,1,1,202001,2020),('2020-01-02',201953,1,2020,2,1,202001,2020),('2020-01-03',201953,1,2020,3,1,202001,2020),('2020-01-04',201953,1,2020,4,1,202001,2020),('2020-01-05',202001,1,2020,5,2,202001,2020),('2020-01-06',202001,1,2020,6,2,202001,2020),('2020-01-07',202001,1,2020,7,2,202001,2020),('2020-01-08',202001,1,2020,8,2,202001,2020),('2020-01-09',202001,1,2020,9,2,202001,2020),('2020-01-10',202001,1,2020,10,2,202001,2020),('2020-01-11',202001,1,2020,11,2,202001,2020),('2020-01-12',202002,1,2020,12,3,202001,2020),('2020-01-13',202002,1,2020,13,3,202001,2020),('2020-01-14',202002,1,2020,14,3,202001,2020),('2020-01-15',202002,1,2020,15,3,202001,2020),('2020-01-16',202002,1,2020,16,3,202001,2020),('2020-01-17',202002,1,2020,17,3,202001,2020),('2020-01-18',202002,1,2020,18,3,202001,2020),('2020-01-19',202003,1,2020,19,4,202001,2020),('2020-01-20',202003,1,2020,20,4,202001,2020),('2020-01-21',202003,1,2020,21,4,202001,2020),('2020-01-22',202003,1,2020,22,4,202001,2020),('2020-01-23',202003,1,2020,23,4,202001,2020),('2020-01-24',202003,1,2020,24,4,202001,2020),('2020-01-25',202003,1,2020,25,4,202001,2020),('2020-01-26',202004,1,2020,26,5,202001,2020),('2020-01-27',202004,1,2020,27,5,202001,2020),('2020-01-28',202004,1,2020,28,5,202001,2020),('2020-01-29',202004,1,2020,29,5,202001,2020),('2020-01-30',202004,1,2020,30,5,202001,2020),('2020-01-31',202004,1,2020,31,5,202001,2020),('2020-02-01',202004,2,2020,1,5,202002,2020),('2020-02-02',202005,2,2020,2,6,202002,2020),('2020-02-03',202005,2,2020,3,6,202002,2020),('2020-02-04',202005,2,2020,4,6,202002,2020),('2020-02-05',202005,2,2020,5,6,202002,2020),('2020-02-06',202005,2,2020,6,6,202002,2020),('2020-02-07',202005,2,2020,7,6,202002,2020),('2020-02-08',202005,2,2020,8,6,202002,2020),('2020-02-09',202006,2,2020,9,7,202002,2020),('2020-02-10',202006,2,2020,10,7,202002,2020),('2020-02-11',202006,2,2020,11,7,202002,2020),('2020-02-12',202006,2,2020,12,7,202002,2020),('2020-02-13',202006,2,2020,13,7,202002,2020),('2020-02-14',202006,2,2020,14,7,202002,2020),('2020-02-15',202006,2,2020,15,7,202002,2020),('2020-02-16',202007,2,2020,16,8,202002,2020),('2020-02-17',202007,2,2020,17,8,202002,2020),('2020-02-18',202007,2,2020,18,8,202002,2020),('2020-02-19',202007,2,2020,19,8,202002,2020),('2020-02-20',202007,2,2020,20,8,202002,2020),('2020-02-21',202007,2,2020,21,8,202002,2020),('2020-02-22',202007,2,2020,22,8,202002,2020),('2020-02-23',202008,2,2020,23,9,202002,2020),('2020-02-24',202008,2,2020,24,9,202002,2020),('2020-02-25',202008,2,2020,25,9,202002,2020),('2020-02-26',202008,2,2020,26,9,202002,2020),('2020-02-27',202008,2,2020,27,9,202002,2020),('2020-02-28',202008,2,2020,28,9,202002,2020),('2020-02-29',202008,2,2020,29,9,202002,2020),('2020-03-01',202009,3,2020,1,10,202003,2020),('2020-03-02',202009,3,2020,2,10,202003,2020),('2020-03-03',202009,3,2020,3,10,202003,2020),('2020-03-04',202009,3,2020,4,10,202003,2020),('2020-03-05',202009,3,2020,5,10,202003,2020),('2020-03-06',202009,3,2020,6,10,202003,2020),('2020-03-07',202009,3,2020,7,10,202003,2020),('2020-03-08',202010,3,2020,8,11,202003,2020),('2020-03-09',202010,3,2020,9,11,202003,2020),('2020-03-10',202010,3,2020,10,11,202003,2020),('2020-03-11',202010,3,2020,11,11,202003,2020),('2020-03-12',202010,3,2020,12,11,202003,2020),('2020-03-13',202010,3,2020,13,11,202003,2020),('2020-03-14',202010,3,2020,14,11,202003,2020),('2020-03-15',202011,3,2020,15,12,202003,2020),('2020-03-16',202011,3,2020,16,12,202003,2020),('2020-03-17',202011,3,2020,17,12,202003,2020),('2020-03-18',202011,3,2020,18,12,202003,2020),('2020-03-19',202011,3,2020,19,12,202003,2020),('2020-03-20',202011,3,2020,20,12,202003,2020),('2020-03-21',202011,3,2020,21,12,202003,2020),('2020-03-22',202012,3,2020,22,13,202003,2020),('2020-03-23',202012,3,2020,23,13,202003,2020),('2020-03-24',202012,3,2020,24,13,202003,2020),('2020-03-25',202012,3,2020,25,13,202003,2020),('2020-03-26',202012,3,2020,26,13,202003,2020),('2020-03-27',202012,3,2020,27,13,202003,2020),('2020-03-28',202012,3,2020,28,13,202003,2020),('2020-03-29',202013,3,2020,29,14,202003,2020),('2020-03-30',202013,3,2020,30,14,202003,2020),('2020-03-31',202013,3,2020,31,14,202003,2020),('2020-04-01',202013,4,2020,1,14,202004,2020),('2020-04-02',202013,4,2020,2,14,202004,2020),('2020-04-03',202013,4,2020,3,14,202004,2020),('2020-04-04',202013,4,2020,4,14,202004,2020),('2020-04-05',202014,4,2020,5,15,202004,2020),('2020-04-06',202014,4,2020,6,15,202004,2020),('2020-04-07',202014,4,2020,7,15,202004,2020),('2020-04-08',202014,4,2020,8,15,202004,2020),('2020-04-09',202014,4,2020,9,15,202004,2020),('2020-04-10',202014,4,2020,10,15,202004,2020),('2020-04-11',202014,4,2020,11,15,202004,2020),('2020-04-12',202015,4,2020,12,16,202004,2020),('2020-04-13',202015,4,2020,13,16,202004,2020),('2020-04-14',202015,4,2020,14,16,202004,2020),('2020-04-15',202015,4,2020,15,16,202004,2020),('2020-04-16',202015,4,2020,16,16,202004,2020),('2020-04-17',202015,4,2020,17,16,202004,2020),('2020-04-18',202015,4,2020,18,16,202004,2020),('2020-04-19',202016,4,2020,19,17,202004,2020),('2020-04-20',202016,4,2020,20,17,202004,2020),('2020-04-21',202016,4,2020,21,17,202004,2020),('2020-04-22',202016,4,2020,22,17,202004,2020),('2020-04-23',202016,4,2020,23,17,202004,2020),('2020-04-24',202016,4,2020,24,17,202004,2020),('2020-04-25',202016,4,2020,25,17,202004,2020),('2020-04-26',202017,4,2020,26,18,202004,2020),('2020-04-27',202017,4,2020,27,18,202004,2020),('2020-04-28',202017,4,2020,28,18,202004,2020),('2020-04-29',202017,4,2020,29,18,202004,2020),('2020-04-30',202017,4,2020,30,18,202004,2020),('2020-05-01',202017,5,2020,1,18,202005,2020),('2020-05-02',202017,5,2020,2,18,202005,2020),('2020-05-03',202018,5,2020,3,19,202005,2020),('2020-05-04',202018,5,2020,4,19,202005,2020),('2020-05-05',202018,5,2020,5,19,202005,2020),('2020-05-06',202018,5,2020,6,19,202005,2020),('2020-05-07',202018,5,2020,7,19,202005,2020),('2020-05-08',202018,5,2020,8,19,202005,2020),('2020-05-09',202018,5,2020,9,19,202005,2020),('2020-05-10',202019,5,2020,10,20,202005,2020),('2020-05-11',202019,5,2020,11,20,202005,2020),('2020-05-12',202019,5,2020,12,20,202005,2020),('2020-05-13',202019,5,2020,13,20,202005,2020),('2020-05-14',202019,5,2020,14,20,202005,2020),('2020-05-15',202019,5,2020,15,20,202005,2020),('2020-05-16',202019,5,2020,16,20,202005,2020),('2020-05-17',202020,5,2020,17,21,202005,2020),('2020-05-18',202020,5,2020,18,21,202005,2020),('2020-05-19',202020,5,2020,19,21,202005,2020),('2020-05-20',202020,5,2020,20,21,202005,2020),('2020-05-21',202020,5,2020,21,21,202005,2020),('2020-05-22',202020,5,2020,22,21,202005,2020),('2020-05-23',202020,5,2020,23,21,202005,2020),('2020-05-24',202021,5,2020,24,22,202005,2020),('2020-05-25',202021,5,2020,25,22,202005,2020),('2020-05-26',202021,5,2020,26,22,202005,2020),('2020-05-27',202021,5,2020,27,22,202005,2020),('2020-05-28',202021,5,2020,28,22,202005,2020),('2020-05-29',202021,5,2020,29,22,202005,2020),('2020-05-30',202021,5,2020,30,22,202005,2020),('2020-05-31',202022,5,2020,31,23,202005,2020),('2020-06-01',202022,6,2020,1,23,202006,2020),('2020-06-02',202022,6,2020,2,23,202006,2020),('2020-06-03',202022,6,2020,3,23,202006,2020),('2020-06-04',202022,6,2020,4,23,202006,2020),('2020-06-05',202022,6,2020,5,23,202006,2020),('2020-06-06',202022,6,2020,6,23,202006,2020),('2020-06-07',202023,6,2020,7,24,202006,2020),('2020-06-08',202023,6,2020,8,24,202006,2020),('2020-06-09',202023,6,2020,9,24,202006,2020),('2020-06-10',202023,6,2020,10,24,202006,2020),('2020-06-11',202023,6,2020,11,24,202006,2020),('2020-06-12',202023,6,2020,12,24,202006,2020),('2020-06-13',202023,6,2020,13,24,202006,2020),('2020-06-14',202024,6,2020,14,25,202006,2020),('2020-06-15',202024,6,2020,15,25,202006,2020),('2020-06-16',202024,6,2020,16,25,202006,2020),('2020-06-17',202024,6,2020,17,25,202006,2020),('2020-06-18',202024,6,2020,18,25,202006,2020),('2020-06-19',202024,6,2020,19,25,202006,2020),('2020-06-20',202024,6,2020,20,25,202006,2020),('2020-06-21',202025,6,2020,21,26,202006,2020),('2020-06-22',202025,6,2020,22,26,202006,2020),('2020-06-23',202025,6,2020,23,26,202006,2020),('2020-06-24',202025,6,2020,24,26,202006,2020),('2020-06-25',202025,6,2020,25,26,202006,2020),('2020-06-26',202025,6,2020,26,26,202006,2020),('2020-06-27',202025,6,2020,27,26,202006,2020),('2020-06-28',202026,6,2020,28,27,202006,2020),('2020-06-29',202026,6,2020,29,27,202006,2020),('2020-06-30',202026,6,2020,30,27,202006,2020),('2020-07-01',202026,7,2020,1,27,202007,2020),('2020-07-02',202026,7,2020,2,27,202007,2020),('2020-07-03',202026,7,2020,3,27,202007,2020),('2020-07-04',202026,7,2020,4,27,202007,2020),('2020-07-05',202027,7,2020,5,28,202007,2020),('2020-07-06',202027,7,2020,6,28,202007,2020),('2020-07-07',202027,7,2020,7,28,202007,2020),('2020-07-08',202027,7,2020,8,28,202007,2020),('2020-07-09',202027,7,2020,9,28,202007,2020),('2020-07-10',202027,7,2020,10,28,202007,2020),('2020-07-11',202027,7,2020,11,28,202007,2020),('2020-07-12',202028,7,2020,12,29,202007,2020),('2020-07-13',202028,7,2020,13,29,202007,2020),('2020-07-14',202028,7,2020,14,29,202007,2020),('2020-07-15',202028,7,2020,15,29,202007,2020),('2020-07-16',202028,7,2020,16,29,202007,2020),('2020-07-17',202028,7,2020,17,29,202007,2020),('2020-07-18',202028,7,2020,18,29,202007,2020),('2020-07-19',202029,7,2020,19,30,202007,2020),('2020-07-20',202029,7,2020,20,30,202007,2020),('2020-07-21',202029,7,2020,21,30,202007,2020),('2020-07-22',202029,7,2020,22,30,202007,2020),('2020-07-23',202029,7,2020,23,30,202007,2020),('2020-07-24',202029,7,2020,24,30,202007,2020),('2020-07-25',202029,7,2020,25,30,202007,2020),('2020-07-26',202030,7,2020,26,31,202007,2020),('2020-07-27',202030,7,2020,27,31,202007,2020),('2020-07-28',202030,7,2020,28,31,202007,2020),('2020-07-29',202030,7,2020,29,31,202007,2020),('2020-07-30',202030,7,2020,30,31,202007,2020),('2020-07-31',202030,7,2020,31,31,202007,2020),('2020-08-01',202030,8,2020,1,31,202008,2020),('2020-08-02',202031,8,2020,2,32,202008,2020),('2020-08-03',202031,8,2020,3,32,202008,2020),('2020-08-04',202031,8,2020,4,32,202008,2020),('2020-08-05',202031,8,2020,5,32,202008,2020),('2020-08-06',202031,8,2020,6,32,202008,2020),('2020-08-07',202031,8,2020,7,32,202008,2020),('2020-08-08',202031,8,2020,8,32,202008,2020),('2020-08-09',202032,8,2020,9,33,202008,2020),('2020-08-10',202032,8,2020,10,33,202008,2020),('2020-08-11',202032,8,2020,11,33,202008,2020),('2020-08-12',202032,8,2020,12,33,202008,2020),('2020-08-13',202032,8,2020,13,33,202008,2020),('2020-08-14',202032,8,2020,14,33,202008,2020),('2020-08-15',202032,8,2020,15,33,202008,2020),('2020-08-16',202033,8,2020,16,34,202008,2020),('2020-08-17',202033,8,2020,17,34,202008,2020),('2020-08-18',202033,8,2020,18,34,202008,2020),('2020-08-19',202033,8,2020,19,34,202008,2020),('2020-08-20',202033,8,2020,20,34,202008,2020),('2020-08-21',202033,8,2020,21,34,202008,2020),('2020-08-22',202033,8,2020,22,34,202008,2020),('2020-08-23',202034,8,2020,23,35,202008,2020),('2020-08-24',202034,8,2020,24,35,202008,2020),('2020-08-25',202034,8,2020,25,35,202008,2020),('2020-08-26',202034,8,2020,26,35,202008,2020),('2020-08-27',202034,8,2020,27,35,202008,2020),('2020-08-28',202034,8,2020,28,35,202008,2020),('2020-08-29',202034,8,2020,29,35,202008,2020),('2020-08-30',202035,8,2020,30,36,202008,2020),('2020-08-31',202035,8,2020,31,36,202008,2020),('2020-09-01',202035,9,2020,1,36,202009,2020),('2020-09-02',202035,9,2020,2,36,202009,2020),('2020-09-03',202035,9,2020,3,36,202009,2020),('2020-09-04',202035,9,2020,4,36,202009,2020),('2020-09-05',202035,9,2020,5,36,202009,2020),('2020-09-06',202036,9,2020,6,37,202009,2020),('2020-09-07',202036,9,2020,7,37,202009,2020),('2020-09-08',202036,9,2020,8,37,202009,2020),('2020-09-09',202036,9,2020,9,37,202009,2020),('2020-09-10',202036,9,2020,10,37,202009,2020),('2020-09-11',202036,9,2020,11,37,202009,2020),('2020-09-12',202036,9,2020,12,37,202009,2020),('2020-09-13',202037,9,2020,13,38,202009,2020),('2020-09-14',202037,9,2020,14,38,202009,2020),('2020-09-15',202037,9,2020,15,38,202009,2020),('2020-09-16',202037,9,2020,16,38,202009,2020),('2020-09-17',202037,9,2020,17,38,202009,2020),('2020-09-18',202037,9,2020,18,38,202009,2020),('2020-09-19',202037,9,2020,19,38,202009,2020),('2020-09-20',202038,9,2020,20,39,202009,2020),('2020-09-21',202038,9,2020,21,39,202009,2020),('2020-09-22',202038,9,2020,22,39,202009,2020),('2020-09-23',202038,9,2020,23,39,202009,2020),('2020-09-24',202038,9,2020,24,39,202009,2020),('2020-09-25',202038,9,2020,25,39,202009,2020),('2020-09-26',202038,9,2020,26,39,202009,2020),('2020-09-27',202039,9,2020,27,40,202009,2020),('2020-09-28',202039,9,2020,28,40,202009,2020),('2020-09-29',202039,9,2020,29,40,202009,2020),('2020-09-30',202039,9,2020,30,40,202009,2020),('2020-10-01',202039,10,2020,1,40,202010,2020),('2020-10-02',202039,10,2020,2,40,202010,2020),('2020-10-03',202039,10,2020,3,40,202010,2020),('2020-10-04',202040,10,2020,4,41,202010,2020),('2020-10-05',202040,10,2020,5,41,202010,2020),('2020-10-06',202040,10,2020,6,41,202010,2020),('2020-10-07',202040,10,2020,7,41,202010,2020),('2020-10-08',202040,10,2020,8,41,202010,2020),('2020-10-09',202040,10,2020,9,41,202010,2020),('2020-10-10',202040,10,2020,10,41,202010,2020),('2020-10-11',202041,10,2020,11,42,202010,2020),('2020-10-12',202041,10,2020,12,42,202010,2020),('2020-10-13',202041,10,2020,13,42,202010,2020),('2020-10-14',202041,10,2020,14,42,202010,2020),('2020-10-15',202041,10,2020,15,42,202010,2020),('2020-10-16',202041,10,2020,16,42,202010,2020),('2020-10-17',202041,10,2020,17,42,202010,2020),('2020-10-18',202042,10,2020,18,43,202010,2020),('2020-10-19',202042,10,2020,19,43,202010,2020),('2020-10-20',202042,10,2020,20,43,202010,2020),('2020-10-21',202042,10,2020,21,43,202010,2020),('2020-10-22',202042,10,2020,22,43,202010,2020),('2020-10-23',202042,10,2020,23,43,202010,2020),('2020-10-24',202042,10,2020,24,43,202010,2020),('2020-10-25',202043,10,2020,25,44,202010,2020),('2020-10-26',202043,10,2020,26,44,202010,2020),('2020-10-27',202043,10,2020,27,44,202010,2020),('2020-10-28',202043,10,2020,28,44,202010,2020),('2020-10-29',202043,10,2020,29,44,202010,2020),('2020-10-30',202043,10,2020,30,44,202010,2020),('2020-10-31',202043,10,2020,31,44,202010,2020),('2020-11-01',202044,11,2020,1,45,202011,2020),('2020-11-02',202044,11,2020,2,45,202011,2020),('2020-11-03',202044,11,2020,3,45,202011,2020),('2020-11-04',202044,11,2020,4,45,202011,2020),('2020-11-05',202044,11,2020,5,45,202011,2020),('2020-11-06',202044,11,2020,6,45,202011,2020),('2020-11-07',202044,11,2020,7,45,202011,2020),('2020-11-08',202045,11,2020,8,46,202011,2020),('2020-11-09',202045,11,2020,9,46,202011,2020),('2020-11-10',202045,11,2020,10,46,202011,2020),('2020-11-11',202045,11,2020,11,46,202011,2020),('2020-11-12',202045,11,2020,12,46,202011,2020),('2020-11-13',202045,11,2020,13,46,202011,2020),('2020-11-14',202045,11,2020,14,46,202011,2020),('2020-11-15',202046,11,2020,15,47,202011,2020),('2020-11-16',202046,11,2020,16,47,202011,2020),('2020-11-17',202046,11,2020,17,47,202011,2020),('2020-11-18',202046,11,2020,18,47,202011,2020),('2020-11-19',202046,11,2020,19,47,202011,2020),('2020-11-20',202046,11,2020,20,47,202011,2020),('2020-11-21',202046,11,2020,21,47,202011,2020),('2020-11-22',202047,11,2020,22,48,202011,2020),('2020-11-23',202047,11,2020,23,48,202011,2020),('2020-11-24',202047,11,2020,24,48,202011,2020),('2020-11-25',202047,11,2020,25,48,202011,2020),('2020-11-26',202047,11,2020,26,48,202011,2020),('2020-11-27',202047,11,2020,27,48,202011,2020),('2020-11-28',202047,11,2020,28,48,202011,2020),('2020-11-29',202048,11,2020,29,49,202011,2020),('2020-11-30',202048,11,2020,30,49,202011,2020),('2020-12-01',202048,12,2020,1,49,202012,2021),('2020-12-02',202048,12,2020,2,49,202012,2021),('2020-12-03',202048,12,2020,3,49,202012,2021),('2020-12-04',202048,12,2020,4,49,202012,2021),('2020-12-05',202048,12,2020,5,49,202012,2021),('2020-12-06',202049,12,2020,6,50,202012,2021),('2020-12-07',202049,12,2020,7,50,202012,2021),('2020-12-08',202049,12,2020,8,50,202012,2021),('2020-12-09',202049,12,2020,9,50,202012,2021),('2020-12-10',202049,12,2020,10,50,202012,2021),('2020-12-11',202049,12,2020,11,50,202012,2021),('2020-12-12',202049,12,2020,12,50,202012,2021),('2020-12-13',202050,12,2020,13,51,202012,2021),('2020-12-14',202050,12,2020,14,51,202012,2021),('2020-12-15',202050,12,2020,15,51,202012,2021),('2020-12-16',202050,12,2020,16,51,202012,2021),('2020-12-17',202050,12,2020,17,51,202012,2021),('2020-12-18',202050,12,2020,18,51,202012,2021),('2020-12-19',202050,12,2020,19,51,202012,2021),('2020-12-20',202051,12,2020,20,52,202012,2021),('2020-12-21',202051,12,2020,21,52,202012,2021),('2020-12-22',202051,12,2020,22,52,202012,2021),('2020-12-23',202051,12,2020,23,52,202012,2021),('2020-12-24',202051,12,2020,24,52,202012,2021),('2020-12-25',202051,12,2020,25,52,202012,2021),('2020-12-26',202051,12,2020,26,52,202012,2021),('2020-12-27',202052,12,2020,27,53,202012,2021),('2020-12-28',202052,12,2020,28,53,202012,2021),('2020-12-29',202052,12,2020,29,53,202012,2021),('2020-12-30',202052,12,2020,30,53,202012,2021),('2020-12-31',202052,12,2020,31,53,202012,2021),('2021-01-01',202101,1,2021,1,1,202101,2021),('2021-01-02',202101,1,2021,2,1,202101,2021),('2021-01-03',202101,1,2021,3,1,202101,2021),('2021-01-04',202101,1,2021,4,1,202101,2021),('2021-01-05',202101,1,2021,5,1,202101,2021),('2021-01-06',202101,1,2021,6,1,202101,2021),('2021-01-07',202101,1,2021,7,1,202101,2021),('2021-01-08',202101,1,2021,8,1,202101,2021),('2021-01-09',202101,1,2021,9,1,202101,2021),('2021-01-10',202102,1,2021,10,2,202101,2021),('2021-01-11',202102,1,2021,11,2,202101,2021),('2021-01-12',202102,1,2021,12,2,202101,2021),('2021-01-13',202102,1,2021,13,2,202101,2021),('2021-01-14',202102,1,2021,14,2,202101,2021),('2021-01-15',202102,1,2021,15,2,202101,2021),('2021-01-16',202102,1,2021,16,2,202101,2021),('2021-01-17',202103,1,2021,17,3,202101,2021),('2021-01-18',202103,1,2021,18,3,202101,2021),('2021-01-19',202103,1,2021,19,3,202101,2021),('2021-01-20',202103,1,2021,20,3,202101,2021),('2021-01-21',202103,1,2021,21,3,202101,2021),('2021-01-22',202103,1,2021,22,3,202101,2021),('2021-01-23',202103,1,2021,23,3,202101,2021),('2021-01-24',202104,1,2021,24,4,202101,2021),('2021-01-25',202104,1,2021,25,4,202101,2021),('2021-01-26',202104,1,2021,26,4,202101,2021),('2021-01-27',202104,1,2021,27,4,202101,2021),('2021-01-28',202104,1,2021,28,4,202101,2021),('2021-01-29',202104,1,2021,29,4,202101,2021),('2021-01-30',202104,1,2021,30,4,202101,2021),('2021-01-31',202105,1,2021,31,5,202101,2021),('2021-02-01',202105,2,2021,1,5,202102,2021),('2021-02-02',202105,2,2021,2,5,202102,2021),('2021-02-03',202105,2,2021,3,5,202102,2021),('2021-02-04',202105,2,2021,4,5,202102,2021),('2021-02-05',202105,2,2021,5,5,202102,2021),('2021-02-06',202105,2,2021,6,5,202102,2021),('2021-02-07',202106,2,2021,7,6,202102,2021),('2021-02-08',202106,2,2021,8,6,202102,2021),('2021-02-09',202106,2,2021,9,6,202102,2021),('2021-02-10',202106,2,2021,10,6,202102,2021),('2021-02-11',202106,2,2021,11,6,202102,2021),('2021-02-12',202106,2,2021,12,6,202102,2021),('2021-02-13',202106,2,2021,13,6,202102,2021),('2021-02-14',202107,2,2021,14,7,202102,2021),('2021-02-15',202107,2,2021,15,7,202102,2021),('2021-02-16',202107,2,2021,16,7,202102,2021),('2021-02-17',202107,2,2021,17,7,202102,2021),('2021-02-18',202107,2,2021,18,7,202102,2021),('2021-02-19',202107,2,2021,19,7,202102,2021),('2021-02-20',202107,2,2021,20,7,202102,2021),('2021-02-21',202108,2,2021,21,8,202102,2021),('2021-02-22',202108,2,2021,22,8,202102,2021),('2021-02-23',202108,2,2021,23,8,202102,2021),('2021-02-24',202108,2,2021,24,8,202102,2021),('2021-02-25',202108,2,2021,25,8,202102,2021),('2021-02-26',202108,2,2021,26,8,202102,2021),('2021-02-27',202108,2,2021,27,8,202102,2021),('2021-02-28',202109,2,2021,28,9,202102,2021),('2021-03-01',202109,3,2021,1,9,202103,2021),('2021-03-02',202109,3,2021,2,9,202103,2021),('2021-03-03',202109,3,2021,3,9,202103,2021),('2021-03-04',202109,3,2021,4,9,202103,2021),('2021-03-05',202109,3,2021,5,9,202103,2021),('2021-03-06',202109,3,2021,6,9,202103,2021),('2021-03-07',202110,3,2021,7,10,202103,2021),('2021-03-08',202110,3,2021,8,10,202103,2021),('2021-03-09',202110,3,2021,9,10,202103,2021),('2021-03-10',202110,3,2021,10,10,202103,2021),('2021-03-11',202110,3,2021,11,10,202103,2021),('2021-03-12',202110,3,2021,12,10,202103,2021),('2021-03-13',202110,3,2021,13,10,202103,2021),('2021-03-14',202111,3,2021,14,11,202103,2021),('2021-03-15',202111,3,2021,15,11,202103,2021),('2021-03-16',202111,3,2021,16,11,202103,2021),('2021-03-17',202111,3,2021,17,11,202103,2021),('2021-03-18',202111,3,2021,18,11,202103,2021),('2021-03-19',202111,3,2021,19,11,202103,2021),('2021-03-20',202111,3,2021,20,11,202103,2021),('2021-03-21',202112,3,2021,21,12,202103,2021),('2021-03-22',202112,3,2021,22,12,202103,2021),('2021-03-23',202112,3,2021,23,12,202103,2021),('2021-03-24',202112,3,2021,24,12,202103,2021),('2021-03-25',202112,3,2021,25,12,202103,2021),('2021-03-26',202112,3,2021,26,12,202103,2021),('2021-03-27',202112,3,2021,27,12,202103,2021),('2021-03-28',202113,3,2021,28,13,202103,2021),('2021-03-29',202113,3,2021,29,13,202103,2021),('2021-03-30',202113,3,2021,30,13,202103,2021),('2021-03-31',202113,3,2021,31,13,202103,2021),('2021-04-01',202113,4,2021,1,13,202104,2021),('2021-04-02',202113,4,2021,2,13,202104,2021),('2021-04-03',202113,4,2021,3,13,202104,2021),('2021-04-04',202114,4,2021,4,14,202104,2021),('2021-04-05',202114,4,2021,5,14,202104,2021),('2021-04-06',202114,4,2021,6,14,202104,2021),('2021-04-07',202114,4,2021,7,14,202104,2021),('2021-04-08',202114,4,2021,8,14,202104,2021),('2021-04-09',202114,4,2021,9,14,202104,2021),('2021-04-10',202114,4,2021,10,14,202104,2021),('2021-04-11',202115,4,2021,11,15,202104,2021),('2021-04-12',202115,4,2021,12,15,202104,2021),('2021-04-13',202115,4,2021,13,15,202104,2021),('2021-04-14',202115,4,2021,14,15,202104,2021),('2021-04-15',202115,4,2021,15,15,202104,2021),('2021-04-16',202115,4,2021,16,15,202104,2021),('2021-04-17',202115,4,2021,17,15,202104,2021),('2021-04-18',202116,4,2021,18,16,202104,2021),('2021-04-19',202116,4,2021,19,16,202104,2021),('2021-04-20',202116,4,2021,20,16,202104,2021),('2021-04-21',202116,4,2021,21,16,202104,2021),('2021-04-22',202116,4,2021,22,16,202104,2021),('2021-04-23',202116,4,2021,23,16,202104,2021),('2021-04-24',202116,4,2021,24,16,202104,2021),('2021-04-25',202117,4,2021,25,17,202104,2021),('2021-04-26',202117,4,2021,26,17,202104,2021),('2021-04-27',202117,4,2021,27,17,202104,2021),('2021-04-28',202117,4,2021,28,17,202104,2021),('2021-04-29',202117,4,2021,29,17,202104,2021),('2021-04-30',202117,4,2021,30,17,202104,2021),('2021-05-01',202117,5,2021,1,17,202105,2021),('2021-05-02',202118,5,2021,2,18,202105,2021),('2021-05-03',202118,5,2021,3,18,202105,2021),('2021-05-04',202118,5,2021,4,18,202105,2021),('2021-05-05',202118,5,2021,5,18,202105,2021),('2021-05-06',202118,5,2021,6,18,202105,2021),('2021-05-07',202118,5,2021,7,18,202105,2021),('2021-05-08',202118,5,2021,8,18,202105,2021),('2021-05-09',202119,5,2021,9,19,202105,2021),('2021-05-10',202119,5,2021,10,19,202105,2021),('2021-05-11',202119,5,2021,11,19,202105,2021),('2021-05-12',202119,5,2021,12,19,202105,2021),('2021-05-13',202119,5,2021,13,19,202105,2021),('2021-05-14',202119,5,2021,14,19,202105,2021),('2021-05-15',202119,5,2021,15,19,202105,2021),('2021-05-16',202120,5,2021,16,20,202105,2021),('2021-05-17',202120,5,2021,17,20,202105,2021),('2021-05-18',202120,5,2021,18,20,202105,2021),('2021-05-19',202120,5,2021,19,20,202105,2021),('2021-05-20',202120,5,2021,20,20,202105,2021),('2021-05-21',202120,5,2021,21,20,202105,2021),('2021-05-22',202120,5,2021,22,20,202105,2021),('2021-05-23',202121,5,2021,23,21,202105,2021),('2021-05-24',202121,5,2021,24,21,202105,2021),('2021-05-25',202121,5,2021,25,21,202105,2021),('2021-05-26',202121,5,2021,26,21,202105,2021),('2021-05-27',202121,5,2021,27,21,202105,2021),('2021-05-28',202121,5,2021,28,21,202105,2021),('2021-05-29',202121,5,2021,29,21,202105,2021),('2021-05-30',202122,5,2021,30,22,202105,2021),('2021-05-31',202122,5,2021,31,22,202105,2021),('2021-06-01',202122,6,2021,1,22,202106,2021),('2021-06-02',202122,6,2021,2,22,202106,2021),('2021-06-03',202122,6,2021,3,22,202106,2021),('2021-06-04',202122,6,2021,4,22,202106,2021),('2021-06-05',202122,6,2021,5,22,202106,2021),('2021-06-06',202123,6,2021,6,23,202106,2021),('2021-06-07',202123,6,2021,7,23,202106,2021),('2021-06-08',202123,6,2021,8,23,202106,2021),('2021-06-09',202123,6,2021,9,23,202106,2021),('2021-06-10',202123,6,2021,10,23,202106,2021),('2021-06-11',202123,6,2021,11,23,202106,2021),('2021-06-12',202123,6,2021,12,23,202106,2021),('2021-06-13',202124,6,2021,13,24,202106,2021),('2021-06-14',202124,6,2021,14,24,202106,2021),('2021-06-15',202124,6,2021,15,24,202106,2021),('2021-06-16',202124,6,2021,16,24,202106,2021),('2021-06-17',202124,6,2021,17,24,202106,2021),('2021-06-18',202124,6,2021,18,24,202106,2021),('2021-06-19',202124,6,2021,19,24,202106,2021),('2021-06-20',202125,6,2021,20,25,202106,2021),('2021-06-21',202125,6,2021,21,25,202106,2021),('2021-06-22',202125,6,2021,22,25,202106,2021),('2021-06-23',202125,6,2021,23,25,202106,2021),('2021-06-24',202125,6,2021,24,25,202106,2021),('2021-06-25',202125,6,2021,25,25,202106,2021),('2021-06-26',202125,6,2021,26,25,202106,2021),('2021-06-27',202126,6,2021,27,26,202106,2021),('2021-06-28',202126,6,2021,28,26,202106,2021),('2021-06-29',202126,6,2021,29,26,202106,2021),('2021-06-30',202126,6,2021,30,26,202106,2021),('2021-07-01',202126,7,2021,1,26,202107,2021),('2021-07-02',202126,7,2021,2,26,202107,2021),('2021-07-03',202126,7,2021,3,26,202107,2021),('2021-07-04',202127,7,2021,4,27,202107,2021),('2021-07-05',202127,7,2021,5,27,202107,2021),('2021-07-06',202127,7,2021,6,27,202107,2021),('2021-07-07',202127,7,2021,7,27,202107,2021),('2021-07-08',202127,7,2021,8,27,202107,2021),('2021-07-09',202127,7,2021,9,27,202107,2021),('2021-07-10',202127,7,2021,10,27,202107,2021),('2021-07-11',202128,7,2021,11,28,202107,2021),('2021-07-12',202128,7,2021,12,28,202107,2021),('2021-07-13',202128,7,2021,13,28,202107,2021),('2021-07-14',202128,7,2021,14,28,202107,2021),('2021-07-15',202128,7,2021,15,28,202107,2021),('2021-07-16',202128,7,2021,16,28,202107,2021),('2021-07-17',202128,7,2021,17,28,202107,2021),('2021-07-18',202129,7,2021,18,29,202107,2021),('2021-07-19',202129,7,2021,19,29,202107,2021),('2021-07-20',202129,7,2021,20,29,202107,2021),('2021-07-21',202129,7,2021,21,29,202107,2021),('2021-07-22',202129,7,2021,22,29,202107,2021),('2021-07-23',202129,7,2021,23,29,202107,2021),('2021-07-24',202129,7,2021,24,29,202107,2021),('2021-07-25',202130,7,2021,25,30,202107,2021),('2021-07-26',202130,7,2021,26,30,202107,2021),('2021-07-27',202130,7,2021,27,30,202107,2021),('2021-07-28',202130,7,2021,28,30,202107,2021),('2021-07-29',202130,7,2021,29,30,202107,2021),('2021-07-30',202130,7,2021,30,30,202107,2021),('2021-07-31',202130,7,2021,31,30,202107,2021),('2021-08-01',202131,8,2021,1,31,202108,2021),('2021-08-02',202131,8,2021,2,31,202108,2021),('2021-08-03',202131,8,2021,3,31,202108,2021),('2021-08-04',202131,8,2021,4,31,202108,2021),('2021-08-05',202131,8,2021,5,31,202108,2021),('2021-08-06',202131,8,2021,6,31,202108,2021),('2021-08-07',202131,8,2021,7,31,202108,2021),('2021-08-08',202132,8,2021,8,32,202108,2021),('2021-08-09',202132,8,2021,9,32,202108,2021),('2021-08-10',202132,8,2021,10,32,202108,2021),('2021-08-11',202132,8,2021,11,32,202108,2021),('2021-08-12',202132,8,2021,12,32,202108,2021),('2021-08-13',202132,8,2021,13,32,202108,2021),('2021-08-14',202132,8,2021,14,32,202108,2021),('2021-08-15',202133,8,2021,15,33,202108,2021),('2021-08-16',202133,8,2021,16,33,202108,2021),('2021-08-17',202133,8,2021,17,33,202108,2021),('2021-08-18',202133,8,2021,18,33,202108,2021),('2021-08-19',202133,8,2021,19,33,202108,2021),('2021-08-20',202133,8,2021,20,33,202108,2021),('2021-08-21',202133,8,2021,21,33,202108,2021),('2021-08-22',202134,8,2021,22,34,202108,2021),('2021-08-23',202134,8,2021,23,34,202108,2021),('2021-08-24',202134,8,2021,24,34,202108,2021),('2021-08-25',202134,8,2021,25,34,202108,2021),('2021-08-26',202134,8,2021,26,34,202108,2021),('2021-08-27',202134,8,2021,27,34,202108,2021),('2021-08-28',202134,8,2021,28,34,202108,2021),('2021-08-29',202135,8,2021,29,35,202108,2021),('2021-08-30',202135,8,2021,30,35,202108,2021),('2021-08-31',202135,8,2021,31,35,202108,2021),('2021-09-01',202135,9,2021,1,35,202109,2021),('2021-09-02',202135,9,2021,2,35,202109,2021),('2021-09-03',202135,9,2021,3,35,202109,2021),('2021-09-04',202135,9,2021,4,35,202109,2021),('2021-09-05',202136,9,2021,5,36,202109,2021),('2021-09-06',202136,9,2021,6,36,202109,2021),('2021-09-07',202136,9,2021,7,36,202109,2021),('2021-09-08',202136,9,2021,8,36,202109,2021),('2021-09-09',202136,9,2021,9,36,202109,2021),('2021-09-10',202136,9,2021,10,36,202109,2021),('2021-09-11',202136,9,2021,11,36,202109,2021),('2021-09-12',202137,9,2021,12,37,202109,2021),('2021-09-13',202137,9,2021,13,37,202109,2021),('2021-09-14',202137,9,2021,14,37,202109,2021),('2021-09-15',202137,9,2021,15,37,202109,2021),('2021-09-16',202137,9,2021,16,37,202109,2021),('2021-09-17',202137,9,2021,17,37,202109,2021),('2021-09-18',202137,9,2021,18,37,202109,2021),('2021-09-19',202138,9,2021,19,38,202109,2021),('2021-09-20',202138,9,2021,20,38,202109,2021),('2021-09-21',202138,9,2021,21,38,202109,2021),('2021-09-22',202138,9,2021,22,38,202109,2021),('2021-09-23',202138,9,2021,23,38,202109,2021),('2021-09-24',202138,9,2021,24,38,202109,2021),('2021-09-25',202138,9,2021,25,38,202109,2021),('2021-09-26',202139,9,2021,26,39,202109,2021),('2021-09-27',202139,9,2021,27,39,202109,2021),('2021-09-28',202139,9,2021,28,39,202109,2021),('2021-09-29',202139,9,2021,29,39,202109,2021),('2021-09-30',202139,9,2021,30,39,202109,2021),('2021-10-01',202139,10,2021,1,39,202110,2021),('2021-10-02',202139,10,2021,2,39,202110,2021),('2021-10-03',202140,10,2021,3,40,202110,2021),('2021-10-04',202140,10,2021,4,40,202110,2021),('2021-10-05',202140,10,2021,5,40,202110,2021),('2021-10-06',202140,10,2021,6,40,202110,2021),('2021-10-07',202140,10,2021,7,40,202110,2021),('2021-10-08',202140,10,2021,8,40,202110,2021),('2021-10-09',202140,10,2021,9,40,202110,2021),('2021-10-10',202141,10,2021,10,41,202110,2021),('2021-10-11',202141,10,2021,11,41,202110,2021),('2021-10-12',202141,10,2021,12,41,202110,2021),('2021-10-13',202141,10,2021,13,41,202110,2021),('2021-10-14',202141,10,2021,14,41,202110,2021),('2021-10-15',202141,10,2021,15,41,202110,2021),('2021-10-16',202141,10,2021,16,41,202110,2021),('2021-10-17',202142,10,2021,17,42,202110,2021),('2021-10-18',202142,10,2021,18,42,202110,2021),('2021-10-19',202142,10,2021,19,42,202110,2021),('2021-10-20',202142,10,2021,20,42,202110,2021),('2021-10-21',202142,10,2021,21,42,202110,2021),('2021-10-22',202142,10,2021,22,42,202110,2021),('2021-10-23',202142,10,2021,23,42,202110,2021),('2021-10-24',202143,10,2021,24,43,202110,2021),('2021-10-25',202143,10,2021,25,43,202110,2021),('2021-10-26',202143,10,2021,26,43,202110,2021),('2021-10-27',202143,10,2021,27,43,202110,2021),('2021-10-28',202143,10,2021,28,43,202110,2021),('2021-10-29',202143,10,2021,29,43,202110,2021),('2021-10-30',202143,10,2021,30,43,202110,2021),('2021-10-31',202144,10,2021,31,44,202110,2021),('2021-11-01',202144,11,2021,1,44,202111,2021),('2021-11-02',202144,11,2021,2,44,202111,2021),('2021-11-03',202144,11,2021,3,44,202111,2021),('2021-11-04',202144,11,2021,4,44,202111,2021),('2021-11-05',202144,11,2021,5,44,202111,2021),('2021-11-06',202144,11,2021,6,44,202111,2021),('2021-11-07',202145,11,2021,7,45,202111,2021),('2021-11-08',202145,11,2021,8,45,202111,2021),('2021-11-09',202145,11,2021,9,45,202111,2021),('2021-11-10',202145,11,2021,10,45,202111,2021),('2021-11-11',202145,11,2021,11,45,202111,2021),('2021-11-12',202145,11,2021,12,45,202111,2021),('2021-11-13',202145,11,2021,13,45,202111,2021),('2021-11-14',202146,11,2021,14,46,202111,2021),('2021-11-15',202146,11,2021,15,46,202111,2021),('2021-11-16',202146,11,2021,16,46,202111,2021),('2021-11-17',202146,11,2021,17,46,202111,2021),('2021-11-18',202146,11,2021,18,46,202111,2021),('2021-11-19',202146,11,2021,19,46,202111,2021),('2021-11-20',202146,11,2021,20,46,202111,2021),('2021-11-21',202147,11,2021,21,47,202111,2021),('2021-11-22',202147,11,2021,22,47,202111,2021),('2021-11-23',202147,11,2021,23,47,202111,2021),('2021-11-24',202147,11,2021,24,47,202111,2021),('2021-11-25',202147,11,2021,25,47,202111,2021),('2021-11-26',202147,11,2021,26,47,202111,2021),('2021-11-27',202147,11,2021,27,47,202111,2021),('2021-11-28',202148,11,2021,28,48,202111,2021),('2021-11-29',202148,11,2021,29,48,202111,2021),('2021-11-30',202148,11,2021,30,48,202111,2021),('2021-12-01',202148,12,2021,1,48,202112,2022),('2021-12-02',202148,12,2021,2,48,202112,2022),('2021-12-03',202148,12,2021,3,48,202112,2022),('2021-12-04',202148,12,2021,4,48,202112,2022),('2021-12-05',202149,12,2021,5,49,202112,2022),('2021-12-06',202149,12,2021,6,49,202112,2022),('2021-12-07',202149,12,2021,7,49,202112,2022),('2021-12-08',202149,12,2021,8,49,202112,2022),('2021-12-09',202149,12,2021,9,49,202112,2022),('2021-12-10',202149,12,2021,10,49,202112,2022),('2021-12-11',202149,12,2021,11,49,202112,2022),('2021-12-12',202150,12,2021,12,50,202112,2022),('2021-12-13',202150,12,2021,13,50,202112,2022),('2021-12-14',202150,12,2021,14,50,202112,2022),('2021-12-15',202150,12,2021,15,50,202112,2022),('2021-12-16',202150,12,2021,16,50,202112,2022),('2021-12-17',202150,12,2021,17,50,202112,2022),('2021-12-18',202150,12,2021,18,50,202112,2022),('2021-12-19',202151,12,2021,19,51,202112,2022),('2021-12-20',202151,12,2021,20,51,202112,2022),('2021-12-21',202151,12,2021,21,51,202112,2022),('2021-12-22',202151,12,2021,22,51,202112,2022),('2021-12-23',202151,12,2021,23,51,202112,2022),('2021-12-24',202151,12,2021,24,51,202112,2022),('2021-12-25',202151,12,2021,25,51,202112,2022),('2021-12-26',202152,12,2021,26,52,202112,2022),('2021-12-27',202152,12,2021,27,52,202112,2022),('2021-12-28',202152,12,2021,28,52,202112,2022),('2021-12-29',202152,12,2021,29,52,202112,2022),('2021-12-30',202152,12,2021,30,52,202112,2022),('2021-12-31',202152,12,2021,31,52,202112,2022),('2022-01-01',202152,1,2022,1,52,202201,2022),('2022-01-02',202201,1,2022,2,1,202201,2022),('2022-01-03',202201,1,2022,3,1,202201,2022),('2022-01-04',202201,1,2022,4,1,202201,2022),('2022-01-05',202201,1,2022,5,1,202201,2022),('2022-01-06',202201,1,2022,6,1,202201,2022),('2022-01-07',202201,1,2022,7,1,202201,2022),('2022-01-08',202201,1,2022,8,1,202201,2022),('2022-01-09',202202,1,2022,9,2,202201,2022),('2022-01-10',202202,1,2022,10,2,202201,2022),('2022-01-11',202202,1,2022,11,2,202201,2022),('2022-01-12',202202,1,2022,12,2,202201,2022),('2022-01-13',202202,1,2022,13,2,202201,2022),('2022-01-14',202202,1,2022,14,2,202201,2022),('2022-01-15',202202,1,2022,15,2,202201,2022),('2022-01-16',202203,1,2022,16,3,202201,2022),('2022-01-17',202203,1,2022,17,3,202201,2022),('2022-01-18',202203,1,2022,18,3,202201,2022),('2022-01-19',202203,1,2022,19,3,202201,2022),('2022-01-20',202203,1,2022,20,3,202201,2022),('2022-01-21',202203,1,2022,21,3,202201,2022),('2022-01-22',202203,1,2022,22,3,202201,2022),('2022-01-23',202204,1,2022,23,4,202201,2022),('2022-01-24',202204,1,2022,24,4,202201,2022),('2022-01-25',202204,1,2022,25,4,202201,2022),('2022-01-26',202204,1,2022,26,4,202201,2022),('2022-01-27',202204,1,2022,27,4,202201,2022),('2022-01-28',202204,1,2022,28,4,202201,2022),('2022-01-29',202204,1,2022,29,4,202201,2022),('2022-01-30',202205,1,2022,30,5,202201,2022),('2022-01-31',202205,1,2022,31,5,202201,2022),('2022-02-01',202205,2,2022,1,5,202202,2022),('2022-02-02',202205,2,2022,2,5,202202,2022),('2022-02-03',202205,2,2022,3,5,202202,2022),('2022-02-04',202205,2,2022,4,5,202202,2022),('2022-02-05',202205,2,2022,5,5,202202,2022),('2022-02-06',202206,2,2022,6,6,202202,2022),('2022-02-07',202206,2,2022,7,6,202202,2022),('2022-02-08',202206,2,2022,8,6,202202,2022),('2022-02-09',202206,2,2022,9,6,202202,2022),('2022-02-10',202206,2,2022,10,6,202202,2022),('2022-02-11',202206,2,2022,11,6,202202,2022),('2022-02-12',202206,2,2022,12,6,202202,2022),('2022-02-13',202207,2,2022,13,7,202202,2022),('2022-02-14',202207,2,2022,14,7,202202,2022),('2022-02-15',202207,2,2022,15,7,202202,2022),('2022-02-16',202207,2,2022,16,7,202202,2022),('2022-02-17',202207,2,2022,17,7,202202,2022),('2022-02-18',202207,2,2022,18,7,202202,2022),('2022-02-19',202207,2,2022,19,7,202202,2022),('2022-02-20',202208,2,2022,20,8,202202,2022),('2022-02-21',202208,2,2022,21,8,202202,2022),('2022-02-22',202208,2,2022,22,8,202202,2022),('2022-02-23',202208,2,2022,23,8,202202,2022),('2022-02-24',202208,2,2022,24,8,202202,2022),('2022-02-25',202208,2,2022,25,8,202202,2022),('2022-02-26',202208,2,2022,26,8,202202,2022),('2022-02-27',202209,2,2022,27,9,202202,2022),('2022-02-28',202209,2,2022,28,9,202202,2022),('2022-03-01',202209,3,2022,1,9,202203,2022),('2022-03-02',202209,3,2022,2,9,202203,2022),('2022-03-03',202209,3,2022,3,9,202203,2022),('2022-03-04',202209,3,2022,4,9,202203,2022),('2022-03-05',202209,3,2022,5,9,202203,2022),('2022-03-06',202210,3,2022,6,10,202203,2022),('2022-03-07',202210,3,2022,7,10,202203,2022),('2022-03-08',202210,3,2022,8,10,202203,2022),('2022-03-09',202210,3,2022,9,10,202203,2022),('2022-03-10',202210,3,2022,10,10,202203,2022),('2022-03-11',202210,3,2022,11,10,202203,2022),('2022-03-12',202210,3,2022,12,10,202203,2022),('2022-03-13',202211,3,2022,13,11,202203,2022),('2022-03-14',202211,3,2022,14,11,202203,2022),('2022-03-15',202211,3,2022,15,11,202203,2022),('2022-03-16',202211,3,2022,16,11,202203,2022),('2022-03-17',202211,3,2022,17,11,202203,2022),('2022-03-18',202211,3,2022,18,11,202203,2022),('2022-03-19',202211,3,2022,19,11,202203,2022),('2022-03-20',202212,3,2022,20,12,202203,2022),('2022-03-21',202212,3,2022,21,12,202203,2022),('2022-03-22',202212,3,2022,22,12,202203,2022),('2022-03-23',202212,3,2022,23,12,202203,2022),('2022-03-24',202212,3,2022,24,12,202203,2022),('2022-03-25',202212,3,2022,25,12,202203,2022),('2022-03-26',202212,3,2022,26,12,202203,2022),('2022-03-27',202213,3,2022,27,13,202203,2022),('2022-03-28',202213,3,2022,28,13,202203,2022),('2022-03-29',202213,3,2022,29,13,202203,2022),('2022-03-30',202213,3,2022,30,13,202203,2022),('2022-03-31',202213,3,2022,31,13,202203,2022),('2022-04-01',202213,4,2022,1,13,202204,2022),('2022-04-02',202213,4,2022,2,13,202204,2022),('2022-04-03',202214,4,2022,3,14,202204,2022),('2022-04-04',202214,4,2022,4,14,202204,2022),('2022-04-05',202214,4,2022,5,14,202204,2022),('2022-04-06',202214,4,2022,6,14,202204,2022),('2022-04-07',202214,4,2022,7,14,202204,2022),('2022-04-08',202214,4,2022,8,14,202204,2022),('2022-04-09',202214,4,2022,9,14,202204,2022),('2022-04-10',202215,4,2022,10,15,202204,2022),('2022-04-11',202215,4,2022,11,15,202204,2022),('2022-04-12',202215,4,2022,12,15,202204,2022),('2022-04-13',202215,4,2022,13,15,202204,2022),('2022-04-14',202215,4,2022,14,15,202204,2022),('2022-04-15',202215,4,2022,15,15,202204,2022),('2022-04-16',202215,4,2022,16,15,202204,2022),('2022-04-17',202216,4,2022,17,16,202204,2022),('2022-04-18',202216,4,2022,18,16,202204,2022),('2022-04-19',202216,4,2022,19,16,202204,2022),('2022-04-20',202216,4,2022,20,16,202204,2022),('2022-04-21',202216,4,2022,21,16,202204,2022),('2022-04-22',202216,4,2022,22,16,202204,2022),('2022-04-23',202216,4,2022,23,16,202204,2022),('2022-04-24',202217,4,2022,24,17,202204,2022),('2022-04-25',202217,4,2022,25,17,202204,2022),('2022-04-26',202217,4,2022,26,17,202204,2022),('2022-04-27',202217,4,2022,27,17,202204,2022),('2022-04-28',202217,4,2022,28,17,202204,2022),('2022-04-29',202217,4,2022,29,17,202204,2022),('2022-04-30',202217,4,2022,30,17,202204,2022),('2022-05-01',202218,5,2022,1,18,202205,2022),('2022-05-02',202218,5,2022,2,18,202205,2022),('2022-05-03',202218,5,2022,3,18,202205,2022),('2022-05-04',202218,5,2022,4,18,202205,2022),('2022-05-05',202218,5,2022,5,18,202205,2022),('2022-05-06',202218,5,2022,6,18,202205,2022),('2022-05-07',202218,5,2022,7,18,202205,2022),('2022-05-08',202219,5,2022,8,19,202205,2022),('2022-05-09',202219,5,2022,9,19,202205,2022),('2022-05-10',202219,5,2022,10,19,202205,2022),('2022-05-11',202219,5,2022,11,19,202205,2022),('2022-05-12',202219,5,2022,12,19,202205,2022),('2022-05-13',202219,5,2022,13,19,202205,2022),('2022-05-14',202219,5,2022,14,19,202205,2022),('2022-05-15',202220,5,2022,15,20,202205,2022),('2022-05-16',202220,5,2022,16,20,202205,2022),('2022-05-17',202220,5,2022,17,20,202205,2022),('2022-05-18',202220,5,2022,18,20,202205,2022),('2022-05-19',202220,5,2022,19,20,202205,2022),('2022-05-20',202220,5,2022,20,20,202205,2022),('2022-05-21',202220,5,2022,21,20,202205,2022),('2022-05-22',202221,5,2022,22,21,202205,2022),('2022-05-23',202221,5,2022,23,21,202205,2022),('2022-05-24',202221,5,2022,24,21,202205,2022),('2022-05-25',202221,5,2022,25,21,202205,2022),('2022-05-26',202221,5,2022,26,21,202205,2022),('2022-05-27',202221,5,2022,27,21,202205,2022),('2022-05-28',202221,5,2022,28,21,202205,2022),('2022-05-29',202222,5,2022,29,22,202205,2022),('2022-05-30',202222,5,2022,30,22,202205,2022),('2022-05-31',202222,5,2022,31,22,202205,2022),('2022-06-01',202222,6,2022,1,22,202206,2022),('2022-06-02',202222,6,2022,2,22,202206,2022),('2022-06-03',202222,6,2022,3,22,202206,2022),('2022-06-04',202222,6,2022,4,22,202206,2022),('2022-06-05',202223,6,2022,5,23,202206,2022),('2022-06-06',202223,6,2022,6,23,202206,2022),('2022-06-07',202223,6,2022,7,23,202206,2022),('2022-06-08',202223,6,2022,8,23,202206,2022),('2022-06-09',202223,6,2022,9,23,202206,2022),('2022-06-10',202223,6,2022,10,23,202206,2022),('2022-06-11',202223,6,2022,11,23,202206,2022),('2022-06-12',202224,6,2022,12,24,202206,2022),('2022-06-13',202224,6,2022,13,24,202206,2022),('2022-06-14',202224,6,2022,14,24,202206,2022),('2022-06-15',202224,6,2022,15,24,202206,2022),('2022-06-16',202224,6,2022,16,24,202206,2022),('2022-06-17',202224,6,2022,17,24,202206,2022),('2022-06-18',202224,6,2022,18,24,202206,2022),('2022-06-19',202225,6,2022,19,25,202206,2022),('2022-06-20',202225,6,2022,20,25,202206,2022),('2022-06-21',202225,6,2022,21,25,202206,2022),('2022-06-22',202225,6,2022,22,25,202206,2022),('2022-06-23',202225,6,2022,23,25,202206,2022),('2022-06-24',202225,6,2022,24,25,202206,2022),('2022-06-25',202225,6,2022,25,25,202206,2022),('2022-06-26',202226,6,2022,26,26,202206,2022),('2022-06-27',202226,6,2022,27,26,202206,2022),('2022-06-28',202226,6,2022,28,26,202206,2022),('2022-06-29',202226,6,2022,29,26,202206,2022),('2022-06-30',202226,6,2022,30,26,202206,2022),('2022-07-01',202226,7,2022,1,26,202207,2022),('2022-07-02',202226,7,2022,2,26,202207,2022),('2022-07-03',202227,7,2022,3,27,202207,2022),('2022-07-04',202227,7,2022,4,27,202207,2022),('2022-07-05',202227,7,2022,5,27,202207,2022),('2022-07-06',202227,7,2022,6,27,202207,2022),('2022-07-07',202227,7,2022,7,27,202207,2022),('2022-07-08',202227,7,2022,8,27,202207,2022),('2022-07-09',202227,7,2022,9,27,202207,2022),('2022-07-10',202228,7,2022,10,28,202207,2022),('2022-07-11',202228,7,2022,11,28,202207,2022),('2022-07-12',202228,7,2022,12,28,202207,2022),('2022-07-13',202228,7,2022,13,28,202207,2022),('2022-07-14',202228,7,2022,14,28,202207,2022),('2022-07-15',202228,7,2022,15,28,202207,2022),('2022-07-16',202228,7,2022,16,28,202207,2022),('2022-07-17',202229,7,2022,17,29,202207,2022),('2022-07-18',202229,7,2022,18,29,202207,2022),('2022-07-19',202229,7,2022,19,29,202207,2022),('2022-07-20',202229,7,2022,20,29,202207,2022),('2022-07-21',202229,7,2022,21,29,202207,2022),('2022-07-22',202229,7,2022,22,29,202207,2022),('2022-07-23',202229,7,2022,23,29,202207,2022),('2022-07-24',202230,7,2022,24,30,202207,2022),('2022-07-25',202230,7,2022,25,30,202207,2022),('2022-07-26',202230,7,2022,26,30,202207,2022),('2022-07-27',202230,7,2022,27,30,202207,2022),('2022-07-28',202230,7,2022,28,30,202207,2022),('2022-07-29',202230,7,2022,29,30,202207,2022),('2022-07-30',202230,7,2022,30,30,202207,2022),('2022-07-31',202231,7,2022,31,31,202207,2022),('2022-08-01',202231,8,2022,1,31,202208,2022),('2022-08-02',202231,8,2022,2,31,202208,2022),('2022-08-03',202231,8,2022,3,31,202208,2022),('2022-08-04',202231,8,2022,4,31,202208,2022),('2022-08-05',202231,8,2022,5,31,202208,2022),('2022-08-06',202231,8,2022,6,31,202208,2022),('2022-08-07',202232,8,2022,7,32,202208,2022),('2022-08-08',202232,8,2022,8,32,202208,2022),('2022-08-09',202232,8,2022,9,32,202208,2022),('2022-08-10',202232,8,2022,10,32,202208,2022),('2022-08-11',202232,8,2022,11,32,202208,2022),('2022-08-12',202232,8,2022,12,32,202208,2022),('2022-08-13',202232,8,2022,13,32,202208,2022),('2022-08-14',202233,8,2022,14,33,202208,2022),('2022-08-15',202233,8,2022,15,33,202208,2022),('2022-08-16',202233,8,2022,16,33,202208,2022),('2022-08-17',202233,8,2022,17,33,202208,2022),('2022-08-18',202233,8,2022,18,33,202208,2022),('2022-08-19',202233,8,2022,19,33,202208,2022),('2022-08-20',202233,8,2022,20,33,202208,2022),('2022-08-21',202234,8,2022,21,34,202208,2022),('2022-08-22',202234,8,2022,22,34,202208,2022),('2022-08-23',202234,8,2022,23,34,202208,2022),('2022-08-24',202234,8,2022,24,34,202208,2022),('2022-08-25',202234,8,2022,25,34,202208,2022),('2022-08-26',202234,8,2022,26,34,202208,2022),('2022-08-27',202234,8,2022,27,34,202208,2022),('2022-08-28',202235,8,2022,28,35,202208,2022),('2022-08-29',202235,8,2022,29,35,202208,2022),('2022-08-30',202235,8,2022,30,35,202208,2022),('2022-08-31',202235,8,2022,31,35,202208,2022),('2022-09-01',202235,9,2022,1,35,202209,2022),('2022-09-02',202235,9,2022,2,35,202209,2022),('2022-09-03',202235,9,2022,3,35,202209,2022),('2022-09-04',202236,9,2022,4,36,202209,2022),('2022-09-05',202236,9,2022,5,36,202209,2022),('2022-09-06',202236,9,2022,6,36,202209,2022),('2022-09-07',202236,9,2022,7,36,202209,2022),('2022-09-08',202236,9,2022,8,36,202209,2022),('2022-09-09',202236,9,2022,9,36,202209,2022),('2022-09-10',202236,9,2022,10,36,202209,2022),('2022-09-11',202237,9,2022,11,37,202209,2022),('2022-09-12',202237,9,2022,12,37,202209,2022),('2022-09-13',202237,9,2022,13,37,202209,2022),('2022-09-14',202237,9,2022,14,37,202209,2022),('2022-09-15',202237,9,2022,15,37,202209,2022),('2022-09-16',202237,9,2022,16,37,202209,2022),('2022-09-17',202237,9,2022,17,37,202209,2022),('2022-09-18',202238,9,2022,18,38,202209,2022),('2022-09-19',202238,9,2022,19,38,202209,2022),('2022-09-20',202238,9,2022,20,38,202209,2022),('2022-09-21',202238,9,2022,21,38,202209,2022),('2022-09-22',202238,9,2022,22,38,202209,2022),('2022-09-23',202238,9,2022,23,38,202209,2022),('2022-09-24',202238,9,2022,24,38,202209,2022),('2022-09-25',202239,9,2022,25,39,202209,2022),('2022-09-26',202239,9,2022,26,39,202209,2022),('2022-09-27',202239,9,2022,27,39,202209,2022),('2022-09-28',202239,9,2022,28,39,202209,2022),('2022-09-29',202239,9,2022,29,39,202209,2022),('2022-09-30',202239,9,2022,30,39,202209,2022),('2022-10-01',202239,10,2022,1,39,202210,2022),('2022-10-02',202240,10,2022,2,40,202210,2022),('2022-10-03',202240,10,2022,3,40,202210,2022),('2022-10-04',202240,10,2022,4,40,202210,2022),('2022-10-05',202240,10,2022,5,40,202210,2022),('2022-10-06',202240,10,2022,6,40,202210,2022),('2022-10-07',202240,10,2022,7,40,202210,2022),('2022-10-08',202240,10,2022,8,40,202210,2022),('2022-10-09',202241,10,2022,9,41,202210,2022),('2022-10-10',202241,10,2022,10,41,202210,2022),('2022-10-11',202241,10,2022,11,41,202210,2022),('2022-10-12',202241,10,2022,12,41,202210,2022),('2022-10-13',202241,10,2022,13,41,202210,2022),('2022-10-14',202241,10,2022,14,41,202210,2022),('2022-10-15',202241,10,2022,15,41,202210,2022),('2022-10-16',202242,10,2022,16,42,202210,2022),('2022-10-17',202242,10,2022,17,42,202210,2022),('2022-10-18',202242,10,2022,18,42,202210,2022),('2022-10-19',202242,10,2022,19,42,202210,2022),('2022-10-20',202242,10,2022,20,42,202210,2022),('2022-10-21',202242,10,2022,21,42,202210,2022),('2022-10-22',202242,10,2022,22,42,202210,2022),('2022-10-23',202243,10,2022,23,43,202210,2022),('2022-10-24',202243,10,2022,24,43,202210,2022),('2022-10-25',202243,10,2022,25,43,202210,2022),('2022-10-26',202243,10,2022,26,43,202210,2022),('2022-10-27',202243,10,2022,27,43,202210,2022),('2022-10-28',202243,10,2022,28,43,202210,2022),('2022-10-29',202243,10,2022,29,43,202210,2022),('2022-10-30',202244,10,2022,30,44,202210,2022),('2022-10-31',202244,10,2022,31,44,202210,2022),('2022-11-01',202244,11,2022,1,44,202211,2022),('2022-11-02',202244,11,2022,2,44,202211,2022),('2022-11-03',202244,11,2022,3,44,202211,2022),('2022-11-04',202244,11,2022,4,44,202211,2022),('2022-11-05',202244,11,2022,5,44,202211,2022),('2022-11-06',202245,11,2022,6,45,202211,2022),('2022-11-07',202245,11,2022,7,45,202211,2022),('2022-11-08',202245,11,2022,8,45,202211,2022),('2022-11-09',202245,11,2022,9,45,202211,2022),('2022-11-10',202245,11,2022,10,45,202211,2022),('2022-11-11',202245,11,2022,11,45,202211,2022),('2022-11-12',202245,11,2022,12,45,202211,2022),('2022-11-13',202246,11,2022,13,46,202211,2022),('2022-11-14',202246,11,2022,14,46,202211,2022),('2022-11-15',202246,11,2022,15,46,202211,2022),('2022-11-16',202246,11,2022,16,46,202211,2022),('2022-11-17',202246,11,2022,17,46,202211,2022),('2022-11-18',202246,11,2022,18,46,202211,2022),('2022-11-19',202246,11,2022,19,46,202211,2022),('2022-11-20',202247,11,2022,20,47,202211,2022),('2022-11-21',202247,11,2022,21,47,202211,2022),('2022-11-22',202247,11,2022,22,47,202211,2022),('2022-11-23',202247,11,2022,23,47,202211,2022),('2022-11-24',202247,11,2022,24,47,202211,2022),('2022-11-25',202247,11,2022,25,47,202211,2022),('2022-11-26',202247,11,2022,26,47,202211,2022),('2022-11-27',202248,11,2022,27,48,202211,2022),('2022-11-28',202248,11,2022,28,48,202211,2022),('2022-11-29',202248,11,2022,29,48,202211,2022),('2022-11-30',202248,11,2022,30,48,202211,2022),('2022-12-01',202248,12,2022,1,48,202212,2023),('2022-12-02',202248,12,2022,2,48,202212,2023),('2022-12-03',202248,12,2022,3,48,202212,2023),('2022-12-04',202249,12,2022,4,49,202212,2023),('2022-12-05',202249,12,2022,5,49,202212,2023),('2022-12-06',202249,12,2022,6,49,202212,2023),('2022-12-07',202249,12,2022,7,49,202212,2023),('2022-12-08',202249,12,2022,8,49,202212,2023),('2022-12-09',202249,12,2022,9,49,202212,2023),('2022-12-10',202249,12,2022,10,49,202212,2023),('2022-12-11',202250,12,2022,11,50,202212,2023),('2022-12-12',202250,12,2022,12,50,202212,2023),('2022-12-13',202250,12,2022,13,50,202212,2023),('2022-12-14',202250,12,2022,14,50,202212,2023),('2022-12-15',202250,12,2022,15,50,202212,2023),('2022-12-16',202250,12,2022,16,50,202212,2023),('2022-12-17',202250,12,2022,17,50,202212,2023),('2022-12-18',202251,12,2022,18,51,202212,2023),('2022-12-19',202251,12,2022,19,51,202212,2023),('2022-12-20',202251,12,2022,20,51,202212,2023),('2022-12-21',202251,12,2022,21,51,202212,2023),('2022-12-22',202251,12,2022,22,51,202212,2023),('2022-12-23',202251,12,2022,23,51,202212,2023),('2022-12-24',202251,12,2022,24,51,202212,2023),('2022-12-25',202252,12,2022,25,52,202212,2023),('2022-12-26',202252,12,2022,26,52,202212,2023),('2022-12-27',202252,12,2022,27,52,202212,2023),('2022-12-28',202252,12,2022,28,52,202212,2023),('2022-12-29',202252,12,2022,29,52,202212,2023),('2022-12-30',202252,12,2022,30,52,202212,2023),('2022-12-31',202252,12,2022,31,52,202212,2023),('2023-01-01',202301,1,2023,1,1,202301,2023),('2023-01-02',202301,1,2023,2,1,202301,2023),('2023-01-03',202301,1,2023,3,1,202301,2023),('2023-01-04',202301,1,2023,4,1,202301,2023),('2023-01-05',202301,1,2023,5,1,202301,2023),('2023-01-06',202301,1,2023,6,1,202301,2023),('2023-01-07',202301,1,2023,7,1,202301,2023),('2023-01-08',202302,1,2023,8,2,202301,2023),('2023-01-09',202302,1,2023,9,2,202301,2023),('2023-01-10',202302,1,2023,10,2,202301,2023),('2023-01-11',202302,1,2023,11,2,202301,2023),('2023-01-12',202302,1,2023,12,2,202301,2023),('2023-01-13',202302,1,2023,13,2,202301,2023),('2023-01-14',202302,1,2023,14,2,202301,2023),('2023-01-15',202303,1,2023,15,3,202301,2023),('2023-01-16',202303,1,2023,16,3,202301,2023),('2023-01-17',202303,1,2023,17,3,202301,2023),('2023-01-18',202303,1,2023,18,3,202301,2023),('2023-01-19',202303,1,2023,19,3,202301,2023),('2023-01-20',202303,1,2023,20,3,202301,2023),('2023-01-21',202303,1,2023,21,3,202301,2023),('2023-01-22',202304,1,2023,22,4,202301,2023),('2023-01-23',202304,1,2023,23,4,202301,2023),('2023-01-24',202304,1,2023,24,4,202301,2023),('2023-01-25',202304,1,2023,25,4,202301,2023),('2023-01-26',202304,1,2023,26,4,202301,2023),('2023-01-27',202304,1,2023,27,4,202301,2023),('2023-01-28',202304,1,2023,28,4,202301,2023),('2023-01-29',202305,1,2023,29,5,202301,2023),('2023-01-30',202305,1,2023,30,5,202301,2023),('2023-01-31',202305,1,2023,31,5,202301,2023),('2023-02-01',202305,2,2023,1,5,202302,2023),('2023-02-02',202305,2,2023,2,5,202302,2023),('2023-02-03',202305,2,2023,3,5,202302,2023),('2023-02-04',202305,2,2023,4,5,202302,2023),('2023-02-05',202306,2,2023,5,6,202302,2023),('2023-02-06',202306,2,2023,6,6,202302,2023),('2023-02-07',202306,2,2023,7,6,202302,2023),('2023-02-08',202306,2,2023,8,6,202302,2023),('2023-02-09',202306,2,2023,9,6,202302,2023),('2023-02-10',202306,2,2023,10,6,202302,2023),('2023-02-11',202306,2,2023,11,6,202302,2023),('2023-02-12',202307,2,2023,12,7,202302,2023),('2023-02-13',202307,2,2023,13,7,202302,2023),('2023-02-14',202307,2,2023,14,7,202302,2023),('2023-02-15',202307,2,2023,15,7,202302,2023),('2023-02-16',202307,2,2023,16,7,202302,2023),('2023-02-17',202307,2,2023,17,7,202302,2023),('2023-02-18',202307,2,2023,18,7,202302,2023),('2023-02-19',202308,2,2023,19,8,202302,2023),('2023-02-20',202308,2,2023,20,8,202302,2023),('2023-02-21',202308,2,2023,21,8,202302,2023),('2023-02-22',202308,2,2023,22,8,202302,2023),('2023-02-23',202308,2,2023,23,8,202302,2023),('2023-02-24',202308,2,2023,24,8,202302,2023),('2023-02-25',202308,2,2023,25,8,202302,2023),('2023-02-26',202309,2,2023,26,9,202302,2023),('2023-02-27',202309,2,2023,27,9,202302,2023),('2023-02-28',202309,2,2023,28,9,202302,2023),('2023-03-01',202309,3,2023,1,9,202303,2023),('2023-03-02',202309,3,2023,2,9,202303,2023),('2023-03-03',202309,3,2023,3,9,202303,2023),('2023-03-04',202309,3,2023,4,9,202303,2023),('2023-03-05',202310,3,2023,5,10,202303,2023),('2023-03-06',202310,3,2023,6,10,202303,2023),('2023-03-07',202310,3,2023,7,10,202303,2023),('2023-03-08',202310,3,2023,8,10,202303,2023),('2023-03-09',202310,3,2023,9,10,202303,2023),('2023-03-10',202310,3,2023,10,10,202303,2023),('2023-03-11',202310,3,2023,11,10,202303,2023),('2023-03-12',202311,3,2023,12,11,202303,2023),('2023-03-13',202311,3,2023,13,11,202303,2023),('2023-03-14',202311,3,2023,14,11,202303,2023),('2023-03-15',202311,3,2023,15,11,202303,2023),('2023-03-16',202311,3,2023,16,11,202303,2023),('2023-03-17',202311,3,2023,17,11,202303,2023),('2023-03-18',202311,3,2023,18,11,202303,2023),('2023-03-19',202312,3,2023,19,12,202303,2023),('2023-03-20',202312,3,2023,20,12,202303,2023),('2023-03-21',202312,3,2023,21,12,202303,2023),('2023-03-22',202312,3,2023,22,12,202303,2023),('2023-03-23',202312,3,2023,23,12,202303,2023),('2023-03-24',202312,3,2023,24,12,202303,2023),('2023-03-25',202312,3,2023,25,12,202303,2023),('2023-03-26',202313,3,2023,26,13,202303,2023),('2023-03-27',202313,3,2023,27,13,202303,2023),('2023-03-28',202313,3,2023,28,13,202303,2023),('2023-03-29',202313,3,2023,29,13,202303,2023),('2023-03-30',202313,3,2023,30,13,202303,2023),('2023-03-31',202313,3,2023,31,13,202303,2023),('2023-04-01',202313,4,2023,1,13,202304,2023),('2023-04-02',202314,4,2023,2,14,202304,2023),('2023-04-03',202314,4,2023,3,14,202304,2023),('2023-04-04',202314,4,2023,4,14,202304,2023),('2023-04-05',202314,4,2023,5,14,202304,2023),('2023-04-06',202314,4,2023,6,14,202304,2023),('2023-04-07',202314,4,2023,7,14,202304,2023),('2023-04-08',202314,4,2023,8,14,202304,2023),('2023-04-09',202315,4,2023,9,15,202304,2023),('2023-04-10',202315,4,2023,10,15,202304,2023),('2023-04-11',202315,4,2023,11,15,202304,2023),('2023-04-12',202315,4,2023,12,15,202304,2023),('2023-04-13',202315,4,2023,13,15,202304,2023),('2023-04-14',202315,4,2023,14,15,202304,2023),('2023-04-15',202315,4,2023,15,15,202304,2023),('2023-04-16',202316,4,2023,16,16,202304,2023),('2023-04-17',202316,4,2023,17,16,202304,2023),('2023-04-18',202316,4,2023,18,16,202304,2023),('2023-04-19',202316,4,2023,19,16,202304,2023),('2023-04-20',202316,4,2023,20,16,202304,2023),('2023-04-21',202316,4,2023,21,16,202304,2023),('2023-04-22',202316,4,2023,22,16,202304,2023),('2023-04-23',202317,4,2023,23,17,202304,2023),('2023-04-24',202317,4,2023,24,17,202304,2023),('2023-04-25',202317,4,2023,25,17,202304,2023),('2023-04-26',202317,4,2023,26,17,202304,2023),('2023-04-27',202317,4,2023,27,17,202304,2023),('2023-04-28',202317,4,2023,28,17,202304,2023),('2023-04-29',202317,4,2023,29,17,202304,2023),('2023-04-30',202318,4,2023,30,18,202304,2023),('2023-05-01',202318,5,2023,1,18,202305,2023),('2023-05-02',202318,5,2023,2,18,202305,2023),('2023-05-03',202318,5,2023,3,18,202305,2023),('2023-05-04',202318,5,2023,4,18,202305,2023),('2023-05-05',202318,5,2023,5,18,202305,2023),('2023-05-06',202318,5,2023,6,18,202305,2023),('2023-05-07',202319,5,2023,7,19,202305,2023),('2023-05-08',202319,5,2023,8,19,202305,2023),('2023-05-09',202319,5,2023,9,19,202305,2023),('2023-05-10',202319,5,2023,10,19,202305,2023),('2023-05-11',202319,5,2023,11,19,202305,2023),('2023-05-12',202319,5,2023,12,19,202305,2023),('2023-05-13',202319,5,2023,13,19,202305,2023),('2023-05-14',202320,5,2023,14,20,202305,2023),('2023-05-15',202320,5,2023,15,20,202305,2023),('2023-05-16',202320,5,2023,16,20,202305,2023),('2023-05-17',202320,5,2023,17,20,202305,2023),('2023-05-18',202320,5,2023,18,20,202305,2023),('2023-05-19',202320,5,2023,19,20,202305,2023),('2023-05-20',202320,5,2023,20,20,202305,2023),('2023-05-21',202321,5,2023,21,21,202305,2023),('2023-05-22',202321,5,2023,22,21,202305,2023),('2023-05-23',202321,5,2023,23,21,202305,2023),('2023-05-24',202321,5,2023,24,21,202305,2023),('2023-05-25',202321,5,2023,25,21,202305,2023),('2023-05-26',202321,5,2023,26,21,202305,2023),('2023-05-27',202321,5,2023,27,21,202305,2023),('2023-05-28',202322,5,2023,28,22,202305,2023),('2023-05-29',202322,5,2023,29,22,202305,2023),('2023-05-30',202322,5,2023,30,22,202305,2023),('2023-05-31',202322,5,2023,31,22,202305,2023),('2023-06-01',202322,6,2023,1,22,202306,2023),('2023-06-02',202322,6,2023,2,22,202306,2023),('2023-06-03',202322,6,2023,3,22,202306,2023),('2023-06-04',202323,6,2023,4,23,202306,2023),('2023-06-05',202323,6,2023,5,23,202306,2023),('2023-06-06',202323,6,2023,6,23,202306,2023),('2023-06-07',202323,6,2023,7,23,202306,2023),('2023-06-08',202323,6,2023,8,23,202306,2023),('2023-06-09',202323,6,2023,9,23,202306,2023),('2023-06-10',202323,6,2023,10,23,202306,2023),('2023-06-11',202324,6,2023,11,24,202306,2023),('2023-06-12',202324,6,2023,12,24,202306,2023),('2023-06-13',202324,6,2023,13,24,202306,2023),('2023-06-14',202324,6,2023,14,24,202306,2023),('2023-06-15',202324,6,2023,15,24,202306,2023),('2023-06-16',202324,6,2023,16,24,202306,2023),('2023-06-17',202324,6,2023,17,24,202306,2023),('2023-06-18',202325,6,2023,18,25,202306,2023),('2023-06-19',202325,6,2023,19,25,202306,2023),('2023-06-20',202325,6,2023,20,25,202306,2023),('2023-06-21',202325,6,2023,21,25,202306,2023),('2023-06-22',202325,6,2023,22,25,202306,2023),('2023-06-23',202325,6,2023,23,25,202306,2023),('2023-06-24',202325,6,2023,24,25,202306,2023),('2023-06-25',202326,6,2023,25,26,202306,2023),('2023-06-26',202326,6,2023,26,26,202306,2023),('2023-06-27',202326,6,2023,27,26,202306,2023),('2023-06-28',202326,6,2023,28,26,202306,2023),('2023-06-29',202326,6,2023,29,26,202306,2023),('2023-06-30',202326,6,2023,30,26,202306,2023),('2023-07-01',202326,7,2023,1,26,202307,2023),('2023-07-02',202327,7,2023,2,27,202307,2023),('2023-07-03',202327,7,2023,3,27,202307,2023),('2023-07-04',202327,7,2023,4,27,202307,2023),('2023-07-05',202327,7,2023,5,27,202307,2023),('2023-07-06',202327,7,2023,6,27,202307,2023),('2023-07-07',202327,7,2023,7,27,202307,2023),('2023-07-08',202327,7,2023,8,27,202307,2023),('2023-07-09',202328,7,2023,9,28,202307,2023),('2023-07-10',202328,7,2023,10,28,202307,2023),('2023-07-11',202328,7,2023,11,28,202307,2023),('2023-07-12',202328,7,2023,12,28,202307,2023),('2023-07-13',202328,7,2023,13,28,202307,2023),('2023-07-14',202328,7,2023,14,28,202307,2023),('2023-07-15',202328,7,2023,15,28,202307,2023),('2023-07-16',202329,7,2023,16,29,202307,2023),('2023-07-17',202329,7,2023,17,29,202307,2023),('2023-07-18',202329,7,2023,18,29,202307,2023),('2023-07-19',202329,7,2023,19,29,202307,2023),('2023-07-20',202329,7,2023,20,29,202307,2023),('2023-07-21',202329,7,2023,21,29,202307,2023),('2023-07-22',202329,7,2023,22,29,202307,2023),('2023-07-23',202330,7,2023,23,30,202307,2023),('2023-07-24',202330,7,2023,24,30,202307,2023),('2023-07-25',202330,7,2023,25,30,202307,2023),('2023-07-26',202330,7,2023,26,30,202307,2023),('2023-07-27',202330,7,2023,27,30,202307,2023),('2023-07-28',202330,7,2023,28,30,202307,2023),('2023-07-29',202330,7,2023,29,30,202307,2023),('2023-07-30',202331,7,2023,30,31,202307,2023),('2023-07-31',202331,7,2023,31,31,202307,2023),('2023-08-01',202331,8,2023,1,31,202308,2023),('2023-08-02',202331,8,2023,2,31,202308,2023),('2023-08-03',202331,8,2023,3,31,202308,2023),('2023-08-04',202331,8,2023,4,31,202308,2023),('2023-08-05',202331,8,2023,5,31,202308,2023),('2023-08-06',202332,8,2023,6,32,202308,2023),('2023-08-07',202332,8,2023,7,32,202308,2023),('2023-08-08',202332,8,2023,8,32,202308,2023),('2023-08-09',202332,8,2023,9,32,202308,2023),('2023-08-10',202332,8,2023,10,32,202308,2023),('2023-08-11',202332,8,2023,11,32,202308,2023),('2023-08-12',202332,8,2023,12,32,202308,2023),('2023-08-13',202333,8,2023,13,33,202308,2023),('2023-08-14',202333,8,2023,14,33,202308,2023),('2023-08-15',202333,8,2023,15,33,202308,2023),('2023-08-16',202333,8,2023,16,33,202308,2023),('2023-08-17',202333,8,2023,17,33,202308,2023),('2023-08-18',202333,8,2023,18,33,202308,2023),('2023-08-19',202333,8,2023,19,33,202308,2023),('2023-08-20',202334,8,2023,20,34,202308,2023),('2023-08-21',202334,8,2023,21,34,202308,2023),('2023-08-22',202334,8,2023,22,34,202308,2023),('2023-08-23',202334,8,2023,23,34,202308,2023),('2023-08-24',202334,8,2023,24,34,202308,2023),('2023-08-25',202334,8,2023,25,34,202308,2023),('2023-08-26',202334,8,2023,26,34,202308,2023),('2023-08-27',202335,8,2023,27,35,202308,2023),('2023-08-28',202335,8,2023,28,35,202308,2023),('2023-08-29',202335,8,2023,29,35,202308,2023),('2023-08-30',202335,8,2023,30,35,202308,2023),('2023-08-31',202335,8,2023,31,35,202308,2023),('2023-09-01',202335,9,2023,1,35,202309,2023),('2023-09-02',202335,9,2023,2,35,202309,2023),('2023-09-03',202336,9,2023,3,36,202309,2023),('2023-09-04',202336,9,2023,4,36,202309,2023),('2023-09-05',202336,9,2023,5,36,202309,2023),('2023-09-06',202336,9,2023,6,36,202309,2023),('2023-09-07',202336,9,2023,7,36,202309,2023),('2023-09-08',202336,9,2023,8,36,202309,2023),('2023-09-09',202336,9,2023,9,36,202309,2023),('2023-09-10',202337,9,2023,10,37,202309,2023),('2023-09-11',202337,9,2023,11,37,202309,2023),('2023-09-12',202337,9,2023,12,37,202309,2023),('2023-09-13',202337,9,2023,13,37,202309,2023),('2023-09-14',202337,9,2023,14,37,202309,2023),('2023-09-15',202337,9,2023,15,37,202309,2023),('2023-09-16',202337,9,2023,16,37,202309,2023),('2023-09-17',202338,9,2023,17,38,202309,2023),('2023-09-18',202338,9,2023,18,38,202309,2023),('2023-09-19',202338,9,2023,19,38,202309,2023),('2023-09-20',202338,9,2023,20,38,202309,2023),('2023-09-21',202338,9,2023,21,38,202309,2023),('2023-09-22',202338,9,2023,22,38,202309,2023),('2023-09-23',202338,9,2023,23,38,202309,2023),('2023-09-24',202339,9,2023,24,39,202309,2023),('2023-09-25',202339,9,2023,25,39,202309,2023),('2023-09-26',202339,9,2023,26,39,202309,2023),('2023-09-27',202339,9,2023,27,39,202309,2023),('2023-09-28',202339,9,2023,28,39,202309,2023),('2023-09-29',202339,9,2023,29,39,202309,2023),('2023-09-30',202339,9,2023,30,39,202309,2023),('2023-10-01',202340,10,2023,1,40,202310,2023),('2023-10-02',202340,10,2023,2,40,202310,2023),('2023-10-03',202340,10,2023,3,40,202310,2023),('2023-10-04',202340,10,2023,4,40,202310,2023),('2023-10-05',202340,10,2023,5,40,202310,2023),('2023-10-06',202340,10,2023,6,40,202310,2023),('2023-10-07',202340,10,2023,7,40,202310,2023),('2023-10-08',202341,10,2023,8,41,202310,2023),('2023-10-09',202341,10,2023,9,41,202310,2023),('2023-10-10',202341,10,2023,10,41,202310,2023),('2023-10-11',202341,10,2023,11,41,202310,2023),('2023-10-12',202341,10,2023,12,41,202310,2023),('2023-10-13',202341,10,2023,13,41,202310,2023),('2023-10-14',202341,10,2023,14,41,202310,2023),('2023-10-15',202342,10,2023,15,42,202310,2023),('2023-10-16',202342,10,2023,16,42,202310,2023),('2023-10-17',202342,10,2023,17,42,202310,2023),('2023-10-18',202342,10,2023,18,42,202310,2023),('2023-10-19',202342,10,2023,19,42,202310,2023),('2023-10-20',202342,10,2023,20,42,202310,2023),('2023-10-21',202342,10,2023,21,42,202310,2023),('2023-10-22',202343,10,2023,22,43,202310,2023),('2023-10-23',202343,10,2023,23,43,202310,2023),('2023-10-24',202343,10,2023,24,43,202310,2023),('2023-10-25',202343,10,2023,25,43,202310,2023),('2023-10-26',202343,10,2023,26,43,202310,2023),('2023-10-27',202343,10,2023,27,43,202310,2023),('2023-10-28',202343,10,2023,28,43,202310,2023),('2023-10-29',202344,10,2023,29,44,202310,2023),('2023-10-30',202344,10,2023,30,44,202310,2023),('2023-10-31',202344,10,2023,31,44,202310,2023),('2023-11-01',202344,11,2023,1,44,202311,2023),('2023-11-02',202344,11,2023,2,44,202311,2023),('2023-11-03',202344,11,2023,3,44,202311,2023),('2023-11-04',202344,11,2023,4,44,202311,2023),('2023-11-05',202345,11,2023,5,45,202311,2023),('2023-11-06',202345,11,2023,6,45,202311,2023),('2023-11-07',202345,11,2023,7,45,202311,2023),('2023-11-08',202345,11,2023,8,45,202311,2023),('2023-11-09',202345,11,2023,9,45,202311,2023),('2023-11-10',202345,11,2023,10,45,202311,2023),('2023-11-11',202345,11,2023,11,45,202311,2023),('2023-11-12',202346,11,2023,12,46,202311,2023),('2023-11-13',202346,11,2023,13,46,202311,2023),('2023-11-14',202346,11,2023,14,46,202311,2023),('2023-11-15',202346,11,2023,15,46,202311,2023),('2023-11-16',202346,11,2023,16,46,202311,2023),('2023-11-17',202346,11,2023,17,46,202311,2023),('2023-11-18',202346,11,2023,18,46,202311,2023),('2023-11-19',202347,11,2023,19,47,202311,2023),('2023-11-20',202347,11,2023,20,47,202311,2023),('2023-11-21',202347,11,2023,21,47,202311,2023),('2023-11-22',202347,11,2023,22,47,202311,2023),('2023-11-23',202347,11,2023,23,47,202311,2023),('2023-11-24',202347,11,2023,24,47,202311,2023),('2023-11-25',202347,11,2023,25,47,202311,2023),('2023-11-26',202348,11,2023,26,48,202311,2023),('2023-11-27',202348,11,2023,27,48,202311,2023),('2023-11-28',202348,11,2023,28,48,202311,2023),('2023-11-29',202348,11,2023,29,48,202311,2023),('2023-11-30',202348,11,2023,30,48,202311,2023),('2023-12-01',202348,12,2023,1,48,202312,2024),('2023-12-02',202348,12,2023,2,48,202312,2024),('2023-12-03',202349,12,2023,3,49,202312,2024),('2023-12-04',202349,12,2023,4,49,202312,2024),('2023-12-05',202349,12,2023,5,49,202312,2024),('2023-12-06',202349,12,2023,6,49,202312,2024),('2023-12-07',202349,12,2023,7,49,202312,2024),('2023-12-08',202349,12,2023,8,49,202312,2024),('2023-12-09',202349,12,2023,9,49,202312,2024),('2023-12-10',202350,12,2023,10,50,202312,2024),('2023-12-11',202350,12,2023,11,50,202312,2024),('2023-12-12',202350,12,2023,12,50,202312,2024),('2023-12-13',202350,12,2023,13,50,202312,2024),('2023-12-14',202350,12,2023,14,50,202312,2024),('2023-12-15',202350,12,2023,15,50,202312,2024),('2023-12-16',202350,12,2023,16,50,202312,2024),('2023-12-17',202351,12,2023,17,51,202312,2024),('2023-12-18',202351,12,2023,18,51,202312,2024),('2023-12-19',202351,12,2023,19,51,202312,2024),('2023-12-20',202351,12,2023,20,51,202312,2024),('2023-12-21',202351,12,2023,21,51,202312,2024),('2023-12-22',202351,12,2023,22,51,202312,2024),('2023-12-23',202351,12,2023,23,51,202312,2024),('2023-12-24',202352,12,2023,24,52,202312,2024),('2023-12-25',202352,12,2023,25,52,202312,2024),('2023-12-26',202352,12,2023,26,52,202312,2024),('2023-12-27',202352,12,2023,27,52,202312,2024),('2023-12-28',202352,12,2023,28,52,202312,2024),('2023-12-29',202352,12,2023,29,52,202312,2024),('2023-12-30',202352,12,2023,30,52,202312,2024),('2023-12-31',202353,12,2023,31,53,202312,2024),('2024-01-01',202401,1,2024,1,1,202401,2024),('2024-01-02',202401,1,2024,2,1,202401,2024),('2024-01-03',202401,1,2024,3,1,202401,2024),('2024-01-04',202401,1,2024,4,1,202401,2024),('2024-01-05',202401,1,2024,5,1,202401,2024),('2024-01-06',202401,1,2024,6,1,202401,2024),('2024-01-07',202402,1,2024,7,2,202401,2024),('2024-01-08',202402,1,2024,8,2,202401,2024),('2024-01-09',202402,1,2024,9,2,202401,2024),('2024-01-10',202402,1,2024,10,2,202401,2024),('2024-01-11',202402,1,2024,11,2,202401,2024),('2024-01-12',202402,1,2024,12,2,202401,2024),('2024-01-13',202402,1,2024,13,2,202401,2024),('2024-01-14',202403,1,2024,14,3,202401,2024),('2024-01-15',202403,1,2024,15,3,202401,2024),('2024-01-16',202403,1,2024,16,3,202401,2024),('2024-01-17',202403,1,2024,17,3,202401,2024),('2024-01-18',202403,1,2024,18,3,202401,2024),('2024-01-19',202403,1,2024,19,3,202401,2024),('2024-01-20',202403,1,2024,20,3,202401,2024),('2024-01-21',202404,1,2024,21,4,202401,2024),('2024-01-22',202404,1,2024,22,4,202401,2024),('2024-01-23',202404,1,2024,23,4,202401,2024),('2024-01-24',202404,1,2024,24,4,202401,2024),('2024-01-25',202404,1,2024,25,4,202401,2024),('2024-01-26',202404,1,2024,26,4,202401,2024),('2024-01-27',202404,1,2024,27,4,202401,2024),('2024-01-28',202405,1,2024,28,5,202401,2024),('2024-01-29',202405,1,2024,29,5,202401,2024),('2024-01-30',202405,1,2024,30,5,202401,2024),('2024-01-31',202405,1,2024,31,5,202401,2024),('2024-02-01',202405,2,2024,1,5,202402,2024),('2024-02-02',202405,2,2024,2,5,202402,2024),('2024-02-03',202405,2,2024,3,5,202402,2024),('2024-02-04',202406,2,2024,4,6,202402,2024),('2024-02-05',202406,2,2024,5,6,202402,2024),('2024-02-06',202406,2,2024,6,6,202402,2024),('2024-02-07',202406,2,2024,7,6,202402,2024),('2024-02-08',202406,2,2024,8,6,202402,2024),('2024-02-09',202406,2,2024,9,6,202402,2024),('2024-02-10',202406,2,2024,10,6,202402,2024),('2024-02-11',202407,2,2024,11,7,202402,2024),('2024-02-12',202407,2,2024,12,7,202402,2024),('2024-02-13',202407,2,2024,13,7,202402,2024),('2024-02-14',202407,2,2024,14,7,202402,2024),('2024-02-15',202407,2,2024,15,7,202402,2024),('2024-02-16',202407,2,2024,16,7,202402,2024),('2024-02-17',202407,2,2024,17,7,202402,2024),('2024-02-18',202408,2,2024,18,8,202402,2024),('2024-02-19',202408,2,2024,19,8,202402,2024),('2024-02-20',202408,2,2024,20,8,202402,2024),('2024-02-21',202408,2,2024,21,8,202402,2024),('2024-02-22',202408,2,2024,22,8,202402,2024),('2024-02-23',202408,2,2024,23,8,202402,2024),('2024-02-24',202408,2,2024,24,8,202402,2024),('2024-02-25',202409,2,2024,25,9,202402,2024),('2024-02-26',202409,2,2024,26,9,202402,2024),('2024-02-27',202409,2,2024,27,9,202402,2024),('2024-02-28',202409,2,2024,28,9,202402,2024),('2024-02-29',202409,2,2024,29,9,202402,2024),('2024-03-01',202409,3,2024,1,9,202403,2024),('2024-03-02',202409,3,2024,2,9,202403,2024),('2024-03-03',202410,3,2024,3,10,202403,2024),('2024-03-04',202410,3,2024,4,10,202403,2024),('2024-03-05',202410,3,2024,5,10,202403,2024),('2024-03-06',202410,3,2024,6,10,202403,2024),('2024-03-07',202410,3,2024,7,10,202403,2024),('2024-03-08',202410,3,2024,8,10,202403,2024),('2024-03-09',202410,3,2024,9,10,202403,2024),('2024-03-10',202411,3,2024,10,11,202403,2024),('2024-03-11',202411,3,2024,11,11,202403,2024),('2024-03-12',202411,3,2024,12,11,202403,2024),('2024-03-13',202411,3,2024,13,11,202403,2024),('2024-03-14',202411,3,2024,14,11,202403,2024),('2024-03-15',202411,3,2024,15,11,202403,2024),('2024-03-16',202411,3,2024,16,11,202403,2024),('2024-03-17',202412,3,2024,17,12,202403,2024),('2024-03-18',202412,3,2024,18,12,202403,2024),('2024-03-19',202412,3,2024,19,12,202403,2024),('2024-03-20',202412,3,2024,20,12,202403,2024),('2024-03-21',202412,3,2024,21,12,202403,2024),('2024-03-22',202412,3,2024,22,12,202403,2024),('2024-03-23',202412,3,2024,23,12,202403,2024),('2024-03-24',202413,3,2024,24,13,202403,2024),('2024-03-25',202413,3,2024,25,13,202403,2024),('2024-03-26',202413,3,2024,26,13,202403,2024),('2024-03-27',202413,3,2024,27,13,202403,2024),('2024-03-28',202413,3,2024,28,13,202403,2024),('2024-03-29',202413,3,2024,29,13,202403,2024),('2024-03-30',202413,3,2024,30,13,202403,2024),('2024-03-31',202414,3,2024,31,14,202403,2024),('2024-04-01',202414,4,2024,1,14,202404,2024),('2024-04-02',202414,4,2024,2,14,202404,2024),('2024-04-03',202414,4,2024,3,14,202404,2024),('2024-04-04',202414,4,2024,4,14,202404,2024),('2024-04-05',202414,4,2024,5,14,202404,2024),('2024-04-06',202414,4,2024,6,14,202404,2024),('2024-04-07',202415,4,2024,7,15,202404,2024),('2024-04-08',202415,4,2024,8,15,202404,2024),('2024-04-09',202415,4,2024,9,15,202404,2024),('2024-04-10',202415,4,2024,10,15,202404,2024),('2024-04-11',202415,4,2024,11,15,202404,2024),('2024-04-12',202415,4,2024,12,15,202404,2024),('2024-04-13',202415,4,2024,13,15,202404,2024),('2024-04-14',202416,4,2024,14,16,202404,2024),('2024-04-15',202416,4,2024,15,16,202404,2024),('2024-04-16',202416,4,2024,16,16,202404,2024),('2024-04-17',202416,4,2024,17,16,202404,2024),('2024-04-18',202416,4,2024,18,16,202404,2024),('2024-04-19',202416,4,2024,19,16,202404,2024),('2024-04-20',202416,4,2024,20,16,202404,2024),('2024-04-21',202417,4,2024,21,17,202404,2024),('2024-04-22',202417,4,2024,22,17,202404,2024),('2024-04-23',202417,4,2024,23,17,202404,2024),('2024-04-24',202417,4,2024,24,17,202404,2024),('2024-04-25',202417,4,2024,25,17,202404,2024),('2024-04-26',202417,4,2024,26,17,202404,2024),('2024-04-27',202417,4,2024,27,17,202404,2024),('2024-04-28',202418,4,2024,28,18,202404,2024),('2024-04-29',202418,4,2024,29,18,202404,2024),('2024-04-30',202418,4,2024,30,18,202404,2024),('2024-05-01',202418,5,2024,1,18,202405,2024),('2024-05-02',202418,5,2024,2,18,202405,2024),('2024-05-03',202418,5,2024,3,18,202405,2024),('2024-05-04',202418,5,2024,4,18,202405,2024),('2024-05-05',202419,5,2024,5,19,202405,2024),('2024-05-06',202419,5,2024,6,19,202405,2024),('2024-05-07',202419,5,2024,7,19,202405,2024),('2024-05-08',202419,5,2024,8,19,202405,2024),('2024-05-09',202419,5,2024,9,19,202405,2024),('2024-05-10',202419,5,2024,10,19,202405,2024),('2024-05-11',202419,5,2024,11,19,202405,2024),('2024-05-12',202420,5,2024,12,20,202405,2024),('2024-05-13',202420,5,2024,13,20,202405,2024),('2024-05-14',202420,5,2024,14,20,202405,2024),('2024-05-15',202420,5,2024,15,20,202405,2024),('2024-05-16',202420,5,2024,16,20,202405,2024),('2024-05-17',202420,5,2024,17,20,202405,2024),('2024-05-18',202420,5,2024,18,20,202405,2024),('2024-05-19',202421,5,2024,19,21,202405,2024),('2024-05-20',202421,5,2024,20,21,202405,2024),('2024-05-21',202421,5,2024,21,21,202405,2024),('2024-05-22',202421,5,2024,22,21,202405,2024),('2024-05-23',202421,5,2024,23,21,202405,2024),('2024-05-24',202421,5,2024,24,21,202405,2024),('2024-05-25',202421,5,2024,25,21,202405,2024),('2024-05-26',202422,5,2024,26,22,202405,2024),('2024-05-27',202422,5,2024,27,22,202405,2024),('2024-05-28',202422,5,2024,28,22,202405,2024),('2024-05-29',202422,5,2024,29,22,202405,2024),('2024-05-30',202422,5,2024,30,22,202405,2024),('2024-05-31',202422,5,2024,31,22,202405,2024),('2024-06-01',202422,6,2024,1,22,202406,2024),('2024-06-02',202423,6,2024,2,23,202406,2024),('2024-06-03',202423,6,2024,3,23,202406,2024),('2024-06-04',202423,6,2024,4,23,202406,2024),('2024-06-05',202423,6,2024,5,23,202406,2024),('2024-06-06',202423,6,2024,6,23,202406,2024),('2024-06-07',202423,6,2024,7,23,202406,2024),('2024-06-08',202423,6,2024,8,23,202406,2024),('2024-06-09',202424,6,2024,9,24,202406,2024),('2024-06-10',202424,6,2024,10,24,202406,2024),('2024-06-11',202424,6,2024,11,24,202406,2024),('2024-06-12',202424,6,2024,12,24,202406,2024),('2024-06-13',202424,6,2024,13,24,202406,2024),('2024-06-14',202424,6,2024,14,24,202406,2024),('2024-06-15',202424,6,2024,15,24,202406,2024),('2024-06-16',202425,6,2024,16,25,202406,2024),('2024-06-17',202425,6,2024,17,25,202406,2024),('2024-06-18',202425,6,2024,18,25,202406,2024),('2024-06-19',202425,6,2024,19,25,202406,2024),('2024-06-20',202425,6,2024,20,25,202406,2024),('2024-06-21',202425,6,2024,21,25,202406,2024),('2024-06-22',202425,6,2024,22,25,202406,2024),('2024-06-23',202426,6,2024,23,26,202406,2024),('2024-06-24',202426,6,2024,24,26,202406,2024),('2024-06-25',202426,6,2024,25,26,202406,2024),('2024-06-26',202426,6,2024,26,26,202406,2024),('2024-06-27',202426,6,2024,27,26,202406,2024),('2024-06-28',202426,6,2024,28,26,202406,2024),('2024-06-29',202426,6,2024,29,26,202406,2024),('2024-06-30',202427,6,2024,30,27,202406,2024),('2024-07-01',202427,7,2024,1,27,202407,2024),('2024-07-02',202427,7,2024,2,27,202407,2024),('2024-07-03',202427,7,2024,3,27,202407,2024),('2024-07-04',202427,7,2024,4,27,202407,2024),('2024-07-05',202427,7,2024,5,27,202407,2024),('2024-07-06',202427,7,2024,6,27,202407,2024),('2024-07-07',202428,7,2024,7,28,202407,2024),('2024-07-08',202428,7,2024,8,28,202407,2024),('2024-07-09',202428,7,2024,9,28,202407,2024),('2024-07-10',202428,7,2024,10,28,202407,2024),('2024-07-11',202428,7,2024,11,28,202407,2024),('2024-07-12',202428,7,2024,12,28,202407,2024),('2024-07-13',202428,7,2024,13,28,202407,2024),('2024-07-14',202429,7,2024,14,29,202407,2024),('2024-07-15',202429,7,2024,15,29,202407,2024),('2024-07-16',202429,7,2024,16,29,202407,2024),('2024-07-17',202429,7,2024,17,29,202407,2024),('2024-07-18',202429,7,2024,18,29,202407,2024),('2024-07-19',202429,7,2024,19,29,202407,2024),('2024-07-20',202429,7,2024,20,29,202407,2024),('2024-07-21',202430,7,2024,21,30,202407,2024),('2024-07-22',202430,7,2024,22,30,202407,2024),('2024-07-23',202430,7,2024,23,30,202407,2024),('2024-07-24',202430,7,2024,24,30,202407,2024),('2024-07-25',202430,7,2024,25,30,202407,2024),('2024-07-26',202430,7,2024,26,30,202407,2024),('2024-07-27',202430,7,2024,27,30,202407,2024),('2024-07-28',202431,7,2024,28,31,202407,2024),('2024-07-29',202431,7,2024,29,31,202407,2024),('2024-07-30',202431,7,2024,30,31,202407,2024),('2024-07-31',202431,7,2024,31,31,202407,2024),('2024-08-01',202431,8,2024,1,31,202408,2024),('2024-08-02',202431,8,2024,2,31,202408,2024),('2024-08-03',202431,8,2024,3,31,202408,2024),('2024-08-04',202432,8,2024,4,32,202408,2024),('2024-08-05',202432,8,2024,5,32,202408,2024),('2024-08-06',202432,8,2024,6,32,202408,2024),('2024-08-07',202432,8,2024,7,32,202408,2024),('2024-08-08',202432,8,2024,8,32,202408,2024),('2024-08-09',202432,8,2024,9,32,202408,2024),('2024-08-10',202432,8,2024,10,32,202408,2024),('2024-08-11',202433,8,2024,11,33,202408,2024),('2024-08-12',202433,8,2024,12,33,202408,2024),('2024-08-13',202433,8,2024,13,33,202408,2024),('2024-08-14',202433,8,2024,14,33,202408,2024),('2024-08-15',202433,8,2024,15,33,202408,2024),('2024-08-16',202433,8,2024,16,33,202408,2024),('2024-08-17',202433,8,2024,17,33,202408,2024),('2024-08-18',202434,8,2024,18,34,202408,2024),('2024-08-19',202434,8,2024,19,34,202408,2024),('2024-08-20',202434,8,2024,20,34,202408,2024),('2024-08-21',202434,8,2024,21,34,202408,2024),('2024-08-22',202434,8,2024,22,34,202408,2024),('2024-08-23',202434,8,2024,23,34,202408,2024),('2024-08-24',202434,8,2024,24,34,202408,2024),('2024-08-25',202435,8,2024,25,35,202408,2024),('2024-08-26',202435,8,2024,26,35,202408,2024),('2024-08-27',202435,8,2024,27,35,202408,2024),('2024-08-28',202435,8,2024,28,35,202408,2024),('2024-08-29',202435,8,2024,29,35,202408,2024),('2024-08-30',202435,8,2024,30,35,202408,2024),('2024-08-31',202435,8,2024,31,35,202408,2024),('2024-09-01',202436,9,2024,1,36,202409,2024),('2024-09-02',202436,9,2024,2,36,202409,2024),('2024-09-03',202436,9,2024,3,36,202409,2024),('2024-09-04',202436,9,2024,4,36,202409,2024),('2024-09-05',202436,9,2024,5,36,202409,2024),('2024-09-06',202436,9,2024,6,36,202409,2024),('2024-09-07',202436,9,2024,7,36,202409,2024),('2024-09-08',202437,9,2024,8,37,202409,2024),('2024-09-09',202437,9,2024,9,37,202409,2024),('2024-09-10',202437,9,2024,10,37,202409,2024),('2024-09-11',202437,9,2024,11,37,202409,2024),('2024-09-12',202437,9,2024,12,37,202409,2024),('2024-09-13',202437,9,2024,13,37,202409,2024),('2024-09-14',202437,9,2024,14,37,202409,2024),('2024-09-15',202438,9,2024,15,38,202409,2024),('2024-09-16',202438,9,2024,16,38,202409,2024),('2024-09-17',202438,9,2024,17,38,202409,2024),('2024-09-18',202438,9,2024,18,38,202409,2024),('2024-09-19',202438,9,2024,19,38,202409,2024),('2024-09-20',202438,9,2024,20,38,202409,2024),('2024-09-21',202438,9,2024,21,38,202409,2024),('2024-09-22',202439,9,2024,22,39,202409,2024),('2024-09-23',202439,9,2024,23,39,202409,2024),('2024-09-24',202439,9,2024,24,39,202409,2024),('2024-09-25',202439,9,2024,25,39,202409,2024),('2024-09-26',202439,9,2024,26,39,202409,2024),('2024-09-27',202439,9,2024,27,39,202409,2024),('2024-09-28',202439,9,2024,28,39,202409,2024),('2024-09-29',202440,9,2024,29,40,202409,2024),('2024-09-30',202440,9,2024,30,40,202409,2024),('2024-10-01',202440,10,2024,1,40,202410,2024),('2024-10-02',202440,10,2024,2,40,202410,2024),('2024-10-03',202440,10,2024,3,40,202410,2024),('2024-10-04',202440,10,2024,4,40,202410,2024),('2024-10-05',202440,10,2024,5,40,202410,2024),('2024-10-06',202441,10,2024,6,41,202410,2024),('2024-10-07',202441,10,2024,7,41,202410,2024),('2024-10-08',202441,10,2024,8,41,202410,2024),('2024-10-09',202441,10,2024,9,41,202410,2024),('2024-10-10',202441,10,2024,10,41,202410,2024),('2024-10-11',202441,10,2024,11,41,202410,2024),('2024-10-12',202441,10,2024,12,41,202410,2024),('2024-10-13',202442,10,2024,13,42,202410,2024),('2024-10-14',202442,10,2024,14,42,202410,2024),('2024-10-15',202442,10,2024,15,42,202410,2024),('2024-10-16',202442,10,2024,16,42,202410,2024),('2024-10-17',202442,10,2024,17,42,202410,2024),('2024-10-18',202442,10,2024,18,42,202410,2024),('2024-10-19',202442,10,2024,19,42,202410,2024),('2024-10-20',202443,10,2024,20,43,202410,2024),('2024-10-21',202443,10,2024,21,43,202410,2024),('2024-10-22',202443,10,2024,22,43,202410,2024),('2024-10-23',202443,10,2024,23,43,202410,2024),('2024-10-24',202443,10,2024,24,43,202410,2024),('2024-10-25',202443,10,2024,25,43,202410,2024),('2024-10-26',202443,10,2024,26,43,202410,2024),('2024-10-27',202444,10,2024,27,44,202410,2024),('2024-10-28',202444,10,2024,28,44,202410,2024),('2024-10-29',202444,10,2024,29,44,202410,2024),('2024-10-30',202444,10,2024,30,44,202410,2024),('2024-10-31',202444,10,2024,31,44,202410,2024),('2024-11-01',202444,11,2024,1,44,202411,2024),('2024-11-02',202444,11,2024,2,44,202411,2024),('2024-11-03',202445,11,2024,3,45,202411,2024),('2024-11-04',202445,11,2024,4,45,202411,2024),('2024-11-05',202445,11,2024,5,45,202411,2024),('2024-11-06',202445,11,2024,6,45,202411,2024),('2024-11-07',202445,11,2024,7,45,202411,2024),('2024-11-08',202445,11,2024,8,45,202411,2024),('2024-11-09',202445,11,2024,9,45,202411,2024),('2024-11-10',202446,11,2024,10,46,202411,2024),('2024-11-11',202446,11,2024,11,46,202411,2024),('2024-11-12',202446,11,2024,12,46,202411,2024),('2024-11-13',202446,11,2024,13,46,202411,2024),('2024-11-14',202446,11,2024,14,46,202411,2024),('2024-11-15',202446,11,2024,15,46,202411,2024),('2024-11-16',202446,11,2024,16,46,202411,2024),('2024-11-17',202447,11,2024,17,47,202411,2024),('2024-11-18',202447,11,2024,18,47,202411,2024),('2024-11-19',202447,11,2024,19,47,202411,2024),('2024-11-20',202447,11,2024,20,47,202411,2024),('2024-11-21',202447,11,2024,21,47,202411,2024),('2024-11-22',202447,11,2024,22,47,202411,2024),('2024-11-23',202447,11,2024,23,47,202411,2024),('2024-11-24',202448,11,2024,24,48,202411,2024),('2024-11-25',202448,11,2024,25,48,202411,2024),('2024-11-26',202448,11,2024,26,48,202411,2024),('2024-11-27',202448,11,2024,27,48,202411,2024),('2024-11-28',202448,11,2024,28,48,202411,2024),('2024-11-29',202448,11,2024,29,48,202411,2024),('2024-11-30',202448,11,2024,30,48,202411,2024),('2024-12-01',202449,12,2024,1,49,202412,2025),('2024-12-02',202449,12,2024,2,49,202412,2025),('2024-12-03',202449,12,2024,3,49,202412,2025),('2024-12-04',202449,12,2024,4,49,202412,2025),('2024-12-05',202449,12,2024,5,49,202412,2025),('2024-12-06',202449,12,2024,6,49,202412,2025),('2024-12-07',202449,12,2024,7,49,202412,2025),('2024-12-08',202450,12,2024,8,50,202412,2025),('2024-12-09',202450,12,2024,9,50,202412,2025),('2024-12-10',202450,12,2024,10,50,202412,2025),('2024-12-11',202450,12,2024,11,50,202412,2025),('2024-12-12',202450,12,2024,12,50,202412,2025),('2024-12-13',202450,12,2024,13,50,202412,2025),('2024-12-14',202450,12,2024,14,50,202412,2025),('2024-12-15',202451,12,2024,15,51,202412,2025),('2024-12-16',202451,12,2024,16,51,202412,2025),('2024-12-17',202451,12,2024,17,51,202412,2025),('2024-12-18',202451,12,2024,18,51,202412,2025),('2024-12-19',202451,12,2024,19,51,202412,2025),('2024-12-20',202451,12,2024,20,51,202412,2025),('2024-12-21',202451,12,2024,21,51,202412,2025),('2024-12-22',202452,12,2024,22,52,202412,2025),('2024-12-23',202452,12,2024,23,52,202412,2025),('2024-12-24',202452,12,2024,24,52,202412,2025),('2024-12-25',202452,12,2024,25,52,202412,2025),('2024-12-26',202452,12,2024,26,52,202412,2025),('2024-12-27',202452,12,2024,27,52,202412,2025),('2024-12-28',202452,12,2024,28,52,202412,2025),('2024-12-29',202453,12,2024,29,1,202412,2025),('2024-12-30',202401,12,2024,30,1,202412,2025),('2024-12-31',202401,12,2024,31,1,202412,2025),('2025-01-01',202501,1,2025,1,1,202501,2025),('2025-01-02',202501,1,2025,2,1,202501,2025),('2025-01-03',202501,1,2025,3,1,202501,2025),('2025-01-04',202501,1,2025,4,1,202501,2025),('2025-01-05',202502,1,2025,5,2,202501,2025),('2025-01-06',202502,1,2025,6,2,202501,2025),('2025-01-07',202502,1,2025,7,2,202501,2025),('2025-01-08',202502,1,2025,8,2,202501,2025),('2025-01-09',202502,1,2025,9,2,202501,2025),('2025-01-10',202502,1,2025,10,2,202501,2025),('2025-01-11',202502,1,2025,11,2,202501,2025),('2025-01-12',202503,1,2025,12,3,202501,2025),('2025-01-13',202503,1,2025,13,3,202501,2025),('2025-01-14',202503,1,2025,14,3,202501,2025),('2025-01-15',202503,1,2025,15,3,202501,2025),('2025-01-16',202503,1,2025,16,3,202501,2025),('2025-01-17',202503,1,2025,17,3,202501,2025),('2025-01-18',202503,1,2025,18,3,202501,2025),('2025-01-19',202504,1,2025,19,4,202501,2025),('2025-01-20',202504,1,2025,20,4,202501,2025),('2025-01-21',202504,1,2025,21,4,202501,2025),('2025-01-22',202504,1,2025,22,4,202501,2025),('2025-01-23',202504,1,2025,23,4,202501,2025),('2025-01-24',202504,1,2025,24,4,202501,2025),('2025-01-25',202504,1,2025,25,4,202501,2025),('2025-01-26',202505,1,2025,26,5,202501,2025),('2025-01-27',202505,1,2025,27,5,202501,2025),('2025-01-28',202505,1,2025,28,5,202501,2025),('2025-01-29',202505,1,2025,29,5,202501,2025),('2025-01-30',202505,1,2025,30,5,202501,2025),('2025-01-31',202505,1,2025,31,5,202501,2025),('2025-02-01',202505,2,2025,1,5,202502,2025),('2025-02-02',202506,2,2025,2,6,202502,2025),('2025-02-03',202506,2,2025,3,6,202502,2025),('2025-02-04',202506,2,2025,4,6,202502,2025),('2025-02-05',202506,2,2025,5,6,202502,2025),('2025-02-06',202506,2,2025,6,6,202502,2025),('2025-02-07',202506,2,2025,7,6,202502,2025),('2025-02-08',202506,2,2025,8,6,202502,2025),('2025-02-09',202507,2,2025,9,7,202502,2025),('2025-02-10',202507,2,2025,10,7,202502,2025),('2025-02-11',202507,2,2025,11,7,202502,2025),('2025-02-12',202507,2,2025,12,7,202502,2025),('2025-02-13',202507,2,2025,13,7,202502,2025),('2025-02-14',202507,2,2025,14,7,202502,2025),('2025-02-15',202507,2,2025,15,7,202502,2025),('2025-02-16',202508,2,2025,16,8,202502,2025),('2025-02-17',202508,2,2025,17,8,202502,2025),('2025-02-18',202508,2,2025,18,8,202502,2025),('2025-02-19',202508,2,2025,19,8,202502,2025),('2025-02-20',202508,2,2025,20,8,202502,2025),('2025-02-21',202508,2,2025,21,8,202502,2025),('2025-02-22',202508,2,2025,22,8,202502,2025),('2025-02-23',202509,2,2025,23,9,202502,2025),('2025-02-24',202509,2,2025,24,9,202502,2025),('2025-02-25',202509,2,2025,25,9,202502,2025),('2025-02-26',202509,2,2025,26,9,202502,2025),('2025-02-27',202509,2,2025,27,9,202502,2025),('2025-02-28',202509,2,2025,28,9,202502,2025),('2025-03-01',202509,3,2025,1,9,202503,2025),('2025-03-02',202510,3,2025,2,10,202503,2025),('2025-03-03',202510,3,2025,3,10,202503,2025),('2025-03-04',202510,3,2025,4,10,202503,2025),('2025-03-05',202510,3,2025,5,10,202503,2025),('2025-03-06',202510,3,2025,6,10,202503,2025),('2025-03-07',202510,3,2025,7,10,202503,2025),('2025-03-08',202510,3,2025,8,10,202503,2025),('2025-03-09',202511,3,2025,9,11,202503,2025),('2025-03-10',202511,3,2025,10,11,202503,2025),('2025-03-11',202511,3,2025,11,11,202503,2025),('2025-03-12',202511,3,2025,12,11,202503,2025),('2025-03-13',202511,3,2025,13,11,202503,2025),('2025-03-14',202511,3,2025,14,11,202503,2025),('2025-03-15',202511,3,2025,15,11,202503,2025),('2025-03-16',202512,3,2025,16,12,202503,2025),('2025-03-17',202512,3,2025,17,12,202503,2025),('2025-03-18',202512,3,2025,18,12,202503,2025),('2025-03-19',202512,3,2025,19,12,202503,2025),('2025-03-20',202512,3,2025,20,12,202503,2025),('2025-03-21',202512,3,2025,21,12,202503,2025),('2025-03-22',202512,3,2025,22,12,202503,2025),('2025-03-23',202513,3,2025,23,13,202503,2025),('2025-03-24',202513,3,2025,24,13,202503,2025),('2025-03-25',202513,3,2025,25,13,202503,2025),('2025-03-26',202513,3,2025,26,13,202503,2025),('2025-03-27',202513,3,2025,27,13,202503,2025),('2025-03-28',202513,3,2025,28,13,202503,2025),('2025-03-29',202513,3,2025,29,13,202503,2025),('2025-03-30',202514,3,2025,30,14,202503,2025),('2025-03-31',202514,3,2025,31,14,202503,2025),('2025-04-01',202514,4,2025,1,14,202504,2025),('2025-04-02',202514,4,2025,2,14,202504,2025),('2025-04-03',202514,4,2025,3,14,202504,2025),('2025-04-04',202514,4,2025,4,14,202504,2025),('2025-04-05',202514,4,2025,5,14,202504,2025),('2025-04-06',202515,4,2025,6,15,202504,2025),('2025-04-07',202515,4,2025,7,15,202504,2025),('2025-04-08',202515,4,2025,8,15,202504,2025),('2025-04-09',202515,4,2025,9,15,202504,2025),('2025-04-10',202515,4,2025,10,15,202504,2025),('2025-04-11',202515,4,2025,11,15,202504,2025),('2025-04-12',202515,4,2025,12,15,202504,2025),('2025-04-13',202516,4,2025,13,16,202504,2025),('2025-04-14',202516,4,2025,14,16,202504,2025),('2025-04-15',202516,4,2025,15,16,202504,2025),('2025-04-16',202516,4,2025,16,16,202504,2025),('2025-04-17',202516,4,2025,17,16,202504,2025),('2025-04-18',202516,4,2025,18,16,202504,2025),('2025-04-19',202516,4,2025,19,16,202504,2025),('2025-04-20',202517,4,2025,20,17,202504,2025),('2025-04-21',202517,4,2025,21,17,202504,2025),('2025-04-22',202517,4,2025,22,17,202504,2025),('2025-04-23',202517,4,2025,23,17,202504,2025),('2025-04-24',202517,4,2025,24,17,202504,2025),('2025-04-25',202517,4,2025,25,17,202504,2025),('2025-04-26',202517,4,2025,26,17,202504,2025),('2025-04-27',202518,4,2025,27,18,202504,2025),('2025-04-28',202518,4,2025,28,18,202504,2025),('2025-04-29',202518,4,2025,29,18,202504,2025),('2025-04-30',202518,4,2025,30,18,202504,2025),('2025-05-01',202518,5,2025,1,18,202505,2025),('2025-05-02',202518,5,2025,2,18,202505,2025),('2025-05-03',202518,5,2025,3,18,202505,2025),('2025-05-04',202519,5,2025,4,19,202505,2025),('2025-05-05',202519,5,2025,5,19,202505,2025),('2025-05-06',202519,5,2025,6,19,202505,2025),('2025-05-07',202519,5,2025,7,19,202505,2025),('2025-05-08',202519,5,2025,8,19,202505,2025),('2025-05-09',202519,5,2025,9,19,202505,2025),('2025-05-10',202519,5,2025,10,19,202505,2025),('2025-05-11',202520,5,2025,11,20,202505,2025),('2025-05-12',202520,5,2025,12,20,202505,2025),('2025-05-13',202520,5,2025,13,20,202505,2025),('2025-05-14',202520,5,2025,14,20,202505,2025),('2025-05-15',202520,5,2025,15,20,202505,2025),('2025-05-16',202520,5,2025,16,20,202505,2025),('2025-05-17',202520,5,2025,17,20,202505,2025),('2025-05-18',202521,5,2025,18,21,202505,2025),('2025-05-19',202521,5,2025,19,21,202505,2025),('2025-05-20',202521,5,2025,20,21,202505,2025),('2025-05-21',202521,5,2025,21,21,202505,2025),('2025-05-22',202521,5,2025,22,21,202505,2025),('2025-05-23',202521,5,2025,23,21,202505,2025),('2025-05-24',202521,5,2025,24,21,202505,2025),('2025-05-25',202522,5,2025,25,22,202505,2025),('2025-05-26',202522,5,2025,26,22,202505,2025),('2025-05-27',202522,5,2025,27,22,202505,2025),('2025-05-28',202522,5,2025,28,22,202505,2025),('2025-05-29',202522,5,2025,29,22,202505,2025),('2025-05-30',202522,5,2025,30,22,202505,2025),('2025-05-31',202522,5,2025,31,22,202505,2025),('2025-06-01',202523,6,2025,1,23,202506,2025),('2025-06-02',202523,6,2025,2,23,202506,2025),('2025-06-03',202523,6,2025,3,23,202506,2025),('2025-06-04',202523,6,2025,4,23,202506,2025),('2025-06-05',202523,6,2025,5,23,202506,2025),('2025-06-06',202523,6,2025,6,23,202506,2025),('2025-06-07',202523,6,2025,7,23,202506,2025),('2025-06-08',202524,6,2025,8,24,202506,2025),('2025-06-09',202524,6,2025,9,24,202506,2025),('2025-06-10',202524,6,2025,10,24,202506,2025),('2025-06-11',202524,6,2025,11,24,202506,2025),('2025-06-12',202524,6,2025,12,24,202506,2025),('2025-06-13',202524,6,2025,13,24,202506,2025),('2025-06-14',202524,6,2025,14,24,202506,2025),('2025-06-15',202525,6,2025,15,25,202506,2025),('2025-06-16',202525,6,2025,16,25,202506,2025),('2025-06-17',202525,6,2025,17,25,202506,2025),('2025-06-18',202525,6,2025,18,25,202506,2025),('2025-06-19',202525,6,2025,19,25,202506,2025),('2025-06-20',202525,6,2025,20,25,202506,2025),('2025-06-21',202525,6,2025,21,25,202506,2025),('2025-06-22',202526,6,2025,22,26,202506,2025),('2025-06-23',202526,6,2025,23,26,202506,2025),('2025-06-24',202526,6,2025,24,26,202506,2025),('2025-06-25',202526,6,2025,25,26,202506,2025),('2025-06-26',202526,6,2025,26,26,202506,2025),('2025-06-27',202526,6,2025,27,26,202506,2025),('2025-06-28',202526,6,2025,28,26,202506,2025),('2025-06-29',202527,6,2025,29,27,202506,2025),('2025-06-30',202527,6,2025,30,27,202506,2025),('2025-07-01',202527,7,2025,1,27,202507,2025),('2025-07-02',202527,7,2025,2,27,202507,2025),('2025-07-03',202527,7,2025,3,27,202507,2025),('2025-07-04',202527,7,2025,4,27,202507,2025),('2025-07-05',202527,7,2025,5,27,202507,2025),('2025-07-06',202528,7,2025,6,28,202507,2025),('2025-07-07',202528,7,2025,7,28,202507,2025),('2025-07-08',202528,7,2025,8,28,202507,2025),('2025-07-09',202528,7,2025,9,28,202507,2025),('2025-07-10',202528,7,2025,10,28,202507,2025),('2025-07-11',202528,7,2025,11,28,202507,2025),('2025-07-12',202528,7,2025,12,28,202507,2025),('2025-07-13',202529,7,2025,13,29,202507,2025),('2025-07-14',202529,7,2025,14,29,202507,2025),('2025-07-15',202529,7,2025,15,29,202507,2025),('2025-07-16',202529,7,2025,16,29,202507,2025),('2025-07-17',202529,7,2025,17,29,202507,2025),('2025-07-18',202529,7,2025,18,29,202507,2025),('2025-07-19',202529,7,2025,19,29,202507,2025),('2025-07-20',202530,7,2025,20,30,202507,2025),('2025-07-21',202530,7,2025,21,30,202507,2025),('2025-07-22',202530,7,2025,22,30,202507,2025),('2025-07-23',202530,7,2025,23,30,202507,2025),('2025-07-24',202530,7,2025,24,30,202507,2025),('2025-07-25',202530,7,2025,25,30,202507,2025),('2025-07-26',202530,7,2025,26,30,202507,2025),('2025-07-27',202531,7,2025,27,31,202507,2025),('2025-07-28',202531,7,2025,28,31,202507,2025),('2025-07-29',202531,7,2025,29,31,202507,2025),('2025-07-30',202531,7,2025,30,31,202507,2025),('2025-07-31',202531,7,2025,31,31,202507,2025),('2025-08-01',202531,8,2025,1,31,202508,2025),('2025-08-02',202531,8,2025,2,31,202508,2025),('2025-08-03',202532,8,2025,3,32,202508,2025),('2025-08-04',202532,8,2025,4,32,202508,2025),('2025-08-05',202532,8,2025,5,32,202508,2025),('2025-08-06',202532,8,2025,6,32,202508,2025),('2025-08-07',202532,8,2025,7,32,202508,2025),('2025-08-08',202532,8,2025,8,32,202508,2025),('2025-08-09',202532,8,2025,9,32,202508,2025),('2025-08-10',202533,8,2025,10,33,202508,2025),('2025-08-11',202533,8,2025,11,33,202508,2025),('2025-08-12',202533,8,2025,12,33,202508,2025),('2025-08-13',202533,8,2025,13,33,202508,2025),('2025-08-14',202533,8,2025,14,33,202508,2025),('2025-08-15',202533,8,2025,15,33,202508,2025),('2025-08-16',202533,8,2025,16,33,202508,2025),('2025-08-17',202534,8,2025,17,34,202508,2025),('2025-08-18',202534,8,2025,18,34,202508,2025),('2025-08-19',202534,8,2025,19,34,202508,2025),('2025-08-20',202534,8,2025,20,34,202508,2025),('2025-08-21',202534,8,2025,21,34,202508,2025),('2025-08-22',202534,8,2025,22,34,202508,2025),('2025-08-23',202534,8,2025,23,34,202508,2025),('2025-08-24',202535,8,2025,24,35,202508,2025),('2025-08-25',202535,8,2025,25,35,202508,2025),('2025-08-26',202535,8,2025,26,35,202508,2025),('2025-08-27',202535,8,2025,27,35,202508,2025),('2025-08-28',202535,8,2025,28,35,202508,2025),('2025-08-29',202535,8,2025,29,35,202508,2025),('2025-08-30',202535,8,2025,30,35,202508,2025),('2025-08-31',202536,8,2025,31,36,202508,2025),('2025-09-01',202536,9,2025,1,36,202509,2025),('2025-09-02',202536,9,2025,2,36,202509,2025),('2025-09-03',202536,9,2025,3,36,202509,2025),('2025-09-04',202536,9,2025,4,36,202509,2025),('2025-09-05',202536,9,2025,5,36,202509,2025),('2025-09-06',202536,9,2025,6,36,202509,2025),('2025-09-07',202537,9,2025,7,37,202509,2025),('2025-09-08',202537,9,2025,8,37,202509,2025),('2025-09-09',202537,9,2025,9,37,202509,2025),('2025-09-10',202537,9,2025,10,37,202509,2025),('2025-09-11',202537,9,2025,11,37,202509,2025),('2025-09-12',202537,9,2025,12,37,202509,2025),('2025-09-13',202537,9,2025,13,37,202509,2025),('2025-09-14',202538,9,2025,14,38,202509,2025),('2025-09-15',202538,9,2025,15,38,202509,2025),('2025-09-16',202538,9,2025,16,38,202509,2025),('2025-09-17',202538,9,2025,17,38,202509,2025),('2025-09-18',202538,9,2025,18,38,202509,2025),('2025-09-19',202538,9,2025,19,38,202509,2025),('2025-09-20',202538,9,2025,20,38,202509,2025),('2025-09-21',202539,9,2025,21,39,202509,2025),('2025-09-22',202539,9,2025,22,39,202509,2025),('2025-09-23',202539,9,2025,23,39,202509,2025),('2025-09-24',202539,9,2025,24,39,202509,2025),('2025-09-25',202539,9,2025,25,39,202509,2025),('2025-09-26',202539,9,2025,26,39,202509,2025),('2025-09-27',202539,9,2025,27,39,202509,2025),('2025-09-28',202540,9,2025,28,40,202509,2025),('2025-09-29',202540,9,2025,29,40,202509,2025),('2025-09-30',202540,9,2025,30,40,202509,2025),('2025-10-01',202540,10,2025,1,40,202510,2025),('2025-10-02',202540,10,2025,2,40,202510,2025),('2025-10-03',202540,10,2025,3,40,202510,2025),('2025-10-04',202540,10,2025,4,40,202510,2025),('2025-10-05',202541,10,2025,5,41,202510,2025),('2025-10-06',202541,10,2025,6,41,202510,2025),('2025-10-07',202541,10,2025,7,41,202510,2025),('2025-10-08',202541,10,2025,8,41,202510,2025),('2025-10-09',202541,10,2025,9,41,202510,2025),('2025-10-10',202541,10,2025,10,41,202510,2025),('2025-10-11',202541,10,2025,11,41,202510,2025),('2025-10-12',202542,10,2025,12,42,202510,2025),('2025-10-13',202542,10,2025,13,42,202510,2025),('2025-10-14',202542,10,2025,14,42,202510,2025),('2025-10-15',202542,10,2025,15,42,202510,2025),('2025-10-16',202542,10,2025,16,42,202510,2025),('2025-10-17',202542,10,2025,17,42,202510,2025),('2025-10-18',202542,10,2025,18,42,202510,2025),('2025-10-19',202543,10,2025,19,43,202510,2025),('2025-10-20',202543,10,2025,20,43,202510,2025),('2025-10-21',202543,10,2025,21,43,202510,2025),('2025-10-22',202543,10,2025,22,43,202510,2025),('2025-10-23',202543,10,2025,23,43,202510,2025),('2025-10-24',202543,10,2025,24,43,202510,2025),('2025-10-25',202543,10,2025,25,43,202510,2025),('2025-10-26',202544,10,2025,26,44,202510,2025),('2025-10-27',202544,10,2025,27,44,202510,2025),('2025-10-28',202544,10,2025,28,44,202510,2025),('2025-10-29',202544,10,2025,29,44,202510,2025),('2025-10-30',202544,10,2025,30,44,202510,2025),('2025-10-31',202544,10,2025,31,44,202510,2025),('2025-11-01',202544,11,2025,1,44,202511,2025),('2025-11-02',202545,11,2025,2,45,202511,2025),('2025-11-03',202545,11,2025,3,45,202511,2025),('2025-11-04',202545,11,2025,4,45,202511,2025),('2025-11-05',202545,11,2025,5,45,202511,2025),('2025-11-06',202545,11,2025,6,45,202511,2025),('2025-11-07',202545,11,2025,7,45,202511,2025),('2025-11-08',202545,11,2025,8,45,202511,2025),('2025-11-09',202546,11,2025,9,46,202511,2025),('2025-11-10',202546,11,2025,10,46,202511,2025),('2025-11-11',202546,11,2025,11,46,202511,2025),('2025-11-12',202546,11,2025,12,46,202511,2025),('2025-11-13',202546,11,2025,13,46,202511,2025),('2025-11-14',202546,11,2025,14,46,202511,2025),('2025-11-15',202546,11,2025,15,46,202511,2025),('2025-11-16',202547,11,2025,16,47,202511,2025),('2025-11-17',202547,11,2025,17,47,202511,2025),('2025-11-18',202547,11,2025,18,47,202511,2025),('2025-11-19',202547,11,2025,19,47,202511,2025),('2025-11-20',202547,11,2025,20,47,202511,2025),('2025-11-21',202547,11,2025,21,47,202511,2025),('2025-11-22',202547,11,2025,22,47,202511,2025),('2025-11-23',202548,11,2025,23,48,202511,2025),('2025-11-24',202548,11,2025,24,48,202511,2025),('2025-11-25',202548,11,2025,25,48,202511,2025),('2025-11-26',202548,11,2025,26,48,202511,2025),('2025-11-27',202548,11,2025,27,48,202511,2025),('2025-11-28',202548,11,2025,28,48,202511,2025),('2025-11-29',202548,11,2025,29,48,202511,2025),('2025-11-30',202549,11,2025,30,49,202511,2025),('2025-12-01',202549,12,2025,1,49,202512,2026),('2025-12-02',202549,12,2025,2,49,202512,2026),('2025-12-03',202549,12,2025,3,49,202512,2026),('2025-12-04',202549,12,2025,4,49,202512,2026),('2025-12-05',202549,12,2025,5,49,202512,2026),('2025-12-06',202549,12,2025,6,49,202512,2026),('2025-12-07',202550,12,2025,7,50,202512,2026),('2025-12-08',202550,12,2025,8,50,202512,2026),('2025-12-09',202550,12,2025,9,50,202512,2026),('2025-12-10',202550,12,2025,10,50,202512,2026),('2025-12-11',202550,12,2025,11,50,202512,2026),('2025-12-12',202550,12,2025,12,50,202512,2026),('2025-12-13',202550,12,2025,13,50,202512,2026),('2025-12-14',202551,12,2025,14,51,202512,2026),('2025-12-15',202551,12,2025,15,51,202512,2026),('2025-12-16',202551,12,2025,16,51,202512,2026),('2025-12-17',202551,12,2025,17,51,202512,2026),('2025-12-18',202551,12,2025,18,51,202512,2026),('2025-12-19',202551,12,2025,19,51,202512,2026),('2025-12-20',202551,12,2025,20,51,202512,2026),('2025-12-21',202552,12,2025,21,52,202512,2026),('2025-12-22',202552,12,2025,22,52,202512,2026),('2025-12-23',202552,12,2025,23,52,202512,2026),('2025-12-24',202552,12,2025,24,52,202512,2026),('2025-12-25',202552,12,2025,25,52,202512,2026),('2025-12-26',202552,12,2025,26,52,202512,2026),('2025-12-27',202552,12,2025,27,52,202512,2026),('2025-12-28',202553,12,2025,28,53,202512,2026),('2025-12-29',202501,12,2025,29,53,202512,2026),('2025-12-30',202501,12,2025,30,53,202512,2026),('2025-12-31',202501,12,2025,31,53,202512,2026),('2026-01-01',202601,1,2026,1,53,202601,2026),('2026-01-02',202601,1,2026,2,53,202601,2026),('2026-01-03',202601,1,2026,3,53,202601,2026),('2026-01-04',202602,1,2026,4,1,202601,2026),('2026-01-05',202602,1,2026,5,1,202601,2026),('2026-01-06',202602,1,2026,6,1,202601,2026),('2026-01-07',202602,1,2026,7,1,202601,2026),('2026-01-08',202602,1,2026,8,1,202601,2026),('2026-01-09',202602,1,2026,9,1,202601,2026),('2026-01-10',202602,1,2026,10,1,202601,2026),('2026-01-11',202603,1,2026,11,2,202601,2026),('2026-01-12',202603,1,2026,12,2,202601,2026),('2026-01-13',202603,1,2026,13,2,202601,2026),('2026-01-14',202603,1,2026,14,2,202601,2026),('2026-01-15',202603,1,2026,15,2,202601,2026),('2026-01-16',202603,1,2026,16,2,202601,2026),('2026-01-17',202603,1,2026,17,2,202601,2026),('2026-01-18',202604,1,2026,18,3,202601,2026),('2026-01-19',202604,1,2026,19,3,202601,2026),('2026-01-20',202604,1,2026,20,3,202601,2026),('2026-01-21',202604,1,2026,21,3,202601,2026),('2026-01-22',202604,1,2026,22,3,202601,2026),('2026-01-23',202604,1,2026,23,3,202601,2026),('2026-01-24',202604,1,2026,24,3,202601,2026),('2026-01-25',202605,1,2026,25,4,202601,2026),('2026-01-26',202605,1,2026,26,4,202601,2026),('2026-01-27',202605,1,2026,27,4,202601,2026),('2026-01-28',202605,1,2026,28,4,202601,2026),('2026-01-29',202605,1,2026,29,4,202601,2026),('2026-01-30',202605,1,2026,30,4,202601,2026),('2026-01-31',202605,1,2026,31,4,202601,2026),('2026-02-01',202606,2,2026,1,5,202602,2026),('2026-02-02',202606,2,2026,2,5,202602,2026),('2026-02-03',202606,2,2026,3,5,202602,2026),('2026-02-04',202606,2,2026,4,5,202602,2026),('2026-02-05',202606,2,2026,5,5,202602,2026),('2026-02-06',202606,2,2026,6,5,202602,2026),('2026-02-07',202606,2,2026,7,5,202602,2026),('2026-02-08',202607,2,2026,8,6,202602,2026),('2026-02-09',202607,2,2026,9,6,202602,2026),('2026-02-10',202607,2,2026,10,6,202602,2026),('2026-02-11',202607,2,2026,11,6,202602,2026),('2026-02-12',202607,2,2026,12,6,202602,2026),('2026-02-13',202607,2,2026,13,6,202602,2026),('2026-02-14',202607,2,2026,14,6,202602,2026),('2026-02-15',202608,2,2026,15,7,202602,2026),('2026-02-16',202608,2,2026,16,7,202602,2026),('2026-02-17',202608,2,2026,17,7,202602,2026),('2026-02-18',202608,2,2026,18,7,202602,2026),('2026-02-19',202608,2,2026,19,7,202602,2026),('2026-02-20',202608,2,2026,20,7,202602,2026),('2026-02-21',202608,2,2026,21,7,202602,2026),('2026-02-22',202609,2,2026,22,8,202602,2026),('2026-02-23',202609,2,2026,23,8,202602,2026),('2026-02-24',202609,2,2026,24,8,202602,2026),('2026-02-25',202609,2,2026,25,8,202602,2026),('2026-02-26',202609,2,2026,26,8,202602,2026),('2026-02-27',202609,2,2026,27,8,202602,2026),('2026-02-28',202609,2,2026,28,8,202602,2026),('2026-03-01',202610,3,2026,1,9,202603,2026),('2026-03-02',202610,3,2026,2,9,202603,2026),('2026-03-03',202610,3,2026,3,9,202603,2026),('2026-03-04',202610,3,2026,4,9,202603,2026),('2026-03-05',202610,3,2026,5,9,202603,2026),('2026-03-06',202610,3,2026,6,9,202603,2026),('2026-03-07',202610,3,2026,7,9,202603,2026),('2026-03-08',202611,3,2026,8,10,202603,2026),('2026-03-09',202611,3,2026,9,10,202603,2026),('2026-03-10',202611,3,2026,10,10,202603,2026),('2026-03-11',202611,3,2026,11,10,202603,2026),('2026-03-12',202611,3,2026,12,10,202603,2026),('2026-03-13',202611,3,2026,13,10,202603,2026),('2026-03-14',202611,3,2026,14,10,202603,2026),('2026-03-15',202612,3,2026,15,11,202603,2026),('2026-03-16',202612,3,2026,16,11,202603,2026),('2026-03-17',202612,3,2026,17,11,202603,2026),('2026-03-18',202612,3,2026,18,11,202603,2026),('2026-03-19',202612,3,2026,19,11,202603,2026),('2026-03-20',202612,3,2026,20,11,202603,2026),('2026-03-21',202612,3,2026,21,11,202603,2026),('2026-03-22',202613,3,2026,22,12,202603,2026),('2026-03-23',202613,3,2026,23,12,202603,2026),('2026-03-24',202613,3,2026,24,12,202603,2026),('2026-03-25',202613,3,2026,25,12,202603,2026),('2026-03-26',202613,3,2026,26,12,202603,2026),('2026-03-27',202613,3,2026,27,12,202603,2026),('2026-03-28',202613,3,2026,28,12,202603,2026),('2026-03-29',202614,3,2026,29,13,202603,2026),('2026-03-30',202614,3,2026,30,13,202603,2026),('2026-03-31',202614,3,2026,31,13,202603,2026),('2026-04-01',202614,4,2026,1,13,202604,2026),('2026-04-02',202614,4,2026,2,13,202604,2026),('2026-04-03',202614,4,2026,3,13,202604,2026),('2026-04-04',202614,4,2026,4,13,202604,2026),('2026-04-05',202615,4,2026,5,14,202604,2026),('2026-04-06',202615,4,2026,6,14,202604,2026),('2026-04-07',202615,4,2026,7,14,202604,2026),('2026-04-08',202615,4,2026,8,14,202604,2026),('2026-04-09',202615,4,2026,9,14,202604,2026),('2026-04-10',202615,4,2026,10,14,202604,2026),('2026-04-11',202615,4,2026,11,14,202604,2026),('2026-04-12',202616,4,2026,12,15,202604,2026),('2026-04-13',202616,4,2026,13,15,202604,2026),('2026-04-14',202616,4,2026,14,15,202604,2026),('2026-04-15',202616,4,2026,15,15,202604,2026),('2026-04-16',202616,4,2026,16,15,202604,2026),('2026-04-17',202616,4,2026,17,15,202604,2026),('2026-04-18',202616,4,2026,18,15,202604,2026),('2026-04-19',202617,4,2026,19,16,202604,2026),('2026-04-20',202617,4,2026,20,16,202604,2026),('2026-04-21',202617,4,2026,21,16,202604,2026),('2026-04-22',202617,4,2026,22,16,202604,2026),('2026-04-23',202617,4,2026,23,16,202604,2026),('2026-04-24',202617,4,2026,24,16,202604,2026),('2026-04-25',202617,4,2026,25,16,202604,2026),('2026-04-26',202618,4,2026,26,17,202604,2026),('2026-04-27',202618,4,2026,27,17,202604,2026),('2026-04-28',202618,4,2026,28,17,202604,2026),('2026-04-29',202618,4,2026,29,17,202604,2026),('2026-04-30',202618,4,2026,30,17,202604,2026),('2026-05-01',202618,5,2026,1,17,202605,2026),('2026-05-02',202618,5,2026,2,17,202605,2026),('2026-05-03',202619,5,2026,3,18,202605,2026),('2026-05-04',202619,5,2026,4,18,202605,2026),('2026-05-05',202619,5,2026,5,18,202605,2026),('2026-05-06',202619,5,2026,6,18,202605,2026),('2026-05-07',202619,5,2026,7,18,202605,2026),('2026-05-08',202619,5,2026,8,18,202605,2026),('2026-05-09',202619,5,2026,9,18,202605,2026),('2026-05-10',202620,5,2026,10,19,202605,2026),('2026-05-11',202620,5,2026,11,19,202605,2026),('2026-05-12',202620,5,2026,12,19,202605,2026),('2026-05-13',202620,5,2026,13,19,202605,2026),('2026-05-14',202620,5,2026,14,19,202605,2026),('2026-05-15',202620,5,2026,15,19,202605,2026),('2026-05-16',202620,5,2026,16,19,202605,2026),('2026-05-17',202621,5,2026,17,20,202605,2026),('2026-05-18',202621,5,2026,18,20,202605,2026),('2026-05-19',202621,5,2026,19,20,202605,2026),('2026-05-20',202621,5,2026,20,20,202605,2026),('2026-05-21',202621,5,2026,21,20,202605,2026),('2026-05-22',202621,5,2026,22,20,202605,2026),('2026-05-23',202621,5,2026,23,20,202605,2026),('2026-05-24',202622,5,2026,24,21,202605,2026),('2026-05-25',202622,5,2026,25,21,202605,2026),('2026-05-26',202622,5,2026,26,21,202605,2026),('2026-05-27',202622,5,2026,27,21,202605,2026),('2026-05-28',202622,5,2026,28,21,202605,2026),('2026-05-29',202622,5,2026,29,21,202605,2026),('2026-05-30',202622,5,2026,30,21,202605,2026),('2026-05-31',202623,5,2026,31,22,202605,2026),('2026-06-01',202623,6,2026,1,22,202606,2026),('2026-06-02',202623,6,2026,2,22,202606,2026),('2026-06-03',202623,6,2026,3,22,202606,2026),('2026-06-04',202623,6,2026,4,22,202606,2026),('2026-06-05',202623,6,2026,5,22,202606,2026),('2026-06-06',202623,6,2026,6,22,202606,2026),('2026-06-07',202624,6,2026,7,23,202606,2026),('2026-06-08',202624,6,2026,8,23,202606,2026),('2026-06-09',202624,6,2026,9,23,202606,2026),('2026-06-10',202624,6,2026,10,23,202606,2026),('2026-06-11',202624,6,2026,11,23,202606,2026),('2026-06-12',202624,6,2026,12,23,202606,2026),('2026-06-13',202624,6,2026,13,23,202606,2026),('2026-06-14',202625,6,2026,14,24,202606,2026),('2026-06-15',202625,6,2026,15,24,202606,2026),('2026-06-16',202625,6,2026,16,24,202606,2026),('2026-06-17',202625,6,2026,17,24,202606,2026),('2026-06-18',202625,6,2026,18,24,202606,2026),('2026-06-19',202625,6,2026,19,24,202606,2026),('2026-06-20',202625,6,2026,20,24,202606,2026),('2026-06-21',202626,6,2026,21,25,202606,2026),('2026-06-22',202626,6,2026,22,25,202606,2026),('2026-06-23',202626,6,2026,23,25,202606,2026),('2026-06-24',202626,6,2026,24,25,202606,2026),('2026-06-25',202626,6,2026,25,25,202606,2026),('2026-06-26',202626,6,2026,26,25,202606,2026),('2026-06-27',202626,6,2026,27,25,202606,2026),('2026-06-28',202627,6,2026,28,26,202606,2026),('2026-06-29',202627,6,2026,29,26,202606,2026),('2026-06-30',202627,6,2026,30,26,202606,2026),('2026-07-01',202627,7,2026,1,26,202607,2026),('2026-07-02',202627,7,2026,2,26,202607,2026),('2026-07-03',202627,7,2026,3,26,202607,2026),('2026-07-04',202627,7,2026,4,26,202607,2026),('2026-07-05',202628,7,2026,5,27,202607,2026),('2026-07-06',202628,7,2026,6,27,202607,2026),('2026-07-07',202628,7,2026,7,27,202607,2026),('2026-07-08',202628,7,2026,8,27,202607,2026),('2026-07-09',202628,7,2026,9,27,202607,2026),('2026-07-10',202628,7,2026,10,27,202607,2026),('2026-07-11',202628,7,2026,11,27,202607,2026),('2026-07-12',202629,7,2026,12,28,202607,2026),('2026-07-13',202629,7,2026,13,28,202607,2026),('2026-07-14',202629,7,2026,14,28,202607,2026),('2026-07-15',202629,7,2026,15,28,202607,2026),('2026-07-16',202629,7,2026,16,28,202607,2026),('2026-07-17',202629,7,2026,17,28,202607,2026),('2026-07-18',202629,7,2026,18,28,202607,2026),('2026-07-19',202630,7,2026,19,29,202607,2026),('2026-07-20',202630,7,2026,20,29,202607,2026),('2026-07-21',202630,7,2026,21,29,202607,2026),('2026-07-22',202630,7,2026,22,29,202607,2026),('2026-07-23',202630,7,2026,23,29,202607,2026),('2026-07-24',202630,7,2026,24,29,202607,2026),('2026-07-25',202630,7,2026,25,29,202607,2026),('2026-07-26',202631,7,2026,26,30,202607,2026),('2026-07-27',202631,7,2026,27,30,202607,2026),('2026-07-28',202631,7,2026,28,30,202607,2026),('2026-07-29',202631,7,2026,29,30,202607,2026),('2026-07-30',202631,7,2026,30,30,202607,2026),('2026-07-31',202631,7,2026,31,30,202607,2026),('2026-08-01',202631,8,2026,1,30,202608,2026),('2026-08-02',202632,8,2026,2,31,202608,2026),('2026-08-03',202632,8,2026,3,31,202608,2026),('2026-08-04',202632,8,2026,4,31,202608,2026),('2026-08-05',202632,8,2026,5,31,202608,2026),('2026-08-06',202632,8,2026,6,31,202608,2026),('2026-08-07',202632,8,2026,7,31,202608,2026),('2026-08-08',202632,8,2026,8,31,202608,2026),('2026-08-09',202633,8,2026,9,32,202608,2026),('2026-08-10',202633,8,2026,10,32,202608,2026),('2026-08-11',202633,8,2026,11,32,202608,2026),('2026-08-12',202633,8,2026,12,32,202608,2026),('2026-08-13',202633,8,2026,13,32,202608,2026),('2026-08-14',202633,8,2026,14,32,202608,2026),('2026-08-15',202633,8,2026,15,32,202608,2026),('2026-08-16',202634,8,2026,16,33,202608,2026),('2026-08-17',202634,8,2026,17,33,202608,2026),('2026-08-18',202634,8,2026,18,33,202608,2026),('2026-08-19',202634,8,2026,19,33,202608,2026),('2026-08-20',202634,8,2026,20,33,202608,2026),('2026-08-21',202634,8,2026,21,33,202608,2026),('2026-08-22',202634,8,2026,22,33,202608,2026),('2026-08-23',202635,8,2026,23,34,202608,2026),('2026-08-24',202635,8,2026,24,34,202608,2026),('2026-08-25',202635,8,2026,25,34,202608,2026),('2026-08-26',202635,8,2026,26,34,202608,2026),('2026-08-27',202635,8,2026,27,34,202608,2026),('2026-08-28',202635,8,2026,28,34,202608,2026),('2026-08-29',202635,8,2026,29,34,202608,2026),('2026-08-30',202636,8,2026,30,35,202608,2026),('2026-08-31',202636,8,2026,31,35,202608,2026),('2026-09-01',202636,9,2026,1,35,202609,2026),('2026-09-02',202636,9,2026,2,35,202609,2026),('2026-09-03',202636,9,2026,3,35,202609,2026),('2026-09-04',202636,9,2026,4,35,202609,2026),('2026-09-05',202636,9,2026,5,35,202609,2026),('2026-09-06',202637,9,2026,6,36,202609,2026),('2026-09-07',202637,9,2026,7,36,202609,2026),('2026-09-08',202637,9,2026,8,36,202609,2026),('2026-09-09',202637,9,2026,9,36,202609,2026),('2026-09-10',202637,9,2026,10,36,202609,2026),('2026-09-11',202637,9,2026,11,36,202609,2026),('2026-09-12',202637,9,2026,12,36,202609,2026),('2026-09-13',202638,9,2026,13,37,202609,2026),('2026-09-14',202638,9,2026,14,37,202609,2026),('2026-09-15',202638,9,2026,15,37,202609,2026),('2026-09-16',202638,9,2026,16,37,202609,2026),('2026-09-17',202638,9,2026,17,37,202609,2026),('2026-09-18',202638,9,2026,18,37,202609,2026),('2026-09-19',202638,9,2026,19,37,202609,2026),('2026-09-20',202639,9,2026,20,38,202609,2026),('2026-09-21',202639,9,2026,21,38,202609,2026),('2026-09-22',202639,9,2026,22,38,202609,2026),('2026-09-23',202639,9,2026,23,38,202609,2026),('2026-09-24',202639,9,2026,24,38,202609,2026),('2026-09-25',202639,9,2026,25,38,202609,2026),('2026-09-26',202639,9,2026,26,38,202609,2026),('2026-09-27',202640,9,2026,27,39,202609,2026),('2026-09-28',202640,9,2026,28,39,202609,2026),('2026-09-29',202640,9,2026,29,39,202609,2026),('2026-09-30',202640,9,2026,30,39,202609,2026),('2026-10-01',202640,10,2026,1,39,202610,2026),('2026-10-02',202640,10,2026,2,39,202610,2026),('2026-10-03',202640,10,2026,3,39,202610,2026),('2026-10-04',202641,10,2026,4,40,202610,2026),('2026-10-05',202641,10,2026,5,40,202610,2026),('2026-10-06',202641,10,2026,6,40,202610,2026),('2026-10-07',202641,10,2026,7,40,202610,2026),('2026-10-08',202641,10,2026,8,40,202610,2026),('2026-10-09',202641,10,2026,9,40,202610,2026),('2026-10-10',202641,10,2026,10,40,202610,2026),('2026-10-11',202642,10,2026,11,41,202610,2026),('2026-10-12',202642,10,2026,12,41,202610,2026),('2026-10-13',202642,10,2026,13,41,202610,2026),('2026-10-14',202642,10,2026,14,41,202610,2026),('2026-10-15',202642,10,2026,15,41,202610,2026),('2026-10-16',202642,10,2026,16,41,202610,2026),('2026-10-17',202642,10,2026,17,41,202610,2026),('2026-10-18',202643,10,2026,18,42,202610,2026),('2026-10-19',202643,10,2026,19,42,202610,2026),('2026-10-20',202643,10,2026,20,42,202610,2026),('2026-10-21',202643,10,2026,21,42,202610,2026),('2026-10-22',202643,10,2026,22,42,202610,2026),('2026-10-23',202643,10,2026,23,42,202610,2026),('2026-10-24',202643,10,2026,24,42,202610,2026),('2026-10-25',202644,10,2026,25,43,202610,2026),('2026-10-26',202644,10,2026,26,43,202610,2026),('2026-10-27',202644,10,2026,27,43,202610,2026),('2026-10-28',202644,10,2026,28,43,202610,2026),('2026-10-29',202644,10,2026,29,43,202610,2026),('2026-10-30',202644,10,2026,30,43,202610,2026),('2026-10-31',202644,10,2026,31,43,202610,2026),('2026-11-01',202645,11,2026,1,44,202611,2026),('2026-11-02',202645,11,2026,2,44,202611,2026),('2026-11-03',202645,11,2026,3,44,202611,2026),('2026-11-04',202645,11,2026,4,44,202611,2026),('2026-11-05',202645,11,2026,5,44,202611,2026),('2026-11-06',202645,11,2026,6,44,202611,2026),('2026-11-07',202645,11,2026,7,44,202611,2026),('2026-11-08',202646,11,2026,8,45,202611,2026),('2026-11-09',202646,11,2026,9,45,202611,2026),('2026-11-10',202646,11,2026,10,45,202611,2026),('2026-11-11',202646,11,2026,11,45,202611,2026),('2026-11-12',202646,11,2026,12,45,202611,2026),('2026-11-13',202646,11,2026,13,45,202611,2026),('2026-11-14',202646,11,2026,14,45,202611,2026),('2026-11-15',202647,11,2026,15,46,202611,2026),('2026-11-16',202647,11,2026,16,46,202611,2026),('2026-11-17',202647,11,2026,17,46,202611,2026),('2026-11-18',202647,11,2026,18,46,202611,2026),('2026-11-19',202647,11,2026,19,46,202611,2026),('2026-11-20',202647,11,2026,20,46,202611,2026),('2026-11-21',202647,11,2026,21,46,202611,2026),('2026-11-22',202648,11,2026,22,47,202611,2026),('2026-11-23',202648,11,2026,23,47,202611,2026),('2026-11-24',202648,11,2026,24,47,202611,2026),('2026-11-25',202648,11,2026,25,47,202611,2026),('2026-11-26',202648,11,2026,26,47,202611,2026),('2026-11-27',202648,11,2026,27,47,202611,2026),('2026-11-28',202648,11,2026,28,47,202611,2026),('2026-11-29',202649,11,2026,29,48,202611,2026),('2026-11-30',202649,11,2026,30,48,202611,2026),('2026-12-01',202649,12,2026,1,48,202612,2027),('2026-12-02',202649,12,2026,2,48,202612,2027),('2026-12-03',202649,12,2026,3,48,202612,2027),('2026-12-04',202649,12,2026,4,48,202612,2027),('2026-12-05',202649,12,2026,5,48,202612,2027),('2026-12-06',202650,12,2026,6,49,202612,2027),('2026-12-07',202650,12,2026,7,49,202612,2027),('2026-12-08',202650,12,2026,8,49,202612,2027),('2026-12-09',202650,12,2026,9,49,202612,2027),('2026-12-10',202650,12,2026,10,49,202612,2027),('2026-12-11',202650,12,2026,11,49,202612,2027),('2026-12-12',202650,12,2026,12,49,202612,2027),('2026-12-13',202651,12,2026,13,50,202612,2027),('2026-12-14',202651,12,2026,14,50,202612,2027),('2026-12-15',202651,12,2026,15,50,202612,2027),('2026-12-16',202651,12,2026,16,50,202612,2027),('2026-12-17',202651,12,2026,17,50,202612,2027),('2026-12-18',202651,12,2026,18,50,202612,2027),('2026-12-19',202651,12,2026,19,50,202612,2027),('2026-12-20',202652,12,2026,20,51,202612,2027),('2026-12-21',202652,12,2026,21,51,202612,2027),('2026-12-22',202652,12,2026,22,51,202612,2027),('2026-12-23',202652,12,2026,23,51,202612,2027),('2026-12-24',202652,12,2026,24,51,202612,2027),('2026-12-25',202652,12,2026,25,51,202612,2027),('2026-12-26',202652,12,2026,26,51,202612,2027),('2026-12-27',202653,12,2026,27,52,202612,2027),('2026-12-28',202653,12,2026,28,52,202612,2027),('2026-12-29',202653,12,2026,29,52,202612,2027),('2026-12-30',202653,12,2026,30,52,202612,2027),('2026-12-31',202653,12,2026,31,52,202612,2027),('2027-01-01',202753,1,2027,1,52,202701,2027),('2027-01-02',202753,1,2027,2,52,202701,2027),('2027-01-03',202754,1,2027,3,1,202701,2027),('2027-01-04',202701,1,2027,4,1,202701,2027),('2027-01-05',202701,1,2027,5,1,202701,2027),('2027-01-06',202701,1,2027,6,1,202701,2027),('2027-01-07',202701,1,2027,7,1,202701,2027),('2027-01-08',202701,1,2027,8,1,202701,2027),('2027-01-09',202701,1,2027,9,1,202701,2027),('2027-01-10',202702,1,2027,10,2,202701,2027),('2027-01-11',202702,1,2027,11,2,202701,2027),('2027-01-12',202702,1,2027,12,2,202701,2027),('2027-01-13',202702,1,2027,13,2,202701,2027),('2027-01-14',202702,1,2027,14,2,202701,2027),('2027-01-15',202702,1,2027,15,2,202701,2027),('2027-01-16',202702,1,2027,16,2,202701,2027),('2027-01-17',202703,1,2027,17,3,202701,2027),('2027-01-18',202703,1,2027,18,3,202701,2027),('2027-01-19',202703,1,2027,19,3,202701,2027),('2027-01-20',202703,1,2027,20,3,202701,2027),('2027-01-21',202703,1,2027,21,3,202701,2027),('2027-01-22',202703,1,2027,22,3,202701,2027),('2027-01-23',202703,1,2027,23,3,202701,2027),('2027-01-24',202704,1,2027,24,4,202701,2027),('2027-01-25',202704,1,2027,25,4,202701,2027),('2027-01-26',202704,1,2027,26,4,202701,2027),('2027-01-27',202704,1,2027,27,4,202701,2027),('2027-01-28',202704,1,2027,28,4,202701,2027),('2027-01-29',202704,1,2027,29,4,202701,2027),('2027-01-30',202704,1,2027,30,4,202701,2027),('2027-01-31',202705,1,2027,31,5,202701,2027),('2027-02-01',202705,2,2027,1,5,202702,2027),('2027-02-02',202705,2,2027,2,5,202702,2027),('2027-02-03',202705,2,2027,3,5,202702,2027),('2027-02-04',202705,2,2027,4,5,202702,2027),('2027-02-05',202705,2,2027,5,5,202702,2027),('2027-02-06',202705,2,2027,6,5,202702,2027),('2027-02-07',202706,2,2027,7,6,202702,2027),('2027-02-08',202706,2,2027,8,6,202702,2027),('2027-02-09',202706,2,2027,9,6,202702,2027),('2027-02-10',202706,2,2027,10,6,202702,2027),('2027-02-11',202706,2,2027,11,6,202702,2027),('2027-02-12',202706,2,2027,12,6,202702,2027),('2027-02-13',202706,2,2027,13,6,202702,2027),('2027-02-14',202707,2,2027,14,7,202702,2027),('2027-02-15',202707,2,2027,15,7,202702,2027),('2027-02-16',202707,2,2027,16,7,202702,2027),('2027-02-17',202707,2,2027,17,7,202702,2027),('2027-02-18',202707,2,2027,18,7,202702,2027),('2027-02-19',202707,2,2027,19,7,202702,2027),('2027-02-20',202707,2,2027,20,7,202702,2027),('2027-02-21',202708,2,2027,21,8,202702,2027),('2027-02-22',202708,2,2027,22,8,202702,2027),('2027-02-23',202708,2,2027,23,8,202702,2027),('2027-02-24',202708,2,2027,24,8,202702,2027),('2027-02-25',202708,2,2027,25,8,202702,2027),('2027-02-26',202708,2,2027,26,8,202702,2027),('2027-02-27',202708,2,2027,27,8,202702,2027),('2027-02-28',202709,2,2027,28,9,202702,2027),('2027-03-01',202709,3,2027,1,9,202703,2027),('2027-03-02',202709,3,2027,2,9,202703,2027),('2027-03-03',202709,3,2027,3,9,202703,2027),('2027-03-04',202709,3,2027,4,9,202703,2027),('2027-03-05',202709,3,2027,5,9,202703,2027),('2027-03-06',202709,3,2027,6,9,202703,2027),('2027-03-07',202710,3,2027,7,10,202703,2027),('2027-03-08',202710,3,2027,8,10,202703,2027),('2027-03-09',202710,3,2027,9,10,202703,2027),('2027-03-10',202710,3,2027,10,10,202703,2027),('2027-03-11',202710,3,2027,11,10,202703,2027),('2027-03-12',202710,3,2027,12,10,202703,2027),('2027-03-13',202710,3,2027,13,10,202703,2027),('2027-03-14',202711,3,2027,14,11,202703,2027),('2027-03-15',202711,3,2027,15,11,202703,2027),('2027-03-16',202711,3,2027,16,11,202703,2027),('2027-03-17',202711,3,2027,17,11,202703,2027),('2027-03-18',202711,3,2027,18,11,202703,2027),('2027-03-19',202711,3,2027,19,11,202703,2027),('2027-03-20',202711,3,2027,20,11,202703,2027),('2027-03-21',202712,3,2027,21,12,202703,2027),('2027-03-22',202712,3,2027,22,12,202703,2027),('2027-03-23',202712,3,2027,23,12,202703,2027),('2027-03-24',202712,3,2027,24,12,202703,2027),('2027-03-25',202712,3,2027,25,12,202703,2027),('2027-03-26',202712,3,2027,26,12,202703,2027),('2027-03-27',202712,3,2027,27,12,202703,2027),('2027-03-28',202713,3,2027,28,13,202703,2027),('2027-03-29',202713,3,2027,29,13,202703,2027),('2027-03-30',202713,3,2027,30,13,202703,2027),('2027-03-31',202713,3,2027,31,13,202703,2027),('2027-04-01',202713,4,2027,1,13,202704,2027),('2027-04-02',202713,4,2027,2,13,202704,2027),('2027-04-03',202713,4,2027,3,13,202704,2027),('2027-04-04',202714,4,2027,4,14,202704,2027),('2027-04-05',202714,4,2027,5,14,202704,2027),('2027-04-06',202714,4,2027,6,14,202704,2027),('2027-04-07',202714,4,2027,7,14,202704,2027),('2027-04-08',202714,4,2027,8,14,202704,2027),('2027-04-09',202714,4,2027,9,14,202704,2027),('2027-04-10',202714,4,2027,10,14,202704,2027),('2027-04-11',202715,4,2027,11,15,202704,2027),('2027-04-12',202715,4,2027,12,15,202704,2027),('2027-04-13',202715,4,2027,13,15,202704,2027),('2027-04-14',202715,4,2027,14,15,202704,2027),('2027-04-15',202715,4,2027,15,15,202704,2027),('2027-04-16',202715,4,2027,16,15,202704,2027),('2027-04-17',202715,4,2027,17,15,202704,2027),('2027-04-18',202716,4,2027,18,16,202704,2027),('2027-04-19',202716,4,2027,19,16,202704,2027),('2027-04-20',202716,4,2027,20,16,202704,2027),('2027-04-21',202716,4,2027,21,16,202704,2027),('2027-04-22',202716,4,2027,22,16,202704,2027),('2027-04-23',202716,4,2027,23,16,202704,2027),('2027-04-24',202716,4,2027,24,16,202704,2027),('2027-04-25',202717,4,2027,25,17,202704,2027),('2027-04-26',202717,4,2027,26,17,202704,2027),('2027-04-27',202717,4,2027,27,17,202704,2027),('2027-04-28',202717,4,2027,28,17,202704,2027),('2027-04-29',202717,4,2027,29,17,202704,2027),('2027-04-30',202717,4,2027,30,17,202704,2027),('2027-05-01',202717,5,2027,1,17,202705,2027),('2027-05-02',202718,5,2027,2,18,202705,2027),('2027-05-03',202718,5,2027,3,18,202705,2027),('2027-05-04',202718,5,2027,4,18,202705,2027),('2027-05-05',202718,5,2027,5,18,202705,2027),('2027-05-06',202718,5,2027,6,18,202705,2027),('2027-05-07',202718,5,2027,7,18,202705,2027),('2027-05-08',202718,5,2027,8,18,202705,2027),('2027-05-09',202719,5,2027,9,19,202705,2027),('2027-05-10',202719,5,2027,10,19,202705,2027),('2027-05-11',202719,5,2027,11,19,202705,2027),('2027-05-12',202719,5,2027,12,19,202705,2027),('2027-05-13',202719,5,2027,13,19,202705,2027),('2027-05-14',202719,5,2027,14,19,202705,2027),('2027-05-15',202719,5,2027,15,19,202705,2027),('2027-05-16',202720,5,2027,16,20,202705,2027),('2027-05-17',202720,5,2027,17,20,202705,2027),('2027-05-18',202720,5,2027,18,20,202705,2027),('2027-05-19',202720,5,2027,19,20,202705,2027),('2027-05-20',202720,5,2027,20,20,202705,2027),('2027-05-21',202720,5,2027,21,20,202705,2027),('2027-05-22',202720,5,2027,22,20,202705,2027),('2027-05-23',202721,5,2027,23,21,202705,2027),('2027-05-24',202721,5,2027,24,21,202705,2027),('2027-05-25',202721,5,2027,25,21,202705,2027),('2027-05-26',202721,5,2027,26,21,202705,2027),('2027-05-27',202721,5,2027,27,21,202705,2027),('2027-05-28',202721,5,2027,28,21,202705,2027),('2027-05-29',202721,5,2027,29,21,202705,2027),('2027-05-30',202722,5,2027,30,22,202705,2027),('2027-05-31',202722,5,2027,31,22,202705,2027),('2027-06-01',202722,6,2027,1,22,202706,2027),('2027-06-02',202722,6,2027,2,22,202706,2027),('2027-06-03',202722,6,2027,3,22,202706,2027),('2027-06-04',202722,6,2027,4,22,202706,2027),('2027-06-05',202722,6,2027,5,22,202706,2027),('2027-06-06',202723,6,2027,6,23,202706,2027),('2027-06-07',202723,6,2027,7,23,202706,2027),('2027-06-08',202723,6,2027,8,23,202706,2027),('2027-06-09',202723,6,2027,9,23,202706,2027),('2027-06-10',202723,6,2027,10,23,202706,2027),('2027-06-11',202723,6,2027,11,23,202706,2027),('2027-06-12',202723,6,2027,12,23,202706,2027),('2027-06-13',202724,6,2027,13,24,202706,2027),('2027-06-14',202724,6,2027,14,24,202706,2027),('2027-06-15',202724,6,2027,15,24,202706,2027),('2027-06-16',202724,6,2027,16,24,202706,2027),('2027-06-17',202724,6,2027,17,24,202706,2027),('2027-06-18',202724,6,2027,18,24,202706,2027),('2027-06-19',202724,6,2027,19,24,202706,2027),('2027-06-20',202725,6,2027,20,25,202706,2027),('2027-06-21',202725,6,2027,21,25,202706,2027),('2027-06-22',202725,6,2027,22,25,202706,2027),('2027-06-23',202725,6,2027,23,25,202706,2027),('2027-06-24',202725,6,2027,24,25,202706,2027),('2027-06-25',202725,6,2027,25,25,202706,2027),('2027-06-26',202725,6,2027,26,25,202706,2027),('2027-06-27',202726,6,2027,27,26,202706,2027),('2027-06-28',202726,6,2027,28,26,202706,2027),('2027-06-29',202726,6,2027,29,26,202706,2027),('2027-06-30',202726,6,2027,30,26,202706,2027),('2027-07-01',202726,7,2027,1,26,202707,2027),('2027-07-02',202726,7,2027,2,26,202707,2027),('2027-07-03',202726,7,2027,3,26,202707,2027),('2027-07-04',202727,7,2027,4,27,202707,2027),('2027-07-05',202727,7,2027,5,27,202707,2027),('2027-07-06',202727,7,2027,6,27,202707,2027),('2027-07-07',202727,7,2027,7,27,202707,2027),('2027-07-08',202727,7,2027,8,27,202707,2027),('2027-07-09',202727,7,2027,9,27,202707,2027),('2027-07-10',202727,7,2027,10,27,202707,2027),('2027-07-11',202728,7,2027,11,28,202707,2027),('2027-07-12',202728,7,2027,12,28,202707,2027),('2027-07-13',202728,7,2027,13,28,202707,2027),('2027-07-14',202728,7,2027,14,28,202707,2027),('2027-07-15',202728,7,2027,15,28,202707,2027),('2027-07-16',202728,7,2027,16,28,202707,2027),('2027-07-17',202728,7,2027,17,28,202707,2027),('2027-07-18',202729,7,2027,18,29,202707,2027),('2027-07-19',202729,7,2027,19,29,202707,2027),('2027-07-20',202729,7,2027,20,29,202707,2027),('2027-07-21',202729,7,2027,21,29,202707,2027),('2027-07-22',202729,7,2027,22,29,202707,2027),('2027-07-23',202729,7,2027,23,29,202707,2027),('2027-07-24',202729,7,2027,24,29,202707,2027),('2027-07-25',202730,7,2027,25,30,202707,2027),('2027-07-26',202730,7,2027,26,30,202707,2027),('2027-07-27',202730,7,2027,27,30,202707,2027),('2027-07-28',202730,7,2027,28,30,202707,2027),('2027-07-29',202730,7,2027,29,30,202707,2027),('2027-07-30',202730,7,2027,30,30,202707,2027),('2027-07-31',202730,7,2027,31,30,202707,2027),('2027-08-01',202731,8,2027,1,31,202708,2027),('2027-08-02',202731,8,2027,2,31,202708,2027),('2027-08-03',202731,8,2027,3,31,202708,2027),('2027-08-04',202731,8,2027,4,31,202708,2027),('2027-08-05',202731,8,2027,5,31,202708,2027),('2027-08-06',202731,8,2027,6,31,202708,2027),('2027-08-07',202731,8,2027,7,31,202708,2027),('2027-08-08',202732,8,2027,8,32,202708,2027),('2027-08-09',202732,8,2027,9,32,202708,2027),('2027-08-10',202732,8,2027,10,32,202708,2027),('2027-08-11',202732,8,2027,11,32,202708,2027),('2027-08-12',202732,8,2027,12,32,202708,2027),('2027-08-13',202732,8,2027,13,32,202708,2027),('2027-08-14',202732,8,2027,14,32,202708,2027),('2027-08-15',202733,8,2027,15,33,202708,2027),('2027-08-16',202733,8,2027,16,33,202708,2027),('2027-08-17',202733,8,2027,17,33,202708,2027),('2027-08-18',202733,8,2027,18,33,202708,2027),('2027-08-19',202733,8,2027,19,33,202708,2027),('2027-08-20',202733,8,2027,20,33,202708,2027),('2027-08-21',202733,8,2027,21,33,202708,2027),('2027-08-22',202734,8,2027,22,34,202708,2027),('2027-08-23',202734,8,2027,23,34,202708,2027),('2027-08-24',202734,8,2027,24,34,202708,2027),('2027-08-25',202734,8,2027,25,34,202708,2027),('2027-08-26',202734,8,2027,26,34,202708,2027),('2027-08-27',202734,8,2027,27,34,202708,2027),('2027-08-28',202734,8,2027,28,34,202708,2027),('2027-08-29',202735,8,2027,29,35,202708,2027),('2027-08-30',202735,8,2027,30,35,202708,2027),('2027-08-31',202735,8,2027,31,35,202708,2027),('2027-09-01',202735,9,2027,1,35,202709,2027),('2027-09-02',202735,9,2027,2,35,202709,2027),('2027-09-03',202735,9,2027,3,35,202709,2027),('2027-09-04',202735,9,2027,4,35,202709,2027),('2027-09-05',202736,9,2027,5,36,202709,2027),('2027-09-06',202736,9,2027,6,36,202709,2027),('2027-09-07',202736,9,2027,7,36,202709,2027),('2027-09-08',202736,9,2027,8,36,202709,2027),('2027-09-09',202736,9,2027,9,36,202709,2027),('2027-09-10',202736,9,2027,10,36,202709,2027),('2027-09-11',202736,9,2027,11,36,202709,2027),('2027-09-12',202737,9,2027,12,37,202709,2027),('2027-09-13',202737,9,2027,13,37,202709,2027),('2027-09-14',202737,9,2027,14,37,202709,2027),('2027-09-15',202737,9,2027,15,37,202709,2027),('2027-09-16',202737,9,2027,16,37,202709,2027),('2027-09-17',202737,9,2027,17,37,202709,2027),('2027-09-18',202737,9,2027,18,37,202709,2027),('2027-09-19',202738,9,2027,19,38,202709,2027),('2027-09-20',202738,9,2027,20,38,202709,2027),('2027-09-21',202738,9,2027,21,38,202709,2027),('2027-09-22',202738,9,2027,22,38,202709,2027),('2027-09-23',202738,9,2027,23,38,202709,2027),('2027-09-24',202738,9,2027,24,38,202709,2027),('2027-09-25',202738,9,2027,25,38,202709,2027),('2027-09-26',202739,9,2027,26,39,202709,2027),('2027-09-27',202739,9,2027,27,39,202709,2027),('2027-09-28',202739,9,2027,28,39,202709,2027),('2027-09-29',202739,9,2027,29,39,202709,2027),('2027-09-30',202739,9,2027,30,39,202709,2027),('2027-10-01',202739,10,2027,1,39,202710,2027),('2027-10-02',202739,10,2027,2,39,202710,2027),('2027-10-03',202740,10,2027,3,40,202710,2027),('2027-10-04',202740,10,2027,4,40,202710,2027),('2027-10-05',202740,10,2027,5,40,202710,2027),('2027-10-06',202740,10,2027,6,40,202710,2027),('2027-10-07',202740,10,2027,7,40,202710,2027),('2027-10-08',202740,10,2027,8,40,202710,2027),('2027-10-09',202740,10,2027,9,40,202710,2027),('2027-10-10',202741,10,2027,10,41,202710,2027),('2027-10-11',202741,10,2027,11,41,202710,2027),('2027-10-12',202741,10,2027,12,41,202710,2027),('2027-10-13',202741,10,2027,13,41,202710,2027),('2027-10-14',202741,10,2027,14,41,202710,2027),('2027-10-15',202741,10,2027,15,41,202710,2027),('2027-10-16',202741,10,2027,16,41,202710,2027),('2027-10-17',202742,10,2027,17,42,202710,2027),('2027-10-18',202742,10,2027,18,42,202710,2027),('2027-10-19',202742,10,2027,19,42,202710,2027),('2027-10-20',202742,10,2027,20,42,202710,2027),('2027-10-21',202742,10,2027,21,42,202710,2027),('2027-10-22',202742,10,2027,22,42,202710,2027),('2027-10-23',202742,10,2027,23,42,202710,2027),('2027-10-24',202743,10,2027,24,43,202710,2027),('2027-10-25',202743,10,2027,25,43,202710,2027),('2027-10-26',202743,10,2027,26,43,202710,2027),('2027-10-27',202743,10,2027,27,43,202710,2027),('2027-10-28',202743,10,2027,28,43,202710,2027),('2027-10-29',202743,10,2027,29,43,202710,2027),('2027-10-30',202743,10,2027,30,43,202710,2027),('2027-10-31',202744,10,2027,31,44,202710,2027),('2027-11-01',202744,11,2027,1,44,202711,2027),('2027-11-02',202744,11,2027,2,44,202711,2027),('2027-11-03',202744,11,2027,3,44,202711,2027),('2027-11-04',202744,11,2027,4,44,202711,2027),('2027-11-05',202744,11,2027,5,44,202711,2027),('2027-11-06',202744,11,2027,6,44,202711,2027),('2027-11-07',202745,11,2027,7,45,202711,2027),('2027-11-08',202745,11,2027,8,45,202711,2027),('2027-11-09',202745,11,2027,9,45,202711,2027),('2027-11-10',202745,11,2027,10,45,202711,2027),('2027-11-11',202745,11,2027,11,45,202711,2027),('2027-11-12',202745,11,2027,12,45,202711,2027),('2027-11-13',202745,11,2027,13,45,202711,2027),('2027-11-14',202746,11,2027,14,46,202711,2027),('2027-11-15',202746,11,2027,15,46,202711,2027),('2027-11-16',202746,11,2027,16,46,202711,2027),('2027-11-17',202746,11,2027,17,46,202711,2027),('2027-11-18',202746,11,2027,18,46,202711,2027),('2027-11-19',202746,11,2027,19,46,202711,2027),('2027-11-20',202746,11,2027,20,46,202711,2027),('2027-11-21',202747,11,2027,21,47,202711,2027),('2027-11-22',202747,11,2027,22,47,202711,2027),('2027-11-23',202747,11,2027,23,47,202711,2027),('2027-11-24',202747,11,2027,24,47,202711,2027),('2027-11-25',202747,11,2027,25,47,202711,2027),('2027-11-26',202747,11,2027,26,47,202711,2027),('2027-11-27',202747,11,2027,27,47,202711,2027),('2027-11-28',202748,11,2027,28,48,202711,2027),('2027-11-29',202748,11,2027,29,48,202711,2027),('2027-11-30',202748,11,2027,30,48,202711,2027),('2027-12-01',202748,12,2027,1,48,202712,2028),('2027-12-02',202748,12,2027,2,48,202712,2028),('2027-12-03',202748,12,2027,3,48,202712,2028),('2027-12-04',202748,12,2027,4,48,202712,2028),('2027-12-05',202749,12,2027,5,49,202712,2028),('2027-12-06',202749,12,2027,6,49,202712,2028),('2027-12-07',202749,12,2027,7,49,202712,2028),('2027-12-08',202749,12,2027,8,49,202712,2028),('2027-12-09',202749,12,2027,9,49,202712,2028),('2027-12-10',202749,12,2027,10,49,202712,2028),('2027-12-11',202749,12,2027,11,49,202712,2028),('2027-12-12',202750,12,2027,12,50,202712,2028),('2027-12-13',202750,12,2027,13,50,202712,2028),('2027-12-14',202750,12,2027,14,50,202712,2028),('2027-12-15',202750,12,2027,15,50,202712,2028),('2027-12-16',202750,12,2027,16,50,202712,2028),('2027-12-17',202750,12,2027,17,50,202712,2028),('2027-12-18',202750,12,2027,18,50,202712,2028),('2027-12-19',202751,12,2027,19,51,202712,2028),('2027-12-20',202751,12,2027,20,51,202712,2028),('2027-12-21',202751,12,2027,21,51,202712,2028),('2027-12-22',202751,12,2027,22,51,202712,2028),('2027-12-23',202751,12,2027,23,51,202712,2028),('2027-12-24',202751,12,2027,24,51,202712,2028),('2027-12-25',202751,12,2027,25,51,202712,2028),('2027-12-26',202752,12,2027,26,52,202712,2028),('2027-12-27',202752,12,2027,27,52,202712,2028),('2027-12-28',202752,12,2027,28,52,202712,2028),('2027-12-29',202752,12,2027,29,52,202712,2028),('2027-12-30',202752,12,2027,30,52,202712,2028),('2027-12-31',202752,12,2027,31,52,202712,2028),('2028-01-01',202852,1,2028,1,52,202801,2028),('2028-01-02',202853,1,2028,2,1,202801,2028),('2028-01-03',202801,1,2028,3,1,202801,2028),('2028-01-04',202801,1,2028,4,1,202801,2028),('2028-01-05',202801,1,2028,5,1,202801,2028),('2028-01-06',202801,1,2028,6,1,202801,2028),('2028-01-07',202801,1,2028,7,1,202801,2028),('2028-01-08',202801,1,2028,8,1,202801,2028),('2028-01-09',202802,1,2028,9,2,202801,2028),('2028-01-10',202802,1,2028,10,2,202801,2028),('2028-01-11',202802,1,2028,11,2,202801,2028),('2028-01-12',202802,1,2028,12,2,202801,2028),('2028-01-13',202802,1,2028,13,2,202801,2028),('2028-01-14',202802,1,2028,14,2,202801,2028),('2028-01-15',202802,1,2028,15,2,202801,2028),('2028-01-16',202803,1,2028,16,3,202801,2028),('2028-01-17',202803,1,2028,17,3,202801,2028),('2028-01-18',202803,1,2028,18,3,202801,2028),('2028-01-19',202803,1,2028,19,3,202801,2028),('2028-01-20',202803,1,2028,20,3,202801,2028),('2028-01-21',202803,1,2028,21,3,202801,2028),('2028-01-22',202803,1,2028,22,3,202801,2028),('2028-01-23',202804,1,2028,23,4,202801,2028),('2028-01-24',202804,1,2028,24,4,202801,2028),('2028-01-25',202804,1,2028,25,4,202801,2028),('2028-01-26',202804,1,2028,26,4,202801,2028),('2028-01-27',202804,1,2028,27,4,202801,2028),('2028-01-28',202804,1,2028,28,4,202801,2028),('2028-01-29',202804,1,2028,29,4,202801,2028),('2028-01-30',202805,1,2028,30,5,202801,2028),('2028-01-31',202805,1,2028,31,5,202801,2028),('2028-02-01',202805,2,2028,1,5,202802,2028),('2028-02-02',202805,2,2028,2,5,202802,2028),('2028-02-03',202805,2,2028,3,5,202802,2028),('2028-02-04',202805,2,2028,4,5,202802,2028),('2028-02-05',202805,2,2028,5,5,202802,2028),('2028-02-06',202806,2,2028,6,6,202802,2028),('2028-02-07',202806,2,2028,7,6,202802,2028),('2028-02-08',202806,2,2028,8,6,202802,2028),('2028-02-09',202806,2,2028,9,6,202802,2028),('2028-02-10',202806,2,2028,10,6,202802,2028),('2028-02-11',202806,2,2028,11,6,202802,2028),('2028-02-12',202806,2,2028,12,6,202802,2028),('2028-02-13',202807,2,2028,13,7,202802,2028),('2028-02-14',202807,2,2028,14,7,202802,2028),('2028-02-15',202807,2,2028,15,7,202802,2028),('2028-02-16',202807,2,2028,16,7,202802,2028),('2028-02-17',202807,2,2028,17,7,202802,2028),('2028-02-18',202807,2,2028,18,7,202802,2028),('2028-02-19',202807,2,2028,19,7,202802,2028),('2028-02-20',202808,2,2028,20,8,202802,2028),('2028-02-21',202808,2,2028,21,8,202802,2028),('2028-02-22',202808,2,2028,22,8,202802,2028),('2028-02-23',202808,2,2028,23,8,202802,2028),('2028-02-24',202808,2,2028,24,8,202802,2028),('2028-02-25',202808,2,2028,25,8,202802,2028),('2028-02-26',202808,2,2028,26,8,202802,2028),('2028-02-27',202809,2,2028,27,9,202802,2028),('2028-02-28',202809,2,2028,28,9,202802,2028),('2028-02-29',202809,2,2028,29,9,202802,2028),('2028-03-01',202809,3,2028,1,9,202803,2028),('2028-03-02',202809,3,2028,2,9,202803,2028),('2028-03-03',202809,3,2028,3,9,202803,2028),('2028-03-04',202809,3,2028,4,9,202803,2028),('2028-03-05',202810,3,2028,5,10,202803,2028),('2028-03-06',202810,3,2028,6,10,202803,2028),('2028-03-07',202810,3,2028,7,10,202803,2028),('2028-03-08',202810,3,2028,8,10,202803,2028),('2028-03-09',202810,3,2028,9,10,202803,2028),('2028-03-10',202810,3,2028,10,10,202803,2028),('2028-03-11',202810,3,2028,11,10,202803,2028),('2028-03-12',202811,3,2028,12,11,202803,2028),('2028-03-13',202811,3,2028,13,11,202803,2028),('2028-03-14',202811,3,2028,14,11,202803,2028),('2028-03-15',202811,3,2028,15,11,202803,2028),('2028-03-16',202811,3,2028,16,11,202803,2028),('2028-03-17',202811,3,2028,17,11,202803,2028),('2028-03-18',202811,3,2028,18,11,202803,2028),('2028-03-19',202812,3,2028,19,12,202803,2028),('2028-03-20',202812,3,2028,20,12,202803,2028),('2028-03-21',202812,3,2028,21,12,202803,2028),('2028-03-22',202812,3,2028,22,12,202803,2028),('2028-03-23',202812,3,2028,23,12,202803,2028),('2028-03-24',202812,3,2028,24,12,202803,2028),('2028-03-25',202812,3,2028,25,12,202803,2028),('2028-03-26',202813,3,2028,26,13,202803,2028),('2028-03-27',202813,3,2028,27,13,202803,2028),('2028-03-28',202813,3,2028,28,13,202803,2028),('2028-03-29',202813,3,2028,29,13,202803,2028),('2028-03-30',202813,3,2028,30,13,202803,2028),('2028-03-31',202813,3,2028,31,13,202803,2028),('2028-04-01',202813,4,2028,1,13,202804,2028),('2028-04-02',202814,4,2028,2,14,202804,2028),('2028-04-03',202814,4,2028,3,14,202804,2028),('2028-04-04',202814,4,2028,4,14,202804,2028),('2028-04-05',202814,4,2028,5,14,202804,2028),('2028-04-06',202814,4,2028,6,14,202804,2028),('2028-04-07',202814,4,2028,7,14,202804,2028),('2028-04-08',202814,4,2028,8,14,202804,2028),('2028-04-09',202815,4,2028,9,15,202804,2028),('2028-04-10',202815,4,2028,10,15,202804,2028),('2028-04-11',202815,4,2028,11,15,202804,2028),('2028-04-12',202815,4,2028,12,15,202804,2028),('2028-04-13',202815,4,2028,13,15,202804,2028),('2028-04-14',202815,4,2028,14,15,202804,2028),('2028-04-15',202815,4,2028,15,15,202804,2028),('2028-04-16',202816,4,2028,16,16,202804,2028),('2028-04-17',202816,4,2028,17,16,202804,2028),('2028-04-18',202816,4,2028,18,16,202804,2028),('2028-04-19',202816,4,2028,19,16,202804,2028),('2028-04-20',202816,4,2028,20,16,202804,2028),('2028-04-21',202816,4,2028,21,16,202804,2028),('2028-04-22',202816,4,2028,22,16,202804,2028),('2028-04-23',202817,4,2028,23,17,202804,2028),('2028-04-24',202817,4,2028,24,17,202804,2028),('2028-04-25',202817,4,2028,25,17,202804,2028),('2028-04-26',202817,4,2028,26,17,202804,2028),('2028-04-27',202817,4,2028,27,17,202804,2028),('2028-04-28',202817,4,2028,28,17,202804,2028),('2028-04-29',202817,4,2028,29,17,202804,2028),('2028-04-30',202818,4,2028,30,18,202804,2028),('2028-05-01',202818,5,2028,1,18,202805,2028),('2028-05-02',202818,5,2028,2,18,202805,2028),('2028-05-03',202818,5,2028,3,18,202805,2028),('2028-05-04',202818,5,2028,4,18,202805,2028),('2028-05-05',202818,5,2028,5,18,202805,2028),('2028-05-06',202818,5,2028,6,18,202805,2028),('2028-05-07',202819,5,2028,7,19,202805,2028),('2028-05-08',202819,5,2028,8,19,202805,2028),('2028-05-09',202819,5,2028,9,19,202805,2028),('2028-05-10',202819,5,2028,10,19,202805,2028),('2028-05-11',202819,5,2028,11,19,202805,2028),('2028-05-12',202819,5,2028,12,19,202805,2028),('2028-05-13',202819,5,2028,13,19,202805,2028),('2028-05-14',202820,5,2028,14,20,202805,2028),('2028-05-15',202820,5,2028,15,20,202805,2028),('2028-05-16',202820,5,2028,16,20,202805,2028),('2028-05-17',202820,5,2028,17,20,202805,2028),('2028-05-18',202820,5,2028,18,20,202805,2028),('2028-05-19',202820,5,2028,19,20,202805,2028),('2028-05-20',202820,5,2028,20,20,202805,2028),('2028-05-21',202821,5,2028,21,21,202805,2028),('2028-05-22',202821,5,2028,22,21,202805,2028),('2028-05-23',202821,5,2028,23,21,202805,2028),('2028-05-24',202821,5,2028,24,21,202805,2028),('2028-05-25',202821,5,2028,25,21,202805,2028),('2028-05-26',202821,5,2028,26,21,202805,2028),('2028-05-27',202821,5,2028,27,21,202805,2028),('2028-05-28',202822,5,2028,28,22,202805,2028),('2028-05-29',202822,5,2028,29,22,202805,2028),('2028-05-30',202822,5,2028,30,22,202805,2028),('2028-05-31',202822,5,2028,31,22,202805,2028),('2028-06-01',202822,6,2028,1,22,202806,2028),('2028-06-02',202822,6,2028,2,22,202806,2028),('2028-06-03',202822,6,2028,3,22,202806,2028),('2028-06-04',202823,6,2028,4,23,202806,2028),('2028-06-05',202823,6,2028,5,23,202806,2028),('2028-06-06',202823,6,2028,6,23,202806,2028),('2028-06-07',202823,6,2028,7,23,202806,2028),('2028-06-08',202823,6,2028,8,23,202806,2028),('2028-06-09',202823,6,2028,9,23,202806,2028),('2028-06-10',202823,6,2028,10,23,202806,2028),('2028-06-11',202824,6,2028,11,24,202806,2028),('2028-06-12',202824,6,2028,12,24,202806,2028),('2028-06-13',202824,6,2028,13,24,202806,2028),('2028-06-14',202824,6,2028,14,24,202806,2028),('2028-06-15',202824,6,2028,15,24,202806,2028),('2028-06-16',202824,6,2028,16,24,202806,2028),('2028-06-17',202824,6,2028,17,24,202806,2028),('2028-06-18',202825,6,2028,18,25,202806,2028),('2028-06-19',202825,6,2028,19,25,202806,2028),('2028-06-20',202825,6,2028,20,25,202806,2028),('2028-06-21',202825,6,2028,21,25,202806,2028),('2028-06-22',202825,6,2028,22,25,202806,2028),('2028-06-23',202825,6,2028,23,25,202806,2028),('2028-06-24',202825,6,2028,24,25,202806,2028),('2028-06-25',202826,6,2028,25,26,202806,2028),('2028-06-26',202826,6,2028,26,26,202806,2028),('2028-06-27',202826,6,2028,27,26,202806,2028),('2028-06-28',202826,6,2028,28,26,202806,2028),('2028-06-29',202826,6,2028,29,26,202806,2028),('2028-06-30',202826,6,2028,30,26,202806,2028),('2028-07-01',202826,7,2028,1,26,202807,2028),('2028-07-02',202827,7,2028,2,27,202807,2028),('2028-07-03',202827,7,2028,3,27,202807,2028),('2028-07-04',202827,7,2028,4,27,202807,2028),('2028-07-05',202827,7,2028,5,27,202807,2028),('2028-07-06',202827,7,2028,6,27,202807,2028),('2028-07-07',202827,7,2028,7,27,202807,2028),('2028-07-08',202827,7,2028,8,27,202807,2028),('2028-07-09',202828,7,2028,9,28,202807,2028),('2028-07-10',202828,7,2028,10,28,202807,2028),('2028-07-11',202828,7,2028,11,28,202807,2028),('2028-07-12',202828,7,2028,12,28,202807,2028),('2028-07-13',202828,7,2028,13,28,202807,2028),('2028-07-14',202828,7,2028,14,28,202807,2028),('2028-07-15',202828,7,2028,15,28,202807,2028),('2028-07-16',202829,7,2028,16,29,202807,2028),('2028-07-17',202829,7,2028,17,29,202807,2028),('2028-07-18',202829,7,2028,18,29,202807,2028),('2028-07-19',202829,7,2028,19,29,202807,2028),('2028-07-20',202829,7,2028,20,29,202807,2028),('2028-07-21',202829,7,2028,21,29,202807,2028),('2028-07-22',202829,7,2028,22,29,202807,2028),('2028-07-23',202830,7,2028,23,30,202807,2028),('2028-07-24',202830,7,2028,24,30,202807,2028),('2028-07-25',202830,7,2028,25,30,202807,2028),('2028-07-26',202830,7,2028,26,30,202807,2028),('2028-07-27',202830,7,2028,27,30,202807,2028),('2028-07-28',202830,7,2028,28,30,202807,2028),('2028-07-29',202830,7,2028,29,30,202807,2028),('2028-07-30',202831,7,2028,30,31,202807,2028),('2028-07-31',202831,7,2028,31,31,202807,2028),('2028-08-01',202831,8,2028,1,31,202808,2028),('2028-08-02',202831,8,2028,2,31,202808,2028),('2028-08-03',202831,8,2028,3,31,202808,2028),('2028-08-04',202831,8,2028,4,31,202808,2028),('2028-08-05',202831,8,2028,5,31,202808,2028),('2028-08-06',202832,8,2028,6,32,202808,2028),('2028-08-07',202832,8,2028,7,32,202808,2028),('2028-08-08',202832,8,2028,8,32,202808,2028),('2028-08-09',202832,8,2028,9,32,202808,2028),('2028-08-10',202832,8,2028,10,32,202808,2028),('2028-08-11',202832,8,2028,11,32,202808,2028),('2028-08-12',202832,8,2028,12,32,202808,2028),('2028-08-13',202833,8,2028,13,33,202808,2028),('2028-08-14',202833,8,2028,14,33,202808,2028),('2028-08-15',202833,8,2028,15,33,202808,2028),('2028-08-16',202833,8,2028,16,33,202808,2028),('2028-08-17',202833,8,2028,17,33,202808,2028),('2028-08-18',202833,8,2028,18,33,202808,2028),('2028-08-19',202833,8,2028,19,33,202808,2028),('2028-08-20',202834,8,2028,20,34,202808,2028),('2028-08-21',202834,8,2028,21,34,202808,2028),('2028-08-22',202834,8,2028,22,34,202808,2028),('2028-08-23',202834,8,2028,23,34,202808,2028),('2028-08-24',202834,8,2028,24,34,202808,2028),('2028-08-25',202834,8,2028,25,34,202808,2028),('2028-08-26',202834,8,2028,26,34,202808,2028),('2028-08-27',202835,8,2028,27,35,202808,2028),('2028-08-28',202835,8,2028,28,35,202808,2028),('2028-08-29',202835,8,2028,29,35,202808,2028),('2028-08-30',202835,8,2028,30,35,202808,2028),('2028-08-31',202835,8,2028,31,35,202808,2028),('2028-09-01',202835,9,2028,1,35,202809,2028),('2028-09-02',202835,9,2028,2,35,202809,2028),('2028-09-03',202836,9,2028,3,36,202809,2028),('2028-09-04',202836,9,2028,4,36,202809,2028),('2028-09-05',202836,9,2028,5,36,202809,2028),('2028-09-06',202836,9,2028,6,36,202809,2028),('2028-09-07',202836,9,2028,7,36,202809,2028),('2028-09-08',202836,9,2028,8,36,202809,2028),('2028-09-09',202836,9,2028,9,36,202809,2028),('2028-09-10',202837,9,2028,10,37,202809,2028),('2028-09-11',202837,9,2028,11,37,202809,2028),('2028-09-12',202837,9,2028,12,37,202809,2028),('2028-09-13',202837,9,2028,13,37,202809,2028),('2028-09-14',202837,9,2028,14,37,202809,2028),('2028-09-15',202837,9,2028,15,37,202809,2028),('2028-09-16',202837,9,2028,16,37,202809,2028),('2028-09-17',202838,9,2028,17,38,202809,2028),('2028-09-18',202838,9,2028,18,38,202809,2028),('2028-09-19',202838,9,2028,19,38,202809,2028),('2028-09-20',202838,9,2028,20,38,202809,2028),('2028-09-21',202838,9,2028,21,38,202809,2028),('2028-09-22',202838,9,2028,22,38,202809,2028),('2028-09-23',202838,9,2028,23,38,202809,2028),('2028-09-24',202839,9,2028,24,39,202809,2028),('2028-09-25',202839,9,2028,25,39,202809,2028),('2028-09-26',202839,9,2028,26,39,202809,2028),('2028-09-27',202839,9,2028,27,39,202809,2028),('2028-09-28',202839,9,2028,28,39,202809,2028),('2028-09-29',202839,9,2028,29,39,202809,2028),('2028-09-30',202839,9,2028,30,39,202809,2028),('2028-10-01',202840,10,2028,1,40,202810,2028),('2028-10-02',202840,10,2028,2,40,202810,2028),('2028-10-03',202840,10,2028,3,40,202810,2028),('2028-10-04',202840,10,2028,4,40,202810,2028),('2028-10-05',202840,10,2028,5,40,202810,2028),('2028-10-06',202840,10,2028,6,40,202810,2028),('2028-10-07',202840,10,2028,7,40,202810,2028),('2028-10-08',202841,10,2028,8,41,202810,2028),('2028-10-09',202841,10,2028,9,41,202810,2028),('2028-10-10',202841,10,2028,10,41,202810,2028),('2028-10-11',202841,10,2028,11,41,202810,2028),('2028-10-12',202841,10,2028,12,41,202810,2028),('2028-10-13',202841,10,2028,13,41,202810,2028),('2028-10-14',202841,10,2028,14,41,202810,2028),('2028-10-15',202842,10,2028,15,42,202810,2028),('2028-10-16',202842,10,2028,16,42,202810,2028),('2028-10-17',202842,10,2028,17,42,202810,2028),('2028-10-18',202842,10,2028,18,42,202810,2028),('2028-10-19',202842,10,2028,19,42,202810,2028),('2028-10-20',202842,10,2028,20,42,202810,2028),('2028-10-21',202842,10,2028,21,42,202810,2028),('2028-10-22',202843,10,2028,22,43,202810,2028),('2028-10-23',202843,10,2028,23,43,202810,2028),('2028-10-24',202843,10,2028,24,43,202810,2028),('2028-10-25',202843,10,2028,25,43,202810,2028),('2028-10-26',202843,10,2028,26,43,202810,2028),('2028-10-27',202843,10,2028,27,43,202810,2028),('2028-10-28',202843,10,2028,28,43,202810,2028),('2028-10-29',202844,10,2028,29,44,202810,2028),('2028-10-30',202844,10,2028,30,44,202810,2028),('2028-10-31',202844,10,2028,31,44,202810,2028),('2028-11-01',202844,11,2028,1,44,202811,2028),('2028-11-02',202844,11,2028,2,44,202811,2028),('2028-11-03',202844,11,2028,3,44,202811,2028),('2028-11-04',202844,11,2028,4,44,202811,2028),('2028-11-05',202845,11,2028,5,45,202811,2028),('2028-11-06',202845,11,2028,6,45,202811,2028),('2028-11-07',202845,11,2028,7,45,202811,2028),('2028-11-08',202845,11,2028,8,45,202811,2028),('2028-11-09',202845,11,2028,9,45,202811,2028),('2028-11-10',202845,11,2028,10,45,202811,2028),('2028-11-11',202845,11,2028,11,45,202811,2028),('2028-11-12',202846,11,2028,12,46,202811,2028),('2028-11-13',202846,11,2028,13,46,202811,2028),('2028-11-14',202846,11,2028,14,46,202811,2028),('2028-11-15',202846,11,2028,15,46,202811,2028),('2028-11-16',202846,11,2028,16,46,202811,2028),('2028-11-17',202846,11,2028,17,46,202811,2028),('2028-11-18',202846,11,2028,18,46,202811,2028),('2028-11-19',202847,11,2028,19,47,202811,2028),('2028-11-20',202847,11,2028,20,47,202811,2028),('2028-11-21',202847,11,2028,21,47,202811,2028),('2028-11-22',202847,11,2028,22,47,202811,2028),('2028-11-23',202847,11,2028,23,47,202811,2028),('2028-11-24',202847,11,2028,24,47,202811,2028),('2028-11-25',202847,11,2028,25,47,202811,2028),('2028-11-26',202848,11,2028,26,48,202811,2028),('2028-11-27',202848,11,2028,27,48,202811,2028),('2028-11-28',202848,11,2028,28,48,202811,2028),('2028-11-29',202848,11,2028,29,48,202811,2028),('2028-11-30',202848,11,2028,30,48,202811,2028),('2028-12-01',202848,12,2028,1,48,202812,2029),('2028-12-02',202848,12,2028,2,48,202812,2029),('2028-12-03',202849,12,2028,3,49,202812,2029),('2028-12-04',202849,12,2028,4,49,202812,2029),('2028-12-05',202849,12,2028,5,49,202812,2029),('2028-12-06',202849,12,2028,6,49,202812,2029),('2028-12-07',202849,12,2028,7,49,202812,2029),('2028-12-08',202849,12,2028,8,49,202812,2029),('2028-12-09',202849,12,2028,9,49,202812,2029),('2028-12-10',202850,12,2028,10,50,202812,2029),('2028-12-11',202850,12,2028,11,50,202812,2029),('2028-12-12',202850,12,2028,12,50,202812,2029),('2028-12-13',202850,12,2028,13,50,202812,2029),('2028-12-14',202850,12,2028,14,50,202812,2029),('2028-12-15',202850,12,2028,15,50,202812,2029),('2028-12-16',202850,12,2028,16,50,202812,2029),('2028-12-17',202851,12,2028,17,51,202812,2029),('2028-12-18',202851,12,2028,18,51,202812,2029),('2028-12-19',202851,12,2028,19,51,202812,2029),('2028-12-20',202851,12,2028,20,51,202812,2029),('2028-12-21',202851,12,2028,21,51,202812,2029),('2028-12-22',202851,12,2028,22,51,202812,2029),('2028-12-23',202851,12,2028,23,51,202812,2029),('2028-12-24',202852,12,2028,24,52,202812,2029),('2028-12-25',202852,12,2028,25,52,202812,2029),('2028-12-26',202852,12,2028,26,52,202812,2029),('2028-12-27',202852,12,2028,27,52,202812,2029),('2028-12-28',202852,12,2028,28,52,202812,2029),('2028-12-29',202852,12,2028,29,52,202812,2029),('2028-12-30',202852,12,2028,30,52,202812,2029),('2028-12-31',202853,12,2028,31,1,202812,2029),('2029-01-01',202901,1,2029,1,1,202901,2029),('2029-01-02',202901,1,2029,2,1,202901,2029),('2029-01-03',202901,1,2029,3,1,202901,2029),('2029-01-04',202901,1,2029,4,1,202901,2029),('2029-01-05',202901,1,2029,5,1,202901,2029),('2029-01-06',202901,1,2029,6,1,202901,2029),('2029-01-07',202902,1,2029,7,2,202901,2029),('2029-01-08',202902,1,2029,8,2,202901,2029),('2029-01-09',202902,1,2029,9,2,202901,2029),('2029-01-10',202902,1,2029,10,2,202901,2029),('2029-01-11',202902,1,2029,11,2,202901,2029),('2029-01-12',202902,1,2029,12,2,202901,2029),('2029-01-13',202902,1,2029,13,2,202901,2029),('2029-01-14',202903,1,2029,14,3,202901,2029),('2029-01-15',202903,1,2029,15,3,202901,2029),('2029-01-16',202903,1,2029,16,3,202901,2029),('2029-01-17',202903,1,2029,17,3,202901,2029),('2029-01-18',202903,1,2029,18,3,202901,2029),('2029-01-19',202903,1,2029,19,3,202901,2029),('2029-01-20',202903,1,2029,20,3,202901,2029),('2029-01-21',202904,1,2029,21,4,202901,2029),('2029-01-22',202904,1,2029,22,4,202901,2029),('2029-01-23',202904,1,2029,23,4,202901,2029),('2029-01-24',202904,1,2029,24,4,202901,2029),('2029-01-25',202904,1,2029,25,4,202901,2029),('2029-01-26',202904,1,2029,26,4,202901,2029),('2029-01-27',202904,1,2029,27,4,202901,2029),('2029-01-28',202905,1,2029,28,5,202901,2029),('2029-01-29',202905,1,2029,29,5,202901,2029),('2029-01-30',202905,1,2029,30,5,202901,2029),('2029-01-31',202905,1,2029,31,5,202901,2029),('2029-02-01',202905,2,2029,1,5,202902,2029),('2029-02-02',202905,2,2029,2,5,202902,2029),('2029-02-03',202905,2,2029,3,5,202902,2029),('2029-02-04',202906,2,2029,4,6,202902,2029),('2029-02-05',202906,2,2029,5,6,202902,2029),('2029-02-06',202906,2,2029,6,6,202902,2029),('2029-02-07',202906,2,2029,7,6,202902,2029),('2029-02-08',202906,2,2029,8,6,202902,2029),('2029-02-09',202906,2,2029,9,6,202902,2029),('2029-02-10',202906,2,2029,10,6,202902,2029),('2029-02-11',202907,2,2029,11,7,202902,2029),('2029-02-12',202907,2,2029,12,7,202902,2029),('2029-02-13',202907,2,2029,13,7,202902,2029),('2029-02-14',202907,2,2029,14,7,202902,2029),('2029-02-15',202907,2,2029,15,7,202902,2029),('2029-02-16',202907,2,2029,16,7,202902,2029),('2029-02-17',202907,2,2029,17,7,202902,2029),('2029-02-18',202908,2,2029,18,8,202902,2029),('2029-02-19',202908,2,2029,19,8,202902,2029),('2029-02-20',202908,2,2029,20,8,202902,2029),('2029-02-21',202908,2,2029,21,8,202902,2029),('2029-02-22',202908,2,2029,22,8,202902,2029),('2029-02-23',202908,2,2029,23,8,202902,2029),('2029-02-24',202908,2,2029,24,8,202902,2029),('2029-02-25',202909,2,2029,25,9,202902,2029),('2029-02-26',202909,2,2029,26,9,202902,2029),('2029-02-27',202909,2,2029,27,9,202902,2029),('2029-02-28',202909,2,2029,28,9,202902,2029),('2029-03-01',202909,3,2029,1,9,202903,2029),('2029-03-02',202909,3,2029,2,9,202903,2029),('2029-03-03',202909,3,2029,3,9,202903,2029),('2029-03-04',202910,3,2029,4,10,202903,2029),('2029-03-05',202910,3,2029,5,10,202903,2029),('2029-03-06',202910,3,2029,6,10,202903,2029),('2029-03-07',202910,3,2029,7,10,202903,2029),('2029-03-08',202910,3,2029,8,10,202903,2029),('2029-03-09',202910,3,2029,9,10,202903,2029),('2029-03-10',202910,3,2029,10,10,202903,2029),('2029-03-11',202911,3,2029,11,11,202903,2029),('2029-03-12',202911,3,2029,12,11,202903,2029),('2029-03-13',202911,3,2029,13,11,202903,2029),('2029-03-14',202911,3,2029,14,11,202903,2029),('2029-03-15',202911,3,2029,15,11,202903,2029),('2029-03-16',202911,3,2029,16,11,202903,2029),('2029-03-17',202911,3,2029,17,11,202903,2029),('2029-03-18',202912,3,2029,18,12,202903,2029),('2029-03-19',202912,3,2029,19,12,202903,2029),('2029-03-20',202912,3,2029,20,12,202903,2029),('2029-03-21',202912,3,2029,21,12,202903,2029),('2029-03-22',202912,3,2029,22,12,202903,2029),('2029-03-23',202912,3,2029,23,12,202903,2029),('2029-03-24',202912,3,2029,24,12,202903,2029),('2029-03-25',202913,3,2029,25,13,202903,2029),('2029-03-26',202913,3,2029,26,13,202903,2029),('2029-03-27',202913,3,2029,27,13,202903,2029),('2029-03-28',202913,3,2029,28,13,202903,2029),('2029-03-29',202913,3,2029,29,13,202903,2029),('2029-03-30',202913,3,2029,30,13,202903,2029),('2029-03-31',202913,3,2029,31,13,202903,2029),('2029-04-01',202914,4,2029,1,14,202904,2029),('2029-04-02',202914,4,2029,2,14,202904,2029),('2029-04-03',202914,4,2029,3,14,202904,2029),('2029-04-04',202914,4,2029,4,14,202904,2029),('2029-04-05',202914,4,2029,5,14,202904,2029),('2029-04-06',202914,4,2029,6,14,202904,2029),('2029-04-07',202914,4,2029,7,14,202904,2029),('2029-04-08',202915,4,2029,8,15,202904,2029),('2029-04-09',202915,4,2029,9,15,202904,2029),('2029-04-10',202915,4,2029,10,15,202904,2029),('2029-04-11',202915,4,2029,11,15,202904,2029),('2029-04-12',202915,4,2029,12,15,202904,2029),('2029-04-13',202915,4,2029,13,15,202904,2029),('2029-04-14',202915,4,2029,14,15,202904,2029),('2029-04-15',202916,4,2029,15,16,202904,2029),('2029-04-16',202916,4,2029,16,16,202904,2029),('2029-04-17',202916,4,2029,17,16,202904,2029),('2029-04-18',202916,4,2029,18,16,202904,2029),('2029-04-19',202916,4,2029,19,16,202904,2029),('2029-04-20',202916,4,2029,20,16,202904,2029),('2029-04-21',202916,4,2029,21,16,202904,2029),('2029-04-22',202917,4,2029,22,17,202904,2029),('2029-04-23',202917,4,2029,23,17,202904,2029),('2029-04-24',202917,4,2029,24,17,202904,2029),('2029-04-25',202917,4,2029,25,17,202904,2029),('2029-04-26',202917,4,2029,26,17,202904,2029),('2029-04-27',202917,4,2029,27,17,202904,2029),('2029-04-28',202917,4,2029,28,17,202904,2029),('2029-04-29',202918,4,2029,29,18,202904,2029),('2029-04-30',202918,4,2029,30,18,202904,2029),('2029-05-01',202918,5,2029,1,18,202905,2029),('2029-05-02',202918,5,2029,2,18,202905,2029),('2029-05-03',202918,5,2029,3,18,202905,2029),('2029-05-04',202918,5,2029,4,18,202905,2029),('2029-05-05',202918,5,2029,5,18,202905,2029),('2029-05-06',202919,5,2029,6,19,202905,2029),('2029-05-07',202919,5,2029,7,19,202905,2029),('2029-05-08',202919,5,2029,8,19,202905,2029),('2029-05-09',202919,5,2029,9,19,202905,2029),('2029-05-10',202919,5,2029,10,19,202905,2029),('2029-05-11',202919,5,2029,11,19,202905,2029),('2029-05-12',202919,5,2029,12,19,202905,2029),('2029-05-13',202920,5,2029,13,20,202905,2029),('2029-05-14',202920,5,2029,14,20,202905,2029),('2029-05-15',202920,5,2029,15,20,202905,2029),('2029-05-16',202920,5,2029,16,20,202905,2029),('2029-05-17',202920,5,2029,17,20,202905,2029),('2029-05-18',202920,5,2029,18,20,202905,2029),('2029-05-19',202920,5,2029,19,20,202905,2029),('2029-05-20',202921,5,2029,20,21,202905,2029),('2029-05-21',202921,5,2029,21,21,202905,2029),('2029-05-22',202921,5,2029,22,21,202905,2029),('2029-05-23',202921,5,2029,23,21,202905,2029),('2029-05-24',202921,5,2029,24,21,202905,2029),('2029-05-25',202921,5,2029,25,21,202905,2029),('2029-05-26',202921,5,2029,26,21,202905,2029),('2029-05-27',202922,5,2029,27,22,202905,2029),('2029-05-28',202922,5,2029,28,22,202905,2029),('2029-05-29',202922,5,2029,29,22,202905,2029),('2029-05-30',202922,5,2029,30,22,202905,2029),('2029-05-31',202922,5,2029,31,22,202905,2029),('2029-06-01',202922,6,2029,1,22,202906,2029),('2029-06-02',202922,6,2029,2,22,202906,2029),('2029-06-03',202923,6,2029,3,23,202906,2029),('2029-06-04',202923,6,2029,4,23,202906,2029),('2029-06-05',202923,6,2029,5,23,202906,2029),('2029-06-06',202923,6,2029,6,23,202906,2029),('2029-06-07',202923,6,2029,7,23,202906,2029),('2029-06-08',202923,6,2029,8,23,202906,2029),('2029-06-09',202923,6,2029,9,23,202906,2029),('2029-06-10',202924,6,2029,10,24,202906,2029),('2029-06-11',202924,6,2029,11,24,202906,2029),('2029-06-12',202924,6,2029,12,24,202906,2029),('2029-06-13',202924,6,2029,13,24,202906,2029),('2029-06-14',202924,6,2029,14,24,202906,2029),('2029-06-15',202924,6,2029,15,24,202906,2029),('2029-06-16',202924,6,2029,16,24,202906,2029),('2029-06-17',202925,6,2029,17,25,202906,2029),('2029-06-18',202925,6,2029,18,25,202906,2029),('2029-06-19',202925,6,2029,19,25,202906,2029),('2029-06-20',202925,6,2029,20,25,202906,2029),('2029-06-21',202925,6,2029,21,25,202906,2029),('2029-06-22',202925,6,2029,22,25,202906,2029),('2029-06-23',202925,6,2029,23,25,202906,2029),('2029-06-24',202926,6,2029,24,26,202906,2029),('2029-06-25',202926,6,2029,25,26,202906,2029),('2029-06-26',202926,6,2029,26,26,202906,2029),('2029-06-27',202926,6,2029,27,26,202906,2029),('2029-06-28',202926,6,2029,28,26,202906,2029),('2029-06-29',202926,6,2029,29,26,202906,2029),('2029-06-30',202926,6,2029,30,26,202906,2029),('2029-07-01',202927,7,2029,1,27,202907,2029),('2029-07-02',202927,7,2029,2,27,202907,2029),('2029-07-03',202927,7,2029,3,27,202907,2029),('2029-07-04',202927,7,2029,4,27,202907,2029),('2029-07-05',202927,7,2029,5,27,202907,2029),('2029-07-06',202927,7,2029,6,27,202907,2029),('2029-07-07',202927,7,2029,7,27,202907,2029),('2029-07-08',202928,7,2029,8,28,202907,2029),('2029-07-09',202928,7,2029,9,28,202907,2029),('2029-07-10',202928,7,2029,10,28,202907,2029),('2029-07-11',202928,7,2029,11,28,202907,2029),('2029-07-12',202928,7,2029,12,28,202907,2029),('2029-07-13',202928,7,2029,13,28,202907,2029),('2029-07-14',202928,7,2029,14,28,202907,2029),('2029-07-15',202929,7,2029,15,29,202907,2029),('2029-07-16',202929,7,2029,16,29,202907,2029),('2029-07-17',202929,7,2029,17,29,202907,2029),('2029-07-18',202929,7,2029,18,29,202907,2029),('2029-07-19',202929,7,2029,19,29,202907,2029),('2029-07-20',202929,7,2029,20,29,202907,2029),('2029-07-21',202929,7,2029,21,29,202907,2029),('2029-07-22',202930,7,2029,22,30,202907,2029),('2029-07-23',202930,7,2029,23,30,202907,2029),('2029-07-24',202930,7,2029,24,30,202907,2029),('2029-07-25',202930,7,2029,25,30,202907,2029),('2029-07-26',202930,7,2029,26,30,202907,2029),('2029-07-27',202930,7,2029,27,30,202907,2029),('2029-07-28',202930,7,2029,28,30,202907,2029),('2029-07-29',202931,7,2029,29,31,202907,2029),('2029-07-30',202931,7,2029,30,31,202907,2029),('2029-07-31',202931,7,2029,31,31,202907,2029),('2029-08-01',202931,8,2029,1,31,202908,2029),('2029-08-02',202931,8,2029,2,31,202908,2029),('2029-08-03',202931,8,2029,3,31,202908,2029),('2029-08-04',202931,8,2029,4,31,202908,2029),('2029-08-05',202932,8,2029,5,32,202908,2029),('2029-08-06',202932,8,2029,6,32,202908,2029),('2029-08-07',202932,8,2029,7,32,202908,2029),('2029-08-08',202932,8,2029,8,32,202908,2029),('2029-08-09',202932,8,2029,9,32,202908,2029),('2029-08-10',202932,8,2029,10,32,202908,2029),('2029-08-11',202932,8,2029,11,32,202908,2029),('2029-08-12',202933,8,2029,12,33,202908,2029),('2029-08-13',202933,8,2029,13,33,202908,2029),('2029-08-14',202933,8,2029,14,33,202908,2029),('2029-08-15',202933,8,2029,15,33,202908,2029),('2029-08-16',202933,8,2029,16,33,202908,2029),('2029-08-17',202933,8,2029,17,33,202908,2029),('2029-08-18',202933,8,2029,18,33,202908,2029),('2029-08-19',202934,8,2029,19,34,202908,2029),('2029-08-20',202934,8,2029,20,34,202908,2029),('2029-08-21',202934,8,2029,21,34,202908,2029),('2029-08-22',202934,8,2029,22,34,202908,2029),('2029-08-23',202934,8,2029,23,34,202908,2029),('2029-08-24',202934,8,2029,24,34,202908,2029),('2029-08-25',202934,8,2029,25,34,202908,2029),('2029-08-26',202935,8,2029,26,35,202908,2029),('2029-08-27',202935,8,2029,27,35,202908,2029),('2029-08-28',202935,8,2029,28,35,202908,2029),('2029-08-29',202935,8,2029,29,35,202908,2029),('2029-08-30',202935,8,2029,30,35,202908,2029),('2029-08-31',202935,8,2029,31,35,202908,2029),('2029-09-01',202935,9,2029,1,35,202909,2029),('2029-09-02',202936,9,2029,2,36,202909,2029),('2029-09-03',202936,9,2029,3,36,202909,2029),('2029-09-04',202936,9,2029,4,36,202909,2029),('2029-09-05',202936,9,2029,5,36,202909,2029),('2029-09-06',202936,9,2029,6,36,202909,2029),('2029-09-07',202936,9,2029,7,36,202909,2029),('2029-09-08',202936,9,2029,8,36,202909,2029),('2029-09-09',202937,9,2029,9,37,202909,2029),('2029-09-10',202937,9,2029,10,37,202909,2029),('2029-09-11',202937,9,2029,11,37,202909,2029),('2029-09-12',202937,9,2029,12,37,202909,2029),('2029-09-13',202937,9,2029,13,37,202909,2029),('2029-09-14',202937,9,2029,14,37,202909,2029),('2029-09-15',202937,9,2029,15,37,202909,2029),('2029-09-16',202938,9,2029,16,38,202909,2029),('2029-09-17',202938,9,2029,17,38,202909,2029),('2029-09-18',202938,9,2029,18,38,202909,2029),('2029-09-19',202938,9,2029,19,38,202909,2029),('2029-09-20',202938,9,2029,20,38,202909,2029),('2029-09-21',202938,9,2029,21,38,202909,2029),('2029-09-22',202938,9,2029,22,38,202909,2029),('2029-09-23',202939,9,2029,23,39,202909,2029),('2029-09-24',202939,9,2029,24,39,202909,2029),('2029-09-25',202939,9,2029,25,39,202909,2029),('2029-09-26',202939,9,2029,26,39,202909,2029),('2029-09-27',202939,9,2029,27,39,202909,2029),('2029-09-28',202939,9,2029,28,39,202909,2029),('2029-09-29',202939,9,2029,29,39,202909,2029),('2029-09-30',202940,9,2029,30,40,202909,2029),('2029-10-01',202940,10,2029,1,40,202910,2029),('2029-10-02',202940,10,2029,2,40,202910,2029),('2029-10-03',202940,10,2029,3,40,202910,2029),('2029-10-04',202940,10,2029,4,40,202910,2029),('2029-10-05',202940,10,2029,5,40,202910,2029),('2029-10-06',202940,10,2029,6,40,202910,2029),('2029-10-07',202941,10,2029,7,41,202910,2029),('2029-10-08',202941,10,2029,8,41,202910,2029),('2029-10-09',202941,10,2029,9,41,202910,2029),('2029-10-10',202941,10,2029,10,41,202910,2029),('2029-10-11',202941,10,2029,11,41,202910,2029),('2029-10-12',202941,10,2029,12,41,202910,2029),('2029-10-13',202941,10,2029,13,41,202910,2029),('2029-10-14',202942,10,2029,14,42,202910,2029),('2029-10-15',202942,10,2029,15,42,202910,2029),('2029-10-16',202942,10,2029,16,42,202910,2029),('2029-10-17',202942,10,2029,17,42,202910,2029),('2029-10-18',202942,10,2029,18,42,202910,2029),('2029-10-19',202942,10,2029,19,42,202910,2029),('2029-10-20',202942,10,2029,20,42,202910,2029),('2029-10-21',202943,10,2029,21,43,202910,2029),('2029-10-22',202943,10,2029,22,43,202910,2029),('2029-10-23',202943,10,2029,23,43,202910,2029),('2029-10-24',202943,10,2029,24,43,202910,2029),('2029-10-25',202943,10,2029,25,43,202910,2029),('2029-10-26',202943,10,2029,26,43,202910,2029),('2029-10-27',202943,10,2029,27,43,202910,2029),('2029-10-28',202944,10,2029,28,44,202910,2029),('2029-10-29',202944,10,2029,29,44,202910,2029),('2029-10-30',202944,10,2029,30,44,202910,2029),('2029-10-31',202944,10,2029,31,44,202910,2029),('2029-11-01',202944,11,2029,1,44,202911,2029),('2029-11-02',202944,11,2029,2,44,202911,2029),('2029-11-03',202944,11,2029,3,44,202911,2029),('2029-11-04',202945,11,2029,4,45,202911,2029),('2029-11-05',202945,11,2029,5,45,202911,2029),('2029-11-06',202945,11,2029,6,45,202911,2029),('2029-11-07',202945,11,2029,7,45,202911,2029),('2029-11-08',202945,11,2029,8,45,202911,2029),('2029-11-09',202945,11,2029,9,45,202911,2029),('2029-11-10',202945,11,2029,10,45,202911,2029),('2029-11-11',202946,11,2029,11,46,202911,2029),('2029-11-12',202946,11,2029,12,46,202911,2029),('2029-11-13',202946,11,2029,13,46,202911,2029),('2029-11-14',202946,11,2029,14,46,202911,2029),('2029-11-15',202946,11,2029,15,46,202911,2029),('2029-11-16',202946,11,2029,16,46,202911,2029),('2029-11-17',202946,11,2029,17,46,202911,2029),('2029-11-18',202947,11,2029,18,47,202911,2029),('2029-11-19',202947,11,2029,19,47,202911,2029),('2029-11-20',202947,11,2029,20,47,202911,2029),('2029-11-21',202947,11,2029,21,47,202911,2029),('2029-11-22',202947,11,2029,22,47,202911,2029),('2029-11-23',202947,11,2029,23,47,202911,2029),('2029-11-24',202947,11,2029,24,47,202911,2029),('2029-11-25',202948,11,2029,25,48,202911,2029),('2029-11-26',202948,11,2029,26,48,202911,2029),('2029-11-27',202948,11,2029,27,48,202911,2029),('2029-11-28',202948,11,2029,28,48,202911,2029),('2029-11-29',202948,11,2029,29,48,202911,2029),('2029-11-30',202948,11,2029,30,48,202911,2029),('2029-12-01',202948,12,2029,1,48,202912,2030),('2029-12-02',202949,12,2029,2,49,202912,2030),('2029-12-03',202949,12,2029,3,49,202912,2030),('2029-12-04',202949,12,2029,4,49,202912,2030),('2029-12-05',202949,12,2029,5,49,202912,2030),('2029-12-06',202949,12,2029,6,49,202912,2030),('2029-12-07',202949,12,2029,7,49,202912,2030),('2029-12-08',202949,12,2029,8,49,202912,2030),('2029-12-09',202950,12,2029,9,50,202912,2030),('2029-12-10',202950,12,2029,10,50,202912,2030),('2029-12-11',202950,12,2029,11,50,202912,2030),('2029-12-12',202950,12,2029,12,50,202912,2030),('2029-12-13',202950,12,2029,13,50,202912,2030),('2029-12-14',202950,12,2029,14,50,202912,2030),('2029-12-15',202950,12,2029,15,50,202912,2030),('2029-12-16',202951,12,2029,16,51,202912,2030),('2029-12-17',202951,12,2029,17,51,202912,2030),('2029-12-18',202951,12,2029,18,51,202912,2030),('2029-12-19',202951,12,2029,19,51,202912,2030),('2029-12-20',202951,12,2029,20,51,202912,2030),('2029-12-21',202951,12,2029,21,51,202912,2030),('2029-12-22',202951,12,2029,22,51,202912,2030),('2029-12-23',202952,12,2029,23,52,202912,2030),('2029-12-24',202952,12,2029,24,52,202912,2030),('2029-12-25',202952,12,2029,25,52,202912,2030),('2029-12-26',202952,12,2029,26,52,202912,2030),('2029-12-27',202952,12,2029,27,52,202912,2030),('2029-12-28',202952,12,2029,28,52,202912,2030),('2029-12-29',202952,12,2029,29,52,202912,2030),('2029-12-30',202953,12,2029,30,1,202912,2030),('2029-12-31',202901,12,2029,31,1,202912,2030),('2030-01-01',203001,1,2030,1,1,203001,2030),('2030-01-02',203001,1,2030,2,1,203001,2030),('2030-01-03',203001,1,2030,3,1,203001,2030),('2030-01-04',203001,1,2030,4,1,203001,2030),('2030-01-05',203001,1,2030,5,1,203001,2030),('2030-01-06',203002,1,2030,6,2,203001,2030),('2030-01-07',203002,1,2030,7,2,203001,2030),('2030-01-08',203002,1,2030,8,2,203001,2030),('2030-01-09',203002,1,2030,9,2,203001,2030),('2030-01-10',203002,1,2030,10,2,203001,2030),('2030-01-11',203002,1,2030,11,2,203001,2030),('2030-01-12',203002,1,2030,12,2,203001,2030),('2030-01-13',203003,1,2030,13,3,203001,2030),('2030-01-14',203003,1,2030,14,3,203001,2030),('2030-01-15',203003,1,2030,15,3,203001,2030),('2030-01-16',203003,1,2030,16,3,203001,2030),('2030-01-17',203003,1,2030,17,3,203001,2030),('2030-01-18',203003,1,2030,18,3,203001,2030),('2030-01-19',203003,1,2030,19,3,203001,2030),('2030-01-20',203004,1,2030,20,4,203001,2030),('2030-01-21',203004,1,2030,21,4,203001,2030),('2030-01-22',203004,1,2030,22,4,203001,2030),('2030-01-23',203004,1,2030,23,4,203001,2030),('2030-01-24',203004,1,2030,24,4,203001,2030),('2030-01-25',203004,1,2030,25,4,203001,2030),('2030-01-26',203004,1,2030,26,4,203001,2030),('2030-01-27',203005,1,2030,27,5,203001,2030),('2030-01-28',203005,1,2030,28,5,203001,2030),('2030-01-29',203005,1,2030,29,5,203001,2030),('2030-01-30',203005,1,2030,30,5,203001,2030),('2030-01-31',203005,1,2030,31,5,203001,2030),('2030-02-01',203005,2,2030,1,5,203002,2030),('2030-02-02',203005,2,2030,2,5,203002,2030),('2030-02-03',203006,2,2030,3,6,203002,2030),('2030-02-04',203006,2,2030,4,6,203002,2030),('2030-02-05',203006,2,2030,5,6,203002,2030),('2030-02-06',203006,2,2030,6,6,203002,2030),('2030-02-07',203006,2,2030,7,6,203002,2030),('2030-02-08',203006,2,2030,8,6,203002,2030),('2030-02-09',203006,2,2030,9,6,203002,2030),('2030-02-10',203007,2,2030,10,7,203002,2030),('2030-02-11',203007,2,2030,11,7,203002,2030),('2030-02-12',203007,2,2030,12,7,203002,2030),('2030-02-13',203007,2,2030,13,7,203002,2030),('2030-02-14',203007,2,2030,14,7,203002,2030),('2030-02-15',203007,2,2030,15,7,203002,2030),('2030-02-16',203007,2,2030,16,7,203002,2030),('2030-02-17',203008,2,2030,17,8,203002,2030),('2030-02-18',203008,2,2030,18,8,203002,2030),('2030-02-19',203008,2,2030,19,8,203002,2030),('2030-02-20',203008,2,2030,20,8,203002,2030),('2030-02-21',203008,2,2030,21,8,203002,2030),('2030-02-22',203008,2,2030,22,8,203002,2030),('2030-02-23',203008,2,2030,23,8,203002,2030),('2030-02-24',203009,2,2030,24,9,203002,2030),('2030-02-25',203009,2,2030,25,9,203002,2030),('2030-02-26',203009,2,2030,26,9,203002,2030),('2030-02-27',203009,2,2030,27,9,203002,2030),('2030-02-28',203009,2,2030,28,9,203002,2030),('2030-03-01',203009,3,2030,1,9,203003,2030),('2030-03-02',203009,3,2030,2,9,203003,2030),('2030-03-03',203010,3,2030,3,10,203003,2030),('2030-03-04',203010,3,2030,4,10,203003,2030),('2030-03-05',203010,3,2030,5,10,203003,2030),('2030-03-06',203010,3,2030,6,10,203003,2030),('2030-03-07',203010,3,2030,7,10,203003,2030),('2030-03-08',203010,3,2030,8,10,203003,2030),('2030-03-09',203010,3,2030,9,10,203003,2030),('2030-03-10',203011,3,2030,10,11,203003,2030),('2030-03-11',203011,3,2030,11,11,203003,2030),('2030-03-12',203011,3,2030,12,11,203003,2030),('2030-03-13',203011,3,2030,13,11,203003,2030),('2030-03-14',203011,3,2030,14,11,203003,2030),('2030-03-15',203011,3,2030,15,11,203003,2030),('2030-03-16',203011,3,2030,16,11,203003,2030),('2030-03-17',203012,3,2030,17,12,203003,2030),('2030-03-18',203012,3,2030,18,12,203003,2030),('2030-03-19',203012,3,2030,19,12,203003,2030),('2030-03-20',203012,3,2030,20,12,203003,2030),('2030-03-21',203012,3,2030,21,12,203003,2030),('2030-03-22',203012,3,2030,22,12,203003,2030),('2030-03-23',203012,3,2030,23,12,203003,2030),('2030-03-24',203013,3,2030,24,13,203003,2030),('2030-03-25',203013,3,2030,25,13,203003,2030),('2030-03-26',203013,3,2030,26,13,203003,2030),('2030-03-27',203013,3,2030,27,13,203003,2030),('2030-03-28',203013,3,2030,28,13,203003,2030),('2030-03-29',203013,3,2030,29,13,203003,2030),('2030-03-30',203013,3,2030,30,13,203003,2030),('2030-03-31',203014,3,2030,31,14,203003,2030),('2030-04-01',203014,4,2030,1,14,203004,2030),('2030-04-02',203014,4,2030,2,14,203004,2030),('2030-04-03',203014,4,2030,3,14,203004,2030),('2030-04-04',203014,4,2030,4,14,203004,2030),('2030-04-05',203014,4,2030,5,14,203004,2030),('2030-04-06',203014,4,2030,6,14,203004,2030),('2030-04-07',203015,4,2030,7,15,203004,2030),('2030-04-08',203015,4,2030,8,15,203004,2030),('2030-04-09',203015,4,2030,9,15,203004,2030),('2030-04-10',203015,4,2030,10,15,203004,2030),('2030-04-11',203015,4,2030,11,15,203004,2030),('2030-04-12',203015,4,2030,12,15,203004,2030),('2030-04-13',203015,4,2030,13,15,203004,2030),('2030-04-14',203016,4,2030,14,16,203004,2030),('2030-04-15',203016,4,2030,15,16,203004,2030),('2030-04-16',203016,4,2030,16,16,203004,2030),('2030-04-17',203016,4,2030,17,16,203004,2030),('2030-04-18',203016,4,2030,18,16,203004,2030),('2030-04-19',203016,4,2030,19,16,203004,2030),('2030-04-20',203016,4,2030,20,16,203004,2030),('2030-04-21',203017,4,2030,21,17,203004,2030),('2030-04-22',203017,4,2030,22,17,203004,2030),('2030-04-23',203017,4,2030,23,17,203004,2030),('2030-04-24',203017,4,2030,24,17,203004,2030),('2030-04-25',203017,4,2030,25,17,203004,2030),('2030-04-26',203017,4,2030,26,17,203004,2030),('2030-04-27',203017,4,2030,27,17,203004,2030),('2030-04-28',203018,4,2030,28,18,203004,2030),('2030-04-29',203018,4,2030,29,18,203004,2030),('2030-04-30',203018,4,2030,30,18,203004,2030),('2030-05-01',203018,5,2030,1,18,203005,2030),('2030-05-02',203018,5,2030,2,18,203005,2030),('2030-05-03',203018,5,2030,3,18,203005,2030),('2030-05-04',203018,5,2030,4,18,203005,2030),('2030-05-05',203019,5,2030,5,19,203005,2030),('2030-05-06',203019,5,2030,6,19,203005,2030),('2030-05-07',203019,5,2030,7,19,203005,2030),('2030-05-08',203019,5,2030,8,19,203005,2030),('2030-05-09',203019,5,2030,9,19,203005,2030),('2030-05-10',203019,5,2030,10,19,203005,2030),('2030-05-11',203019,5,2030,11,19,203005,2030),('2030-05-12',203020,5,2030,12,20,203005,2030),('2030-05-13',203020,5,2030,13,20,203005,2030),('2030-05-14',203020,5,2030,14,20,203005,2030),('2030-05-15',203020,5,2030,15,20,203005,2030),('2030-05-16',203020,5,2030,16,20,203005,2030),('2030-05-17',203020,5,2030,17,20,203005,2030),('2030-05-18',203020,5,2030,18,20,203005,2030),('2030-05-19',203021,5,2030,19,21,203005,2030),('2030-05-20',203021,5,2030,20,21,203005,2030),('2030-05-21',203021,5,2030,21,21,203005,2030),('2030-05-22',203021,5,2030,22,21,203005,2030),('2030-05-23',203021,5,2030,23,21,203005,2030),('2030-05-24',203021,5,2030,24,21,203005,2030),('2030-05-25',203021,5,2030,25,21,203005,2030),('2030-05-26',203022,5,2030,26,22,203005,2030),('2030-05-27',203022,5,2030,27,22,203005,2030),('2030-05-28',203022,5,2030,28,22,203005,2030),('2030-05-29',203022,5,2030,29,22,203005,2030),('2030-05-30',203022,5,2030,30,22,203005,2030),('2030-05-31',203022,5,2030,31,22,203005,2030),('2030-06-01',203022,6,2030,1,22,203006,2030),('2030-06-02',203023,6,2030,2,23,203006,2030),('2030-06-03',203023,6,2030,3,23,203006,2030),('2030-06-04',203023,6,2030,4,23,203006,2030),('2030-06-05',203023,6,2030,5,23,203006,2030),('2030-06-06',203023,6,2030,6,23,203006,2030),('2030-06-07',203023,6,2030,7,23,203006,2030),('2030-06-08',203023,6,2030,8,23,203006,2030),('2030-06-09',203024,6,2030,9,24,203006,2030),('2030-06-10',203024,6,2030,10,24,203006,2030),('2030-06-11',203024,6,2030,11,24,203006,2030),('2030-06-12',203024,6,2030,12,24,203006,2030),('2030-06-13',203024,6,2030,13,24,203006,2030),('2030-06-14',203024,6,2030,14,24,203006,2030),('2030-06-15',203024,6,2030,15,24,203006,2030),('2030-06-16',203025,6,2030,16,25,203006,2030),('2030-06-17',203025,6,2030,17,25,203006,2030),('2030-06-18',203025,6,2030,18,25,203006,2030),('2030-06-19',203025,6,2030,19,25,203006,2030),('2030-06-20',203025,6,2030,20,25,203006,2030),('2030-06-21',203025,6,2030,21,25,203006,2030),('2030-06-22',203025,6,2030,22,25,203006,2030),('2030-06-23',203026,6,2030,23,26,203006,2030),('2030-06-24',203026,6,2030,24,26,203006,2030),('2030-06-25',203026,6,2030,25,26,203006,2030),('2030-06-26',203026,6,2030,26,26,203006,2030),('2030-06-27',203026,6,2030,27,26,203006,2030),('2030-06-28',203026,6,2030,28,26,203006,2030),('2030-06-29',203026,6,2030,29,26,203006,2030),('2030-06-30',203027,6,2030,30,27,203006,2030),('2030-07-01',203027,7,2030,1,27,203007,2030),('2030-07-02',203027,7,2030,2,27,203007,2030),('2030-07-03',203027,7,2030,3,27,203007,2030),('2030-07-04',203027,7,2030,4,27,203007,2030),('2030-07-05',203027,7,2030,5,27,203007,2030),('2030-07-06',203027,7,2030,6,27,203007,2030),('2030-07-07',203028,7,2030,7,28,203007,2030),('2030-07-08',203028,7,2030,8,28,203007,2030),('2030-07-09',203028,7,2030,9,28,203007,2030),('2030-07-10',203028,7,2030,10,28,203007,2030),('2030-07-11',203028,7,2030,11,28,203007,2030),('2030-07-12',203028,7,2030,12,28,203007,2030),('2030-07-13',203028,7,2030,13,28,203007,2030),('2030-07-14',203029,7,2030,14,29,203007,2030),('2030-07-15',203029,7,2030,15,29,203007,2030),('2030-07-16',203029,7,2030,16,29,203007,2030),('2030-07-17',203029,7,2030,17,29,203007,2030),('2030-07-18',203029,7,2030,18,29,203007,2030),('2030-07-19',203029,7,2030,19,29,203007,2030),('2030-07-20',203029,7,2030,20,29,203007,2030),('2030-07-21',203030,7,2030,21,30,203007,2030),('2030-07-22',203030,7,2030,22,30,203007,2030),('2030-07-23',203030,7,2030,23,30,203007,2030),('2030-07-24',203030,7,2030,24,30,203007,2030),('2030-07-25',203030,7,2030,25,30,203007,2030),('2030-07-26',203030,7,2030,26,30,203007,2030),('2030-07-27',203030,7,2030,27,30,203007,2030),('2030-07-28',203031,7,2030,28,31,203007,2030),('2030-07-29',203031,7,2030,29,31,203007,2030),('2030-07-30',203031,7,2030,30,31,203007,2030),('2030-07-31',203031,7,2030,31,31,203007,2030),('2030-08-01',203031,8,2030,1,31,203008,2030),('2030-08-02',203031,8,2030,2,31,203008,2030),('2030-08-03',203031,8,2030,3,31,203008,2030),('2030-08-04',203032,8,2030,4,32,203008,2030),('2030-08-05',203032,8,2030,5,32,203008,2030),('2030-08-06',203032,8,2030,6,32,203008,2030),('2030-08-07',203032,8,2030,7,32,203008,2030),('2030-08-08',203032,8,2030,8,32,203008,2030),('2030-08-09',203032,8,2030,9,32,203008,2030),('2030-08-10',203032,8,2030,10,32,203008,2030),('2030-08-11',203033,8,2030,11,33,203008,2030),('2030-08-12',203033,8,2030,12,33,203008,2030),('2030-08-13',203033,8,2030,13,33,203008,2030),('2030-08-14',203033,8,2030,14,33,203008,2030),('2030-08-15',203033,8,2030,15,33,203008,2030),('2030-08-16',203033,8,2030,16,33,203008,2030),('2030-08-17',203033,8,2030,17,33,203008,2030),('2030-08-18',203034,8,2030,18,34,203008,2030),('2030-08-19',203034,8,2030,19,34,203008,2030),('2030-08-20',203034,8,2030,20,34,203008,2030),('2030-08-21',203034,8,2030,21,34,203008,2030),('2030-08-22',203034,8,2030,22,34,203008,2030),('2030-08-23',203034,8,2030,23,34,203008,2030),('2030-08-24',203034,8,2030,24,34,203008,2030),('2030-08-25',203035,8,2030,25,35,203008,2030),('2030-08-26',203035,8,2030,26,35,203008,2030),('2030-08-27',203035,8,2030,27,35,203008,2030),('2030-08-28',203035,8,2030,28,35,203008,2030),('2030-08-29',203035,8,2030,29,35,203008,2030),('2030-08-30',203035,8,2030,30,35,203008,2030),('2030-08-31',203035,8,2030,31,35,203008,2030),('2030-09-01',203036,9,2030,1,36,203009,2030),('2030-09-02',203036,9,2030,2,36,203009,2030),('2030-09-03',203036,9,2030,3,36,203009,2030),('2030-09-04',203036,9,2030,4,36,203009,2030),('2030-09-05',203036,9,2030,5,36,203009,2030),('2030-09-06',203036,9,2030,6,36,203009,2030),('2030-09-07',203036,9,2030,7,36,203009,2030),('2030-09-08',203037,9,2030,8,37,203009,2030),('2030-09-09',203037,9,2030,9,37,203009,2030),('2030-09-10',203037,9,2030,10,37,203009,2030),('2030-09-11',203037,9,2030,11,37,203009,2030),('2030-09-12',203037,9,2030,12,37,203009,2030),('2030-09-13',203037,9,2030,13,37,203009,2030),('2030-09-14',203037,9,2030,14,37,203009,2030),('2030-09-15',203038,9,2030,15,38,203009,2030),('2030-09-16',203038,9,2030,16,38,203009,2030),('2030-09-17',203038,9,2030,17,38,203009,2030),('2030-09-18',203038,9,2030,18,38,203009,2030),('2030-09-19',203038,9,2030,19,38,203009,2030),('2030-09-20',203038,9,2030,20,38,203009,2030),('2030-09-21',203038,9,2030,21,38,203009,2030),('2030-09-22',203039,9,2030,22,39,203009,2030),('2030-09-23',203039,9,2030,23,39,203009,2030),('2030-09-24',203039,9,2030,24,39,203009,2030),('2030-09-25',203039,9,2030,25,39,203009,2030),('2030-09-26',203039,9,2030,26,39,203009,2030),('2030-09-27',203039,9,2030,27,39,203009,2030),('2030-09-28',203039,9,2030,28,39,203009,2030),('2030-09-29',203040,9,2030,29,40,203009,2030),('2030-09-30',203040,9,2030,30,40,203009,2030),('2030-10-01',203040,10,2030,1,40,203010,2030),('2030-10-02',203040,10,2030,2,40,203010,2030),('2030-10-03',203040,10,2030,3,40,203010,2030),('2030-10-04',203040,10,2030,4,40,203010,2030),('2030-10-05',203040,10,2030,5,40,203010,2030),('2030-10-06',203041,10,2030,6,41,203010,2030),('2030-10-07',203041,10,2030,7,41,203010,2030),('2030-10-08',203041,10,2030,8,41,203010,2030),('2030-10-09',203041,10,2030,9,41,203010,2030),('2030-10-10',203041,10,2030,10,41,203010,2030),('2030-10-11',203041,10,2030,11,41,203010,2030),('2030-10-12',203041,10,2030,12,41,203010,2030),('2030-10-13',203042,10,2030,13,42,203010,2030),('2030-10-14',203042,10,2030,14,42,203010,2030),('2030-10-15',203042,10,2030,15,42,203010,2030),('2030-10-16',203042,10,2030,16,42,203010,2030),('2030-10-17',203042,10,2030,17,42,203010,2030),('2030-10-18',203042,10,2030,18,42,203010,2030),('2030-10-19',203042,10,2030,19,42,203010,2030),('2030-10-20',203043,10,2030,20,43,203010,2030),('2030-10-21',203043,10,2030,21,43,203010,2030),('2030-10-22',203043,10,2030,22,43,203010,2030),('2030-10-23',203043,10,2030,23,43,203010,2030),('2030-10-24',203043,10,2030,24,43,203010,2030),('2030-10-25',203043,10,2030,25,43,203010,2030),('2030-10-26',203043,10,2030,26,43,203010,2030),('2030-10-27',203044,10,2030,27,44,203010,2030),('2030-10-28',203044,10,2030,28,44,203010,2030),('2030-10-29',203044,10,2030,29,44,203010,2030),('2030-10-30',203044,10,2030,30,44,203010,2030),('2030-10-31',203044,10,2030,31,44,203010,2030),('2030-11-01',203044,11,2030,1,44,203011,2030),('2030-11-02',203044,11,2030,2,44,203011,2030),('2030-11-03',203045,11,2030,3,45,203011,2030),('2030-11-04',203045,11,2030,4,45,203011,2030),('2030-11-05',203045,11,2030,5,45,203011,2030),('2030-11-06',203045,11,2030,6,45,203011,2030),('2030-11-07',203045,11,2030,7,45,203011,2030),('2030-11-08',203045,11,2030,8,45,203011,2030),('2030-11-09',203045,11,2030,9,45,203011,2030),('2030-11-10',203046,11,2030,10,46,203011,2030),('2030-11-11',203046,11,2030,11,46,203011,2030),('2030-11-12',203046,11,2030,12,46,203011,2030),('2030-11-13',203046,11,2030,13,46,203011,2030),('2030-11-14',203046,11,2030,14,46,203011,2030),('2030-11-15',203046,11,2030,15,46,203011,2030),('2030-11-16',203046,11,2030,16,46,203011,2030),('2030-11-17',203047,11,2030,17,47,203011,2030),('2030-11-18',203047,11,2030,18,47,203011,2030),('2030-11-19',203047,11,2030,19,47,203011,2030),('2030-11-20',203047,11,2030,20,47,203011,2030),('2030-11-21',203047,11,2030,21,47,203011,2030),('2030-11-22',203047,11,2030,22,47,203011,2030),('2030-11-23',203047,11,2030,23,47,203011,2030),('2030-11-24',203048,11,2030,24,48,203011,2030),('2030-11-25',203048,11,2030,25,48,203011,2030),('2030-11-26',203048,11,2030,26,48,203011,2030),('2030-11-27',203048,11,2030,27,48,203011,2030),('2030-11-28',203048,11,2030,28,48,203011,2030),('2030-11-29',203048,11,2030,29,48,203011,2030),('2030-11-30',203048,11,2030,30,48,203011,2030),('2030-12-01',203049,12,2030,1,49,203012,2031),('2030-12-02',203049,12,2030,2,49,203012,2031),('2030-12-03',203049,12,2030,3,49,203012,2031),('2030-12-04',203049,12,2030,4,49,203012,2031),('2030-12-05',203049,12,2030,5,49,203012,2031),('2030-12-06',203049,12,2030,6,49,203012,2031),('2030-12-07',203049,12,2030,7,49,203012,2031),('2030-12-08',203050,12,2030,8,50,203012,2031),('2030-12-09',203050,12,2030,9,50,203012,2031),('2030-12-10',203050,12,2030,10,50,203012,2031),('2030-12-11',203050,12,2030,11,50,203012,2031),('2030-12-12',203050,12,2030,12,50,203012,2031),('2030-12-13',203050,12,2030,13,50,203012,2031),('2030-12-14',203050,12,2030,14,50,203012,2031),('2030-12-15',203051,12,2030,15,51,203012,2031),('2030-12-16',203051,12,2030,16,51,203012,2031),('2030-12-17',203051,12,2030,17,51,203012,2031),('2030-12-18',203051,12,2030,18,51,203012,2031),('2030-12-19',203051,12,2030,19,51,203012,2031),('2030-12-20',203051,12,2030,20,51,203012,2031),('2030-12-21',203051,12,2030,21,51,203012,2031),('2030-12-22',203052,12,2030,22,52,203012,2031),('2030-12-23',203052,12,2030,23,52,203012,2031),('2030-12-24',203052,12,2030,24,52,203012,2031),('2030-12-25',203052,12,2030,25,52,203012,2031),('2030-12-26',203052,12,2030,26,52,203012,2031),('2030-12-27',203052,12,2030,27,52,203012,2031),('2030-12-28',203052,12,2030,28,52,203012,2031),('2030-12-29',203053,12,2030,29,1,203012,2031),('2030-12-30',203001,12,2030,30,1,203012,2031),('2030-12-31',203001,12,2030,31,1,203012,2031),('2031-01-01',203101,1,2031,1,1,203101,2031),('2031-01-02',203101,1,2031,2,1,203101,2031),('2031-01-03',203101,1,2031,3,1,203101,2031),('2031-01-04',203101,1,2031,4,1,203101,2031),('2031-01-05',203102,1,2031,5,2,203101,2031),('2031-01-06',203102,1,2031,6,2,203101,2031),('2031-01-07',203102,1,2031,7,2,203101,2031),('2031-01-08',203102,1,2031,8,2,203101,2031),('2031-01-09',203102,1,2031,9,2,203101,2031),('2031-01-10',203102,1,2031,10,2,203101,2031),('2031-01-11',203102,1,2031,11,2,203101,2031),('2031-01-12',203103,1,2031,12,3,203101,2031),('2031-01-13',203103,1,2031,13,3,203101,2031),('2031-01-14',203103,1,2031,14,3,203101,2031),('2031-01-15',203103,1,2031,15,3,203101,2031),('2031-01-16',203103,1,2031,16,3,203101,2031),('2031-01-17',203103,1,2031,17,3,203101,2031),('2031-01-18',203103,1,2031,18,3,203101,2031),('2031-01-19',203104,1,2031,19,4,203101,2031),('2031-01-20',203104,1,2031,20,4,203101,2031),('2031-01-21',203104,1,2031,21,4,203101,2031),('2031-01-22',203104,1,2031,22,4,203101,2031),('2031-01-23',203104,1,2031,23,4,203101,2031),('2031-01-24',203104,1,2031,24,4,203101,2031),('2031-01-25',203104,1,2031,25,4,203101,2031),('2031-01-26',203105,1,2031,26,5,203101,2031),('2031-01-27',203105,1,2031,27,5,203101,2031),('2031-01-28',203105,1,2031,28,5,203101,2031),('2031-01-29',203105,1,2031,29,5,203101,2031),('2031-01-30',203105,1,2031,30,5,203101,2031),('2031-01-31',203105,1,2031,31,5,203101,2031),('2031-02-01',203105,2,2031,1,5,203102,2031),('2031-02-02',203106,2,2031,2,6,203102,2031),('2031-02-03',203106,2,2031,3,6,203102,2031),('2031-02-04',203106,2,2031,4,6,203102,2031),('2031-02-05',203106,2,2031,5,6,203102,2031),('2031-02-06',203106,2,2031,6,6,203102,2031),('2031-02-07',203106,2,2031,7,6,203102,2031),('2031-02-08',203106,2,2031,8,6,203102,2031),('2031-02-09',203107,2,2031,9,7,203102,2031),('2031-02-10',203107,2,2031,10,7,203102,2031),('2031-02-11',203107,2,2031,11,7,203102,2031),('2031-02-12',203107,2,2031,12,7,203102,2031),('2031-02-13',203107,2,2031,13,7,203102,2031),('2031-02-14',203107,2,2031,14,7,203102,2031),('2031-02-15',203107,2,2031,15,7,203102,2031),('2031-02-16',203108,2,2031,16,8,203102,2031),('2031-02-17',203108,2,2031,17,8,203102,2031),('2031-02-18',203108,2,2031,18,8,203102,2031),('2031-02-19',203108,2,2031,19,8,203102,2031),('2031-02-20',203108,2,2031,20,8,203102,2031),('2031-02-21',203108,2,2031,21,8,203102,2031),('2031-02-22',203108,2,2031,22,8,203102,2031),('2031-02-23',203109,2,2031,23,9,203102,2031),('2031-02-24',203109,2,2031,24,9,203102,2031),('2031-02-25',203109,2,2031,25,9,203102,2031),('2031-02-26',203109,2,2031,26,9,203102,2031),('2031-02-27',203109,2,2031,27,9,203102,2031),('2031-02-28',203109,2,2031,28,9,203102,2031),('2031-03-01',203109,3,2031,1,9,203103,2031),('2031-03-02',203110,3,2031,2,10,203103,2031),('2031-03-03',203110,3,2031,3,10,203103,2031),('2031-03-04',203110,3,2031,4,10,203103,2031),('2031-03-05',203110,3,2031,5,10,203103,2031),('2031-03-06',203110,3,2031,6,10,203103,2031),('2031-03-07',203110,3,2031,7,10,203103,2031),('2031-03-08',203110,3,2031,8,10,203103,2031),('2031-03-09',203111,3,2031,9,11,203103,2031),('2031-03-10',203111,3,2031,10,11,203103,2031),('2031-03-11',203111,3,2031,11,11,203103,2031),('2031-03-12',203111,3,2031,12,11,203103,2031),('2031-03-13',203111,3,2031,13,11,203103,2031),('2031-03-14',203111,3,2031,14,11,203103,2031),('2031-03-15',203111,3,2031,15,11,203103,2031),('2031-03-16',203112,3,2031,16,12,203103,2031),('2031-03-17',203112,3,2031,17,12,203103,2031),('2031-03-18',203112,3,2031,18,12,203103,2031),('2031-03-19',203112,3,2031,19,12,203103,2031),('2031-03-20',203112,3,2031,20,12,203103,2031),('2031-03-21',203112,3,2031,21,12,203103,2031),('2031-03-22',203112,3,2031,22,12,203103,2031),('2031-03-23',203113,3,2031,23,13,203103,2031),('2031-03-24',203113,3,2031,24,13,203103,2031),('2031-03-25',203113,3,2031,25,13,203103,2031),('2031-03-26',203113,3,2031,26,13,203103,2031),('2031-03-27',203113,3,2031,27,13,203103,2031),('2031-03-28',203113,3,2031,28,13,203103,2031),('2031-03-29',203113,3,2031,29,13,203103,2031),('2031-03-30',203114,3,2031,30,14,203103,2031),('2031-03-31',203114,3,2031,31,14,203103,2031),('2031-04-01',203114,4,2031,1,14,203104,2031),('2031-04-02',203114,4,2031,2,14,203104,2031),('2031-04-03',203114,4,2031,3,14,203104,2031),('2031-04-04',203114,4,2031,4,14,203104,2031),('2031-04-05',203114,4,2031,5,14,203104,2031),('2031-04-06',203115,4,2031,6,15,203104,2031),('2031-04-07',203115,4,2031,7,15,203104,2031),('2031-04-08',203115,4,2031,8,15,203104,2031),('2031-04-09',203115,4,2031,9,15,203104,2031),('2031-04-10',203115,4,2031,10,15,203104,2031),('2031-04-11',203115,4,2031,11,15,203104,2031),('2031-04-12',203115,4,2031,12,15,203104,2031),('2031-04-13',203116,4,2031,13,16,203104,2031),('2031-04-14',203116,4,2031,14,16,203104,2031),('2031-04-15',203116,4,2031,15,16,203104,2031),('2031-04-16',203116,4,2031,16,16,203104,2031),('2031-04-17',203116,4,2031,17,16,203104,2031),('2031-04-18',203116,4,2031,18,16,203104,2031),('2031-04-19',203116,4,2031,19,16,203104,2031),('2031-04-20',203117,4,2031,20,17,203104,2031),('2031-04-21',203117,4,2031,21,17,203104,2031),('2031-04-22',203117,4,2031,22,17,203104,2031),('2031-04-23',203117,4,2031,23,17,203104,2031),('2031-04-24',203117,4,2031,24,17,203104,2031),('2031-04-25',203117,4,2031,25,17,203104,2031),('2031-04-26',203117,4,2031,26,17,203104,2031),('2031-04-27',203118,4,2031,27,18,203104,2031),('2031-04-28',203118,4,2031,28,18,203104,2031),('2031-04-29',203118,4,2031,29,18,203104,2031),('2031-04-30',203118,4,2031,30,18,203104,2031),('2031-05-01',203118,5,2031,1,18,203105,2031),('2031-05-02',203118,5,2031,2,18,203105,2031),('2031-05-03',203118,5,2031,3,18,203105,2031),('2031-05-04',203119,5,2031,4,19,203105,2031),('2031-05-05',203119,5,2031,5,19,203105,2031),('2031-05-06',203119,5,2031,6,19,203105,2031),('2031-05-07',203119,5,2031,7,19,203105,2031),('2031-05-08',203119,5,2031,8,19,203105,2031),('2031-05-09',203119,5,2031,9,19,203105,2031),('2031-05-10',203119,5,2031,10,19,203105,2031),('2031-05-11',203120,5,2031,11,20,203105,2031),('2031-05-12',203120,5,2031,12,20,203105,2031),('2031-05-13',203120,5,2031,13,20,203105,2031),('2031-05-14',203120,5,2031,14,20,203105,2031),('2031-05-15',203120,5,2031,15,20,203105,2031),('2031-05-16',203120,5,2031,16,20,203105,2031),('2031-05-17',203120,5,2031,17,20,203105,2031),('2031-05-18',203121,5,2031,18,21,203105,2031),('2031-05-19',203121,5,2031,19,21,203105,2031),('2031-05-20',203121,5,2031,20,21,203105,2031),('2031-05-21',203121,5,2031,21,21,203105,2031),('2031-05-22',203121,5,2031,22,21,203105,2031),('2031-05-23',203121,5,2031,23,21,203105,2031),('2031-05-24',203121,5,2031,24,21,203105,2031),('2031-05-25',203122,5,2031,25,22,203105,2031),('2031-05-26',203122,5,2031,26,22,203105,2031),('2031-05-27',203122,5,2031,27,22,203105,2031),('2031-05-28',203122,5,2031,28,22,203105,2031),('2031-05-29',203122,5,2031,29,22,203105,2031),('2031-05-30',203122,5,2031,30,22,203105,2031),('2031-05-31',203122,5,2031,31,22,203105,2031),('2031-06-01',203123,6,2031,1,23,203106,2031),('2031-06-02',203123,6,2031,2,23,203106,2031),('2031-06-03',203123,6,2031,3,23,203106,2031),('2031-06-04',203123,6,2031,4,23,203106,2031),('2031-06-05',203123,6,2031,5,23,203106,2031),('2031-06-06',203123,6,2031,6,23,203106,2031),('2031-06-07',203123,6,2031,7,23,203106,2031),('2031-06-08',203124,6,2031,8,24,203106,2031),('2031-06-09',203124,6,2031,9,24,203106,2031),('2031-06-10',203124,6,2031,10,24,203106,2031),('2031-06-11',203124,6,2031,11,24,203106,2031),('2031-06-12',203124,6,2031,12,24,203106,2031),('2031-06-13',203124,6,2031,13,24,203106,2031),('2031-06-14',203124,6,2031,14,24,203106,2031),('2031-06-15',203125,6,2031,15,25,203106,2031),('2031-06-16',203125,6,2031,16,25,203106,2031),('2031-06-17',203125,6,2031,17,25,203106,2031),('2031-06-18',203125,6,2031,18,25,203106,2031),('2031-06-19',203125,6,2031,19,25,203106,2031),('2031-06-20',203125,6,2031,20,25,203106,2031),('2031-06-21',203125,6,2031,21,25,203106,2031),('2031-06-22',203126,6,2031,22,26,203106,2031),('2031-06-23',203126,6,2031,23,26,203106,2031),('2031-06-24',203126,6,2031,24,26,203106,2031),('2031-06-25',203126,6,2031,25,26,203106,2031),('2031-06-26',203126,6,2031,26,26,203106,2031),('2031-06-27',203126,6,2031,27,26,203106,2031),('2031-06-28',203126,6,2031,28,26,203106,2031),('2031-06-29',203127,6,2031,29,27,203106,2031),('2031-06-30',203127,6,2031,30,27,203106,2031),('2031-07-01',203127,7,2031,1,27,203107,2031),('2031-07-02',203127,7,2031,2,27,203107,2031),('2031-07-03',203127,7,2031,3,27,203107,2031),('2031-07-04',203127,7,2031,4,27,203107,2031),('2031-07-05',203127,7,2031,5,27,203107,2031),('2031-07-06',203128,7,2031,6,28,203107,2031),('2031-07-07',203128,7,2031,7,28,203107,2031),('2031-07-08',203128,7,2031,8,28,203107,2031),('2031-07-09',203128,7,2031,9,28,203107,2031),('2031-07-10',203128,7,2031,10,28,203107,2031),('2031-07-11',203128,7,2031,11,28,203107,2031),('2031-07-12',203128,7,2031,12,28,203107,2031),('2031-07-13',203129,7,2031,13,29,203107,2031),('2031-07-14',203129,7,2031,14,29,203107,2031),('2031-07-15',203129,7,2031,15,29,203107,2031),('2031-07-16',203129,7,2031,16,29,203107,2031),('2031-07-17',203129,7,2031,17,29,203107,2031),('2031-07-18',203129,7,2031,18,29,203107,2031),('2031-07-19',203129,7,2031,19,29,203107,2031),('2031-07-20',203130,7,2031,20,30,203107,2031),('2031-07-21',203130,7,2031,21,30,203107,2031),('2031-07-22',203130,7,2031,22,30,203107,2031),('2031-07-23',203130,7,2031,23,30,203107,2031),('2031-07-24',203130,7,2031,24,30,203107,2031),('2031-07-25',203130,7,2031,25,30,203107,2031),('2031-07-26',203130,7,2031,26,30,203107,2031),('2031-07-27',203131,7,2031,27,31,203107,2031),('2031-07-28',203131,7,2031,28,31,203107,2031),('2031-07-29',203131,7,2031,29,31,203107,2031),('2031-07-30',203131,7,2031,30,31,203107,2031),('2031-07-31',203131,7,2031,31,31,203107,2031),('2031-08-01',203131,8,2031,1,31,203108,2031),('2031-08-02',203131,8,2031,2,31,203108,2031),('2031-08-03',203132,8,2031,3,32,203108,2031),('2031-08-04',203132,8,2031,4,32,203108,2031),('2031-08-05',203132,8,2031,5,32,203108,2031),('2031-08-06',203132,8,2031,6,32,203108,2031),('2031-08-07',203132,8,2031,7,32,203108,2031),('2031-08-08',203132,8,2031,8,32,203108,2031),('2031-08-09',203132,8,2031,9,32,203108,2031),('2031-08-10',203133,8,2031,10,33,203108,2031),('2031-08-11',203133,8,2031,11,33,203108,2031),('2031-08-12',203133,8,2031,12,33,203108,2031),('2031-08-13',203133,8,2031,13,33,203108,2031),('2031-08-14',203133,8,2031,14,33,203108,2031),('2031-08-15',203133,8,2031,15,33,203108,2031),('2031-08-16',203133,8,2031,16,33,203108,2031),('2031-08-17',203134,8,2031,17,34,203108,2031),('2031-08-18',203134,8,2031,18,34,203108,2031),('2031-08-19',203134,8,2031,19,34,203108,2031),('2031-08-20',203134,8,2031,20,34,203108,2031),('2031-08-21',203134,8,2031,21,34,203108,2031),('2031-08-22',203134,8,2031,22,34,203108,2031),('2031-08-23',203134,8,2031,23,34,203108,2031),('2031-08-24',203135,8,2031,24,35,203108,2031),('2031-08-25',203135,8,2031,25,35,203108,2031),('2031-08-26',203135,8,2031,26,35,203108,2031),('2031-08-27',203135,8,2031,27,35,203108,2031),('2031-08-28',203135,8,2031,28,35,203108,2031),('2031-08-29',203135,8,2031,29,35,203108,2031),('2031-08-30',203135,8,2031,30,35,203108,2031),('2031-08-31',203136,8,2031,31,36,203108,2031),('2031-09-01',203136,9,2031,1,36,203109,2031),('2031-09-02',203136,9,2031,2,36,203109,2031),('2031-09-03',203136,9,2031,3,36,203109,2031),('2031-09-04',203136,9,2031,4,36,203109,2031),('2031-09-05',203136,9,2031,5,36,203109,2031),('2031-09-06',203136,9,2031,6,36,203109,2031),('2031-09-07',203137,9,2031,7,37,203109,2031),('2031-09-08',203137,9,2031,8,37,203109,2031),('2031-09-09',203137,9,2031,9,37,203109,2031),('2031-09-10',203137,9,2031,10,37,203109,2031),('2031-09-11',203137,9,2031,11,37,203109,2031),('2031-09-12',203137,9,2031,12,37,203109,2031),('2031-09-13',203137,9,2031,13,37,203109,2031),('2031-09-14',203138,9,2031,14,38,203109,2031),('2031-09-15',203138,9,2031,15,38,203109,2031),('2031-09-16',203138,9,2031,16,38,203109,2031),('2031-09-17',203138,9,2031,17,38,203109,2031),('2031-09-18',203138,9,2031,18,38,203109,2031),('2031-09-19',203138,9,2031,19,38,203109,2031),('2031-09-20',203138,9,2031,20,38,203109,2031),('2031-09-21',203139,9,2031,21,39,203109,2031),('2031-09-22',203139,9,2031,22,39,203109,2031),('2031-09-23',203139,9,2031,23,39,203109,2031),('2031-09-24',203139,9,2031,24,39,203109,2031),('2031-09-25',203139,9,2031,25,39,203109,2031),('2031-09-26',203139,9,2031,26,39,203109,2031),('2031-09-27',203139,9,2031,27,39,203109,2031),('2031-09-28',203140,9,2031,28,40,203109,2031),('2031-09-29',203140,9,2031,29,40,203109,2031),('2031-09-30',203140,9,2031,30,40,203109,2031),('2031-10-01',203140,10,2031,1,40,203110,2031),('2031-10-02',203140,10,2031,2,40,203110,2031),('2031-10-03',203140,10,2031,3,40,203110,2031),('2031-10-04',203140,10,2031,4,40,203110,2031),('2031-10-05',203141,10,2031,5,41,203110,2031),('2031-10-06',203141,10,2031,6,41,203110,2031),('2031-10-07',203141,10,2031,7,41,203110,2031),('2031-10-08',203141,10,2031,8,41,203110,2031),('2031-10-09',203141,10,2031,9,41,203110,2031),('2031-10-10',203141,10,2031,10,41,203110,2031),('2031-10-11',203141,10,2031,11,41,203110,2031),('2031-10-12',203142,10,2031,12,42,203110,2031),('2031-10-13',203142,10,2031,13,42,203110,2031),('2031-10-14',203142,10,2031,14,42,203110,2031),('2031-10-15',203142,10,2031,15,42,203110,2031),('2031-10-16',203142,10,2031,16,42,203110,2031),('2031-10-17',203142,10,2031,17,42,203110,2031),('2031-10-18',203142,10,2031,18,42,203110,2031),('2031-10-19',203143,10,2031,19,43,203110,2031),('2031-10-20',203143,10,2031,20,43,203110,2031),('2031-10-21',203143,10,2031,21,43,203110,2031),('2031-10-22',203143,10,2031,22,43,203110,2031),('2031-10-23',203143,10,2031,23,43,203110,2031),('2031-10-24',203143,10,2031,24,43,203110,2031),('2031-10-25',203143,10,2031,25,43,203110,2031),('2031-10-26',203144,10,2031,26,44,203110,2031),('2031-10-27',203144,10,2031,27,44,203110,2031),('2031-10-28',203144,10,2031,28,44,203110,2031),('2031-10-29',203144,10,2031,29,44,203110,2031),('2031-10-30',203144,10,2031,30,44,203110,2031),('2031-10-31',203144,10,2031,31,44,203110,2031),('2031-11-01',203144,11,2031,1,44,203111,2031),('2031-11-02',203145,11,2031,2,45,203111,2031),('2031-11-03',203145,11,2031,3,45,203111,2031),('2031-11-04',203145,11,2031,4,45,203111,2031),('2031-11-05',203145,11,2031,5,45,203111,2031),('2031-11-06',203145,11,2031,6,45,203111,2031),('2031-11-07',203145,11,2031,7,45,203111,2031),('2031-11-08',203145,11,2031,8,45,203111,2031),('2031-11-09',203146,11,2031,9,46,203111,2031),('2031-11-10',203146,11,2031,10,46,203111,2031),('2031-11-11',203146,11,2031,11,46,203111,2031),('2031-11-12',203146,11,2031,12,46,203111,2031),('2031-11-13',203146,11,2031,13,46,203111,2031),('2031-11-14',203146,11,2031,14,46,203111,2031),('2031-11-15',203146,11,2031,15,46,203111,2031),('2031-11-16',203147,11,2031,16,47,203111,2031),('2031-11-17',203147,11,2031,17,47,203111,2031),('2031-11-18',203147,11,2031,18,47,203111,2031),('2031-11-19',203147,11,2031,19,47,203111,2031),('2031-11-20',203147,11,2031,20,47,203111,2031),('2031-11-21',203147,11,2031,21,47,203111,2031),('2031-11-22',203147,11,2031,22,47,203111,2031),('2031-11-23',203148,11,2031,23,48,203111,2031),('2031-11-24',203148,11,2031,24,48,203111,2031),('2031-11-25',203148,11,2031,25,48,203111,2031),('2031-11-26',203148,11,2031,26,48,203111,2031),('2031-11-27',203148,11,2031,27,48,203111,2031),('2031-11-28',203148,11,2031,28,48,203111,2031),('2031-11-29',203148,11,2031,29,48,203111,2031),('2031-11-30',203149,11,2031,30,49,203111,2031),('2031-12-01',203149,12,2031,1,49,203112,2032),('2031-12-02',203149,12,2031,2,49,203112,2032),('2031-12-03',203149,12,2031,3,49,203112,2032),('2031-12-04',203149,12,2031,4,49,203112,2032),('2031-12-05',203149,12,2031,5,49,203112,2032),('2031-12-06',203149,12,2031,6,49,203112,2032),('2031-12-07',203150,12,2031,7,50,203112,2032),('2031-12-08',203150,12,2031,8,50,203112,2032),('2031-12-09',203150,12,2031,9,50,203112,2032),('2031-12-10',203150,12,2031,10,50,203112,2032),('2031-12-11',203150,12,2031,11,50,203112,2032),('2031-12-12',203150,12,2031,12,50,203112,2032),('2031-12-13',203150,12,2031,13,50,203112,2032),('2031-12-14',203151,12,2031,14,51,203112,2032),('2031-12-15',203151,12,2031,15,51,203112,2032),('2031-12-16',203151,12,2031,16,51,203112,2032),('2031-12-17',203151,12,2031,17,51,203112,2032),('2031-12-18',203151,12,2031,18,51,203112,2032),('2031-12-19',203151,12,2031,19,51,203112,2032),('2031-12-20',203151,12,2031,20,51,203112,2032),('2031-12-21',203152,12,2031,21,52,203112,2032),('2031-12-22',203152,12,2031,22,52,203112,2032),('2031-12-23',203152,12,2031,23,52,203112,2032),('2031-12-24',203152,12,2031,24,52,203112,2032),('2031-12-25',203152,12,2031,25,52,203112,2032),('2031-12-26',203152,12,2031,26,52,203112,2032),('2031-12-27',203152,12,2031,27,52,203112,2032),('2031-12-28',203153,12,2031,28,53,203112,2032),('2031-12-29',203101,12,2031,29,53,203112,2032),('2031-12-30',203101,12,2031,30,53,203112,2032),('2031-12-31',203101,12,2031,31,53,203112,2032),('2032-01-01',203201,1,2032,1,53,203201,2032),('2032-01-02',203201,1,2032,2,53,203201,2032),('2032-01-03',203201,1,2032,3,53,203201,2032),('2032-01-04',203202,1,2032,4,1,203201,2032),('2032-01-05',203202,1,2032,5,1,203201,2032),('2032-01-06',203202,1,2032,6,1,203201,2032),('2032-01-07',203202,1,2032,7,1,203201,2032),('2032-01-08',203202,1,2032,8,1,203201,2032),('2032-01-09',203202,1,2032,9,1,203201,2032),('2032-01-10',203202,1,2032,10,1,203201,2032),('2032-01-11',203203,1,2032,11,2,203201,2032),('2032-01-12',203203,1,2032,12,2,203201,2032),('2032-01-13',203203,1,2032,13,2,203201,2032),('2032-01-14',203203,1,2032,14,2,203201,2032),('2032-01-15',203203,1,2032,15,2,203201,2032),('2032-01-16',203203,1,2032,16,2,203201,2032),('2032-01-17',203203,1,2032,17,2,203201,2032),('2032-01-18',203204,1,2032,18,3,203201,2032),('2032-01-19',203204,1,2032,19,3,203201,2032),('2032-01-20',203204,1,2032,20,3,203201,2032),('2032-01-21',203204,1,2032,21,3,203201,2032),('2032-01-22',203204,1,2032,22,3,203201,2032),('2032-01-23',203204,1,2032,23,3,203201,2032),('2032-01-24',203204,1,2032,24,3,203201,2032),('2032-01-25',203205,1,2032,25,4,203201,2032),('2032-01-26',203205,1,2032,26,4,203201,2032),('2032-01-27',203205,1,2032,27,4,203201,2032),('2032-01-28',203205,1,2032,28,4,203201,2032),('2032-01-29',203205,1,2032,29,4,203201,2032),('2032-01-30',203205,1,2032,30,4,203201,2032),('2032-01-31',203205,1,2032,31,4,203201,2032),('2032-02-01',203206,2,2032,1,5,203202,2032),('2032-02-02',203206,2,2032,2,5,203202,2032),('2032-02-03',203206,2,2032,3,5,203202,2032),('2032-02-04',203206,2,2032,4,5,203202,2032),('2032-02-05',203206,2,2032,5,5,203202,2032),('2032-02-06',203206,2,2032,6,5,203202,2032),('2032-02-07',203206,2,2032,7,5,203202,2032),('2032-02-08',203207,2,2032,8,6,203202,2032),('2032-02-09',203207,2,2032,9,6,203202,2032),('2032-02-10',203207,2,2032,10,6,203202,2032),('2032-02-11',203207,2,2032,11,6,203202,2032),('2032-02-12',203207,2,2032,12,6,203202,2032),('2032-02-13',203207,2,2032,13,6,203202,2032),('2032-02-14',203207,2,2032,14,6,203202,2032),('2032-02-15',203208,2,2032,15,7,203202,2032),('2032-02-16',203208,2,2032,16,7,203202,2032),('2032-02-17',203208,2,2032,17,7,203202,2032),('2032-02-18',203208,2,2032,18,7,203202,2032),('2032-02-19',203208,2,2032,19,7,203202,2032),('2032-02-20',203208,2,2032,20,7,203202,2032),('2032-02-21',203208,2,2032,21,7,203202,2032),('2032-02-22',203209,2,2032,22,8,203202,2032),('2032-02-23',203209,2,2032,23,8,203202,2032),('2032-02-24',203209,2,2032,24,8,203202,2032),('2032-02-25',203209,2,2032,25,8,203202,2032),('2032-02-26',203209,2,2032,26,8,203202,2032),('2032-02-27',203209,2,2032,27,8,203202,2032),('2032-02-28',203209,2,2032,28,8,203202,2032),('2032-02-29',203210,2,2032,29,9,203202,2032),('2032-03-01',203210,3,2032,1,9,203203,2032),('2032-03-02',203210,3,2032,2,9,203203,2032),('2032-03-03',203210,3,2032,3,9,203203,2032),('2032-03-04',203210,3,2032,4,9,203203,2032),('2032-03-05',203210,3,2032,5,9,203203,2032),('2032-03-06',203210,3,2032,6,9,203203,2032),('2032-03-07',203211,3,2032,7,10,203203,2032),('2032-03-08',203211,3,2032,8,10,203203,2032),('2032-03-09',203211,3,2032,9,10,203203,2032),('2032-03-10',203211,3,2032,10,10,203203,2032),('2032-03-11',203211,3,2032,11,10,203203,2032),('2032-03-12',203211,3,2032,12,10,203203,2032),('2032-03-13',203211,3,2032,13,10,203203,2032),('2032-03-14',203212,3,2032,14,11,203203,2032),('2032-03-15',203212,3,2032,15,11,203203,2032),('2032-03-16',203212,3,2032,16,11,203203,2032),('2032-03-17',203212,3,2032,17,11,203203,2032),('2032-03-18',203212,3,2032,18,11,203203,2032),('2032-03-19',203212,3,2032,19,11,203203,2032),('2032-03-20',203212,3,2032,20,11,203203,2032),('2032-03-21',203213,3,2032,21,12,203203,2032),('2032-03-22',203213,3,2032,22,12,203203,2032),('2032-03-23',203213,3,2032,23,12,203203,2032),('2032-03-24',203213,3,2032,24,12,203203,2032),('2032-03-25',203213,3,2032,25,12,203203,2032),('2032-03-26',203213,3,2032,26,12,203203,2032),('2032-03-27',203213,3,2032,27,12,203203,2032),('2032-03-28',203214,3,2032,28,13,203203,2032),('2032-03-29',203214,3,2032,29,13,203203,2032),('2032-03-30',203214,3,2032,30,13,203203,2032),('2032-03-31',203214,3,2032,31,13,203203,2032),('2032-04-01',203214,4,2032,1,13,203204,2032),('2032-04-02',203214,4,2032,2,13,203204,2032),('2032-04-03',203214,4,2032,3,13,203204,2032),('2032-04-04',203215,4,2032,4,14,203204,2032),('2032-04-05',203215,4,2032,5,14,203204,2032),('2032-04-06',203215,4,2032,6,14,203204,2032),('2032-04-07',203215,4,2032,7,14,203204,2032),('2032-04-08',203215,4,2032,8,14,203204,2032),('2032-04-09',203215,4,2032,9,14,203204,2032),('2032-04-10',203215,4,2032,10,14,203204,2032),('2032-04-11',203216,4,2032,11,15,203204,2032),('2032-04-12',203216,4,2032,12,15,203204,2032),('2032-04-13',203216,4,2032,13,15,203204,2032),('2032-04-14',203216,4,2032,14,15,203204,2032),('2032-04-15',203216,4,2032,15,15,203204,2032),('2032-04-16',203216,4,2032,16,15,203204,2032),('2032-04-17',203216,4,2032,17,15,203204,2032),('2032-04-18',203217,4,2032,18,16,203204,2032),('2032-04-19',203217,4,2032,19,16,203204,2032),('2032-04-20',203217,4,2032,20,16,203204,2032),('2032-04-21',203217,4,2032,21,16,203204,2032),('2032-04-22',203217,4,2032,22,16,203204,2032),('2032-04-23',203217,4,2032,23,16,203204,2032),('2032-04-24',203217,4,2032,24,16,203204,2032),('2032-04-25',203218,4,2032,25,17,203204,2032),('2032-04-26',203218,4,2032,26,17,203204,2032),('2032-04-27',203218,4,2032,27,17,203204,2032),('2032-04-28',203218,4,2032,28,17,203204,2032),('2032-04-29',203218,4,2032,29,17,203204,2032),('2032-04-30',203218,4,2032,30,17,203204,2032),('2032-05-01',203218,5,2032,1,17,203205,2032),('2032-05-02',203219,5,2032,2,18,203205,2032),('2032-05-03',203219,5,2032,3,18,203205,2032),('2032-05-04',203219,5,2032,4,18,203205,2032),('2032-05-05',203219,5,2032,5,18,203205,2032),('2032-05-06',203219,5,2032,6,18,203205,2032),('2032-05-07',203219,5,2032,7,18,203205,2032),('2032-05-08',203219,5,2032,8,18,203205,2032),('2032-05-09',203220,5,2032,9,19,203205,2032),('2032-05-10',203220,5,2032,10,19,203205,2032),('2032-05-11',203220,5,2032,11,19,203205,2032),('2032-05-12',203220,5,2032,12,19,203205,2032),('2032-05-13',203220,5,2032,13,19,203205,2032),('2032-05-14',203220,5,2032,14,19,203205,2032),('2032-05-15',203220,5,2032,15,19,203205,2032),('2032-05-16',203221,5,2032,16,20,203205,2032),('2032-05-17',203221,5,2032,17,20,203205,2032),('2032-05-18',203221,5,2032,18,20,203205,2032),('2032-05-19',203221,5,2032,19,20,203205,2032),('2032-05-20',203221,5,2032,20,20,203205,2032),('2032-05-21',203221,5,2032,21,20,203205,2032),('2032-05-22',203221,5,2032,22,20,203205,2032),('2032-05-23',203222,5,2032,23,21,203205,2032),('2032-05-24',203222,5,2032,24,21,203205,2032),('2032-05-25',203222,5,2032,25,21,203205,2032),('2032-05-26',203222,5,2032,26,21,203205,2032),('2032-05-27',203222,5,2032,27,21,203205,2032),('2032-05-28',203222,5,2032,28,21,203205,2032),('2032-05-29',203222,5,2032,29,21,203205,2032),('2032-05-30',203223,5,2032,30,22,203205,2032),('2032-05-31',203223,5,2032,31,22,203205,2032),('2032-06-01',203223,6,2032,1,22,203206,2032),('2032-06-02',203223,6,2032,2,22,203206,2032),('2032-06-03',203223,6,2032,3,22,203206,2032),('2032-06-04',203223,6,2032,4,22,203206,2032),('2032-06-05',203223,6,2032,5,22,203206,2032),('2032-06-06',203224,6,2032,6,23,203206,2032),('2032-06-07',203224,6,2032,7,23,203206,2032),('2032-06-08',203224,6,2032,8,23,203206,2032),('2032-06-09',203224,6,2032,9,23,203206,2032),('2032-06-10',203224,6,2032,10,23,203206,2032),('2032-06-11',203224,6,2032,11,23,203206,2032),('2032-06-12',203224,6,2032,12,23,203206,2032),('2032-06-13',203225,6,2032,13,24,203206,2032),('2032-06-14',203225,6,2032,14,24,203206,2032),('2032-06-15',203225,6,2032,15,24,203206,2032),('2032-06-16',203225,6,2032,16,24,203206,2032),('2032-06-17',203225,6,2032,17,24,203206,2032),('2032-06-18',203225,6,2032,18,24,203206,2032),('2032-06-19',203225,6,2032,19,24,203206,2032),('2032-06-20',203226,6,2032,20,25,203206,2032),('2032-06-21',203226,6,2032,21,25,203206,2032),('2032-06-22',203226,6,2032,22,25,203206,2032),('2032-06-23',203226,6,2032,23,25,203206,2032),('2032-06-24',203226,6,2032,24,25,203206,2032),('2032-06-25',203226,6,2032,25,25,203206,2032),('2032-06-26',203226,6,2032,26,25,203206,2032),('2032-06-27',203227,6,2032,27,26,203206,2032),('2032-06-28',203227,6,2032,28,26,203206,2032),('2032-06-29',203227,6,2032,29,26,203206,2032),('2032-06-30',203227,6,2032,30,26,203206,2032),('2032-07-01',203227,7,2032,1,26,203207,2032),('2032-07-02',203227,7,2032,2,26,203207,2032),('2032-07-03',203227,7,2032,3,26,203207,2032),('2032-07-04',203228,7,2032,4,27,203207,2032),('2032-07-05',203228,7,2032,5,27,203207,2032),('2032-07-06',203228,7,2032,6,27,203207,2032),('2032-07-07',203228,7,2032,7,27,203207,2032),('2032-07-08',203228,7,2032,8,27,203207,2032),('2032-07-09',203228,7,2032,9,27,203207,2032),('2032-07-10',203228,7,2032,10,27,203207,2032),('2032-07-11',203229,7,2032,11,28,203207,2032),('2032-07-12',203229,7,2032,12,28,203207,2032),('2032-07-13',203229,7,2032,13,28,203207,2032),('2032-07-14',203229,7,2032,14,28,203207,2032),('2032-07-15',203229,7,2032,15,28,203207,2032),('2032-07-16',203229,7,2032,16,28,203207,2032),('2032-07-17',203229,7,2032,17,28,203207,2032),('2032-07-18',203230,7,2032,18,29,203207,2032),('2032-07-19',203230,7,2032,19,29,203207,2032),('2032-07-20',203230,7,2032,20,29,203207,2032),('2032-07-21',203230,7,2032,21,29,203207,2032),('2032-07-22',203230,7,2032,22,29,203207,2032),('2032-07-23',203230,7,2032,23,29,203207,2032),('2032-07-24',203230,7,2032,24,29,203207,2032),('2032-07-25',203231,7,2032,25,30,203207,2032),('2032-07-26',203231,7,2032,26,30,203207,2032),('2032-07-27',203231,7,2032,27,30,203207,2032),('2032-07-28',203231,7,2032,28,30,203207,2032),('2032-07-29',203231,7,2032,29,30,203207,2032),('2032-07-30',203231,7,2032,30,30,203207,2032),('2032-07-31',203231,7,2032,31,30,203207,2032),('2032-08-01',203232,8,2032,1,31,203208,2032),('2032-08-02',203232,8,2032,2,31,203208,2032),('2032-08-03',203232,8,2032,3,31,203208,2032),('2032-08-04',203232,8,2032,4,31,203208,2032),('2032-08-05',203232,8,2032,5,31,203208,2032),('2032-08-06',203232,8,2032,6,31,203208,2032),('2032-08-07',203232,8,2032,7,31,203208,2032),('2032-08-08',203233,8,2032,8,32,203208,2032),('2032-08-09',203233,8,2032,9,32,203208,2032),('2032-08-10',203233,8,2032,10,32,203208,2032),('2032-08-11',203233,8,2032,11,32,203208,2032),('2032-08-12',203233,8,2032,12,32,203208,2032),('2032-08-13',203233,8,2032,13,32,203208,2032),('2032-08-14',203233,8,2032,14,32,203208,2032),('2032-08-15',203234,8,2032,15,33,203208,2032),('2032-08-16',203234,8,2032,16,33,203208,2032),('2032-08-17',203234,8,2032,17,33,203208,2032),('2032-08-18',203234,8,2032,18,33,203208,2032),('2032-08-19',203234,8,2032,19,33,203208,2032),('2032-08-20',203234,8,2032,20,33,203208,2032),('2032-08-21',203234,8,2032,21,33,203208,2032),('2032-08-22',203235,8,2032,22,34,203208,2032),('2032-08-23',203235,8,2032,23,34,203208,2032),('2032-08-24',203235,8,2032,24,34,203208,2032),('2032-08-25',203235,8,2032,25,34,203208,2032),('2032-08-26',203235,8,2032,26,34,203208,2032),('2032-08-27',203235,8,2032,27,34,203208,2032),('2032-08-28',203235,8,2032,28,34,203208,2032),('2032-08-29',203236,8,2032,29,35,203208,2032),('2032-08-30',203236,8,2032,30,35,203208,2032),('2032-08-31',203236,8,2032,31,35,203208,2032),('2032-09-01',203236,9,2032,1,35,203209,2032),('2032-09-02',203236,9,2032,2,35,203209,2032),('2032-09-03',203236,9,2032,3,35,203209,2032),('2032-09-04',203236,9,2032,4,35,203209,2032),('2032-09-05',203237,9,2032,5,36,203209,2032),('2032-09-06',203237,9,2032,6,36,203209,2032),('2032-09-07',203237,9,2032,7,36,203209,2032),('2032-09-08',203237,9,2032,8,36,203209,2032),('2032-09-09',203237,9,2032,9,36,203209,2032),('2032-09-10',203237,9,2032,10,36,203209,2032),('2032-09-11',203237,9,2032,11,36,203209,2032),('2032-09-12',203238,9,2032,12,37,203209,2032),('2032-09-13',203238,9,2032,13,37,203209,2032),('2032-09-14',203238,9,2032,14,37,203209,2032),('2032-09-15',203238,9,2032,15,37,203209,2032),('2032-09-16',203238,9,2032,16,37,203209,2032),('2032-09-17',203238,9,2032,17,37,203209,2032),('2032-09-18',203238,9,2032,18,37,203209,2032),('2032-09-19',203239,9,2032,19,38,203209,2032),('2032-09-20',203239,9,2032,20,38,203209,2032),('2032-09-21',203239,9,2032,21,38,203209,2032),('2032-09-22',203239,9,2032,22,38,203209,2032),('2032-09-23',203239,9,2032,23,38,203209,2032),('2032-09-24',203239,9,2032,24,38,203209,2032),('2032-09-25',203239,9,2032,25,38,203209,2032),('2032-09-26',203240,9,2032,26,39,203209,2032),('2032-09-27',203240,9,2032,27,39,203209,2032),('2032-09-28',203240,9,2032,28,39,203209,2032),('2032-09-29',203240,9,2032,29,39,203209,2032),('2032-09-30',203240,9,2032,30,39,203209,2032),('2032-10-01',203240,10,2032,1,39,203210,2032),('2032-10-02',203240,10,2032,2,39,203210,2032),('2032-10-03',203241,10,2032,3,40,203210,2032),('2032-10-04',203241,10,2032,4,40,203210,2032),('2032-10-05',203241,10,2032,5,40,203210,2032),('2032-10-06',203241,10,2032,6,40,203210,2032),('2032-10-07',203241,10,2032,7,40,203210,2032),('2032-10-08',203241,10,2032,8,40,203210,2032),('2032-10-09',203241,10,2032,9,40,203210,2032),('2032-10-10',203242,10,2032,10,41,203210,2032),('2032-10-11',203242,10,2032,11,41,203210,2032),('2032-10-12',203242,10,2032,12,41,203210,2032),('2032-10-13',203242,10,2032,13,41,203210,2032),('2032-10-14',203242,10,2032,14,41,203210,2032),('2032-10-15',203242,10,2032,15,41,203210,2032),('2032-10-16',203242,10,2032,16,41,203210,2032),('2032-10-17',203243,10,2032,17,42,203210,2032),('2032-10-18',203243,10,2032,18,42,203210,2032),('2032-10-19',203243,10,2032,19,42,203210,2032),('2032-10-20',203243,10,2032,20,42,203210,2032),('2032-10-21',203243,10,2032,21,42,203210,2032),('2032-10-22',203243,10,2032,22,42,203210,2032),('2032-10-23',203243,10,2032,23,42,203210,2032),('2032-10-24',203244,10,2032,24,43,203210,2032),('2032-10-25',203244,10,2032,25,43,203210,2032),('2032-10-26',203244,10,2032,26,43,203210,2032),('2032-10-27',203244,10,2032,27,43,203210,2032),('2032-10-28',203244,10,2032,28,43,203210,2032),('2032-10-29',203244,10,2032,29,43,203210,2032),('2032-10-30',203244,10,2032,30,43,203210,2032),('2032-10-31',203245,10,2032,31,44,203210,2032),('2032-11-01',203245,11,2032,1,44,203211,2032),('2032-11-02',203245,11,2032,2,44,203211,2032),('2032-11-03',203245,11,2032,3,44,203211,2032),('2032-11-04',203245,11,2032,4,44,203211,2032),('2032-11-05',203245,11,2032,5,44,203211,2032),('2032-11-06',203245,11,2032,6,44,203211,2032),('2032-11-07',203246,11,2032,7,45,203211,2032),('2032-11-08',203246,11,2032,8,45,203211,2032),('2032-11-09',203246,11,2032,9,45,203211,2032),('2032-11-10',203246,11,2032,10,45,203211,2032),('2032-11-11',203246,11,2032,11,45,203211,2032),('2032-11-12',203246,11,2032,12,45,203211,2032),('2032-11-13',203246,11,2032,13,45,203211,2032),('2032-11-14',203247,11,2032,14,46,203211,2032),('2032-11-15',203247,11,2032,15,46,203211,2032),('2032-11-16',203247,11,2032,16,46,203211,2032),('2032-11-17',203247,11,2032,17,46,203211,2032),('2032-11-18',203247,11,2032,18,46,203211,2032),('2032-11-19',203247,11,2032,19,46,203211,2032),('2032-11-20',203247,11,2032,20,46,203211,2032),('2032-11-21',203248,11,2032,21,47,203211,2032),('2032-11-22',203248,11,2032,22,47,203211,2032),('2032-11-23',203248,11,2032,23,47,203211,2032),('2032-11-24',203248,11,2032,24,47,203211,2032),('2032-11-25',203248,11,2032,25,47,203211,2032),('2032-11-26',203248,11,2032,26,47,203211,2032),('2032-11-27',203248,11,2032,27,47,203211,2032),('2032-11-28',203249,11,2032,28,48,203211,2032),('2032-11-29',203249,11,2032,29,48,203211,2032),('2032-11-30',203249,11,2032,30,48,203211,2032),('2032-12-01',203249,12,2032,1,48,203212,2033),('2032-12-02',203249,12,2032,2,48,203212,2033),('2032-12-03',203249,12,2032,3,48,203212,2033),('2032-12-04',203249,12,2032,4,48,203212,2033),('2032-12-05',203250,12,2032,5,49,203212,2033),('2032-12-06',203250,12,2032,6,49,203212,2033),('2032-12-07',203250,12,2032,7,49,203212,2033),('2032-12-08',203250,12,2032,8,49,203212,2033),('2032-12-09',203250,12,2032,9,49,203212,2033),('2032-12-10',203250,12,2032,10,49,203212,2033),('2032-12-11',203250,12,2032,11,49,203212,2033),('2032-12-12',203251,12,2032,12,50,203212,2033),('2032-12-13',203251,12,2032,13,50,203212,2033),('2032-12-14',203251,12,2032,14,50,203212,2033),('2032-12-15',203251,12,2032,15,50,203212,2033),('2032-12-16',203251,12,2032,16,50,203212,2033),('2032-12-17',203251,12,2032,17,50,203212,2033),('2032-12-18',203251,12,2032,18,50,203212,2033),('2032-12-19',203252,12,2032,19,51,203212,2033),('2032-12-20',203252,12,2032,20,51,203212,2033),('2032-12-21',203252,12,2032,21,51,203212,2033),('2032-12-22',203252,12,2032,22,51,203212,2033),('2032-12-23',203252,12,2032,23,51,203212,2033),('2032-12-24',203252,12,2032,24,51,203212,2033),('2032-12-25',203252,12,2032,25,51,203212,2033),('2032-12-26',203253,12,2032,26,52,203212,2033),('2032-12-27',203253,12,2032,27,52,203212,2033),('2032-12-28',203253,12,2032,28,52,203212,2033),('2032-12-29',203253,12,2032,29,52,203212,2033),('2032-12-30',203253,12,2032,30,52,203212,2033),('2032-12-31',203253,12,2032,31,52,203212,2033),('2033-01-01',203353,1,2033,1,52,203301,2033),('2033-01-02',203354,1,2033,2,1,203301,2033),('2033-01-03',203301,1,2033,3,1,203301,2033),('2033-01-04',203301,1,2033,4,1,203301,2033),('2033-01-05',203301,1,2033,5,1,203301,2033),('2033-01-06',203301,1,2033,6,1,203301,2033),('2033-01-07',203301,1,2033,7,1,203301,2033),('2033-01-08',203301,1,2033,8,1,203301,2033),('2033-01-09',203302,1,2033,9,2,203301,2033),('2033-01-10',203302,1,2033,10,2,203301,2033),('2033-01-11',203302,1,2033,11,2,203301,2033),('2033-01-12',203302,1,2033,12,2,203301,2033),('2033-01-13',203302,1,2033,13,2,203301,2033),('2033-01-14',203302,1,2033,14,2,203301,2033),('2033-01-15',203302,1,2033,15,2,203301,2033),('2033-01-16',203303,1,2033,16,3,203301,2033),('2033-01-17',203303,1,2033,17,3,203301,2033),('2033-01-18',203303,1,2033,18,3,203301,2033),('2033-01-19',203303,1,2033,19,3,203301,2033),('2033-01-20',203303,1,2033,20,3,203301,2033),('2033-01-21',203303,1,2033,21,3,203301,2033),('2033-01-22',203303,1,2033,22,3,203301,2033),('2033-01-23',203304,1,2033,23,4,203301,2033),('2033-01-24',203304,1,2033,24,4,203301,2033),('2033-01-25',203304,1,2033,25,4,203301,2033),('2033-01-26',203304,1,2033,26,4,203301,2033),('2033-01-27',203304,1,2033,27,4,203301,2033),('2033-01-28',203304,1,2033,28,4,203301,2033),('2033-01-29',203304,1,2033,29,4,203301,2033),('2033-01-30',203305,1,2033,30,5,203301,2033),('2033-01-31',203305,1,2033,31,5,203301,2033),('2033-02-01',203305,2,2033,1,5,203302,2033),('2033-02-02',203305,2,2033,2,5,203302,2033),('2033-02-03',203305,2,2033,3,5,203302,2033),('2033-02-04',203305,2,2033,4,5,203302,2033),('2033-02-05',203305,2,2033,5,5,203302,2033),('2033-02-06',203306,2,2033,6,6,203302,2033),('2033-02-07',203306,2,2033,7,6,203302,2033),('2033-02-08',203306,2,2033,8,6,203302,2033),('2033-02-09',203306,2,2033,9,6,203302,2033),('2033-02-10',203306,2,2033,10,6,203302,2033),('2033-02-11',203306,2,2033,11,6,203302,2033),('2033-02-12',203306,2,2033,12,6,203302,2033),('2033-02-13',203307,2,2033,13,7,203302,2033),('2033-02-14',203307,2,2033,14,7,203302,2033),('2033-02-15',203307,2,2033,15,7,203302,2033),('2033-02-16',203307,2,2033,16,7,203302,2033),('2033-02-17',203307,2,2033,17,7,203302,2033),('2033-02-18',203307,2,2033,18,7,203302,2033),('2033-02-19',203307,2,2033,19,7,203302,2033),('2033-02-20',203308,2,2033,20,8,203302,2033),('2033-02-21',203308,2,2033,21,8,203302,2033),('2033-02-22',203308,2,2033,22,8,203302,2033),('2033-02-23',203308,2,2033,23,8,203302,2033),('2033-02-24',203308,2,2033,24,8,203302,2033),('2033-02-25',203308,2,2033,25,8,203302,2033),('2033-02-26',203308,2,2033,26,8,203302,2033),('2033-02-27',203309,2,2033,27,9,203302,2033),('2033-02-28',203309,2,2033,28,9,203302,2033),('2033-03-01',203309,3,2033,1,9,203303,2033),('2033-03-02',203309,3,2033,2,9,203303,2033),('2033-03-03',203309,3,2033,3,9,203303,2033),('2033-03-04',203309,3,2033,4,9,203303,2033),('2033-03-05',203309,3,2033,5,9,203303,2033),('2033-03-06',203310,3,2033,6,10,203303,2033),('2033-03-07',203310,3,2033,7,10,203303,2033),('2033-03-08',203310,3,2033,8,10,203303,2033),('2033-03-09',203310,3,2033,9,10,203303,2033),('2033-03-10',203310,3,2033,10,10,203303,2033),('2033-03-11',203310,3,2033,11,10,203303,2033),('2033-03-12',203310,3,2033,12,10,203303,2033),('2033-03-13',203311,3,2033,13,11,203303,2033),('2033-03-14',203311,3,2033,14,11,203303,2033),('2033-03-15',203311,3,2033,15,11,203303,2033),('2033-03-16',203311,3,2033,16,11,203303,2033),('2033-03-17',203311,3,2033,17,11,203303,2033),('2033-03-18',203311,3,2033,18,11,203303,2033),('2033-03-19',203311,3,2033,19,11,203303,2033),('2033-03-20',203312,3,2033,20,12,203303,2033),('2033-03-21',203312,3,2033,21,12,203303,2033),('2033-03-22',203312,3,2033,22,12,203303,2033),('2033-03-23',203312,3,2033,23,12,203303,2033),('2033-03-24',203312,3,2033,24,12,203303,2033),('2033-03-25',203312,3,2033,25,12,203303,2033),('2033-03-26',203312,3,2033,26,12,203303,2033),('2033-03-27',203313,3,2033,27,13,203303,2033),('2033-03-28',203313,3,2033,28,13,203303,2033),('2033-03-29',203313,3,2033,29,13,203303,2033),('2033-03-30',203313,3,2033,30,13,203303,2033),('2033-03-31',203313,3,2033,31,13,203303,2033),('2033-04-01',203313,4,2033,1,13,203304,2033),('2033-04-02',203313,4,2033,2,13,203304,2033),('2033-04-03',203314,4,2033,3,14,203304,2033),('2033-04-04',203314,4,2033,4,14,203304,2033),('2033-04-05',203314,4,2033,5,14,203304,2033),('2033-04-06',203314,4,2033,6,14,203304,2033),('2033-04-07',203314,4,2033,7,14,203304,2033),('2033-04-08',203314,4,2033,8,14,203304,2033),('2033-04-09',203314,4,2033,9,14,203304,2033),('2033-04-10',203315,4,2033,10,15,203304,2033),('2033-04-11',203315,4,2033,11,15,203304,2033),('2033-04-12',203315,4,2033,12,15,203304,2033),('2033-04-13',203315,4,2033,13,15,203304,2033),('2033-04-14',203315,4,2033,14,15,203304,2033),('2033-04-15',203315,4,2033,15,15,203304,2033),('2033-04-16',203315,4,2033,16,15,203304,2033),('2033-04-17',203316,4,2033,17,16,203304,2033),('2033-04-18',203316,4,2033,18,16,203304,2033),('2033-04-19',203316,4,2033,19,16,203304,2033),('2033-04-20',203316,4,2033,20,16,203304,2033),('2033-04-21',203316,4,2033,21,16,203304,2033),('2033-04-22',203316,4,2033,22,16,203304,2033),('2033-04-23',203316,4,2033,23,16,203304,2033),('2033-04-24',203317,4,2033,24,17,203304,2033),('2033-04-25',203317,4,2033,25,17,203304,2033),('2033-04-26',203317,4,2033,26,17,203304,2033),('2033-04-27',203317,4,2033,27,17,203304,2033),('2033-04-28',203317,4,2033,28,17,203304,2033),('2033-04-29',203317,4,2033,29,17,203304,2033),('2033-04-30',203317,4,2033,30,17,203304,2033),('2033-05-01',203318,5,2033,1,18,203305,2033),('2033-05-02',203318,5,2033,2,18,203305,2033),('2033-05-03',203318,5,2033,3,18,203305,2033),('2033-05-04',203318,5,2033,4,18,203305,2033),('2033-05-05',203318,5,2033,5,18,203305,2033),('2033-05-06',203318,5,2033,6,18,203305,2033),('2033-05-07',203318,5,2033,7,18,203305,2033),('2033-05-08',203319,5,2033,8,19,203305,2033),('2033-05-09',203319,5,2033,9,19,203305,2033),('2033-05-10',203319,5,2033,10,19,203305,2033),('2033-05-11',203319,5,2033,11,19,203305,2033),('2033-05-12',203319,5,2033,12,19,203305,2033),('2033-05-13',203319,5,2033,13,19,203305,2033),('2033-05-14',203319,5,2033,14,19,203305,2033),('2033-05-15',203320,5,2033,15,20,203305,2033),('2033-05-16',203320,5,2033,16,20,203305,2033),('2033-05-17',203320,5,2033,17,20,203305,2033),('2033-05-18',203320,5,2033,18,20,203305,2033),('2033-05-19',203320,5,2033,19,20,203305,2033),('2033-05-20',203320,5,2033,20,20,203305,2033),('2033-05-21',203320,5,2033,21,20,203305,2033),('2033-05-22',203321,5,2033,22,21,203305,2033),('2033-05-23',203321,5,2033,23,21,203305,2033),('2033-05-24',203321,5,2033,24,21,203305,2033),('2033-05-25',203321,5,2033,25,21,203305,2033),('2033-05-26',203321,5,2033,26,21,203305,2033),('2033-05-27',203321,5,2033,27,21,203305,2033),('2033-05-28',203321,5,2033,28,21,203305,2033),('2033-05-29',203322,5,2033,29,22,203305,2033),('2033-05-30',203322,5,2033,30,22,203305,2033),('2033-05-31',203322,5,2033,31,22,203305,2033),('2033-06-01',203322,6,2033,1,22,203306,2033),('2033-06-02',203322,6,2033,2,22,203306,2033),('2033-06-03',203322,6,2033,3,22,203306,2033),('2033-06-04',203322,6,2033,4,22,203306,2033),('2033-06-05',203323,6,2033,5,23,203306,2033),('2033-06-06',203323,6,2033,6,23,203306,2033),('2033-06-07',203323,6,2033,7,23,203306,2033),('2033-06-08',203323,6,2033,8,23,203306,2033),('2033-06-09',203323,6,2033,9,23,203306,2033),('2033-06-10',203323,6,2033,10,23,203306,2033),('2033-06-11',203323,6,2033,11,23,203306,2033),('2033-06-12',203324,6,2033,12,24,203306,2033),('2033-06-13',203324,6,2033,13,24,203306,2033),('2033-06-14',203324,6,2033,14,24,203306,2033),('2033-06-15',203324,6,2033,15,24,203306,2033),('2033-06-16',203324,6,2033,16,24,203306,2033),('2033-06-17',203324,6,2033,17,24,203306,2033),('2033-06-18',203324,6,2033,18,24,203306,2033),('2033-06-19',203325,6,2033,19,25,203306,2033),('2033-06-20',203325,6,2033,20,25,203306,2033),('2033-06-21',203325,6,2033,21,25,203306,2033),('2033-06-22',203325,6,2033,22,25,203306,2033),('2033-06-23',203325,6,2033,23,25,203306,2033),('2033-06-24',203325,6,2033,24,25,203306,2033),('2033-06-25',203325,6,2033,25,25,203306,2033),('2033-06-26',203326,6,2033,26,26,203306,2033),('2033-06-27',203326,6,2033,27,26,203306,2033),('2033-06-28',203326,6,2033,28,26,203306,2033),('2033-06-29',203326,6,2033,29,26,203306,2033),('2033-06-30',203326,6,2033,30,26,203306,2033),('2033-07-01',203326,7,2033,1,26,203307,2033),('2033-07-02',203326,7,2033,2,26,203307,2033),('2033-07-03',203327,7,2033,3,27,203307,2033),('2033-07-04',203327,7,2033,4,27,203307,2033),('2033-07-05',203327,7,2033,5,27,203307,2033),('2033-07-06',203327,7,2033,6,27,203307,2033),('2033-07-07',203327,7,2033,7,27,203307,2033),('2033-07-08',203327,7,2033,8,27,203307,2033),('2033-07-09',203327,7,2033,9,27,203307,2033),('2033-07-10',203328,7,2033,10,28,203307,2033),('2033-07-11',203328,7,2033,11,28,203307,2033),('2033-07-12',203328,7,2033,12,28,203307,2033),('2033-07-13',203328,7,2033,13,28,203307,2033),('2033-07-14',203328,7,2033,14,28,203307,2033),('2033-07-15',203328,7,2033,15,28,203307,2033),('2033-07-16',203328,7,2033,16,28,203307,2033),('2033-07-17',203329,7,2033,17,29,203307,2033),('2033-07-18',203329,7,2033,18,29,203307,2033),('2033-07-19',203329,7,2033,19,29,203307,2033),('2033-07-20',203329,7,2033,20,29,203307,2033),('2033-07-21',203329,7,2033,21,29,203307,2033),('2033-07-22',203329,7,2033,22,29,203307,2033),('2033-07-23',203329,7,2033,23,29,203307,2033),('2033-07-24',203330,7,2033,24,30,203307,2033),('2033-07-25',203330,7,2033,25,30,203307,2033),('2033-07-26',203330,7,2033,26,30,203307,2033),('2033-07-27',203330,7,2033,27,30,203307,2033),('2033-07-28',203330,7,2033,28,30,203307,2033),('2033-07-29',203330,7,2033,29,30,203307,2033),('2033-07-30',203330,7,2033,30,30,203307,2033),('2033-07-31',203331,7,2033,31,31,203307,2033),('2033-08-01',203331,8,2033,1,31,203308,2033),('2033-08-02',203331,8,2033,2,31,203308,2033),('2033-08-03',203331,8,2033,3,31,203308,2033),('2033-08-04',203331,8,2033,4,31,203308,2033),('2033-08-05',203331,8,2033,5,31,203308,2033),('2033-08-06',203331,8,2033,6,31,203308,2033),('2033-08-07',203332,8,2033,7,32,203308,2033),('2033-08-08',203332,8,2033,8,32,203308,2033),('2033-08-09',203332,8,2033,9,32,203308,2033),('2033-08-10',203332,8,2033,10,32,203308,2033),('2033-08-11',203332,8,2033,11,32,203308,2033),('2033-08-12',203332,8,2033,12,32,203308,2033),('2033-08-13',203332,8,2033,13,32,203308,2033),('2033-08-14',203333,8,2033,14,33,203308,2033),('2033-08-15',203333,8,2033,15,33,203308,2033),('2033-08-16',203333,8,2033,16,33,203308,2033),('2033-08-17',203333,8,2033,17,33,203308,2033),('2033-08-18',203333,8,2033,18,33,203308,2033),('2033-08-19',203333,8,2033,19,33,203308,2033),('2033-08-20',203333,8,2033,20,33,203308,2033),('2033-08-21',203334,8,2033,21,34,203308,2033),('2033-08-22',203334,8,2033,22,34,203308,2033),('2033-08-23',203334,8,2033,23,34,203308,2033),('2033-08-24',203334,8,2033,24,34,203308,2033),('2033-08-25',203334,8,2033,25,34,203308,2033),('2033-08-26',203334,8,2033,26,34,203308,2033),('2033-08-27',203334,8,2033,27,34,203308,2033),('2033-08-28',203335,8,2033,28,35,203308,2033),('2033-08-29',203335,8,2033,29,35,203308,2033),('2033-08-30',203335,8,2033,30,35,203308,2033),('2033-08-31',203335,8,2033,31,35,203308,2033),('2033-09-01',203335,9,2033,1,35,203309,2033),('2033-09-02',203335,9,2033,2,35,203309,2033),('2033-09-03',203335,9,2033,3,35,203309,2033),('2033-09-04',203336,9,2033,4,36,203309,2033),('2033-09-05',203336,9,2033,5,36,203309,2033),('2033-09-06',203336,9,2033,6,36,203309,2033),('2033-09-07',203336,9,2033,7,36,203309,2033),('2033-09-08',203336,9,2033,8,36,203309,2033),('2033-09-09',203336,9,2033,9,36,203309,2033),('2033-09-10',203336,9,2033,10,36,203309,2033),('2033-09-11',203337,9,2033,11,37,203309,2033),('2033-09-12',203337,9,2033,12,37,203309,2033),('2033-09-13',203337,9,2033,13,37,203309,2033),('2033-09-14',203337,9,2033,14,37,203309,2033),('2033-09-15',203337,9,2033,15,37,203309,2033),('2033-09-16',203337,9,2033,16,37,203309,2033),('2033-09-17',203337,9,2033,17,37,203309,2033),('2033-09-18',203338,9,2033,18,38,203309,2033),('2033-09-19',203338,9,2033,19,38,203309,2033),('2033-09-20',203338,9,2033,20,38,203309,2033),('2033-09-21',203338,9,2033,21,38,203309,2033),('2033-09-22',203338,9,2033,22,38,203309,2033),('2033-09-23',203338,9,2033,23,38,203309,2033),('2033-09-24',203338,9,2033,24,38,203309,2033),('2033-09-25',203339,9,2033,25,39,203309,2033),('2033-09-26',203339,9,2033,26,39,203309,2033),('2033-09-27',203339,9,2033,27,39,203309,2033),('2033-09-28',203339,9,2033,28,39,203309,2033),('2033-09-29',203339,9,2033,29,39,203309,2033),('2033-09-30',203339,9,2033,30,39,203309,2033),('2033-10-01',203339,10,2033,1,39,203310,2033),('2033-10-02',203340,10,2033,2,40,203310,2033),('2033-10-03',203340,10,2033,3,40,203310,2033),('2033-10-04',203340,10,2033,4,40,203310,2033),('2033-10-05',203340,10,2033,5,40,203310,2033),('2033-10-06',203340,10,2033,6,40,203310,2033),('2033-10-07',203340,10,2033,7,40,203310,2033),('2033-10-08',203340,10,2033,8,40,203310,2033),('2033-10-09',203341,10,2033,9,41,203310,2033),('2033-10-10',203341,10,2033,10,41,203310,2033),('2033-10-11',203341,10,2033,11,41,203310,2033),('2033-10-12',203341,10,2033,12,41,203310,2033),('2033-10-13',203341,10,2033,13,41,203310,2033),('2033-10-14',203341,10,2033,14,41,203310,2033),('2033-10-15',203341,10,2033,15,41,203310,2033),('2033-10-16',203342,10,2033,16,42,203310,2033),('2033-10-17',203342,10,2033,17,42,203310,2033),('2033-10-18',203342,10,2033,18,42,203310,2033),('2033-10-19',203342,10,2033,19,42,203310,2033),('2033-10-20',203342,10,2033,20,42,203310,2033),('2033-10-21',203342,10,2033,21,42,203310,2033),('2033-10-22',203342,10,2033,22,42,203310,2033),('2033-10-23',203343,10,2033,23,43,203310,2033),('2033-10-24',203343,10,2033,24,43,203310,2033),('2033-10-25',203343,10,2033,25,43,203310,2033),('2033-10-26',203343,10,2033,26,43,203310,2033),('2033-10-27',203343,10,2033,27,43,203310,2033),('2033-10-28',203343,10,2033,28,43,203310,2033),('2033-10-29',203343,10,2033,29,43,203310,2033),('2033-10-30',203344,10,2033,30,44,203310,2033),('2033-10-31',203344,10,2033,31,44,203310,2033),('2033-11-01',203344,11,2033,1,44,203311,2033),('2033-11-02',203344,11,2033,2,44,203311,2033),('2033-11-03',203344,11,2033,3,44,203311,2033),('2033-11-04',203344,11,2033,4,44,203311,2033),('2033-11-05',203344,11,2033,5,44,203311,2033),('2033-11-06',203345,11,2033,6,45,203311,2033),('2033-11-07',203345,11,2033,7,45,203311,2033),('2033-11-08',203345,11,2033,8,45,203311,2033),('2033-11-09',203345,11,2033,9,45,203311,2033),('2033-11-10',203345,11,2033,10,45,203311,2033),('2033-11-11',203345,11,2033,11,45,203311,2033),('2033-11-12',203345,11,2033,12,45,203311,2033),('2033-11-13',203346,11,2033,13,46,203311,2033),('2033-11-14',203346,11,2033,14,46,203311,2033),('2033-11-15',203346,11,2033,15,46,203311,2033),('2033-11-16',203346,11,2033,16,46,203311,2033),('2033-11-17',203346,11,2033,17,46,203311,2033),('2033-11-18',203346,11,2033,18,46,203311,2033),('2033-11-19',203346,11,2033,19,46,203311,2033),('2033-11-20',203347,11,2033,20,47,203311,2033),('2033-11-21',203347,11,2033,21,47,203311,2033),('2033-11-22',203347,11,2033,22,47,203311,2033),('2033-11-23',203347,11,2033,23,47,203311,2033),('2033-11-24',203347,11,2033,24,47,203311,2033),('2033-11-25',203347,11,2033,25,47,203311,2033),('2033-11-26',203347,11,2033,26,47,203311,2033),('2033-11-27',203348,11,2033,27,48,203311,2033),('2033-11-28',203348,11,2033,28,48,203311,2033),('2033-11-29',203348,11,2033,29,48,203311,2033),('2033-11-30',203348,11,2033,30,48,203311,2033),('2033-12-01',203348,12,2033,1,48,203312,2034),('2033-12-02',203348,12,2033,2,48,203312,2034),('2033-12-03',203348,12,2033,3,48,203312,2034),('2033-12-04',203349,12,2033,4,49,203312,2034),('2033-12-05',203349,12,2033,5,49,203312,2034),('2033-12-06',203349,12,2033,6,49,203312,2034),('2033-12-07',203349,12,2033,7,49,203312,2034),('2033-12-08',203349,12,2033,8,49,203312,2034),('2033-12-09',203349,12,2033,9,49,203312,2034),('2033-12-10',203349,12,2033,10,49,203312,2034),('2033-12-11',203350,12,2033,11,50,203312,2034),('2033-12-12',203350,12,2033,12,50,203312,2034),('2033-12-13',203350,12,2033,13,50,203312,2034),('2033-12-14',203350,12,2033,14,50,203312,2034),('2033-12-15',203350,12,2033,15,50,203312,2034),('2033-12-16',203350,12,2033,16,50,203312,2034),('2033-12-17',203350,12,2033,17,50,203312,2034),('2033-12-18',203351,12,2033,18,51,203312,2034),('2033-12-19',203351,12,2033,19,51,203312,2034),('2033-12-20',203351,12,2033,20,51,203312,2034),('2033-12-21',203351,12,2033,21,51,203312,2034),('2033-12-22',203351,12,2033,22,51,203312,2034),('2033-12-23',203351,12,2033,23,51,203312,2034),('2033-12-24',203351,12,2033,24,51,203312,2034),('2033-12-25',203352,12,2033,25,52,203312,2034),('2033-12-26',203352,12,2033,26,52,203312,2034),('2033-12-27',203352,12,2033,27,52,203312,2034),('2033-12-28',203352,12,2033,28,52,203312,2034),('2033-12-29',203352,12,2033,29,52,203312,2034),('2033-12-30',203352,12,2033,30,52,203312,2034),('2033-12-31',203352,12,2033,31,52,203312,2034),('2034-01-01',203453,1,2034,1,1,203401,2034),('2034-01-02',203401,1,2034,2,1,203401,2034),('2034-01-03',203401,1,2034,3,1,203401,2034),('2034-01-04',203401,1,2034,4,1,203401,2034),('2034-01-05',203401,1,2034,5,1,203401,2034),('2034-01-06',203401,1,2034,6,1,203401,2034),('2034-01-07',203401,1,2034,7,1,203401,2034),('2034-01-08',203402,1,2034,8,2,203401,2034),('2034-01-09',203402,1,2034,9,2,203401,2034),('2034-01-10',203402,1,2034,10,2,203401,2034),('2034-01-11',203402,1,2034,11,2,203401,2034),('2034-01-12',203402,1,2034,12,2,203401,2034),('2034-01-13',203402,1,2034,13,2,203401,2034),('2034-01-14',203402,1,2034,14,2,203401,2034),('2034-01-15',203403,1,2034,15,3,203401,2034),('2034-01-16',203403,1,2034,16,3,203401,2034),('2034-01-17',203403,1,2034,17,3,203401,2034),('2034-01-18',203403,1,2034,18,3,203401,2034),('2034-01-19',203403,1,2034,19,3,203401,2034),('2034-01-20',203403,1,2034,20,3,203401,2034),('2034-01-21',203403,1,2034,21,3,203401,2034),('2034-01-22',203404,1,2034,22,4,203401,2034),('2034-01-23',203404,1,2034,23,4,203401,2034),('2034-01-24',203404,1,2034,24,4,203401,2034),('2034-01-25',203404,1,2034,25,4,203401,2034),('2034-01-26',203404,1,2034,26,4,203401,2034),('2034-01-27',203404,1,2034,27,4,203401,2034),('2034-01-28',203404,1,2034,28,4,203401,2034),('2034-01-29',203405,1,2034,29,5,203401,2034),('2034-01-30',203405,1,2034,30,5,203401,2034),('2034-01-31',203405,1,2034,31,5,203401,2034),('2034-02-01',203405,2,2034,1,5,203402,2034),('2034-02-02',203405,2,2034,2,5,203402,2034),('2034-02-03',203405,2,2034,3,5,203402,2034),('2034-02-04',203405,2,2034,4,5,203402,2034),('2034-02-05',203406,2,2034,5,6,203402,2034),('2034-02-06',203406,2,2034,6,6,203402,2034),('2034-02-07',203406,2,2034,7,6,203402,2034),('2034-02-08',203406,2,2034,8,6,203402,2034),('2034-02-09',203406,2,2034,9,6,203402,2034),('2034-02-10',203406,2,2034,10,6,203402,2034),('2034-02-11',203406,2,2034,11,6,203402,2034),('2034-02-12',203407,2,2034,12,7,203402,2034),('2034-02-13',203407,2,2034,13,7,203402,2034),('2034-02-14',203407,2,2034,14,7,203402,2034),('2034-02-15',203407,2,2034,15,7,203402,2034),('2034-02-16',203407,2,2034,16,7,203402,2034),('2034-02-17',203407,2,2034,17,7,203402,2034),('2034-02-18',203407,2,2034,18,7,203402,2034),('2034-02-19',203408,2,2034,19,8,203402,2034),('2034-02-20',203408,2,2034,20,8,203402,2034),('2034-02-21',203408,2,2034,21,8,203402,2034),('2034-02-22',203408,2,2034,22,8,203402,2034),('2034-02-23',203408,2,2034,23,8,203402,2034),('2034-02-24',203408,2,2034,24,8,203402,2034),('2034-02-25',203408,2,2034,25,8,203402,2034),('2034-02-26',203409,2,2034,26,9,203402,2034),('2034-02-27',203409,2,2034,27,9,203402,2034),('2034-02-28',203409,2,2034,28,9,203402,2034),('2034-03-01',203409,3,2034,1,9,203403,2034),('2034-03-02',203409,3,2034,2,9,203403,2034),('2034-03-03',203409,3,2034,3,9,203403,2034),('2034-03-04',203409,3,2034,4,9,203403,2034),('2034-03-05',203410,3,2034,5,10,203403,2034),('2034-03-06',203410,3,2034,6,10,203403,2034),('2034-03-07',203410,3,2034,7,10,203403,2034),('2034-03-08',203410,3,2034,8,10,203403,2034),('2034-03-09',203410,3,2034,9,10,203403,2034),('2034-03-10',203410,3,2034,10,10,203403,2034),('2034-03-11',203410,3,2034,11,10,203403,2034),('2034-03-12',203411,3,2034,12,11,203403,2034),('2034-03-13',203411,3,2034,13,11,203403,2034),('2034-03-14',203411,3,2034,14,11,203403,2034),('2034-03-15',203411,3,2034,15,11,203403,2034),('2034-03-16',203411,3,2034,16,11,203403,2034),('2034-03-17',203411,3,2034,17,11,203403,2034),('2034-03-18',203411,3,2034,18,11,203403,2034),('2034-03-19',203412,3,2034,19,12,203403,2034),('2034-03-20',203412,3,2034,20,12,203403,2034),('2034-03-21',203412,3,2034,21,12,203403,2034),('2034-03-22',203412,3,2034,22,12,203403,2034),('2034-03-23',203412,3,2034,23,12,203403,2034),('2034-03-24',203412,3,2034,24,12,203403,2034),('2034-03-25',203412,3,2034,25,12,203403,2034),('2034-03-26',203413,3,2034,26,13,203403,2034),('2034-03-27',203413,3,2034,27,13,203403,2034),('2034-03-28',203413,3,2034,28,13,203403,2034),('2034-03-29',203413,3,2034,29,13,203403,2034),('2034-03-30',203413,3,2034,30,13,203403,2034),('2034-03-31',203413,3,2034,31,13,203403,2034),('2034-04-01',203413,4,2034,1,13,203404,2034),('2034-04-02',203414,4,2034,2,14,203404,2034),('2034-04-03',203414,4,2034,3,14,203404,2034),('2034-04-04',203414,4,2034,4,14,203404,2034),('2034-04-05',203414,4,2034,5,14,203404,2034),('2034-04-06',203414,4,2034,6,14,203404,2034),('2034-04-07',203414,4,2034,7,14,203404,2034),('2034-04-08',203414,4,2034,8,14,203404,2034),('2034-04-09',203415,4,2034,9,15,203404,2034),('2034-04-10',203415,4,2034,10,15,203404,2034),('2034-04-11',203415,4,2034,11,15,203404,2034),('2034-04-12',203415,4,2034,12,15,203404,2034),('2034-04-13',203415,4,2034,13,15,203404,2034),('2034-04-14',203415,4,2034,14,15,203404,2034),('2034-04-15',203415,4,2034,15,15,203404,2034),('2034-04-16',203416,4,2034,16,16,203404,2034),('2034-04-17',203416,4,2034,17,16,203404,2034),('2034-04-18',203416,4,2034,18,16,203404,2034),('2034-04-19',203416,4,2034,19,16,203404,2034),('2034-04-20',203416,4,2034,20,16,203404,2034),('2034-04-21',203416,4,2034,21,16,203404,2034),('2034-04-22',203416,4,2034,22,16,203404,2034),('2034-04-23',203417,4,2034,23,17,203404,2034),('2034-04-24',203417,4,2034,24,17,203404,2034),('2034-04-25',203417,4,2034,25,17,203404,2034),('2034-04-26',203417,4,2034,26,17,203404,2034),('2034-04-27',203417,4,2034,27,17,203404,2034),('2034-04-28',203417,4,2034,28,17,203404,2034),('2034-04-29',203417,4,2034,29,17,203404,2034),('2034-04-30',203418,4,2034,30,18,203404,2034),('2034-05-01',203418,5,2034,1,18,203405,2034),('2034-05-02',203418,5,2034,2,18,203405,2034),('2034-05-03',203418,5,2034,3,18,203405,2034),('2034-05-04',203418,5,2034,4,18,203405,2034),('2034-05-05',203418,5,2034,5,18,203405,2034),('2034-05-06',203418,5,2034,6,18,203405,2034),('2034-05-07',203419,5,2034,7,19,203405,2034),('2034-05-08',203419,5,2034,8,19,203405,2034),('2034-05-09',203419,5,2034,9,19,203405,2034),('2034-05-10',203419,5,2034,10,19,203405,2034),('2034-05-11',203419,5,2034,11,19,203405,2034),('2034-05-12',203419,5,2034,12,19,203405,2034),('2034-05-13',203419,5,2034,13,19,203405,2034),('2034-05-14',203420,5,2034,14,20,203405,2034),('2034-05-15',203420,5,2034,15,20,203405,2034),('2034-05-16',203420,5,2034,16,20,203405,2034),('2034-05-17',203420,5,2034,17,20,203405,2034),('2034-05-18',203420,5,2034,18,20,203405,2034),('2034-05-19',203420,5,2034,19,20,203405,2034),('2034-05-20',203420,5,2034,20,20,203405,2034),('2034-05-21',203421,5,2034,21,21,203405,2034),('2034-05-22',203421,5,2034,22,21,203405,2034),('2034-05-23',203421,5,2034,23,21,203405,2034),('2034-05-24',203421,5,2034,24,21,203405,2034),('2034-05-25',203421,5,2034,25,21,203405,2034),('2034-05-26',203421,5,2034,26,21,203405,2034),('2034-05-27',203421,5,2034,27,21,203405,2034),('2034-05-28',203422,5,2034,28,22,203405,2034),('2034-05-29',203422,5,2034,29,22,203405,2034),('2034-05-30',203422,5,2034,30,22,203405,2034),('2034-05-31',203422,5,2034,31,22,203405,2034),('2034-06-01',203422,6,2034,1,22,203406,2034),('2034-06-02',203422,6,2034,2,22,203406,2034),('2034-06-03',203422,6,2034,3,22,203406,2034),('2034-06-04',203423,6,2034,4,23,203406,2034),('2034-06-05',203423,6,2034,5,23,203406,2034),('2034-06-06',203423,6,2034,6,23,203406,2034),('2034-06-07',203423,6,2034,7,23,203406,2034),('2034-06-08',203423,6,2034,8,23,203406,2034),('2034-06-09',203423,6,2034,9,23,203406,2034),('2034-06-10',203423,6,2034,10,23,203406,2034),('2034-06-11',203424,6,2034,11,24,203406,2034),('2034-06-12',203424,6,2034,12,24,203406,2034),('2034-06-13',203424,6,2034,13,24,203406,2034),('2034-06-14',203424,6,2034,14,24,203406,2034),('2034-06-15',203424,6,2034,15,24,203406,2034),('2034-06-16',203424,6,2034,16,24,203406,2034),('2034-06-17',203424,6,2034,17,24,203406,2034),('2034-06-18',203425,6,2034,18,25,203406,2034),('2034-06-19',203425,6,2034,19,25,203406,2034),('2034-06-20',203425,6,2034,20,25,203406,2034),('2034-06-21',203425,6,2034,21,25,203406,2034),('2034-06-22',203425,6,2034,22,25,203406,2034),('2034-06-23',203425,6,2034,23,25,203406,2034),('2034-06-24',203425,6,2034,24,25,203406,2034),('2034-06-25',203426,6,2034,25,26,203406,2034),('2034-06-26',203426,6,2034,26,26,203406,2034),('2034-06-27',203426,6,2034,27,26,203406,2034),('2034-06-28',203426,6,2034,28,26,203406,2034),('2034-06-29',203426,6,2034,29,26,203406,2034),('2034-06-30',203426,6,2034,30,26,203406,2034),('2034-07-01',203426,7,2034,1,26,203407,2034),('2034-07-02',203427,7,2034,2,27,203407,2034),('2034-07-03',203427,7,2034,3,27,203407,2034),('2034-07-04',203427,7,2034,4,27,203407,2034),('2034-07-05',203427,7,2034,5,27,203407,2034),('2034-07-06',203427,7,2034,6,27,203407,2034),('2034-07-07',203427,7,2034,7,27,203407,2034),('2034-07-08',203427,7,2034,8,27,203407,2034),('2034-07-09',203428,7,2034,9,28,203407,2034),('2034-07-10',203428,7,2034,10,28,203407,2034),('2034-07-11',203428,7,2034,11,28,203407,2034),('2034-07-12',203428,7,2034,12,28,203407,2034),('2034-07-13',203428,7,2034,13,28,203407,2034),('2034-07-14',203428,7,2034,14,28,203407,2034),('2034-07-15',203428,7,2034,15,28,203407,2034),('2034-07-16',203429,7,2034,16,29,203407,2034),('2034-07-17',203429,7,2034,17,29,203407,2034),('2034-07-18',203429,7,2034,18,29,203407,2034),('2034-07-19',203429,7,2034,19,29,203407,2034),('2034-07-20',203429,7,2034,20,29,203407,2034),('2034-07-21',203429,7,2034,21,29,203407,2034),('2034-07-22',203429,7,2034,22,29,203407,2034),('2034-07-23',203430,7,2034,23,30,203407,2034),('2034-07-24',203430,7,2034,24,30,203407,2034),('2034-07-25',203430,7,2034,25,30,203407,2034),('2034-07-26',203430,7,2034,26,30,203407,2034),('2034-07-27',203430,7,2034,27,30,203407,2034),('2034-07-28',203430,7,2034,28,30,203407,2034),('2034-07-29',203430,7,2034,29,30,203407,2034),('2034-07-30',203431,7,2034,30,31,203407,2034),('2034-07-31',203431,7,2034,31,31,203407,2034),('2034-08-01',203431,8,2034,1,31,203408,2034),('2034-08-02',203431,8,2034,2,31,203408,2034),('2034-08-03',203431,8,2034,3,31,203408,2034),('2034-08-04',203431,8,2034,4,31,203408,2034),('2034-08-05',203431,8,2034,5,31,203408,2034),('2034-08-06',203432,8,2034,6,32,203408,2034),('2034-08-07',203432,8,2034,7,32,203408,2034),('2034-08-08',203432,8,2034,8,32,203408,2034),('2034-08-09',203432,8,2034,9,32,203408,2034),('2034-08-10',203432,8,2034,10,32,203408,2034),('2034-08-11',203432,8,2034,11,32,203408,2034),('2034-08-12',203432,8,2034,12,32,203408,2034),('2034-08-13',203433,8,2034,13,33,203408,2034),('2034-08-14',203433,8,2034,14,33,203408,2034),('2034-08-15',203433,8,2034,15,33,203408,2034),('2034-08-16',203433,8,2034,16,33,203408,2034),('2034-08-17',203433,8,2034,17,33,203408,2034),('2034-08-18',203433,8,2034,18,33,203408,2034),('2034-08-19',203433,8,2034,19,33,203408,2034),('2034-08-20',203434,8,2034,20,34,203408,2034),('2034-08-21',203434,8,2034,21,34,203408,2034),('2034-08-22',203434,8,2034,22,34,203408,2034),('2034-08-23',203434,8,2034,23,34,203408,2034),('2034-08-24',203434,8,2034,24,34,203408,2034),('2034-08-25',203434,8,2034,25,34,203408,2034),('2034-08-26',203434,8,2034,26,34,203408,2034),('2034-08-27',203435,8,2034,27,35,203408,2034),('2034-08-28',203435,8,2034,28,35,203408,2034),('2034-08-29',203435,8,2034,29,35,203408,2034),('2034-08-30',203435,8,2034,30,35,203408,2034),('2034-08-31',203435,8,2034,31,35,203408,2034),('2034-09-01',203435,9,2034,1,35,203409,2034),('2034-09-02',203435,9,2034,2,35,203409,2034),('2034-09-03',203436,9,2034,3,36,203409,2034),('2034-09-04',203436,9,2034,4,36,203409,2034),('2034-09-05',203436,9,2034,5,36,203409,2034),('2034-09-06',203436,9,2034,6,36,203409,2034),('2034-09-07',203436,9,2034,7,36,203409,2034),('2034-09-08',203436,9,2034,8,36,203409,2034),('2034-09-09',203436,9,2034,9,36,203409,2034),('2034-09-10',203437,9,2034,10,37,203409,2034),('2034-09-11',203437,9,2034,11,37,203409,2034),('2034-09-12',203437,9,2034,12,37,203409,2034),('2034-09-13',203437,9,2034,13,37,203409,2034),('2034-09-14',203437,9,2034,14,37,203409,2034),('2034-09-15',203437,9,2034,15,37,203409,2034),('2034-09-16',203437,9,2034,16,37,203409,2034),('2034-09-17',203438,9,2034,17,38,203409,2034),('2034-09-18',203438,9,2034,18,38,203409,2034),('2034-09-19',203438,9,2034,19,38,203409,2034),('2034-09-20',203438,9,2034,20,38,203409,2034),('2034-09-21',203438,9,2034,21,38,203409,2034),('2034-09-22',203438,9,2034,22,38,203409,2034),('2034-09-23',203438,9,2034,23,38,203409,2034),('2034-09-24',203439,9,2034,24,39,203409,2034),('2034-09-25',203439,9,2034,25,39,203409,2034),('2034-09-26',203439,9,2034,26,39,203409,2034),('2034-09-27',203439,9,2034,27,39,203409,2034),('2034-09-28',203439,9,2034,28,39,203409,2034),('2034-09-29',203439,9,2034,29,39,203409,2034),('2034-09-30',203439,9,2034,30,39,203409,2034),('2034-10-01',203440,10,2034,1,40,203410,2034),('2034-10-02',203440,10,2034,2,40,203410,2034),('2034-10-03',203440,10,2034,3,40,203410,2034),('2034-10-04',203440,10,2034,4,40,203410,2034),('2034-10-05',203440,10,2034,5,40,203410,2034),('2034-10-06',203440,10,2034,6,40,203410,2034),('2034-10-07',203440,10,2034,7,40,203410,2034),('2034-10-08',203441,10,2034,8,41,203410,2034),('2034-10-09',203441,10,2034,9,41,203410,2034),('2034-10-10',203441,10,2034,10,41,203410,2034),('2034-10-11',203441,10,2034,11,41,203410,2034),('2034-10-12',203441,10,2034,12,41,203410,2034),('2034-10-13',203441,10,2034,13,41,203410,2034),('2034-10-14',203441,10,2034,14,41,203410,2034),('2034-10-15',203442,10,2034,15,42,203410,2034),('2034-10-16',203442,10,2034,16,42,203410,2034),('2034-10-17',203442,10,2034,17,42,203410,2034),('2034-10-18',203442,10,2034,18,42,203410,2034),('2034-10-19',203442,10,2034,19,42,203410,2034),('2034-10-20',203442,10,2034,20,42,203410,2034),('2034-10-21',203442,10,2034,21,42,203410,2034),('2034-10-22',203443,10,2034,22,43,203410,2034),('2034-10-23',203443,10,2034,23,43,203410,2034),('2034-10-24',203443,10,2034,24,43,203410,2034),('2034-10-25',203443,10,2034,25,43,203410,2034),('2034-10-26',203443,10,2034,26,43,203410,2034),('2034-10-27',203443,10,2034,27,43,203410,2034),('2034-10-28',203443,10,2034,28,43,203410,2034),('2034-10-29',203444,10,2034,29,44,203410,2034),('2034-10-30',203444,10,2034,30,44,203410,2034),('2034-10-31',203444,10,2034,31,44,203410,2034),('2034-11-01',203444,11,2034,1,44,203411,2034),('2034-11-02',203444,11,2034,2,44,203411,2034),('2034-11-03',203444,11,2034,3,44,203411,2034),('2034-11-04',203444,11,2034,4,44,203411,2034),('2034-11-05',203445,11,2034,5,45,203411,2034),('2034-11-06',203445,11,2034,6,45,203411,2034),('2034-11-07',203445,11,2034,7,45,203411,2034),('2034-11-08',203445,11,2034,8,45,203411,2034),('2034-11-09',203445,11,2034,9,45,203411,2034),('2034-11-10',203445,11,2034,10,45,203411,2034),('2034-11-11',203445,11,2034,11,45,203411,2034),('2034-11-12',203446,11,2034,12,46,203411,2034),('2034-11-13',203446,11,2034,13,46,203411,2034),('2034-11-14',203446,11,2034,14,46,203411,2034),('2034-11-15',203446,11,2034,15,46,203411,2034),('2034-11-16',203446,11,2034,16,46,203411,2034),('2034-11-17',203446,11,2034,17,46,203411,2034),('2034-11-18',203446,11,2034,18,46,203411,2034),('2034-11-19',203447,11,2034,19,47,203411,2034),('2034-11-20',203447,11,2034,20,47,203411,2034),('2034-11-21',203447,11,2034,21,47,203411,2034),('2034-11-22',203447,11,2034,22,47,203411,2034),('2034-11-23',203447,11,2034,23,47,203411,2034),('2034-11-24',203447,11,2034,24,47,203411,2034),('2034-11-25',203447,11,2034,25,47,203411,2034),('2034-11-26',203448,11,2034,26,48,203411,2034),('2034-11-27',203448,11,2034,27,48,203411,2034),('2034-11-28',203448,11,2034,28,48,203411,2034),('2034-11-29',203448,11,2034,29,48,203411,2034),('2034-11-30',203448,11,2034,30,48,203411,2034),('2034-12-01',203448,12,2034,1,48,203412,2035),('2034-12-02',203448,12,2034,2,48,203412,2035),('2034-12-03',203449,12,2034,3,49,203412,2035),('2034-12-04',203449,12,2034,4,49,203412,2035),('2034-12-05',203449,12,2034,5,49,203412,2035),('2034-12-06',203449,12,2034,6,49,203412,2035),('2034-12-07',203449,12,2034,7,49,203412,2035),('2034-12-08',203449,12,2034,8,49,203412,2035),('2034-12-09',203449,12,2034,9,49,203412,2035),('2034-12-10',203450,12,2034,10,50,203412,2035),('2034-12-11',203450,12,2034,11,50,203412,2035),('2034-12-12',203450,12,2034,12,50,203412,2035),('2034-12-13',203450,12,2034,13,50,203412,2035),('2034-12-14',203450,12,2034,14,50,203412,2035),('2034-12-15',203450,12,2034,15,50,203412,2035),('2034-12-16',203450,12,2034,16,50,203412,2035),('2034-12-17',203451,12,2034,17,51,203412,2035),('2034-12-18',203451,12,2034,18,51,203412,2035),('2034-12-19',203451,12,2034,19,51,203412,2035),('2034-12-20',203451,12,2034,20,51,203412,2035),('2034-12-21',203451,12,2034,21,51,203412,2035),('2034-12-22',203451,12,2034,22,51,203412,2035),('2034-12-23',203451,12,2034,23,51,203412,2035),('2034-12-24',203452,12,2034,24,52,203412,2035),('2034-12-25',203452,12,2034,25,52,203412,2035),('2034-12-26',203452,12,2034,26,52,203412,2035),('2034-12-27',203452,12,2034,27,52,203412,2035),('2034-12-28',203452,12,2034,28,52,203412,2035),('2034-12-29',203452,12,2034,29,52,203412,2035),('2034-12-30',203452,12,2034,30,52,203412,2035),('2034-12-31',203453,12,2034,31,1,203412,2035),('2035-01-01',203501,1,2035,1,1,203501,2035),('2035-01-02',203501,1,2035,2,1,203501,2035),('2035-01-03',203501,1,2035,3,1,203501,2035),('2035-01-04',203501,1,2035,4,1,203501,2035),('2035-01-05',203501,1,2035,5,1,203501,2035),('2035-01-06',203501,1,2035,6,1,203501,2035),('2035-01-07',203502,1,2035,7,2,203501,2035),('2035-01-08',203502,1,2035,8,2,203501,2035),('2035-01-09',203502,1,2035,9,2,203501,2035),('2035-01-10',203502,1,2035,10,2,203501,2035),('2035-01-11',203502,1,2035,11,2,203501,2035),('2035-01-12',203502,1,2035,12,2,203501,2035),('2035-01-13',203502,1,2035,13,2,203501,2035),('2035-01-14',203503,1,2035,14,3,203501,2035),('2035-01-15',203503,1,2035,15,3,203501,2035),('2035-01-16',203503,1,2035,16,3,203501,2035),('2035-01-17',203503,1,2035,17,3,203501,2035),('2035-01-18',203503,1,2035,18,3,203501,2035),('2035-01-19',203503,1,2035,19,3,203501,2035),('2035-01-20',203503,1,2035,20,3,203501,2035),('2035-01-21',203504,1,2035,21,4,203501,2035),('2035-01-22',203504,1,2035,22,4,203501,2035),('2035-01-23',203504,1,2035,23,4,203501,2035),('2035-01-24',203504,1,2035,24,4,203501,2035),('2035-01-25',203504,1,2035,25,4,203501,2035),('2035-01-26',203504,1,2035,26,4,203501,2035),('2035-01-27',203504,1,2035,27,4,203501,2035),('2035-01-28',203505,1,2035,28,5,203501,2035),('2035-01-29',203505,1,2035,29,5,203501,2035),('2035-01-30',203505,1,2035,30,5,203501,2035),('2035-01-31',203505,1,2035,31,5,203501,2035),('2035-02-01',203505,2,2035,1,5,203502,2035),('2035-02-02',203505,2,2035,2,5,203502,2035),('2035-02-03',203505,2,2035,3,5,203502,2035),('2035-02-04',203506,2,2035,4,6,203502,2035),('2035-02-05',203506,2,2035,5,6,203502,2035),('2035-02-06',203506,2,2035,6,6,203502,2035),('2035-02-07',203506,2,2035,7,6,203502,2035),('2035-02-08',203506,2,2035,8,6,203502,2035),('2035-02-09',203506,2,2035,9,6,203502,2035),('2035-02-10',203506,2,2035,10,6,203502,2035),('2035-02-11',203507,2,2035,11,7,203502,2035),('2035-02-12',203507,2,2035,12,7,203502,2035),('2035-02-13',203507,2,2035,13,7,203502,2035),('2035-02-14',203507,2,2035,14,7,203502,2035),('2035-02-15',203507,2,2035,15,7,203502,2035),('2035-02-16',203507,2,2035,16,7,203502,2035),('2035-02-17',203507,2,2035,17,7,203502,2035),('2035-02-18',203508,2,2035,18,8,203502,2035),('2035-02-19',203508,2,2035,19,8,203502,2035),('2035-02-20',203508,2,2035,20,8,203502,2035),('2035-02-21',203508,2,2035,21,8,203502,2035),('2035-02-22',203508,2,2035,22,8,203502,2035),('2035-02-23',203508,2,2035,23,8,203502,2035),('2035-02-24',203508,2,2035,24,8,203502,2035),('2035-02-25',203509,2,2035,25,9,203502,2035),('2035-02-26',203509,2,2035,26,9,203502,2035),('2035-02-27',203509,2,2035,27,9,203502,2035),('2035-02-28',203509,2,2035,28,9,203502,2035),('2035-03-01',203509,3,2035,1,9,203503,2035),('2035-03-02',203509,3,2035,2,9,203503,2035),('2035-03-03',203509,3,2035,3,9,203503,2035),('2035-03-04',203510,3,2035,4,10,203503,2035),('2035-03-05',203510,3,2035,5,10,203503,2035),('2035-03-06',203510,3,2035,6,10,203503,2035),('2035-03-07',203510,3,2035,7,10,203503,2035),('2035-03-08',203510,3,2035,8,10,203503,2035),('2035-03-09',203510,3,2035,9,10,203503,2035),('2035-03-10',203510,3,2035,10,10,203503,2035),('2035-03-11',203511,3,2035,11,11,203503,2035),('2035-03-12',203511,3,2035,12,11,203503,2035),('2035-03-13',203511,3,2035,13,11,203503,2035),('2035-03-14',203511,3,2035,14,11,203503,2035),('2035-03-15',203511,3,2035,15,11,203503,2035),('2035-03-16',203511,3,2035,16,11,203503,2035),('2035-03-17',203511,3,2035,17,11,203503,2035),('2035-03-18',203512,3,2035,18,12,203503,2035),('2035-03-19',203512,3,2035,19,12,203503,2035),('2035-03-20',203512,3,2035,20,12,203503,2035),('2035-03-21',203512,3,2035,21,12,203503,2035),('2035-03-22',203512,3,2035,22,12,203503,2035),('2035-03-23',203512,3,2035,23,12,203503,2035),('2035-03-24',203512,3,2035,24,12,203503,2035),('2035-03-25',203513,3,2035,25,13,203503,2035),('2035-03-26',203513,3,2035,26,13,203503,2035),('2035-03-27',203513,3,2035,27,13,203503,2035),('2035-03-28',203513,3,2035,28,13,203503,2035),('2035-03-29',203513,3,2035,29,13,203503,2035),('2035-03-30',203513,3,2035,30,13,203503,2035),('2035-03-31',203513,3,2035,31,13,203503,2035),('2035-04-01',203514,4,2035,1,14,203504,2035),('2035-04-02',203514,4,2035,2,14,203504,2035),('2035-04-03',203514,4,2035,3,14,203504,2035),('2035-04-04',203514,4,2035,4,14,203504,2035),('2035-04-05',203514,4,2035,5,14,203504,2035),('2035-04-06',203514,4,2035,6,14,203504,2035),('2035-04-07',203514,4,2035,7,14,203504,2035),('2035-04-08',203515,4,2035,8,15,203504,2035),('2035-04-09',203515,4,2035,9,15,203504,2035),('2035-04-10',203515,4,2035,10,15,203504,2035),('2035-04-11',203515,4,2035,11,15,203504,2035),('2035-04-12',203515,4,2035,12,15,203504,2035),('2035-04-13',203515,4,2035,13,15,203504,2035),('2035-04-14',203515,4,2035,14,15,203504,2035),('2035-04-15',203516,4,2035,15,16,203504,2035),('2035-04-16',203516,4,2035,16,16,203504,2035),('2035-04-17',203516,4,2035,17,16,203504,2035),('2035-04-18',203516,4,2035,18,16,203504,2035),('2035-04-19',203516,4,2035,19,16,203504,2035),('2035-04-20',203516,4,2035,20,16,203504,2035),('2035-04-21',203516,4,2035,21,16,203504,2035),('2035-04-22',203517,4,2035,22,17,203504,2035),('2035-04-23',203517,4,2035,23,17,203504,2035),('2035-04-24',203517,4,2035,24,17,203504,2035),('2035-04-25',203517,4,2035,25,17,203504,2035),('2035-04-26',203517,4,2035,26,17,203504,2035),('2035-04-27',203517,4,2035,27,17,203504,2035),('2035-04-28',203517,4,2035,28,17,203504,2035),('2035-04-29',203518,4,2035,29,18,203504,2035),('2035-04-30',203518,4,2035,30,18,203504,2035),('2035-05-01',203518,5,2035,1,18,203505,2035),('2035-05-02',203518,5,2035,2,18,203505,2035),('2035-05-03',203518,5,2035,3,18,203505,2035),('2035-05-04',203518,5,2035,4,18,203505,2035),('2035-05-05',203518,5,2035,5,18,203505,2035),('2035-05-06',203519,5,2035,6,19,203505,2035),('2035-05-07',203519,5,2035,7,19,203505,2035),('2035-05-08',203519,5,2035,8,19,203505,2035),('2035-05-09',203519,5,2035,9,19,203505,2035),('2035-05-10',203519,5,2035,10,19,203505,2035),('2035-05-11',203519,5,2035,11,19,203505,2035),('2035-05-12',203519,5,2035,12,19,203505,2035),('2035-05-13',203520,5,2035,13,20,203505,2035),('2035-05-14',203520,5,2035,14,20,203505,2035),('2035-05-15',203520,5,2035,15,20,203505,2035),('2035-05-16',203520,5,2035,16,20,203505,2035),('2035-05-17',203520,5,2035,17,20,203505,2035),('2035-05-18',203520,5,2035,18,20,203505,2035),('2035-05-19',203520,5,2035,19,20,203505,2035),('2035-05-20',203521,5,2035,20,21,203505,2035),('2035-05-21',203521,5,2035,21,21,203505,2035),('2035-05-22',203521,5,2035,22,21,203505,2035),('2035-05-23',203521,5,2035,23,21,203505,2035),('2035-05-24',203521,5,2035,24,21,203505,2035),('2035-05-25',203521,5,2035,25,21,203505,2035),('2035-05-26',203521,5,2035,26,21,203505,2035),('2035-05-27',203522,5,2035,27,22,203505,2035),('2035-05-28',203522,5,2035,28,22,203505,2035),('2035-05-29',203522,5,2035,29,22,203505,2035),('2035-05-30',203522,5,2035,30,22,203505,2035),('2035-05-31',203522,5,2035,31,22,203505,2035),('2035-06-01',203522,6,2035,1,22,203506,2035),('2035-06-02',203522,6,2035,2,22,203506,2035),('2035-06-03',203523,6,2035,3,23,203506,2035),('2035-06-04',203523,6,2035,4,23,203506,2035),('2035-06-05',203523,6,2035,5,23,203506,2035),('2035-06-06',203523,6,2035,6,23,203506,2035),('2035-06-07',203523,6,2035,7,23,203506,2035),('2035-06-08',203523,6,2035,8,23,203506,2035),('2035-06-09',203523,6,2035,9,23,203506,2035),('2035-06-10',203524,6,2035,10,24,203506,2035),('2035-06-11',203524,6,2035,11,24,203506,2035),('2035-06-12',203524,6,2035,12,24,203506,2035),('2035-06-13',203524,6,2035,13,24,203506,2035),('2035-06-14',203524,6,2035,14,24,203506,2035),('2035-06-15',203524,6,2035,15,24,203506,2035),('2035-06-16',203524,6,2035,16,24,203506,2035),('2035-06-17',203525,6,2035,17,25,203506,2035),('2035-06-18',203525,6,2035,18,25,203506,2035),('2035-06-19',203525,6,2035,19,25,203506,2035),('2035-06-20',203525,6,2035,20,25,203506,2035),('2035-06-21',203525,6,2035,21,25,203506,2035),('2035-06-22',203525,6,2035,22,25,203506,2035),('2035-06-23',203525,6,2035,23,25,203506,2035),('2035-06-24',203526,6,2035,24,26,203506,2035),('2035-06-25',203526,6,2035,25,26,203506,2035),('2035-06-26',203526,6,2035,26,26,203506,2035),('2035-06-27',203526,6,2035,27,26,203506,2035),('2035-06-28',203526,6,2035,28,26,203506,2035),('2035-06-29',203526,6,2035,29,26,203506,2035),('2035-06-30',203526,6,2035,30,26,203506,2035),('2035-07-01',203527,7,2035,1,27,203507,2035),('2035-07-02',203527,7,2035,2,27,203507,2035),('2035-07-03',203527,7,2035,3,27,203507,2035),('2035-07-04',203527,7,2035,4,27,203507,2035),('2035-07-05',203527,7,2035,5,27,203507,2035),('2035-07-06',203527,7,2035,6,27,203507,2035),('2035-07-07',203527,7,2035,7,27,203507,2035),('2035-07-08',203528,7,2035,8,28,203507,2035),('2035-07-09',203528,7,2035,9,28,203507,2035),('2035-07-10',203528,7,2035,10,28,203507,2035),('2035-07-11',203528,7,2035,11,28,203507,2035),('2035-07-12',203528,7,2035,12,28,203507,2035),('2035-07-13',203528,7,2035,13,28,203507,2035),('2035-07-14',203528,7,2035,14,28,203507,2035),('2035-07-15',203529,7,2035,15,29,203507,2035),('2035-07-16',203529,7,2035,16,29,203507,2035),('2035-07-17',203529,7,2035,17,29,203507,2035),('2035-07-18',203529,7,2035,18,29,203507,2035),('2035-07-19',203529,7,2035,19,29,203507,2035),('2035-07-20',203529,7,2035,20,29,203507,2035),('2035-07-21',203529,7,2035,21,29,203507,2035),('2035-07-22',203530,7,2035,22,30,203507,2035),('2035-07-23',203530,7,2035,23,30,203507,2035),('2035-07-24',203530,7,2035,24,30,203507,2035),('2035-07-25',203530,7,2035,25,30,203507,2035),('2035-07-26',203530,7,2035,26,30,203507,2035),('2035-07-27',203530,7,2035,27,30,203507,2035),('2035-07-28',203530,7,2035,28,30,203507,2035),('2035-07-29',203531,7,2035,29,31,203507,2035),('2035-07-30',203531,7,2035,30,31,203507,2035),('2035-07-31',203531,7,2035,31,31,203507,2035),('2035-08-01',203531,8,2035,1,31,203508,2035),('2035-08-02',203531,8,2035,2,31,203508,2035),('2035-08-03',203531,8,2035,3,31,203508,2035),('2035-08-04',203531,8,2035,4,31,203508,2035),('2035-08-05',203532,8,2035,5,32,203508,2035),('2035-08-06',203532,8,2035,6,32,203508,2035),('2035-08-07',203532,8,2035,7,32,203508,2035),('2035-08-08',203532,8,2035,8,32,203508,2035),('2035-08-09',203532,8,2035,9,32,203508,2035),('2035-08-10',203532,8,2035,10,32,203508,2035),('2035-08-11',203532,8,2035,11,32,203508,2035),('2035-08-12',203533,8,2035,12,33,203508,2035),('2035-08-13',203533,8,2035,13,33,203508,2035),('2035-08-14',203533,8,2035,14,33,203508,2035),('2035-08-15',203533,8,2035,15,33,203508,2035),('2035-08-16',203533,8,2035,16,33,203508,2035),('2035-08-17',203533,8,2035,17,33,203508,2035),('2035-08-18',203533,8,2035,18,33,203508,2035),('2035-08-19',203534,8,2035,19,34,203508,2035),('2035-08-20',203534,8,2035,20,34,203508,2035),('2035-08-21',203534,8,2035,21,34,203508,2035),('2035-08-22',203534,8,2035,22,34,203508,2035),('2035-08-23',203534,8,2035,23,34,203508,2035),('2035-08-24',203534,8,2035,24,34,203508,2035),('2035-08-25',203534,8,2035,25,34,203508,2035),('2035-08-26',203535,8,2035,26,35,203508,2035),('2035-08-27',203535,8,2035,27,35,203508,2035),('2035-08-28',203535,8,2035,28,35,203508,2035),('2035-08-29',203535,8,2035,29,35,203508,2035),('2035-08-30',203535,8,2035,30,35,203508,2035),('2035-08-31',203535,8,2035,31,35,203508,2035),('2035-09-01',203535,9,2035,1,35,203509,2035),('2035-09-02',203536,9,2035,2,36,203509,2035),('2035-09-03',203536,9,2035,3,36,203509,2035),('2035-09-04',203536,9,2035,4,36,203509,2035),('2035-09-05',203536,9,2035,5,36,203509,2035),('2035-09-06',203536,9,2035,6,36,203509,2035),('2035-09-07',203536,9,2035,7,36,203509,2035),('2035-09-08',203536,9,2035,8,36,203509,2035),('2035-09-09',203537,9,2035,9,37,203509,2035),('2035-09-10',203537,9,2035,10,37,203509,2035),('2035-09-11',203537,9,2035,11,37,203509,2035),('2035-09-12',203537,9,2035,12,37,203509,2035),('2035-09-13',203537,9,2035,13,37,203509,2035),('2035-09-14',203537,9,2035,14,37,203509,2035),('2035-09-15',203537,9,2035,15,37,203509,2035),('2035-09-16',203538,9,2035,16,38,203509,2035),('2035-09-17',203538,9,2035,17,38,203509,2035),('2035-09-18',203538,9,2035,18,38,203509,2035),('2035-09-19',203538,9,2035,19,38,203509,2035),('2035-09-20',203538,9,2035,20,38,203509,2035),('2035-09-21',203538,9,2035,21,38,203509,2035),('2035-09-22',203538,9,2035,22,38,203509,2035),('2035-09-23',203539,9,2035,23,39,203509,2035),('2035-09-24',203539,9,2035,24,39,203509,2035),('2035-09-25',203539,9,2035,25,39,203509,2035),('2035-09-26',203539,9,2035,26,39,203509,2035),('2035-09-27',203539,9,2035,27,39,203509,2035),('2035-09-28',203539,9,2035,28,39,203509,2035),('2035-09-29',203539,9,2035,29,39,203509,2035),('2035-09-30',203540,9,2035,30,40,203509,2035),('2035-10-01',203540,10,2035,1,40,203510,2035),('2035-10-02',203540,10,2035,2,40,203510,2035),('2035-10-03',203540,10,2035,3,40,203510,2035),('2035-10-04',203540,10,2035,4,40,203510,2035),('2035-10-05',203540,10,2035,5,40,203510,2035),('2035-10-06',203540,10,2035,6,40,203510,2035),('2035-10-07',203541,10,2035,7,41,203510,2035),('2035-10-08',203541,10,2035,8,41,203510,2035),('2035-10-09',203541,10,2035,9,41,203510,2035),('2035-10-10',203541,10,2035,10,41,203510,2035),('2035-10-11',203541,10,2035,11,41,203510,2035),('2035-10-12',203541,10,2035,12,41,203510,2035),('2035-10-13',203541,10,2035,13,41,203510,2035),('2035-10-14',203542,10,2035,14,42,203510,2035),('2035-10-15',203542,10,2035,15,42,203510,2035),('2035-10-16',203542,10,2035,16,42,203510,2035),('2035-10-17',203542,10,2035,17,42,203510,2035),('2035-10-18',203542,10,2035,18,42,203510,2035),('2035-10-19',203542,10,2035,19,42,203510,2035),('2035-10-20',203542,10,2035,20,42,203510,2035),('2035-10-21',203543,10,2035,21,43,203510,2035),('2035-10-22',203543,10,2035,22,43,203510,2035),('2035-10-23',203543,10,2035,23,43,203510,2035),('2035-10-24',203543,10,2035,24,43,203510,2035),('2035-10-25',203543,10,2035,25,43,203510,2035),('2035-10-26',203543,10,2035,26,43,203510,2035),('2035-10-27',203543,10,2035,27,43,203510,2035),('2035-10-28',203544,10,2035,28,44,203510,2035),('2035-10-29',203544,10,2035,29,44,203510,2035),('2035-10-30',203544,10,2035,30,44,203510,2035),('2035-10-31',203544,10,2035,31,44,203510,2035),('2035-11-01',203544,11,2035,1,44,203511,2035),('2035-11-02',203544,11,2035,2,44,203511,2035),('2035-11-03',203544,11,2035,3,44,203511,2035),('2035-11-04',203545,11,2035,4,45,203511,2035),('2035-11-05',203545,11,2035,5,45,203511,2035),('2035-11-06',203545,11,2035,6,45,203511,2035),('2035-11-07',203545,11,2035,7,45,203511,2035),('2035-11-08',203545,11,2035,8,45,203511,2035),('2035-11-09',203545,11,2035,9,45,203511,2035),('2035-11-10',203545,11,2035,10,45,203511,2035),('2035-11-11',203546,11,2035,11,46,203511,2035),('2035-11-12',203546,11,2035,12,46,203511,2035),('2035-11-13',203546,11,2035,13,46,203511,2035),('2035-11-14',203546,11,2035,14,46,203511,2035),('2035-11-15',203546,11,2035,15,46,203511,2035),('2035-11-16',203546,11,2035,16,46,203511,2035),('2035-11-17',203546,11,2035,17,46,203511,2035),('2035-11-18',203547,11,2035,18,47,203511,2035),('2035-11-19',203547,11,2035,19,47,203511,2035),('2035-11-20',203547,11,2035,20,47,203511,2035),('2035-11-21',203547,11,2035,21,47,203511,2035),('2035-11-22',203547,11,2035,22,47,203511,2035),('2035-11-23',203547,11,2035,23,47,203511,2035),('2035-11-24',203547,11,2035,24,47,203511,2035),('2035-11-25',203548,11,2035,25,48,203511,2035),('2035-11-26',203548,11,2035,26,48,203511,2035),('2035-11-27',203548,11,2035,27,48,203511,2035),('2035-11-28',203548,11,2035,28,48,203511,2035),('2035-11-29',203548,11,2035,29,48,203511,2035),('2035-11-30',203548,11,2035,30,48,203511,2035),('2035-12-01',203548,12,2035,1,48,203512,2036),('2035-12-02',203549,12,2035,2,49,203512,2036),('2035-12-03',203549,12,2035,3,49,203512,2036),('2035-12-04',203549,12,2035,4,49,203512,2036),('2035-12-05',203549,12,2035,5,49,203512,2036),('2035-12-06',203549,12,2035,6,49,203512,2036),('2035-12-07',203549,12,2035,7,49,203512,2036),('2035-12-08',203549,12,2035,8,49,203512,2036),('2035-12-09',203550,12,2035,9,50,203512,2036),('2035-12-10',203550,12,2035,10,50,203512,2036),('2035-12-11',203550,12,2035,11,50,203512,2036),('2035-12-12',203550,12,2035,12,50,203512,2036),('2035-12-13',203550,12,2035,13,50,203512,2036),('2035-12-14',203550,12,2035,14,50,203512,2036),('2035-12-15',203550,12,2035,15,50,203512,2036),('2035-12-16',203551,12,2035,16,51,203512,2036),('2035-12-17',203551,12,2035,17,51,203512,2036),('2035-12-18',203551,12,2035,18,51,203512,2036),('2035-12-19',203551,12,2035,19,51,203512,2036),('2035-12-20',203551,12,2035,20,51,203512,2036),('2035-12-21',203551,12,2035,21,51,203512,2036),('2035-12-22',203551,12,2035,22,51,203512,2036),('2035-12-23',203552,12,2035,23,52,203512,2036),('2035-12-24',203552,12,2035,24,52,203512,2036),('2035-12-25',203552,12,2035,25,52,203512,2036),('2035-12-26',203552,12,2035,26,52,203512,2036),('2035-12-27',203552,12,2035,27,52,203512,2036),('2035-12-28',203552,12,2035,28,52,203512,2036),('2035-12-29',203552,12,2035,29,52,203512,2036),('2035-12-30',203553,12,2035,30,1,203512,2036),('2035-12-31',203501,12,2035,31,1,203512,2036),('2036-01-01',203601,1,2036,1,1,203601,2036),('2036-01-02',203601,1,2036,2,1,203601,2036),('2036-01-03',203601,1,2036,3,1,203601,2036),('2036-01-04',203601,1,2036,4,1,203601,2036),('2036-01-05',203601,1,2036,5,1,203601,2036),('2036-01-06',203602,1,2036,6,2,203601,2036),('2036-01-07',203602,1,2036,7,2,203601,2036),('2036-01-08',203602,1,2036,8,2,203601,2036),('2036-01-09',203602,1,2036,9,2,203601,2036),('2036-01-10',203602,1,2036,10,2,203601,2036),('2036-01-11',203602,1,2036,11,2,203601,2036),('2036-01-12',203602,1,2036,12,2,203601,2036),('2036-01-13',203603,1,2036,13,3,203601,2036),('2036-01-14',203603,1,2036,14,3,203601,2036),('2036-01-15',203603,1,2036,15,3,203601,2036),('2036-01-16',203603,1,2036,16,3,203601,2036),('2036-01-17',203603,1,2036,17,3,203601,2036),('2036-01-18',203603,1,2036,18,3,203601,2036),('2036-01-19',203603,1,2036,19,3,203601,2036),('2036-01-20',203604,1,2036,20,4,203601,2036),('2036-01-21',203604,1,2036,21,4,203601,2036),('2036-01-22',203604,1,2036,22,4,203601,2036),('2036-01-23',203604,1,2036,23,4,203601,2036),('2036-01-24',203604,1,2036,24,4,203601,2036),('2036-01-25',203604,1,2036,25,4,203601,2036),('2036-01-26',203604,1,2036,26,4,203601,2036),('2036-01-27',203605,1,2036,27,5,203601,2036),('2036-01-28',203605,1,2036,28,5,203601,2036),('2036-01-29',203605,1,2036,29,5,203601,2036),('2036-01-30',203605,1,2036,30,5,203601,2036),('2036-01-31',203605,1,2036,31,5,203601,2036),('2036-02-01',203605,2,2036,1,5,203602,2036),('2036-02-02',203605,2,2036,2,5,203602,2036),('2036-02-03',203606,2,2036,3,6,203602,2036),('2036-02-04',203606,2,2036,4,6,203602,2036),('2036-02-05',203606,2,2036,5,6,203602,2036),('2036-02-06',203606,2,2036,6,6,203602,2036),('2036-02-07',203606,2,2036,7,6,203602,2036),('2036-02-08',203606,2,2036,8,6,203602,2036),('2036-02-09',203606,2,2036,9,6,203602,2036),('2036-02-10',203607,2,2036,10,7,203602,2036),('2036-02-11',203607,2,2036,11,7,203602,2036),('2036-02-12',203607,2,2036,12,7,203602,2036),('2036-02-13',203607,2,2036,13,7,203602,2036),('2036-02-14',203607,2,2036,14,7,203602,2036),('2036-02-15',203607,2,2036,15,7,203602,2036),('2036-02-16',203607,2,2036,16,7,203602,2036),('2036-02-17',203608,2,2036,17,8,203602,2036),('2036-02-18',203608,2,2036,18,8,203602,2036),('2036-02-19',203608,2,2036,19,8,203602,2036),('2036-02-20',203608,2,2036,20,8,203602,2036),('2036-02-21',203608,2,2036,21,8,203602,2036),('2036-02-22',203608,2,2036,22,8,203602,2036),('2036-02-23',203608,2,2036,23,8,203602,2036),('2036-02-24',203609,2,2036,24,9,203602,2036),('2036-02-25',203609,2,2036,25,9,203602,2036),('2036-02-26',203609,2,2036,26,9,203602,2036),('2036-02-27',203609,2,2036,27,9,203602,2036),('2036-02-28',203609,2,2036,28,9,203602,2036),('2036-02-29',203609,2,2036,29,9,203602,2036),('2036-03-01',203609,3,2036,1,9,203603,2036),('2036-03-02',203610,3,2036,2,10,203603,2036),('2036-03-03',203610,3,2036,3,10,203603,2036),('2036-03-04',203610,3,2036,4,10,203603,2036),('2036-03-05',203610,3,2036,5,10,203603,2036),('2036-03-06',203610,3,2036,6,10,203603,2036),('2036-03-07',203610,3,2036,7,10,203603,2036),('2036-03-08',203610,3,2036,8,10,203603,2036),('2036-03-09',203611,3,2036,9,11,203603,2036),('2036-03-10',203611,3,2036,10,11,203603,2036),('2036-03-11',203611,3,2036,11,11,203603,2036),('2036-03-12',203611,3,2036,12,11,203603,2036),('2036-03-13',203611,3,2036,13,11,203603,2036),('2036-03-14',203611,3,2036,14,11,203603,2036),('2036-03-15',203611,3,2036,15,11,203603,2036),('2036-03-16',203612,3,2036,16,12,203603,2036),('2036-03-17',203612,3,2036,17,12,203603,2036),('2036-03-18',203612,3,2036,18,12,203603,2036),('2036-03-19',203612,3,2036,19,12,203603,2036),('2036-03-20',203612,3,2036,20,12,203603,2036),('2036-03-21',203612,3,2036,21,12,203603,2036),('2036-03-22',203612,3,2036,22,12,203603,2036),('2036-03-23',203613,3,2036,23,13,203603,2036),('2036-03-24',203613,3,2036,24,13,203603,2036),('2036-03-25',203613,3,2036,25,13,203603,2036),('2036-03-26',203613,3,2036,26,13,203603,2036),('2036-03-27',203613,3,2036,27,13,203603,2036),('2036-03-28',203613,3,2036,28,13,203603,2036),('2036-03-29',203613,3,2036,29,13,203603,2036),('2036-03-30',203614,3,2036,30,14,203603,2036),('2036-03-31',203614,3,2036,31,14,203603,2036),('2036-04-01',203614,4,2036,1,14,203604,2036),('2036-04-02',203614,4,2036,2,14,203604,2036),('2036-04-03',203614,4,2036,3,14,203604,2036),('2036-04-04',203614,4,2036,4,14,203604,2036),('2036-04-05',203614,4,2036,5,14,203604,2036),('2036-04-06',203615,4,2036,6,15,203604,2036),('2036-04-07',203615,4,2036,7,15,203604,2036),('2036-04-08',203615,4,2036,8,15,203604,2036),('2036-04-09',203615,4,2036,9,15,203604,2036),('2036-04-10',203615,4,2036,10,15,203604,2036),('2036-04-11',203615,4,2036,11,15,203604,2036),('2036-04-12',203615,4,2036,12,15,203604,2036),('2036-04-13',203616,4,2036,13,16,203604,2036),('2036-04-14',203616,4,2036,14,16,203604,2036),('2036-04-15',203616,4,2036,15,16,203604,2036),('2036-04-16',203616,4,2036,16,16,203604,2036),('2036-04-17',203616,4,2036,17,16,203604,2036),('2036-04-18',203616,4,2036,18,16,203604,2036),('2036-04-19',203616,4,2036,19,16,203604,2036),('2036-04-20',203617,4,2036,20,17,203604,2036),('2036-04-21',203617,4,2036,21,17,203604,2036),('2036-04-22',203617,4,2036,22,17,203604,2036),('2036-04-23',203617,4,2036,23,17,203604,2036),('2036-04-24',203617,4,2036,24,17,203604,2036),('2036-04-25',203617,4,2036,25,17,203604,2036),('2036-04-26',203617,4,2036,26,17,203604,2036),('2036-04-27',203618,4,2036,27,18,203604,2036),('2036-04-28',203618,4,2036,28,18,203604,2036),('2036-04-29',203618,4,2036,29,18,203604,2036),('2036-04-30',203618,4,2036,30,18,203604,2036),('2036-05-01',203618,5,2036,1,18,203605,2036),('2036-05-02',203618,5,2036,2,18,203605,2036),('2036-05-03',203618,5,2036,3,18,203605,2036),('2036-05-04',203619,5,2036,4,19,203605,2036),('2036-05-05',203619,5,2036,5,19,203605,2036),('2036-05-06',203619,5,2036,6,19,203605,2036),('2036-05-07',203619,5,2036,7,19,203605,2036),('2036-05-08',203619,5,2036,8,19,203605,2036),('2036-05-09',203619,5,2036,9,19,203605,2036),('2036-05-10',203619,5,2036,10,19,203605,2036),('2036-05-11',203620,5,2036,11,20,203605,2036),('2036-05-12',203620,5,2036,12,20,203605,2036),('2036-05-13',203620,5,2036,13,20,203605,2036),('2036-05-14',203620,5,2036,14,20,203605,2036),('2036-05-15',203620,5,2036,15,20,203605,2036),('2036-05-16',203620,5,2036,16,20,203605,2036),('2036-05-17',203620,5,2036,17,20,203605,2036),('2036-05-18',203621,5,2036,18,21,203605,2036),('2036-05-19',203621,5,2036,19,21,203605,2036),('2036-05-20',203621,5,2036,20,21,203605,2036),('2036-05-21',203621,5,2036,21,21,203605,2036),('2036-05-22',203621,5,2036,22,21,203605,2036),('2036-05-23',203621,5,2036,23,21,203605,2036),('2036-05-24',203621,5,2036,24,21,203605,2036),('2036-05-25',203622,5,2036,25,22,203605,2036),('2036-05-26',203622,5,2036,26,22,203605,2036),('2036-05-27',203622,5,2036,27,22,203605,2036),('2036-05-28',203622,5,2036,28,22,203605,2036),('2036-05-29',203622,5,2036,29,22,203605,2036),('2036-05-30',203622,5,2036,30,22,203605,2036),('2036-05-31',203622,5,2036,31,22,203605,2036),('2036-06-01',203623,6,2036,1,23,203606,2036),('2036-06-02',203623,6,2036,2,23,203606,2036),('2036-06-03',203623,6,2036,3,23,203606,2036),('2036-06-04',203623,6,2036,4,23,203606,2036),('2036-06-05',203623,6,2036,5,23,203606,2036),('2036-06-06',203623,6,2036,6,23,203606,2036),('2036-06-07',203623,6,2036,7,23,203606,2036),('2036-06-08',203624,6,2036,8,24,203606,2036),('2036-06-09',203624,6,2036,9,24,203606,2036),('2036-06-10',203624,6,2036,10,24,203606,2036),('2036-06-11',203624,6,2036,11,24,203606,2036),('2036-06-12',203624,6,2036,12,24,203606,2036),('2036-06-13',203624,6,2036,13,24,203606,2036),('2036-06-14',203624,6,2036,14,24,203606,2036),('2036-06-15',203625,6,2036,15,25,203606,2036),('2036-06-16',203625,6,2036,16,25,203606,2036),('2036-06-17',203625,6,2036,17,25,203606,2036),('2036-06-18',203625,6,2036,18,25,203606,2036),('2036-06-19',203625,6,2036,19,25,203606,2036),('2036-06-20',203625,6,2036,20,25,203606,2036),('2036-06-21',203625,6,2036,21,25,203606,2036),('2036-06-22',203626,6,2036,22,26,203606,2036),('2036-06-23',203626,6,2036,23,26,203606,2036),('2036-06-24',203626,6,2036,24,26,203606,2036),('2036-06-25',203626,6,2036,25,26,203606,2036),('2036-06-26',203626,6,2036,26,26,203606,2036),('2036-06-27',203626,6,2036,27,26,203606,2036),('2036-06-28',203626,6,2036,28,26,203606,2036),('2036-06-29',203627,6,2036,29,27,203606,2036),('2036-06-30',203627,6,2036,30,27,203606,2036),('2036-07-01',203627,7,2036,1,27,203607,2036),('2036-07-02',203627,7,2036,2,27,203607,2036),('2036-07-03',203627,7,2036,3,27,203607,2036),('2036-07-04',203627,7,2036,4,27,203607,2036),('2036-07-05',203627,7,2036,5,27,203607,2036),('2036-07-06',203628,7,2036,6,28,203607,2036),('2036-07-07',203628,7,2036,7,28,203607,2036),('2036-07-08',203628,7,2036,8,28,203607,2036),('2036-07-09',203628,7,2036,9,28,203607,2036),('2036-07-10',203628,7,2036,10,28,203607,2036),('2036-07-11',203628,7,2036,11,28,203607,2036),('2036-07-12',203628,7,2036,12,28,203607,2036),('2036-07-13',203629,7,2036,13,29,203607,2036),('2036-07-14',203629,7,2036,14,29,203607,2036),('2036-07-15',203629,7,2036,15,29,203607,2036),('2036-07-16',203629,7,2036,16,29,203607,2036),('2036-07-17',203629,7,2036,17,29,203607,2036),('2036-07-18',203629,7,2036,18,29,203607,2036),('2036-07-19',203629,7,2036,19,29,203607,2036),('2036-07-20',203630,7,2036,20,30,203607,2036),('2036-07-21',203630,7,2036,21,30,203607,2036),('2036-07-22',203630,7,2036,22,30,203607,2036),('2036-07-23',203630,7,2036,23,30,203607,2036),('2036-07-24',203630,7,2036,24,30,203607,2036),('2036-07-25',203630,7,2036,25,30,203607,2036),('2036-07-26',203630,7,2036,26,30,203607,2036),('2036-07-27',203631,7,2036,27,31,203607,2036),('2036-07-28',203631,7,2036,28,31,203607,2036),('2036-07-29',203631,7,2036,29,31,203607,2036),('2036-07-30',203631,7,2036,30,31,203607,2036),('2036-07-31',203631,7,2036,31,31,203607,2036),('2036-08-01',203631,8,2036,1,31,203608,2036),('2036-08-02',203631,8,2036,2,31,203608,2036),('2036-08-03',203632,8,2036,3,32,203608,2036),('2036-08-04',203632,8,2036,4,32,203608,2036),('2036-08-05',203632,8,2036,5,32,203608,2036),('2036-08-06',203632,8,2036,6,32,203608,2036),('2036-08-07',203632,8,2036,7,32,203608,2036),('2036-08-08',203632,8,2036,8,32,203608,2036),('2036-08-09',203632,8,2036,9,32,203608,2036),('2036-08-10',203633,8,2036,10,33,203608,2036),('2036-08-11',203633,8,2036,11,33,203608,2036),('2036-08-12',203633,8,2036,12,33,203608,2036),('2036-08-13',203633,8,2036,13,33,203608,2036),('2036-08-14',203633,8,2036,14,33,203608,2036),('2036-08-15',203633,8,2036,15,33,203608,2036),('2036-08-16',203633,8,2036,16,33,203608,2036),('2036-08-17',203634,8,2036,17,34,203608,2036),('2036-08-18',203634,8,2036,18,34,203608,2036),('2036-08-19',203634,8,2036,19,34,203608,2036),('2036-08-20',203634,8,2036,20,34,203608,2036),('2036-08-21',203634,8,2036,21,34,203608,2036),('2036-08-22',203634,8,2036,22,34,203608,2036),('2036-08-23',203634,8,2036,23,34,203608,2036),('2036-08-24',203635,8,2036,24,35,203608,2036),('2036-08-25',203635,8,2036,25,35,203608,2036),('2036-08-26',203635,8,2036,26,35,203608,2036),('2036-08-27',203635,8,2036,27,35,203608,2036),('2036-08-28',203635,8,2036,28,35,203608,2036),('2036-08-29',203635,8,2036,29,35,203608,2036),('2036-08-30',203635,8,2036,30,35,203608,2036),('2036-08-31',203636,8,2036,31,36,203608,2036),('2036-09-01',203636,9,2036,1,36,203609,2036),('2036-09-02',203636,9,2036,2,36,203609,2036),('2036-09-03',203636,9,2036,3,36,203609,2036),('2036-09-04',203636,9,2036,4,36,203609,2036),('2036-09-05',203636,9,2036,5,36,203609,2036),('2036-09-06',203636,9,2036,6,36,203609,2036),('2036-09-07',203637,9,2036,7,37,203609,2036),('2036-09-08',203637,9,2036,8,37,203609,2036),('2036-09-09',203637,9,2036,9,37,203609,2036),('2036-09-10',203637,9,2036,10,37,203609,2036),('2036-09-11',203637,9,2036,11,37,203609,2036),('2036-09-12',203637,9,2036,12,37,203609,2036),('2036-09-13',203637,9,2036,13,37,203609,2036),('2036-09-14',203638,9,2036,14,38,203609,2036),('2036-09-15',203638,9,2036,15,38,203609,2036),('2036-09-16',203638,9,2036,16,38,203609,2036),('2036-09-17',203638,9,2036,17,38,203609,2036),('2036-09-18',203638,9,2036,18,38,203609,2036),('2036-09-19',203638,9,2036,19,38,203609,2036),('2036-09-20',203638,9,2036,20,38,203609,2036),('2036-09-21',203639,9,2036,21,39,203609,2036),('2036-09-22',203639,9,2036,22,39,203609,2036),('2036-09-23',203639,9,2036,23,39,203609,2036),('2036-09-24',203639,9,2036,24,39,203609,2036),('2036-09-25',203639,9,2036,25,39,203609,2036),('2036-09-26',203639,9,2036,26,39,203609,2036),('2036-09-27',203639,9,2036,27,39,203609,2036),('2036-09-28',203640,9,2036,28,40,203609,2036),('2036-09-29',203640,9,2036,29,40,203609,2036),('2036-09-30',203640,9,2036,30,40,203609,2036),('2036-10-01',203640,10,2036,1,40,203610,2036),('2036-10-02',203640,10,2036,2,40,203610,2036),('2036-10-03',203640,10,2036,3,40,203610,2036),('2036-10-04',203640,10,2036,4,40,203610,2036),('2036-10-05',203641,10,2036,5,41,203610,2036),('2036-10-06',203641,10,2036,6,41,203610,2036),('2036-10-07',203641,10,2036,7,41,203610,2036),('2036-10-08',203641,10,2036,8,41,203610,2036),('2036-10-09',203641,10,2036,9,41,203610,2036),('2036-10-10',203641,10,2036,10,41,203610,2036),('2036-10-11',203641,10,2036,11,41,203610,2036),('2036-10-12',203642,10,2036,12,42,203610,2036),('2036-10-13',203642,10,2036,13,42,203610,2036),('2036-10-14',203642,10,2036,14,42,203610,2036),('2036-10-15',203642,10,2036,15,42,203610,2036),('2036-10-16',203642,10,2036,16,42,203610,2036),('2036-10-17',203642,10,2036,17,42,203610,2036),('2036-10-18',203642,10,2036,18,42,203610,2036),('2036-10-19',203643,10,2036,19,43,203610,2036),('2036-10-20',203643,10,2036,20,43,203610,2036),('2036-10-21',203643,10,2036,21,43,203610,2036),('2036-10-22',203643,10,2036,22,43,203610,2036),('2036-10-23',203643,10,2036,23,43,203610,2036),('2036-10-24',203643,10,2036,24,43,203610,2036),('2036-10-25',203643,10,2036,25,43,203610,2036),('2036-10-26',203644,10,2036,26,44,203610,2036),('2036-10-27',203644,10,2036,27,44,203610,2036),('2036-10-28',203644,10,2036,28,44,203610,2036),('2036-10-29',203644,10,2036,29,44,203610,2036),('2036-10-30',203644,10,2036,30,44,203610,2036),('2036-10-31',203644,10,2036,31,44,203610,2036),('2036-11-01',203644,11,2036,1,44,203611,2036),('2036-11-02',203645,11,2036,2,45,203611,2036),('2036-11-03',203645,11,2036,3,45,203611,2036),('2036-11-04',203645,11,2036,4,45,203611,2036),('2036-11-05',203645,11,2036,5,45,203611,2036),('2036-11-06',203645,11,2036,6,45,203611,2036),('2036-11-07',203645,11,2036,7,45,203611,2036),('2036-11-08',203645,11,2036,8,45,203611,2036),('2036-11-09',203646,11,2036,9,46,203611,2036),('2036-11-10',203646,11,2036,10,46,203611,2036),('2036-11-11',203646,11,2036,11,46,203611,2036),('2036-11-12',203646,11,2036,12,46,203611,2036),('2036-11-13',203646,11,2036,13,46,203611,2036),('2036-11-14',203646,11,2036,14,46,203611,2036),('2036-11-15',203646,11,2036,15,46,203611,2036),('2036-11-16',203647,11,2036,16,47,203611,2036),('2036-11-17',203647,11,2036,17,47,203611,2036),('2036-11-18',203647,11,2036,18,47,203611,2036),('2036-11-19',203647,11,2036,19,47,203611,2036),('2036-11-20',203647,11,2036,20,47,203611,2036),('2036-11-21',203647,11,2036,21,47,203611,2036),('2036-11-22',203647,11,2036,22,47,203611,2036),('2036-11-23',203648,11,2036,23,48,203611,2036),('2036-11-24',203648,11,2036,24,48,203611,2036),('2036-11-25',203648,11,2036,25,48,203611,2036),('2036-11-26',203648,11,2036,26,48,203611,2036),('2036-11-27',203648,11,2036,27,48,203611,2036),('2036-11-28',203648,11,2036,28,48,203611,2036),('2036-11-29',203648,11,2036,29,48,203611,2036),('2036-11-30',203649,11,2036,30,49,203611,2036),('2036-12-01',203649,12,2036,1,49,203612,2037),('2036-12-02',203649,12,2036,2,49,203612,2037),('2036-12-03',203649,12,2036,3,49,203612,2037),('2036-12-04',203649,12,2036,4,49,203612,2037),('2036-12-05',203649,12,2036,5,49,203612,2037),('2036-12-06',203649,12,2036,6,49,203612,2037),('2036-12-07',203650,12,2036,7,50,203612,2037),('2036-12-08',203650,12,2036,8,50,203612,2037),('2036-12-09',203650,12,2036,9,50,203612,2037),('2036-12-10',203650,12,2036,10,50,203612,2037),('2036-12-11',203650,12,2036,11,50,203612,2037),('2036-12-12',203650,12,2036,12,50,203612,2037),('2036-12-13',203650,12,2036,13,50,203612,2037),('2036-12-14',203651,12,2036,14,51,203612,2037),('2036-12-15',203651,12,2036,15,51,203612,2037),('2036-12-16',203651,12,2036,16,51,203612,2037),('2036-12-17',203651,12,2036,17,51,203612,2037),('2036-12-18',203651,12,2036,18,51,203612,2037),('2036-12-19',203651,12,2036,19,51,203612,2037),('2036-12-20',203651,12,2036,20,51,203612,2037),('2036-12-21',203652,12,2036,21,52,203612,2037),('2036-12-22',203652,12,2036,22,52,203612,2037),('2036-12-23',203652,12,2036,23,52,203612,2037),('2036-12-24',203652,12,2036,24,52,203612,2037),('2036-12-25',203652,12,2036,25,52,203612,2037),('2036-12-26',203652,12,2036,26,52,203612,2037),('2036-12-27',203652,12,2036,27,52,203612,2037),('2036-12-28',203653,12,2036,28,53,203612,2037),('2036-12-29',203601,12,2036,29,53,203612,2037),('2036-12-30',203601,12,2036,30,53,203612,2037); /*!40000 ALTER TABLE `time` ENABLE KEYS */; UNLOCK TABLES; @@ -13539,8 +480,7 @@ UNLOCK TABLES; LOCK TABLES `volumeConfig` WRITE; /*!40000 ALTER TABLE `volumeConfig` DISABLE KEYS */; -INSERT INTO `volumeConfig` VALUES -(2.67,1.60,0.8,150,0.30,120,57,2.0,0,200,0,167.0); +INSERT INTO `volumeConfig` VALUES (2.67,1.60,0.8,150,0.30,120,57,2.0,0,200,0,167.0); /*!40000 ALTER TABLE `volumeConfig` ENABLE KEYS */; UNLOCK TABLES; @@ -13550,16 +490,7 @@ UNLOCK TABLES; LOCK TABLES `workCenter` WRITE; /*!40000 ALTER TABLE `workCenter` DISABLE KEYS */; -INSERT INTO `workCenter` VALUES -(1,'Silla',20,859,1,'Av espioca 100',552703,NULL), -(2,'Mercaflor',19,NULL,NULL,NULL,NULL,NULL), -(3,'Marjales',26,20008,NULL,NULL,NULL,NULL), -(4,'VNH',NULL,NULL,NULL,NULL,NULL,NULL), -(5,'Madrid',28,2869,5,'Av constitución 3',554145,0.50), -(6,'Vilassar',88,88038,NULL,'Cami del Crist, 33',556412,NULL), -(7,'Tenerife',NULL,NULL,NULL,NULL,NULL,NULL), -(8,'Silla-Agrario',26,NULL,NULL,NULL,NULL,NULL), -(9,'Algemesi',20,1354,60,'Fenollars, 2',523549,NULL); +INSERT INTO `workCenter` VALUES (1,'Silla',20,859,1,'Av espioca 100',552703,NULL),(2,'Mercaflor',19,NULL,NULL,NULL,NULL,NULL),(3,'Marjales',26,20008,NULL,NULL,NULL,NULL),(4,'VNH',NULL,NULL,NULL,NULL,NULL,NULL),(5,'Madrid',28,2869,5,'Av constitución 3',554145,0.50),(6,'Vilassar',88,88038,NULL,'Cami del Crist, 33',556412,NULL),(7,'Tenerife',NULL,NULL,NULL,NULL,NULL,NULL),(8,'Silla-Agrario',26,NULL,NULL,NULL,NULL,NULL),(9,'Algemesi',20,1354,60,'Fenollars, 2',523549,NULL); /*!40000 ALTER TABLE `workCenter` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -13571,13 +502,13 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2022-11-21 7:59:05 +-- Dump completed on 2023-02-20 14:45:54 USE `cache`; --- MariaDB dump 10.19 Distrib 10.9.4-MariaDB, for Linux (x86_64) +-- MariaDB dump 10.19 Distrib 10.5.18-MariaDB, for debian-linux-gnu (x86_64) -- --- Host: db.verdnatura.es Database: cache +-- Host: db-proxy.verdnatura.es Database: cache -- ------------------------------------------------------ --- Server version 10.7.6-MariaDB-1:10.7.6+maria~deb11-log +-- Server version 10.7.7-MariaDB-1:10.7.7+maria~deb11-log /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -13595,21 +526,7 @@ USE `cache`; LOCK TABLES `cache` WRITE; /*!40000 ALTER TABLE `cache` DISABLE KEYS */; -INSERT INTO `cache` VALUES -(1,'equalizator','00:19:00'), -(2,'available','00:06:00'), -(3,'stock','00:30:00'), -(4,'last_buy','23:59:00'), -(5,'weekly_sales','12:00:00'), -(6,'bionic','00:06:00'), -(7,'sales','00:04:00'), -(8,'visible','00:04:00'), -(9,'item_range','00:03:00'), -(10,'barcodes','01:00:00'), -(11,'prod_graphic','00:17:00'), -(12,'ticketShipping','00:01:00'), -(13,'availableNoRaids','00:06:00'), -(14,'lastBuy','23:59:00'); +INSERT INTO `cache` VALUES (1,'equalizator','00:19:00'),(2,'available','00:06:00'),(3,'stock','00:30:00'),(4,'last_buy','23:59:00'),(5,'weekly_sales','12:00:00'),(6,'bionic','00:06:00'),(7,'sales','00:04:00'),(8,'visible','00:04:00'),(9,'item_range','00:03:00'),(10,'barcodes','01:00:00'),(11,'prod_graphic','00:17:00'),(12,'ticketShipping','00:01:00'),(13,'availableNoRaids','00:06:00'),(14,'lastBuy','23:59:00'); /*!40000 ALTER TABLE `cache` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -13621,13 +538,13 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2022-11-21 7:59:06 +-- Dump completed on 2023-02-20 14:45:55 USE `hedera`; --- MariaDB dump 10.19 Distrib 10.9.4-MariaDB, for Linux (x86_64) +-- MariaDB dump 10.19 Distrib 10.5.18-MariaDB, for debian-linux-gnu (x86_64) -- --- Host: db.verdnatura.es Database: hedera +-- Host: db-proxy.verdnatura.es Database: hedera -- ------------------------------------------------------ --- Server version 10.7.6-MariaDB-1:10.7.6+maria~deb11-log +-- Server version 10.7.7-MariaDB-1:10.7.7+maria~deb11-log /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -13645,12 +562,7 @@ USE `hedera`; LOCK TABLES `browser` WRITE; /*!40000 ALTER TABLE `browser` DISABLE KEYS */; -INSERT INTO `browser` VALUES -('Chrome',49), -('Edge',79), -('Firefox',69), -('Opera',36), -('Safari',11); +INSERT INTO `browser` VALUES ('Chrome',49),('Edge',79),('Firefox',69),('Opera',36),('Safari',11); /*!40000 ALTER TABLE `browser` ENABLE KEYS */; UNLOCK TABLES; @@ -13660,11 +572,7 @@ UNLOCK TABLES; LOCK TABLES `imageCollection` WRITE; /*!40000 ALTER TABLE `imageCollection` DISABLE KEYS */; -INSERT INTO `imageCollection` VALUES -(1,'catalog','Artículo',3840,2160,'Item','image','vn','item','image',1,75), -(4,'link','Enlace',200,200,'Link','image','hedera','link','image',1,9), -(5,'news','Noticias',800,1200,'New','image','hedera','news','image',1,9), -(6,'user','Usuario',800,1200,'Account','image','account','user','image',1,74); +INSERT INTO `imageCollection` VALUES (1,'catalog','Artículo',3840,2160,'Item','image','vn','item','image',1,75),(4,'link','Enlace',200,200,'Link','image','hedera','link','image',1,9),(5,'news','Noticias',800,1200,'New','image','hedera','news','image',1,9),(6,'user','Usuario',800,1200,'Account','image','account','user','image',1,74); /*!40000 ALTER TABLE `imageCollection` ENABLE KEYS */; UNLOCK TABLES; @@ -13674,17 +582,7 @@ UNLOCK TABLES; LOCK TABLES `imageCollectionSize` WRITE; /*!40000 ALTER TABLE `imageCollectionSize` DISABLE KEYS */; -INSERT INTO `imageCollectionSize` VALUES -(2,1,50,50,1), -(3,1,200,200,1), -(5,5,200,200,1), -(6,1,70,70,1), -(8,5,50,50,1), -(9,1,1600,900,0), -(13,6,160,160,1), -(14,6,520,520,1), -(15,6,1600,1600,1), -(16,1,500,500,1); +INSERT INTO `imageCollectionSize` VALUES (2,1,50,50,1),(3,1,200,200,1),(5,5,200,200,1),(6,1,70,70,1),(8,5,50,50,1),(9,1,1600,900,0),(13,6,160,160,1),(14,6,520,520,1),(15,6,1600,1600,1),(16,1,500,500,1); /*!40000 ALTER TABLE `imageCollectionSize` ENABLE KEYS */; UNLOCK TABLES; @@ -13694,13 +592,7 @@ UNLOCK TABLES; LOCK TABLES `language` WRITE; /*!40000 ALTER TABLE `language` DISABLE KEYS */; -INSERT INTO `language` VALUES -('ca','Català','Catalan',1), -('en','English','English',1), -('es','Español','Spanish',1), -('fr','Français','French',1), -('mn','Португалий','Mongolian',1), -('pt','Português','Portuguese',1); +INSERT INTO `language` VALUES ('ca','Català','Catalan',1),('en','English','English',1),('es','Español','Spanish',1),('fr','Français','French',1),('mn','Португалий','Mongolian',1),('pt','Português','Portuguese',1); /*!40000 ALTER TABLE `language` ENABLE KEYS */; UNLOCK TABLES; @@ -13710,43 +602,17 @@ UNLOCK TABLES; LOCK TABLES `link` WRITE; /*!40000 ALTER TABLE `link` DISABLE KEYS */; -INSERT INTO `link` VALUES -(16,'Printing server','Manage the CUPS printing server','http://server.verdnatura.es:631','printer'), -(20,'Webmail','Verdnatura webmail','https://webmail.verdnatura.es/','mail'), -(23,'Verdnatura Beta','Trial version of the web page','https://test.verdnatura.es/','vn'), -(25,'Shared folder','Shared folder','/share','backup'), -(29,'phpMyAdmin','Manage MySQL database','https://pma.verdnatura.es/','pma'), -(30,'Nagios','Monitoring system','https://nagios.verdnatura.es/','nagios'), -(33,'Gitea','Version control system','https://gitea.verdnatura.es/','git'), -(34,'Wiknatura','Verdnatura wiki page','https://wiki.verdnatura.es/','wiki'), -(35,'phpLDAPadmin','Manage the LDAP database','https://pla.verdnatura.es/','pla'), -(36,'Applications','Access applications repository','/vn-access','backup'); +INSERT INTO `link` VALUES (16,'Printing server','Manage the CUPS printing server','http://printnatura.verdnatura.es','printer'),(20,'Webmail','Verdnatura webmail','https://webmail.verdnatura.es/','mail'),(23,'Verdnatura Beta','Trial version of the web page','https://test-shop.verdnatura.es/','vn'),(25,'Shared folder','Shared folder','https://cdn.verdnatura.es/share','backup'),(29,'phpMyAdmin','Manage MySQL database','https://pma.verdnatura.es/','pma'),(30,'Nagios','Monitoring system','https://nagios.verdnatura.es/','nagios'),(33,'Gitea','Version control system','https://gitea.verdnatura.es/','git'),(34,'Wiknatura','Verdnatura wiki page','https://wiki.verdnatura.es/','wiki'),(35,'phpLDAPadmin','Manage the LDAP database','https://pla.verdnatura.es/','pla'),(36,'Applications','Access applications repository','https://cdn.verdnatura.es/vn-access','access'),(37,'Jenkins','CI and CD system','https://jenkins.verdnatura.es','jenkins'),(38,'osTicket','User service center','https://cau.verdnatura.es','osticket'),(39,'Redmine','Flexible project management','https://redmine.verdnatura.es','redmine'),(40,'Grafana','Analytics & monitoring solution','https://grafana.verdnatura.es','grafana'),(41,'Rocket.Chat','Communications platform','https://chat.verdnatura.es','rocketchat'),(42,'Salix','ERP software','https://salix.verdnatura.es','salix'),(43,'Docker','Container management','https://docker.verdnatura.es','docker'),(44,'Proxmox','Virtual environment','https://proxmox.verdnatura.es','proxmox'),(45,'Shinobi','Network video recorder','https://shinobi.verdnatura.es','shinobi'),(46,'DokuWiki','Internal documentation','https://doku.verdnatura.es','dokuwiki'); /*!40000 ALTER TABLE `link` ENABLE KEYS */; UNLOCK TABLES; --- --- Manual Dumping data for table `agencyTermConfig` --- -LOCK TABLES `agencyTermConfig` WRITE; -/*!40000 ALTER TABLE `agencyTermConfig` DISABLE KEYS */; -INSERT INTO `vn`.`agencyTermConfig` (`expenceFk`, `vatAccountSupported`, `vatPercentage`, `transaction`) - VALUES - ('6240000000', '4721000015', 21.0000000000, 'Adquisiciones intracomunitarias de servicios'); -/*!40000 ALTER TABLE `agencyTermConfig` ENABLE KEYS */; -UNLOCK TABLES; - -- -- Dumping data for table `location` -- LOCK TABLES `location` WRITE; /*!40000 ALTER TABLE `location` DISABLE KEYS */; -INSERT INTO `location` VALUES -(2,'39.2095886','-0.4173501','Valencia','Calle Fenollar, 2','46680','Algemesi','Valencia','963 242 100','es'), -(3,'40.4564969','-3.4875829','Madrid','Avenida de la Constitución, 3 - Nave E','28850','Torrejón de Ardoz','Madrid','963 242 100',NULL), -(4,'41.4962045','2.3765504','Barcelona','Camí del crist, 33','08340','Vilassar de Mar','Barcelona','607 562 391','ca'), -(5,'52.2612312','4.7818154','Holland','Aalsmeer Flower Auction','1430 BA','Legmeerdijk 313','Aalsmeer','Nederland','nl'), -(6,'43.4375416','5.2261456','Marseille','ruben@verdnatura.es','13054','Marigname','Marseille','+33 781 533 900','fr'); +INSERT INTO `location` VALUES (2,'39.2095886','-0.4173501','Valencia','Calle Fenollar, 2','46680','Algemesi','Valencia','963 242 100','es'),(3,'40.4564969','-3.4875829','Madrid','Avenida de la Constitución, 3 - Nave E','28850','Torrejón de Ardoz','Madrid','963 242 100',NULL),(4,'41.4962045','2.3765504','Barcelona','Camí del crist, 33','08340','Vilassar de Mar','Barcelona','607 562 391','ca'),(5,'52.2612312','4.7818154','Holland','Aalsmeer Flower Auction','1430 BA','Legmeerdijk 313','Aalsmeer','Nederland','nl'),(6,'43.4375416','5.2261456','Marseille','ruben@verdnatura.es','13054','Marigname','Marseille','+33 781 533 900','fr'); /*!40000 ALTER TABLE `location` ENABLE KEYS */; UNLOCK TABLES; @@ -13756,27 +622,7 @@ UNLOCK TABLES; LOCK TABLES `menu` WRITE; /*!40000 ALTER TABLE `menu` DISABLE KEYS */; -INSERT INTO `menu` VALUES -(1,'Home','cms/home',6,NULL,1), -(2,'Orders',NULL,11,NULL,1), -(3,'Catalog','ecomerce/catalog',6,NULL,2), -(7,'Administration',NULL,1,NULL,2), -(8,'Users','admin/users',1,7,2), -(9,'Connections','admin/connections',1,7,2), -(11,'Agencies','agencies/packages',3,NULL,2), -(12,'News','news/news',1,7,3), -(15,'Photos','admin/photos',1,7,3), -(17,'Configuration',NULL,11,NULL,3), -(19,'Control panel','admin/links',1,7,1), -(21,'Basket','ecomerce/basket',11,NULL,1), -(22,'Last orders','ecomerce/orders',11,2,2), -(23,'Invoices','ecomerce/invoices',11,2,2), -(24,'Account','account/conf',11,17,1), -(25,'Addresses','account/address-list',11,17,2), -(26,'Shelves','reports/shelves',1,29,1), -(28,'Visits','admin/visits',1,7,2), -(29,'Reports',NULL,1,NULL,2), -(30,'Items','admin/items',1,7,3); +INSERT INTO `menu` VALUES (1,'Home','cms/home',6,NULL,1),(2,'Orders',NULL,11,NULL,1),(3,'Catalog','ecomerce/catalog',6,NULL,2),(7,'Administration',NULL,1,NULL,2),(8,'Users','admin/users',1,7,2),(9,'Connections','admin/connections',1,7,2),(11,'Agencies','agencies/packages',3,NULL,2),(12,'News','news/news',1,7,3),(15,'Photos','admin/photos',1,7,3),(17,'Configuration',NULL,11,NULL,3),(19,'Control panel','admin/links',1,7,1),(21,'Basket','ecomerce/basket',11,NULL,1),(22,'Last orders','ecomerce/orders',11,2,2),(23,'Invoices','ecomerce/invoices',11,2,2),(24,'Account','account/conf',11,17,1),(25,'Addresses','account/address-list',11,17,2),(26,'Shelves','reports/shelves',1,29,1),(28,'Visits','admin/visits',1,7,2),(29,'Reports',NULL,1,NULL,2),(30,'Items','admin/items',1,7,3); /*!40000 ALTER TABLE `menu` ENABLE KEYS */; UNLOCK TABLES; @@ -13786,23 +632,7 @@ UNLOCK TABLES; LOCK TABLES `message` WRITE; /*!40000 ALTER TABLE `message` DISABLE KEYS */; -INSERT INTO `message` VALUES -(1,'ORDER_DATE_HOLIDAY','No es posible realizar pedidos para días festivos'), -(2,'ORDER_EMPTY','El pedido esta vacío'), -(3,'ORDER_UNAVAILABLE','Algunos artículos ya no están disponibles, verifica las cantidades resaltadas en rojo'), -(4,'SURVEY_MAX_ONE_VOTE','Solo es posible realizar un voto por encuesta'), -(5,'ORDER_MAX_EXCEEDED','Has excedido el número máximo de pedidos por confirmar, por favor elimina o confirma los pedidos iniciados'), -(6,'LOGIN_INCORRECT','Usuario o contraseña incorrectos. Recuerda que se hace distinción entre mayúsculas y minúsculas.'), -(7,'ORDER_DATE_PAST','La fecha de su pedido debe ser mayor o igual al día de hoy'), -(8,'ORDER_DATE_LAST','No es posible realizar más para hoy, por favor atrasa la fecha de tu pedido a mañana o días posteriores'), -(9,'ORDER_DATE_SUNDAY','No es posible confirmar pedidos para Domingo'), -(10,'ORDER_DATE_SATURATED','Estamos saturados de pedidos, por favor selecciona otra fecha de envío o recogida '), -(11,'USER_DISCONNECTED','Has sido desconectado del servidor, por favor vuelve a iniciar sesión'), -(12,'UNAUTH_ACTION','Acción no permitida'), -(13,'ORDER_INVALID_AGENCY','La agencia de envío no es válida'), -(14,'ORDER_EMPTY_ADDRESS','Selecciona una dirección de envío'), -(15,'ORDER_AMOUNT_ROUNDED','Este artículo se vende agrupado y la cantidad ha sido redondeada'), -(16,'ORDER_ALREADY_CONFIRMED','Este pedido ya estaba confirmado'); +INSERT INTO `message` VALUES (1,'ORDER_DATE_HOLIDAY','No es posible realizar pedidos para días festivos'),(2,'ORDER_EMPTY','El pedido esta vacío'),(3,'ORDER_UNAVAILABLE','Algunos artículos ya no están disponibles, verifica las cantidades resaltadas en rojo'),(4,'SURVEY_MAX_ONE_VOTE','Solo es posible realizar un voto por encuesta'),(5,'ORDER_MAX_EXCEEDED','Has excedido el número máximo de pedidos por confirmar, por favor elimina o confirma los pedidos iniciados'),(6,'LOGIN_INCORRECT','Usuario o contraseña incorrectos. Recuerda que se hace distinción entre mayúsculas y minúsculas.'),(7,'ORDER_DATE_PAST','La fecha de su pedido debe ser mayor o igual al día de hoy'),(8,'ORDER_DATE_LAST','No es posible realizar más para hoy, por favor atrasa la fecha de tu pedido a mañana o días posteriores'),(9,'ORDER_DATE_SUNDAY','No es posible confirmar pedidos para Domingo'),(10,'ORDER_DATE_SATURATED','Estamos saturados de pedidos, por favor selecciona otra fecha de envío o recogida '),(11,'USER_DISCONNECTED','Has sido desconectado del servidor, por favor vuelve a iniciar sesión'),(12,'UNAUTH_ACTION','Acción no permitida'),(13,'ORDER_INVALID_AGENCY','La agencia de envío no es válida'),(14,'ORDER_EMPTY_ADDRESS','Selecciona una dirección de envío'),(15,'ORDER_AMOUNT_ROUNDED','Este artículo se vende agrupado y la cantidad ha sido redondeada'),(16,'ORDER_ALREADY_CONFIRMED','Este pedido ya estaba confirmado'); /*!40000 ALTER TABLE `message` ENABLE KEYS */; UNLOCK TABLES; @@ -13812,15 +642,7 @@ UNLOCK TABLES; LOCK TABLES `metatag` WRITE; /*!40000 ALTER TABLE `metatag` DISABLE KEYS */; -INSERT INTO `metatag` VALUES -(2,'title','Verdnatura Levante SL, mayorista de flores, plantas y complementos para floristería y decoración'), -(3,'description','Verdnatura Levante SL, mayorista de flores, plantas y complementos para floristería y decoración. Envío a toda España, pedidos por internet o por teléfono.'), -(4,'keywords','verdnatura, mayorista, floristería, flores, verdes, plantas, ramos, complementos, artificial, natural, decoración, rosas, helecho, fern, clavel, lilium, orquídea, tulipan, crisantemo, cala, gerbera, hiedra, eucaliptus, cinerea, aralia'), -(6,'revisit-after','15 days'), -(7,'rating','general'), -(8,'author','Juan Ferrer Toribio'), -(9,'owner','Verdnatura Levante S.L.'), -(10,'robots','index, follow'); +INSERT INTO `metatag` VALUES (2,'title','Verdnatura Levante SL, mayorista de flores, plantas y complementos para floristería y decoración'),(3,'description','Verdnatura Levante SL, mayorista de flores, plantas y complementos para floristería y decoración. Envío a toda España, pedidos por internet o por teléfono.'),(4,'keywords','verdnatura, mayorista, floristería, flores, verdes, plantas, ramos, complementos, artificial, natural, decoración, rosas, helecho, fern, clavel, lilium, orquídea, tulipan, crisantemo, cala, gerbera, hiedra, eucaliptus, cinerea, aralia'),(6,'revisit-after','15 days'),(7,'rating','general'),(8,'author','Juan Ferrer Toribio'),(9,'owner','Verdnatura Levante S.L.'),(10,'robots','index, follow'); /*!40000 ALTER TABLE `metatag` ENABLE KEYS */; UNLOCK TABLES; @@ -13830,10 +652,7 @@ UNLOCK TABLES; LOCK TABLES `newsTag` WRITE; /*!40000 ALTER TABLE `newsTag` DISABLE KEYS */; -INSERT INTO `newsTag` VALUES -('course','Curso'), -('new','Noticia'), -('offer','Oferta'); +INSERT INTO `newsTag` VALUES ('course','Curso'),('new','Noticia'),('offer','Oferta'); /*!40000 ALTER TABLE `newsTag` ENABLE KEYS */; UNLOCK TABLES; @@ -13843,23 +662,7 @@ UNLOCK TABLES; LOCK TABLES `restPriv` WRITE; /*!40000 ALTER TABLE `restPriv` DISABLE KEYS */; -INSERT INTO `restPriv` VALUES -(1,'tpv/transaction',2), -(3,'image/upload',1), -(5,'user/supplant',104), -(10,'misc/captcha',NULL), -(11,'core/log',NULL), -(14,'core/query',NULL), -(15,'user/recover-password',NULL), -(16,'user/restore-password',NULL), -(17,'dms/invoice',2), -(18,'image/thumb',NULL), -(19,'misc/contact',NULL), -(20,'misc/production',NULL), -(21,'tpv/confirm-post',NULL), -(22,'tpv/confirm-soap',NULL), -(23,'client/supplant',18), -(24,'client/supplant',35); +INSERT INTO `restPriv` VALUES (1,'tpv/transaction',2),(3,'image/upload',1),(5,'user/supplant',104),(10,'misc/captcha',NULL),(11,'core/log',NULL),(14,'core/query',NULL),(15,'user/recover-password',NULL),(16,'user/restore-password',NULL),(17,'dms/invoice',2),(18,'image/thumb',NULL),(19,'misc/contact',NULL),(20,'misc/production',NULL),(21,'tpv/confirm-post',NULL),(22,'tpv/confirm-soap',NULL),(23,'client/supplant',18),(24,'client/supplant',35); /*!40000 ALTER TABLE `restPriv` ENABLE KEYS */; UNLOCK TABLES; @@ -13869,14 +672,7 @@ UNLOCK TABLES; LOCK TABLES `social` WRITE; /*!40000 ALTER TABLE `social` DISABLE KEYS */; -INSERT INTO `social` VALUES -(1,'Blog','https://blog.verdnatura.es/','blog.svg',0), -(3,'Facebook','http://www.facebook.com/verdnatura','facebook.svg',2), -(4,'YouTube','http://www.youtube.com/user/verdnatura','youtube.svg',2), -(5,'Twitter','https://twitter.com/Verdnatura','twitter.svg',1), -(6,'Instagram','https://www.instagram.com/verdnatura','instagram.svg',2), -(7,'Linkedin','https://www.linkedin.com/company/verdnatura','linkedin.svg',1), -(8,'Pinterest','https://es.pinterest.com/verdnatura/','pinterest.svg',1); +INSERT INTO `social` VALUES (1,'Blog','https://blog.verdnatura.es/','blog.svg',0),(3,'Facebook','http://www.facebook.com/verdnatura','facebook.svg',2),(4,'YouTube','http://www.youtube.com/user/verdnatura','youtube.svg',2),(5,'Twitter','https://twitter.com/Verdnatura','twitter.svg',1),(6,'Instagram','https://www.instagram.com/verdnatura','instagram.svg',2),(7,'Linkedin','https://www.linkedin.com/company/verdnatura','linkedin.svg',1),(8,'Pinterest','https://es.pinterest.com/verdnatura/','pinterest.svg',1); /*!40000 ALTER TABLE `social` ENABLE KEYS */; UNLOCK TABLES; @@ -13886,89 +682,7 @@ UNLOCK TABLES; LOCK TABLES `tpvError` WRITE; /*!40000 ALTER TABLE `tpvError` DISABLE KEYS */; -INSERT INTO `tpvError` VALUES -('SIS0007','Error al desmontar el XML de entrada'), -('SIS0008','Error falta Ds_Merchant_MerchantCode'), -('SIS0009','Error de formato en Ds_Merchant_MerchantCode'), -('SIS0010','Error falta Ds_Merchant_Terminal'), -('SIS0011','Error de formato en Ds_Merchant_Terminal'), -('SIS0014','Error de formato en Ds_Merchant_Order'), -('SIS0015','Error falta Ds_Merchant_Currency'), -('SIS0016','Error de formato en Ds_Merchant_Currency'), -('SIS0017','Error no se admite operaciones en pesetas'), -('SIS0018','Error falta Ds_Merchant_Amount'), -('SIS0019','Error de formato en Ds_Merchant_Amount'), -('SIS0020','Error falta Ds_Merchant_MerchantSignature'), -('SIS0021','Error la Ds_Merchant_MerchantSignature viene vacía'), -('SIS0022','Error de formato en Ds_Merchant_TransactionType'), -('SIS0023','Error Ds_Merchant_TransactionType desconocido'), -('SIS0024','Error Ds_Merchant_ConsumerLanguage tiene más de 3 posiciones'), -('SIS0026','Error No existe el comercio / terminal enviado'), -('SIS0027','Error Moneda enviada por el comercio es diferente a la que tiene asignada para ese terminal'), -('SIS0028','Error Comercio / terminal está dado de baja'), -('SIS0030','Error en un pago con tarjeta ha llegado un tipo de operación no valido'), -('SIS0031','Método de pago no definido'), -('SIS0034','Error de acceso a la Base de Datos'), -('SIS0038','Error en java'), -('SIS0040','Error el comercio / terminal no tiene ningún método de pago asignado'), -('SIS0041','Error en el cálculo de la firma de datos del comercio'), -('SIS0042','La firma enviada no es correcta'), -('SIS0046','El BIN de la tarjeta no está dado de alta'), -('SIS0051','Error número de pedido repetido'), -('SIS0054','Error no existe operación sobre la que realizar la devolución'), -('SIS0055','Error no existe más de un pago con el mismo número de pedido'), -('SIS0056','La operación sobre la que se desea devolver no está autorizada'), -('SIS0057','El importe a devolver supera el permitido'), -('SIS0058','Inconsistencia de datos, en la validación de una confirmación'), -('SIS0059','Error no existe operación sobre la que realizar la devolución'), -('SIS0060','Ya existe una confirmación asociada a la preautorización'), -('SIS0061','La preautorización sobre la que se desea confirmar no está autorizada'), -('SIS0062','El importe a confirmar supera el permitido'), -('SIS0063','Error. Número de tarjeta no disponible'), -('SIS0064','Error. El número de tarjeta no puede tener más de 19 posiciones'), -('SIS0065','Error. El número de tarjeta no es numérico'), -('SIS0066','Error. Mes de caducidad no disponible'), -('SIS0067','Error. El mes de la caducidad no es numérico'), -('SIS0068','Error. El mes de la caducidad no es válido'), -('SIS0069','Error. Año de caducidad no disponible'), -('SIS0070','Error. El Año de la caducidad no es numérico'), -('SIS0071','Tarjeta caducada'), -('SIS0072','Operación no anulable'), -('SIS0074','Error falta Ds_Merchant_Order'), -('SIS0075','Error el Ds_Merchant_Order tiene menos de 4 posiciones o más de 12'), -('SIS0076','Error el Ds_Merchant_Order no tiene las cuatro primeras posiciones numéricas'), -('SIS0078','Método de pago no disponible'), -('SIS0079','Error al realizar el pago con tarjeta'), -('SIS0081','La sesión es nueva, se han perdido los datos almacenados'), -('SIS0089','El valor de Ds_Merchant_ExpiryDate no ocupa 4 posiciones'), -('SIS0092','El valor de Ds_Merchant_ExpiryDate es nulo'), -('SIS0093','Tarjeta no encontrada en la tabla de rangos'), -('SIS0112','Error. El tipo de transacción especificado en Ds_Merchant_Transaction_Type no esta permitido'), -('SIS0115','Error no existe operación sobre la que realizar el pago de la cuota'), -('SIS0116','La operación sobre la que se desea pagar una cuota no es una operación válida'), -('SIS0117','La operación sobre la que se desea pagar una cuota no está autorizada'), -('SIS0118','Se ha excedido el importe total de las cuotas'), -('SIS0119','Valor del campo Ds_Merchant_DateFrecuency no válido'), -('SIS0120','Valor del campo Ds_Merchant_CargeExpiryDate no válido'), -('SIS0121','Valor del campo Ds_Merchant_SumTotal no válido'), -('SIS0122','Valor del campo Ds_merchant_DateFrecuency o Ds_Merchant_SumTotal tiene formato incorrecto'), -('SIS0123','Se ha excedido la fecha tope para realizar transacciones'), -('SIS0124','No ha transcurrido la frecuencia mínima en un pago recurrente sucesivo'), -('SIS0132','La fecha de Confirmación de Autorización no puede superar en más de 7 días a la de Preautorización'), -('SIS0139','Error el pago recurrente inicial está duplicado SIS0142 Tiempo excedido para el pago'), -('SIS0216','Error Ds_Merchant_CVV2 tiene mas de 3/4 posiciones'), -('SIS0217','Error de formato en Ds_Merchant_CVV2'), -('SIS0221','Error el CVV2 es obligatorio'), -('SIS0222','Ya existe una anulación asociada a la preautorización'), -('SIS0223','La preautorización que se desea anular no está autorizada'), -('SIS0225','Error no existe operación sobre la que realizar la anulación'), -('SIS0226','Inconsistencia de datos, en la validación de una anulación'), -('SIS0227','Valor del campo Ds_Merchan_TransactionDate no válido'), -('SIS0252','El comercio no permite el envío de tarjeta'), -('SIS0253','La tarjeta no cumple el check-digit'), -('SIS0261','Operación detenida por superar el control de restricciones en la entrada al SIS'), -('SIS0274','Tipo de operación desconocida o no permitida por esta entrada al SIS'), -('SIS9915','A petición del usuario se ha cancelado el pago'); +INSERT INTO `tpvError` VALUES ('SIS0007','Error al desmontar el XML de entrada'),('SIS0008','Error falta Ds_Merchant_MerchantCode'),('SIS0009','Error de formato en Ds_Merchant_MerchantCode'),('SIS0010','Error falta Ds_Merchant_Terminal'),('SIS0011','Error de formato en Ds_Merchant_Terminal'),('SIS0014','Error de formato en Ds_Merchant_Order'),('SIS0015','Error falta Ds_Merchant_Currency'),('SIS0016','Error de formato en Ds_Merchant_Currency'),('SIS0017','Error no se admite operaciones en pesetas'),('SIS0018','Error falta Ds_Merchant_Amount'),('SIS0019','Error de formato en Ds_Merchant_Amount'),('SIS0020','Error falta Ds_Merchant_MerchantSignature'),('SIS0021','Error la Ds_Merchant_MerchantSignature viene vacía'),('SIS0022','Error de formato en Ds_Merchant_TransactionType'),('SIS0023','Error Ds_Merchant_TransactionType desconocido'),('SIS0024','Error Ds_Merchant_ConsumerLanguage tiene más de 3 posiciones'),('SIS0026','Error No existe el comercio / terminal enviado'),('SIS0027','Error Moneda enviada por el comercio es diferente a la que tiene asignada para ese terminal'),('SIS0028','Error Comercio / terminal está dado de baja'),('SIS0030','Error en un pago con tarjeta ha llegado un tipo de operación no valido'),('SIS0031','Método de pago no definido'),('SIS0034','Error de acceso a la Base de Datos'),('SIS0038','Error en java'),('SIS0040','Error el comercio / terminal no tiene ningún método de pago asignado'),('SIS0041','Error en el cálculo de la firma de datos del comercio'),('SIS0042','La firma enviada no es correcta'),('SIS0046','El BIN de la tarjeta no está dado de alta'),('SIS0051','Error número de pedido repetido'),('SIS0054','Error no existe operación sobre la que realizar la devolución'),('SIS0055','Error no existe más de un pago con el mismo número de pedido'),('SIS0056','La operación sobre la que se desea devolver no está autorizada'),('SIS0057','El importe a devolver supera el permitido'),('SIS0058','Inconsistencia de datos, en la validación de una confirmación'),('SIS0059','Error no existe operación sobre la que realizar la devolución'),('SIS0060','Ya existe una confirmación asociada a la preautorización'),('SIS0061','La preautorización sobre la que se desea confirmar no está autorizada'),('SIS0062','El importe a confirmar supera el permitido'),('SIS0063','Error. Número de tarjeta no disponible'),('SIS0064','Error. El número de tarjeta no puede tener más de 19 posiciones'),('SIS0065','Error. El número de tarjeta no es numérico'),('SIS0066','Error. Mes de caducidad no disponible'),('SIS0067','Error. El mes de la caducidad no es numérico'),('SIS0068','Error. El mes de la caducidad no es válido'),('SIS0069','Error. Año de caducidad no disponible'),('SIS0070','Error. El Año de la caducidad no es numérico'),('SIS0071','Tarjeta caducada'),('SIS0072','Operación no anulable'),('SIS0074','Error falta Ds_Merchant_Order'),('SIS0075','Error el Ds_Merchant_Order tiene menos de 4 posiciones o más de 12'),('SIS0076','Error el Ds_Merchant_Order no tiene las cuatro primeras posiciones numéricas'),('SIS0078','Método de pago no disponible'),('SIS0079','Error al realizar el pago con tarjeta'),('SIS0081','La sesión es nueva, se han perdido los datos almacenados'),('SIS0089','El valor de Ds_Merchant_ExpiryDate no ocupa 4 posiciones'),('SIS0092','El valor de Ds_Merchant_ExpiryDate es nulo'),('SIS0093','Tarjeta no encontrada en la tabla de rangos'),('SIS0112','Error. El tipo de transacción especificado en Ds_Merchant_Transaction_Type no esta permitido'),('SIS0115','Error no existe operación sobre la que realizar el pago de la cuota'),('SIS0116','La operación sobre la que se desea pagar una cuota no es una operación válida'),('SIS0117','La operación sobre la que se desea pagar una cuota no está autorizada'),('SIS0118','Se ha excedido el importe total de las cuotas'),('SIS0119','Valor del campo Ds_Merchant_DateFrecuency no válido'),('SIS0120','Valor del campo Ds_Merchant_CargeExpiryDate no válido'),('SIS0121','Valor del campo Ds_Merchant_SumTotal no válido'),('SIS0122','Valor del campo Ds_merchant_DateFrecuency o Ds_Merchant_SumTotal tiene formato incorrecto'),('SIS0123','Se ha excedido la fecha tope para realizar transacciones'),('SIS0124','No ha transcurrido la frecuencia mínima en un pago recurrente sucesivo'),('SIS0132','La fecha de Confirmación de Autorización no puede superar en más de 7 días a la de Preautorización'),('SIS0139','Error el pago recurrente inicial está duplicado SIS0142 Tiempo excedido para el pago'),('SIS0216','Error Ds_Merchant_CVV2 tiene mas de 3/4 posiciones'),('SIS0217','Error de formato en Ds_Merchant_CVV2'),('SIS0221','Error el CVV2 es obligatorio'),('SIS0222','Ya existe una anulación asociada a la preautorización'),('SIS0223','La preautorización que se desea anular no está autorizada'),('SIS0225','Error no existe operación sobre la que realizar la anulación'),('SIS0226','Inconsistencia de datos, en la validación de una anulación'),('SIS0227','Valor del campo Ds_Merchan_TransactionDate no válido'),('SIS0252','El comercio no permite el envío de tarjeta'),('SIS0253','La tarjeta no cumple el check-digit'),('SIS0261','Operación detenida por superar el control de restricciones en la entrada al SIS'),('SIS0274','Tipo de operación desconocida o no permitida por esta entrada al SIS'),('SIS9915','A petición del usuario se ha cancelado el pago'); /*!40000 ALTER TABLE `tpvError` ENABLE KEYS */; UNLOCK TABLES; @@ -13978,44 +692,7 @@ UNLOCK TABLES; LOCK TABLES `tpvResponse` WRITE; /*!40000 ALTER TABLE `tpvResponse` DISABLE KEYS */; -INSERT INTO `tpvResponse` VALUES -(101,'Tarjeta Caducada'), -(102,'Tarjeta en excepción transitoria o bajo sospecha de fraude'), -(104,'Operación no permitida para esa tarjeta o terminal'), -(106,'Intentos de PIN excedidos'), -(116,'Disponible Insuficiente'), -(118,'Tarjeta no Registrada'), -(125,'Tarjeta no efectiva'), -(129,'Código de seguridad (CVV2/CVC2) incorrecto'), -(180,'Tarjeta ajena al servicio'), -(184,'Error en la autenticación del titular'), -(190,'Denegación sin especificar motivo'), -(191,'Fecha de caducidad errónea'), -(202,'Tarjeta en excepción transitoria o bajo sospecha de fraude con retirada de tarjeta'), -(904,'Comercio no registrado en FUC'), -(909,'Error de sistema'), -(912,'Emisor no Disponible'), -(913,'Pedido repetido'), -(944,'Sesión Incorrecta'), -(950,'Operación de devolución no permitida'), -(9064,'Número de posiciones de la tarjeta incorrecto'), -(9078,'No existe método de pago válido para esa tarjeta'), -(9093,'Tarjeta no existente'), -(9094,'Rechazo servidores internacionales'), -(9104,'A petición del usuario se ha cancelado el pago'), -(9218,'El comercio no permite op. seguras por entrada /operaciones'), -(9253,'Tarjeta no cumple el check-digit'), -(9256,'El comercio no puede realizar preautorizaciones'), -(9257,'Esta tarjeta no permite operativa de preautorizaciones'), -(9261,'Operación detenida por superar el control de restricciones en la entrada al SIS'), -(9912,'Emisor no Disponible'), -(9913,'Error en la confirmación que el comercio envía al TPV Virtual (solo aplicable en la opción de sincronización SOAP)'), -(9914,'Confirmación “KO” del comercio (solo aplicable en la opción de sincronización SOAP)'), -(9915,'A petición del usuario se ha cancelado el pago'), -(9928,'Anulación de autorización en diferido realizada por el SIS (proceso batch)'), -(9929,'Anulación de autorización en diferido realizada por el comercio'), -(9998,'Operación en proceso de solicitud de datos de tarjeta'), -(9999,'Operación que ha sido redirigida al emisora autenticar'); +INSERT INTO `tpvResponse` VALUES (101,'Tarjeta Caducada'),(102,'Tarjeta en excepción transitoria o bajo sospecha de fraude'),(104,'Operación no permitida para esa tarjeta o terminal'),(106,'Intentos de PIN excedidos'),(116,'Disponible Insuficiente'),(118,'Tarjeta no Registrada'),(125,'Tarjeta no efectiva'),(129,'Código de seguridad (CVV2/CVC2) incorrecto'),(180,'Tarjeta ajena al servicio'),(184,'Error en la autenticación del titular'),(190,'Denegación sin especificar motivo'),(191,'Fecha de caducidad errónea'),(202,'Tarjeta en excepción transitoria o bajo sospecha de fraude con retirada de tarjeta'),(904,'Comercio no registrado en FUC'),(909,'Error de sistema'),(912,'Emisor no Disponible'),(913,'Pedido repetido'),(944,'Sesión Incorrecta'),(950,'Operación de devolución no permitida'),(9064,'Número de posiciones de la tarjeta incorrecto'),(9078,'No existe método de pago válido para esa tarjeta'),(9093,'Tarjeta no existente'),(9094,'Rechazo servidores internacionales'),(9104,'A petición del usuario se ha cancelado el pago'),(9218,'El comercio no permite op. seguras por entrada /operaciones'),(9253,'Tarjeta no cumple el check-digit'),(9256,'El comercio no puede realizar preautorizaciones'),(9257,'Esta tarjeta no permite operativa de preautorizaciones'),(9261,'Operación detenida por superar el control de restricciones en la entrada al SIS'),(9912,'Emisor no Disponible'),(9913,'Error en la confirmación que el comercio envía al TPV Virtual (solo aplicable en la opción de sincronización SOAP)'),(9914,'Confirmación “KO” del comercio (solo aplicable en la opción de sincronización SOAP)'),(9915,'A petición del usuario se ha cancelado el pago'),(9928,'Anulación de autorización en diferido realizada por el SIS (proceso batch)'),(9929,'Anulación de autorización en diferido realizada por el comercio'),(9998,'Operación en proceso de solicitud de datos de tarjeta'),(9999,'Operación que ha sido redirigida al emisora autenticar'); /*!40000 ALTER TABLE `tpvResponse` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -14027,13 +704,13 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2022-11-21 7:59:06 +-- Dump completed on 2023-02-20 14:45:56 USE `postgresql`; --- MariaDB dump 10.19 Distrib 10.9.4-MariaDB, for Linux (x86_64) +-- MariaDB dump 10.19 Distrib 10.5.18-MariaDB, for debian-linux-gnu (x86_64) -- --- Host: db.verdnatura.es Database: postgresql +-- Host: db-proxy.verdnatura.es Database: postgresql -- ------------------------------------------------------ --- Server version 10.7.6-MariaDB-1:10.7.6+maria~deb11-log +-- Server version 10.7.7-MariaDB-1:10.7.7+maria~deb11-log /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -14051,39 +728,7 @@ USE `postgresql`; LOCK TABLES `calendar_labour_type` WRITE; /*!40000 ALTER TABLE `calendar_labour_type` DISABLE KEYS */; -INSERT INTO `calendar_labour_type` VALUES -(1,'Horario general','00:20:00',40,0), -(2,'Horario 35h/semana','00:20:00',35,1), -(3,'Horario 20h/semana','00:00:00',20,1), -(4,'Festivo y Fin de semana','00:00:00',0,1), -(5,'Horario 30h/semana','00:20:00',30,1), -(6,'Horario 25h/semana','00:20:00',25,1), -(7,'Vacaciones trabajadas','00:00:00',0,1), -(8,'Vacaciones','00:00:00',0,1), -(9,'Horario 26h/semana','00:20:00',26,1), -(10,'Horario 28h/semana','00:20:00',28,1), -(11,'Horario 8h/semana','00:00:00',8,1), -(12,'Horario 16h/semana','00:00:00',16,1), -(13,'Horario 32h/semana','00:20:00',32,1), -(14,'Horario 24h/semana','00:20:00',24,1), -(15,'Horario 10h/semana','00:00:00',10,1), -(16,'Horario 27,5h/semana','00:20:00',28,1), -(17,'Horario 13,5h/semana','00:20:00',14,1), -(18,'Horario 31h/semana',NULL,31,1), -(19,'Horario 21,5h/semana',NULL,22,1), -(20,'Horario 34h/semana',NULL,34,1), -(21,'Horario 17h/semana',NULL,17,1), -(22,'Horario 18h/semana',NULL,18,1), -(23,'Horario 37,5 h/semana',NULL,38,1), -(24,'Horario 29 h/semana',NULL,29,1), -(25,'Horario 12h/semana',NULL,12,1), -(26,'Horario 10h/semana',NULL,10,1), -(27,'Horario 15h/semana',NULL,15,1), -(28,'Horario 9h/semana',NULL,9,1), -(29,'Horario 23h/semana',NULL,23,1), -(30,'Horario 21h/semana',NULL,21,1), -(31,'Horario 39h/semana',NULL,39,1), -(32,'Horario 22/semana',NULL,22,1); +INSERT INTO `calendar_labour_type` VALUES (1,'Horario general','00:20:00',40,0),(2,'Horario 35h/semana','00:20:00',35,1),(3,'Horario 20h/semana','00:00:00',20,1),(4,'Festivo y Fin de semana','00:00:00',0,1),(5,'Horario 30h/semana','00:20:00',30,1),(6,'Horario 25h/semana','00:20:00',25,1),(7,'Vacaciones trabajadas','00:00:00',0,1),(8,'Vacaciones','00:00:00',0,1),(9,'Horario 26h/semana','00:20:00',26,1),(10,'Horario 28h/semana','00:20:00',28,1),(11,'Horario 8h/semana','00:00:00',8,1),(12,'Horario 16h/semana','00:00:00',16,1),(13,'Horario 32h/semana','00:20:00',32,1),(14,'Horario 24h/semana','00:20:00',24,1),(15,'Horario 10h/semana','00:00:00',10,1),(16,'Horario 27,5h/semana','00:20:00',28,1),(17,'Horario 13,5h/semana','00:20:00',14,1),(18,'Horario 31h/semana',NULL,31,1),(19,'Horario 21,5h/semana',NULL,22,1),(20,'Horario 34h/semana',NULL,34,1),(21,'Horario 17h/semana',NULL,17,1),(22,'Horario 18h/semana',NULL,18,1),(23,'Horario 37,5 h/semana',NULL,38,1),(24,'Horario 29 h/semana',NULL,29,1),(25,'Horario 12h/semana',NULL,12,1),(26,'Horario 10h/semana',NULL,10,1),(27,'Horario 15h/semana',NULL,15,1),(28,'Horario 9h/semana',NULL,9,1),(29,'Horario 23h/semana',NULL,23,1),(30,'Horario 21h/semana',NULL,21,1),(31,'Horario 39h/semana',NULL,39,1),(32,'Horario 22/semana',NULL,22,1); /*!40000 ALTER TABLE `calendar_labour_type` ENABLE KEYS */; UNLOCK TABLES; @@ -14093,8 +738,7 @@ UNLOCK TABLES; LOCK TABLES `labour_agreement` WRITE; /*!40000 ALTER TABLE `labour_agreement` DISABLE KEYS */; -INSERT INTO `labour_agreement` VALUES -(1,2.5,1830,'Flores y Plantas','2012-01-01',NULL); +INSERT INTO `labour_agreement` VALUES (1,2.5,1830,'Flores y Plantas','2012-01-01',NULL); /*!40000 ALTER TABLE `labour_agreement` ENABLE KEYS */; UNLOCK TABLES; @@ -14104,18 +748,7 @@ UNLOCK TABLES; LOCK TABLES `media_type` WRITE; /*!40000 ALTER TABLE `media_type` DISABLE KEYS */; -INSERT INTO `media_type` VALUES -(3,'email'), -(12,'extension movil'), -(6,'facebook'), -(2,'fijo'), -(11,'material'), -(10,'movil empresa'), -(1,'movil personal'), -(5,'msn'), -(9,'seg social'), -(4,'skype'), -(7,'web'); +INSERT INTO `media_type` VALUES (3,'email'),(12,'extension movil'),(6,'facebook'),(2,'fijo'),(11,'material'),(10,'movil empresa'),(1,'movil personal'),(5,'msn'),(9,'seg social'),(4,'skype'),(7,'web'); /*!40000 ALTER TABLE `media_type` ENABLE KEYS */; UNLOCK TABLES; @@ -14125,50 +758,7 @@ UNLOCK TABLES; LOCK TABLES `professional_category` WRITE; /*!40000 ALTER TABLE `professional_category` DISABLE KEYS */; -INSERT INTO `professional_category` VALUES -(1,'Mozos',5,1,27.5,NULL), -(2,'Encargados',3,1,27.5,NULL), -(4,'Comprador',3,1,27.5,NULL), -(5,'Aux Administracion',NULL,1,27.5,NULL), -(6,'Of Administracion',3,1,27.5,NULL), -(7,'Jefe Administracion',2,1,27.5,NULL), -(8,'Informatico',3,1,27.5,NULL), -(9,'Directivo',1,0,27.5,NULL), -(10,'Aux Ventas',4,1,27.5,NULL), -(11,'Vendedor',4,1,27.5,NULL), -(12,'Jefe de Ventas',4,0,27.5,NULL), -(13,'Repartidor',5,1,27.5,NULL), -(14,'Aprendices',NULL,1,27.5,NULL), -(15,'Técnicos',2,1,27.5,NULL), -(16,'Aux Florista',5,1,27.5,NULL), -(17,'Florista',4,1,27.5,NULL), -(18,'Jefe Floristas',2,1,27.5,NULL), -(19,'Técnico marketing',3,1,27.5,NULL), -(20,'Auxiliar marketing',4,1,27.5,NULL), -(21,'Aux Informática',4,1,27.5,NULL), -(22,'Peón agrícola',5,1,27.5,NULL), -(23,'Oficial mantenimiento',4,1,27.5,NULL), -(24,'Aux mantenimiento',5,1,27.5,NULL), -(25,'Mozo Aeropuerto',5,1,27.5,NULL), -(26,'Coordinador',2,1,27.5,NULL), -(28,'Aux Logistica',4,1,27.5,NULL), -(29,'Oficial Logistica',3,1,27.5,NULL), -(30,'Subencargado',4,1,27.5,NULL), -(31,'Conductor +3500kg',NULL,1,27.5,32400), -(32,'Oficial 1ª',NULL,1,27.5,NULL), -(33,'Oficial 2ª',NULL,1,27.5,NULL), -(34,'Supervisor',NULL,1,27.5,NULL), -(35,'Aux.Comerc./Market.',NULL,1,27.5,NULL), -(36,'Oficial Comerc./Market.',NULL,1,27.5,NULL), -(37,'Coord. Comerc./Market.',NULL,1,27.5,NULL), -(38,'Aux. Florista 1ª',NULL,1,27.5,NULL), -(39,'Mozo/campo',NULL,1,27.5,NULL), -(40,'Conductor B',NULL,1,27.5,NULL), -(41,'Conductor C',NULL,1,27.5,NULL), -(42,'Conductor C + E',NULL,1,27.5,NULL), -(43,'Enrutador I',NULL,1,27.5,NULL), -(44,'Enrutador II',NULL,1,27.5,NULL), -(45,'Jefe Logística',NULL,1,27.5,NULL); +INSERT INTO `professional_category` VALUES (1,'Mozos',5,1,27.5,NULL),(2,'Encargados',3,1,27.5,NULL),(4,'Comprador',3,1,27.5,NULL),(5,'Aux Administracion',NULL,1,27.5,NULL),(6,'Of Administracion',3,1,27.5,NULL),(7,'Jefe Administracion',2,1,27.5,NULL),(8,'Informatico',3,1,27.5,NULL),(9,'Directivo',1,0,27.5,NULL),(10,'Aux Ventas',4,1,27.5,NULL),(11,'Vendedor',4,1,27.5,NULL),(12,'Jefe de Ventas',4,0,27.5,NULL),(13,'Repartidor',5,1,27.5,NULL),(14,'Aprendices',NULL,1,27.5,NULL),(15,'Técnicos',2,1,27.5,NULL),(16,'Aux Florista',5,1,27.5,NULL),(17,'Florista',4,1,27.5,NULL),(18,'Jefe Floristas',2,1,27.5,NULL),(19,'Técnico marketing',3,1,27.5,NULL),(20,'Auxiliar marketing',4,1,27.5,NULL),(21,'Aux Informática',4,1,27.5,NULL),(22,'Peón agrícola',5,1,27.5,NULL),(23,'Oficial mantenimiento',4,1,27.5,NULL),(24,'Aux mantenimiento',5,1,27.5,NULL),(25,'Mozo Aeropuerto',5,1,27.5,NULL),(26,'Coordinador',2,1,27.5,NULL),(28,'Aux Logistica',4,1,27.5,NULL),(29,'Oficial Logistica',3,1,27.5,NULL),(30,'Subencargado',4,1,27.5,NULL),(31,'Conductor +3500kg',NULL,1,27.5,32400),(32,'Oficial 1ª',NULL,1,27.5,NULL),(33,'Oficial 2ª',NULL,1,27.5,NULL),(34,'Supervisor',NULL,1,27.5,NULL),(35,'Aux.Comerc./Market.',NULL,1,27.5,NULL),(36,'Oficial Comerc./Market.',NULL,1,27.5,NULL),(37,'Coord. Comerc./Market.',NULL,1,27.5,NULL),(38,'Aux. Florista 1ª',NULL,1,27.5,NULL),(39,'Mozo/campo',NULL,1,27.5,NULL),(40,'Conductor B',NULL,1,27.5,NULL),(41,'Conductor C',NULL,1,27.5,NULL),(42,'Conductor C + E',NULL,1,27.5,NULL),(43,'Enrutador I',NULL,1,27.5,NULL),(44,'Enrutador II',NULL,1,27.5,NULL),(45,'Jefe Logística',NULL,1,27.5,NULL); /*!40000 ALTER TABLE `professional_category` ENABLE KEYS */; UNLOCK TABLES; @@ -14178,13 +768,7 @@ UNLOCK TABLES; LOCK TABLES `profile_type` WRITE; /*!40000 ALTER TABLE `profile_type` DISABLE KEYS */; -INSERT INTO `profile_type` VALUES -(1,'Laboral'), -(2,'Personal'), -(3,'Cliente'), -(4,'Proveedor'), -(5,'Banco'), -(6,'Patronal'); +INSERT INTO `profile_type` VALUES (1,'Laboral'),(2,'Personal'),(3,'Cliente'),(4,'Proveedor'),(5,'Banco'),(6,'Patronal'); /*!40000 ALTER TABLE `profile_type` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -14196,13 +780,13 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2022-11-21 7:59:07 +-- Dump completed on 2023-02-20 14:45:56 USE `sage`; --- MariaDB dump 10.19 Distrib 10.9.4-MariaDB, for Linux (x86_64) +-- MariaDB dump 10.19 Distrib 10.5.18-MariaDB, for debian-linux-gnu (x86_64) -- --- Host: db.verdnatura.es Database: sage +-- Host: db-proxy.verdnatura.es Database: sage -- ------------------------------------------------------ --- Server version 10.7.6-MariaDB-1:10.7.6+maria~deb11-log +-- Server version 10.7.7-MariaDB-1:10.7.7+maria~deb11-log /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -14220,34 +804,7 @@ USE `sage`; LOCK TABLES `TiposIva` WRITE; /*!40000 ALTER TABLE `TiposIva` DISABLE KEYS */; -INSERT INTO `TiposIva` VALUES -(2,0,'Operaciones no sujetas',0.0000000000,0.0000000000,0.0000000000,'','4770000020','','','','','','','95B21A93-5910-489D-83BB-C32788C9B19D','','','','','','','','','',0,0), -(4,0,'I.V.A. 4%',0.0000000000,4.0000000000,0.0000000000,'4720000004','4770000004','','6310000000','','','','','9E6160D5-984E-4643-ACBC-1EBC3BF73360','','','','','','','','','',0,0), -(5,0,'I.V.A. 4% y R.E. 0.5%',0.0000000000,4.0000000000,0.5000000000,'','4770000504','4770000405','','','','','','DBEFA562-63FB-4FFC-8171-64F0C6F065FF','','','','','','','','','',0,0), -(6,0,'H.P. IVA 4% CEE',0.0000000000,4.0000000000,0.0000000000,'4721000004','4771000004','','','','','','','DD0ECBA8-2EF5-425E-911B-623580BADA77','','','','','','','','','',0,1), -(7,0,'H.P. IVA 10% CEE',0.0000000000,10.0000000000,0.0000000000,'4721000011','4771000010','','','','','','','593208CD-6F28-4489-B6EC-907AD689EAC9','','','','','','','','','',0,1), -(8,0,'H.P. IVA 21% CEE',0.0000000000,21.0000000000,0.0000000000,'4721000021','4771000021','','','','','','','27061852-9BC1-4C4F-9B6E-69970E208F23','','','','','','','','','',0,1), -(10,0,'I.V.A. 10% Nacional',0.0000000000,10.0000000000,0.0000000000,'4720000011','4770000010','','6290000553','','','','','828A9D6F-5C01-4C3A-918A-B2E4482830D3','','','','','','','','','',0,0), -(11,0,'I.V.A. 10% y R.E. 1,4%',0.0000000000,10.0000000000,1.4000000000,'','4770000101','4770000110','','','','','','C1F2D910-83A1-4191-A76C-8B3D7AB98348','','','','','','','','','',0,0), -(16,0,'I.V.A. Adqui. servicios CEE',0.0000000000,21.0000000000,0.0000000000,'4721000015','4771000016','','','','','','','E3EDE961-CE8F-41D4-9E6C-D8BCD32275A1','','','','','','','','','',0,1), -(18,0,'H.P. Iva Importación 0% ISP',0.0000000000,0.0000000000,0.0000000000,'4720000005','4770000005','','','','','','','27AD4158-2349-49C2-B53A-A4E0EFAC5D09','','','','','','','','','',0,0), -(20,0,'I.V.A 0% Nacional',0.0000000000,0.0000000000,0.0000000000,'4720000000','','','','','','','','B90B0FBD-E513-4F04-9721-C873504E08DF','','','','','','','','','',0,0), -(21,0,'I.V.A. 21%',0.0000000000,21.0000000000,0.0000000000,'4720000021','4770000021','4770000000','','','','','','BA8C4E28-DCFA-4F7B-AE4F-CA044626B55E','','','','','','','','','',0,0), -(22,0,'IVA 10% importaciones',0.0000000000,10.0000000000,0.0000000000,'4722000010','','','','','','','','540450A8-4B41-4607-96D1-E7F296FB6933','','','','','','','','','',0,0), -(26,0,'I.V.A. 21% y R.E. 5,2%',0.0000000000,21.0000000000,5.2000000000,'4720000021','4770000215','4770000521','631000000','','','','','2BC0765F-7739-49AE-A5F0-28B648B81677','','','','','','','','','',0,0), -(90,0,'IVA 21% importaciones',0.0000000000,21.0000000000,0.0000000000,'4722000021','','','','','','','','EB675F91-5FF2-4E26-A31E-EEB674125945','','','','','','','','','',0,0), -(91,0,'IVA 0% importaciones',0.0000000000,0.0000000000,0.0000000000,'4723000000','','','','','','','','5E5EFA56-2A99-4D54-A16B-5D818274CA18','','','','','','','','','',0,0), -(92,0,'8.5% comp. ganadera o pesquera',0.0000000000,8.5000000000,0.0000000000,'4720000000','4770000000','477000000','631000000','','','','','','','','','','','','','','',0,0), -(93,0,'12% com. agrícola o forestal',0.0000000000,12.0000000000,0.0000000000,'4720000012','','','','','','','','267B1DDB-247F-4A71-AB95-3349FEFC5F92','','','','','','','','','',0,0), -(94,0,'10,5% com. ganadera o pesquera',0.0000000000,10.5000000000,0.0000000000,'4770000000','4720000000','631000000','477000000','','','','','','','','','','','','','','',0,0), -(108,0,'I.V.A. 8%',0.0000000000,8.0000000000,0.0000000000,'4720000000','4770000000','477000000','631000000','','','','','','','','','','','','','','',0,0), -(109,0,'I.V.A. 8% y R.E. 1%',0.0000000000,8.0000000000,1.0000000000,'4720000000','4770000000','477000000','631000000','','','','','','','','','','','','','','',0,0), -(110,0,'HP IVA Devengado Exento CEE',0.0000000000,0.0000000000,0.0000000000,'','4771000000','','','','','','','C605BC32-E161-42FD-83F3-3A66B1FBE399','','','','','','','','','',0,1), -(111,0,'H.P. Iva Devengado Exento Ser',0.0000000000,0.0000000000,0.0000000000,'','4771000001','','','','','','','F1AEC4DC-AFE5-498E-A713-2648FFB6DA32','','','','','','','','','',0,0), -(112,0,'H.P. IVA Devengado en exportac',0.0000000000,0.0000000000,0.0000000000,'','4770000002','','','','','','','F980AE74-BF75-4F4C-927F-0CCCE0DB8D15','','','','','','','','','',0,0), -(113,0,'HP DEVENGADO 21 ISP ',0.0000000000,21.0000000000,0.0000000000,'4720000006','4770000006','','','','','','','728D7A76-E936-438C-AF05-3CA38FE16EA5','','','','','','','','','',0,0), -(114,0,'HP.IVA NO DEDUCIBLE 10%',0.0000000000,0.0000000000,0.0000000000,'4720000026','','','','','','','','','','','','','','','','','',0,0), -(115,0,'H.P. IVA Soportado Impor 4% ',0.0000000000,4.0000000000,0.0000000000,'4722000004','','','','','','','','','','','','','','','','','',0,0); +INSERT INTO `TiposIva` VALUES (2,0,'Operaciones no sujetas',0.0000000000,0.0000000000,0.0000000000,'','4770000020','','','','','','','95B21A93-5910-489D-83BB-C32788C9B19D','','','','','','','','','',0,0),(4,0,'I.V.A. 4%',0.0000000000,4.0000000000,0.0000000000,'4720000004','4770000004','','6310000000','','','','','9E6160D5-984E-4643-ACBC-1EBC3BF73360','','','','','','','','','',0,0),(5,0,'I.V.A. 4% y R.E. 0.5%',0.0000000000,4.0000000000,0.5000000000,'','4770000504','4770000405','','','','','','DBEFA562-63FB-4FFC-8171-64F0C6F065FF','','','','','','','','','',0,0),(6,0,'H.P. IVA 4% CEE',0.0000000000,4.0000000000,0.0000000000,'4721000004','4771000004','','','','','','','DD0ECBA8-2EF5-425E-911B-623580BADA77','','','','','','','','','',0,1),(7,0,'H.P. IVA 10% CEE',0.0000000000,10.0000000000,0.0000000000,'4721000011','4771000010','','','','','','','593208CD-6F28-4489-B6EC-907AD689EAC9','','','','','','','','','',0,1),(8,0,'H.P. IVA 21% CEE',0.0000000000,21.0000000000,0.0000000000,'4721000021','4771000021','','','','','','','27061852-9BC1-4C4F-9B6E-69970E208F23','','','','','','','','','',0,1),(10,0,'I.V.A. 10% Nacional',0.0000000000,10.0000000000,0.0000000000,'4720000011','4770000010','','6290000553','','','','','828A9D6F-5C01-4C3A-918A-B2E4482830D3','','','','','','','','','',0,0),(11,0,'I.V.A. 10% y R.E. 1,4%',0.0000000000,10.0000000000,1.4000000000,'','4770000101','4770000110','','','','','','C1F2D910-83A1-4191-A76C-8B3D7AB98348','','','','','','','','','',0,0),(16,0,'I.V.A. Adqui. servicios CEE',0.0000000000,21.0000000000,0.0000000000,'4721000015','4771000016','','','','','','','E3EDE961-CE8F-41D4-9E6C-D8BCD32275A1','','','','','','','','','',0,1),(18,0,'H.P. Iva Importación 0% ISP',0.0000000000,0.0000000000,0.0000000000,'4720000005','4770000005','','','','','','','27AD4158-2349-49C2-B53A-A4E0EFAC5D09','','','','','','','','','',0,0),(20,0,'I.V.A 0% Nacional',0.0000000000,0.0000000000,0.0000000000,'4720000000','','','','','','','','B90B0FBD-E513-4F04-9721-C873504E08DF','','','','','','','','','',0,0),(21,0,'I.V.A. 21%',0.0000000000,21.0000000000,0.0000000000,'4720000021','4770000021','4770000000','','','','','','BA8C4E28-DCFA-4F7B-AE4F-CA044626B55E','','','','','','','','','',0,0),(22,0,'IVA 10% importaciones',0.0000000000,10.0000000000,0.0000000000,'4722000010','','','','','','','','540450A8-4B41-4607-96D1-E7F296FB6933','','','','','','','','','',0,0),(26,0,'I.V.A. 21% y R.E. 5,2%',0.0000000000,21.0000000000,5.2000000000,'4720000021','4770000215','4770000521','631000000','','','','','2BC0765F-7739-49AE-A5F0-28B648B81677','','','','','','','','','',0,0),(90,0,'IVA 21% importaciones',0.0000000000,21.0000000000,0.0000000000,'4722000021','','','','','','','','EB675F91-5FF2-4E26-A31E-EEB674125945','','','','','','','','','',0,0),(91,0,'IVA 0% importaciones',0.0000000000,0.0000000000,0.0000000000,'4723000000','','','','','','','','5E5EFA56-2A99-4D54-A16B-5D818274CA18','','','','','','','','','',0,0),(92,0,'8.5% comp. ganadera o pesquera',0.0000000000,8.5000000000,0.0000000000,'4720000000','4770000000','477000000','631000000','','','','','','','','','','','','','','',0,0),(93,0,'12% com. agrícola o forestal',0.0000000000,12.0000000000,0.0000000000,'4720000012','','','','','','','','267B1DDB-247F-4A71-AB95-3349FEFC5F92','','','','','','','','','',0,0),(94,0,'10,5% com. ganadera o pesquera',0.0000000000,10.5000000000,0.0000000000,'4770000000','4720000000','631000000','477000000','','','','','','','','','','','','','','',0,0),(100,0,'HP IVA SOPORTADO 5%',0.0000000000,5.0000000000,0.0000000000,'4720000055','','','','','','','','3AD36CB2-4172-4CC9-9F87-2BF2B56AAC80','','','','','','','','','',0,0),(108,0,'I.V.A. 8%',0.0000000000,8.0000000000,0.0000000000,'4720000000','4770000000','477000000','631000000','','','','','','','','','','','','','','',0,0),(109,0,'I.V.A. 8% y R.E. 1%',0.0000000000,8.0000000000,1.0000000000,'4720000000','4770000000','477000000','631000000','','','','','','','','','','','','','','',0,0),(110,0,'HP IVA Devengado Exento CEE',0.0000000000,0.0000000000,0.0000000000,'','4771000000','','','','','','','C605BC32-E161-42FD-83F3-3A66B1FBE399','','','','','','','','','',0,1),(111,0,'H.P. Iva Devengado Exento Ser',0.0000000000,0.0000000000,0.0000000000,'','4771000001','','','','','','','F1AEC4DC-AFE5-498E-A713-2648FFB6DA32','','','','','','','','','',0,0),(112,0,'H.P. IVA Devengado en exportac',0.0000000000,0.0000000000,0.0000000000,'','4770000002','','','','','','','F980AE74-BF75-4F4C-927F-0CCCE0DB8D15','','','','','','','','','',0,0),(113,0,'HP DEVENGADO 21 ISP ',0.0000000000,21.0000000000,0.0000000000,'4720000006','4770000006','','','','','','','728D7A76-E936-438C-AF05-3CA38FE16EA5','','','','','','','','','',0,0),(114,0,'HP.IVA NO DEDUCIBLE 10%',0.0000000000,0.0000000000,0.0000000000,'4720000026','','','','','','','','','','','','','','','','','',0,0),(115,0,'H.P. IVA Soportado Impor 4% ',0.0000000000,4.0000000000,0.0000000000,'4722000004','','','','','','','','','','','','','','','','','',0,0); /*!40000 ALTER TABLE `TiposIva` ENABLE KEYS */; UNLOCK TABLES; @@ -14257,66 +814,7 @@ UNLOCK TABLES; LOCK TABLES `TiposTransacciones` WRITE; /*!40000 ALTER TABLE `TiposTransacciones` DISABLE KEYS */; -INSERT INTO `TiposTransacciones` VALUES -(1,'Rég.general/Oper.interiores bienes y serv.corrien.','',0,''), -(2,'Régimen especial de bienes usados','E',0,''), -(3,'Régimen especial de obj. de arte y antigüedades','E',0,''), -(4,'Régimen especial agencias de viaje','',0,''), -(5,'Régimen especial determinación proporcional','E',0,''), -(6,'Oper.en rég.simplificado art.37.1.2º Rgto.IVA','E',0,''), -(7,'Oper.en rég.simplificado art.37.1.1º Rgto.IVA','E',0,''), -(8,'Oper.en rég.de agricultura, ganadería y pesca','E',0,''), -(9,'Oper.en rég.especial de recargo de equivalencia','E',0,''), -(10,'Entregas intracomunitarias','E',0,''), -(11,'Entregas intermediarias intracomunitarias','E',0,''), -(12,'Operaciones sujetas con derecho a devolución','E',0,''), -(13,'Prest. Serv. No sujetas derecho devolución','E',0,''), -(14,'Exportaciones definitivas','E',0,''), -(15,'Envíos definitivos a Canarias, Ceuta y Melilla','E',0,''), -(16,'Devoluciones en régimen de viajeros','E',0,''), -(17,'Operaciones con áreas exentas','E',0,''), -(18,'Operaciones exentas con derecho a deducción','E',0,''), -(19,'Operaciones exentas sin derecho a deducción','E',0,''), -(20,'Adquisic.intracomunitarias de bienes y serv.corr.','',-1,'P'), -(21,'Adquisic.intracomunitarias de bienes de inversión','',-1,'P'), -(22,'Adquisic.intermediarias intracomunitarias','',-1,'P'), -(23,'Modif.autorizadas en quiebras y susp.de pagos','',0,''), -(24,'Entrega de bienes inmuebles no habituales','E',0,''), -(25,'Entrega de bienes de inversión','E',0,''), -(26,'Op.finan. y Entregas oro inversión, no habituales','E',0,''), -(27,'Inversión sujeto pasivo','',-1,'I'), -(28,'Prestaciones intracomunitarias de servicios','E',0,''), -(29,'Adquisiciones intracomunitarias de servicios','',-1,'I'), -(30,'Operaciones interiores de bienes de inversión','R',0,''), -(31,'Importaciones de bienes y servicios corrientes','R',0,''), -(32,'Importaciones de bienes de inversión','R',0,''), -(33,'Operaciones que generan inversión sujeto pasivo','E',0,''), -(35,'Compensaciones en rég.de agricultura, gan.y pesca','R',0,''), -(36,'Regularización de inversiones','R',0,''), -(37,'Operaciones exentas','R',0,''), -(38,'Operaciones no sujetas','',0,''), -(39,'Gastos devengados op interiores (País Vasco)','R',0,''), -(40,'Gastos Adq.intracom. bienes (País Vasco)','',-1,'P'), -(42,'Gastos Adq.intermediarias intracom. (País Vasco)','',-1,'P'), -(47,'Gastos Inversión sujeto pasivo (País Vasco)','',-1,'I'), -(49,'Gastos Adq. intracom. servicios (País Vasco)','',-1,'I'), -(51,'Gastos Importaciones (País Vasco)','R',0,''), -(53,'Adquisiciones a agencias de viajes en rég.especial','R',0,''), -(54,'Entregas intrac.posteriores a importaciones','E',0,''), -(55,'Entregas intrac.post.impor.con representante','E',0,''), -(56,'Import. bienes y serv. corrientes pdte. liquidar','R',0,''), -(57,'Import. bienes de inversión pdte. liquidar','R',0,''), -(58,'Servicios prestados por Internet desde España','E',0,''), -(59,'Servicios prestados por Internet fuera de España','E',0,''), -(60,'Régimen depósito distinto al aduanero','',0,''), -(61,'Adquisición de bienes de inversión con ISP','',-1,'I'), -(62,'Prest. Serv. Interiores clientes comunit./extranj.','',0,''), -(63,'Prest. Serv. Ex. con derecho a deducc. comu./extr.','E',0,''), -(64,'Prest. Serv. Ex. sin derecho a deducc. comu./extr.','E',0,''), -(65,'Entregas No sujetas derecho devolución','E',0,''), -(66,'Operaciones exentas art. 25 ley 19/1994 (Canarias)','',0,''), -(67,'Entrega de bienes exenta \"Zona Especial Canaria\"','',0,''), -(68,'Prestac. servicios exenta \"Zona Especial Canaria\"','',0,''); +INSERT INTO `TiposTransacciones` VALUES (1,'Rég.general/Oper.interiores bienes y serv.corrien.','',0,''),(2,'Régimen especial de bienes usados','E',0,''),(3,'Régimen especial de obj. de arte y antigüedades','E',0,''),(4,'Régimen especial agencias de viaje','',0,''),(5,'Régimen especial determinación proporcional','E',0,''),(6,'Oper.en rég.simplificado art.37.1.2º Rgto.IVA','E',0,''),(7,'Oper.en rég.simplificado art.37.1.1º Rgto.IVA','E',0,''),(8,'Oper.en rég.de agricultura, ganadería y pesca','E',0,''),(9,'Oper.en rég.especial de recargo de equivalencia','E',0,''),(10,'Entregas intracomunitarias','E',0,''),(11,'Entregas intermediarias intracomunitarias','E',0,''),(12,'Operaciones sujetas con derecho a devolución','E',0,''),(13,'Prest. Serv. No sujetas derecho devolución','E',0,''),(14,'Exportaciones definitivas','E',0,''),(15,'Envíos definitivos a Canarias, Ceuta y Melilla','E',0,''),(16,'Devoluciones en régimen de viajeros','E',0,''),(17,'Operaciones con áreas exentas','E',0,''),(18,'Operaciones exentas con derecho a deducción','E',0,''),(19,'Operaciones exentas sin derecho a deducción','E',0,''),(20,'Adquisic.intracomunitarias de bienes y serv.corr.','',-1,'P'),(21,'Adquisic.intracomunitarias de bienes de inversión','',-1,'P'),(22,'Adquisic.intermediarias intracomunitarias','',-1,'P'),(23,'Modif.autorizadas en quiebras y susp.de pagos','',0,''),(24,'Entrega de bienes inmuebles no habituales','E',0,''),(25,'Entrega de bienes de inversión','E',0,''),(26,'Op.finan. y Entregas oro inversión, no habituales','E',0,''),(27,'Inversión sujeto pasivo','',-1,'I'),(28,'Prestaciones intracomunitarias de servicios','E',0,''),(29,'Adquisiciones intracomunitarias de servicios','',-1,'I'),(30,'Operaciones interiores de bienes de inversión','R',0,''),(31,'Importaciones de bienes y servicios corrientes','R',0,''),(32,'Importaciones de bienes de inversión','R',0,''),(33,'Operaciones que generan inversión sujeto pasivo','E',0,''),(35,'Compensaciones en rég.de agricultura, gan.y pesca','R',0,''),(36,'Regularización de inversiones','R',0,''),(37,'Operaciones exentas','R',0,''),(38,'Operaciones no sujetas','',0,''),(39,'Gastos devengados op interiores (País Vasco)','R',0,''),(40,'Gastos Adq.intracom. bienes (País Vasco)','',-1,'P'),(42,'Gastos Adq.intermediarias intracom. (País Vasco)','',-1,'P'),(47,'Gastos Inversión sujeto pasivo (País Vasco)','',-1,'I'),(49,'Gastos Adq. intracom. servicios (País Vasco)','',-1,'I'),(51,'Gastos Importaciones (País Vasco)','R',0,''),(53,'Adquisiciones a agencias de viajes en rég.especial','R',0,''),(54,'Entregas intrac.posteriores a importaciones','E',0,''),(55,'Entregas intrac.post.impor.con representante','E',0,''),(56,'Import. bienes y serv. corrientes pdte. liquidar','R',0,''),(57,'Import. bienes de inversión pdte. liquidar','R',0,''),(58,'Servicios prestados por Internet desde España','E',0,''),(59,'Servicios prestados por Internet fuera de España','E',0,''),(60,'Régimen depósito distinto al aduanero','',0,''),(61,'Adquisición de bienes de inversión con ISP','',-1,'I'),(62,'Prest. Serv. Interiores clientes comunit./extranj.','',0,''),(63,'Prest. Serv. Ex. con derecho a deducc. comu./extr.','E',0,''),(64,'Prest. Serv. Ex. sin derecho a deducc. comu./extr.','E',0,''),(65,'Entregas No sujetas derecho devolución','E',0,''),(66,'Operaciones exentas art. 25 ley 19/1994 (Canarias)','',0,''),(67,'Entrega de bienes exenta \"Zona Especial Canaria\"','',0,''),(68,'Prestac. servicios exenta \"Zona Especial Canaria\"','',0,''); /*!40000 ALTER TABLE `TiposTransacciones` ENABLE KEYS */; UNLOCK TABLES; @@ -14326,12 +824,7 @@ UNLOCK TABLES; LOCK TABLES `TiposRetencion` WRITE; /*!40000 ALTER TABLE `TiposRetencion` DISABLE KEYS */; -INSERT INTO `TiposRetencion` VALUES -(1,'RETENCION ESTIMACION OBJETIVA',1.0000000000,'4730000000','4751000000',NULL,NULL,NULL,'03811652-0F3A-44A1-AE1C-B19624525D7F'), -(2,'ACTIVIDADES AGRICOLAS O GANADERAS',2.0000000000,'4730000000','4751000000',NULL,NULL,NULL,'F3F91EF3-FED6-444D-B03C-75B639D13FB4'), -(9,'ACTIVIDADES PROFESIONALES 2 PRIMEROS AÑOS',9.0000000000,'4730000000','4751000000',NULL,NULL,NULL,'73F95642-E951-4C91-970A-60C503A4792B'), -(15,'ACTIVIDADES PROFESIONALES',15.0000000000,'4730000000','4751000000','6',NULL,NULL,'F6BDE0EE-3B01-4023-8FFF-A73AE9AC50D7'), -(19,'ARRENDAMIENTO Y SUBARRENDAMIENTO',19.0000000000,'4730000000','4751000000','8',NULL,NULL,'09B033AE-16E5-4057-8D4A-A7710C8A4FB9'); +INSERT INTO `TiposRetencion` VALUES (1,'RETENCION ESTIMACION OBJETIVA',1.0000000000,'4730000000','4751000000',NULL,NULL,NULL,'03811652-0F3A-44A1-AE1C-B19624525D7F'),(2,'ACTIVIDADES AGRICOLAS O GANADERAS',2.0000000000,'4730000000','4751000000',NULL,NULL,NULL,'F3F91EF3-FED6-444D-B03C-75B639D13FB4'),(9,'ACTIVIDADES PROFESIONALES 2 PRIMEROS AÑOS',9.0000000000,'4730000000','4751000000',NULL,NULL,NULL,'73F95642-E951-4C91-970A-60C503A4792B'),(15,'ACTIVIDADES PROFESIONALES',15.0000000000,'4730000000','4751000000','6',NULL,NULL,'F6BDE0EE-3B01-4023-8FFF-A73AE9AC50D7'),(19,'ARRENDAMIENTO Y SUBARRENDAMIENTO',19.0000000000,'4730000000','4751000000','8',NULL,NULL,'09B033AE-16E5-4057-8D4A-A7710C8A4FB9'); /*!40000 ALTER TABLE `TiposRetencion` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -14343,4 +836,4 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2022-11-21 7:59:07 +-- Dump completed on 2023-02-20 14:45:57 diff --git a/db/dump/fixtures.sql b/db/dump/fixtures.sql index 6f766f8ad..8fb12e822 100644 --- a/db/dump/fixtures.sql +++ b/db/dump/fixtures.sql @@ -228,13 +228,13 @@ INSERT INTO `vn`.`bankEntity`(`id`, `countryFk`, `name`, `bic`) (128, 1, 'The Best Bank', 'BBKKESMMMMMM'), (2100, 1, 'Caixa Bank', 'CAIXESBB'); -INSERT INTO `vn`.`bank`(`id`, `bank`, `account`, `cash`, `entityFk`, `isActive`, `currencyFk`) +INSERT INTO `vn`.`accounting`(`id`, `bank`, `account`, `accountingTypeFk`, `entityFk`, `isActive`, `currencyFk`, `code`) VALUES - (1, 'Pay on receipt', '5720000001', 3, 128, 1, 1), - (2, 'Cash', '5700000001', 2, 128, 1, 1), - (3, 'Compensation', '4000000000', 8, 128, 1, 1), - (4, 'Transfers', '4000000001', 1, 128, 1, 1), - (3117, 'Caixa Rural d''Algemesi', '5720000000', 8, 2100, 1, 1); + (1, 'Pay on receipt', '5720000001', 3, 128, 1, 1, 'payOnReceipt'), + (2, 'Cash', '5700000001', 2, 128, 1, 1, 'cash'), + (3, 'Compensation', '4000000000', 8, 128, 1, 1, 'compensation'), + (4, 'Transfers', '4000000001', 1, 128, 1, 1, 'transfers'), + (3117, 'Caixa Rural d''Algemesi', '5720000000', 8, 2100, 1, 1, 'cra'); INSERT INTO `vn`.`deliveryMethod`(`id`, `code`, `description`) VALUES @@ -359,8 +359,8 @@ INSERT INTO `vn`.`client`(`id`,`name`,`fi`,`socialName`,`contact`,`street`,`city (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); + (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, 'others'), + (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, 'others'); 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'), 'GOTHAM', 46460, 1, CONCAT(name,'@mydomain.com'), NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1,NULL, 10, 5, util.VN_CURDATE(), 1 @@ -736,7 +736,7 @@ 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(util.VN_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 @@ -1019,16 +1019,11 @@ INSERT INTO `vn`.`sale`(`id`, `itemFk`, `ticketFk`, `concept`, `quantity`, `pric (33, 5, 14, 'Ranged weapon pistol 9mm', 50, 1.79, 0, 0, 0, util.VN_CURDATE()), (34, 4, 28, 'Melee weapon heavy shield 1x0.5m', 20, 1.72, 0, 0, 0, util.VN_CURDATE()), (35, 4, 29, 'Melee weapon heavy shield 1x0.5m', 20, 1.72, 0, 0, 0, util.VN_CURDATE()), - (36, 4, 30, 'Melee weapon heavy shield 1x0.5m', 20, 1.72, 0, 0, 0, util.VN_CURDATE()), (37, 4, 31, 'Melee weapon heavy shield 1x0.5m', 20, 1.72, 0, 0, 0, util.VN_CURDATE()), + (36, 4, 30, 'Melee weapon heavy shield 1x0.5m', 20, 1.72, 0, 0, 0, util.VN_CURDATE()), (38, 2, 32, 'Melee weapon combat fist 15cm', 30, 7.07, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH)), (39, 1, 32, 'Ranged weapon longbow 2m', 2, 103.49, 0, 0, 0, util.VN_CURDATE()); -INSERT INTO `vn`.`saleChecked`(`saleFk`, `isChecked`) - VALUES - (1, 0), - (2, 1); - INSERT INTO `vn`.`saleComponent`(`saleFk`, `componentFk`, `value`) VALUES (1, 28, 50), @@ -1177,18 +1172,13 @@ INSERT INTO `vn`.`itemShelvingSale` (`itemShelvingFk`, `saleFk`, `quantity`, `cr ('1', '7', '1', util.VN_CURDATE(), '1106'), ('2', '8', '5', util.VN_CURDATE(), '1106'); -INSERT INTO `vncontrol`.`accion`(`accion_id`, `accion`) +INSERT INTO `vn`.`saleTracking`(`saleFk`, `isChecked`, `created`, `originalQuantity`, `workerFk`, `id`, `stateFk`) VALUES - (3, 'ACTION ONE'), - (4, 'ACTIOn TWO'); - -INSERT INTO `vn`.`saleTracking`(`saleFk`, `isChecked`, `created`, `originalQuantity`, `workerFk`, `actionFk`, `id`, `stateFk`) - VALUES - (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), - (31, 1, util.VN_CURDATE(), -5, 40, 4, 5, 8); + (1, 0, util.VN_CURDATE(), 5, 55, 1, 14), + (1, 1, util.VN_CURDATE(), 5, 54, 2, 8), + (2, 1, util.VN_CURDATE(), 10, 40, 3, 8), + (3, 1, util.VN_CURDATE(), 2, 40, 4, 8), + (31, 1, util.VN_CURDATE(), -5, 40, 5, 8); INSERT INTO `vn`.`itemBarcode`(`id`, `itemFk`, `code`) VALUES @@ -1375,7 +1365,7 @@ INSERT INTO `vn`.`recovery`(`id`, `clientFk`, `started`, `finished`, `amount`, ` (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`) +INSERT INTO `bs`.`clientAnnualConsumption`(`clientFk`, `invoiced`) VALUES (1101, 1500), (1102, 100), @@ -1949,7 +1939,7 @@ DROP TEMPORARY TABLE IF EXISTS tmp.worker; CREATE TEMPORARY TABLE tmp.worker (PRIMARY KEY (id)) ENGINE = MEMORY - SELECT '1111' as 'id', w.id as `workerFk`, 'VNL', CONCAT(YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -2 YEAR)), '-12-25') as started, CONCAT(YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 YEAR)) as ended, '-12-24'), CONCAT('E-46-', RPAD(CONCAT(w.id, 9), 8, w.id)), NULL as `notes`, NULL as `departmentFk`, 23, 1 as `workerBusinessProfessionalCategoryFk`, 1 as `calendarTypeFk`, 1 as `isHourlyLabor`, 1 as `workerBusinessAgreementFk`, 1 as `workcenterFk` + SELECT '1111' as 'id', w.id as `workerFk`, 'VNL', CONCAT(YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -2 YEAR)), '-12-25') as started, CONCAT(YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 YEAR)), '-12-24') as ended, CONCAT('E-46-', RPAD(CONCAT(w.id, 9), 8, w.id)), NULL as `notes`, NULL as `departmentFk`, 23, 1 as `workerBusinessProfessionalCategoryFk`, 1 as `calendarTypeFk`, 1 as `isHourlyLabor`, 1 as `workerBusinessAgreementFk`, 1 as `workcenterFk` FROM `vn`.`worker` `w` WHERE `w`.`id` = 1109; @@ -1985,28 +1975,24 @@ INSERT INTO `vn`.`workerBusinessType` (`id`, `name`, `isFullTime`, `isPermanent` UPDATE `vn`.`business` b SET `rate` = 7, - `workerBusinessCategoryFk` = 1, `workerBusinessTypeFk` = 100, `amount` = 900.50 WHERE b.id = 1; UPDATE `vn`.`business` b SET `rate` = 7, - `workerBusinessCategoryFk` = 1, `workerBusinessTypeFk` = 100, `amount` = 1263.03 WHERE b.id = 1106; UPDATE `vn`.`business` b SET `rate` = 7, - `workerBusinessCategoryFk` = 1, `workerBusinessTypeFk` = 100, `amount` = 2000 WHERE b.id = 1107; UPDATE `vn`.`business` b SET `rate` = 7, - `workerBusinessCategoryFk` = 1, `workerBusinessTypeFk` = 100, `amount` = 1500 WHERE b.id = 1108; @@ -2020,7 +2006,7 @@ INSERT INTO `vn`.`absenceType` (`id`, `name`, `rgb`, `code`, `holidayEntitlement (20, 'Furlough', '#97B92F', 'furlough', 1, 1), (21, 'Furlough half day', '#778899', 'halfFurlough', 0.5, 1); -INSERT INTO `postgresql`.`calendar_employee` (`businessFk`, `calendar_state_id`, `date`) +INSERT INTO `vn`.`calendar` (`businessFk`, `dayOffTypeFk`, `dated`) VALUES (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))), @@ -2491,6 +2477,10 @@ REPLACE INTO `vn`.`invoiceIn`(`id`, `serialNumber`,`serial`, `supplierFk`, `issu (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`.`invoiceInConfig` (`id`, `retentionRate`, `retentionName`, `sageWithholdingFk`) + VALUES + (1, -2, '2% retention', 2); + INSERT INTO `vn`.`invoiceInDueDay`(`invoiceInFk`, `dueDated`, `bankFk`, `amount`) VALUES (1, util.VN_CURDATE(), 1, 336.99), @@ -2730,7 +2720,7 @@ INSERT INTO `util`.`notificationSubscription` (`notificationFk`, `userFk`) VALUES (1, 1109), (1, 1110), - (3, 1109), + (2, 1109), (1,9), (1,3); @@ -2784,10 +2774,6 @@ INSERT INTO `vn`.`profileType` (`id`, `name`) VALUES (1, 'working'); -INSERT INTO `vn`.`newWorkerConfig` (`id`, `street`, `provinceFk`, `companyFk`, `profileTypeFk`, `roleFk`) - VALUES - (1, 'S/ ', 1, 442, 1, 1); - INSERT INTO `salix`.`url` (`appName`, `environment`, `url`) VALUES ('lilium', 'dev', 'http://localhost:8080/#/'), diff --git a/db/dump/structure.sql b/db/dump/structure.sql index 3186fa01f..cd168c2f9 100644 --- a/db/dump/structure.sql +++ b/db/dump/structure.sql @@ -1,8 +1,8 @@ --- MariaDB dump 10.19 Distrib 10.9.4-MariaDB, for Linux (x86_64) +-- MariaDB dump 10.19 Distrib 10.5.15-MariaDB, for debian-linux-gnu (x86_64) -- -- Host: db.verdnatura.es Database: account -- ------------------------------------------------------ --- Server version 10.7.6-MariaDB-1:10.7.6+maria~deb11-log +-- Server version 10.7.7-MariaDB-1:10.7.7+maria~deb11-log /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -19,8 +19,7 @@ -- Current Database: `account` -- - -CREATE DATABASE /*!32312 IF NOT EXISTS*/ `account` /*!40100 DEFAULT CHARACTER SET utf8mb3 */; +CREATE DATABASE /*!32312 IF NOT EXISTS*/ `account` /*!40100 DEFAULT CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci */; USE `account`; @@ -89,8 +88,8 @@ DROP TABLE IF EXISTS `accountConfig`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `accountConfig` ( `id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT, - `homedir` varchar(50) COLLATE utf8mb3_unicode_ci NOT NULL COMMENT 'The base folder for users home directory', - `shell` varchar(50) COLLATE utf8mb3_unicode_ci NOT NULL COMMENT 'The default shell', + `homedir` varchar(50) NOT NULL COMMENT 'The base folder for users home directory', + `shell` varchar(50) NOT NULL COMMENT 'The default shell', `idBase` int(11) NOT NULL COMMENT 'Base id for Posix users and groups', `min` smallint(6) NOT NULL, `max` smallint(6) NOT NULL COMMENT 'Maximum password age (seconds)', @@ -108,9 +107,10 @@ DROP TABLE IF EXISTS `accountDovecot`; /*!50001 DROP VIEW IF EXISTS `accountDovecot`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `accountDovecot` AS SELECT - 1 AS `name`, - 1 AS `password` */; +/*!50001 CREATE TABLE `accountDovecot` ( + `name` tinyint NOT NULL, + `password` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -122,12 +122,12 @@ DROP TABLE IF EXISTS `accountLog`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `accountLog` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `msg` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL, - `pid` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL, - `user` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL, - `host` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL, - `rhost` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL, - `time` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL, + `msg` varchar(255) NOT NULL, + `pid` varchar(255) NOT NULL, + `user` varchar(255) NOT NULL, + `host` varchar(255) NOT NULL, + `rhost` varchar(255) NOT NULL, + `time` varchar(255) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -140,9 +140,10 @@ DROP TABLE IF EXISTS `emailUser`; /*!50001 DROP VIEW IF EXISTS `emailUser`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `emailUser` AS SELECT - 1 AS `userFk`, - 1 AS `email` */; +/*!50001 CREATE TABLE `emailUser` ( + `userFk` tinyint NOT NULL, + `email` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -154,11 +155,11 @@ DROP TABLE IF EXISTS `ldapConfig`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `ldapConfig` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `server` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL COMMENT 'The LDAP server access url', - `rdn` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL COMMENT 'The LDAP user', - `password` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL COMMENT 'The LDAP password', - `userDn` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL COMMENT 'The base DN for users', - `groupDn` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL COMMENT 'The base DN for groups', + `server` varchar(255) NOT NULL COMMENT 'The LDAP server access url', + `rdn` varchar(255) NOT NULL COMMENT 'The LDAP user', + `password` varchar(255) NOT NULL COMMENT 'The LDAP password', + `userDn` varchar(255) DEFAULT NULL COMMENT 'The base DN for users', + `groupDn` varchar(255) DEFAULT NULL COMMENT 'The base DN for groups', PRIMARY KEY (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='LDAP server configuration parameters'; /*!40101 SET character_set_client = @saved_cs_client */; @@ -172,8 +173,8 @@ DROP TABLE IF EXISTS `mailAlias`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `mailAlias` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `alias` varchar(50) CHARACTER SET utf8mb3 NOT NULL, - `description` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `alias` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, + `description` varchar(255) DEFAULT NULL, `isPublic` tinyint(4) NOT NULL DEFAULT 1, PRIMARY KEY (`id`), UNIQUE KEY `alias` (`alias`) @@ -213,7 +214,7 @@ CREATE TABLE `mailClientAccess` ( `description` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `mailFrom` (`client`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3; +) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -227,7 +228,7 @@ CREATE TABLE `mailConfig` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `domain` varchar(255) NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3; +) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -239,7 +240,7 @@ DROP TABLE IF EXISTS `mailForward`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `mailForward` ( `account` int(10) unsigned NOT NULL, - `forwardTo` varchar(250) CHARACTER SET utf8mb3 NOT NULL, + `forwardTo` varchar(250) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, PRIMARY KEY (`account`), CONSTRAINT `mailForward_ibfk_1` FOREIGN KEY (`account`) REFERENCES `account` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='Mail forwarding'; @@ -259,7 +260,7 @@ CREATE TABLE `mailSenderAccess` ( `description` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `mailFrom` (`sender`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3; +) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -270,8 +271,9 @@ DROP TABLE IF EXISTS `myRole`; /*!50001 DROP VIEW IF EXISTS `myRole`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `myRole` AS SELECT - 1 AS `id` */; +/*!50001 CREATE TABLE `myRole` ( + `id` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -282,15 +284,16 @@ DROP TABLE IF EXISTS `myUser`; /*!50001 DROP VIEW IF EXISTS `myUser`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `myUser` AS SELECT - 1 AS `id`, - 1 AS `name`, - 1 AS `active`, - 1 AS `email`, - 1 AS `nickname`, - 1 AS `lang`, - 1 AS `role`, - 1 AS `recoverPass` */; +/*!50001 CREATE TABLE `myUser` ( + `id` tinyint NOT NULL, + `name` tinyint NOT NULL, + `active` tinyint NOT NULL, + `email` tinyint NOT NULL, + `nickname` tinyint NOT NULL, + `lang` tinyint NOT NULL, + `role` tinyint NOT NULL, + `recoverPass` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -302,8 +305,8 @@ DROP TABLE IF EXISTS `role`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `role` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `name` varchar(14) COLLATE utf8mb3_unicode_ci NOT NULL COMMENT 'MySQL doesn''t support more than 14 chars for proxied user names', - `description` varchar(100) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `name` varchar(14) NOT NULL COMMENT 'MySQL doesn''t support more than 14 chars for proxied user names', + `description` varchar(100) 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(), @@ -369,7 +372,7 @@ CREATE TABLE `roleConfig` ( `userHost` varchar(255) NOT NULL, `tplUser` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COMMENT='Role configuration parameters'; +) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci COMMENT='Role configuration parameters'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -416,10 +419,10 @@ DROP TABLE IF EXISTS `sambaConfig`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `sambaConfig` ( `id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT, - `adDomain` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL COMMENT 'Active directory domain', - `adController` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL COMMENT 'The hosname of domain controller', - `adUser` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL COMMENT 'Active directory user', - `adPassword` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL COMMENT 'Active directory password', + `adDomain` varchar(255) NOT NULL COMMENT 'Active directory domain', + `adController` varchar(255) NOT NULL COMMENT 'The hosname of domain controller', + `adUser` varchar(255) DEFAULT NULL COMMENT 'Active directory user', + `adPassword` varchar(255) DEFAULT NULL COMMENT 'Active directory password', `verifyCert` tinyint(3) unsigned NOT NULL DEFAULT 1 COMMENT 'Whether to verify server certificate', PRIMARY KEY (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='Global configuration parameters for accounts'; @@ -434,21 +437,21 @@ DROP TABLE IF EXISTS `user`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `user` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `realm` varchar(512) CHARACTER SET utf8mb3 DEFAULT NULL, - `name` varchar(30) CHARACTER SET utf8mb3 NOT NULL, - `nickname` varchar(127) COLLATE utf8mb3_unicode_ci NOT NULL, - `bcryptPassword` varchar(512) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `realm` varchar(512) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL, + `name` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, + `nickname` varchar(127) NOT NULL, + `bcryptPassword` varchar(512) DEFAULT NULL, `role` int(10) unsigned NOT NULL DEFAULT 2, `active` tinyint(1) NOT NULL DEFAULT 1, - `email` varchar(255) CHARACTER SET utf8mb3 DEFAULT NULL, + `email` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL, `emailVerified` tinyint(1) DEFAULT NULL, - `verificationToken` varchar(512) CHARACTER SET utf8mb3 DEFAULT NULL, - `lang` char(2) CHARACTER SET utf8mb3 DEFAULT NULL, + `verificationToken` varchar(512) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL, + `lang` char(2) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL, `lastPassChange` datetime DEFAULT NULL, `created` timestamp NOT NULL DEFAULT current_timestamp(), `updated` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), - `image` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `password` char(64) COLLATE utf8mb3_unicode_ci NOT NULL COMMENT 'Deprecated', + `image` varchar(255) DEFAULT NULL, + `password` char(64) NOT NULL COMMENT 'Deprecated', `recoverPass` tinyint(3) unsigned NOT NULL DEFAULT 1 COMMENT 'Deprecated', `sync` tinyint(4) NOT NULL DEFAULT 0 COMMENT 'Deprecated', `hasGrant` tinyint(1) NOT NULL, @@ -500,7 +503,7 @@ DELIMITER ;; FOR EACH ROW BEGIN CALL hedera.image_ref('user', NEW.image); - + INSERT IGNORE INTO userSync SET `name` = NEW.`name`; END */;; DELIMITER ; @@ -565,7 +568,7 @@ BEGIN 'jgallego@verdnatura.es', 'Rol modificado', CONCAT( - myUser_getName(), + myUser_getName(), ' ha modificado el rol del usuario ', NEW.`name`, ' de ', OLD.role, ' a ', NEW.role) ); @@ -610,7 +613,7 @@ CREATE TABLE `userConfig` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `loginKey` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3; +) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -641,7 +644,7 @@ DROP TABLE IF EXISTS `userSync`; CREATE TABLE `userSync` ( `name` varchar(30) NOT NULL COMMENT 'The user name', PRIMARY KEY (`name`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='Users pending to be synchronized'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci COMMENT='Users pending to be synchronized'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -651,8 +654,6 @@ CREATE TABLE `userSync` ( -- -- Dumping routines for database 'account' -- -/*!50003 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `myUser_checkLogin` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -660,6 +661,8 @@ CREATE TABLE `userSync` ( /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `myUser_checkLogin`() RETURNS tinyint(1) READS SQL DATA @@ -681,7 +684,7 @@ BEGIN SET vSignature = util.hmacSha2(256, CONCAT_WS('/', @userId, @userName), vKey); RETURN vSignature = @userSignature; END IF; - + RETURN FALSE; END ;; @@ -690,8 +693,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `myUser_getId` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -699,6 +700,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `myUser_getId`() RETURNS int(11) READS SQL DATA @@ -710,7 +713,7 @@ BEGIN * @return The user id */ DECLARE vUser INT DEFAULT NULL; - + IF myUser_checkLogin() THEN SET vUser = @userId; @@ -718,7 +721,7 @@ BEGIN SELECT id INTO vUser FROM user WHERE name = LEFT(USER(), INSTR(USER(), '@') - 1); END IF; - + RETURN vUser; END ;; DELIMITER ; @@ -726,8 +729,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `myUser_getName` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -735,6 +736,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `myUser_getName`() RETURNS varchar(30) CHARSET utf8 NO SQL @@ -753,7 +756,7 @@ BEGIN ELSE SET vUser = LEFT(USER(), INSTR(USER(), '@') - 1); END IF; - + RETURN vUser; END ;; DELIMITER ; @@ -761,8 +764,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `myUser_hasRole` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -770,6 +771,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `myUser_hasRole`(vRoleName VARCHAR(255)) RETURNS tinyint(1) DETERMINISTIC @@ -787,8 +790,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `myUser_hasRoleId` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -796,6 +797,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `myUser_hasRoleId`(vRoleId INT) RETURNS tinyint(1) DETERMINISTIC @@ -813,8 +816,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `passwordGenerate` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -822,6 +823,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `passwordGenerate`() RETURNS text CHARSET utf8 COLLATE utf8_unicode_ci READS SQL DATA @@ -848,10 +851,10 @@ BEGIN DECLARE vDigitChars TEXT DEFAULT '1234567890'; DECLARE vPunctChars TEXT DEFAULT '!$%&()=.'; - SELECT length, nAlpha, nUpper, nDigits, nPunct + SELECT length, nAlpha, nUpper, nDigits, nPunct INTO vMinLength, vMinAlpha, vMinUpper, vMinDigits, vMinPunct FROM userPassword; - WHILE LENGTH(vPwd) < vMinLength OR vAlpha < vMinAlpha + WHILE LENGTH(vPwd) < vMinLength OR vAlpha < vMinAlpha OR vUpper < vMinUpper OR vDigits < vMinDigits OR vPunct < vMinPunct DO SET vRandIndex = FLOOR((RAND() * 4) + 1); @@ -877,8 +880,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `toUnixDays` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -886,6 +887,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `toUnixDays`(vDate DATE) RETURNS int(11) DETERMINISTIC @@ -903,8 +906,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `user_getMysqlRole` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -912,6 +913,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `user_getMysqlRole`(vUserName VARCHAR(255)) RETURNS varchar(255) CHARSET utf8 COLLATE utf8_unicode_ci DETERMINISTIC @@ -926,7 +929,7 @@ BEGIN DECLARE vRole VARCHAR(255); SELECT CONCAT(IF(r.hasLogin, c.rolePrefix, ''), r.name) INTO vRole - FROM role r + FROM role r JOIN user u ON u.role = r.id JOIN roleConfig c WHERE u.name = vUserName; @@ -938,8 +941,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `user_getNameFromId` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -947,22 +948,24 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `user_getNameFromId`(vSelf INT) RETURNS varchar(30) CHARSET utf8 COLLATE utf8_unicode_ci DETERMINISTIC BEGIN /** * Gets user name from it's id. - * + * * @param vSelf The user id * @return The user name */ DECLARE vName VARCHAR(30); - - SELECT `name` INTO vName - FROM user + + SELECT `name` INTO vName + FROM user WHERE id = vSelf; - + RETURN vName; END ;; DELIMITER ; @@ -970,8 +973,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `user_hasRole` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -979,6 +980,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `user_hasRole`(vUserName VARCHAR(255), vRoleName VARCHAR(255)) RETURNS tinyint(1) DETERMINISTIC @@ -1006,8 +1009,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `user_hasRoleId` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -1015,6 +1016,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `user_hasRoleId`(vUser VARCHAR(255), vRoleId INT) RETURNS tinyint(1) DETERMINISTIC @@ -1034,7 +1037,7 @@ BEGIN JOIN role r ON r.id = rr.inheritsFrom WHERE u.`name` = vUser AND r.id = vRoleId; - + RETURN vHasRole; END ;; DELIMITER ; @@ -1042,8 +1045,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `myUser_changePassword` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -1051,6 +1052,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `myUser_changePassword`(vOldPassword VARCHAR(255), vPassword VARCHAR(255)) BEGIN @@ -1067,8 +1070,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `myUser_login` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -1076,6 +1077,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `myUser_login`(vUserName VARCHAR(255), vPassword VARCHAR(255)) READS SQL DATA @@ -1093,7 +1096,7 @@ BEGIN AND password = MD5(vPassword) AND active; - IF vAuthIsOk + IF vAuthIsOk THEN CALL myUser_loginWithName (vUserName); ELSE @@ -1105,8 +1108,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `myUser_loginWithKey` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -1114,6 +1115,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `myUser_loginWithKey`(vUserName VARCHAR(255), vKey VARCHAR(255)) READS SQL DATA @@ -1139,8 +1142,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `myUser_loginWithName` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -1148,13 +1149,15 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `myUser_loginWithName`(vUserName VARCHAR(255)) READS SQL DATA BEGIN /** * Logs in using only the user name. This procedure is intended to be executed - * by users with a high level of privileges so that normal users should not have + * by users with a high level of privileges so that normal users should not have * execute permissions on it. * * @param vUserName The user name @@ -1176,8 +1179,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `myUser_logout` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -1185,12 +1186,14 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `myUser_logout`() BEGIN /** * Logouts the user. - */ + */ SET @userId = NULL; SET @userName = NULL; SET @userSignature = NULL; @@ -1200,8 +1203,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `myUser_restorePassword` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -1209,6 +1210,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `myUser_restorePassword`(vVerificationToken VARCHAR(255), vPassword VARCHAR(255)) BEGIN @@ -1225,8 +1228,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `role_checkName` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -1234,6 +1235,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `role_checkName`(vRoleName VARCHAR(255)) BEGIN @@ -1254,8 +1257,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `role_getDescendents` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -1263,6 +1264,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `role_getDescendents`(vSelf INT) BEGIN @@ -1313,9 +1316,9 @@ BEGIN SELECT COUNT(*) > 0 INTO vIsRoot FROM tmp.role t - JOIN role r ON r.id = t.id + JOIN role r ON r.id = t.id WHERE r.`name` = 'root'; - + IF vIsRoot THEN INSERT IGNORE INTO tmp.role (id) SELECT id FROM role; @@ -1331,8 +1334,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `role_sync` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -1340,6 +1341,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `role_sync`() BEGIN @@ -1395,8 +1398,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `role_syncPrivileges` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -1404,6 +1405,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb3 */ ; /*!50003 SET character_set_results = utf8mb3 */ ; /*!50003 SET collation_connection = utf8mb3_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `role_syncPrivileges`() BEGIN @@ -1973,8 +1976,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `user_changePassword` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -1982,6 +1983,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `user_changePassword`(vSelf INT, vOldPassword VARCHAR(255), vPassword VARCHAR(255)) BEGIN @@ -1998,7 +2001,7 @@ BEGIN SELECT `password` = MD5(vOldPassword), `name` INTO vPasswordOk, vUserName FROM user WHERE id = vSelf; - + IF NOT vPasswordOk THEN SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'Invalid password'; @@ -2011,8 +2014,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `user_checkName` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -2020,6 +2021,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `user_checkName`(vUserName VARCHAR(255)) BEGIN @@ -2039,8 +2042,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `user_checkPassword` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -2048,6 +2049,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `user_checkPassword`(vPassword VARCHAR(255)) BEGIN @@ -2072,7 +2075,7 @@ BEGIN IF vChr REGEXP '[[:alpha:]]' THEN SET vNAlpha = vNAlpha+1; - + IF vChr REGEXP '[A-Z]' THEN SET vNUpper = vNUpper+1; @@ -2107,8 +2110,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `user_restorePassword` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -2116,6 +2117,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `user_restorePassword`(vSelf INT, vVerificationToken VARCHAR(255), vPassword VARCHAR(255)) BEGIN @@ -2132,7 +2135,7 @@ BEGIN SELECT verificationToken = vVerificationToken, `name` INTO vTokenVerified, vUserName FROM user WHERE id = vSelf; - + IF NOT vTokenVerified THEN SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'Invalid verification token'; @@ -2145,8 +2148,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `user_setPassword` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -2154,6 +2155,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `user_setPassword`(vSelf INT, vPassword VARCHAR(255)) BEGIN @@ -2194,15 +2197,16 @@ DROP TABLE IF EXISTS `bajasLaborales`; /*!50001 DROP VIEW IF EXISTS `bajasLaborales`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `bajasLaborales` AS SELECT - 1 AS `firstname`, - 1 AS `name`, - 1 AS `businessFk`, - 1 AS `lastDate`, - 1 AS `endContract`, - 1 AS `type`, - 1 AS `dias`, - 1 AS `userFk` */; +/*!50001 CREATE TABLE `bajasLaborales` ( + `firstname` tinyint NOT NULL, + `name` tinyint NOT NULL, + `businessFk` tinyint NOT NULL, + `lastDate` tinyint NOT NULL, + `endContract` tinyint NOT NULL, + `type` tinyint NOT NULL, + `dias` tinyint NOT NULL, + `userFk` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -2235,7 +2239,7 @@ DROP TABLE IF EXISTS `carteras`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `carteras` ( - `CodigoTrabajador` varchar(3) CHARACTER SET latin1 NOT NULL, + `CodigoTrabajador` varchar(3) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL, `Año` int(11) NOT NULL, `Mes` int(11) NOT NULL, `Peso` decimal(10,2) DEFAULT NULL, @@ -2267,11 +2271,11 @@ DROP TABLE IF EXISTS `clientDied`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `clientDied` ( `id` int(11) NOT NULL DEFAULT 0, - `clientName` varchar(50) COLLATE utf8mb3_unicode_ci NOT NULL, + `clientName` varchar(50) NOT NULL, `lastInvoiced` date DEFAULT NULL, - `workerCode` varchar(3) COLLATE utf8mb3_unicode_ci NOT NULL, - `Boss` varchar(3) COLLATE utf8mb3_unicode_ci NOT NULL, - `Aviso` varchar(13) CHARACTER SET utf8mb3 DEFAULT NULL, + `workerCode` varchar(3) NOT NULL, + `Boss` varchar(3) NOT NULL, + `Aviso` varchar(13) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='Clientes que no han comprado en los ultimos 3 meses, se actualiza con proceso nocturno el 3 de cada mes'; /*!40101 SET character_set_client = @saved_cs_client */; @@ -2453,9 +2457,9 @@ DROP TABLE IF EXISTS `inspeccionSS_2021`; CREATE TABLE `inspeccionSS_2021` ( `business_id` int(11) DEFAULT NULL, `id` int(11) NOT NULL DEFAULT 0, - `firstName` varchar(50) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `lastName` varchar(50) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `name` varchar(45) COLLATE utf8mb3_unicode_ci NOT NULL, + `firstName` varchar(50) DEFAULT NULL, + `lastName` varchar(50) DEFAULT NULL, + `name` varchar(45) NOT NULL, `timed` datetime NOT NULL, `hours_week` smallint(6) DEFAULT NULL, `year` int(4) NOT NULL, @@ -2473,30 +2477,31 @@ DROP TABLE IF EXISTS `lastIndicators`; /*!50001 DROP VIEW IF EXISTS `lastIndicators`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `lastIndicators` AS SELECT - 1 AS `updated`, - 1 AS `lastYearSales`, - 1 AS `incLastYearSales`, - 1 AS `totalGreuge`, - 1 AS `incTotalGreuge`, - 1 AS `latePaymentRate`, - 1 AS `incLatePaymentRate`, - 1 AS `countEmployee`, - 1 AS `incCountEmployee`, - 1 AS `averageMana`, - 1 AS `incAverageMana`, - 1 AS `bankingPool`, - 1 AS `incbankingPool`, - 1 AS `lastMonthActiveClients`, - 1 AS `incLastMonthActiveClients`, - 1 AS `lastMonthLostClients`, - 1 AS `incLastMonthLostClients`, - 1 AS `lastMonthNewClients`, - 1 AS `incLastMonthNewClients`, - 1 AS `lastMonthWebBuyingRate`, - 1 AS `incLastMonthWebBuyingRate`, - 1 AS `thisWeekSales`, - 1 AS `lastYearWeekSales` */; +/*!50001 CREATE TABLE `lastIndicators` ( + `updated` tinyint NOT NULL, + `lastYearSales` tinyint NOT NULL, + `incLastYearSales` tinyint NOT NULL, + `totalGreuge` tinyint NOT NULL, + `incTotalGreuge` tinyint NOT NULL, + `latePaymentRate` tinyint NOT NULL, + `incLatePaymentRate` tinyint NOT NULL, + `countEmployee` tinyint NOT NULL, + `incCountEmployee` tinyint NOT NULL, + `averageMana` tinyint NOT NULL, + `incAverageMana` tinyint NOT NULL, + `bankingPool` tinyint NOT NULL, + `incbankingPool` tinyint NOT NULL, + `lastMonthActiveClients` tinyint NOT NULL, + `incLastMonthActiveClients` tinyint NOT NULL, + `lastMonthLostClients` tinyint NOT NULL, + `incLastMonthLostClients` tinyint NOT NULL, + `lastMonthNewClients` tinyint NOT NULL, + `incLastMonthNewClients` tinyint NOT NULL, + `lastMonthWebBuyingRate` tinyint NOT NULL, + `incLastMonthWebBuyingRate` tinyint NOT NULL, + `thisWeekSales` tinyint NOT NULL, + `lastYearWeekSales` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -2516,7 +2521,7 @@ CREATE TABLE `m3` ( `month` int(11) DEFAULT NULL, `week` int(11) DEFAULT NULL, `day` int(11) DEFAULT NULL, - `dayName` varchar(12) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `dayName` varchar(12) DEFAULT NULL, `euros` decimal(10,2) DEFAULT 0.00, PRIMARY KEY (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; @@ -2535,10 +2540,10 @@ CREATE TABLE `nightTask` ( `finished` datetime DEFAULT NULL, `lastFinished` datetime DEFAULT NULL, `order` int(11) DEFAULT NULL, - `schema` varchar(45) COLLATE utf8mb3_unicode_ci NOT NULL, - `procedure` varchar(100) COLLATE utf8mb3_unicode_ci NOT NULL, - `error` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `errorCode` varchar(10) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `schema` varchar(45) NOT NULL, + `procedure` varchar(100) NOT NULL, + `error` varchar(255) DEFAULT NULL, + `errorCode` varchar(10) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -2559,7 +2564,7 @@ BEGIN IF NOT (NEW.`schema`REGEXP '^[0-9a-zA-Z_]+$') OR NOT (NEW.`procedure`REGEXP '^[0-9a-zA-Z_]+$') THEN CALL util.throw('ONLY_ALPHANUMERICS_ALLOWED'); - + END IF; END */;; @@ -2585,7 +2590,7 @@ BEGIN IF NOT (NEW.`schema`REGEXP '^[0-9a-zA-Z_]+$') OR NOT (NEW.`procedure`REGEXP '^[0-9a-zA-Z_]+$') THEN CALL util.throw('ONLY_ALPHANUMERICS_ALLOWED'); - + END IF; END */;; @@ -2604,7 +2609,7 @@ DROP TABLE IF EXISTS `nightTaskConfig`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `nightTaskConfig` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `logMail` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `logMail` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -2617,12 +2622,13 @@ DROP TABLE IF EXISTS `packingSpeed`; /*!50001 DROP VIEW IF EXISTS `packingSpeed`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `packingSpeed` AS SELECT - 1 AS `hora`, - 1 AS `minuto`, - 1 AS `cm3`, - 1 AS `warehouse_id`, - 1 AS `odbc_date` */; +/*!50001 CREATE TABLE `packingSpeed` ( + `hora` tinyint NOT NULL, + `minuto` tinyint NOT NULL, + `cm3` tinyint NOT NULL, + `warehouse_id` tinyint NOT NULL, + `odbc_date` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -2656,7 +2662,7 @@ DROP TABLE IF EXISTS `payMethodClientEvolution`; CREATE TABLE `payMethodClientEvolution` ( `id` int(11) NOT NULL AUTO_INCREMENT, `dated` date NOT NULL, - `payMethodName` varchar(45) COLLATE utf8mb3_unicode_ci NOT NULL, + `payMethodName` varchar(45) NOT NULL, `amountClient` int(11) NOT NULL, `amount` decimal(10,2) NOT NULL, `equalizationTax` decimal(10,2) NOT NULL, @@ -2672,12 +2678,13 @@ DROP TABLE IF EXISTS `s1_ticketDetail`; /*!50001 DROP VIEW IF EXISTS `s1_ticketDetail`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `s1_ticketDetail` AS SELECT - 1 AS `ticketFk`, - 1 AS `ticketAmount`, - 1 AS `ticketLines`, - 1 AS `ticketM3`, - 1 AS `shipped` */; +/*!50001 CREATE TABLE `s1_ticketDetail` ( + `ticketFk` tinyint NOT NULL, + `ticketAmount` tinyint NOT NULL, + `ticketLines` tinyint NOT NULL, + `ticketM3` tinyint NOT NULL, + `shipped` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -2688,19 +2695,20 @@ DROP TABLE IF EXISTS `s21_saleDetail`; /*!50001 DROP VIEW IF EXISTS `s21_saleDetail`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `s21_saleDetail` AS SELECT - 1 AS `dia`, - 1 AS `año`, - 1 AS `mes`, - 1 AS `concepto`, - 1 AS `unidades`, - 1 AS `precio`, - 1 AS `venta`, - 1 AS `familia`, - 1 AS `comprador`, - 1 AS `itemFk`, - 1 AS `ticketFk`, - 1 AS `volume` */; +/*!50001 CREATE TABLE `s21_saleDetail` ( + `dia` tinyint NOT NULL, + `año` tinyint NOT NULL, + `mes` tinyint NOT NULL, + `concepto` tinyint NOT NULL, + `unidades` tinyint NOT NULL, + `precio` tinyint NOT NULL, + `venta` tinyint NOT NULL, + `familia` tinyint NOT NULL, + `comprador` tinyint NOT NULL, + `itemFk` tinyint NOT NULL, + `ticketFk` tinyint NOT NULL, + `volume` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -2801,16 +2809,16 @@ CREATE TABLE `salesByclientSalesPerson` ( /*!40101 SET character_set_client = @saved_cs_client */; -- --- Table structure for table `salesMonthlySnapshot` +-- Table structure for table `salesMonthlySnapshot___` -- -DROP TABLE IF EXISTS `salesMonthlySnapshot`; +DROP TABLE IF EXISTS `salesMonthlySnapshot___`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; -CREATE TABLE `salesMonthlySnapshot` ( +CREATE TABLE `salesMonthlySnapshot___` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `salesPersonName` varchar(100) COLLATE utf8mb3_unicode_ci DEFAULT '', - `teamName` varchar(100) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `salesPersonName` varchar(100) DEFAULT '', + `teamName` varchar(100) DEFAULT NULL, `year` int(11) DEFAULT NULL, `month` int(11) DEFAULT NULL, `currentSale` decimal(10,3) DEFAULT NULL, @@ -2822,32 +2830,7 @@ CREATE TABLE `salesMonthlySnapshot` ( `newClientScore` decimal(10,3) DEFAULT NULL, `teamBossPlus` decimal(10,3) DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Table structure for table `salesPerson` --- - -DROP TABLE IF EXISTS `salesPerson`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `salesPerson` ( - `workerFk` int(10) unsigned NOT NULL, - `year` int(4) NOT NULL, - `month` int(2) NOT NULL, - `amount` decimal(10,2) DEFAULT NULL, - `commission` decimal(10,2) DEFAULT NULL, - `leasedCommission` decimal(10,2) DEFAULT NULL COMMENT 'comision proveniente de clientes que han sido donados. Ver tabla Clientes_cedidos', - `cededCommission` decimal(10,2) DEFAULT NULL COMMENT 'comision generada por los clientes que han sido donados. Ver tabla Clientes_cedidos', - `newCommission` decimal(10,2) DEFAULT NULL, - `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(), - 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=utf8mb3 COLLATE=utf8mb3_unicode_ci; +) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='@deprecated 2022-11'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -2871,43 +2854,45 @@ CREATE TABLE `salesPersonEvolution` ( /*!40101 SET character_set_client = @saved_cs_client */; -- --- Temporary table structure for view `vendedores` +-- Table structure for table `salesPerson__` -- -DROP TABLE IF EXISTS `vendedores`; -/*!50001 DROP VIEW IF EXISTS `vendedores`*/; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; -/*!50001 CREATE VIEW `vendedores` AS SELECT - 1 AS `Id_Trabajador`, - 1 AS `año`, - 1 AS `mes`, - 1 AS `importe`, - 1 AS `comision`, - 1 AS `comisionArrendada`, - 1 AS `comisionCedida`, - 1 AS `comisionNuevos`, - 1 AS `sustitucionArrendada`, - 1 AS `itemTypeBorrowed`, - 1 AS `portfolioWeight`, - 1 AS `updated` */; -SET character_set_client = @saved_cs_client; - --- --- Table structure for table `vendedores_evolution` --- - -DROP TABLE IF EXISTS `vendedores_evolution`; +DROP TABLE IF EXISTS `salesPerson__`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; -CREATE TABLE `vendedores_evolution` ( +CREATE TABLE `salesPerson__` ( + `workerFk` int(10) unsigned NOT NULL, + `year` int(4) NOT NULL, + `month` int(2) NOT NULL, + `amount` decimal(10,2) DEFAULT NULL, + `commission` decimal(10,2) DEFAULT NULL, + `leasedCommission` decimal(10,2) DEFAULT NULL COMMENT 'comision proveniente de clientes que han sido donados. Ver tabla Clientes_cedidos', + `cededCommission` decimal(10,2) DEFAULT NULL COMMENT 'comision generada por los clientes que han sido donados. Ver tabla Clientes_cedidos', + `newCommission` decimal(10,2) DEFAULT NULL, + `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(), + 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=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='@deprecated 2022-11'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `vendedores_evolution__` +-- + +DROP TABLE IF EXISTS `vendedores_evolution__`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `vendedores_evolution__` ( `workerFk` int(10) unsigned NOT NULL, `year` int(11) NOT NULL, `sales` decimal(10,2) DEFAULT NULL, `month` int(11) NOT NULL, PRIMARY KEY (`workerFk`,`year`,`month`), CONSTRAINT `evo_vendedor_trabajador` FOREIGN KEY (`workerFk`) REFERENCES `vn`.`worker` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='@deprecated 2022-11'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -2918,15 +2903,16 @@ DROP TABLE IF EXISTS `ventas`; /*!50001 DROP VIEW IF EXISTS `ventas`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `ventas` AS SELECT - 1 AS `Id_Movimiento`, - 1 AS `importe`, - 1 AS `recargo`, - 1 AS `fecha`, - 1 AS `tipo_id`, - 1 AS `Id_Cliente`, - 1 AS `empresa_id`, - 1 AS `margen` */; +/*!50001 CREATE TABLE `ventas` ( + `Id_Movimiento` tinyint NOT NULL, + `importe` tinyint NOT NULL, + `recargo` tinyint NOT NULL, + `fecha` tinyint NOT NULL, + `tipo_id` tinyint NOT NULL, + `Id_Cliente` tinyint NOT NULL, + `empresa_id` tinyint NOT NULL, + `margen` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -2944,7 +2930,7 @@ CREATE TABLE `ventas_contables` ( `reino_id` int(10) unsigned NOT NULL, `tipo_id` smallint(5) unsigned NOT NULL, `empresa_id` int(4) NOT NULL, - `gasto` varchar(10) CHARACTER SET latin1 NOT NULL, + `gasto` varchar(10) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL, PRIMARY KEY (`year`,`month`,`grupo`,`reino_id`,`tipo_id`,`empresa_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -2957,10 +2943,10 @@ DROP TABLE IF EXISTS `waste`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `waste` ( - `buyer` varchar(30) CHARACTER SET utf8mb3 NOT NULL, + `buyer` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, `year` int(4) NOT NULL, `week` int(2) NOT NULL, - `family` varchar(30) COLLATE utf8mb3_unicode_ci NOT NULL, + `family` varchar(30) NOT NULL, `itemFk` int(11) NOT NULL DEFAULT 0, `itemTypeFk` smallint(5) unsigned DEFAULT NULL, `saleTotal` decimal(16,0) DEFAULT NULL, @@ -2983,7 +2969,7 @@ DROP TABLE IF EXISTS `workerLabourDataByMonth`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `workerLabourDataByMonth` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `code` varchar(25) COLLATE utf8mb3_unicode_ci NOT NULL, + `code` varchar(25) NOT NULL, `month` int(2) NOT NULL, `year` int(4) NOT NULL, `total` int(5) NOT NULL COMMENT 'Número de empleados', @@ -3007,12 +2993,14 @@ CREATE TABLE `workerProductivity` ( `workerFk` int(10) unsigned NOT NULL, `volume` decimal(10,6) NOT NULL, `seconds` int(11) NOT NULL, - `actionFk` int(11) NOT NULL, + `actionFk` int(11) DEFAULT NULL, + `stateFk` tinyint(3) unsigned DEFAULT NULL, PRIMARY KEY (`id`), KEY `workerProductivity_warehouseFk_idx` (`warehouseFk`), KEY `workerProductivity_workerFk_idx` (`workerFk`), KEY `workerProductivity_roleFk_idx` (`actionFk`), - CONSTRAINT `workerProductivity_FK` FOREIGN KEY (`actionFk`) REFERENCES `vn`.`ticketTrackingState` (`id`) ON UPDATE CASCADE, + KEY `workerProductivity_FK_1` (`stateFk`), + CONSTRAINT `workerProductivity_FK_1` FOREIGN KEY (`stateFk`) REFERENCES `vn`.`state` (`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=utf8mb3 COLLATE=utf8mb3_unicode_ci; @@ -3042,14 +3030,14 @@ DELIMITER ;; /*!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 = utf8mb4 */ ;; -/*!50003 SET character_set_results = utf8mb4 */ ;; -/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;; +/*!50003 SET character_set_client = utf8mb3 */ ;; +/*!50003 SET character_set_results = utf8mb3 */ ;; +/*!50003 SET collation_connection = utf8mb3_general_ci */ ;; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;; -/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ;; +/*!50003 SET sql_mode = 'IGNORE_SPACE,STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION' */ ;; /*!50003 SET @saved_time_zone = @@time_zone */ ;; /*!50003 SET time_zone = 'SYSTEM' */ ;; -/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `nightTask_launchAll` ON SCHEDULE EVERY 1 DAY STARTS '2022-02-08 04:14:00' ON COMPLETION PRESERVE ENABLE DO CALL bs.nightTask_launchAll */ ;; +/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `nightTask_launchAll` ON SCHEDULE EVERY 1 DAY STARTS '2022-02-08 04:14:00' ON COMPLETION PRESERVE DISABLE ON SLAVE DO CALL bs.nightTask_launchAll */ ;; /*!50003 SET time_zone = @saved_time_zone */ ;; /*!50003 SET sql_mode = @saved_sql_mode */ ;; /*!50003 SET character_set_client = @saved_cs_client */ ;; @@ -3061,8 +3049,6 @@ DELIMITER ; -- -- Dumping routines for database 'bs' -- -/*!50003 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `tramo` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -3070,6 +3056,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb3 */ ; /*!50003 SET character_set_results = utf8mb3 */ ; /*!50003 SET collation_connection = utf8mb3_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `tramo`(vDateTime DATETIME) RETURNS varchar(20) CHARSET utf8 COLLATE utf8_unicode_ci NO SQL @@ -3077,11 +3065,11 @@ BEGIN DECLARE vTramo VARCHAR(20); DECLARE vHour INT; - + SET vHour = HOUR(vDateTime) ; - + SET vTramo = - CASE + CASE WHEN vHour BETWEEN 0 AND 14 THEN 'Mañana' WHEN vHour BETWEEN 15 AND 24 THEN 'Tarde' END ; @@ -3093,8 +3081,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `bancos_evolution_add` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -3102,6 +3088,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `bancos_evolution_add`(vStartingDate DATE) BEGIN @@ -3109,7 +3097,7 @@ BEGIN * Inserta en la tabla bancos_evolution los saldos acumulados de cada banco * * @param vStartingDate Fecha desde la cual se recalculan la tabla bs.bancos_evolution - */ + */ DECLARE vCurrentDate DATE; DECLARE vMaxDate DATE DEFAULT TIMESTAMPADD(MONTH, 7, util.VN_CURDATE()); IF IFNULL(vStartingDate,0) < TIMESTAMPADD(YEAR, -5, util.VN_CURDATE()) THEN @@ -3123,49 +3111,49 @@ BEGIN SELECT vCurrentDate, Id_Banco, deuda FROM bs.bancos_evolution WHERE Fecha = TIMESTAMPADD(DAY,-1,vCurrentDate); - + WHILE vCurrentDate < vMaxDate DO -- insertar solo el dia de ayer INSERT INTO bs.bancos_evolution(Fecha ,Id_Banco, saldo) - SELECT vCurrentDate, Id_Banco, SUM(saldo) + SELECT vCurrentDate, Id_Banco, SUM(saldo) FROM ( SELECT Id_Banco ,saldo FROM bs.bancos_evolution WHERE Fecha = TIMESTAMPADD(DAY,-1,vCurrentDate) -- los saldos acumulados del dia anterior UNION ALL - + SELECT c.Id_Banco, IFNULL(SUM(Entrada),0) - IFNULL(SUM(Salida),0) as saldo FROM vn2008.Cajas c JOIN vn2008.Bancos b using(Id_Banco) -- saldos de las cajas - JOIN vn.accountingType at2 ON at2.id = b.cash + JOIN vn.accountingType at2 ON at2.id = b.cash WHERE at2.code IN ('wireTransfer','fundingLine') AND Cajafecha = vCurrentDate AND (Serie = 'MB' OR at2.code = 'fundingLine') GROUP BY Id_Banco - )sub + )sub GROUP BY Id_Banco ON DUPLICATE KEY UPDATE saldo = saldo + VALUES(saldo); - + SET vCurrentDate = TIMESTAMPADD(DAY,1,vCurrentDate); END WHILE; - -- Ahora actualizamos la quilla + -- Ahora actualizamos la quilla UPDATE bs.bancos_evolution be JOIN ( SELECT bp.Id_Banco, - sum(bp.importe) as quilla, t.dated - FROM vn.time t + FROM vn.time t JOIN vn2008.Bancos_poliza bp ON t.dated between apertura AND IFNULL(cierre, t.dated) WHERE t.dated BETWEEN vStartingDate AND vMaxDate GROUP BY Id_Banco, t.dated ) sub ON be.Id_Banco = sub.Id_Banco AND sub.dated = be.Fecha - SET be.quilla = sub.quilla; + SET be.quilla = sub.quilla; -- pagos futuros no concilidados INSERT INTO bs.bancos_evolution(Fecha, Id_Banco, saldo) SELECT t.dated, p.id_banco, - importe - FROM vn.time t + FROM vn.time t join vn2008.pago p ON p.fecha <= t.dated WHERE t.dated BETWEEN util.VN_CURDATE() AND vMaxDate AND p.fecha BETWEEN util.VN_CURDATE() AND vMaxDate @@ -3175,7 +3163,7 @@ BEGIN -- cobros futuros INSERT INTO bs.bancos_evolution(Fecha, Id_Banco, saldo) SELECT t.dated, r.Id_Banco, SUM(Entregado) - FROM vn.time t + FROM vn.time t JOIN vn2008.Recibos r ON r.Fechacobro <= t.dated WHERE r.Fechacobro > util.VN_CURDATE() AND r.Fechacobro <= vMaxDate AND t.dated BETWEEN util.VN_CURDATE() AND vMaxDate @@ -3185,10 +3173,10 @@ BEGIN -- saldos de la tabla prevision INSERT INTO bs.bancos_evolution(Fecha, Id_Banco, saldo) SELECT t.dated, sp.Id_Banco, SUM(Importe) - FROM vn.time t + FROM vn.time t JOIN vn2008.Saldos_Prevision sp ON sp.Fecha <= t.dated JOIN vn2008.Bancos b ON sp.Id_Banco = b.Id_Banco - JOIN vn.accountingType at2 ON at2.id = b.cash + JOIN vn.accountingType at2 ON at2.id = b.cash WHERE at2.code IN ('wireTransfer','fundingLine') AND t.dated BETWEEN vStartingDate AND vMaxDate GROUP BY t.dated, sp.Id_Banco @@ -3202,12 +3190,12 @@ BEGIN -- Deuda UPDATE bs.bancos_evolution be JOIN vn2008.Bancos b using(Id_Banco) - JOIN vn.accountingType at2 ON at2.id = b.cash + JOIN vn.accountingType at2 ON at2.id = b.cash SET be.deuda = IF(at2.code = 'fundingLine', be.saldo_aux, 0) , be.saldo = IF(at2.code = 'fundingLine', 0, be.saldo_aux) WHERE Fecha >= vStartingDate; - -- Liquidez + -- Liquidez update bs.bancos_evolution set liquidez = saldo - quilla + deuda WHERE Fecha >= vStartingDate; -- Disponibilidad update bs.bancos_evolution set `disponibilidad ajena` = - quilla + deuda WHERE Fecha >= vStartingDate; @@ -3218,8 +3206,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `campaignComparative` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -3227,17 +3213,19 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `campaignComparative`(vDateFrom DATE, vDateTo DATE) BEGIN - SELECT - workerName, - id, - name, - CAST(SUM(previousAmmount) AS DECIMAL(10, 0)) AS previousAmmount, - CAST(SUM(currentAmmount) AS DECIMAL(10, 0)) AS currentAmmount + SELECT + workerName, + id, + name, + CAST(SUM(previousAmmount) AS DECIMAL(10, 0)) AS previousAmmount, + CAST(SUM(currentAmmount) AS DECIMAL(10, 0)) AS currentAmmount FROM ( - (SELECT + (SELECT CONCAT(w.firstname, ' ', w.lastName) AS workerName, c.id, c.name, @@ -3246,11 +3234,11 @@ BEGIN FROM bs.ventas v INNER JOIN vn.`client` c ON v.Id_Cliente = c.id INNER JOIN vn.worker w ON c.salesPersonFk = w.id - WHERE v.fecha BETWEEN DATE_ADD(vDateFrom, INTERVAL - 1 YEAR) + WHERE v.fecha BETWEEN DATE_ADD(vDateFrom, INTERVAL - 1 YEAR) AND DATE_ADD(vDateTo, INTERVAL - 1 YEAR) GROUP BY w.id, v.Id_Cliente) UNION ALL - (SELECT + (SELECT CONCAT(w.firstname, ' ', w.lastName) AS workerName, c.id, c.name, @@ -3273,8 +3261,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `carteras_add` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -3282,6 +3268,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `carteras_add`() BEGIN @@ -3296,7 +3284,7 @@ BEGIN FROM vn.time t 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 + JOIN vn.worker w ON w.id = c.salesPersonFk WHERE t.year >= YEAR(util.VN_CURDATE()) - 1 GROUP BY w.code, t.year , t.month; END ;; @@ -3305,8 +3293,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `clean` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -3314,6 +3300,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `clean`() BEGIN @@ -3330,32 +3318,30 @@ BEGIN DELETE FROM bs.clientNewBorn WHERE lastShipped < vOneYearAgo; - + DELETE FROM ventas WHERE fecha < vFourYearsAgo; - + DELETE FROM payMethodClient WHERE dated < vOneYearAgo; DELETE FROM payMethodClientEvolution WHERE dated < vFourYearsAgo; - DELETE FROM bs.salesByclientSalesPerson + DELETE FROM bs.salesByclientSalesPerson WHERE dated < vFourYearsAgo; - - DELETE FROM bs.m3 + + DELETE FROM bs.m3 WHERE fecha < vTwoYearAgo; DELETE FROM salesByItemTypeDay - WHERE dated < vThreeYearAgo; + WHERE dated < vThreeYearAgo; END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `clientDied_recalc` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -3363,6 +3349,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `clientDied_recalc`() BEGIN @@ -3401,8 +3389,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `clientNewBorn_recalc` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -3410,21 +3396,23 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `clientNewBorn_recalc`() BLOCK1: BEGIN DECLARE vClientFk INT; - DECLARE vShipped DATE; + DECLARE vShipped DATE; DECLARE vPreviousShipped DATE; - DECLARE vDone boolean; - DECLARE cur cursor for - - SELECT clientFk, firstShipped - FROM bs.clientNewBorn; - - DECLARE continue HANDLER FOR NOT FOUND SET vDone = TRUE; - SET vDone := FALSE; + DECLARE vDone boolean; + DECLARE cur cursor for + + SELECT clientFk, firstShipped + FROM bs.clientNewBorn; + + DECLARE continue HANDLER FOR NOT FOUND SET vDone = TRUE; + SET vDone := FALSE; DELETE FROM bs.clientNewBorn WHERE isModified = FALSE; @@ -3436,7 +3424,7 @@ BLOCK1: BEGIN 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; - + LOOP1: LOOP SET vDone := FALSE; FETCH cur INTO vClientFk, vShipped; @@ -3447,37 +3435,37 @@ BLOCK1: BEGIN END IF; BLOCK2: BEGIN - DECLARE vCurrentShipped DATE; - DECLARE vDone2 boolean; + DECLARE vCurrentShipped DATE; + DECLARE vDone2 boolean; DECLARE cur2 CURSOR FOR - SELECT shipped - FROM vn.ticket + SELECT shipped + FROM vn.ticket WHERE clientFk = vClientFk AND shipped <= util.VN_CURDATE() ORDER BY shipped DESC; - + DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone2 = TRUE; SET vDone2 := FALSE; OPEN cur2; - + SET vPreviousShipped := vShipped; LOOP2: LOOP SET vDone2 := FALSE; FETCH cur2 INTO vCurrentShipped; - + IF DATEDIFF(vPreviousShipped,vCurrentShipped) > 365 THEN - UPDATE bs.clientNewBorn - SET firstShipped = vPreviousShipped + UPDATE bs.clientNewBorn + SET firstShipped = vPreviousShipped WHERE clientFk= vClientFk; - + CLOSE cur2; - LEAVE LOOP2; + LEAVE LOOP2; END IF; - + SET vPreviousShipped := vCurrentShipped; IF vDone2 THEN - UPDATE bs.clientNewBorn - SET firstShipped = vCurrentShipped + UPDATE bs.clientNewBorn + SET firstShipped = vCurrentShipped WHERE clientFk= vClientFk; CLOSE cur2; LEAVE LOOP2; @@ -3487,22 +3475,20 @@ BLOCK1: BEGIN END BLOCK2; END LOOP LOOP1; - UPDATE bs.clientNewBorn cnb + UPDATE bs.clientNewBorn cnb LEFT JOIN (SELECT DISTINCT t.clientFk FROM vn.ticket t JOIN vn.productionConfig pc 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); - + SET cnd.isRookie = ISNULL(notRookie.clientFk); + END BLOCK1 ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `comercialesCompleto` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -3510,21 +3496,23 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `comercialesCompleto`(IN vWorker INT, vDate DATE) BEGIN DECLARE vAYearAgoStarted DATE DEFAULT DATE_FORMAT(TIMESTAMPADD(YEAR, - 1, vDate), '%Y-%m-01'); DECLARE vAYearAgoEnded DATE DEFAULT TIMESTAMPADD(YEAR, - 1, LAST_DAY(vDate)); - + CALL vn.worker_GetHierarchy(vWorker); - + INSERT IGNORE INTO tmp.workerHierarchyList (workerFk) SELECT wd2.workerFk FROM vn.workerDepartment wd2 WHERE wd2.workerFk = vWorker; - + -- Falta que en algunos casos solo tenga en cuenta los tipos afectados. - SELECT + SELECT c.Id_Cliente id_cliente, c.calidad, c.Cliente cliente, @@ -3550,7 +3538,7 @@ BEGIN FROM vn2008.Clientes c LEFT JOIN - (SELECT g.Id_Cliente, CAST( SUM(Importe) as DECIMAL(12,2)) AS Greuge + (SELECT g.Id_Cliente, CAST( SUM(Importe) as DECIMAL(12,2)) AS Greuge FROM vn2008.Greuges g JOIN vn.`client` c ON c.id = g.Id_Cliente LEFT JOIN vn.worker w ON c.salesPersonFk = w.id @@ -3572,14 +3560,14 @@ BEGIN WHERE v.fecha BETWEEN TIMESTAMPADD(YEAR, - 1, vDate) AND vDate GROUP BY v.Id_Cliente) c365 ON c365.Id_Cliente = c.Id_Cliente LEFT JOIN - (SELECT + (SELECT Id_Cliente, SUM(importe) consumo FROM bs.ventas v INNER JOIN vn2008.Clientes c USING (Id_Cliente) LEFT JOIN vn2008.Trabajadores tr ON c.Id_Trabajador = tr.Id_Trabajador WHERE - (c.Id_Trabajador = vWorker OR tr.boss = vWorker) + (c.Id_Trabajador = vWorker OR tr.boss = vWorker) AND (v.fecha BETWEEN TIMESTAMPADD(DAY, - DAY(vDate) + 1, vDate) AND TIMESTAMPADD(DAY, - 1, vDate)) GROUP BY Id_Cliente) mes_actual ON mes_actual.Id_Cliente = c.Id_Cliente LEFT JOIN @@ -3626,8 +3614,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `compradores_add` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -3635,22 +3621,24 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `compradores_add`(IN vYear INT, IN vWeekFrom INT, IN vWeekTo INT) BEGIN /** * Sustituye los registros de "bs.compradores". - * + * * @param vYear: año ventas * @param vWeekFrom: semana desde * @param vWeekTo: semana hasta */ REPLACE bs.compradores - SELECT it.workerFk AS Id_Trabajador, vYear AS año, tm.week AS semana, SUM(importe) AS importe, 0 AS comision + SELECT it.workerFk AS Id_Trabajador, vYear AS año, tm.week AS semana, SUM(importe) AS importe, 0 AS comision FROM bs.ventas v JOIN vn.time tm ON tm.dated = v.fecha - JOIN vn.itemType it ON it.id = v.tipo_id - WHERE tm.year = vYear + JOIN vn.itemType it ON it.id = v.tipo_id + WHERE tm.year = vYear AND tm.week BETWEEN vWeekFrom AND vWeekTo AND it.categoryFk != 6 GROUP BY it.workerFk, tm.week; @@ -3660,8 +3648,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `compradores_add_launcher` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -3669,6 +3655,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `compradores_add_launcher`() BEGIN @@ -3676,22 +3664,22 @@ BEGIN DECLARE vYear INT; DECLARE vWeek INT; DECLARE done BOOL DEFAULT FALSE; - + DECLARE rs CURSOR FOR SELECT year, week FROM vn.time - WHERE dated <= util.VN_CURDATE() - AND year = vYear + WHERE dated <= util.VN_CURDATE() + AND year = vYear AND week >= vWeek; - + DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE; - - SELECT MAX(año) INTO vYear + + SELECT MAX(año) INTO vYear FROM compradores; - + SELECT MAX(semana) INTO vWeek - FROM compradores - WHERE año = vYear; + FROM compradores + WHERE año = vYear; OPEN rs; @@ -3700,7 +3688,7 @@ BEGIN WHILE NOT done DO CALL compradores_add(vYear, vWeek, vWeek); - + FETCH rs INTO vYear, vWeek; END WHILE; @@ -3708,15 +3696,13 @@ BEGIN CLOSE rs; CALL compradores_evolution_add; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `compradores_evolution_add` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -3724,6 +3710,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `compradores_evolution_add`() BEGIN @@ -3740,10 +3728,10 @@ DECLARE i INT DEFAULT 1; SELECT TIMESTAMPADD(DAY,1,MAX(fecha)) INTO datFEC FROM bs.compradores_evolution; IF ISNULL(datFEC) THEN - - SELECT min(fecha) INTO datFEC + + SELECT min(fecha) INTO datFEC FROM bs.ventas; - + INSERT INTO bs.compradores_evolution( Id_Trabajador , fecha , importe) @@ -3752,19 +3740,19 @@ SELECT TIMESTAMPADD(DAY,1,MAX(fecha)) INTO datFEC FROM bs.compradores_evolution; JOIN vn2008.Tipos tp using(tipo_id) WHERE fecha = datFEC GROUP BY Id_Trabajador; - + SET datFEC = TIMESTAMPADD(DAY, 1, datFEC); - + END IF; WHILE datFEC < util.VN_CURDATE() DO - - IF i mod 150 = 0 THEN + + IF i mod 150 = 0 THEN SELECT datFEC; END IF; - + SET i = i + 1; - + REPLACE bs.compradores_evolution( Id_Trabajador , fecha , importe) @@ -3772,7 +3760,7 @@ SELECT TIMESTAMPADD(DAY,1,MAX(fecha)) INTO datFEC FROM bs.compradores_evolution; SELECT Id_Trabajador , datFEC as fecha , sum(importe) as importe - + FROM ( @@ -3780,17 +3768,17 @@ SELECT TIMESTAMPADD(DAY,1,MAX(fecha)) INTO datFEC FROM bs.compradores_evolution; , importe FROM bs.compradores_evolution WHERE fecha = TIMESTAMPADD(DAY,-1,datFEC) -- las ventas acumuladas del dia anterior - + UNION ALL - + SELECT Id_Trabajador , importe * IF(v.fecha < datFEC,-1,1) -- se restan las ventas del año anterior y se suman las del actual FROM bs.ventas v JOIN vn2008.Tipos tp using(tipo_id) WHERE fecha IN (datFEC, TIMESTAMPADD(DAY,-365,datFEC)) AND reino_id != 6 - - )sub + + )sub GROUP BY Id_Trabajador; SET datFEC = TIMESTAMPADD(DAY,1,datFEC); @@ -3804,8 +3792,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `fondo_evolution_add` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -3813,6 +3799,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `fondo_evolution_add`() BEGIN @@ -3820,49 +3808,49 @@ BEGIN * Inserta en la tabla fondo_maniobra los saldos acumulados en los ultimos 365 dias */ DECLARE datFEC DATE DEFAULT '2015-01-01'; - - SELECT TIMESTAMPADD(DAY,1,MAX(fecha)) - INTO datFEC + + SELECT TIMESTAMPADD(DAY,1,MAX(fecha)) + INTO datFEC FROM bs.fondo_maniobra; - + WHILE datFEC < util.VN_CURDATE() DO - + IF DAY(datFEC) MOD 28 = 0 THEN -- esto solo sirve para no aburrirse mientras esperamos... SELECT datFEC; END IF; - + REPLACE bs.fondo_maniobra(Fecha, clientes_facturas, clientes_cobros,proveedores_facturas,proveedores_pagos, fondo) SELECT datFEC AS Fecha, Facturas, Cobros,Recibidas,Pagos, Facturas + Cobros + Recibidas + Pagos FROM ( SELECT SUM(io.amount) AS Facturas FROM vn.invoiceOut io - JOIN vn.client c ON io.clientFk = c.id + JOIN vn.client c ON io.clientFk = c.id WHERE c.isRelevant - AND io.companyFk <> 1381 + AND io.companyFk <> 1381 AND io.issued BETWEEN '2011-01-01' AND datFEC ) fac JOIN ( SELECT - SUM(r.amountPaid) AS Cobros - FROM vn.receipt r - JOIN vn.client c ON r.clientFk = c.id - WHERE c.isRelevant + FROM vn.receipt r + JOIN vn.client c ON r.clientFk = c.id + WHERE c.isRelevant AND r.companyFk <> 1381 AND r.payed BETWEEN '2011-01-01' AND datFEC ) cob JOIN ( SELECT - SUM(id.amount) AS Recibidas - FROM vn.invoiceIn ii - JOIN vn.invoiceInDueDay id ON ii.id = id.invoiceInFk + FROM vn.invoiceIn ii + JOIN vn.invoiceInDueDay id ON ii.id = id.invoiceInFk WHERE ii.companyFk <> 1381 AND ii.issued BETWEEN '2015-01-01' AND datFEC ) rec JOIN ( SELECT SUM(p.amount) AS Pagos - FROM vn.payment p - WHERE p.companyFk <>1381 + FROM vn.payment p + WHERE p.companyFk <>1381 AND p.received BETWEEN '2015-01-01' AND datFEC ) pag; - + UPDATE bs.fondo_maniobra JOIN ( SELECT AVG(fondo) AS media @@ -3870,7 +3858,7 @@ BEGIN WHERE fecha <= datFEC ) sub SET fondo_medio = media WHERE fecha = datFEC; - + SET datFEC = TIMESTAMPADD(DAY,1,datFEC); END WHILE; @@ -3882,8 +3870,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `fruitsEvolution` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -3891,10 +3877,12 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `fruitsEvolution`() BEGIN -select Id_Cliente, +select Id_Cliente, Cliente, count(semana) as semanas, (w.code IS NOT NULL) isWorker from ( select distinct v.Id_Cliente, c.name as Cliente, week(fecha, 3) as semana @@ -3912,8 +3900,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `indicatorsUpdate` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -3921,6 +3907,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `indicatorsUpdate`(vDated DATE) BEGIN @@ -3935,40 +3923,40 @@ BEGIN -- Ventas totales del ultimo año UPDATE indicators - SET lastYearSales = + SET lastYearSales = (SELECT SUM(importe + recargo) FROM ventas v JOIN vn2008.empresa e ON e.id = v.empresa_id JOIN vn2008.empresa_grupo eg ON eg.empresa_grupo_id = e.empresa_grupo WHERE fecha BETWEEN oneYearBefore AND vDated AND eg.grupo = 'Verdnatura' - ) + ) WHERE updated = vDated; - + -- Greuge total acumulado UPDATE indicators - SET totalGreuge = + SET totalGreuge = (SELECT SUM(amount) FROM vn.greuge WHERE shipped <= vDated - ) + ) WHERE updated = vDated; -- Tasa de morosidad con respecto a las ventas del último mes UPDATE indicators - SET latePaymentRate = - (SELECT SUM(amount) - FROM bi.defaulters + SET latePaymentRate = + (SELECT SUM(amount) + FROM bi.defaulters WHERE date = vDated AND amount > 0) / - (SELECT SUM(importe + recargo) - FROM ventas + (SELECT SUM(importe + recargo) + FROM ventas WHERE fecha BETWEEN oneMonthBefore AND vDated) WHERE updated = vDated; -- Número de trabajadores activos UPDATE indicators - SET countEmployee = + SET countEmployee = (SELECT CAST(SUM(cl.hours_week) / 40 AS DECIMAL (10, 2)) FROM vn.business b JOIN postgresql.calendar_labour_type cl ON cl.calendar_labour_type_id = b.calendarTypeFk @@ -3987,7 +3975,7 @@ BEGIN -- Número de clientes que han comprado en los últimos 30 dias UPDATE indicators - SET lastMonthActiveClients = + SET lastMonthActiveClients = (SELECT COUNT(DISTINCT t.clientFk) FROM vn.ticket t WHERE t.shipped BETWEEN oneMonthBefore AND vDated @@ -3996,9 +3984,9 @@ BEGIN -- Número de clientes que no han comprado en los últimos 30 dias, pero compraron en los 30 anteriores UPDATE indicators - SET lastMonthLostClients = + SET lastMonthLostClients = (SELECT COUNT(lm.clientFk) - FROM + FROM (SELECT DISTINCT t.clientFk FROM vn.ticket t WHERE t.shipped BETWEEN oneMonthBefore AND vDated @@ -4015,9 +4003,9 @@ BEGIN -- Número de clientes que han comprado en los últimos 30 dias, pero no compraron en los 30 anteriores UPDATE indicators - SET lastMonthNewClients = + SET lastMonthNewClients = (SELECT COUNT(cm.clientFk) - FROM + FROM (SELECT DISTINCT t.clientFk FROM vn.ticket t WHERE t.shipped BETWEEN oneMonthBefore AND vDated @@ -4043,7 +4031,7 @@ BEGIN -- Cálculo de las ventas agrupado por semanas SELECT week INTO vWeek - FROM vn.time + FROM vn.time WHERE dated = vDated; TRUNCATE salesByWeek; @@ -4057,12 +4045,12 @@ BEGIN -- Indicador Ventas semana actual UPDATE indicators i - JOIN salesByWeek s ON s.week= vWeek + JOIN salesByWeek s ON s.week= vWeek AND s.year = YEAR(vDated) SET i.thisWeekSales = s.sales WHERE updated = vDated; - -- Indicador ventas semana actual en el año pasado + -- Indicador ventas semana actual en el año pasado UPDATE indicators i JOIN salesByWeek s ON s.week = vWeek AND s.year = YEAR(vDated)-1 @@ -4075,8 +4063,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `indicatorsUpdateLauncher` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -4084,6 +4070,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `indicatorsUpdateLauncher`() BEGIN @@ -4093,15 +4081,15 @@ BEGIN SELECT IFNULL(TIMESTAMPADD(DAY,1,MAX(updated)), '2018-04-01') INTO vDated FROM bs.indicators; - + WHILE vDated < util.VN_CURDATE() DO - + CALL indicatorsUpdate(vDated); - + SELECT TIMESTAMPADD(DAY,1,MAX(updated)) INTO vDated FROM bs.indicators; - + END WHILE; END ;; @@ -4110,8 +4098,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `inspeccionSS_2021_add` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -4119,6 +4105,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `inspeccionSS_2021_add`() BEGIN @@ -4126,30 +4114,30 @@ BEGIN TRUNCATE bs.inspeccionSS_2021; INSERT INTO bs.inspeccionSS_2021 - SELECT wbd.businessFk , - w.id, - w.firstName, - w.lastName, - d.name , - wtc.timed , - cl.hours_week , - t.`year` , - t.week , + SELECT wbd.businessFk , + w.id, + w.firstName, + w.lastName, + d.name , + wtc.timed , + cl.hours_week , + t.`year` , + t.week , t.dated , 0 AS orden FROM vn.workerTimeControl wtc JOIN vn.worker w ON w.id = wtc.userFk - JOIN vn.workerBusinessDated wbd ON wbd.workerFk = wtc.userFk + JOIN vn.workerBusinessDated wbd ON wbd.workerFk = wtc.userFk AND wbd.dated = date(wtc.timed) JOIN vn.time t ON t.dated = wbd.dated - JOIN vn.business b ON b.id = wbd.businessFk - JOIN postgresql.calendar_labour_type AS cl ON b.calendarTypeFk = cl.calendar_labour_type_id - JOIN vn.department d ON d.id = b.departmentFk + JOIN vn.business b ON b.id = wbd.businessFk + JOIN postgresql.calendar_labour_type AS cl ON b.calendarTypeFk = cl.calendar_labour_type_id + JOIN vn.department d ON d.id = b.departmentFk JOIN vn.department d2 ON d2.id = d.parentFk AND d2.name = 'PRODUCCION' WHERE wtc.timed BETWEEN '2020-10-01' AND '2021-04-19' AND d.lft BETWEEN d2.lft AND d2.rgt AND lastName NOT LIKE 'FERRER%'; - + SET @orden := 1; SET @id := 0; SET @day := 0; @@ -4158,15 +4146,13 @@ BEGIN SET orden = IF(id = @id AND day(timed) = @day, @orden := @orden + 1, @orden := 1), id = @id := id + (0 * @day := day(timed)) ORDER BY id, timed; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `m3Add` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -4174,21 +4160,23 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `m3Add`() BEGIN DECLARE datSTART DATE; DECLARE datEND DATE; - + SELECT TIMESTAMPADD(WEEK, -1,MAX(fecha)) INTO datSTART FROM bs.m3; - + SET datEND = TIMESTAMPADD(DAY,-1,util.VN_CURDATE()); - - DELETE FROM bs.m3 + + DELETE FROM bs.m3 WHERE fecha >= datSTART; - + INSERT INTO bs.m3 (fecha, provinceFk, warehouseFk, m3, year, month, week, day, dayName, euros) SELECT v.fecha, a.provinceFk, t.warehouseFk, sum(s.quantity * ic.cm3delivery) / 1000000 AS m3, tm.year, tm.month, tm.week, tm.day, dayname(v.fecha), sum(importe) @@ -4210,8 +4198,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `manaCustomerUpdate` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -4219,6 +4205,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `manaCustomerUpdate`() BEGIN @@ -4231,51 +4219,51 @@ BEGIN DECLARE vManaBankId INT; DECLARE vManaGreugeTypeId INT; - SELECT id INTO vManaId + SELECT id INTO vManaId FROM vn.component WHERE code = 'mana'; - - SELECT id INTO vManaAutoId + + SELECT id INTO vManaAutoId FROM vn.component WHERE code = 'autoMana'; - + SELECT id INTO vClaimManaId FROM vn.component WHERE code = 'manaClaim'; - - SELECT id INTO vManaBankId + + SELECT id INTO vManaBankId FROM vn.bank WHERE code = 'mana'; - - SELECT id INTO vManaGreugeTypeId + + SELECT id INTO vManaGreugeTypeId FROM vn.greugeType WHERE code = 'mana'; SELECT IFNULL(MAX(dated), '2016-01-01') - INTO vFromDated + INTO vFromDated FROM vn.clientManaCache; - + DELETE FROM vn.clientManaCache WHERE dated = vFromDated; SELECT IFNULL(MAX(dated), '2016-01-01') - INTO vFromDated + INTO vFromDated FROM vn.clientManaCache; WHILE timestampadd(DAY,30,vFromDated) < util.VN_CURDATE() DO SELECT timestampadd(DAY,30,vFromDated), - timestampadd(DAY,-90,vFromDated) - INTO + timestampadd(DAY,-90,vFromDated) + INTO vToDated, vForDeleteDated; - + DELETE FROM vn.clientManaCache WHERE dated <= vForDeleteDated; INSERT INTO vn.clientManaCache(clientFk, mana, dated) - SELECT + SELECT Id_Cliente, cast(sum(mana) as decimal(10,2)) as mana, - vToDated as dated - FROM + vToDated as dated + FROM ( SELECT cs.Id_Cliente, Cantidad * Valor as mana FROM vn2008.Tickets t @@ -4283,20 +4271,20 @@ BEGIN JOIN vn2008.Movimientos m on m.Id_Ticket = t.Id_Ticket JOIN vn2008.Movimientos_componentes mc on mc.Id_Movimiento = m.Id_Movimiento WHERE Id_Componente IN (vManaAutoId, vManaId, vClaimManaId) - AND t.Fecha > vFromDated + AND t.Fecha > vFromDated AND date(t.Fecha) <= vToDated UNION ALL SELECT r.Id_Cliente, - Entregado FROM vn2008.Recibos r WHERE Id_Banco = vManaBankId - AND Fechacobro > vFromDated + AND Fechacobro > vFromDated AND Fechacobro <= vToDated - + UNION ALL SELECT g.Id_Cliente, g.Importe FROM vn2008.Greuges g WHERE Greuges_type_id = vManaGreugeTypeId - AND Fecha > vFromDated + AND Fecha > vFromDated AND Fecha <= vToDated UNION ALL SELECT clientFk, mana @@ -4307,7 +4295,7 @@ BEGIN HAVING Id_Cliente; SET vFromDated = vToDated; - + END WHILE; END ;; @@ -4316,8 +4304,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `manaSpellers_actualize` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -4325,30 +4311,32 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `manaSpellers_actualize`() BEGIN -/** - * Recalcula el valor del campo con el modificador de precio para el componente de maná automático. +/** + * Recalcula el valor del campo con el modificador de precio + * para el componente de maná automático. */ - UPDATE vn.workerMana wm - JOIN - (SELECT Id_Trabajador workerFk, FLOOR(SUM(importe)/12) pesoCarteraMensual - FROM bs.vendedores - WHERE año * 100 + mes >= (YEAR(util.VN_CURDATE()) -1) * 100 + MONTH(util.VN_CURDATE()) - GROUP BY workerFk - ) lastYearSales USING(workerFk) - SET pricesModifierRate = GREATEST(minRate, LEAST(maxRate, ROUND(- amount/lastYearSales.pesoCarteraMensual,3))); - + JOIN( + SELECT sb.salespersonFk, FLOOR(SUM(sb.amount) / 12) monthlyAmount + FROM salesByclientSalesPerson sb + JOIN vn.time t ON t.dated = sb.dated + WHERE t.year * 100 + t.month >= + (YEAR(util.VN_CURDATE()) - 1) * 100 + MONTH(util.VN_CURDATE()) + GROUP BY salespersonFk + ) lastYearSales ON wm.workerFk = lastYearSales.salespersonFk + SET pricesModifierRate = GREATEST(minRate, + LEAST(maxRate, ROUND( - amount / lastYearSales.monthlyAmount, 3))); END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `nightTask_launchAll` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -4356,6 +4344,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `nightTask_launchAll`() BEGIN @@ -4372,8 +4362,8 @@ BEGIN DECLARE vId INT; DECLARE rs CURSOR FOR - SELECT id, `schema`, `procedure` - FROM nightTask + SELECT id, `schema`, `procedure` + FROM nightTask WHERE finished <= util.VN_CURDATE() OR finished IS NULL ORDER BY `order`; @@ -4406,7 +4396,7 @@ BEGIN vError, vErrorCode ); - + IF vError IS NOT NULL THEN SET vNErrors = vNErrors + 1; @@ -4444,8 +4434,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `nightTask_launchTask` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -4453,6 +4441,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `nightTask_launchTask`( vSchema VARCHAR(255), @@ -4476,15 +4466,13 @@ BEGIN vError = MESSAGE_TEXT, vErrorCode = RETURNED_SQLSTATE; - CALL util.exec(CONCAT('CALL `', vSchema ,'`.`', vProcedure ,'`')); + CALL util.exec(CONCAT('CALL `', vSchema ,'`.`', vProcedure ,'`')); END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `payMethodClientAdd` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -4492,33 +4480,33 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `payMethodClientAdd`() BEGIN - INSERT IGNORE INTO `bs`.`payMethodClient` (dated, payMethodFk, clientFk) + INSERT IGNORE INTO `bs`.`payMethodClient` (dated, payMethodFk, clientFk) SELECT util.VN_CURDATE(), c.payMethodFk, c.id - FROM vn.client c + FROM vn.client c JOIN vn.payMethod p ON c.payMethodFk = p.id; - + TRUNCATE `bs`.`payMethodClientEvolution` ; - + INSERT INTO `bs`.`payMethodClientEvolution` (dated, payMethodName, amountClient, amount, equalizationTax) - SELECT p.dated, pm.name, COUNT(p.clientFk), SUM(sub.importe) , SUM(sub.recargo) + SELECT p.dated, pm.name, COUNT(p.clientFk), SUM(sub.importe) , SUM(sub.recargo) FROM bs.payMethodClient p - JOIN (SELECT SUM(v.importe) AS importe, SUM(v.recargo) as recargo, v.fecha, v.Id_cliente + JOIN (SELECT SUM(v.importe) AS importe, SUM(v.recargo) as recargo, v.fecha, v.Id_cliente FROM bs.ventas v WHERE v.fecha>= (SELECT MIN(dated) FROM bs. payMethodClient) GROUP BY v.Id_cliente, v.fecha) sub ON sub.fecha = p.dated AND sub.Id_cliente = p.ClientFk JOIN vn.payMethod pm ON p.payMethodFk = pm.id - GROUP BY dated,payMethodFk; + GROUP BY dated,payMethodFk; END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `saleGraphic` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -4526,16 +4514,18 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `saleGraphic`(IN vItemFk INT, IN vTypeFk INT, IN vCategoryFk INT, IN vFromDate DATE, IN vToDate DATE, IN vProducerFk INT) BEGIN - + DECLARE vFromDateLastYear DATE; DECLARE vToDateLastYear DATE; DECLARE vFromDateTwoYearsAgo DATE; DECLARE vToDateTwoYearsAgo DATE; - + SET vItemFk = IFNULL(vItemFk,0); SET vTypeFk = IFNULL(vTypeFk, 0); SET vCategoryFk = IFNULL(vCategoryFk,0); @@ -4550,27 +4540,25 @@ BEGIN SELECT s.quantity, CAST(v.importe AS DECIMAL(10,0)) importe, v.fecha FROM bs.ventas v - JOIN vn.sale s ON s.id = v.Id_Movimiento - JOIN vn.item i ON i.id = s.itemFk - JOIN vn.itemType it ON it.id = i.typeFk - JOIN vn.itemCategory ic ON ic.id = it.categoryFk + JOIN vn.sale s ON s.id = v.Id_Movimiento + JOIN vn.item i ON i.id = s.itemFk + JOIN vn.itemType it ON it.id = i.typeFk + JOIN vn.itemCategory ic ON ic.id = it.categoryFk WHERE vItemFk IN (i.id, 0) AND vTypeFk IN (i.typeFk, 0) AND vCategoryFk IN (it.categoryFk, 0) AND vProducerFk IN (i.producerFk, 0) AND (v.fecha BETWEEN vFromDate AND vToDate OR v.fecha BETWEEN vFromDateLastYear AND vToDateLastYear - OR v.fecha BETWEEN vFromDateTwoYearsAgo AND vToDateTwoYearsAgo + OR v.fecha BETWEEN vFromDateTwoYearsAgo AND vToDateTwoYearsAgo ); - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `salePersonEvolutionAdd` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -4578,32 +4566,32 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `salePersonEvolutionAdd`(IN vDateStart DATETIME) BEGIN - DELETE FROM bs.salePersonEvolution + DELETE FROM bs.salePersonEvolution WHERE dated <= DATE_SUB(util.VN_CURDATE(), INTERVAL 1 YEAR); - - + + INSERT INTO bs.salePersonEvolution (dated, amount, equalizationTax, salesPersonFk) - SELECT fecha dated, - CAST(SUM(importe) AS DECIMAL(10,2) ) amount, + SELECT fecha dated, + CAST(SUM(importe) AS DECIMAL(10,2) ) amount, CAST(SUM(recargo) AS DECIMAL(10,2) ) equalizationTax , IFNULL(salesPersonFk,0) salesPersonFk FROM bs.ventas v - JOIN vn.client c ON v.Id_Cliente = c.id + JOIN vn.client c ON v.Id_Cliente = c.id JOIN vn.company co ON co.id = v.empresa_id WHERE co.code = "VNL" AND fecha >= vDateStart GROUP BY v.fecha,c.salesPersonFk - ORDER BY salesPersonFk,dated ASC; + ORDER BY salesPersonFk,dated ASC; END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `salesByclientSalesPerson_add` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -4611,13 +4599,15 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `salesByclientSalesPerson_add`(vDatedFrom DATE) BEGIN /** * Agrupa las ventas por cliente/comercial/fecha en la tabla bs.salesByclientSalesPerson * El asociación cliente/comercial/fecha, se mantiene correcta en el tiempo - * + * * @param vDatedFrom el cálculo se realizará desde la fecha introducida hasta ayer */ @@ -4625,17 +4615,17 @@ BEGIN SET vDatedFrom = util.VN_CURDATE() - INTERVAL 1 MONTH; END IF; - UPDATE salesByclientSalesPerson + UPDATE salesByclientSalesPerson SET amount = 0, equalizationTax = 0, amountNewBorn = 0 WHERE dated BETWEEN vDatedFrom AND util.yesterday(); - - INSERT INTO salesByclientSalesPerson( - dated, - salesPersonFk, - clientFk, - amount, + + INSERT INTO salesByclientSalesPerson( + dated, + salesPersonFk, + clientFk, + amount, equalizationTax) SELECT s.dated, c.salesPersonFk, @@ -4644,7 +4634,7 @@ BEGIN SUM(s.surcharge) FROM sale s JOIN vn.client c on s.clientFk = c.id - WHERE s.dated BETWEEN vDatedFrom AND util.yesterday() + WHERE s.dated BETWEEN vDatedFrom AND util.yesterday() GROUP BY s.dated, c.salesPersonFk, s.clientFk ON DUPLICATE KEY UPDATE amount= VALUES(amount), equalizationTax= VALUES(equalizationTax); @@ -4661,8 +4651,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `salesByItemTypeDay_add` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -4670,169 +4658,171 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `salesByItemTypeDay_add`(vDateStart DATE, vDateEnd DATE) BEGIN /** * Almacena datos relativos a las ventas de artículos agrupados por reino y familia * - * @param vDateStart - * @param vDateEnd + * @param vDateStart + * @param vDateEnd */ - - DELETE FROM bs.salesByItemTypeDay + + DELETE FROM bs.salesByItemTypeDay WHERE dated BETWEEN vDateStart AND vDateEnd; - + INSERT INTO bs.salesByItemTypeDay (itemTypeFk, itemCategoryFk, dated) - SELECT id, categoryFk, dated + SELECT id, categoryFk, dated FROM vn.itemType JOIN vn.`time` WHERE dated BETWEEN vDateStart AND vDateEnd; - + UPDATE bs.salesByItemTypeDay it - JOIN (SELECT ic.id itemCategoryFk, + JOIN (SELECT ic.id itemCategoryFk, it.id itemTypeFk, bs.dated, SUM(bs.amount) netSale FROM bs.sale bs JOIN vn.itemType it ON it.id = bs.typeFk - JOIN vn .itemCategory ic ON ic.id = it.categoryFk + JOIN vn .itemCategory ic ON ic.id = it.categoryFk JOIN vn.client c on c.id = bs.clientFk JOIN vn.sale s ON s.id = bs.saleFk - JOIN vn.item i ON i.id = s.itemFk - JOIN vn.ticket t ON t.id = s.ticketFk + JOIN vn.item i ON i.id = s.itemFk + JOIN vn.ticket t ON t.id = s.ticketFk JOIN vn.`time` ti ON ti.dated = bs.dated - WHERE ic.merchandise + WHERE ic.merchandise AND bs.dated BETWEEN vDateStart AND vDateEnd GROUP BY ic.id, it.id, bs.dated) sub ON sub.dated = it.dated AND sub.itemCategoryFk = it.itemCategoryFk AND sub.itemTypeFk = it.itemTypeFk SET it.netSale = sub.netSale; - - + + UPDATE bs.salesByItemTypeDay it - JOIN (SELECT ic.id AS itemCategoryFk, + JOIN (SELECT ic.id AS itemCategoryFk, it.id AS itemTypeFk, bs.dated, SUM(i.stems * s.quantity) stems FROM bs.sale bs JOIN vn.itemType it ON it.id = bs.typeFk - JOIN vn.itemCategory ic ON ic.id = it.categoryFk + JOIN vn.itemCategory ic ON ic.id = it.categoryFk JOIN vn.sale s ON s.id = bs.saleFk - JOIN vn.ticket t ON t.id = s.ticketFk - JOIN vn.item i ON i.id = s.itemFk + JOIN vn.ticket t ON t.id = s.ticketFk + JOIN vn.item i ON i.id = s.itemFk JOIN vn.`time` tm ON tm.dated = bs.dated - WHERE ic.merchandise + WHERE ic.merchandise AND bs.dated BETWEEN vDateStart AND vDateEnd - GROUP BY ic.id, it.id, bs.dated) sub ON sub.dated = it.dated AND sub.itemCategoryFk = it.itemCategoryFk AND sub.itemTypeFk = it.itemTypeFk + GROUP BY ic.id, it.id, bs.dated) sub ON sub.dated = it.dated AND sub.itemCategoryFk = it.itemCategoryFk AND sub.itemTypeFk = it.itemTypeFk SET it.stems = sub.stems; - - + + UPDATE bs.salesByItemTypeDay it - JOIN (SELECT ic.id AS itemCategoryFk, + JOIN (SELECT ic.id AS itemCategoryFk, it.id AS itemTypeFk, DATE(t.shipped) dated, COUNT(DISTINCT(i.id)) `references` FROM vn.ticket t - JOIN vn.sale s ON s.ticketFk = t.id - JOIN vn.item i ON i.id = s.itemFk - JOIN vn.itemType it ON it.id = i.typeFk - JOIN vn.itemCategory ic ON ic.id = it.categoryFk - WHERE ic.merchandise + JOIN vn.sale s ON s.ticketFk = t.id + JOIN vn.item i ON i.id = s.itemFk + JOIN vn.itemType it ON it.id = i.typeFk + JOIN vn.itemCategory ic ON ic.id = it.categoryFk + WHERE ic.merchandise AND t.shipped BETWEEN vDateStart AND util.dayEnd(vDateEnd) GROUP BY ic.id, it.id, dated) sub ON sub.dated = it.dated AND sub.itemCategoryFk = it.itemCategoryFk AND sub.itemTypeFk = it.itemTypeFk SET it.`references` = sub.`references`; - + UPDATE bs.salesByItemTypeDay it - JOIN (SELECT ic.id AS itemCategoryFk, + JOIN (SELECT ic.id AS itemCategoryFk, it.id AS itemTypeFk, DATE(t.shipped) dated, SUM(i.stems*s.quantity) AS trash FROM vn.sale s - JOIN vn.ticket t ON t.id = s.ticketFk - JOIN vn.item i ON i.id = s.itemFk - JOIN vn.itemType it ON it.id = i.typeFk - JOIN vn.itemCategory ic ON ic.id = it.categoryFk - JOIN vn.client c ON c.id = t.clientFk - WHERE c.name = 'BASURA' + JOIN vn.ticket t ON t.id = s.ticketFk + JOIN vn.item i ON i.id = s.itemFk + JOIN vn.itemType it ON it.id = i.typeFk + JOIN vn.itemCategory ic ON ic.id = it.categoryFk + JOIN vn.client c ON c.id = t.clientFk + WHERE c.name = 'BASURA' AND t.shipped BETWEEN vDateStart AND util.dayEnd(vDateEnd) GROUP BY ic.id, it.id, dated) sub ON sub.dated = it.dated AND sub.itemCategoryFk = it.itemCategoryFk AND sub.itemTypeFk = it.itemTypeFk - SET it.trash = sub.trash; - + SET it.trash = sub.trash; + UPDATE bs.salesByItemTypeDay it - JOIN (SELECT ic.id AS itemCategoryFk, + JOIN (SELECT ic.id AS itemCategoryFk, it.id AS itemTypeFk, DATE(t.shipped) dated, SUM(IFNULL(i.stems, 1) * s.quantity) AS faults FROM vn.sale s - JOIN vn.ticket t ON t.id = s.ticketFk - JOIN vn.item i ON i.id = s.itemFk - JOIN vn.itemType it ON it.id = i.typeFk - JOIN vn.itemCategory ic ON ic.id = it.categoryFk - JOIN vn.client c ON c.id = t.clientFk - WHERE c.name = 'FALTAS' + JOIN vn.ticket t ON t.id = s.ticketFk + JOIN vn.item i ON i.id = s.itemFk + JOIN vn.itemType it ON it.id = i.typeFk + JOIN vn.itemCategory ic ON ic.id = it.categoryFk + JOIN vn.client c ON c.id = t.clientFk + WHERE c.name = 'FALTAS' AND t.shipped BETWEEN vDateStart AND util.dayEnd(vDateEnd) GROUP BY ic.id, it.id, dated) sub ON sub.dated = it.dated AND sub.itemCategoryFk = it.itemCategoryFk AND sub.itemTypeFk = it.itemTypeFk - SET it.`faults` = sub.`faults`; - + SET it.`faults` = sub.`faults`; + UPDATE bs.salesByItemTypeDay it - JOIN (SELECT ic.id AS itemCategoryFk, + JOIN (SELECT ic.id AS itemCategoryFk, it.id AS itemTypeFk, DATE(t.shipped) dated, - SUM((cb.quantity * s.price * (100 - s.discount) / 100) * ((cc.maxResponsibility - c.responsibility )/4 )) accepted, + SUM((cb.quantity * s.price * (100 - s.discount) / 100) * ((cc.maxResponsibility - c.responsibility )/4 )) accepted, SUM(cb.quantity * s.price * (100 - s.discount) / 100) claimed FROM vn.claim c JOIN vn.claimBeginning cb ON cb.claimFk = c.id JOIN vn.sale s ON s.id = cb.saleFk JOIN vn.ticket t ON t.id = s.ticketFk JOIN vn.item i ON i.id = s.itemFk - JOIN vn.itemType it ON it.id = i.typeFk - JOIN vn.itemCategory ic ON ic.id = it.categoryFk + JOIN vn.itemType it ON it.id = i.typeFk + JOIN vn.itemCategory ic ON ic.id = it.categoryFk JOIN vn.claimConfig cc - WHERE ic.merchandise + WHERE ic.merchandise AND t.shipped BETWEEN vDateStart AND util.dayEnd(vDateEnd) GROUP BY ic.id, it.id, dated) sub ON sub.dated = it.dated AND sub.itemCategoryFk = it.itemCategoryFk AND sub.itemTypeFk = it.itemTypeFk SET it.accepted = sub.accepted, it.claimed = sub.claimed; - + UPDATE bs.salesByItemTypeDay it - JOIN(SELECT itemCategoryFk, - itemTypeFk, - dated, - CAST(SUM(sale) AS DECIMAL(10,2)) sale, + JOIN(SELECT itemCategoryFk, + itemTypeFk, + dated, + CAST(SUM(sale) AS DECIMAL(10,2)) sale, CAST(SUM(buy) AS DECIMAL(10,2))buy - FROM(SELECT ic.id itemCategoryFk, + FROM(SELECT ic.id itemCategoryFk, it.id itemTypeFk, bs.dated, SUM(bs.amount) sale, 0 buy FROM bs.sale bs JOIN vn.itemType it ON it.id = bs.typeFk - JOIN vn.itemCategory ic ON ic.id = it.categoryFk + JOIN vn.itemCategory ic ON ic.id = it.categoryFk JOIN vn.client c on c.id = bs.clientFk JOIN vn.`time` tm ON tm.dated = bs.dated JOIN vn.sale s ON s.id = bs.saleFk - JOIN vn.item i ON i.id = s.itemFk - WHERE ic.merchandise + JOIN vn.item i ON i.id = s.itemFk + WHERE ic.merchandise AND bs.dated BETWEEN vDateStart AND vDateEnd GROUP BY ic.id, it.id, bs.dated - UNION ALL - SELECT ic.id, + UNION ALL + SELECT ic.id, it.id, t.landed, 0 , SUM(b.buyingValue * b.quantity) - FROM vn.entry e - JOIN vn.travel t ON t.id = e.travelFk - JOIN vn.buy b ON b.entryFk = e.id - JOIN vn.item i ON i.id = b.itemFk - JOIN vn.itemType it ON it.id = i.typeFk - JOIN vn.itemCategory ic ON ic.id = it.categoryFk + FROM vn.entry e + JOIN vn.travel t ON t.id = e.travelFk + JOIN vn.buy b ON b.entryFk = e.id + JOIN vn.item i ON i.id = b.itemFk + JOIN vn.itemType it ON it.id = i.typeFk + JOIN vn.itemCategory ic ON ic.id = it.categoryFk WHERE ic.merchandise AND t.landed BETWEEN vDateStart AND vDateEnd - GROUP BY ic.id, it.id, t.landed) sub + GROUP BY ic.id, it.id, t.landed) sub GROUP BY itemCategoryFk, itemTypeFk, dated) sub2 ON sub2.dated = it.dated AND sub2.itemCategoryFk = it.itemCategoryFk AND sub2.itemTypeFk = it.itemTypeFk SET it.sale = sub2.sale, it.buy = sub2.buy; - + DROP TEMPORARY TABLE IF EXISTS tmp.`component`; CREATE TEMPORARY TABLE tmp.`component` (PRIMARY KEY (`itemTypeFk`,`dated`), @@ -4840,18 +4830,18 @@ BEGIN KEY `salesByItemTypeDay_dated_idx` (`dated`)) ENGINE = MEMORY SELECT DATE(t.shipped) dated, - ic.id itemCategoryFk, + ic.id itemCategoryFk, it.id itemTypeFk, SUM(s.quantity * IF(c.code = 'purchaseValue', sc.value,0)) costComponent, SUM(s.quantity * IF(ct.isMargin, sc.value,0)) marginComponent FROM vn.ticket t - JOIN vn.sale s ON t.id = s.ticketFk - JOIN vn.item i ON i.id = s.itemFk - JOIN vn.itemType it ON it.id = i.typeFk - JOIN vn.itemCategory ic ON ic.id = it.categoryFk - JOIN vn.saleComponent sc ON sc.saleFk = s.id - STRAIGHT_JOIN vn.component c ON c.id = sc.componentFk - JOIN vn.componentType ct ON ct.id = c.typeFk + JOIN vn.sale s ON t.id = s.ticketFk + JOIN vn.item i ON i.id = s.itemFk + JOIN vn.itemType it ON it.id = i.typeFk + JOIN vn.itemCategory ic ON ic.id = it.categoryFk + JOIN vn.saleComponent sc ON sc.saleFk = s.id + STRAIGHT_JOIN vn.component c ON c.id = sc.componentFk + JOIN vn.componentType ct ON ct.id = c.typeFk WHERE t.shipped BETWEEN vDateStart AND util.dayEnd(vDateEnd) GROUP BY ic.id, it.id, dated; @@ -4860,23 +4850,23 @@ BEGIN SET it.costComponent = c.costComponent, it.marginComponent = c.marginComponent, it.saleComponent = c.costComponent + c.marginComponent; - - DROP TEMPORARY TABLE tmp.`component`; - + + DROP TEMPORARY TABLE tmp.`component`; + /* UPDATE bs.salesByItemTypeDay it JOIN(SELECT DATE(t.shipped) dated, - ic.id itemCategoryFk, + ic.id itemCategoryFk, it.id itemTypeFk, SUM(s.quantity * IF(c.code = 'purchaseValue', sc.value,0)) costComponent, SUM(s.quantity * IF(ct.isMargin, sc.value,0)) marginComponent FROM vn.ticket t - JOIN vn.sale s ON t.id = s.ticketFk - JOIN vn.item i ON i.id = s.itemFk - JOIN vn.itemType it ON it.id = i.typeFk - JOIN vn.itemCategory ic ON ic.id = it.categoryFk - JOIN vn.saleComponent sc ON sc.saleFk = s.id - STRAIGHT_JOIN vn.component c ON c.id = sc.componentFk - JOIN vn.componentType ct ON ct.id = c.typeFk + JOIN vn.sale s ON t.id = s.ticketFk + JOIN vn.item i ON i.id = s.itemFk + JOIN vn.itemType it ON it.id = i.typeFk + JOIN vn.itemCategory ic ON ic.id = it.categoryFk + JOIN vn.saleComponent sc ON sc.saleFk = s.id + STRAIGHT_JOIN vn.component c ON c.id = sc.componentFk + JOIN vn.componentType ct ON ct.id = c.typeFk JOIN vn.`time` tm ON tm.dated = DATE(t.shipped) WHERE t.shipped BETWEEN vDateStart AND util.dayEnd(vDateEnd) GROUP BY ic.id, it.id, dated)sub ON sub.dated = it.dated AND sub.itemCategoryFk = it.itemCategoryFk AND sub.itemTypeFk = it.itemTypeFk @@ -4889,8 +4879,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `salesByItemTypeDay_addLauncher` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -4898,6 +4886,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `salesByItemTypeDay_addLauncher`() BEGIN @@ -4911,222 +4901,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; -/*!50003 DROP PROCEDURE IF EXISTS `salesMonthlySnapshot_add` */; -/*!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 = utf8mb4 */ ; -/*!50003 SET character_set_results = utf8mb4 */ ; -/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; -DELIMITER ;; -CREATE DEFINER=`root`@`localhost` PROCEDURE `salesMonthlySnapshot_add`() -BEGIN - DECLARE vExecutionDay INT; - DECLARE vPlusNewClient INT; - DECLARE vPlusDifference INT; - DECLARE vScoreNewClient INT; - DECLARE vScoreDifference INT; - DECLARE vMaxWorkersWithPlusNewClient INT; - DECLARE vRowCount INT DEFAULT 1; - DECLARE vMaxRow INT; - DECLARE vPreviusMonth DATETIME DEFAULT util.VN_CURDATE(); - - SELECT executionDay, maxPlusNewClient, plusDifference, maxScoreNewClient, scoreDifference, salesPersonWithPlusNewClient - INTO vExecutionDay, vPlusNewClient, vPlusDifference, vScoreNewClient, vScoreDifference, vMaxWorkersWithPlusNewClient - FROM vn.commissionConfig; - - IF(DAY(util.VN_CURDATE()) = vExecutionDay) THEN - -- COMERCIAL Y EQUIPO - DROP TEMPORARY TABLE IF EXISTS tmp.salesPersons; - CREATE TEMPORARY TABLE tmp.salesPersons - ENGINE = MEMORY - SELECT u.id workerFk, - u.name salesPersonName, - d.name teamName - FROM vn.department d - JOIN vn.workerDepartment wd ON wd.departmentFk = d.id - JOIN account.user u ON u.id = wd.workerFk - JOIN vn.department d2 ON d2.id = d.parentFk - WHERE d2.code = 'VT'; - - -- VENTA, COMISIÓN - DROP TEMPORARY TABLE IF EXISTS tmp.sale; - CREATE TEMPORARY TABLE tmp.sale - ENGINE = MEMORY - SELECT YEAR(s.dated) year, - MONTH(s.dated) month, - u.name, - SUM(s.amount) currentSale, - SUM(s.amount)*cc.rate commissionSale, - s.salesPersonFk workerFk, - cc.minimumSalesByQuarter/3 minimumSalesByMonth - FROM - bs.salesByclientSalesPerson s - 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(vPreviusMonth) AND LAST_DAY(vPreviusMonth) - GROUP BY year, month, workerFk; - - -- OBJETIVO EVALUABLE (GRUPO) Y OBJETIVO INCENTIVO (INDIVIDUAL) - DROP TEMPORARY TABLE IF EXISTS tmp.objectives; - CREATE TEMPORARY TABLE tmp.objectives - ENGINE = MEMORY - SELECT - sg.rank, - sg.goal goalGroup, - sg4.goal goalIncentive, - sub.walletWeigth, - sub.walletWeigth*sg4.goal/100 AS incentiveObjective, - sub.walletWeigth*sg.goal/100 AS evaluableObjective, - sub.workerFk, - rb.bonus - FROM ( - SELECT sg.`rank` , - u.id workerFk, - IFNULL(v.portfolioWeight,0) AS walletWeigth - FROM bs.vendedores v - JOIN account.`user` u ON u.id = v.Id_Trabajador - JOIN vn.saleGoal sg ON sg.`year` = YEAR(vPreviusMonth) - AND sg.`month` = MONTH(vPreviusMonth) - AND v.portfolioWeight BETWEEN sg.walletWeightFrom AND sg.walletWeightTo - WHERE v.año = YEAR(vPreviusMonth)-1 AND v.mes = MONTH(vPreviusMonth) - GROUP BY u.id - ) sub - JOIN vn.saleGoal sg ON sg.`rank` = sub.rank AND sg.goalType = '1' AND sg.`year` = YEAR(vPreviusMonth) AND sg.`month` = MONTH(vPreviusMonth) - JOIN vn.saleGoal sg4 ON sg4.`rank` = sub.rank AND sg4.goalType = '4' AND sg4.`year` = YEAR(vPreviusMonth) AND sg4.`month` = MONTH(vPreviusMonth) - LEFT JOIN account.`user` u2 ON u2.id = sub.workerFk - JOIN vn.rankBonus rb ON rb.`rank` = sub.`rank`; - - -- PUNTUACIÓN EQUIPO, PLUS OBJETIVO EQUIPO - DROP TEMPORARY TABLE IF EXISTS tmp.scoreTeam; - CREATE TEMPORARY TABLE tmp.scoreTeam - ENGINE = MEMORY - SELECT *, - IF(sub1.teamScore >= sub1.minScoreForPlusTeam, sub1.plusTeamValue, 0) teamPlus - FROM ( - SELECT *, - (100/sub.countSalesPerson)*countGroupAchieved teamScore - FROM ( - SELECT COUNT(u.id) countSalesPerson, - u.id workerFk, - u.name salesPersonName, - d3.workerFk bossFk, - d.name teamName, - cc.minScoreForPlusTeam, - cc.minScoreForPlusBoss, - cc.plusTeam plusTeamValue, - cc.plusBoss, - SUM(IF(s.currentSale > r.evaluableObjective, 1, 0)) countGroupAchieved - FROM vn.department d - JOIN vn.workerDepartment wd ON wd.departmentFk = d.id - JOIN account.user u ON u.id = wd.workerFk - JOIN tmp.sale s ON s.workerFk = wd.workerFk - JOIN tmp.objectives r ON r.workerFk = wd.workerFk - JOIN vn.commissionConfig cc - JOIN vn.department d2 ON d2.id = d.parentFk - JOIN vn.department d3 ON d3.name = d.name - WHERE d2.code = 'VT' - GROUP BY d.name - ) sub - ) sub1; - - -- PLUS VARIABLE JEFE DE EQUIPO - DROP TEMPORARY TABLE IF EXISTS tmp.plusBoss; - CREATE TEMPORARY TABLE tmp.plusBoss - ENGINE = MEMORY - SELECT d.workerFk, - IF(st.teamScore >= st.minScoreForPlusBoss , st.countSalesPerson * st.plusBoss, 0) teamBossPlus - FROM tmp.scoreTeam st - JOIN vn.department d ON d.name = st.teamName; - - -- PLUS CLIENTES NUEVOS - DROP TEMPORARY TABLE IF EXISTS tmp.newClients; - CREATE TEMPORARY TABLE tmp.newClients ( - id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, - workerFk INTEGER(11), - name VARCHAR(30), - total DECIMAL(10,3), - newClientPlus INTEGER(11), - newClientScore INTEGER(11) - ); - - INSERT INTO tmp.newClients (workerFk, total, name, newClientPlus) - SELECT u.id workerFk, u.name, SUM(v.importe) total, vPlusNewClient - FROM bs.clientNewBorn cn - JOIN bs.ventas v ON DATE_ADD(cn.firstShipped, INTERVAL 1 YEAR) > v.fecha AND v.Id_Cliente = cn.clientFk - JOIN vn.client c ON c.id = v.Id_Cliente - 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 - JOIN vn.department d2 ON d2.id = d.parentFk - WHERE v.fecha >= util.firstDayOfMonth(vPreviusMonth) - AND cn.firstShipped >= util.firstDayOfMonth(DATE_ADD(vPreviusMonth, INTERVAL -1 year)) - AND d2.code = 'VT' - GROUP BY u.id - ORDER BY total DESC; - - SET vMaxRow = ROW_COUNT(); - - my_loop: LOOP - UPDATE tmp.newClients SET newClientPlus = vPlusNewClient WHERE id = vRowCount; - UPDATE tmp.newClients SET newClientScore = vScoreNewClient WHERE id = vRowCount; - - IF (vRowCount <= vMaxWorkersWithPlusNewClient) THEN - SET vPlusNewClient = vPlusNewClient - vPlusDifference; - ELSE - SET vPlusNewClient = 0; - END IF; - - SET vScoreNewClient = vScoreNewClient - vScoreDifference; - SET vRowCount = vRowCount + 1; - - IF vRowCount > vMaxRow THEN - LEAVE my_loop; - END IF; - END LOOP my_loop; - - INSERT INTO bs.salesMonthlySnapshot (salesPersonName, teamName, `year`, `month`, currentSale, commissionSale, individualPlus, teamPlus, teamScore, newClientPlus, newClientScore, teamBossPlus) - SELECT * - FROM ( - SELECT sp.salesPersonName, - sp.teamName, - s.`year`, - s.`month`, - s.currentSale, - s.commissionSale, - IF(s.currentSale > s.minimumSalesByMonth AND s.currentSale > r.incentiveObjective, r.bonus, 0) individualPlus, - np.teamPlus, - np.teamScore, - nc.newClientPlus, - nc.newClientScore, - pb.teamBossPlus - FROM tmp.salesPersons sp - LEFT JOIN tmp.sale s ON s.workerFk = sp.workerFk - LEFT JOIN tmp.objectives r ON r.workerFk = sp.workerFk - LEFT JOIN tmp.scoreTeam np ON np.teamName = sp.teamName - LEFT JOIN tmp.plusBoss pb ON pb.workerFk = sp.workerFk - LEFT JOIN tmp.newClients nc ON nc.workerFk = sp.workerFk - ) sub - ORDER BY salesPersonName; - - DROP TEMPORARY TABLE - tmp.salesPersons, - tmp.sale, - tmp.objectives, - tmp.scoreTeam, - tmp.newClients; - END IF; -END ;; -DELIMITER ; -/*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `salesPersonEvolution_add` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -5134,47 +4908,70 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `salesPersonEvolution_add`() BEGIN +/** + * Calcula los datos para los gráficos de evolución agrupado por salesPersonFk y día. + * Recalcula automáticamente los 3 últimos meses para comprobar si hay algún cambio. + */ DECLARE vDated DATE; DECLARE vCont INT DEFAULT 1; - SELECT TIMESTAMPADD(DAY,1,MAX(dated)) INTO vDated - FROM bs.salesPersonEvolution; + SELECT MAX(dated) - INTERVAL 3 MONTH INTO vDated + FROM salesPersonEvolution; + + DELETE FROM salesPersonEvolution + WHERE dated >= vDated; IF ISNULL(vDated) THEN - - SELECT MIN(dated) INTO vDated + SELECT MIN(dated) INTO vDated FROM salesByclientSalesPerson; - - INSERT INTO bs.salesPersonEvolution( salesPersonFk, dated, amount, equalizationTax, amountNewBorn ) - SELECT salesPersonFk, dated, amount, equalizationTax, amountNewBorn - FROM salesByclientSalesPerson + + INSERT INTO salesPersonEvolution( + salesPersonFk, + dated, + amount, + equalizationTax, + amountNewBorn + ) + SELECT salesPersonFk, + dated, + amount, + equalizationTax, + amountNewBorn + FROM salesByclientSalesPerson WHERE dated = vDated GROUP BY salesPersonFk; - SET vDated = TIMESTAMPADD(DAY, 1, vDated); + SET vDated = vDated + INTERVAL 1 DAY; END IF; WHILE vDated < util.VN_CURDATE() DO - - SET vCont = vCont + 1; - - REPLACE bs.salesPersonEvolution( salesPersonFk, dated, amount) - SELECT salesPersonFk, vDated, SUM(amount) - FROM(SELECT salesPersonFk, amount - FROM salesPersonEvolution - WHERE dated = TIMESTAMPADD(DAY,-1,vDated) -- amount acumulado día anterior - UNION ALL - SELECT salesPersonFk, amount * IF(dated < vDated,-1,1) -- suma amount año actual/ resta amount año anterior - FROM salesByclientSalesPerson - WHERE dated IN (vDated, TIMESTAMPADD(DAY,-365,vDated)) + + SET vCont = vCont + 1; + REPLACE salesPersonEvolution(salesPersonFk, dated, amount) + SELECT salesPersonFk, vDated, amount + FROM(SELECT salesPersonFk, SUM(amount) amount + FROM(SELECT salesPersonFk, amount + FROM salesPersonEvolution + WHERE dated = vDated - INTERVAL 1 DAY + UNION ALL + SELECT salesPersonFk, amount + FROM salesByclientSalesPerson + WHERE dated = vDated + UNION ALL + SELECT salesPersonFk, - amount + FROM salesByclientSalesPerson + WHERE dated = vDated - INTERVAL 1 YEAR + )sub + GROUP BY salesPersonFk )sub GROUP BY salesPersonFk; - SET vDated = TIMESTAMPADD(DAY,1,vDated); - + SET vDated = vDated + INTERVAL 1 DAY; END WHILE; END ;; DELIMITER ; @@ -5182,128 +4979,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; -/*!50003 DROP PROCEDURE IF EXISTS `salesPerson_updatePortfolio` */; -/*!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 = utf8mb4 */ ; -/*!50003 SET character_set_results = utf8mb4 */ ; -/*!50003 SET collation_connection = utf8mb4_general_ci */ ; -DELIMITER ;; -CREATE DEFINER=`root`@`localhost` PROCEDURE `salesPerson_updatePortfolio`() -BEGIN - /** - * Actualiza el campo portfolioWeight que indica el peso de la cartera del comercial - * - */ - 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 util.VN_CURDATE(); - - UPDATE vendedores v - JOIN ( - SELECT c.lastSalesPersonFk - , t.`year` - , t.`month` - , SUM(v.importe) importe - FROM vn.`time` t - 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 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; -END ;; -DELIMITER ; -/*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; -/*!50003 DROP PROCEDURE IF EXISTS `vendedores_add` */; -/*!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 = utf8mb4 */ ; -/*!50003 SET character_set_results = utf8mb4 */ ; -/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; -DELIMITER ;; -CREATE DEFINER=`root`@`localhost` PROCEDURE `vendedores_add`(intYEAR INT, vQuarter INT) -BEGIN - - DECLARE vCommissionRate DOUBLE; - - SELECT rate - INTO vCommissionRate - FROM vn.commissionConfig; - - -- vaciar tabla - DELETE v.* FROM vendedores v - JOIN vn.`time` t ON t.`year` = v.año AND t.`month` = v.mes - WHERE t.`year` = intYEAR AND QUARTER(t.dated) = vQuarter; - - REPLACE vendedores(Id_Trabajador, año, mes, importe, comision, portfolioWeight) - SELECT c.Id_Trabajador - , intYEAR - , MONTH(v.fecha) intMONTH - , sum(v.importe) - , sum(v.importe) * vCommissionRate - , sum(v.importe) - FROM ventas v - JOIN vn2008.Clientes c on v.Id_Cliente = c.Id_Cliente - JOIN vn.`time` t on t.dated = v.fecha - WHERE c.Id_Trabajador is not null - AND t.`year` = intYEAR AND QUARTER(t.dated) = vQuarter - GROUP BY c.Id_Trabajador, t.`month`; - - -- Sustitucion cedidas - lended - INSERT INTO vendedores (Id_Trabajador, mes, año, importe, comision) - SELECT c.salesPersonFk - , t.`month` - , t.`year` - , - sum(importe) - , - sum(importe) * vCommissionRate as lended - FROM ventas v - JOIN vn.client c ON c.id = v.Id_Cliente - JOIN vn.sharingCartDaily scd on scd.ownerFk = c.salesPersonFk AND scd.dated = v.fecha - JOIN vn.`time` t ON t.dated = v.fecha - WHERE t.`year` = intYEAR AND QUARTER(t.dated) = vQuarter - GROUP BY c.salesPersonFk, t.`month` - ON DUPLICATE KEY UPDATE comision = comision + VALUES(comision), - importe = importe + VALUES(importe); - - -- Sustitucion arrendadas - borrowed - INSERT INTO vendedores (Id_Trabajador, mes, año, importe, comision) - SELECT scd.substituteFk - , t.`month` - , t.`year` - , sum(importe) - , sum(importe) * vCommissionRate as borrowed - FROM ventas v - JOIN vn.`client` c ON c.id = v.Id_Cliente - JOIN vn.sharingCartDaily scd on scd.ownerFk = c.salesPersonFk AND scd.dated = v.fecha - JOIN vn.`time` t ON t.dated = v.fecha - WHERE t.`year` = intYEAR AND QUARTER(t.dated) = vQuarter - GROUP BY scd.substituteFk, t.`month` - ON DUPLICATE KEY UPDATE comision = comision + VALUES(comision), - importe = importe + VALUES(importe); - - -END ;; -DELIMITER ; -/*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `vendedores_add_launcher` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -5311,85 +4986,20 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `vendedores_add_launcher`() BEGIN - CALL bs.vendedores_add(YEAR(util.VN_CURDATE()),QUARTER(util.VN_CURDATE())); - CALL bs.vendedores_evolution_add; - CALL bs.salesByclientSalesPerson_add(util.VN_CURDATE()- INTERVAL 15 DAY); - + CALL bs.salesByclientSalesPerson_add(util.VN_CURDATE()- INTERVAL 45 DAY); + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; -/*!50003 DROP PROCEDURE IF EXISTS `vendedores_evolution_add` */; -/*!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 = utf8mb4 */ ; -/*!50003 SET character_set_results = utf8mb4 */ ; -/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; -DELIMITER ;; -CREATE DEFINER=`root`@`localhost` PROCEDURE `vendedores_evolution_add`() -BEGIN -/* -Inserta en la tabla compradores_evolution las ventas acumuladas en el ultimo mes -*/ - - DECLARE vYear, vMonth INTEGER; - DECLARE vCurYear, vCurMonth INTEGER; - DECLARE vDateFrom DATE; - DECLARE vDateTo DATE; - - 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 - FROM bs.vendedores_evolution; - - WHILE (vYear < vCurYear) OR (vYear = vCurYear AND vMonth < vCurMonth) DO - - SELECT max(dated), TIMESTAMPADD(DAY,-364,max(dated)) INTO vDateTo, vDateFrom - FROM vn.time - WHERE year = vYear - AND month = vMonth; - - REPLACE bs.vendedores_evolution( workerFk - , year - , month - , sales) - SELECT c.salesPersonFk - , vYear as year - , vMonth as month - , sum(v.importe) as sales - FROM bs.ventas v - JOIN vn.client c on c.id = v.Id_Cliente - WHERE v.fecha BETWEEN vDateFrom AND vDateTo - AND c.salesPersonFk is not null - GROUP BY c.salesPersonFk; - - SET vMonth = vMonth + 1; - - IF vMonth = 13 THEN - SET vMonth = 1; - SET vYear = vYear + 1; - END IF; - END WHILE; - -END ;; -DELIMITER ; -/*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `ventas_add` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -5397,6 +5007,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `ventas_add`( IN vStarted DATETIME, @@ -5405,7 +5017,7 @@ BEGIN /** * Añade las ventas que se realizaron de hace * una semana hasta hoy -* +* * @param vStarted Fecha de inicio * @param vEnded Fecha de finalizacion * @@ -5413,7 +5025,7 @@ BEGIN DECLARE vStartingDate DATETIME; DECLARE vEndingDate DATETIME; - IF vStarted < TIMESTAMPADD(YEAR,-5,util.VN_CURDATE()) + IF vStarted < TIMESTAMPADD(YEAR,-5,util.VN_CURDATE()) OR vEnded < TIMESTAMPADD(YEAR,-5,util.VN_CURDATE()) THEN CALL util.throw('fechaDemasiadoAntigua'); END IF; @@ -5422,8 +5034,8 @@ BEGIN SET vStartingDate = vStarted ; SET vEndingDate = vn2008.dayend(vStartingDate); - DELETE - FROM sale + DELETE + FROM sale WHERE dated BETWEEN vStartingDate AND vEnded; WHILE vEndingDate <= vEnded DO @@ -5444,28 +5056,28 @@ BEGIN JOIN vn.itemType it ON it.id = i.typeFk JOIN vn.itemCategory ic ON ic.id = it.categoryFk JOIN vn.ticket t ON t.id = s.ticketFk - JOIN vn.address a ON a.id = t.addressFk + JOIN vn.address a ON a.id = t.addressFk JOIN vn.client cl ON cl.id = a.clientFk WHERE t.shipped BETWEEN vStartingDate AND vEndingDate AND s.quantity <> 0 AND s.discount <> 100 - AND ic.merchandise + AND ic.merchandise GROUP BY sc.saleFk HAVING IFNULL(importe,0) <> 0 OR IFNULL(recargo,0) <> 0; UPDATE sale s JOIN ( - SELECT s.id, + SELECT s.id, SUM(s.quantity * sc.value ) margen, s.quantity * s.price * (100 - s.discount ) / 100 pvp FROM vn.sale s - JOIN vn.ticket t ON t.id = s.ticketFk + JOIN vn.ticket t ON t.id = s.ticketFk JOIN vn.saleComponent sc ON sc.saleFk = s.id - JOIN vn.component c ON c.id = sc.componentFk - JOIN vn.componentType ct ON ct.id = c.typeFk + JOIN vn.component c ON c.id = sc.componentFk + JOIN vn.componentType ct ON ct.id = c.typeFk WHERE t.shipped BETWEEN vStartingDate AND vEndingDate AND ct.isMargin = TRUE - GROUP BY s.id) sub ON sub.id = s.saleFk + GROUP BY s.id) sub ON sub.id = s.saleFk SET s.margin = sub.margen + s.amount + s.surcharge - sub.pvp; SET vStartingDate = TIMESTAMPADD(DAY,1, vStartingDate); @@ -5479,8 +5091,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `ventas_add_launcher` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -5488,10 +5098,12 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `ventas_add_launcher`() BEGIN - + /** * Añade las ventas que se realizaron de hace * una semana hasta hoy @@ -5506,8 +5118,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `ventas_contables_add` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -5515,10 +5125,12 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `ventas_contables_add`(IN vYear INT, IN vMonth INT) BEGIN - + /** * Reemplaza las ventas contables del último año. * Es el origen de datos para el balance de Entradas @@ -5530,8 +5142,8 @@ BEGIN DECLARE TIPO_PATRIMONIAL INT DEFAULT 188; - DELETE FROM bs.ventas_contables - WHERE year = vYear + DELETE FROM bs.ventas_contables + WHERE year = vYear AND month = vMonth; DROP TEMPORARY TABLE IF EXISTS tmp.ticket_list; @@ -5542,7 +5154,7 @@ BEGIN FROM vn2008.Tickets t JOIN vn2008.Facturas f ON f.Id_Factura = t.Factura WHERE year(f.Fecha) = vYear - AND month(f.Fecha) = vMonth; + AND month(f.Fecha) = vMonth; INSERT INTO bs.ventas_contables(year , month @@ -5552,7 +5164,7 @@ BEGIN , tipo_id , empresa_id , gasto) - + SELECT vYear , vMonth , round(sum(Cantidad * Preu * (100 - m.Descuento)/100)) @@ -5564,13 +5176,13 @@ BEGIN , tp.reino_id , a.tipo_id , t.empresa_id - , 7000000000 + , 7000000000 + IF(e.empresa_grupo = e2.empresa_grupo ,1 ,IF(e2.empresa_grupo,2,0) - ) * 1000000 + ) * 1000000 + tp.reino_id * 10000 as Gasto - FROM vn2008.Movimientos m + FROM vn2008.Movimientos m JOIN vn2008.Tickets t on t.Id_Ticket = m.Id_Ticket JOIN vn2008.Consignatarios cs on cs.Id_Consigna = t.Id_Consigna JOIN vn2008.Clientes c on c.Id_Cliente = cs.Id_Cliente @@ -5584,7 +5196,7 @@ BEGIN AND m.Descuento <> 100 AND a.tipo_id != TIPO_PATRIMONIAL GROUP BY grupo, reino_id, tipo_id, empresa_id, Gasto; - + INSERT INTO bs.ventas_contables(year , month , venta @@ -5603,17 +5215,17 @@ BEGIN ) as grupo , NULL , NULL - , t.companyFk + , t.companyFk , 7050000000 - FROM vn.ticketService ts + FROM vn.ticketService ts JOIN vn.ticket t ON ts.ticketFk = t.id - JOIN vn.address a on a.id = t.addressFk - JOIN vn.client cl on cl.id = a.clientFk + JOIN vn.address a on a.id = t.addressFk + JOIN vn.client cl on cl.id = a.clientFk JOIN tmp.ticket_list tt on tt.Id_Ticket = t.id - JOIN vn.company c on c.id = t.companyFk + JOIN vn.company c on c.id = t.companyFk LEFT JOIN vn.company c2 on c2.clientFk = cl.id - GROUP BY grupo, t.companyFk ; - + GROUP BY grupo, t.companyFk ; + DROP TEMPORARY TABLE tmp.ticket_list; END ;; DELIMITER ; @@ -5621,8 +5233,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `ventas_contables_add_launcher` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -5630,16 +5240,18 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `ventas_contables_add_launcher`() BEGIN - + /** * Reemplaza las ventas contables del último año. * Es el origen de datos para el balance de Entradas * **/ - + CALL bs.ventas_contables_add(YEAR(TIMESTAMPADD(MONTH,-1,util.VN_CURDATE())), MONTH(TIMESTAMPADD(MONTH,-1,util.VN_CURDATE()))); END ;; @@ -5648,8 +5260,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `ventas_contables_por_cliente` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -5657,15 +5267,17 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `ventas_contables_por_cliente`(IN vYear INT, IN vMonth INT) BEGIN - + /** * Muestra las ventas (€) de cada cliente * dependiendo del año */ - + DROP TEMPORARY TABLE IF EXISTS tmp.ticket_list; CREATE TEMPORARY TABLE tmp.ticket_list @@ -5674,8 +5286,8 @@ BEGIN FROM vn2008.Tickets t JOIN vn2008.Facturas f ON f.Id_Factura = t.Factura WHERE year(f.Fecha) = vYear - AND month(f.Fecha) = vMonth; - + AND month(f.Fecha) = vMonth; + SELECT vYear Año, vMonth Mes, t.Id_Cliente, @@ -5685,7 +5297,7 @@ BEGIN IF(e2.empresa_grupo,2,0)) AS grupo, t.empresa_id empresa - FROM vn2008.Movimientos m + FROM vn2008.Movimientos m JOIN vn2008.Tickets t ON t.Id_Ticket = m.Id_Ticket JOIN vn2008.Consignatarios cs ON cs.Id_Consigna = t.Id_Consigna JOIN vn2008.Clientes c ON c.Id_Cliente = cs.Id_Cliente @@ -5699,17 +5311,15 @@ BEGIN AND m.Descuento <> 100 AND a.tipo_id != 188 GROUP BY t.Id_Cliente, grupo,t.empresa_id; - + DROP TEMPORARY TABLE tmp.ticket_list; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `vivosMuertos` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -5717,10 +5327,12 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `vivosMuertos`() BEGIN - + /** * Devuelve el número de clientes nuevos y muertos, * dependiendo de la fecha actual. @@ -5731,9 +5343,9 @@ BEGIN 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; - + CREATE TEMPORARY TABLE tmp.VivosMuertos SELECT c.Id_Cliente, tm.yearMonth, f.Compra, 0 as Nuevo, 0 as Muerto FROM vn2008.Clientes c @@ -5749,10 +5361,10 @@ BEGIN WHERE Fecha BETWEEN @datSTART AND @datEND) f ON f.yearMonth = tm.yearMonth AND f.Id_Cliente = c.Id_Cliente; - + UPDATE tmp.VivosMuertos vm JOIN - (SELECT MIN(tm.yearMonth) firstMonth, f.Id_Cliente + (SELECT MIN(tm.yearMonth) firstMonth, f.Id_Cliente FROM vn2008.Facturas f JOIN vn2008.time tm ON tm.date = f.Fecha WHERE Fecha BETWEEN @datSTART AND @datEND @@ -5760,9 +5372,9 @@ BEGIN AND fm.Id_Cliente = vm.Id_Cliente SET Nuevo = 1; - + SELECT max(yearMonth) INTO @lastYearMonth FROM tmp.VivosMuertos; - + UPDATE tmp.VivosMuertos vm JOIN ( SELECT MAX(tm.yearMonth) firstMonth, f.Id_Cliente @@ -5784,8 +5396,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `waste_addSales` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -5793,6 +5403,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `waste_addSales`() BEGIN @@ -5803,23 +5415,23 @@ BEGIN INTO vWeek, vYear FROM vn.time WHERE dated = util.VN_CURDATE(); - + REPLACE bs.waste SELECT *, 100 * mermas / total as porcentaje FROM ( - SELECT buyer, - year, + SELECT buyer, + year, week, family, itemFk, itemTypeFk, - floor(sum(value)) as total, + floor(sum(value)) as total, floor(sum(IF(clientTypeFk = 'loses', value, 0))) as mermas - FROM vn.saleValue + FROM vn.saleValue where year = vYear and week = vWeek - + GROUP BY family, itemFk - + ) sub ORDER BY mermas DESC; END ;; @@ -5828,8 +5440,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `workerLabour_getData` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -5837,6 +5447,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `workerLabour_getData`() BEGIN @@ -5851,56 +5463,56 @@ BEGIN DECLARE vDateEnded DATE; DECLARE vCursor CURSOR FOR - SELECT util.firstDayOfMonth(t.dated), LAST_DAY(t.dated) + SELECT util.firstDayOfMonth(t.dated), LAST_DAY(t.dated) FROM vn.time t WHERE t.dated BETWEEN vDateStarted AND vDateEnded - GROUP BY year,month; + GROUP BY year,month; DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE; - + IF DAY(util.VN_CURDATE()) = 21 THEN - + SELECT util.firstDayOfMonth(DATE_SUB(util.VN_CURDATE(), INTERVAL 12 MONTH)), LAST_DAY(DATE_SUB(util.VN_CURDATE(), INTERVAL 1 MONTH)) - INTO vDateStarted, + INTO vDateStarted, vDateEnded; - - DELETE FROM workerLabourDataByMonth + + DELETE FROM workerLabourDataByMonth WHERE CONCAT(`year`, '-',`month`, '-01') BETWEEN vDateStarted AND vDateEnded; OPEN vCursor; l: LOOP SET vDone = FALSE; - + FETCH vCursor INTO vFristDay, vLastDay; - + IF vDone THEN LEAVE l; END IF; - + -- Altas periodo - INSERT INTO workerLabourDataByMonth (code, month, year, total, permanent) - SELECT 'hiring', MONTH(vFristDay), YEAR(vFristDay), COUNT(*), SUM(wbt.isPermanent) + INSERT INTO workerLabourDataByMonth (code, month, year, total, permanent) + SELECT 'hiring', MONTH(vFristDay), YEAR(vFristDay), COUNT(*), SUM(wbt.isPermanent) FROM vn.business b JOIN vn.workCenter wc ON wc.id = b.workCenterFk JOIN vn.worker w ON w.id = b.workerFk LEFT JOIN vn.workerBusinessType wbt ON wbt.id = b.workerBusinessTypeFk LEFT JOIN (SELECT b.id, b.workerFk FROM vn.business b - LEFT JOIN (SELECT ended, workerFk FROM vn.business) wl + LEFT JOIN (SELECT ended, workerFk FROM vn.business) wl ON wl.ended = DATE_SUB(b.started, INTERVAL 1 DAY) AND wl.workerFk = b.workerFk - WHERE b.started BETWEEN vFristDay AND vLastDay AND wl.ended + WHERE b.started BETWEEN vFristDay AND vLastDay AND wl.ended )sub ON sub.workerFk = b.workerFk WHERE wc.payrollCenterFk IS NOT NULL AND b.workCenterFk IS NOT NULL AND b.started BETWEEN vFristDay AND vLastDay AND sub.workerFk IS NULL - AND NOT w.isFreelance; + AND NOT w.isFreelance; -- Bajas periodo - INSERT INTO workerLabourDataByMonth (code, month, year, total, permanent) - SELECT 'layoffs', MONTH(vFristDay), YEAR(vFristDay), COUNT(*), SUM(wbt.isPermanent) + INSERT INTO workerLabourDataByMonth (code, month, year, total, permanent) + SELECT 'layoffs', MONTH(vFristDay), YEAR(vFristDay), COUNT(*), SUM(wbt.isPermanent) FROM vn.business b JOIN vn.worker w ON w.id = b.workerFk JOIN vn.workCenter wc ON wc.id = b.workCenterFk @@ -5911,12 +5523,12 @@ BEGIN AND b.ended BETWEEN vFristDay AND vLastDay AND wl.started IS NULL AND NOT w.isFreelance; - + -- Anterior al periodo SET vLastDay = LAST_DAY(DATE_SUB(vFristDay, INTERVAL 1 DAY)); - INSERT INTO workerLabourDataByMonth (code, month, year, total, permanent) - SELECT 'staff', MONTH(vFristDay), YEAR(vFristDay), COUNT(*), SUM(wbt.isPermanent) + INSERT INTO workerLabourDataByMonth (code, month, year, total, permanent) + SELECT 'staff', MONTH(vFristDay), YEAR(vFristDay), COUNT(*), SUM(wbt.isPermanent) FROM vn.business b JOIN vn.worker w ON w.id = b.workerFk JOIN vn.workCenter wc ON wc.id = b.workCenterFk @@ -5926,8 +5538,8 @@ BEGIN AND NOT w.isFreelance; -- Discapacidad - INSERT INTO workerLabourDataByMonth (code, month, year, total, permanent) - SELECT 'disabled', MONTH(vFristDay), YEAR(vFristDay), COUNT(*), SUM(wbt.isPermanent) + INSERT INTO workerLabourDataByMonth (code, month, year, total, permanent) + SELECT 'disabled', MONTH(vFristDay), YEAR(vFristDay), COUNT(*), SUM(wbt.isPermanent) FROM vn.business b JOIN vn.worker w ON w.id = b.workerFk JOIN vn.workCenter wc ON wc.id = b.workCenterFk @@ -5947,8 +5559,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `workerProductivity_add` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -5956,104 +5566,105 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `workerProductivity_add`() BEGIN DECLARE vDateFrom DATE; - SELECT DATE_SUB(util.VN_CURDATE(),INTERVAL 30 DAY) INTO vDateFrom; - - DELETE FROM workerProductivity + SELECT DATE_SUB(util.VN_CURDATE(), INTERVAL 30 DAY) INTO vDateFrom; + + DELETE FROM workerProductivity WHERE dated >= vDateFrom; -- SACADORES Y ARTIFICIAL - INSERT INTO workerProductivity(dated, wareHouseFk, workerFk, volume, seconds, actionFk) + INSERT INTO workerProductivity(dated, wareHouseFk, workerFk, volume, seconds, stateFk) SELECT sub.dated, sub.warehouseFk, sub.workerFk, SUM(sub.volume), - SUM(sub.seconds) , - sub.accion_id + SUM(sub.seconds), + sub.stateFk FROM(SELECT t.warehouseFk warehouseFk, st.workerFk, DATE(t.shipped) dated, SUM((ic.cm3delivery * s.quantity)/1000000) volume, - TIME_TO_SEC(TIMEDIFF( MAX(st.created),MIN(st.created))) + w.minSeconsItemPicker seconds, - a.accion_id + TIME_TO_SEC(TIMEDIFF( MAX(st.created),MIN(st.created))) + wc.minSeconsItemPicker seconds, + s2.id stateFk FROM vn.saleTracking st LEFT JOIN vn.salesPreviousPreparated sp ON sp.saleFk = st.saleFk JOIN vn.sale s ON s.id = st.saleFk JOIN vn.ticket t ON t.id = s.ticketFk JOIN vn.itemCost ic ON ic.warehouseFk = t.warehouseFk AND ic.itemFk = s.itemFk JOIN vn.worker w ON w.id = st.workerFk - JOIN vncontrol.accion a ON a.accion_id = st.actionFk + JOIN vn.state s2 ON s2.id = st.stateFk LEFT JOIN vn.workerDepartment wd ON wd.workerFk = st.workerFk - JOIN workerProductivityConfig w ON TRUE - WHERE t.shipped >= vDateFrom - AND ISNULL(sp.saleFk) - AND (a.accion = 'SACAR' - OR a.accion = 'PRESACAR') + JOIN workerProductivityConfig wc ON TRUE + WHERE t.shipped >= vDateFrom + AND ISNULL(sp.saleFk) + AND (s2.code IN ('OK PREVIOUS', 'PREVIOUS_PREPARATION', 'PREPARED', 'OK')) GROUP BY t.id, t.warehouseFk, st.workerFk ) sub GROUP BY sub.warehouseFk, sub.workerFk, sub.dated; -- ENCAJADORES - INSERT INTO workerProductivity(dated, wareHouseFk, workerFk, volume, seconds, actionFk) + INSERT INTO workerProductivity(dated, wareHouseFk, workerFk, volume, seconds, stateFk) SELECT sub2.shipped, sub2.warehouseFk, - sub2.workerFK, - SUM(sub2.volume), + sub2.workerFK, + SUM(sub2.volume), SUM(sub2.seconds), - a.accion_id + s2.id stateFk FROM (SELECT t.warehouseFk, SUM(s.volume) volume, sub.workerFk, DATE(t.shipped) shipped, sub.seconds + w.minSeconsPackager seconds, - s.saleFk + s.saleFk FROM vn.saleVolume s JOIN vn.ticket t ON t.id = s.ticketFk - JOIN(SELECT e.workerFk, e.ticketFk,TIME_TO_SEC(TIMEDIFF( MAX(e.created), MIN(e.created))) seconds + JOIN(SELECT e.workerFk, e.ticketFk,TIME_TO_SEC(TIMEDIFF( MAX(e.created), MIN(e.created))) seconds FROM vn.expedition e JOIN vn.ticket t ON t.id = e.ticketFk WHERE e.workerFk IS NOT NULL AND - t.shipped >= vDateFrom + t.shipped >= vDateFrom GROUP BY e.ticketFk )sub ON sub.ticketFk = t.id JOIN workerProductivityConfig w ON TRUE GROUP BY s.ticketFk, t.warehouseFk )sub2 - JOIN vncontrol.accion a ON a.accion = 'ENCAJAR' + JOIN vn.state s2 ON s2.code IN ('PACKING','PACKED') GROUP BY sub2.warehouseFk,sub2.workerFk, sub2.shipped; -- REVISADORES - INSERT INTO workerProductivity(dated, wareHouseFk, workerFk, volume, seconds, actionFk) - SELECT sub2.shipped, - sub2.warehouseFk, - sub2.workerFK, - SUM(sub2.volume), - SUM(sub2.seconds), - sub2.accion_id - FROM (SELECT t.warehouseFk, - SUM(s.volume) volume, - sub.workerFk, - DATE(t.shipped) shipped, - sub.seconds + w.minSeconsPackager seconds, - sub.accion_id - FROM vn.saleVolume s - JOIN vn.ticket t ON t.id = s.ticketFk - JOIN(SELECT st.workerFk, t.id ticketFk,TIME_TO_SEC(TIMEDIFF( MAX(st.created), MIN(st.created))) seconds, a.accion_id - FROM vn.saleTracking st - JOIN vncontrol.accion a ON a.accion_id = st.actionFk - JOIN vn.sale s ON s.id = st.saleFk - JOIN vn.ticket t ON s.ticketFk = t.id - WHERE a.accion = 'CONTROLAR' - AND t.shipped >= vDateFrom - GROUP BY t.id - )sub ON sub.ticketFk = t.id - JOIN workerProductivityConfig w ON TRUE - GROUP BY s.ticketFk, t.warehouseFk - )sub2 - GROUP BY sub2.warehouseFk,sub2.workerFk, sub2.shipped; + INSERT INTO workerProductivity(dated, wareHouseFk, workerFk, volume, seconds, stateFk) + SELECT sub2.shipped, + sub2.warehouseFk, + sub2.workerFK, + SUM(sub2.volume), + SUM(sub2.seconds), + sub2.stateFk + FROM (SELECT t.warehouseFk, + SUM(s.volume) volume, + sub.workerFk, + DATE(t.shipped) shipped, + sub.seconds + w.minSeconsPackager seconds, + sub.stateFk + FROM vn.saleVolume s + JOIN vn.ticket t ON t.id = s.ticketFk + JOIN(SELECT st.workerFk, t.id ticketFk,TIME_TO_SEC(TIMEDIFF( MAX(st.created), MIN(st.created))) seconds, s2.id stateFk + FROM vn.saleTracking st + JOIN vn.state s2 ON s2.id = st.stateFk + JOIN vn.sale s ON s.id = st.saleFk + JOIN vn.ticket t ON s.ticketFk = t.id + WHERE s2.code = 'CHECKED' + AND t.shipped >= vDateFrom + GROUP BY t.id + )sub ON sub.ticketFk = t.id + JOIN workerProductivityConfig w ON TRUE + GROUP BY s.ticketFk, t.warehouseFk + )sub2 + GROUP BY sub2.warehouseFk,sub2.workerFk, sub2.shipped; END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -6128,7 +5739,7 @@ DROP TABLE IF EXISTS `cache`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `cache` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `name` varchar(50) CHARACTER SET utf8mb3 NOT NULL, + `name` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, `lifetime` time NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `name` (`name`) @@ -6145,8 +5756,8 @@ DROP TABLE IF EXISTS `cache_calc`; CREATE TABLE `cache_calc` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `cache_id` int(10) unsigned NOT NULL, - `cacheName` varchar(255) CHARACTER SET utf8mb3 DEFAULT NULL, - `params` varchar(100) CHARACTER SET utf8mb3 NOT NULL DEFAULT '', + `cacheName` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL, + `params` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT '', `last_refresh` datetime DEFAULT NULL, `expires` datetime DEFAULT NULL, `created` timestamp NOT NULL DEFAULT current_timestamp(), @@ -6223,7 +5834,7 @@ CREATE TABLE `prod_graphic_source` ( `hora` int(11) NOT NULL, `order` int(11) NOT NULL DEFAULT 0, `graphCategory` int(11) NOT NULL DEFAULT 0, - `Agencia` varchar(45) CHARACTER SET utf8mb3 NOT NULL, + `Agencia` varchar(45) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -6287,14 +5898,14 @@ DELIMITER ;; /*!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 = utf8mb4 */ ;; -/*!50003 SET character_set_results = utf8mb4 */ ;; -/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;; +/*!50003 SET character_set_client = utf8mb3 */ ;; +/*!50003 SET character_set_results = utf8mb3 */ ;; +/*!50003 SET collation_connection = utf8mb3_general_ci */ ;; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;; /*!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 `cacheCalc_clean` ON SCHEDULE EVERY 30 MINUTE STARTS '2022-01-28 09:29:18' ON COMPLETION NOT PRESERVE ENABLE DO CALL cacheCalc_clean */ ;; +/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `cacheCalc_clean` ON SCHEDULE EVERY 30 MINUTE STARTS '2022-01-28 09:29:18' ON COMPLETION NOT PRESERVE DISABLE ON SLAVE DO CALL cacheCalc_clean */ ;; /*!50003 SET time_zone = @saved_time_zone */ ;; /*!50003 SET sql_mode = @saved_sql_mode */ ;; /*!50003 SET character_set_client = @saved_cs_client */ ;; @@ -6305,14 +5916,14 @@ DELIMITER ;; /*!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 = utf8mb4 */ ;; -/*!50003 SET character_set_results = utf8mb4 */ ;; -/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;; +/*!50003 SET character_set_client = utf8mb3 */ ;; +/*!50003 SET character_set_results = utf8mb3 */ ;; +/*!50003 SET collation_connection = utf8mb3_general_ci */ ;; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;; /*!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 `cache_clean` ON SCHEDULE EVERY 5 MINUTE STARTS '2022-01-28 09:29:18' ON COMPLETION NOT PRESERVE ENABLE DO CALL cache_clean */ ;; +/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `cache_clean` ON SCHEDULE EVERY 5 MINUTE STARTS '2022-01-28 09:29:18' ON COMPLETION NOT PRESERVE DISABLE ON SLAVE DO CALL cache_clean */ ;; /*!50003 SET time_zone = @saved_time_zone */ ;; /*!50003 SET sql_mode = @saved_sql_mode */ ;; /*!50003 SET character_set_client = @saved_cs_client */ ;; @@ -6324,8 +5935,6 @@ DELIMITER ; -- -- Dumping routines for database 'cache' -- -/*!50003 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `addressFriendship_Update` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -6333,11 +5942,13 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `addressFriendship_Update`() BEGIN - REPLACE cache.addressFriendship + REPLACE cache.addressFriendship SELECT addressFk1, addressFk2, count(*) friendship FROM ( @@ -6348,7 +5959,7 @@ BEGIN AND t2.shipped >= TIMESTAMPADD(MONTH,-3,util.VN_CURDATE()) AND t.addressFk != t2.addressFk) sub GROUP BY addressFk1, addressFk2; - + REPLACE cache.zoneAgencyFriendship SELECT r.agencyModeFk, t.zoneFk, count(*) friendship FROM vn.route r @@ -6364,8 +5975,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `availableNoRaids_refresh` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -6373,6 +5982,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `availableNoRaids_refresh`(OUT `vCalc` INT, IN `vRefresh` INT, IN `vWarehouse` INT, IN `vDated` DATE) proc: BEGIN @@ -6500,8 +6111,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `available_clean` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -6509,6 +6118,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `available_clean`() BEGIN @@ -6522,12 +6133,12 @@ BEGIN FROM available a LEFT JOIN tCalc c ON c.id = a.calc_id WHERE c.id IS NULL; - + DELETE a FROM availableNoRaids a LEFT JOIN tCalc c ON c.id = a.calc_id WHERE c.id IS NULL; - + DROP TEMPORARY TABLE tCalc; END ;; DELIMITER ; @@ -6535,8 +6146,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `available_refresh` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -6544,6 +6153,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `available_refresh`(OUT `vCalc` INT, IN `vRefresh` INT, IN `vWarehouse` INT, IN `vDated` DATE) proc: BEGIN @@ -6675,8 +6286,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `cacheCalc_clean` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -6684,6 +6293,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `cacheCalc_clean`() BEGIN @@ -6695,8 +6306,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `cache_calc_end` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -6704,6 +6313,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `cache_calc_end`(IN `v_calc` INT) BEGIN @@ -6733,8 +6344,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `cache_calc_start` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -6742,6 +6351,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `cache_calc_start`(OUT `v_calc` INT, INOUT `v_refresh` INT, IN `v_cache_name` VARCHAR(50), IN `v_params` VARCHAR(100)) proc: BEGIN @@ -6789,9 +6400,9 @@ proc: BEGIN INTO v_cache_id, v_calc, v_expires FROM cache c LEFT JOIN cache_calc ca - ON ca.cache_id = c.id AND ca.params = v_params COLLATE 'utf8_general_ci' + ON ca.cache_id = c.id AND ca.params = v_params COLLATE 'utf8_general_ci' WHERE c.name = v_cache_name COLLATE 'utf8_general_ci'; - + -- Si existe una calculo valido libera el bloqueo y devuelve su identificador. IF !v_refresh AND util.VN_NOW() < v_expires @@ -6832,8 +6443,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `cache_calc_unlock` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -6841,6 +6450,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `cache_calc_unlock`(IN `v_calc` INT) proc: BEGIN @@ -6855,7 +6466,7 @@ proc: BEGIN FROM cache c JOIN cache_calc ca ON c.id = ca.cache_id WHERE ca.id = v_calc; - + DELETE FROM cache_calc WHERE id = v_calc; IF v_cache_name IS NOT NULL THEN @@ -6867,8 +6478,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `cache_clean` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -6876,6 +6485,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `cache_clean`() NO SQL @@ -6888,8 +6499,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `clean` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -6897,11 +6506,13 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `clean`() BEGIN - - DECLARE vDateShort DATETIME; + + DECLARE vDateShort DATETIME; SET vDateShort = TIMESTAMPADD(MONTH, -1, util.VN_CURDATE()); @@ -6912,8 +6523,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `departure_timing` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -6921,6 +6530,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `departure_timing`(vWarehouseId INT) BEGIN @@ -6952,7 +6563,7 @@ DECLARE rs CURSOR FOR DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE; - SET myTime = HOUR(util.VN_NOW()) + MINUTE(util.VN_NOW()) / 60; + SET myTime = HOUR(util.VN_NOW()) + MINUTE(util.VN_NOW()) / 60; OPEN rs; @@ -6961,23 +6572,23 @@ DECLARE rs CURSOR FOR WHILE NOT done DO SET resto = IF(inicioProd < rsDeparture, rsDeparture - inicioProd,0); - + SET inicioProd = rsDeparture - rsHoras; - + IF inicioProd - resto < myTime THEN - + SET done = TRUE; - + ELSE - + SET departureLimit = rsDeparture; - + FETCH rs INTO rsDeparture, rsHoras , rsInicio; - + -- SELECT rsDeparture, rsHoras , rsInicio; - + END IF; - + END WHILE; SET departureLimit = IFNULL(departureLimit,24); @@ -6999,8 +6610,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `last_buy_refresh` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -7008,6 +6617,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `last_buy_refresh`(vRefresh BOOL) proc: BEGIN @@ -7022,7 +6633,7 @@ proc: BEGIN DECLARE started DATE; DECLARE ended DATE; DECLARE vLastRefresh DATE; - + DECLARE EXIT HANDLER FOR SQLEXCEPTION BEGIN CALL cache_calc_unlock (vCalc); @@ -7057,8 +6668,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `prod_graphic_refresh` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -7066,20 +6675,22 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `prod_graphic_refresh`(v_refresh BOOL, wh_id INT) proc: BEGIN DECLARE datEQ DATETIME; DECLARE timDIF TIME; DECLARE v_calc INT; - + CALL cache_calc_start (v_calc, v_refresh, 'prod_graphic', wh_id); - + IF !v_refresh THEN LEAVE proc; END IF; - + CALL vn2008.production_control_source(wh_id, 0); DELETE FROM prod_graphic_source; @@ -7097,8 +6708,8 @@ proc: BEGIN WHERE Fecha = util.VN_CURDATE() GROUP BY wh_id, graphCategory ; - - + + CALL cache_calc_end (v_calc); END ;; DELIMITER ; @@ -7106,8 +6717,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `stock_refresh` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -7115,11 +6724,13 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `stock_refresh`(v_refresh BOOL) proc: BEGIN /** - * Crea o actualiza la cache con el disponible hasta el día de + * Crea o actualiza la cache con el disponible hasta el día de * ayer. Esta cache es usada como base para otros procedimientos * como el cáculo del visible o del ATP. * @@ -7145,21 +6756,21 @@ proc: BEGIN SET v_date_inv = (SELECT inventoried FROM vn.config LIMIT 1); SET v_curdate = util.VN_CURDATE(); - + DELETE FROM stock; - + INSERT INTO stock (item_id, warehouse_id, amount) SELECT item_id, warehouse_id, SUM(amount) amount FROM ( - SELECT itemFk AS item_id, warehouseFk AS warehouse_id, quantity AS amount + SELECT itemFk AS item_id, warehouseFk AS warehouse_id, quantity AS amount FROM vn.itemTicketOut WHERE shipped >= v_date_inv AND shipped < v_curdate UNION ALL - SELECT itemFk ASitem_id, warehouseInFk AS warehouse_id, quantity AS amount + SELECT itemFk ASitem_id, warehouseInFk AS warehouse_id, quantity AS amount FROM vn.itemEntryIn WHERE landed >= v_date_inv AND landed < v_curdate AND isVirtualStock is FALSE UNION ALL - SELECT itemFk AS item_id ,warehouseOutFk AS warehouse_id, quantity AS amount + SELECT itemFk AS item_id ,warehouseOutFk AS warehouse_id, quantity AS amount FROM vn.itemEntryOut WHERE shipped >= v_date_inv AND shipped < v_curdate ) t @@ -7172,8 +6783,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `visible_clean` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -7181,6 +6790,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `visible_clean`() BEGIN @@ -7189,12 +6800,12 @@ BEGIN (INDEX (id)) ENGINE = MEMORY SELECT id FROM cache_calc; - + DELETE v FROM visible v LEFT JOIN tCalc c ON c.id = v.calc_id WHERE c.id IS NULL; - + DROP TEMPORARY TABLE tCalc; END ;; DELIMITER ; @@ -7202,8 +6813,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `visible_refresh` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -7211,6 +6820,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `visible_refresh`(OUT v_calc INT, v_refresh BOOL, v_warehouse INT) proc: BEGIN @@ -7225,11 +6836,11 @@ proc: BEGIN IF !v_refresh THEN LEAVE proc; END IF; - + -- Calculamos el stock hasta ayer - + CALL `cache`.stock_refresh(false); - + DROP TEMPORARY TABLE IF EXISTS vn2008.tmp_item; CREATE TEMPORARY TABLE vn2008.tmp_item (PRIMARY KEY (item_id)) @@ -7238,9 +6849,9 @@ proc: BEGIN WHERE warehouse_id = v_warehouse; -- Calculamos los movimientos confirmados de hoy - CALL vn.item_GetVisible(v_warehouse, NULL); + CALL vn.item_GetVisible(v_warehouse, NULL); DELETE FROM visible WHERE calc_id = v_calc; - + INSERT INTO visible (calc_id, item_id,visible) SELECT v_calc, item_id, visible FROM vn2008.tmp_item; @@ -7272,15 +6883,15 @@ DROP TABLE IF EXISTS `PriceDetails`; CREATE TABLE `PriceDetails` ( `ID` int(11) NOT NULL, `SuplyResponseID` int(11) NOT NULL, - `PriceType` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `Location` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `PriceType` varchar(255) DEFAULT NULL, + `Location` varchar(255) DEFAULT NULL, `Price` decimal(10,2) DEFAULT NULL, `BasisQuantitiy` int(11) DEFAULT NULL, - `BasisQuantityType` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `BasisQuantityType` varchar(255) DEFAULT NULL, `MinimumQuantity` int(11) DEFAULT NULL, - `MinimumQuantityType` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `MinimumQuantityType` varchar(255) DEFAULT NULL, `MaximumQuantity Integer` int(11) DEFAULT NULL, - `MaximumQuantityType` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `MaximumQuantityType` varchar(255) DEFAULT NULL, `LatestDeliveryDateTime` datetime DEFAULT NULL, `EarliestDespatchDateTime` datetime DEFAULT NULL, `FirstOrderDateTime` datetime DEFAULT NULL, @@ -7298,19 +6909,19 @@ DROP TABLE IF EXISTS `VMPSettings`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `VMPSettings` ( `VMPID` int(11) NOT NULL, - `name` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `name` varchar(45) DEFAULT NULL, `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', `vmpVersion` int(11) DEFAULT NULL, - `vmpUrl` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `loginName` varchar(150) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `loginPassword` varchar(150) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `vmpUrl` varchar(255) DEFAULT NULL, + `loginName` varchar(150) DEFAULT NULL, + `loginPassword` varchar(150) DEFAULT NULL, `refreshRate` int(11) DEFAULT NULL, - `eanBuyer` varchar(15) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `eanSupplier` varchar(15) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `eanAgent` varchar(15) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `eanBuyer` varchar(15) DEFAULT NULL, + `eanSupplier` varchar(15) DEFAULT NULL, + `eanAgent` varchar(15) DEFAULT NULL, `dateTimeLastSync` timestamp NULL DEFAULT NULL, `closedFrom` int(11) DEFAULT NULL, `closedTo` int(11) DEFAULT NULL, @@ -7318,7 +6929,7 @@ CREATE TABLE `VMPSettings` ( `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 utf8mb3_unicode_ci DEFAULT NULL, + `ApiKey` varchar(100) 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', PRIMARY KEY (`VMPID`) @@ -7335,7 +6946,7 @@ DROP TABLE IF EXISTS `bucket`; CREATE TABLE `bucket` ( `bucket_id` int(11) unsigned NOT NULL, `bucket_type_id` mediumint(8) unsigned NOT NULL, - `description` varchar(100) COLLATE utf8mb3_unicode_ci NOT NULL, + `description` varchar(100) NOT NULL, `x_size` mediumint(8) unsigned NOT NULL COMMENT 'mm', `y_size` mediumint(8) unsigned NOT NULL COMMENT 'mm', `z_size` mediumint(8) unsigned NOT NULL COMMENT 'mm', @@ -7357,7 +6968,7 @@ DROP TABLE IF EXISTS `bucket_type`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `bucket_type` ( `bucket_type_id` mediumint(8) unsigned NOT NULL, - `description` varchar(100) COLLATE utf8mb3_unicode_ci NOT NULL, + `description` varchar(100) NOT NULL, `entry_date` date DEFAULT NULL, `expiry_date` date DEFAULT NULL, `change_date_time` datetime DEFAULT NULL, @@ -7390,8 +7001,8 @@ DROP TABLE IF EXISTS `deliveryInformation`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `deliveryInformation` ( `ID` int(11) NOT NULL AUTO_INCREMENT, - `DeliveryType` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `Location` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `DeliveryType` varchar(255) DEFAULT NULL, + `Location` varchar(255) DEFAULT NULL, `DeliveryPrice` decimal(10,2) DEFAULT NULL, `ChargeAmount` decimal(10,2) DEFAULT NULL, `BasisQuantitiy` int(11) DEFAULT NULL, @@ -7422,7 +7033,7 @@ DROP TABLE IF EXISTS `di`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `di` ( `ID` int(11) NOT NULL DEFAULT 0, - `Location` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `Location` varchar(255) DEFAULT NULL, `LatestDeliveryDateTime` datetime DEFAULT NULL, `FirstOrderDateTime` datetime DEFAULT NULL, `LatestOrderDateTime` datetime DEFAULT NULL, @@ -7441,7 +7052,7 @@ DROP TABLE IF EXISTS `ekt`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `ekt` ( `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Id', - `barcode` char(25) COLLATE utf8mb3_unicode_ci DEFAULT NULL COMMENT 'Generated auction barcode', + `barcode` char(25) DEFAULT NULL COMMENT 'Generated auction barcode', `entryYear` smallint(5) unsigned NOT NULL COMMENT 'Transaction year', `batchNumber` bigint(20) unsigned DEFAULT NULL COMMENT 'RFF+BT', `deliveryNumber` bigint(20) unsigned DEFAULT NULL COMMENT 'RFF+AAJ', @@ -7451,14 +7062,14 @@ CREATE TABLE `ekt` ( `util.VN_NOW` timestamp NULL DEFAULT current_timestamp() COMMENT 'Creation time', `ptj` bigint(20) unsigned DEFAULT NULL COMMENT 'NAD+BY', `ref` int(11) NOT NULL COMMENT 'LIN', - `item` varchar(50) COLLATE utf8mb3_unicode_ci DEFAULT NULL COMMENT 'IMD+S99', + `item` varchar(50) DEFAULT NULL COMMENT 'IMD+S99', `pac` int(11) DEFAULT 0 COMMENT 'QTY+52', `qty` int(10) NOT NULL COMMENT 'QTY+66', - `ori` varchar(3) COLLATE utf8mb3_unicode_ci DEFAULT 'NL' COMMENT 'IMD+S62', - `cat` varchar(2) COLLATE utf8mb3_unicode_ci DEFAULT NULL COMMENT 'IMD+S98', + `ori` varchar(3) DEFAULT 'NL' COMMENT 'IMD+S62', + `cat` varchar(2) DEFAULT NULL COMMENT 'IMD+S98', `agj` int(11) DEFAULT NULL COMMENT 'RFF+AGJ', `kop` int(11) DEFAULT NULL COMMENT 'RFF+ADZ', - `ptd` varchar(6) COLLATE utf8mb3_unicode_ci DEFAULT NULL COMMENT 'RFF+ACE', + `ptd` varchar(6) DEFAULT NULL COMMENT 'RFF+ACE', `sub` mediumint(8) unsigned DEFAULT NULL COMMENT 'RFF+CTS', `pro` mediumint(8) unsigned NOT NULL COMMENT 'NAD+MF', `pri` double NOT NULL COMMENT 'PRI+INV', @@ -7469,17 +7080,17 @@ CREATE TABLE `ekt` ( `k2` smallint(5) unsigned DEFAULT NULL COMMENT 'IMD+K02', `k3` tinyint(3) unsigned DEFAULT NULL COMMENT 'IMD+P01', `k4` tinyint(3) unsigned DEFAULT NULL COMMENT 'IMD+P02', - `s1` varchar(3) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `s2` varchar(3) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `s3` varchar(3) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `s4` varchar(4) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `s5` varchar(3) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `s6` varchar(3) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `s1` varchar(3) DEFAULT NULL, + `s2` varchar(3) DEFAULT NULL, + `s3` varchar(3) DEFAULT NULL, + `s4` varchar(4) DEFAULT NULL, + `s5` varchar(3) DEFAULT NULL, + `s6` varchar(3) DEFAULT NULL, `ok` tinyint(4) NOT NULL DEFAULT 0, `trolleyFk` int(11) DEFAULT NULL, `putOrderFk` bigint(20) unsigned DEFAULT NULL COMMENT 'RFF+ON', `scanned` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'Whether it''s been scanned', - `cps` varchar(7) COLLATE utf8mb3_unicode_ci DEFAULT NULL COMMENT 'Código alfanumérico de Floriday', + `cps` varchar(7) DEFAULT NULL COMMENT 'Código alfanumérico de Floriday', `dp` bigint(20) unsigned DEFAULT NULL COMMENT 'NAD+DP', `sender` bigint(20) unsigned DEFAULT NULL COMMENT 'NAD+SE', PRIMARY KEY (`id`) USING BTREE, @@ -7521,55 +7132,56 @@ DROP TABLE IF EXISTS `ektRecent`; /*!50001 DROP VIEW IF EXISTS `ektRecent`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `ektRecent` AS SELECT - 1 AS `id`, - 1 AS `barcode`, - 1 AS `entryYear`, - 1 AS `batchNumber`, - 1 AS `deliveryNumber`, - 1 AS `vendorOrderNumber`, - 1 AS `fec`, - 1 AS `hor`, - 1 AS `util.VN_NOW`, - 1 AS `ptj`, - 1 AS `ref`, - 1 AS `item`, - 1 AS `pac`, - 1 AS `qty`, - 1 AS `ori`, - 1 AS `cat`, - 1 AS `agj`, - 1 AS `kop`, - 1 AS `ptd`, - 1 AS `sub`, - 1 AS `pro`, - 1 AS `pri`, - 1 AS `package`, - 1 AS `auction`, - 1 AS `klo`, - 1 AS `k1`, - 1 AS `k2`, - 1 AS `k3`, - 1 AS `k4`, - 1 AS `s1`, - 1 AS `s2`, - 1 AS `s3`, - 1 AS `s4`, - 1 AS `s5`, - 1 AS `s6`, - 1 AS `ok`, - 1 AS `trolleyFk`, - 1 AS `putOrderFk`, - 1 AS `scanned`, - 1 AS `cps`, - 1 AS `dp`, - 1 AS `sender`, - 1 AS `usefulAuctionLeftSegmentLength`, - 1 AS `standardBarcodeLength`, - 1 AS `floridayBarcodeLength`, - 1 AS `floramondoBarcodeLength`, - 1 AS `defaultKlo`, - 1 AS `ektRecentScopeDays` */; +/*!50001 CREATE TABLE `ektRecent` ( + `id` tinyint NOT NULL, + `barcode` tinyint NOT NULL, + `entryYear` tinyint NOT NULL, + `batchNumber` tinyint NOT NULL, + `deliveryNumber` tinyint NOT NULL, + `vendorOrderNumber` tinyint NOT NULL, + `fec` tinyint NOT NULL, + `hor` tinyint NOT NULL, + `util.VN_NOW` tinyint NOT NULL, + `ptj` tinyint NOT NULL, + `ref` tinyint NOT NULL, + `item` tinyint NOT NULL, + `pac` tinyint NOT NULL, + `qty` tinyint NOT NULL, + `ori` tinyint NOT NULL, + `cat` tinyint NOT NULL, + `agj` tinyint NOT NULL, + `kop` tinyint NOT NULL, + `ptd` tinyint NOT NULL, + `sub` tinyint NOT NULL, + `pro` tinyint NOT NULL, + `pri` tinyint NOT NULL, + `package` tinyint NOT NULL, + `auction` tinyint NOT NULL, + `klo` tinyint NOT NULL, + `k1` tinyint NOT NULL, + `k2` tinyint NOT NULL, + `k3` tinyint NOT NULL, + `k4` tinyint NOT NULL, + `s1` tinyint NOT NULL, + `s2` tinyint NOT NULL, + `s3` tinyint NOT NULL, + `s4` tinyint NOT NULL, + `s5` tinyint NOT NULL, + `s6` tinyint NOT NULL, + `ok` tinyint NOT NULL, + `trolleyFk` tinyint NOT NULL, + `putOrderFk` tinyint NOT NULL, + `scanned` tinyint NOT NULL, + `cps` tinyint NOT NULL, + `dp` tinyint NOT NULL, + `sender` tinyint NOT NULL, + `usefulAuctionLeftSegmentLength` tinyint NOT NULL, + `standardBarcodeLength` tinyint NOT NULL, + `floridayBarcodeLength` tinyint NOT NULL, + `floramondoBarcodeLength` tinyint NOT NULL, + `defaultKlo` tinyint NOT NULL, + `ektRecentScopeDays` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -7580,17 +7192,18 @@ DROP TABLE IF EXISTS `errorList`; /*!50001 DROP VIEW IF EXISTS `errorList`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `errorList` AS SELECT - 1 AS `id`, - 1 AS `name`, - 1 AS `longName`, - 1 AS `quantity`, - 1 AS `stock`, - 1 AS `error`, - 1 AS `deliveryInformationID`, - 1 AS `supplyResponseID`, - 1 AS `OrderTradeLineDateTime`, - 1 AS `EndUserPartyGLN` */; +/*!50001 CREATE TABLE `errorList` ( + `id` tinyint NOT NULL, + `name` tinyint NOT NULL, + `longName` tinyint NOT NULL, + `quantity` tinyint NOT NULL, + `stock` tinyint NOT NULL, + `error` tinyint NOT NULL, + `deliveryInformationID` tinyint NOT NULL, + `supplyResponseID` tinyint NOT NULL, + `OrderTradeLineDateTime` tinyint NOT NULL, + `EndUserPartyGLN` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -7623,7 +7236,7 @@ DROP TABLE IF EXISTS `exchangeConfig`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `exchangeConfig` ( `id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT, - `logMail` varchar(150) COLLATE utf8mb3_unicode_ci DEFAULT NULL COMMENT 'Mail where the log information is sent', + `logMail` varchar(150) DEFAULT NULL COMMENT 'Mail where the log information is sent', `restrictToSenders` tinyint(4) NOT NULL COMMENT 'Whether to process mails only from known senders', `presaleFk` mediumint(8) unsigned DEFAULT NULL, `defaultKop` int(10) unsigned DEFAULT NULL, @@ -7642,7 +7255,7 @@ DROP TABLE IF EXISTS `exchangeType`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `exchangeType` ( `id` mediumint(8) unsigned NOT NULL, - `description` varchar(50) COLLATE utf8mb3_unicode_ci NOT NULL, + `description` varchar(50) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -7656,8 +7269,8 @@ DROP TABLE IF EXISTS `feature`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `feature` ( `item_id` int(11) unsigned NOT NULL, - `feature_type_id` varchar(3) COLLATE utf8mb3_unicode_ci NOT NULL, - `feature_value` varchar(3) COLLATE utf8mb3_unicode_ci NOT NULL, + `feature_type_id` varchar(3) NOT NULL, + `feature_value` varchar(3) NOT NULL, `entry_date` date NOT NULL, `expiry_date` date NOT NULL, `change_date_time` datetime NOT NULL, @@ -7674,8 +7287,8 @@ DROP TABLE IF EXISTS `fileConfig`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `fileConfig` ( - `name` varchar(25) COLLATE utf8mb3_unicode_ci NOT NULL, - `checksum` text COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `name` varchar(25) NOT NULL, + `checksum` text DEFAULT NULL, `keyValue` tinyint(1) NOT NULL DEFAULT 1, PRIMARY KEY (`name`), UNIQUE KEY `fileConfig_name_uindex` (`name`) @@ -7704,9 +7317,9 @@ DROP TABLE IF EXISTS `ftpConfig`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `ftpConfig` ( `id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT, - `host` varchar(255) CHARACTER SET utf8mb3 NOT NULL, - `user` varchar(50) CHARACTER SET utf8mb3 NOT NULL, - `password` varchar(50) CHARACTER SET utf8mb3 NOT NULL, + `host` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, + `user` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, + `password` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='Configuration parameters'; /*!40101 SET character_set_client = @saved_cs_client */; @@ -7720,7 +7333,7 @@ DROP TABLE IF EXISTS `genus`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `genus` ( `genus_id` mediumint(8) unsigned NOT NULL, - `latin_genus_name` varchar(100) COLLATE utf8mb3_unicode_ci NOT NULL, + `latin_genus_name` varchar(100) NOT NULL, `entry_date` date DEFAULT NULL, `expiry_date` date DEFAULT NULL, `change_date_time` datetime DEFAULT NULL, @@ -7737,9 +7350,9 @@ DROP TABLE IF EXISTS `goodCharacteristic`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `goodCharacteristic` ( - `supplyResponse` varchar(26) COLLATE utf8mb3_unicode_ci NOT NULL, - `type` varchar(3) COLLATE utf8mb3_unicode_ci DEFAULT NULL COMMENT 'edi.type', - `value` varchar(3) COLLATE utf8mb3_unicode_ci DEFAULT NULL COMMENT 'edi.value', + `supplyResponse` varchar(26) NOT NULL, + `type` varchar(3) DEFAULT NULL COMMENT 'edi.type', + `value` varchar(3) DEFAULT NULL COMMENT 'edi.value', PRIMARY KEY (`supplyResponse`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -7753,13 +7366,13 @@ DROP TABLE IF EXISTS `imapConfig`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `imapConfig` ( `id` tinyint(3) unsigned NOT NULL, - `environment` varchar(45) CHARACTER SET utf8mb3 NOT NULL, - `host` varchar(150) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'localhost', - `user` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `pass` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `cleanPeriod` varchar(15) COLLATE utf8mb3_unicode_ci DEFAULT NULL COMMENT 'How long the old mails are preserved', - `successFolder` varchar(150) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `errorFolder` varchar(150) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `environment` varchar(45) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, + `host` varchar(150) NOT NULL DEFAULT 'localhost', + `user` varchar(45) DEFAULT NULL, + `pass` varchar(45) DEFAULT NULL, + `cleanPeriod` varchar(15) DEFAULT NULL COMMENT 'How long the old mails are preserved', + `successFolder` varchar(150) DEFAULT NULL, + `errorFolder` varchar(150) DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `imapConfig_environment` (`environment`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='IMAP configuration parameters'; @@ -7774,8 +7387,8 @@ DROP TABLE IF EXISTS `item`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `item` ( `id` int(11) unsigned NOT NULL, - `product_name` varchar(100) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `name` varchar(100) COLLATE utf8mb3_unicode_ci NOT NULL, + `product_name` varchar(100) DEFAULT NULL, + `name` varchar(100) NOT NULL, `plant_id` mediumint(8) unsigned DEFAULT NULL, `group_id` int(11) unsigned DEFAULT NULL, `entry_date` date DEFAULT NULL, @@ -7812,7 +7425,7 @@ DROP TABLE IF EXISTS `item_feature`; CREATE TABLE `item_feature` ( `item_id` int(11) NOT NULL, `presentation_order` tinyint(11) unsigned NOT NULL, - `feature` varchar(3) COLLATE utf8mb3_unicode_ci NOT NULL, + `feature` varchar(3) NOT NULL, `regulation_type` tinyint(3) unsigned NOT NULL, `entry_date` date NOT NULL, `expiry_date` date DEFAULT NULL, @@ -7866,7 +7479,7 @@ DROP TABLE IF EXISTS `item_group`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `item_group` ( `group_code` int(11) unsigned NOT NULL, - `dutch_group_description` varchar(100) COLLATE utf8mb3_unicode_ci NOT NULL, + `dutch_group_description` varchar(100) NOT NULL, `entry_date` date NOT NULL, `expiry_date` date NOT NULL, `change_date_time` datetime NOT NULL, @@ -7886,7 +7499,7 @@ CREATE TABLE `item_groupToOffer` ( `itemTypeFk` smallint(5) unsigned NOT NULL, `intrastatFk` int(8) unsigned zerofill NOT NULL, `originFk` tinyint(2) unsigned NOT NULL DEFAULT 17, - `expenseFk` varchar(10) COLLATE utf8mb3_unicode_ci DEFAULT '7001000000', + `expenseFk` varchar(10) DEFAULT '7001000000', PRIMARY KEY (`group_code`), KEY `item_groupToOffer_fk2_idx` (`itemTypeFk`), KEY `item_groupToOffer_fk3_idx` (`intrastatFk`), @@ -7933,9 +7546,9 @@ DROP TABLE IF EXISTS `log`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `log` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `tableName` varchar(100) COLLATE utf8mb3_unicode_ci NOT NULL, - `fieldName` varchar(100) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `fieldValue` varchar(100) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `tableName` varchar(100) NOT NULL, + `fieldName` varchar(100) DEFAULT NULL, + `fieldValue` varchar(100) DEFAULT NULL, `created` timestamp NOT NULL DEFAULT current_timestamp(), PRIMARY KEY (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; @@ -7951,12 +7564,12 @@ DROP TABLE IF EXISTS `mail`; CREATE TABLE `mail` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `senderFk` int(10) unsigned DEFAULT NULL, - `sender` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `messageId` varchar(100) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `sender` varchar(255) DEFAULT NULL, + `messageId` varchar(100) DEFAULT NULL, `nExchanges` int(10) unsigned NOT NULL, - `error` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `error` varchar(255) DEFAULT NULL, `created` timestamp NOT NULL DEFAULT current_timestamp(), - `source` text COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `source` text DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `mail_id` (`messageId`), KEY `sender_id` (`senderFk`), @@ -7973,7 +7586,7 @@ DROP TABLE IF EXISTS `mailSender`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `mailSender` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `mail` varchar(150) COLLATE utf8mb3_unicode_ci NOT NULL, + `mail` varchar(150) NOT NULL, `kop` int(10) unsigned DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `mail` (`mail`) @@ -7988,8 +7601,8 @@ DROP TABLE IF EXISTS `marketPlace`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `marketPlace` ( - `id` varchar(13) COLLATE utf8mb3_unicode_ci NOT NULL, - `name` varchar(45) COLLATE utf8mb3_unicode_ci NOT NULL, + `id` varchar(13) NOT NULL, + `name` varchar(45) NOT NULL, `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', @@ -8010,7 +7623,7 @@ DROP TABLE IF EXISTS `offerList`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `offerList` ( - `supplier` varchar(100) COLLATE utf8mb3_unicode_ci NOT NULL, + `supplier` varchar(100) NOT NULL, `total` int(11) DEFAULT NULL COMMENT 'Total de oferta', `filter` int(11) DEFAULT NULL COMMENT 'Total en edi.supplyOffer', `vnh` int(11) DEFAULT NULL COMMENT 'Total en la entrada de VNH', @@ -8028,11 +7641,11 @@ DROP TABLE IF EXISTS `param`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `param` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, - `code` varchar(30) COLLATE utf8mb3_unicode_ci NOT NULL, - `name` varchar(5) COLLATE utf8mb3_unicode_ci NOT NULL, - `subname` varchar(5) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `code` varchar(30) NOT NULL, + `name` varchar(5) NOT NULL, + `subname` varchar(5) DEFAULT NULL, `position` tinyint(3) unsigned NOT NULL DEFAULT 1, - `type` enum('INTEGER','DOUBLE','STRING','DATE','TIME') COLLATE utf8mb3_unicode_ci NOT NULL, + `type` enum('INTEGER','DOUBLE','STRING','DATE','TIME') NOT NULL, `required` tinyint(3) unsigned NOT NULL DEFAULT 1, PRIMARY KEY (`id`), UNIQUE KEY `code` (`code`), @@ -8072,12 +7685,12 @@ CREATE TABLE `putOrder` ( `orderTradelineItemID` int(11) DEFAULT NULL COMMENT 'ticketFk or EntryFk?', `OrderTradeLineDateTime` timestamp NOT NULL DEFAULT current_timestamp() COMMENT 'fecha de creacion en la tabla', `quantity` int(11) DEFAULT NULL, - `EndUserPartyID` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `EndUserPartyGLN` varchar(13) COLLATE utf8mb3_unicode_ci DEFAULT NULL COMMENT 'The grower can use this reference in his EKT in the NAD (MA) segment.', + `EndUserPartyID` varchar(255) DEFAULT NULL, + `EndUserPartyGLN` varchar(13) 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', `isOrderProcessed` tinyint(4) DEFAULT NULL, - `error` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `barcode` varchar(25) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `error` varchar(255) DEFAULT NULL, + `barcode` varchar(25) DEFAULT NULL, `created` timestamp NOT NULL DEFAULT current_timestamp(), `FHAdminNumber` int(11) DEFAULT 66011, `saleFk` int(11) DEFAULT NULL, @@ -8104,9 +7717,9 @@ DELIMITER ;; BEGIN DECLARE nextID INT; - + SELECT 1 + MAX(id) INTO nextID FROM putOrder ; - + SET NEW.orderTradelineItemID = nextID; END */;; @@ -8128,36 +7741,36 @@ DELIMITER ;; BEFORE UPDATE ON `putOrder` FOR EACH ROW BEGIN - + DECLARE vError VARCHAR(100) DEFAULT 'Orderregel niet meer teruggevonden op basis van de orderps'; DECLARE vVmpIdError INT DEFAULT 7; DECLARE vVmpFk INT; DECLARE vSupplyResponseNumberOfUnits INT; - - SELECT sr.vmpID INTO vVmpFk - FROM edi.supplyResponse sr + + SELECT sr.vmpID INTO vVmpFk + FROM edi.supplyResponse sr WHERE sr.id = NEW.supplyResponseID; - - IF NEW.OrderStatus = 3 - AND NOT (NEW.OrderStatus <=> OLD.OrderStatus) - AND NEW.error = vError - AND vVmpFk = vVmpIdError - - THEN - + + IF NEW.OrderStatus = 3 + AND NOT (NEW.OrderStatus <=> OLD.OrderStatus) + AND NEW.error = vError + AND vVmpFk = vVmpIdError + + THEN + SET NEW.OrderStatus = 2; - + END IF; - + -- Error de disponible menor de lo solicitado IF NEW.error LIKE 'error2602%' THEN - + SELECT NumberOfUnits INTO vSupplyResponseNumberOfUnits - FROM edi.supplyResponse sr + FROM edi.supplyResponse sr WHERE sr.ID = NEW.supplyResponseID; - + SET NEW.error = CONCAT('(',vSupplyResponseNumberOfUnits,') ', NEW.error); - + END IF; END */;; DELIMITER ; @@ -8184,16 +7797,16 @@ BEGIN DECLARE vIsEktSender BOOLEAN; IF NEW.OrderStatus = vOrderStatusDenied AND NOT (NEW.OrderStatus <=> OLD.OrderStatus) THEN - + SELECT s.id INTO vSaleFk - FROM vn.sale s + FROM vn.sale s 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 >= util.VN_CURDATE() AND i.supplyResponseFk = NEW.supplyResponseID LIMIT 1; - + UPDATE vn.sale s JOIN vn.ticket t ON s.ticketFk = t.id JOIN vn.item i ON i.id = s.itemFk @@ -8201,7 +7814,7 @@ BEGIN SET s.quantity = 0 WHERE t.clientFk = NEW.EndUserPartyGLN AND t.shipped >= util.VN_CURDATE() AND i.supplyResponseFk = NEW.supplyResponseID; - + INSERT INTO vn.mail (sender, `subject`, body) SELECT IF(u.id IS NOT NULL AND c.email IS NOT NULL, c.email, @@ -8213,26 +7826,26 @@ BEGIN IF (u.id IS NOT NULL AND c.email IS NOT NULL , CONCAT('https://shop.verdnatura.es/#!form=ecomerce%2Fticket&ticket=', t.id ), CONCAT('https://salix.verdnatura.es/#!/ticket/', t.id ,'/summary'))) - FROM vn.sale s + FROM vn.sale s JOIN vn.ticket t ON t.id = s.ticketFk JOIN vn.`client` c ON c.id = t.clientFk LEFT JOIN account.user u ON u.id= c.salesPersonFk AND u.name IN ('ruben', 'ismaelalcolea') WHERE s.id = vSaleFk; - + END IF; IF NEW.OrderStatus = vOrderStatusOK AND NOT (NEW.OrderStatus <=> OLD.OrderStatus) THEN - SELECT v.isEktSender INTO vIsEktSender + SELECT v.isEktSender INTO vIsEktSender FROM edi.VMPSettings v - JOIN edi.supplyResponse sr ON sr.vmpID = v.VMPID + JOIN edi.supplyResponse sr ON sr.vmpID = v.VMPID WHERE sr.id = NEW.supplyResponseID; - + IF NOT vIsEktSender THEN CALL edi.ekt_add(NEW.id); - + END IF; IF NEW.barcode THEN @@ -8241,7 +7854,7 @@ BEGIN SELECT i.id, NEW.barcode FROM vn.item i WHERE i.supplyResponseFk = NEW.supplyResponseID; - + END IF; END IF; @@ -8263,7 +7876,7 @@ DROP TABLE IF EXISTS `specie`; CREATE TABLE `specie` ( `specie_id` mediumint(8) unsigned NOT NULL, `genus_id` mediumint(8) unsigned NOT NULL, - `latin_species_name` varchar(100) COLLATE utf8mb3_unicode_ci NOT NULL, + `latin_species_name` varchar(100) NOT NULL, `entry_date` date DEFAULT NULL, `expiry_date` date DEFAULT NULL, `change_date_time` datetime DEFAULT NULL, @@ -8280,8 +7893,8 @@ DROP TABLE IF EXISTS `supplier`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `supplier` ( `supplier_id` int(10) unsigned NOT NULL COMMENT 'FHRegistrationNr', - `glnAddressCode` varchar(13) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `company_name` varchar(70) COLLATE utf8mb3_unicode_ci NOT NULL, + `glnAddressCode` varchar(13) DEFAULT NULL, + `company_name` varchar(70) NOT NULL, `entry_date` date NOT NULL, `expiry_date` date NOT NULL, `change_date_time` datetime NOT NULL, @@ -8301,50 +7914,51 @@ DROP TABLE IF EXISTS `supplyOffer`; /*!50001 DROP VIEW IF EXISTS `supplyOffer`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `supplyOffer` AS SELECT - 1 AS `vmpID`, - 1 AS `diId`, - 1 AS `srId`, - 1 AS `Item_ArticleCode`, - 1 AS `product_name`, - 1 AS `company_name`, - 1 AS `Price`, - 1 AS `Quality`, - 1 AS `s1`, - 1 AS `s2`, - 1 AS `s3`, - 1 AS `s4`, - 1 AS `s5`, - 1 AS `s6`, - 1 AS `NumberOfUnits`, - 1 AS `EmbalageCode`, - 1 AS `LatestDeliveryDateTime`, - 1 AS `EarliestDespatchDateTime`, - 1 AS `FirstOrderDateTime`, - 1 AS `LatestOrderDateTime`, - 1 AS `NumberOfItemsPerCask`, - 1 AS `NumberOfLayersPerTrolley`, - 1 AS `MinimumNumberToOrder`, - 1 AS `MaximumNumberToOrder`, - 1 AS `IncrementalOrderableQuantity`, - 1 AS `PackingPrice`, - 1 AS `MarketPlaceID`, - 1 AS `PictureReference`, - 1 AS `supplyResponseUpdated`, - 1 AS `group_id`, - 1 AS `marketPlace`, - 1 AS `DeliveryPrice`, - 1 AS `ChargeAmount`, - 1 AS `MinimumQuantity`, - 1 AS `MaximumQuantity`, - 1 AS `OrderUnit`, - 1 AS `IncrementalOrderUnit`, - 1 AS `isEarlyBird`, - 1 AS `isVNHSupplier`, - 1 AS `expenseFk`, - 1 AS `intrastatFk`, - 1 AS `originFk`, - 1 AS `itemTypeFk` */; +/*!50001 CREATE TABLE `supplyOffer` ( + `vmpID` tinyint NOT NULL, + `diId` tinyint NOT NULL, + `srId` tinyint NOT NULL, + `Item_ArticleCode` tinyint NOT NULL, + `product_name` tinyint NOT NULL, + `company_name` tinyint NOT NULL, + `Price` tinyint NOT NULL, + `Quality` tinyint NOT NULL, + `s1` tinyint NOT NULL, + `s2` tinyint NOT NULL, + `s3` tinyint NOT NULL, + `s4` tinyint NOT NULL, + `s5` tinyint NOT NULL, + `s6` tinyint NOT NULL, + `NumberOfUnits` tinyint NOT NULL, + `EmbalageCode` tinyint NOT NULL, + `LatestDeliveryDateTime` tinyint NOT NULL, + `EarliestDespatchDateTime` tinyint NOT NULL, + `FirstOrderDateTime` tinyint NOT NULL, + `LatestOrderDateTime` tinyint NOT NULL, + `NumberOfItemsPerCask` tinyint NOT NULL, + `NumberOfLayersPerTrolley` tinyint NOT NULL, + `MinimumNumberToOrder` tinyint NOT NULL, + `MaximumNumberToOrder` tinyint NOT NULL, + `IncrementalOrderableQuantity` tinyint NOT NULL, + `PackingPrice` tinyint NOT NULL, + `MarketPlaceID` tinyint NOT NULL, + `PictureReference` tinyint NOT NULL, + `supplyResponseUpdated` tinyint NOT NULL, + `group_id` tinyint NOT NULL, + `marketPlace` tinyint NOT NULL, + `DeliveryPrice` tinyint NOT NULL, + `ChargeAmount` tinyint NOT NULL, + `MinimumQuantity` tinyint NOT NULL, + `MaximumQuantity` tinyint NOT NULL, + `OrderUnit` tinyint NOT NULL, + `IncrementalOrderUnit` tinyint NOT NULL, + `isEarlyBird` tinyint NOT NULL, + `isVNHSupplier` tinyint NOT NULL, + `expenseFk` tinyint NOT NULL, + `intrastatFk` tinyint NOT NULL, + `originFk` tinyint NOT NULL, + `itemTypeFk` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -8357,59 +7971,59 @@ DROP TABLE IF EXISTS `supplyResponse`; CREATE TABLE `supplyResponse` ( `ID` int(11) NOT NULL AUTO_INCREMENT, `NumberBunchesPerCask` int(11) DEFAULT NULL, - `SupplierGLN` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `SupplierGLN` varchar(255) DEFAULT NULL, `NewItem` tinyint(1) DEFAULT NULL, - `SendererID` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `ItemSupplierID` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `SendererID` varchar(255) DEFAULT NULL, + `ItemSupplierID` varchar(255) DEFAULT NULL, `TransactionDate` datetime DEFAULT NULL, - `TransactionNumber` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `AuctionClockNumber` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `SupplierID` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `TransactionNumber` varchar(255) DEFAULT NULL, + `AuctionClockNumber` varchar(255) DEFAULT NULL, + `SupplierID` varchar(255) DEFAULT NULL, `ItemDatesupplyResponsecol` datetime DEFAULT NULL, `Item_ArticleCode` int(11) DEFAULT NULL, - `VBNOmschrijving` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `ExtraRemark` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `ArtCodeType` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `VBNGroupCode` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `VBNGroupDescription` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `VBNOmschrijving` varchar(255) DEFAULT NULL, + `ExtraRemark` varchar(255) DEFAULT NULL, + `ArtCodeType` varchar(255) DEFAULT NULL, + `VBNGroupCode` varchar(255) DEFAULT NULL, + `VBNGroupDescription` varchar(255) DEFAULT NULL, `TransactionTime` time DEFAULT NULL, - `CountryOfOrigin` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `CountryOfOrigin` varchar(255) DEFAULT NULL, `NumberOfItemsPerCask` int(11) DEFAULT NULL, `NumberOfLayersPerTrolley` int(11) DEFAULT NULL, `NumberOfUnits` int(11) DEFAULT NULL, `MinimumNumberToOrder` int(11) DEFAULT NULL, - `MinimumOrderUnitType` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `MinimumOrderUnitType` varchar(255) DEFAULT NULL, `Price` decimal(10,2) DEFAULT NULL, - `Quality` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `s1` varchar(3) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `s2` varchar(3) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `s3` varchar(3) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `s4` varchar(3) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `s5` varchar(3) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `s6` varchar(3) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `ExaminiationCode1` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `ExaminiationCode2` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `OrderUnitType` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `Quality` varchar(255) DEFAULT NULL, + `s1` varchar(3) DEFAULT NULL, + `s2` varchar(3) DEFAULT NULL, + `s3` varchar(3) DEFAULT NULL, + `s4` varchar(3) DEFAULT NULL, + `s5` varchar(3) DEFAULT NULL, + `s6` varchar(3) DEFAULT NULL, + `ExaminiationCode1` varchar(255) DEFAULT NULL, + `ExaminiationCode2` varchar(255) DEFAULT NULL, + `OrderUnitType` varchar(255) DEFAULT NULL, `EmbalageCode` int(11) DEFAULT NULL, - `PictureReference` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `AgentGLN` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `PictureReference` varchar(255) DEFAULT NULL, + `AgentGLN` varchar(255) DEFAULT NULL, `MaximumNumberToOrder` int(11) DEFAULT NULL, `MaximumOrderType` tinyint(1) DEFAULT NULL COMMENT 'Unit: 1 = piece, 2 = bunch, 3 = box, 4 = layer, 5 = load carrier/trolley', `IncrementalOrderableQuantity` int(11) DEFAULT NULL, `IncrementalOrderableQuantityType` tinyint(1) DEFAULT NULL COMMENT 'Unit: 1 = piece, 2 = bunch, 3 = box, 4 = layer, 5 = load carrier/trolley', `PackingPrice` decimal(10,2) DEFAULT NULL, - `PackingPriceType` varchar(25) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `PackingPriceType` varchar(25) DEFAULT NULL, `PackingPriceQuantity` int(11) DEFAULT NULL, `PackingPriceQuantityType` tinyint(1) DEFAULT NULL COMMENT 'Unit: 1 = piece, 2 = bunch, 3 = box, 4 = layer, 5 = load carrier/trolley', - `MarketPlaceID` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `MarketFormCode` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL COMMENT '"002" Standard Sales\n"005" Catalogue (optional)\n"001" Committed (optional)\n"003" Buffer (optional, Clock Pre Sales) ', - `FlowerColor` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `MarketPlaceID` varchar(255) DEFAULT NULL, + `MarketFormCode` varchar(255) DEFAULT NULL COMMENT '"002" Standard Sales\n"005" Catalogue (optional)\n"001" Committed (optional)\n"003" Buffer (optional, Clock Pre Sales) ', + `FlowerColor` varchar(255) DEFAULT NULL, `vmpID` int(11) DEFAULT NULL, `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(), - `EmbalageCodeSupplier` varchar(10) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `EmbalageCodeSupplier` varchar(10) DEFAULT NULL, `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', @@ -8439,8 +8053,8 @@ BEGIN UPDATE vn.buy b JOIN vn.entry e ON e.id = b.entryFk - JOIN vn.travel tr ON tr.id = e.travelFk - JOIN vn.agencyMode am ON am.id = tr.agencyModeFk + JOIN vn.travel tr ON tr.id = e.travelFk + JOIN vn.agencyMode am ON am.id = tr.agencyModeFk JOIN vn.item i ON i.id = b.itemFk JOIN edi.supplyResponse sr ON i.supplyResponseFk = sr.ID SET b.quantity = NEW.NumberOfItemsPerCask * NEW.NumberOfUnits, @@ -8449,7 +8063,7 @@ BEGIN AND am.name = 'LOGIFLORA' AND e.isRaid AND tr.landed >= util.VN_CURDATE(); - + END */;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -8485,9 +8099,9 @@ DROP TABLE IF EXISTS `tableConfig`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `tableConfig` ( - `fileName` varchar(2) COLLATE utf8mb3_unicode_ci NOT NULL, - `toTable` varchar(15) COLLATE utf8mb3_unicode_ci NOT NULL, - `file` varchar(30) COLLATE utf8mb3_unicode_ci NOT NULL, + `fileName` varchar(2) NOT NULL, + `toTable` varchar(15) NOT NULL, + `file` varchar(30) NOT NULL, `updated` date DEFAULT NULL, PRIMARY KEY (`fileName`), UNIQUE KEY `to_table` (`toTable`) @@ -8502,9 +8116,9 @@ DROP TABLE IF EXISTS `type`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `type` ( - `type_id` varchar(3) COLLATE utf8mb3_unicode_ci NOT NULL, + `type_id` varchar(3) NOT NULL, `type_group_id` tinyint(3) unsigned NOT NULL, - `description` varchar(100) COLLATE utf8mb3_unicode_ci NOT NULL, + `description` varchar(100) NOT NULL, `entry_date` date NOT NULL, `expiry_date` date NOT NULL, `change_date_time` datetime NOT NULL, @@ -8520,9 +8134,9 @@ DROP TABLE IF EXISTS `value`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `value` ( - `type_id` varchar(3) COLLATE utf8mb3_unicode_ci NOT NULL, - `type_value` varchar(3) COLLATE utf8mb3_unicode_ci NOT NULL, - `type_description` varchar(70) COLLATE utf8mb3_unicode_ci NOT NULL, + `type_id` varchar(3) NOT NULL, + `type_value` varchar(3) NOT NULL, + `type_description` varchar(70) NOT NULL, `entry_date` date NOT NULL, `expiry_date` date NOT NULL, `change_date_time` datetime NOT NULL, @@ -8559,14 +8173,14 @@ DELIMITER ;; /*!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 = utf8mb4 */ ;; -/*!50003 SET character_set_results = utf8mb4 */ ;; -/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;; +/*!50003 SET character_set_client = utf8mb3 */ ;; +/*!50003 SET character_set_results = utf8mb3 */ ;; +/*!50003 SET collation_connection = utf8mb3_general_ci */ ;; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;; /*!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 `floramondo` ON SCHEDULE EVERY 6 MINUTE STARTS '2022-01-28 09:52:45' ON COMPLETION NOT PRESERVE ENABLE DO CALL edi.floramondo_offerRefresh() */ ;; +/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `floramondo` ON SCHEDULE EVERY 6 MINUTE STARTS '2022-01-28 09:52:45' ON COMPLETION NOT PRESERVE DISABLE ON SLAVE DO CALL edi.floramondo_offerRefresh() */ ;; /*!50003 SET time_zone = @saved_time_zone */ ;; /*!50003 SET sql_mode = @saved_sql_mode */ ;; /*!50003 SET character_set_client = @saved_cs_client */ ;; @@ -8578,8 +8192,6 @@ DELIMITER ; -- -- Dumping routines for database 'edi' -- -/*!50003 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `imageName` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -8587,11 +8199,13 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `imageName`(vPictureReference VARCHAR(255)) RETURNS varchar(255) CHARSET utf8 COLLATE utf8_unicode_ci DETERMINISTIC BEGIN - + SET vPictureReference = REPLACE(vPictureReference,'.',''); SET vPictureReference = REPLACE(vPictureReference,'/',''); @@ -8603,7 +8217,7 @@ BEGIN SET vPictureReference = REPLACE(vPictureReference,'?',''); SET vPictureReference = REPLACE(vPictureReference,'=',''); - + RETURN vPictureReference; END ;; @@ -8612,8 +8226,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `clean` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -8621,6 +8233,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `clean`() BEGIN @@ -8629,23 +8243,21 @@ BEGIN DECLARE vOneWeekAgo DATE DEFAULT TIMESTAMPADD(WEEK,-1,util.VN_CURDATE()); DELETE FROM ekt WHERE fec < vFourYearsAgo; - + DELETE IGNORE sr.* FROM supplyResponse sr LEFT JOIN edi.deliveryInformation di ON sr.ID = di.supplyResponseID WHERE di.LatestOrderDateTime < vOneWeekAgo OR di.ID IS NULL; - - DELETE FROM putOrder + + DELETE FROM putOrder WHERE created < TIMESTAMPADD(MONTH,-1,util.VN_CURDATE()); - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `deliveryInformation_Delete` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -8653,38 +8265,38 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `deliveryInformation_Delete`() BEGIN - + DECLARE vID INT; DECLARE vGap INT DEFAULT 100; DECLARE vTope INT; - - SELECT MIN(ID), MAX(ID) + + SELECT MIN(ID), MAX(ID) INTO vID, vTope FROM edi.deliveryInformation; - WHILE vID <= vTope DO - + WHILE vID <= vTope DO + SET vID = vID + vGap; - - DELETE - FROM edi.deliveryInformation + + DELETE + FROM edi.deliveryInformation WHERE ID < vID AND EarliestDespatchDateTime IS NULL; - + END WHILE; - - + + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `ekt_add` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -8692,18 +8304,20 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `ekt_add`(vPutOrderFk INT) BEGIN - + /** * Añade ekt para las ordenes de compra de proveedores que no envian el ekt por email - * + * * @param vPutOrderFk PutOrderId de donde coger los datos **/ - - INSERT INTO edi.ekt(entryYear, - deliveryNumber, + + INSERT INTO edi.ekt(entryYear, + deliveryNumber, fec, hor, item, @@ -8743,25 +8357,23 @@ BEGIN i.value10 s6, p.id putOrderFk, sr.Item_ArticleCode, - sr.vmpID + sr.vmpID FROM edi.putOrder p - JOIN edi.supplyResponse sr ON sr.ID = p.supplyResponseID - JOIN edi.deliveryInformation di ON di.id = p.deliveryInformationID - JOIN edi.marketPlace mp ON mp.id = sr.MarketPlaceID - JOIN vn.item i ON i.supplyResponseFk = sr.ID - JOIN vn.origin o ON o.id = i.originFk + JOIN edi.supplyResponse sr ON sr.ID = p.supplyResponseID + JOIN edi.deliveryInformation di ON di.id = p.deliveryInformationID + JOIN edi.marketPlace mp ON mp.id = sr.MarketPlaceID + JOIN vn.item i ON i.supplyResponseFk = sr.ID + JOIN vn.origin o ON o.id = i.originFk WHERE p.id = vPutOrderFk; - + CALL edi.ekt_load(LAST_INSERT_ID()); - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `ekt_load` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -8769,10 +8381,12 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `ekt_load`(IN `vSelf` INT) proc:BEGIN - + DECLARE vRef INT; DECLARE vBuy INT; DECLARE vItem INT; @@ -8797,51 +8411,51 @@ proc:BEGIN FROM edi.ekt e LEFT JOIN edi.item i ON e.ref = i.id LEFT JOIN edi.putOrder po ON po.id = e.putOrderFk - LEFT JOIN vn.item i2 ON i2.supplyResponseFk = po.supplyResponseID + LEFT JOIN vn.item i2 ON i2.supplyResponseFk = po.supplyResponseID LEFT JOIN vn.ektEntryAssign eea ON eea.sub = e.sub LEFT JOIN edi.item_groupToOffer igto ON igto.group_code = i.group_id WHERE e.id = vSelf LIMIT 1; - + IF NOT vHasItemGroup THEN - + CALL vn.mail_insert('logistica@verdnatura.es', 'nocontestar@verdnatura.es', 'Nuevo grupo en Floramondo', vDescription); - + CALL vn.mail_insert('pako@verdnatura.es', 'nocontestar@verdnatura.es', CONCAT('Nuevo grupo en Floramondo: ', vDescription), vDescription); - + LEAVE proc; - + END IF; - + -- Asigna la entrada SELECT vn.ekt_getEntry(vSelf) INTO vEntryFk; - + -- Inserta el cubo si no existe IF vPackage = 800 THEN - + SET vHasToChangePackagingFk = TRUE; - + IF vItem THEN - + SELECT vn.item_getPackage(vItem) INTO vPackage ; - + ELSE - + SET vPackage = 8000 + vQty; INSERT IGNORE INTO vn.packaging(id, width, `depth`) SELECT vPackage, vc.ccLength / vQty, vc.ccWidth FROM vn.volumeConfig vc; - + END IF; - + ELSE - + INSERT IGNORE INTO vn2008.Cubos (Id_Cubo, X, Y, Z) SELECT bucket_id, ROUND(x_size/10), ROUND(y_size/10), ROUND(z_size/10) FROM bucket WHERE bucket_id = vPackage; - + IF ROW_COUNT() > 0 THEN INSERT INTO vn2008.mail SET @@ -8850,27 +8464,27 @@ proc:BEGIN `to` = 'ekt@verdnatura.es'; END IF; END IF; - + -- Si es una compra de Logiflora obtiene el articulo IF vPutOrderFk THEN - + SELECT i.id INTO vItem FROM edi.putOrder po JOIN vn.item i ON i.supplyResponseFk = po.supplyResponseID WHERE po.id = vPutOrderFk LIMIT 1; - + END IF; INSERT IGNORE INTO item_track SET item_id = vRef; - + IF IFNULL(vItem,0) = 0 THEN - + -- Intenta obtener el artículo en base a los atributos holandeses - + SELECT b.id, IFNULL(b.itemOriginalFk ,b.itemFk) INTO vBuy, vItem - FROM edi.ekt e + FROM edi.ekt e JOIN edi.item_track t ON t.item_id = e.ref LEFT JOIN edi.ekt l ON l.ref = e.ref LEFT JOIN vn.buy b ON b.ektFk = l.id @@ -8891,19 +8505,19 @@ proc:BEGIN AND IF(t.pro, l.pro = e.pro, TRUE) 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.util.VN_NOW DESC, b.id ASC + AND i.isFloramondo = vIsFloramondoDirect + ORDER BY l.util.VN_NOW DESC, b.id ASC LIMIT 1; END IF; - + -- Si no encuentra el articulo lo crea en el caso de las compras directas en Floramondo IF ISNULL(vItem) AND vIsFloramondoDirect THEN - + CALL edi.item_getNewByEkt(vSelf, vItem); - + END IF; - + INSERT INTO vn.buy ( entryFk @@ -8926,15 +8540,15 @@ proc:BEGIN ,e.qty stickers ,@pac := IFNULL(i.stemMultiplier, 1) * e.pac / @t packing ,IFNULL(b.`grouping`, e.pac) - ,@pac * e.qty + ,@pac * e.qty ,vForceToPacking ,IF(vHasToChangePackagingFk OR ISNULL(b.packageFk), vPackage, b.packageFk) ,(IFNULL(i.weightByPiece,0) * @pac)/1000 - FROM edi.ekt e + FROM edi.ekt e LEFT JOIN vn.buy b ON b.id = vBuy LEFT JOIN vn.item i ON i.id = b.itemFk LEFT JOIN vn.supplier s ON e.pro = s.id - JOIN vn2008.config cfg + JOIN vn2008.config cfg WHERE e.id = vSelf LIMIT 1; @@ -8942,33 +8556,36 @@ proc:BEGIN CREATE TEMPORARY TABLE tmp.buyRecalc SELECT buy.id - FROM vn.buy + FROM vn.buy WHERE ektFk = vSelf; CALL vn.buy_recalcPrices(); -- Si es una compra de Logiflora hay que informar la tabla vn.saleBuy IF vPutOrderFk THEN - + REPLACE vn.saleBuy(saleFk, buyFk, workerFk) SELECT po.saleFk, b.id, account.myUser_getId() FROM edi.putOrder po JOIN vn.buy b ON b.ektFk = vSelf WHERE po.id = vPutOrderFk; - + END IF; - -- Si es una compra directa en Floramondo hay que añadirlo al ticket + -- Si es una compra directa en Floramondo hay que añadirlo al ticket IF vIsFloramondoDirect THEN SELECT t.id INTO vTicketFk - FROM vn.ticket t - JOIN vn.ektEntryAssign eea ON eea.addressFk = t.addressFk - JOIN vn.warehouse w ON w.id = t.warehouseFk AND w.name = 'Floramondo' - JOIN edi.ekt e ON e.sub = eea.sub AND e.id = vSelf - WHERE e.fec = t.shipped - LIMIT 1; - + FROM vn.ticket t + JOIN vn.ektEntryAssign eea + ON eea.addressFk = t.addressFk + AND t.warehouseFk = eea.warehouseInFk + JOIN edi.ekt e + ON e.sub = eea.sub + AND e.id = vSelf + WHERE e.fec = t.shipped + LIMIT 1; + IF ISNULL(vTicketFk) THEN INSERT INTO vn.ticket ( @@ -8990,27 +8607,26 @@ proc:BEGIN a.id, a.agencyModeFk, a.nickname, - w.id, + eea.warehouseInFk, c.id, e.fec, z.id, z.price, z.bonus - FROM edi.ekt e - JOIN vn.ektEntryAssign eea ON eea.sub = e.sub + FROM edi.ekt e + JOIN vn.ektEntryAssign eea ON eea.sub = e.sub JOIN vn.address a ON a.id = eea.addressFk - JOIN vn.warehouse w ON w.name = 'Floramondo' JOIN vn.company c ON c.code = 'VNL' JOIN vn.`zone` z ON z.code = 'FLORAMONDO' WHERE e.id = vSelf LIMIT 1; SET vTicketFk = LAST_INSERT_ID(); - + INSERT INTO vn.ticketLog - SET originFk = vTicketFk, - userFk = account.myUser_getId(), - `action` = 'insert', + SET originFk = vTicketFk, + userFk = account.myUser_getId(), + `action` = 'insert', description = CONCAT('EktLoad ha creado el ticket:', ' ', vTicketFk); END IF; @@ -9020,9 +8636,9 @@ proc:BEGIN FROM edi.ekt e JOIN edi.floraHollandConfig fhc WHERE e.id = vSelf; - + SELECT LAST_INSERT_ID() INTO vSaleFk; - + REPLACE vn.saleBuy(saleFk, buyFk, workerFk) SELECT vSaleFk, b.id, account.myUser_getId() FROM vn.buy b @@ -9033,9 +8649,9 @@ proc:BEGIN FROM edi.ekt e JOIN vn.component c ON c.code = 'purchaseValue' WHERE e.id = vSelf; - + INSERT INTO vn.saleComponent(saleFk, componentFk, value) - SELECT vSaleFk, c.id, e.pri * fhc.floramondoMargin + SELECT vSaleFk, c.id, e.pri * fhc.floramondoMargin FROM edi.ekt e JOIN edi.floraHollandConfig fhc JOIN vn.component c ON c.code = 'margin' @@ -9048,8 +8664,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `ekt_loadNotBuy` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -9057,10 +8671,12 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `ekt_loadNotBuy`() BEGIN - + /** * Ejecuta ekt_load para aquellos ekt de hoy que no tienen vn.buy */ @@ -9070,24 +8686,24 @@ 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 >= util.VN_CURDATE() + FROM edi.ekt e + LEFT JOIN vn.buy b ON b.ektFk = e.id + WHERE e.fec >= util.VN_CURDATE() AND ISNULL(b.ektFk); DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = 1; OPEN cursor1; bucle: LOOP - + FETCH cursor1 INTO vEktFk; - + IF done THEN LEAVE bucle; END IF; - + CALL edi.ekt_load(vEktFk); - + END LOOP bucle; CLOSE cursor1; @@ -9097,8 +8713,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `ekt_refresh` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -9106,6 +8720,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `ekt_refresh`( `vSelf` INT, vMailFk INT) @@ -9165,8 +8781,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `ekt_scan` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -9174,12 +8788,14 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `ekt_scan`(vBarcode VARCHAR(512)) BEGIN /** * Busca transaciones a partir de un código de barras, las marca como escaneadas - * y las devuelve. + * y las devuelve. * Ver https://wiki.verdnatura.es/index.php/Ekt#Algoritmos_de_lectura * * @param vBarcode Código de compra de una etiqueta de subasta @@ -9218,19 +8834,19 @@ BEGIN ENGINE = MEMORY SELECT id ektFk FROM ekt LIMIT 0; - CASE + CASE WHEN LENGTH(vBarcode) <= vFloridayBarcodeLength THEN INSERT INTO tmp.ekt - SELECT id + SELECT id FROM edi.ektRecent e WHERE e.cps = vBarcode OR e.batchNumber = vBarcode; WHEN LENGTH(vBarcode) = vFloramondoBarcodeLength THEN INSERT INTO tmp.ekt - SELECT e.id + SELECT e.id FROM edi.ektRecent e - WHERE e.pro = MID(vBarcode,2,6) + WHERE e.pro = MID(vBarcode,2,6) AND CAST(e.ptd AS SIGNED) = MID(vBarcode,8,5); ELSE @@ -9245,7 +8861,7 @@ BEGIN -- Clásico de subasta -- Trade standard -- Trade que construye como la subasta - -- Trade como el anterior pero sin trade code + -- Trade como el anterior pero sin trade code INSERT INTO tmp.ekt SELECT id FROM ekt @@ -9266,9 +8882,9 @@ BEGIN -- BatchNumber largo IF NOT vIsFound THEN INSERT INTO tmp.ekt - SELECT id + SELECT id FROM edi.ektRecent e - WHERE e.batchNumber + WHERE e.batchNumber = LEFT(vBarcode,vUsefulAuctionLeftSegmentLength) AND e.batchNumber > 0; @@ -9278,7 +8894,7 @@ BEGIN -- Order Number IF NOT vIsFound THEN INSERT INTO tmp.ekt - SELECT id + SELECT id FROM edi.ektRecent e WHERE e.putOrderFk = vBarcode; @@ -9288,7 +8904,7 @@ BEGIN -- deliveryNumber incrustado IF NOT vIsFound THEN INSERT INTO tmp.ekt - SELECT id + SELECT id FROM edi.ektRecent e WHERE e.deliveryNumber = MID(vBarcode, 4, 13) @@ -9299,7 +8915,7 @@ BEGIN END CASE; IF vIsFound THEN - UPDATE ekt e + UPDATE ekt e JOIN tmp.ekt t ON t.ektFk = e.id SET e.scanned = TRUE; END IF; @@ -9309,8 +8925,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `floramondo_offerRefresh` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -9318,6 +8932,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `floramondo_offerRefresh`() proc: BEGIN @@ -9345,7 +8961,7 @@ proc: BEGIN ROLLBACK; RESIGNAL; END; - + DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN DO RELEASE_LOCK('edi.floramondo_offerRefresh'); @@ -9355,10 +8971,10 @@ proc: BEGIN IF 'test' = (SELECT environment FROM util.config) THEN LEAVE proc; END IF; - + IF !GET_LOCK('edi.floramondo_offerRefresh', 0) THEN LEAVE proc; - END IF; + END IF; SET vStartingTime = util.VN_NOW(); @@ -9803,8 +9419,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `item_freeAdd` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -9812,6 +9426,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `item_freeAdd`() BEGIN @@ -9848,8 +9464,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `item_getNewByEkt` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -9857,13 +9471,15 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb3 */ ; /*!50003 SET character_set_results = utf8mb3 */ ; /*!50003 SET collation_connection = utf8mb3_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `item_getNewByEkt`(vEktFk INT, OUT vItemFk INT) BEGIN /** * Devuelve un número nuevo de item a partir de un registro de la tabla edi.ekt - * + * * @param vEktFk Identificador de la tabla edi.ekt */ @@ -9872,17 +9488,17 @@ BEGIN SELECT MIN(id) id INTO vItemFk FROM edi.item_free; - DELETE FROM edi.item_free + DELETE FROM edi.item_free WHERE id = vItemFk; - + COMMIT; - + IF ISNULL(vItemFk) THEN SELECT MAX(i.id) + 1 INTO vItemFk FROM vn.item i; END IF; - + INSERT INTO vn.item(id, @@ -9909,118 +9525,118 @@ BEGIN least(IF((e.package = 800),((e.package * 10) + e.pac), e.package), ifnull(idt.bucket_id, '999')) packageFk, e.cat, TRUE - FROM edi.ekt e - JOIN edi.item i ON i.id = e.`ref` - JOIN edi.item_groupToOffer igto ON igto.group_code = i.group_id - LEFT JOIN edi.item_defaultType idt ON idt.item_id = e.`ref` + FROM edi.ekt e + JOIN edi.item i ON i.id = e.`ref` + JOIN edi.item_groupToOffer igto ON igto.group_code = i.group_id + LEFT JOIN edi.item_defaultType idt ON idt.item_id = e.`ref` WHERE e.id = vEktFk; SET @isTriggerDisabled = TRUE; - + INSERT INTO vn.itemTag(itemFk, tagFk, value, priority) - SELECT vItemFk, t.id , e.item , 1 - FROM edi.ekt e + SELECT vItemFk, t.id , e.item , 1 + FROM edi.ekt e JOIN vn.tag t ON t.`name` = 'Producto' WHERE e.id = vEktFk AND NOT ISNULL(e.item); INSERT INTO vn.itemTag(itemFk, tagFk, value, priority) - SELECT vItemFk, t.id , e.cat , 3 - FROM edi.ekt e + SELECT vItemFk, t.id , e.cat , 3 + FROM edi.ekt e JOIN vn.tag t ON t.`name` = 'Calidad' WHERE e.id = vEktFk AND NOT ISNULL(e.cat); - + INSERT INTO vn.itemTag(itemFk, tagFk, value, priority) - SELECT vItemFk, t.id , s.company_name , 4 - FROM edi.ekt e + SELECT vItemFk, t.id , s.company_name , 4 + FROM edi.ekt e JOIN edi.supplier s ON s.supplier_id = e.pro JOIN vn.tag t ON t.`name` = 'Productor' WHERE e.id = vEktFk AND NOT ISNULL(s.company_name); INSERT INTO vn.itemTag(itemFk, tagFk, value, priority) - SELECT vItemFk, t.id , e.s1, 5 + SELECT vItemFk, t.id , e.s1, 5 FROM edi.ekt e - LEFT JOIN edi.item_feature eif ON eif.item_id = e.`ref` - AND eif.presentation_order = 1 + LEFT JOIN edi.item_feature eif ON eif.item_id = e.`ref` + AND eif.presentation_order = 1 AND eif.expiry_date IS NULL - LEFT JOIN edi.`value` ev ON ev.type_id = eif.feature + LEFT JOIN edi.`value` ev ON ev.type_id = eif.feature AND e.s1 = ev.type_value JOIN vn.tag t ON t.ediTypeFk = eif.feature WHERE e.id = vEktFk AND NOT ISNULL(e.s1); - + INSERT INTO vn.itemTag(itemFk, tagFk, value, priority) - SELECT vItemFk, t.id , e.s2, 6 + SELECT vItemFk, t.id , e.s2, 6 FROM edi.ekt e - LEFT JOIN edi.item_feature eif ON eif.item_id = e.`ref` - AND eif.presentation_order = 2 + LEFT JOIN edi.item_feature eif ON eif.item_id = e.`ref` + AND eif.presentation_order = 2 AND eif.expiry_date IS NULL - LEFT JOIN edi.`value` ev ON ev.type_id = eif.feature + LEFT JOIN edi.`value` ev ON ev.type_id = eif.feature AND e.s2 = ev.type_value JOIN vn.tag t ON t.ediTypeFk = eif.feature WHERE e.id = vEktFk AND NOT ISNULL(e.s2); - + INSERT INTO vn.itemTag(itemFk, tagFk, value, priority) - SELECT vItemFk, t.id , e.s3, 7 + SELECT vItemFk, t.id , e.s3, 7 FROM edi.ekt e - LEFT JOIN edi.item_feature eif ON eif.item_id = e.`ref` - AND eif.presentation_order = 3 + LEFT JOIN edi.item_feature eif ON eif.item_id = e.`ref` + AND eif.presentation_order = 3 AND eif.expiry_date IS NULL - LEFT JOIN edi.`value` ev ON ev.type_id = eif.feature + LEFT JOIN edi.`value` ev ON ev.type_id = eif.feature AND e.s3 = ev.type_value JOIN vn.tag t ON t.ediTypeFk = eif.feature WHERE e.id = vEktFk AND NOT ISNULL(e.s3); - + INSERT INTO vn.itemTag(itemFk, tagFk, value, priority) - SELECT vItemFk, t.id , e.s4, 8 + SELECT vItemFk, t.id , e.s4, 8 FROM edi.ekt e - LEFT JOIN edi.item_feature eif ON eif.item_id = e.`ref` + LEFT JOIN edi.item_feature eif ON eif.item_id = e.`ref` AND eif.presentation_order = 4 AND eif.expiry_date IS NULL - LEFT JOIN edi.`value` ev ON ev.type_id = eif.feature + LEFT JOIN edi.`value` ev ON ev.type_id = eif.feature AND e.s4 = ev.type_value JOIN vn.tag t ON t.ediTypeFk = eif.feature WHERE e.id = vEktFk AND NOT ISNULL(e.s4); - + INSERT INTO vn.itemTag(itemFk, tagFk, value, priority) - SELECT vItemFk, t.id , e.s5, 9 + SELECT vItemFk, t.id , e.s5, 9 FROM edi.ekt e - LEFT JOIN edi.item_feature eif ON eif.item_id = e.`ref` + LEFT JOIN edi.item_feature eif ON eif.item_id = e.`ref` AND eif.presentation_order = 5 AND eif.expiry_date IS NULL - LEFT JOIN edi.`value` ev ON ev.type_id = eif.feature + LEFT JOIN edi.`value` ev ON ev.type_id = eif.feature AND e.s5 = ev.type_value JOIN vn.tag t ON t.ediTypeFk = eif.feature WHERE e.id = vEktFk AND NOT ISNULL(e.s5); INSERT INTO vn.itemTag(itemFk, tagFk, value, priority) - SELECT vItemFk, t.id , e.s6, 10 + SELECT vItemFk, t.id , e.s6, 10 FROM edi.ekt e - LEFT JOIN edi.item_feature eif ON eif.item_id = e.`ref` + LEFT JOIN edi.item_feature eif ON eif.item_id = e.`ref` AND eif.presentation_order = 6 AND eif.expiry_date IS NULL - LEFT JOIN edi.`value` ev ON ev.type_id = eif.feature + LEFT JOIN edi.`value` ev ON ev.type_id = eif.feature AND e.s6 = ev.type_value JOIN vn.tag t ON t.ediTypeFk = eif.feature WHERE e.id = vEktFk AND NOT ISNULL(e.s6); INSERT INTO vn.itemTag(itemFk, tagFk, value, priority) - SELECT vItemFk, t.id, IFNULL(ink.name, ik.color), 11 - FROM edi.ekt e + SELECT vItemFk, t.id, IFNULL(ink.name, ik.color), 11 + FROM edi.ekt e JOIN vn.tag t ON t.`name` = 'Color' - LEFT JOIN edi.feature f ON f.item_id = e.`ref` + LEFT JOIN edi.feature f ON f.item_id = e.`ref` LEFT JOIN edi.`type` tp ON tp.type_id = f.feature_type_id AND tp.`description` = 'Hoofdkleur 1' LEFT JOIN vn.ink ON ink.dutchCode = f.feature_value LEFT JOIN vn.itemInk ik ON ik.longName = e.item WHERE e.id = vEktFk - AND ( ink.name IS NOT NULL + AND ( ink.name IS NOT NULL OR ik.color IS NOT NULL) LIMIT 1; @@ -10032,16 +9648,14 @@ BEGIN CALL vn.item_refreshTags(); - SET @isTriggerDisabled = FALSE; - + SET @isTriggerDisabled = FALSE; + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `mail_new` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -10049,6 +9663,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `mail_new`( vMessageId VARCHAR(100) @@ -10079,7 +9695,7 @@ BEGIN sender = vSender, senderFk = vSenderId, messageId = vMessageId; - + IF vIsDuplicated THEN SELECT id INTO vSelf FROM mail @@ -10093,8 +9709,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `ticket_calcCompByFloramondo` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -10102,29 +9716,31 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `ticket_calcCompByFloramondo`(vSelf INT) BEGIN - + /** * Recalcula "a pelo" los componentes para un ticket de Floramondo - * + * * Pendiente de concretar la solución cuando Logiflora conteste. - * + * * @param vSelf Identificador de vn.ticket */ - + CALL cache.last_buy_refresh(TRUE); - DELETE sc.* + DELETE sc.* FROM vn.saleComponent sc - JOIN vn.sale s ON s.id = sc.saleFk + JOIN vn.sale s ON s.id = sc.saleFk WHERE s.ticketFk = vSelf; UPDATE vn.sale s - JOIN vn.item i ON i.id = s.itemFk + JOIN vn.item i ON i.id = s.itemFk JOIN edi.floraHollandConfig fhc - LEFT JOIN cache.last_buy lb ON lb.item_id = i.id + LEFT JOIN cache.last_buy lb ON lb.item_id = i.id LEFT JOIN vn.buy b ON b.id = lb.buy_id LEFT JOIN vn.warehouse w ON w.id = lb.warehouse_id AND w.name = 'Floramondo' SET s.price = b.buyingValue * (1 + fhc.floramondoMargin) @@ -10133,18 +9749,18 @@ BEGIN INSERT INTO vn.saleComponent(saleFk, componentFk, value) SELECT s.id, c.id, MAX(b.buyingValue) FROM vn.sale s - JOIN vn.item i ON i.id = s.itemFk + JOIN vn.item i ON i.id = s.itemFk LEFT JOIN cache.last_buy lb ON lb.item_id = i.id LEFT JOIN vn.buy b ON b.id = lb.buy_id LEFT JOIN vn.warehouse w ON w.id = lb.warehouse_id AND w.name = 'Floramondo' JOIN vn.component c ON c.code = 'purchaseValue' WHERE s.ticketFk = vSelf GROUP BY s.id; - + INSERT INTO vn.saleComponent(saleFk, componentFk, value) - SELECT s.id, c.id, MAX(b.buyingValue) * fhc.floramondoMargin + SELECT s.id, c.id, MAX(b.buyingValue) * fhc.floramondoMargin FROM vn.sale s - JOIN vn.item i ON i.id = s.itemFk + JOIN vn.item i ON i.id = s.itemFk JOIN edi.floraHollandConfig fhc LEFT JOIN cache.last_buy lb ON lb.item_id = i.id LEFT JOIN vn.buy b ON b.id = lb.buy_id @@ -10176,7 +9792,7 @@ DROP TABLE IF EXISTS `androidUser`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `androidUser` ( - `androidId` varchar(200) CHARACTER SET utf8mb3 NOT NULL, + `androidId` varchar(200) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, `userFk` int(10) unsigned NOT NULL, PRIMARY KEY (`userFk`,`androidId`), CONSTRAINT `androidUser_ibfk_1` FOREIGN KEY (`userFk`) REFERENCES `account`.`user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE @@ -10209,7 +9825,7 @@ DROP TABLE IF EXISTS `browser`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `browser` ( - `name` varchar(30) COLLATE utf8mb3_unicode_ci NOT NULL COMMENT 'Browser name in browscap', + `name` varchar(30) NOT NULL COMMENT 'Browser name in browscap', `version` float NOT NULL COMMENT 'Minimal version', UNIQUE KEY `name` (`name`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='List of compatible web browsers and its version'; @@ -10224,18 +9840,18 @@ DROP TABLE IF EXISTS `config`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `config` ( `id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT, - `defaultLang` char(2) CHARACTER SET utf8mb3 NOT NULL COMMENT 'The default language if none is specified', + `defaultLang` char(2) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT 'The default language if none is specified', `https` tinyint(3) unsigned NOT NULL COMMENT 'Wether to force de use of HTTPS', `cookieLife` smallint(5) unsigned NOT NULL COMMENT 'The cookies life, in days', - `jwtKey` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL COMMENT 'The key used to encode/decode JWT tokens', - `defaultForm` varchar(50) COLLATE utf8mb3_unicode_ci DEFAULT NULL COMMENT 'Form loaded at web login', - `restUri` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL COMMENT 'The URI for rest service', - `testRestUri` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL COMMENT 'The URI for test rest service', - `guestUser` varchar(50) COLLATE utf8mb3_unicode_ci DEFAULT NULL COMMENT 'Guest user name', - `testDomain` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL COMMENT 'The address for beta website', - `productionDomain` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL COMMENT 'The address for production website', - `pdfsDir` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL COMMENT 'Directory where PDFs are allocated', - `dmsDir` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL COMMENT 'Directory where documents are allocated', + `jwtKey` varchar(255) NOT NULL COMMENT 'The key used to encode/decode JWT tokens', + `defaultForm` varchar(50) DEFAULT NULL COMMENT 'Form loaded at web login', + `restUri` varchar(255) NOT NULL COMMENT 'The URI for rest service', + `testRestUri` varchar(255) NOT NULL COMMENT 'The URI for test rest service', + `guestUser` varchar(50) DEFAULT NULL COMMENT 'Guest user name', + `testDomain` varchar(255) DEFAULT NULL COMMENT 'The address for beta website', + `productionDomain` varchar(255) DEFAULT NULL COMMENT 'The address for production website', + `pdfsDir` varchar(255) NOT NULL COMMENT 'Directory where PDFs are allocated', + `dmsDir` varchar(255) 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=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='Global configuration parameters'; @@ -10250,7 +9866,7 @@ DROP TABLE IF EXISTS `contact`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `contact` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `recipient` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL, + `recipient` varchar(255) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -10264,8 +9880,8 @@ DROP TABLE IF EXISTS `image`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `image` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `collectionFk` varchar(50) COLLATE utf8mb3_unicode_ci NOT NULL, - `name` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL, + `collectionFk` varchar(50) NOT NULL, + `name` varchar(255) 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', PRIMARY KEY (`id`), @@ -10283,15 +9899,15 @@ DROP TABLE IF EXISTS `imageCollection`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `imageCollection` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `name` varchar(50) COLLATE utf8mb3_unicode_ci NOT NULL, - `desc` varchar(50) COLLATE utf8mb3_unicode_ci NOT NULL, + `name` varchar(50) NOT NULL, + `desc` varchar(50) NOT NULL, `maxWidth` int(10) unsigned NOT NULL, `maxHeight` int(10) unsigned NOT NULL, - `model` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `property` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `schema` varchar(50) COLLATE utf8mb3_unicode_ci NOT NULL COMMENT 'Deprecated', - `table` varchar(50) COLLATE utf8mb3_unicode_ci NOT NULL COMMENT 'Deprecated', - `column` varchar(50) COLLATE utf8mb3_unicode_ci NOT NULL COMMENT 'Deprecated', + `model` varchar(255) DEFAULT NULL, + `property` varchar(255) DEFAULT NULL, + `schema` varchar(50) NOT NULL COMMENT 'Deprecated', + `table` varchar(50) NOT NULL COMMENT 'Deprecated', + `column` varchar(50) NOT NULL COMMENT 'Deprecated', `readRoleFk` int(10) unsigned DEFAULT 1, `writeRoleFk` int(10) unsigned DEFAULT 1, PRIMARY KEY (`id`), @@ -10335,7 +9951,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=utf8mb3 COMMENT='Global image parameters'; +) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci COMMENT='Global image parameters'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -10346,9 +9962,9 @@ DROP TABLE IF EXISTS `language`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `language` ( - `code` varchar(10) CHARACTER SET utf8mb3 NOT NULL, - `name` varchar(20) COLLATE utf8mb3_unicode_ci NOT NULL, - `orgName` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL, + `code` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, + `name` varchar(20) NOT NULL, + `orgName` varchar(255) NOT NULL, `isActive` tinyint(1) NOT NULL DEFAULT 0, PRIMARY KEY (`code`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; @@ -10363,10 +9979,10 @@ DROP TABLE IF EXISTS `link`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `link` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `name` varchar(30) COLLATE utf8mb3_unicode_ci NOT NULL, - `description` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL, - `link` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL, - `image` varchar(30) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `name` varchar(30) NOT NULL, + `description` varchar(255) NOT NULL, + `link` varchar(255) NOT NULL, + `image` varchar(30) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -10443,15 +10059,15 @@ DROP TABLE IF EXISTS `location`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `location` ( `id` smallint(5) unsigned NOT NULL AUTO_INCREMENT, - `lat` varchar(12) COLLATE utf8mb3_unicode_ci NOT NULL, - `lng` varchar(12) COLLATE utf8mb3_unicode_ci NOT NULL, - `title` varchar(50) COLLATE utf8mb3_unicode_ci NOT NULL, - `address` varchar(75) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `postcode` varchar(15) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `city` varchar(50) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `province` varchar(50) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `phone` varchar(20) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `language` char(2) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `lat` varchar(12) NOT NULL, + `lng` varchar(12) NOT NULL, + `title` varchar(50) NOT NULL, + `address` varchar(75) DEFAULT NULL, + `postcode` varchar(15) DEFAULT NULL, + `city` varchar(50) DEFAULT NULL, + `province` varchar(50) DEFAULT NULL, + `phone` varchar(20) DEFAULT NULL, + `language` char(2) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -10465,13 +10081,13 @@ DROP TABLE IF EXISTS `mailConfig`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `mailConfig` ( `id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Identifier', - `host` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'localhost' COMMENT 'SMTP host', + `host` varchar(255) 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', - `sender` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL COMMENT 'The sender mail address', - `senderName` varchar(75) CHARACTER SET utf8mb3 NOT NULL COMMENT 'The sender name', - `user` varchar(50) COLLATE utf8mb3_unicode_ci DEFAULT NULL COMMENT 'SMTP user', - `password` varchar(100) COLLATE utf8mb3_unicode_ci DEFAULT NULL COMMENT 'SMTP password, base64 encoded', + `sender` varchar(255) NOT NULL COMMENT 'The sender mail address', + `senderName` varchar(75) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT 'The sender name', + `user` varchar(50) DEFAULT NULL COMMENT 'SMTP user', + `password` varchar(100) DEFAULT NULL COMMENT 'SMTP password, base64 encoded', PRIMARY KEY (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -10497,9 +10113,10 @@ DROP TABLE IF EXISTS `mainAccountBank`; /*!50001 DROP VIEW IF EXISTS `mainAccountBank`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `mainAccountBank` AS SELECT - 1 AS `name`, - 1 AS `iban` */; +/*!50001 CREATE TABLE `mainAccountBank` ( + `name` tinyint NOT NULL, + `iban` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -10511,8 +10128,8 @@ DROP TABLE IF EXISTS `menu`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `menu` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `description` varchar(30) COLLATE utf8mb3_unicode_ci NOT NULL, - `path` varchar(50) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `description` varchar(30) NOT NULL, + `path` varchar(50) DEFAULT NULL, `roleFk` int(10) unsigned NOT NULL, `parentFk` int(10) unsigned DEFAULT NULL, `displayOrder` tinyint(4) unsigned NOT NULL DEFAULT 1, @@ -10532,8 +10149,8 @@ DROP TABLE IF EXISTS `message`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `message` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, - `code` char(35) COLLATE utf8mb3_unicode_ci NOT NULL, - `description` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL, + `code` char(35) NOT NULL, + `description` varchar(255) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `code` (`code`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; @@ -10548,8 +10165,8 @@ DROP TABLE IF EXISTS `metatag`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `metatag` ( `id` int(11) NOT NULL, - `name` varchar(50) COLLATE utf8mb3_unicode_ci NOT NULL, - `content` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL, + `name` varchar(50) NOT NULL, + `content` varchar(255) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `name` (`name`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; @@ -10563,19 +10180,20 @@ DROP TABLE IF EXISTS `myAddress`; /*!50001 DROP VIEW IF EXISTS `myAddress`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `myAddress` AS SELECT - 1 AS `id`, - 1 AS `clientFk`, - 1 AS `street`, - 1 AS `city`, - 1 AS `postalCode`, - 1 AS `provinceFk`, - 1 AS `nickname`, - 1 AS `isDefaultAddress`, - 1 AS `isActive`, - 1 AS `longitude`, - 1 AS `latitude`, - 1 AS `agencyModeFk` */; +/*!50001 CREATE TABLE `myAddress` ( + `id` tinyint NOT NULL, + `clientFk` tinyint NOT NULL, + `street` tinyint NOT NULL, + `city` tinyint NOT NULL, + `postalCode` tinyint NOT NULL, + `provinceFk` tinyint NOT NULL, + `nickname` tinyint NOT NULL, + `isDefaultAddress` tinyint NOT NULL, + `isActive` tinyint NOT NULL, + `longitude` tinyint NOT NULL, + `latitude` tinyint NOT NULL, + `agencyModeFk` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -10586,16 +10204,17 @@ DROP TABLE IF EXISTS `myBasket`; /*!50001 DROP VIEW IF EXISTS `myBasket`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `myBasket` AS SELECT - 1 AS `id`, - 1 AS `made`, - 1 AS `sent`, - 1 AS `clientFk`, - 1 AS `deliveryMethodFk`, - 1 AS `agencyModeFk`, - 1 AS `addressFk`, - 1 AS `companyFk`, - 1 AS `notes` */; +/*!50001 CREATE TABLE `myBasket` ( + `id` tinyint NOT NULL, + `made` tinyint NOT NULL, + `sent` tinyint NOT NULL, + `clientFk` tinyint NOT NULL, + `deliveryMethodFk` tinyint NOT NULL, + `agencyModeFk` tinyint NOT NULL, + `addressFk` tinyint NOT NULL, + `companyFk` tinyint NOT NULL, + `notes` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -10606,11 +10225,12 @@ DROP TABLE IF EXISTS `myBasketDefaults`; /*!50001 DROP VIEW IF EXISTS `myBasketDefaults`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `myBasketDefaults` AS SELECT - 1 AS `deliveryMethod`, - 1 AS `agencyModeFk`, - 1 AS `addressFk`, - 1 AS `defaultAgencyFk` */; +/*!50001 CREATE TABLE `myBasketDefaults` ( + `deliveryMethod` tinyint NOT NULL, + `agencyModeFk` tinyint NOT NULL, + `addressFk` tinyint NOT NULL, + `defaultAgencyFk` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -10621,13 +10241,14 @@ DROP TABLE IF EXISTS `myBasketItem`; /*!50001 DROP VIEW IF EXISTS `myBasketItem`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `myBasketItem` AS SELECT - 1 AS `id`, - 1 AS `orderFk`, - 1 AS `warehouseFk`, - 1 AS `itemFk`, - 1 AS `amount`, - 1 AS `price` */; +/*!50001 CREATE TABLE `myBasketItem` ( + `id` tinyint NOT NULL, + `orderFk` tinyint NOT NULL, + `warehouseFk` tinyint NOT NULL, + `itemFk` tinyint NOT NULL, + `amount` tinyint NOT NULL, + `price` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -10638,11 +10259,12 @@ DROP TABLE IF EXISTS `myClient`; /*!50001 DROP VIEW IF EXISTS `myClient`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `myClient` AS SELECT - 1 AS `id`, - 1 AS `isToBeMailed`, - 1 AS `defaultAddressFk`, - 1 AS `credit` */; +/*!50001 CREATE TABLE `myClient` ( + `id` tinyint NOT NULL, + `isToBeMailed` tinyint NOT NULL, + `defaultAddressFk` tinyint NOT NULL, + `credit` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -10653,12 +10275,13 @@ DROP TABLE IF EXISTS `myInvoice`; /*!50001 DROP VIEW IF EXISTS `myInvoice`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `myInvoice` AS SELECT - 1 AS `id`, - 1 AS `ref`, - 1 AS `issued`, - 1 AS `amount`, - 1 AS `hasPdf` */; +/*!50001 CREATE TABLE `myInvoice` ( + `id` tinyint NOT NULL, + `ref` tinyint NOT NULL, + `issued` tinyint NOT NULL, + `amount` tinyint NOT NULL, + `hasPdf` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -10669,11 +10292,12 @@ DROP TABLE IF EXISTS `myMenu`; /*!50001 DROP VIEW IF EXISTS `myMenu`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `myMenu` AS SELECT - 1 AS `id`, - 1 AS `path`, - 1 AS `description`, - 1 AS `parentFk` */; +/*!50001 CREATE TABLE `myMenu` ( + `id` tinyint NOT NULL, + `path` tinyint NOT NULL, + `description` tinyint NOT NULL, + `parentFk` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -10684,20 +10308,21 @@ DROP TABLE IF EXISTS `myOrder`; /*!50001 DROP VIEW IF EXISTS `myOrder`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `myOrder` AS SELECT - 1 AS `id`, - 1 AS `landed`, - 1 AS `clientFk`, - 1 AS `deliveryMethodFk`, - 1 AS `agencyModeFk`, - 1 AS `addressFk`, - 1 AS `companyFk`, - 1 AS `note`, - 1 AS `sourceApp`, - 1 AS `isConfirmed`, - 1 AS `created`, - 1 AS `firstRowStamp`, - 1 AS `confirmed` */; +/*!50001 CREATE TABLE `myOrder` ( + `id` tinyint NOT NULL, + `landed` tinyint NOT NULL, + `clientFk` tinyint NOT NULL, + `deliveryMethodFk` tinyint NOT NULL, + `agencyModeFk` tinyint NOT NULL, + `addressFk` tinyint NOT NULL, + `companyFk` tinyint NOT NULL, + `note` tinyint NOT NULL, + `sourceApp` tinyint NOT NULL, + `isConfirmed` tinyint NOT NULL, + `created` tinyint NOT NULL, + `firstRowStamp` tinyint NOT NULL, + `confirmed` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -10708,17 +10333,18 @@ DROP TABLE IF EXISTS `myOrderRow`; /*!50001 DROP VIEW IF EXISTS `myOrderRow`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `myOrderRow` AS SELECT - 1 AS `id`, - 1 AS `Fk`, - 1 AS `itemFk`, - 1 AS `warehouseFk`, - 1 AS `shipped`, - 1 AS `amount`, - 1 AS `price`, - 1 AS `rate`, - 1 AS `created`, - 1 AS `saleFk` */; +/*!50001 CREATE TABLE `myOrderRow` ( + `id` tinyint NOT NULL, + `Fk` tinyint NOT NULL, + `itemFk` tinyint NOT NULL, + `warehouseFk` tinyint NOT NULL, + `shipped` tinyint NOT NULL, + `amount` tinyint NOT NULL, + `price` tinyint NOT NULL, + `rate` tinyint NOT NULL, + `created` tinyint NOT NULL, + `saleFk` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -10729,9 +10355,10 @@ DROP TABLE IF EXISTS `myOrderTicket`; /*!50001 DROP VIEW IF EXISTS `myOrderTicket`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `myOrderTicket` AS SELECT - 1 AS `orderFk`, - 1 AS `ticketFk` */; +/*!50001 CREATE TABLE `myOrderTicket` ( + `orderFk` tinyint NOT NULL, + `ticketFk` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -10742,18 +10369,19 @@ DROP TABLE IF EXISTS `myTicket`; /*!50001 DROP VIEW IF EXISTS `myTicket`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `myTicket` AS SELECT - 1 AS `id`, - 1 AS `clientFk`, - 1 AS `warehouseFk`, - 1 AS `shipped`, - 1 AS `landed`, - 1 AS `nickname`, - 1 AS `agencyModeFk`, - 1 AS `refFk`, - 1 AS `addressFk`, - 1 AS `location`, - 1 AS `companyFk` */; +/*!50001 CREATE TABLE `myTicket` ( + `id` tinyint NOT NULL, + `clientFk` tinyint NOT NULL, + `warehouseFk` tinyint NOT NULL, + `shipped` tinyint NOT NULL, + `landed` tinyint NOT NULL, + `nickname` tinyint NOT NULL, + `agencyModeFk` tinyint NOT NULL, + `refFk` tinyint NOT NULL, + `addressFk` tinyint NOT NULL, + `location` tinyint NOT NULL, + `companyFk` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -10764,16 +10392,17 @@ DROP TABLE IF EXISTS `myTicketRow`; /*!50001 DROP VIEW IF EXISTS `myTicketRow`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `myTicketRow` AS SELECT - 1 AS `id`, - 1 AS `itemFk`, - 1 AS `ticketFk`, - 1 AS `concept`, - 1 AS `quantity`, - 1 AS `price`, - 1 AS `discount`, - 1 AS `reserved`, - 1 AS `isPicked` */; +/*!50001 CREATE TABLE `myTicketRow` ( + `id` tinyint NOT NULL, + `itemFk` tinyint NOT NULL, + `ticketFk` tinyint NOT NULL, + `concept` tinyint NOT NULL, + `quantity` tinyint NOT NULL, + `price` tinyint NOT NULL, + `discount` tinyint NOT NULL, + `reserved` tinyint NOT NULL, + `isPicked` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -10784,14 +10413,15 @@ DROP TABLE IF EXISTS `myTicketService`; /*!50001 DROP VIEW IF EXISTS `myTicketService`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `myTicketService` AS SELECT - 1 AS `id`, - 1 AS `description`, - 1 AS `quantity`, - 1 AS `price`, - 1 AS `taxClassFk`, - 1 AS `ticketFk`, - 1 AS `ticketServiceTypeFk` */; +/*!50001 CREATE TABLE `myTicketService` ( + `id` tinyint NOT NULL, + `description` tinyint NOT NULL, + `quantity` tinyint NOT NULL, + `price` tinyint NOT NULL, + `taxClassFk` tinyint NOT NULL, + `ticketFk` tinyint NOT NULL, + `ticketServiceTypeFk` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -10802,20 +10432,21 @@ DROP TABLE IF EXISTS `myTicketState`; /*!50001 DROP VIEW IF EXISTS `myTicketState`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `myTicketState` AS SELECT - 1 AS `id`, - 1 AS `clientFk`, - 1 AS `warehouseFk`, - 1 AS `shipped`, - 1 AS `landed`, - 1 AS `nickname`, - 1 AS `agencyModeFk`, - 1 AS `refFk`, - 1 AS `addressFk`, - 1 AS `location`, - 1 AS `companyFk`, - 1 AS `alertLevel`, - 1 AS `code` */; +/*!50001 CREATE TABLE `myTicketState` ( + `id` tinyint NOT NULL, + `clientFk` tinyint NOT NULL, + `warehouseFk` tinyint NOT NULL, + `shipped` tinyint NOT NULL, + `landed` tinyint NOT NULL, + `nickname` tinyint NOT NULL, + `agencyModeFk` tinyint NOT NULL, + `refFk` tinyint NOT NULL, + `addressFk` tinyint NOT NULL, + `location` tinyint NOT NULL, + `companyFk` tinyint NOT NULL, + `alertLevel` tinyint NOT NULL, + `code` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -10826,15 +10457,16 @@ DROP TABLE IF EXISTS `myTpvTransaction`; /*!50001 DROP VIEW IF EXISTS `myTpvTransaction`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `myTpvTransaction` AS SELECT - 1 AS `id`, - 1 AS `merchantFk`, - 1 AS `clientFk`, - 1 AS `receiptFk`, - 1 AS `amount`, - 1 AS `response`, - 1 AS `status`, - 1 AS `created` */; +/*!50001 CREATE TABLE `myTpvTransaction` ( + `id` tinyint NOT NULL, + `merchantFk` tinyint NOT NULL, + `clientFk` tinyint NOT NULL, + `receiptFk` tinyint NOT NULL, + `amount` tinyint NOT NULL, + `response` tinyint NOT NULL, + `status` tinyint NOT NULL, + `created` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -10846,13 +10478,13 @@ DROP TABLE IF EXISTS `news`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `news` ( `id` smallint(5) unsigned NOT NULL AUTO_INCREMENT, - `title` varchar(150) COLLATE utf8mb3_unicode_ci NOT NULL, - `text` text COLLATE utf8mb3_unicode_ci NOT NULL, - `image` varchar(100) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `title` varchar(150) NOT NULL, + `text` text NOT NULL, + `image` varchar(100) DEFAULT NULL, `userFk` int(10) unsigned NOT NULL, `created` timestamp NOT NULL DEFAULT current_timestamp(), `priority` tinyint(3) unsigned NOT NULL DEFAULT 3, - `tag` varchar(15) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'new', + `tag` varchar(15) NOT NULL DEFAULT 'new', PRIMARY KEY (`id`), KEY `user` (`userFk`), KEY `tag` (`tag`), @@ -10932,8 +10564,8 @@ DROP TABLE IF EXISTS `newsTag`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `newsTag` ( - `name` varchar(15) COLLATE utf8mb3_unicode_ci NOT NULL, - `description` varchar(25) COLLATE utf8mb3_unicode_ci NOT NULL, + `name` varchar(15) NOT NULL, + `description` varchar(25) NOT NULL, PRIMARY KEY (`name`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -10953,8 +10585,8 @@ CREATE TABLE `order` ( `agency_id` int(11) DEFAULT 2, `address_id` int(11) DEFAULT NULL, `company_id` smallint(5) unsigned NOT NULL DEFAULT 442, - `note` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `source_app` set('WEB','ANDROID','IOS','SALIX','TPV','TABLET_VN','') COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'TPV', + `note` varchar(255) DEFAULT NULL, + `source_app` set('WEB','ANDROID','IOS','SALIX','TPV','TABLET_VN','') 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(), @@ -10989,7 +10621,7 @@ DELIMITER ;; /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `hedera`.`order_afterInsert` AFTER INSERT ON `order` FOR EACH ROW -BEGIN +BEGIN IF NEW.address_id = 2850 THEN -- Fallo que se insertan no se sabe como tickets en este cliente CALL vn.mail_insert( @@ -10998,7 +10630,7 @@ BEGIN 'Creada order al address 2850', CONCAT(account.myUser_getName(), ' ha creado la order ',NEW.id) ); - + END IF; END */;; DELIMITER ; @@ -11020,7 +10652,7 @@ DELIMITER ;; FOR EACH ROW BEGIN CALL stock.log_add('order', NEW.id, OLD.id); - + IF !(OLD.address_id <=> NEW.address_id) OR !(OLD.company_id <=> NEW.company_id) OR !(OLD.customer_id <=> NEW.customer_id) THEN @@ -11074,7 +10706,7 @@ CREATE TABLE `orderConfig` ( `id` int(11) NOT NULL AUTO_INCREMENT, `employeeFk` int(10) unsigned NOT NULL, `defaultAgencyFk` int(11) DEFAULT NULL, - `guestMethod` varchar(45) CHARACTER SET utf8mb3 NOT NULL, + `guestMethod` varchar(45) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, `guestAgencyFk` int(11) NOT NULL, `reserveTime` time NOT NULL, `defaultCompanyFk` smallint(6) unsigned DEFAULT NULL, @@ -11150,12 +10782,12 @@ DELIMITER ;; BEGIN DECLARE vIsFirst BOOL; - SELECT (first_row_stamp IS NULL) INTO vIsFirst - FROM `order` + SELECT (first_row_stamp IS NULL) INTO vIsFirst + FROM `order` WHERE id = NEW.orderFk; IF vIsFirst THEN - UPDATE `order` SET first_row_stamp = util.VN_NOW() + UPDATE `order` SET first_row_stamp = util.VN_NOW() WHERE id = NEW.orderFk; END IF; END */;; @@ -11254,9 +10886,10 @@ DROP TABLE IF EXISTS `orderTicket`; /*!50001 DROP VIEW IF EXISTS `orderTicket`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `orderTicket` AS SELECT - 1 AS `orderFk`, - 1 AS `ticketFk` */; +/*!50001 CREATE TABLE `orderTicket` ( + `orderFk` tinyint NOT NULL, + `ticketFk` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -11267,10 +10900,11 @@ DROP TABLE IF EXISTS `order_component`; /*!50001 DROP VIEW IF EXISTS `order_component`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `order_component` AS SELECT - 1 AS `order_row_id`, - 1 AS `component_id`, - 1 AS `price` */; +/*!50001 CREATE TABLE `order_component` ( + `order_row_id` tinyint NOT NULL, + `component_id` tinyint NOT NULL, + `price` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -11281,17 +10915,18 @@ DROP TABLE IF EXISTS `order_row`; /*!50001 DROP VIEW IF EXISTS `order_row`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `order_row` AS SELECT - 1 AS `id`, - 1 AS `order_id`, - 1 AS `item_id`, - 1 AS `warehouse_id`, - 1 AS `shipment`, - 1 AS `amount`, - 1 AS `price`, - 1 AS `rate`, - 1 AS `created`, - 1 AS `Id_Movimiento` */; +/*!50001 CREATE TABLE `order_row` ( + `id` tinyint NOT NULL, + `order_id` tinyint NOT NULL, + `item_id` tinyint NOT NULL, + `warehouse_id` tinyint NOT NULL, + `shipment` tinyint NOT NULL, + `amount` tinyint NOT NULL, + `price` tinyint NOT NULL, + `rate` tinyint NOT NULL, + `created` tinyint NOT NULL, + `Id_Movimiento` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -11303,7 +10938,7 @@ DROP TABLE IF EXISTS `restPriv`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `restPriv` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `methodPath` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL, + `methodPath` varchar(255) NOT NULL, `role` int(10) unsigned DEFAULT NULL, PRIMARY KEY (`id`), KEY `role` (`role`), @@ -11320,7 +10955,7 @@ DROP TABLE IF EXISTS `shelf`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `shelf` ( `id` int(10) unsigned NOT NULL, - `name` varchar(30) COLLATE utf8mb3_unicode_ci NOT NULL, + `name` varchar(30) NOT NULL, `nTrays` tinyint(3) unsigned NOT NULL, `trayheight` mediumint(8) unsigned NOT NULL, `topTrayHeight` mediumint(8) unsigned NOT NULL, @@ -11339,8 +10974,8 @@ DROP TABLE IF EXISTS `shelfConfig`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `shelfConfig` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `name` varchar(25) COLLATE utf8mb3_unicode_ci NOT NULL, - `namePrefix` varchar(50) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `name` varchar(25) NOT NULL, + `namePrefix` varchar(50) DEFAULT NULL, `warehouse` smallint(5) unsigned NOT NULL, `family` smallint(5) unsigned NOT NULL, `shelf` int(10) unsigned NOT NULL, @@ -11366,9 +11001,9 @@ DROP TABLE IF EXISTS `social`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `social` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `title` varchar(50) COLLATE utf8mb3_unicode_ci NOT NULL, - `link` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL, - `icon` varchar(50) COLLATE utf8mb3_unicode_ci NOT NULL, + `title` varchar(50) NOT NULL, + `link` varchar(255) NOT NULL, + `icon` varchar(50) NOT NULL, `priority` tinyint(3) unsigned NOT NULL, PRIMARY KEY (`id`), KEY `priority` (`priority`) @@ -11384,7 +11019,7 @@ DROP TABLE IF EXISTS `survey`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `survey` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `question` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL, + `question` varchar(255) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -11399,7 +11034,7 @@ DROP TABLE IF EXISTS `surveyAnswer`; CREATE TABLE `surveyAnswer` ( `id` int(10) unsigned NOT NULL, `surveyFk` int(10) unsigned NOT NULL, - `answer` varchar(30) COLLATE utf8mb3_unicode_ci NOT NULL, + `answer` varchar(30) NOT NULL, `votes` int(10) unsigned NOT NULL DEFAULT 0, PRIMARY KEY (`id`), KEY `survey` (`surveyFk`) @@ -11437,11 +11072,11 @@ CREATE TABLE `tpvConfig` ( `transactionType` tinyint(3) unsigned NOT NULL, `maxAmount` int(10) unsigned DEFAULT NULL, `employeeFk` int(10) unsigned NOT NULL, - `url` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL COMMENT 'The bank web service URL for production environment', + `url` varchar(255) 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', - `testUrl` varchar(255) CHARACTER SET utf8mb3 DEFAULT NULL COMMENT 'The bank web service URL for test environment', - `testKey` varchar(50) CHARACTER SET utf8mb3 DEFAULT NULL COMMENT 'The bank secret key for test environment', - `merchantUrl` varchar(255) CHARACTER SET utf8mb3 DEFAULT NULL, + `testUrl` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT 'The bank web service URL for test environment', + `testKey` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT 'The bank secret key for test environment', + `merchantUrl` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL, PRIMARY KEY (`id`), KEY `employee_id` (`employeeFk`), CONSTRAINT `employee_id` FOREIGN KEY (`employeeFk`) REFERENCES `vn`.`worker` (`id`) ON UPDATE CASCADE @@ -11456,8 +11091,8 @@ DROP TABLE IF EXISTS `tpvError`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `tpvError` ( - `code` char(7) COLLATE utf8mb3_unicode_ci NOT NULL, - `message` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL, + `code` char(7) NOT NULL, + `message` varchar(255) NOT NULL, PRIMARY KEY (`code`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT=' List of possible TPV errors'; /*!40101 SET character_set_client = @saved_cs_client */; @@ -11471,12 +11106,12 @@ DROP TABLE IF EXISTS `tpvImapConfig`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `tpvImapConfig` ( `id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT, - `host` varchar(150) COLLATE utf8mb3_unicode_ci NOT NULL, - `user` varchar(50) COLLATE utf8mb3_unicode_ci NOT NULL, - `pass` varchar(50) COLLATE utf8mb3_unicode_ci NOT NULL, - `cleanPeriod` varchar(15) CHARACTER SET utf8mb3 NOT NULL, - `successFolder` varchar(150) CHARACTER SET utf8mb3 DEFAULT NULL, - `errorFolder` varchar(150) CHARACTER SET utf8mb3 DEFAULT NULL, + `host` varchar(150) NOT NULL, + `user` varchar(50) NOT NULL, + `pass` varchar(50) NOT NULL, + `cleanPeriod` varchar(15) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, + `successFolder` varchar(150) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL, + `errorFolder` varchar(150) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='IMAP configuration parameters for virtual TPV'; /*!40101 SET character_set_client = @saved_cs_client */; @@ -11490,10 +11125,10 @@ DROP TABLE IF EXISTS `tpvMerchant`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `tpvMerchant` ( `id` int(10) unsigned NOT NULL COMMENT 'Merchant identifier', - `description` varchar(50) COLLATE utf8mb3_unicode_ci NOT NULL COMMENT 'Small description', + `description` varchar(50) NOT NULL COMMENT 'Small description', `companyFk` smallint(6) unsigned DEFAULT NULL COMMENT 'Company associated with the merchant', `bankFk` int(10) NOT NULL COMMENT 'The bank where merchant receipts are created', - `secretKey` varchar(50) COLLATE utf8mb3_unicode_ci NOT NULL COMMENT 'The merchant secret key to sign transactions', + `secretKey` varchar(50) NOT NULL COMMENT 'The merchant secret key to sign transactions', PRIMARY KEY (`id`), KEY `bank_id` (`bankFk`), KEY `company_id` (`companyFk`), @@ -11526,7 +11161,7 @@ DROP TABLE IF EXISTS `tpvResponse`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `tpvResponse` ( `id` smallint(5) unsigned NOT NULL, - `message` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL, + `message` varchar(255) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='List of possible TPV reponses'; /*!40101 SET character_set_client = @saved_cs_client */; @@ -11545,8 +11180,8 @@ CREATE TABLE `tpvTransaction` ( `receiptFk` int(11) DEFAULT NULL, `amount` int(10) unsigned NOT NULL, `response` smallint(5) unsigned DEFAULT NULL COMMENT 'Status notified by bank: NULL if no notification, 0 if success, error otherwise', - `errorCode` char(7) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `status` enum('started','ok','ko') COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'started', + `errorCode` char(7) DEFAULT NULL, + `status` enum('started','ok','ko') NOT NULL DEFAULT 'started', `created` timestamp NOT NULL DEFAULT current_timestamp(), PRIMARY KEY (`id`), KEY `merchant_id` (`merchantFk`), @@ -11570,8 +11205,8 @@ DROP TABLE IF EXISTS `userSession`; CREATE TABLE `userSession` ( `created` datetime NOT NULL DEFAULT current_timestamp(), `lastUpdate` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), - `ssid` char(64) COLLATE utf8mb3_unicode_ci NOT NULL, - `data` text COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `ssid` char(64) NOT NULL, + `data` text DEFAULT NULL, `userVisitFk` int(10) unsigned DEFAULT NULL, UNIQUE KEY `ssid` (`ssid`), KEY `userVisit` (`userVisitFk`), @@ -11607,7 +11242,7 @@ CREATE TABLE `visitAccess` ( `agentFk` int(10) unsigned NOT NULL, `stamp` datetime NOT NULL DEFAULT current_timestamp(), `ip` int(10) unsigned DEFAULT NULL, - `referer` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `referer` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`), KEY `visit_access_idx_agent` (`agentFk`), KEY `stamp` (`stamp`), @@ -11626,12 +11261,12 @@ CREATE TABLE `visitAgent` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `visitFk` int(10) unsigned NOT NULL, `firstAccessFk` int(10) unsigned DEFAULT NULL, - `platform` varchar(30) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `browser` varchar(30) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `version` varchar(15) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `platform` varchar(30) DEFAULT NULL, + `browser` varchar(30) DEFAULT NULL, + `version` varchar(15) DEFAULT NULL, `javascript` tinyint(3) unsigned DEFAULT NULL, `cookies` tinyint(3) unsigned DEFAULT NULL, - `agent` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `agent` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`), KEY `visit_id` (`visitFk`), KEY `firstAccess` (`firstAccessFk`), @@ -11669,14 +11304,14 @@ DELIMITER ;; /*!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 = utf8mb4 */ ;; -/*!50003 SET character_set_results = utf8mb4 */ ;; -/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;; +/*!50003 SET character_set_client = utf8mb3 */ ;; +/*!50003 SET character_set_results = utf8mb3 */ ;; +/*!50003 SET collation_connection = utf8mb3_general_ci */ ;; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;; /*!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 `order_doRecalc` ON SCHEDULE EVERY 10 SECOND STARTS '2019-08-29 14:18:04' ON COMPLETION PRESERVE ENABLE DO CALL order_doRecalc */ ;; +/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `order_doRecalc` ON SCHEDULE EVERY 10 SECOND STARTS '2019-08-29 14:18:04' ON COMPLETION PRESERVE DISABLE ON SLAVE DO CALL order_doRecalc */ ;; /*!50003 SET time_zone = @saved_time_zone */ ;; /*!50003 SET sql_mode = @saved_sql_mode */ ;; /*!50003 SET character_set_client = @saved_cs_client */ ;; @@ -11688,8 +11323,6 @@ DELIMITER ; -- -- Dumping routines for database 'hedera' -- -/*!50003 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `myBasket_getId` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -11697,6 +11330,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `myBasket_getId`() RETURNS int(11) DETERMINISTIC @@ -11713,8 +11348,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `myClient_getDebt` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -11722,6 +11355,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `myClient_getDebt`(vDate DATE) RETURNS decimal(10,2) DETERMINISTIC @@ -11738,8 +11373,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `myUser_checkRestPriv` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -11747,6 +11380,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `myUser_checkRestPriv`(vMethodPath VARCHAR(255)) RETURNS tinyint(1) DETERMINISTIC @@ -11765,7 +11400,7 @@ BEGIN IF vCount = 0 THEN RETURN FALSE; - END IF; + END IF; SELECT COUNT(*) > 0 INTO vHasRole @@ -11781,8 +11416,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `order_getTotal` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -11790,6 +11423,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `order_getTotal`(vSelf INT) RETURNS decimal(10,2) READS SQL DATA @@ -11824,8 +11459,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `catalog_calcFromMyAddress` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -11833,6 +11466,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `catalog_calcFromMyAddress`(vDelivery DATE, vAddress INT) BEGIN @@ -11846,14 +11481,14 @@ BEGIN * @return tmp.ticketComponent * @return tmp.ticketLot * @return tmp.zoneGetShipped - */ + */ DECLARE vAgencyMode INT; - + SELECT a.agencyModeFk INTO vAgencyMode FROM myClient c JOIN vn.address a ON a.clientFk = c.id - WHERE a.id = vAddress; + WHERE a.id = vAddress; CALL vn.available_calc(vDelivery, vAddress, vAgencyMode); @@ -11866,7 +11501,7 @@ BEGIN JOIN tmp.availableCalc a ON a.calcFk = c.calc_id WHERE c.available > 0 GROUP BY c.item_id; - + CALL vn.catalog_calculate(vDelivery, vAddress, vAgencyMode); DROP TEMPORARY TABLE tmp.item; @@ -11876,8 +11511,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `catalog_calcFromMyAddress_beta` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -11885,6 +11518,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `catalog_calcFromMyAddress_beta`(vDelivery DATE, vAddress INT) BEGIN @@ -11918,7 +11553,7 @@ BEGIN JOIN tmp.availableCalc a ON a.calcFk = c.calc_id WHERE c.available > 0 GROUP BY c.item_id; - + CALL vn.catalog_calculate_beta(vDelivery, vAddress, vAgencyMode); DROP TEMPORARY TABLE tmp.item; @@ -11928,8 +11563,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `image_ref` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -11937,6 +11570,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `image_ref`( vCollection VARCHAR(255), @@ -11966,8 +11601,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `image_unref` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -11975,6 +11608,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `image_unref`( vCollection VARCHAR(255), @@ -11996,8 +11631,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `item_calcCatalog` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -12005,6 +11638,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `item_calcCatalog`( vSelf INT, @@ -12020,7 +11655,7 @@ BEGIN */ DROP TEMPORARY TABLE IF EXISTS tmp.item; CREATE TEMPORARY TABLE tmp.item - ENGINE = MEMORY + ENGINE = MEMORY SELECT vSelf itemFk; CALL vn.catalog_calculate(vLanded, vAddressFk, vAgencyModeFk); @@ -12044,8 +11679,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `item_getVisible` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -12053,6 +11686,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `item_getVisible`( vWarehouse TINYINT, @@ -12060,7 +11695,7 @@ CREATE DEFINER=`root`@`localhost` PROCEDURE `item_getVisible`( vType INT, vPrefix VARCHAR(255)) BEGIN - + /** * Gets visible items of the specified type at specified date. * @@ -12069,7 +11704,7 @@ BEGIN * @param vType The type id * @param vPrefix The article prefix to filter or %NULL for all * @return tmp.itemVisible Visible items - */ + */ DECLARE vPrefixLen SMALLINT; DECLARE vFilter VARCHAR(255) DEFAULT NULL; DECLARE vDateInv DATE DEFAULT vn2008.date_inv(); @@ -12078,13 +11713,13 @@ BEGIN GET DIAGNOSTICS CONDITION 1 @message = MESSAGE_TEXT; CALL vn.mail_insert( - 'cau@verdnatura.es', - NULL, + 'cau@verdnatura.es', + NULL, CONCAT('hedera.item_getVisible error: ', @message), CONCAT( - 'warehouse: ', IFNULL(vWarehouse, ''), - ', Fecha:', IFNULL(vDate, ''), - ', tipo: ', IFNULL(vType,''), + 'warehouse: ', IFNULL(vWarehouse, ''), + ', Fecha:', IFNULL(vDate, ''), + ', tipo: ', IFNULL(vType,''), ', prefijo: ', IFNULL(vPrefix,''))); RESIGNAL; END; @@ -12163,7 +11798,7 @@ BEGIN IF(p.depth > 0, p.depth, 0) depth, p.width, p.height, CEIL(s.quantity / t.packing) etiquetas FROM vn.item i - JOIN `filter` f ON f.itemFk = i.id + JOIN `filter` f ON f.itemFk = i.id JOIN currentStock s ON s.itemFk = i.id LEFT JOIN tmp t ON t.itemFk = i.id LEFT JOIN vn.packaging p ON p.id = t.packageFk @@ -12181,8 +11816,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `item_listAllocation` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -12190,6 +11823,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `item_listAllocation`(IN `vWh` TINYINT, IN `vDate` DATE, IN `vType` INT, IN `vPrefix` VARCHAR(255), IN `vUseIds` BOOLEAN) BEGIN @@ -12222,8 +11857,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `myBasket_addItem` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -12231,6 +11864,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `myBasket_addItem`( vWarehouse INT, @@ -12244,8 +11879,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `myBasket_calcCatalogFromItem` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -12253,6 +11886,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `myBasket_calcCatalogFromItem`(vItem INT) BEGIN @@ -12274,8 +11909,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `myBasket_calcCatalogFull` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -12283,6 +11916,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `myBasket_calcCatalogFull`() BEGIN @@ -12304,8 +11939,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `myBasket_check` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -12313,6 +11946,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `myBasket_check`() BEGIN @@ -12337,7 +11972,7 @@ BEGIN IF vStatus = 'OK' THEN CALL order_checkConfig(vSelf); - + IF vStatus = 'OK' AND vCreated < TIMESTAMPADD(DAY, -1, util.VN_NOW()) THEN CALL order_update(vSelf); @@ -12352,8 +11987,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `myBasket_configure` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -12361,6 +11994,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `myBasket_configure`( vDelivery DATE, @@ -12441,8 +12076,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `myBasket_configureForGuest` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -12450,6 +12083,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `myBasket_configureForGuest`() BEGIN @@ -12477,8 +12112,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `myBasket_confirm` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -12486,6 +12119,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `myBasket_confirm`() BEGIN @@ -12493,7 +12128,7 @@ BEGIN IF vSelf IS NOT NULL THEN CALL order_confirm(vSelf); - + DELETE FROM basketOrder WHERE orderFk = vSelf; END IF; @@ -12503,8 +12138,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `myBasket_getAvailable` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -12512,6 +12145,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `myBasket_getAvailable`() BEGIN @@ -12527,8 +12162,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `myBasket_getTax` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -12536,6 +12169,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `myBasket_getTax`() READS SQL DATA @@ -12549,9 +12184,9 @@ BEGIN CREATE TEMPORARY TABLE tmp.`order` ENGINE = MEMORY SELECT myBasket_getId() orderFk; - + CALL order_getTax(); - + DROP TEMPORARY TABLE IF EXISTS tmp.`order`; END ;; DELIMITER ; @@ -12559,8 +12194,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `myOrder_addItem` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -12568,6 +12201,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `myOrder_addItem`( vSelf INT, @@ -12580,7 +12215,7 @@ BEGIN SELECT COUNT(*) INTO vIsMine FROM myOrder WHERE id = vSelf; - + IF vIsMine THEN CALL order_addItem(vSelf, vWarehouse, vItem, vAmount); END IF; @@ -12590,8 +12225,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `myOrder_confirm` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -12599,15 +12232,17 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `myOrder_confirm`(vSelf INT) BEGIN DECLARE vIsMine BOOL; - - SELECT COUNT(*) INTO vIsMine + + SELECT COUNT(*) INTO vIsMine FROM myOrder WHERE id = vSelf; - + IF vIsMine THEN CALL order_confirm(vSelf); END IF; @@ -12617,8 +12252,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `myOrder_getAvailable` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -12626,6 +12259,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `myOrder_getAvailable`(vSelf INT) BEGIN @@ -12640,7 +12275,7 @@ BEGIN SELECT COUNT(*) INTO isMine FROM myOrder WHERE id = vSelf; - + IF isMine THEN CALL order_getAvailable(vSelf); END IF; @@ -12650,8 +12285,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `myOrder_newWithAddress` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -12659,6 +12292,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `myOrder_newWithAddress`( OUT vSelf INT, @@ -12686,15 +12321,15 @@ BEGIN START TRANSACTION; - SELECT a.agencyModeFk, a.id + SELECT a.agencyModeFk, a.id INTO vAgencyMode, vAddressFk - FROM vn.address a + FROM vn.address a WHERE a.id = vAddressFk; - + SELECT deliveryMethodFk INTO vDeliveryMethodId FROM vn.agencyMode am WHERE am.id = vAgencyMode; - + IF vCompany IS NULL THEN SELECT defaultCompanyFk INTO vCompany @@ -12712,7 +12347,7 @@ BEGIN company_id = vCompany; SET vSelf = LAST_INSERT_ID(); - + CALL order_checkConfig(vSelf); COMMIT; @@ -12722,8 +12357,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `myOrder_newWithDate` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -12731,6 +12364,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `myOrder_newWithDate`( OUT vSelf INT, @@ -12758,15 +12393,15 @@ BEGIN START TRANSACTION; - SELECT a.agencyModeFk, a.id + SELECT a.agencyModeFk, a.id INTO vAgencyMode, vAddress FROM myClient c JOIN vn.address a ON a.id = c.defaultAddressFk; - + SELECT deliveryMethodFk INTO vDeliveryMethodId FROM vn.agencyMode am WHERE am.id = vAgencyMode; - + IF vCompany IS NULL THEN SELECT defaultCompanyFk INTO vCompany @@ -12784,7 +12419,7 @@ BEGIN company_id = vCompany; SET vSelf = LAST_INSERT_ID(); - + CALL order_checkConfig(vSelf); COMMIT; @@ -12794,8 +12429,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `myTicket_get` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -12803,6 +12436,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `myTicket_get`(vSelf INT) BEGIN @@ -12848,8 +12483,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `myTicket_getPackages` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -12857,6 +12490,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `myTicket_getPackages`(vSelf INT) BEGIN @@ -12881,8 +12516,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `myTicket_getRows` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -12890,6 +12523,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `myTicket_getRows`(vSelf INT) BEGIN @@ -12910,8 +12545,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `myTicket_getServices` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -12919,6 +12552,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `myTicket_getServices`(vSelf INT) BEGIN @@ -12937,8 +12572,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `myTicket_list` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -12946,6 +12579,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `myTicket_list`(vFrom DATE, vTo DATE) BEGIN @@ -12967,7 +12602,7 @@ BEGIN SELECT t.id ticketFk FROM myTicket t WHERE shipped BETWEEN TIMESTAMP(vFrom) AND TIMESTAMP(vTo, '23:59:59'); - + CALL vn.ticketGetTotal; SELECT v.id, IFNULL(v.landed, v.shipped) landed, @@ -12989,8 +12624,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `myTicket_logAccess` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -12998,6 +12631,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `myTicket_logAccess`(vSelf INT) BEGIN @@ -13017,8 +12652,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `myTpvTransaction_end` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -13026,32 +12659,35 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; -CREATE DEFINER=`root`@`localhost` PROCEDURE `myTpvTransaction_end`(vSelf INT, vStatus VARCHAR(12)) +CREATE DEFINER=`root`@`localhost` PROCEDURE `myTpvTransaction_end`( + vSelf INT, + vStatus VARCHAR(12)) BEGIN /** - * Finaliza una transaccción estableciendo su estado a 'ok' o - * 'ko' en función de si esta se ha realizado correctamente. - * Este procedimiento debe ser llamado directamente por el cliente - * nada mas finalizar la transacción y solo tiene validez hasta que - * llega la notificacion definitiva desde el banco. + * See tpvTransaction_start() for more info. * - * @param vSelf El identificador de la transacción - * @param vStatus El estado, 'ok' o 'ko' + * @param vSelf Transaction indentifier + * @param vStatus The status, 'ok' o 'ko' */ - IF vStatus IN ('ok', 'ko') - THEN - UPDATE myTpvTransaction SET status = vStatus - WHERE id = vSelf AND response IS NULL; + DECLARE vIsOwned BOOL; + + SELECT COUNT(*) > 0 INTO vIsOwned + FROM myTpvTransaction WHERE id = vSelf; + + IF NOT vIsOwned THEN + CALL util.throw('transactionNotOwnedByUser'); END IF; + + CALL tpvTransaction_end(vSelf, vStatus); END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `myTpvTransaction_start` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -13059,86 +12695,26 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; -CREATE DEFINER=`root`@`localhost` PROCEDURE `myTpvTransaction_start`(vAmount INT, vCompany INT) +CREATE DEFINER=`root`@`localhost` PROCEDURE `myTpvTransaction_start`( + vAmount INT, + vCompany INT) BEGIN /** - * Inicia una nueva transacción con el TPV virtual, generando - * un identificador de transacción y devolviendo con un SELECT - * los parámetros que deben enviarse a la URL del servicio web - * del banco. + * See tpvTransaction_start() for more info. * - * @param vAmount Cantidad a pagar en céntimos - * @param vCompany El identificador de la empresa - * - * @select Los parámetros que deben pasarse al banco + * @param vAmount Amount to pay in cents + * @param vCompany The company identifier */ - DECLARE vSelf CHAR(12); - DECLARE vMerchant INT; - DECLARE vUrl VARCHAR(255); - DECLARE vKey VARCHAR(50); - DECLARE vEnvironment VARCHAR(255); - - DECLARE EXIT HANDLER FOR SQLEXCEPTION - BEGIN - ROLLBACK; - RESIGNAL; - END; - - START TRANSACTION; - - IF vCompany IS NULL - THEN - SELECT companyFk INTO vCompany - FROM tpvMerchantEnable LIMIT 1; - END IF; - - SELECT merchantFk INTO vMerchant - FROM tpvMerchantEnable WHERE companyFk = vCompany; - - SELECT environment INTO vEnvironment - FROM util.config; - - IF vEnvironment = 'production' - THEN - SELECT c.url, m.secretKey INTO vUrl, vKey - FROM tpvMerchant m - JOIN tpvConfig c - WHERE m.id = vMerchant; - ELSE - SELECT testUrl, testKey INTO vUrl, vKey - FROM tpvConfig; - END IF; - - INSERT INTO myTpvTransaction - SET - merchantFk = vMerchant - ,clientFk = account.myUser_getId() - ,amount = vAmount; - - SET vSelf = LAST_INSERT_ID(); - - SELECT - vAmount amount - ,vSelf transactionId - ,vMerchant merchant - ,currency - ,transactionType - ,terminal - ,merchantUrl - ,vUrl url - ,vKey secretKey - FROM tpvConfig; - - COMMIT; + CALL tpvTransaction_start(vAmount, vCompany, account.myUser_getId()); END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `order_addItem` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -13146,6 +12722,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `order_addItem`( vSelf INT, @@ -13210,7 +12788,7 @@ BEGIN IF vDone THEN LEAVE l; END IF; - + SET vAdd = vAmount - MOD(vAmount, vGrouping); SET vAmount = vAmount - vAdd; @@ -13226,7 +12804,7 @@ BEGIN rate = vRate, amount = vAdd, price = vPrice; - + SET vRow = LAST_INSERT_ID(); INSERT INTO orderRowComponent (rowFk, componentFk, price) @@ -13244,7 +12822,7 @@ BEGIN IF vAmount > 0 THEN CALL util.throw ('AMOUNT_NOT_MATCH_GROUPING'); END IF; - + COMMIT; CALL vn.ticketCalculatePurge; END ;; @@ -13253,8 +12831,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `order_calcCatalog` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -13262,6 +12838,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `order_calcCatalog`(vSelf INT) BEGIN @@ -13287,10 +12865,10 @@ BEGIN CREATE TEMPORARY TABLE tmp.item (PRIMARY KEY (itemFk)) ENGINE = MEMORY - SELECT itemFk FROM orderRow + SELECT itemFk FROM orderRow WHERE orderFk = vSelf GROUP BY itemFk; - + CALL vn.catalog_calculate(vDate, vAddress, vAgencyMode); DROP TEMPORARY TABLE tmp.item; @@ -13300,8 +12878,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `order_calcCatalogFromItem` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -13309,6 +12885,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `order_calcCatalogFromItem`(vSelf INT, vItem INT) BEGIN @@ -13340,8 +12918,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `order_calcCatalogFull` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -13349,6 +12925,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `order_calcCatalogFull`(vSelf INT) BEGIN @@ -13389,8 +12967,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `order_checkConfig` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -13398,6 +12974,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `order_checkConfig`(vSelf INT) BEGIN @@ -13461,8 +13039,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `order_confirm` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -13470,6 +13046,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `order_confirm`(vSelf INT) BEGIN @@ -13487,8 +13065,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `order_confirmWithUser` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -13496,6 +13072,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `order_confirmWithUser`(IN `vOrder` INT, IN `vUserId` INT) BEGIN @@ -13528,6 +13106,10 @@ BEGIN DECLARE TICKET_FREE INT DEFAULT 2; DECLARE vCalc INT; DECLARE vIsLogifloraItem BOOL; + DECLARE vOldQuantity INT; + DECLARE vNewQuantity INT; + DECLARE vOldInstance JSON; + DECLARE vNewInstance JSON; DECLARE cDates CURSOR FOR SELECT zgs.shipped, r.warehouse_id @@ -13641,10 +13223,10 @@ BEGIN vTicket ); ELSE - INSERT INTO vncontrol.inter - SET Id_Ticket = vTicket, - Id_Trabajador = vUserId, - state_id = TICKET_FREE; + INSERT INTO vn.ticketTracking + SET ticketFk = vTicket, + workerFk = vUserId, + stateFk = TICKET_FREE; END IF; INSERT IGNORE INTO vn.orderTicket @@ -13680,7 +13262,7 @@ BEGIN SET vSale = NULL; - SELECT s.id INTO vSale + SELECT s.id, s.quantity INTO vSale, vOldQuantity FROM vn.sale s WHERE ticketFk = vTicket AND price = vPrice @@ -13692,6 +13274,20 @@ BEGIN UPDATE vn.sale SET quantity = quantity + vAmount WHERE id = vSale; + + SELECT s.quantity INTO vNewQuantity + FROM vn.sale s + WHERE id = vSale; + + SET vOldInstance = JSON_OBJECT( + 'quantity', vOldQuantity + ); + SET vNewInstance = JSON_OBJECT( + 'quantity', vNewQuantity + ); + + CALL `util`.`log_addWithUser`('vn', 'ticket', + 'Sale', vTicket, vSale, 'update', vOldInstance, vNewInstance, vUserId); ELSE INSERT INTO vn.sale SET @@ -13705,6 +13301,18 @@ BEGIN SET vSale = LAST_INSERT_ID(); + SET vNewInstance = JSON_OBJECT( + 'itemFk', vItem, + 'ticketFk', vTicket, + 'concept', vConcept, + 'quantity', vAmount, + 'price', vPrice, + 'priceFixed', FALSE, + 'isPriceFixed', TRUE + ); + CALL `util`.`log_addWithUser`('vn', 'ticket', + 'Sale', vTicket, vSale, 'insert', NULL, vNewInstance, vUserId); + INSERT INTO vn.saleComponent (saleFk, componentFk, `value`) SELECT vSale, cm.component_id, cm.price @@ -13798,8 +13406,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `order_doRecalc` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -13807,6 +13413,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `order_doRecalc`() proc: BEGIN @@ -13864,8 +13472,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `order_getAvailable` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -13873,6 +13479,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `order_getAvailable`(vSelf INT) BEGIN @@ -13890,7 +13498,7 @@ BEGIN INTO vDelivery, vAddress, vAgencyMode FROM `order` WHERE id = vSelf; - + CALL vn.available_calc(vDelivery, vAddress, vAgencyMode); DROP TEMPORARY TABLE IF EXISTS tmp.itemAvailable; @@ -13909,8 +13517,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `order_getTax` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -13918,6 +13524,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `order_getTax`() READS SQL DATA @@ -13932,7 +13540,7 @@ BEGIN DROP TEMPORARY TABLE IF EXISTS tmp.addressCompany; CREATE TEMPORARY TABLE tmp.addressCompany (INDEX (addressFk, companyFk)) - ENGINE = MEMORY + ENGINE = MEMORY SELECT DISTINCT o.address_id addressFk, o.company_id companyFk FROM tmp.`order` tmpOrder JOIN hedera.`order` o ON o.id = tmpOrder.orderFk; @@ -13967,7 +13575,7 @@ BEGIN JOIN vn.taxClass tc ON tc.id = bp.taxClassFk GROUP BY tmpOrder.orderFk, pgc.`code`, pgc.rate HAVING taxableBase != 0; - + DROP TEMPORARY TABLE IF EXISTS tmp.orderAmount; CREATE TEMPORARY TABLE tmp.orderAmount (INDEX (orderFk)) @@ -13976,7 +13584,7 @@ BEGIN SUM(CAST(taxableBase * rate / 100 AS DECIMAL(10, 2))) tax FROM tmp.orderTax GROUP BY orderFk, `code`; - + DROP TEMPORARY TABLE tmp.addressTaxArea; END ;; DELIMITER ; @@ -13984,8 +13592,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `order_getTotal` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -13993,6 +13599,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `order_getTotal`() BEGIN @@ -14022,8 +13630,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `order_recalc` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -14031,6 +13637,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `order_recalc`(vSelf INT) BEGIN @@ -14046,7 +13654,7 @@ BEGIN CREATE TEMPORARY TABLE tmp.`order` ENGINE = MEMORY SELECT vSelf orderFk; - + CALL order_getTax; SELECT IFNULL(SUM(taxableBase), 0.0), IFNULL(SUM(tax), 0.0) @@ -14068,8 +13676,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `order_requestRecalc` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -14077,6 +13683,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `order_requestRecalc`(vSelf INT) proc: BEGIN @@ -14096,8 +13704,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `order_update` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -14105,6 +13711,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `order_update`(vSelf INT) proc: BEGIN @@ -14137,7 +13745,7 @@ proc: BEGIN FROM orderRow r JOIN orderRowComponent c ON c.rowFk = r.id WHERE r.orderFk = vSelf; - + UPDATE orderRow r LEFT JOIN tmp.ticketComponentPrice p ON p.warehouseFk = r.warehouseFk @@ -14162,7 +13770,7 @@ proc: BEGIN ON t.id = c.componentFk AND (t.classRate IS NULL OR t.classRate = r.rate) WHERE r.orderFk = vSelf; - + CALL vn.ticketCalculatePurge; END IF; @@ -14176,8 +13784,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `survey_vote` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -14185,6 +13791,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `survey_vote`(vAnswer INT) BEGIN @@ -14208,8 +13816,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `tpvTransaction_confirm` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -14217,6 +13823,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `tpvTransaction_confirm`( vAmount INT @@ -14333,8 +13941,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `tpvTransaction_confirmAll` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -14342,6 +13948,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `tpvTransaction_confirmAll`(vDate DATE) BEGIN @@ -14384,8 +13992,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `tpvTransaction_confirmById` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -14393,6 +13999,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `tpvTransaction_confirmById`(vOrder INT) BEGIN @@ -14426,8 +14034,124 @@ 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 PROCEDURE IF EXISTS `tpvTransaction_end` */; +/*!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 = utf8mb4 */ ; +/*!50003 SET character_set_results = utf8mb4 */ ; +/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; +DELIMITER ;; +CREATE DEFINER=`root`@`localhost` PROCEDURE `tpvTransaction_end`( + vSelf INT, + vStatus VARCHAR(12)) +BEGIN +/** + * Ends a transaction by setting its status to 'ok' or 'ko' depending on + * if this has been done correctly. + * This procedure must be called directly by the client when the transaction + * ends, it is only valid until the arrival of the definitive notification from + * the payment platform. + * + * @param vSelf Transaction indentifier + * @param vStatus The status, 'ok' o 'ko' + */ + IF vStatus IN ('ok', 'ko') THEN + UPDATE tpvTransaction SET `status` = vStatus + WHERE id = vSelf AND response IS NULL; + END IF; +END ;; +DELIMITER ; +/*!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 PROCEDURE IF EXISTS `tpvTransaction_start` */; +/*!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 = utf8mb4 */ ; +/*!50003 SET character_set_results = utf8mb4 */ ; +/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; +DELIMITER ;; +CREATE DEFINER=`root`@`localhost` PROCEDURE `tpvTransaction_start`( + vAmount INT, + vCompany INT, + vUser INT) +BEGIN +/** + * Start a new transaction with the virtual TPV, generating an identifier + * of transaction and returning the parameters that should be sent to the + * payment platform. + * + * @param vAmount Amount to pay in cents + * @param vCompany The company identifier + * @select Parameters that will be sent to payment platform + */ + DECLARE vSelf CHAR(12); + DECLARE vMerchant INT; + DECLARE vUrl VARCHAR(255); + DECLARE vKey VARCHAR(50); + DECLARE vEnvironment VARCHAR(255); + + DECLARE EXIT HANDLER FOR SQLEXCEPTION + BEGIN + ROLLBACK; + RESIGNAL; + END; + + START TRANSACTION; + + IF vCompany IS NULL THEN + SELECT companyFk INTO vCompany + FROM tpvMerchantEnable LIMIT 1; + END IF; + + SELECT merchantFk INTO vMerchant + FROM tpvMerchantEnable WHERE companyFk = vCompany; + + SELECT environment INTO vEnvironment + FROM util.config; + + IF vEnvironment = 'production' THEN + SELECT c.url, m.secretKey INTO vUrl, vKey + FROM tpvMerchant m + JOIN tpvConfig c + WHERE m.id = vMerchant; + ELSE + SELECT testUrl, testKey INTO vUrl, vKey + FROM tpvConfig; + END IF; + + INSERT INTO tpvTransaction + SET merchantFk = vMerchant, + clientFk = vUser, + amount = vAmount; + + SET vSelf = LAST_INSERT_ID(); + + SELECT vAmount amount, + vSelf transactionId, + vMerchant merchant, + currency, + transactionType, + terminal, + merchantUrl, + vUrl url, + vKey secretKey + FROM tpvConfig; + + COMMIT; +END ;; +DELIMITER ; +/*!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 PROCEDURE IF EXISTS `tpvTransaction_undo` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -14435,6 +14159,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `tpvTransaction_undo`(vSelf INT) p: BEGIN @@ -14506,13 +14232,13 @@ p: BEGIN AND DATE(FECHA) = vDate AND EURODEBE = vAmount LIMIT 1; - + -- Actualiza la transaccion UPDATE tpvTransaction SET response = NULL, status = 'started' WHERE id = vSelf; - + COMMIT; END ;; DELIMITER ; @@ -14520,8 +14246,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `visitUser_new` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -14529,6 +14253,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `visitUser_new`( vAccess INT @@ -14545,7 +14271,7 @@ BEGIN UPDATE userSession SET userVisitFk = vUserVisit WHERE ssid = vSsid; - + DELETE FROM userSession WHERE lastUpdate < TIMESTAMPADD(HOUR, -1, util.VN_NOW()); END ;; @@ -14554,8 +14280,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `visit_listByBrowser` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -14563,6 +14287,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `visit_listByBrowser`(vFrom DATE, vTo DATE) BEGIN @@ -14591,8 +14317,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `visit_register` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -14600,6 +14324,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `visit_register`( vVisit INT @@ -14669,7 +14395,7 @@ BEGIN UPDATE visitAgent SET firstAccessFk = vAccessId WHERE id = vAgentId; END IF; - + -- Returns the visit info SELECT vVisit visit, vAccessId access; @@ -14696,7 +14422,7 @@ DROP TABLE IF EXISTS `blacklist`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `blacklist` ( - `phone` varchar(20) COLLATE utf8mb3_unicode_ci NOT NULL, + `phone` varchar(20) NOT NULL, PRIMARY KEY (`phone`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='Hangup input calls from this list'; /*!40101 SET character_set_client = @saved_cs_client */; @@ -14751,21 +14477,21 @@ DROP TABLE IF EXISTS `cdr`; CREATE TABLE `cdr` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `call_date` datetime NOT NULL DEFAULT current_timestamp(), - `clid` varchar(80) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '', - `src` varchar(80) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '', - `dst` varchar(80) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '', - `dcontext` varchar(80) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '', - `channel` varchar(80) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '', - `dst_channel` varchar(80) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '', - `last_app` varchar(80) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '', - `last_data` varchar(80) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '', + `clid` varchar(80) NOT NULL DEFAULT '', + `src` varchar(80) NOT NULL DEFAULT '', + `dst` varchar(80) NOT NULL DEFAULT '', + `dcontext` varchar(80) NOT NULL DEFAULT '', + `channel` varchar(80) NOT NULL DEFAULT '', + `dst_channel` varchar(80) NOT NULL DEFAULT '', + `last_app` varchar(80) NOT NULL DEFAULT '', + `last_data` varchar(80) NOT NULL DEFAULT '', `duration` int(11) NOT NULL DEFAULT 0, `billsec` int(11) NOT NULL DEFAULT 0, - `disposition` varchar(45) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '', + `disposition` varchar(45) NOT NULL DEFAULT '', `ama_flags` int(11) NOT NULL DEFAULT 0, - `account_code` varchar(20) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '', - `unique_id` varchar(32) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '', - `user_field` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '', + `account_code` varchar(20) NOT NULL DEFAULT '', + `unique_id` varchar(32) NOT NULL DEFAULT '', + `user_field` varchar(255) NOT NULL DEFAULT '', PRIMARY KEY (`id`), KEY `calldate` (`call_date`), KEY `dst` (`dst`), @@ -14784,23 +14510,24 @@ DROP TABLE IF EXISTS `cdrConf`; /*!50001 DROP VIEW IF EXISTS `cdrConf`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `cdrConf` AS SELECT - 1 AS `calldate`, - 1 AS `clid`, - 1 AS `src`, - 1 AS `dst`, - 1 AS `dcontext`, - 1 AS `channel`, - 1 AS `dstchannel`, - 1 AS `lastapp`, - 1 AS `lastdata`, - 1 AS `duration`, - 1 AS `billsec`, - 1 AS `disposition`, - 1 AS `amaflags`, - 1 AS `accountcode`, - 1 AS `uniqueid`, - 1 AS `userfield` */; +/*!50001 CREATE TABLE `cdrConf` ( + `calldate` tinyint NOT NULL, + `clid` tinyint NOT NULL, + `src` tinyint NOT NULL, + `dst` tinyint NOT NULL, + `dcontext` tinyint NOT NULL, + `channel` tinyint NOT NULL, + `dstchannel` tinyint NOT NULL, + `lastapp` tinyint NOT NULL, + `lastdata` tinyint NOT NULL, + `duration` tinyint NOT NULL, + `billsec` tinyint NOT NULL, + `disposition` tinyint NOT NULL, + `amaflags` tinyint NOT NULL, + `accountcode` tinyint NOT NULL, + `uniqueid` tinyint NOT NULL, + `userfield` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -14813,7 +14540,7 @@ DROP TABLE IF EXISTS `config`; CREATE TABLE `config` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `sundayFestive` tinyint(4) NOT NULL, - `countryPrefix` varchar(20) CHARACTER SET utf8mb3 DEFAULT NULL, + `countryPrefix` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='Global configuration'; /*!40101 SET character_set_client = @saved_cs_client */; @@ -14826,8 +14553,8 @@ DROP TABLE IF EXISTS `followme`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `followme` ( - `extension` varchar(128) CHARACTER SET utf8mb3 NOT NULL, - `phone` varchar(20) CHARACTER SET utf8mb3 NOT NULL, + `extension` varchar(128) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, + `phone` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, PRIMARY KEY (`extension`), CONSTRAINT `followme_ibfk_1` FOREIGN KEY (`extension`) REFERENCES `sip` (`extension`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; @@ -14881,12 +14608,13 @@ DROP TABLE IF EXISTS `followmeConf`; /*!50001 DROP VIEW IF EXISTS `followmeConf`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `followmeConf` AS SELECT - 1 AS `name`, - 1 AS `music`, - 1 AS `context`, - 1 AS `takecall`, - 1 AS `declinecall` */; +/*!50001 CREATE TABLE `followmeConf` ( + `name` tinyint NOT NULL, + `music` tinyint NOT NULL, + `context` tinyint NOT NULL, + `takecall` tinyint NOT NULL, + `declinecall` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -14898,10 +14626,10 @@ DROP TABLE IF EXISTS `followmeConfig`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `followmeConfig` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `music` varchar(50) CHARACTER SET utf8mb3 DEFAULT NULL, - `context` varchar(50) CHARACTER SET utf8mb3 NOT NULL, - `takeCall` char(1) CHARACTER SET utf8mb3 NOT NULL, - `declineCall` char(1) CHARACTER SET utf8mb3 NOT NULL, + `music` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL, + `context` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, + `takeCall` char(1) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, + `declineCall` char(1) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, `timeout` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; @@ -14915,11 +14643,12 @@ DROP TABLE IF EXISTS `followmeNumberConf`; /*!50001 DROP VIEW IF EXISTS `followmeNumberConf`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `followmeNumberConf` AS SELECT - 1 AS `name`, - 1 AS `ordinal`, - 1 AS `phonenumber`, - 1 AS `timeout` */; +/*!50001 CREATE TABLE `followmeNumberConf` ( + `name` tinyint NOT NULL, + `ordinal` tinyint NOT NULL, + `phonenumber` tinyint NOT NULL, + `timeout` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -14931,8 +14660,8 @@ DROP TABLE IF EXISTS `queue`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `queue` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `description` varchar(128) CHARACTER SET utf8mb3 NOT NULL, - `name` varchar(128) CHARACTER SET utf8mb3 NOT NULL, + `description` varchar(128) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, + `name` varchar(128) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, `config` int(10) unsigned NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `name` (`name`), @@ -14990,14 +14719,15 @@ DROP TABLE IF EXISTS `queueConf`; /*!50001 DROP VIEW IF EXISTS `queueConf`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `queueConf` AS SELECT - 1 AS `name`, - 1 AS `strategy`, - 1 AS `timeout`, - 1 AS `retry`, - 1 AS `weight`, - 1 AS `maxlen`, - 1 AS `ringinuse` */; +/*!50001 CREATE TABLE `queueConf` ( + `name` tinyint NOT NULL, + `strategy` tinyint NOT NULL, + `timeout` tinyint NOT NULL, + `retry` tinyint NOT NULL, + `weight` tinyint NOT NULL, + `maxlen` tinyint NOT NULL, + `ringinuse` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -15009,7 +14739,7 @@ DROP TABLE IF EXISTS `queueConfig`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `queueConfig` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `strategy` varchar(128) CHARACTER SET utf8mb3 NOT NULL, + `strategy` varchar(128) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, `timeout` int(10) unsigned NOT NULL, `retry` int(10) unsigned NOT NULL, `weight` int(10) unsigned NOT NULL, @@ -15028,8 +14758,8 @@ DROP TABLE IF EXISTS `queueMember`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `queueMember` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `queue` varchar(128) CHARACTER SET utf8mb3 NOT NULL, - `extension` varchar(128) CHARACTER SET utf8mb3 NOT NULL, + `queue` varchar(128) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, + `extension` varchar(128) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `queue` (`queue`,`extension`), KEY `extension` (`extension`), @@ -15046,11 +14776,12 @@ DROP TABLE IF EXISTS `queueMemberConf`; /*!50001 DROP VIEW IF EXISTS `queueMemberConf`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `queueMemberConf` AS SELECT - 1 AS `uniqueid`, - 1 AS `queue_name`, - 1 AS `interface`, - 1 AS `paused` */; +/*!50001 CREATE TABLE `queueMemberConf` ( + `uniqueid` tinyint NOT NULL, + `queue_name` tinyint NOT NULL, + `interface` tinyint NOT NULL, + `paused` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -15062,8 +14793,8 @@ DROP TABLE IF EXISTS `queuePhone`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `queuePhone` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `queue` varchar(128) CHARACTER SET utf8mb3 NOT NULL, - `phone` varchar(128) CHARACTER SET utf8mb3 NOT NULL, + `queue` varchar(128) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, + `phone` varchar(128) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `queue` (`queue`,`phone`), CONSTRAINT `queuePhone_ibfk_1` FOREIGN KEY (`queue`) REFERENCES `queue` (`name`) ON DELETE CASCADE ON UPDATE CASCADE @@ -15122,7 +14853,7 @@ CREATE TABLE `schedule` ( `weekDay` tinyint(3) unsigned NOT NULL COMMENT '0 = Monday, 6 = Sunday', `timeStart` time NOT NULL, `timeEnd` time NOT NULL, - `queue` varchar(128) CHARACTER SET utf8mb3 NOT NULL, + `queue` varchar(128) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, PRIMARY KEY (`id`), KEY `queue` (`queue`), CONSTRAINT `schedule_ibfk_1` FOREIGN KEY (`queue`) REFERENCES `queue` (`name`) @@ -15138,10 +14869,10 @@ DROP TABLE IF EXISTS `sip`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `sip` ( `user_id` int(10) unsigned NOT NULL DEFAULT 0 COMMENT 'The user id', - `extension` varchar(128) CHARACTER SET utf8mb3 NOT NULL COMMENT 'The softphone extension', - `md5Secret` varchar(80) COLLATE utf8mb3_unicode_ci DEFAULT NULL COMMENT 'MD5 hash of extension and password', - `secret` varchar(80) CHARACTER SET utf8mb3 DEFAULT NULL COMMENT 'Deprecated', - `caller_id` varchar(80) CHARACTER SET utf8mb3 DEFAULT NULL COMMENT 'Deprecated', + `extension` varchar(128) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT 'The softphone extension', + `md5Secret` varchar(80) DEFAULT NULL COMMENT 'MD5 hash of extension and password', + `secret` varchar(80) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT 'Deprecated', + `caller_id` varchar(80) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT 'Deprecated', PRIMARY KEY (`user_id`), UNIQUE KEY `extension` (`extension`), CONSTRAINT `sip_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `account`.`user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE @@ -15246,31 +14977,32 @@ DROP TABLE IF EXISTS `sipConf`; /*!50001 DROP VIEW IF EXISTS `sipConf`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `sipConf` AS SELECT - 1 AS `id`, - 1 AS `name`, - 1 AS `callbackextension`, - 1 AS `md5secret`, - 1 AS `callerid`, - 1 AS `host`, - 1 AS `deny`, - 1 AS `permit`, - 1 AS `type`, - 1 AS `context`, - 1 AS `incominglimit`, - 1 AS `pickupgroup`, - 1 AS `careinvite`, - 1 AS `insecure`, - 1 AS `transport`, - 1 AS `nat`, - 1 AS `ipaddr`, - 1 AS `regseconds`, - 1 AS `port`, - 1 AS `defaultuser`, - 1 AS `useragent`, - 1 AS `lastms`, - 1 AS `fullcontact`, - 1 AS `regserver` */; +/*!50001 CREATE TABLE `sipConf` ( + `id` tinyint NOT NULL, + `name` tinyint NOT NULL, + `callbackextension` tinyint NOT NULL, + `md5secret` tinyint NOT NULL, + `callerid` tinyint NOT NULL, + `host` tinyint NOT NULL, + `deny` tinyint NOT NULL, + `permit` tinyint NOT NULL, + `type` tinyint NOT NULL, + `context` tinyint NOT NULL, + `incominglimit` tinyint NOT NULL, + `pickupgroup` tinyint NOT NULL, + `careinvite` tinyint NOT NULL, + `insecure` tinyint NOT NULL, + `transport` tinyint NOT NULL, + `nat` tinyint NOT NULL, + `ipaddr` tinyint NOT NULL, + `regseconds` tinyint NOT NULL, + `port` tinyint NOT NULL, + `defaultuser` tinyint NOT NULL, + `useragent` tinyint NOT NULL, + `lastms` tinyint NOT NULL, + `fullcontact` tinyint NOT NULL, + `regserver` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -15282,25 +15014,25 @@ DROP TABLE IF EXISTS `sipConfig`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `sipConfig` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, - `host` varchar(40) CHARACTER SET utf8mb3 DEFAULT NULL, - `deny` varchar(95) CHARACTER SET utf8mb3 NOT NULL, - `permit` varchar(95) CHARACTER SET utf8mb3 NOT NULL, - `type` enum('user','peer','friend') CHARACTER SET utf8mb3 NOT NULL, - `context` varchar(80) CHARACTER SET utf8mb3 NOT NULL, - `incomingLimit` varchar(10) CHARACTER SET utf8mb3 NOT NULL, - `pickupGroup` varchar(10) CHARACTER SET utf8mb3 NOT NULL, - `careInvite` varchar(10) CHARACTER SET utf8mb3 NOT NULL, - `insecure` varchar(45) COLLATE utf8mb3_unicode_ci NOT NULL, - `transport` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `avpf` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `icesupport` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `encryption` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `dtlsenable` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `dtlverify` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `dtlscertfile` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `dtlsprivatekey` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `dtlssetup` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `nat` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `host` varchar(40) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL, + `deny` varchar(95) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, + `permit` varchar(95) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, + `type` enum('user','peer','friend') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, + `context` varchar(80) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, + `incomingLimit` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, + `pickupGroup` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, + `careInvite` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, + `insecure` varchar(45) NOT NULL, + `transport` varchar(255) DEFAULT NULL, + `avpf` varchar(255) DEFAULT NULL, + `icesupport` varchar(255) DEFAULT NULL, + `encryption` varchar(255) DEFAULT NULL, + `dtlsenable` varchar(255) DEFAULT NULL, + `dtlverify` varchar(255) DEFAULT NULL, + `dtlscertfile` varchar(255) DEFAULT NULL, + `dtlsprivatekey` varchar(255) DEFAULT NULL, + `dtlssetup` varchar(255) DEFAULT NULL, + `nat` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='Default values for SIP accounts'; /*!40101 SET character_set_client = @saved_cs_client */; @@ -15314,14 +15046,14 @@ DROP TABLE IF EXISTS `sipReg`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `sipReg` ( `userId` int(10) unsigned NOT NULL, - `ipAddr` varchar(45) CHARACTER SET utf8mb3 DEFAULT NULL, + `ipAddr` varchar(45) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL, `regSeconds` bigint(20) unsigned DEFAULT NULL, - `port` varchar(50) CHARACTER SET utf8mb3 DEFAULT NULL, - `defaultUser` varchar(50) CHARACTER SET utf8mb3 DEFAULT NULL, - `userAgent` varchar(80) CHARACTER SET utf8mb3 DEFAULT NULL, - `lastMs` varchar(50) CHARACTER SET utf8mb3 DEFAULT NULL, - `fullContact` varchar(50) CHARACTER SET utf8mb3 DEFAULT NULL, - `regServer` varchar(20) CHARACTER SET utf8mb3 DEFAULT NULL, + `port` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL, + `defaultUser` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL, + `userAgent` varchar(80) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL, + `lastMs` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL, + `fullContact` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL, + `regServer` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL, PRIMARY KEY (`userId`), CONSTRAINT `sipReg_ibfk_1` FOREIGN KEY (`userId`) REFERENCES `sip` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='SIP registrations'; @@ -15334,8 +15066,6 @@ CREATE TABLE `sipReg` ( -- -- Dumping routines for database 'pbx' -- -/*!50003 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `clientFromPhone` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -15343,6 +15073,8 @@ CREATE TABLE `sipReg` ( /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `clientFromPhone`(vPhone VARCHAR(255)) RETURNS int(11) DETERMINISTIC @@ -15357,8 +15089,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `phone_format` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -15366,6 +15096,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `phone_format`(vPhone VARCHAR(255)) RETURNS varchar(255) CHARSET utf8 DETERMINISTIC @@ -15378,7 +15110,7 @@ BEGIN WHILE vI < vLen DO SET vChr = SUBSTR(vPhone, vI + 1, 1); - + IF vChr REGEXP '^[0-9]$' THEN SET vNewPhone = CONCAT(vNewPhone, vChr); @@ -15386,7 +15118,7 @@ BEGIN THEN SET vNewPhone = CONCAT(vNewPhone, '00'); END IF; - + SET vI = vI + 1; END WHILE; @@ -15405,8 +15137,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `phone_isValid` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -15414,6 +15144,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `phone_isValid`(vPhone VARCHAR(255)) BEGIN @@ -15440,8 +15172,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `queue_isValid` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -15449,6 +15179,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `queue_isValid`(vQueue VARCHAR(255)) BEGIN @@ -15473,8 +15205,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `sip_getExtension` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -15482,29 +15212,29 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `sip_getExtension`(vUserId INT(10)) BEGIN - + /* * Devuelve la extensión pbx del usuario - * - * @param vUserId Id del usuario - * + * + * @param vUserId Id del usuario + * */ SELECT extension - FROM sip s + FROM sip s WHERE s.user_id = vUserId; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `sip_isValid` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -15512,6 +15242,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `sip_isValid`(vExtension VARCHAR(255)) BEGIN @@ -15537,8 +15269,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `sip_setPassword` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -15546,6 +15276,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `sip_setPassword`( vUser VARCHAR(255), @@ -15590,7 +15322,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=utf8mb3; +) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -15604,7 +15336,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=utf8mb3; +) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -15618,7 +15350,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=utf8mb3; +) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -15629,11 +15361,12 @@ DROP TABLE IF EXISTS `calendar_employee`; /*!50001 DROP VIEW IF EXISTS `calendar_employee`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `calendar_employee` AS SELECT - 1 AS `id`, - 1 AS `businessFk`, - 1 AS `calendar_state_id`, - 1 AS `date` */; +/*!50001 CREATE TABLE `calendar_employee` ( + `id` tinyint NOT NULL, + `businessFk` tinyint NOT NULL, + `calendar_state_id` tinyint NOT NULL, + `date` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -15651,7 +15384,7 @@ CREATE TABLE `calendar_labour_type` ( `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=utf8mb3; +) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -15663,7 +15396,7 @@ DROP TABLE IF EXISTS `erte_COVID19`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `erte_COVID19` ( `personFk` int(11) NOT NULL, - `description` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `description` varchar(45) DEFAULT NULL, PRIMARY KEY (`personFk`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -15688,7 +15421,7 @@ CREATE TABLE `income_employee` ( KEY `income_employee_workerFk_idx` (`workerFk`), CONSTRAINT `income_employeeId_incomeType` FOREIGN KEY (`id_incomeType`) REFERENCES `vn2008`.`payroll_conceptos` (`conceptoid`) ON UPDATE CASCADE, CONSTRAINT `income_employee_workerFk` FOREIGN KEY (`workerFk`) REFERENCES `vn`.`worker` (`id`) ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3; +) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_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 */ ; @@ -15766,7 +15499,7 @@ CREATE TABLE `incometype_employee` ( `nomina` smallint(6) DEFAULT 0, `isExtraSalarial` tinyint(4) NOT NULL DEFAULT 0, PRIMARY KEY (`id_incometype`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -15786,7 +15519,7 @@ CREATE TABLE `journey` ( UNIQUE KEY `day_id` (`day_id`,`start`,`end`,`business_id`), KEY `journey_business_id_idx` (`business_id`), CONSTRAINT `journey_business_id` FOREIGN KEY (`business_id`) REFERENCES `vn`.`business` (`id`) ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3; +) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -15804,7 +15537,7 @@ CREATE TABLE `labour_agreement` ( `date_START` date DEFAULT NULL, `date_END` date DEFAULT NULL, PRIMARY KEY (`labour_agreement_id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3; +) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -15822,7 +15555,7 @@ CREATE TABLE `media` ( PRIMARY KEY (`media_id`), KEY `media_media_type_id_idx` (`media_type_id`), CONSTRAINT `media_ibfk_1` FOREIGN KEY (`media_type_id`) REFERENCES `media_type` (`media_type_id`) ON DELETE NO ACTION ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3; +) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -15837,7 +15570,7 @@ CREATE TABLE `media_type` ( `name` varchar(15) NOT NULL, PRIMARY KEY (`media_type_id`), UNIQUE KEY `media_type_name_key` (`name`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3; +) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -15856,7 +15589,7 @@ CREATE TABLE `professional_category` ( `dayBreak` int(11) DEFAULT NULL, PRIMARY KEY (`professional_category_id`), UNIQUE KEY `professional_category_name_category_key` (`category_name`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3; +) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -15871,7 +15604,7 @@ CREATE TABLE `professional_levels` ( `level_name` varchar(5) DEFAULT NULL, `price_overtime` double DEFAULT NULL, PRIMARY KEY (`professional_levels_id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3; +) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -15888,7 +15621,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=utf8mb3; +) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -15905,7 +15638,7 @@ CREATE TABLE `profile_media` ( PRIMARY KEY (`profile_media_id`), KEY `profile_media_media_id_idx` (`media_id`), CONSTRAINT `fk_profile_media_media1` FOREIGN KEY (`media_id`) REFERENCES `media` (`media_id`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3; +) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -15919,7 +15652,7 @@ CREATE TABLE `profile_type` ( `profile_type_id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(15) NOT NULL, PRIMARY KEY (`profile_type_id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3; +) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -15935,7 +15668,7 @@ CREATE TABLE `province` ( `nation_id` int(11) NOT NULL, PRIMARY KEY (`province_id`), UNIQUE KEY `province_name_key` (`name`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3; +) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -15953,7 +15686,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=utf8mb3; +) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -15966,9 +15699,9 @@ DROP TABLE IF EXISTS `workers20190711_FichadasAbril`; CREATE TABLE `workers20190711_FichadasAbril` ( `id` int(11) NOT NULL AUTO_INCREMENT, `person_id` int(11) NOT NULL DEFAULT 0, - `nif` varchar(15) CHARACTER SET utf8mb3 DEFAULT NULL, - `Apellidos` varchar(60) CHARACTER SET utf8mb3 NOT NULL, - `Nombre` varchar(20) CHARACTER SET utf8mb3 DEFAULT NULL, + `nif` varchar(15) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL, + `Apellidos` varchar(60) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, + `Nombre` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL, `Fecha` date DEFAULT NULL, `Hora` int(2) DEFAULT NULL, `Minuto` int(2) DEFAULT NULL, @@ -15990,7 +15723,7 @@ CREATE TABLE `workers20190711_FichadasAbril` ( -- Current Database: `sage` -- -CREATE DATABASE /*!32312 IF NOT EXISTS*/ `sage` /*!40100 DEFAULT CHARACTER SET utf8mb3 */; +CREATE DATABASE /*!32312 IF NOT EXISTS*/ `sage` /*!40100 DEFAULT CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci */; USE `sage`; @@ -16006,7 +15739,7 @@ CREATE TABLE `ClavesOperacion` ( `Descripcion` varchar(250) NOT NULL, PRIMARY KEY (`ClaveOperacionFactura_`), UNIQUE KEY `ClaveOperacionFactura__UNIQUE` (`ClaveOperacionFactura_`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -16026,7 +15759,7 @@ CREATE TABLE `Municipios` ( `Autonomia` smallint(6) NOT NULL, `Nacion` tinyint(4) NOT NULL, PRIMARY KEY (`Codigo`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -16040,16 +15773,16 @@ CREATE TABLE `Naciones` ( `countryFk` mediumint(8) NOT NULL, `CodigoNacion` smallint(6) NOT NULL DEFAULT 108, `CodigoNacion347` smallint(6) NOT NULL DEFAULT 108, - `Nacion` varchar(25) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '', - `SiglaNacion` varchar(2) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'ES', - `TipoCodigo` varchar(1) CHARACTER SET utf8mb3 NOT NULL DEFAULT 'A', + `Nacion` varchar(25) NOT NULL DEFAULT '', + `SiglaNacion` varchar(2) NOT NULL DEFAULT 'ES', + `TipoCodigo` varchar(1) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci 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, `FechaCEE` datetime DEFAULT NULL, - `NacionISO` varchar(3) CHARACTER SET utf8mb3 NOT NULL DEFAULT '', + `NacionISO` varchar(3) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT '', PRIMARY KEY (`countryFk`,`CodigoNacion`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -16068,7 +15801,7 @@ CREATE TABLE `Provincias` ( `Provincia` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '', `RecargoProvincial` decimal(28,10) NOT NULL DEFAULT 0.0000000000, PRIMARY KEY (`CodigoProvincia`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -16106,7 +15839,7 @@ CREATE TABLE `TiposIva` ( `IGICImplicito` smallint(6) NOT NULL DEFAULT 0, `isIntracommunity` tinyint(2) NOT NULL DEFAULT 0, PRIMARY KEY (`CodigoIva`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -16127,7 +15860,7 @@ CREATE TABLE `TiposRetencion` ( `CuentaAbonoANT_` varchar(15) DEFAULT NULL, `IdTipoRetencion` varchar(45) DEFAULT NULL, PRIMARY KEY (`CodigoRetencion`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -16144,7 +15877,7 @@ CREATE TABLE `TiposTransacciones` ( `Autofactura` smallint(6) NOT NULL DEFAULT 0, `ClaveOperacionDefecto` varchar(1) NOT NULL DEFAULT '', PRIMARY KEY (`CodigoTransaccion`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -16155,9 +15888,10 @@ DROP TABLE IF EXISTS `clientLastTwoMonths`; /*!50001 DROP VIEW IF EXISTS `clientLastTwoMonths`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `clientLastTwoMonths` AS SELECT - 1 AS `clientFk`, - 1 AS `companyFk` */; +/*!50001 CREATE TABLE `clientLastTwoMonths` ( + `clientFk` tinyint NOT NULL, + `companyFk` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -16169,39 +15903,39 @@ DROP TABLE IF EXISTS `clientesProveedores`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `clientesProveedores` ( `CodigoEmpresa` smallint(6) NOT NULL, - `ClienteOProveedor` varchar(1) COLLATE utf8mb3_unicode_ci NOT NULL, + `ClienteOProveedor` varchar(1) NOT NULL, `CodigoClienteProveedor` int(11) NOT NULL, - `RazonSocial` varchar(40) COLLATE utf8mb3_unicode_ci NOT NULL, - `RazonSocial2` varchar(40) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '', - `Nombre` varchar(35) COLLATE utf8mb3_unicode_ci NOT NULL, - `Domicilio` varchar(40) COLLATE utf8mb3_unicode_ci NOT NULL, - `Cargo1` varchar(15) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '', - `Nombre1` varchar(30) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '', - `Cargo2` varchar(15) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '', - `Nombre2` varchar(30) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '', - `CodigoCuenta` varchar(15) CHARACTER SET utf8mb3 NOT NULL, - `CifDni` varchar(13) COLLATE utf8mb3_unicode_ci NOT NULL, - `CifEuropeo` varchar(15) COLLATE utf8mb3_unicode_ci NOT NULL, - `CodigoSigla` varchar(2) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '', - `ViaPublica` varchar(40) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '', - `Numero1` varchar(4) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '', - `Numero2` varchar(4) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '', - `Escalera` varchar(2) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '', - `Piso` varchar(2) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '', - `Puerta` varchar(2) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '', - `Letra` varchar(2) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '', - `CodigoPostal` varchar(8) COLLATE utf8mb3_unicode_ci NOT NULL, - `CodigoMunicipio` varchar(7) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '', - `Municipio` varchar(25) COLLATE utf8mb3_unicode_ci NOT NULL, - `ColaMunicipio` varchar(15) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '', - `CodigoProvincia` varchar(5) COLLATE utf8mb3_unicode_ci NOT NULL, - `Provincia` varchar(20) COLLATE utf8mb3_unicode_ci NOT NULL, + `RazonSocial` varchar(40) NOT NULL, + `RazonSocial2` varchar(40) NOT NULL DEFAULT '', + `Nombre` varchar(35) NOT NULL, + `Domicilio` varchar(40) NOT NULL, + `Cargo1` varchar(15) NOT NULL DEFAULT '', + `Nombre1` varchar(30) NOT NULL DEFAULT '', + `Cargo2` varchar(15) NOT NULL DEFAULT '', + `Nombre2` varchar(30) NOT NULL DEFAULT '', + `CodigoCuenta` varchar(15) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, + `CifDni` varchar(13) NOT NULL, + `CifEuropeo` varchar(15) NOT NULL, + `CodigoSigla` varchar(2) NOT NULL DEFAULT '', + `ViaPublica` varchar(40) NOT NULL DEFAULT '', + `Numero1` varchar(4) NOT NULL DEFAULT '', + `Numero2` varchar(4) NOT NULL DEFAULT '', + `Escalera` varchar(2) NOT NULL DEFAULT '', + `Piso` varchar(2) NOT NULL DEFAULT '', + `Puerta` varchar(2) NOT NULL DEFAULT '', + `Letra` varchar(2) NOT NULL DEFAULT '', + `CodigoPostal` varchar(8) NOT NULL, + `CodigoMunicipio` varchar(7) NOT NULL DEFAULT '', + `Municipio` varchar(25) NOT NULL, + `ColaMunicipio` varchar(15) NOT NULL DEFAULT '', + `CodigoProvincia` varchar(5) NOT NULL, + `Provincia` varchar(20) NOT NULL, `CodigoNacion` smallint(6) NOT NULL DEFAULT 0, - `Nacion` varchar(25) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '', - `Telefono` varchar(15) COLLATE utf8mb3_unicode_ci NOT NULL, - `Telefono2` varchar(15) COLLATE utf8mb3_unicode_ci NOT NULL, - `Telefono3` varchar(15) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '', - `Fax` varchar(15) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '', + `Nacion` varchar(25) NOT NULL DEFAULT '', + `Telefono` varchar(15) NOT NULL, + `Telefono2` varchar(15) NOT NULL, + `Telefono3` varchar(15) NOT NULL DEFAULT '', + `Fax` varchar(15) NOT NULL DEFAULT '', `CodigoTransaccion` tinyint(4) NOT NULL DEFAULT 0, `CodigoRetencion` smallint(6) NOT NULL, `Deducible` smallint(6) NOT NULL DEFAULT 0, @@ -16219,30 +15953,30 @@ CREATE TABLE `clientesProveedores` ( `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 utf8mb3_unicode_ci NOT NULL DEFAULT '', + `RemesaHabitual` varchar(15) NOT NULL DEFAULT '', `CodigoTipoEfecto` smallint(6) NOT NULL DEFAULT 0, - `Email1` varchar(250) COLLATE utf8mb3_unicode_ci NOT NULL, - `Email2` varchar(250) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '', - `CodigoCategoriaCliente_` varchar(10) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'CLI', - `IdDelegacion` varchar(10) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '', - `CodigoMotivoBajaClienteLc` varchar(3) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '', - `CodigoDepartamento` varchar(10) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '', - `CodigoCanal` varchar(10) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '', - `CodigoBanco` varchar(6) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '', - `CodigoAgencia` varchar(6) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '', - `DC` varchar(2) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '', - `CCC` varchar(15) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '', - `IBAN` varchar(34) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '', + `Email1` varchar(250) NOT NULL, + `Email2` varchar(250) NOT NULL DEFAULT '', + `CodigoCategoriaCliente_` varchar(10) NOT NULL DEFAULT 'CLI', + `IdDelegacion` varchar(10) NOT NULL DEFAULT '', + `CodigoMotivoBajaClienteLc` varchar(3) NOT NULL DEFAULT '', + `CodigoDepartamento` varchar(10) NOT NULL DEFAULT '', + `CodigoCanal` varchar(10) NOT NULL DEFAULT '', + `CodigoBanco` varchar(6) NOT NULL DEFAULT '', + `CodigoAgencia` varchar(6) NOT NULL DEFAULT '', + `DC` varchar(2) NOT NULL DEFAULT '', + `CCC` varchar(15) NOT NULL DEFAULT '', + `IBAN` varchar(34) 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, - `Contrapartida` varchar(15) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '', - `CodigoCuentaImpagado` varchar(15) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '', - `CodigoCuentaEfecto` varchar(15) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '', - `Comentarios` text COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '', + `Contrapartida` varchar(15) NOT NULL DEFAULT '', + `CodigoCuentaImpagado` varchar(15) NOT NULL DEFAULT '', + `CodigoCuentaEfecto` varchar(15) NOT NULL DEFAULT '', + `Comentarios` text NOT NULL DEFAULT '', `CodigoTerritorio` smallint(6) NOT NULL DEFAULT 0, - `CodigoIdioma_` varchar(3) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '', + `CodigoIdioma_` varchar(3) 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, @@ -16250,43 +15984,43 @@ CREATE TABLE `clientesProveedores` ( `%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 utf8mb3_unicode_ci NOT NULL DEFAULT '', + `SiglaNacion` varchar(2) NOT NULL DEFAULT '', `MarcaMenorSinNif` smallint(6) NOT NULL DEFAULT 0, - `PersonaFisicaJuridica` varchar(1) COLLATE utf8mb3_unicode_ci NOT NULL, - `SiglaNacionRepresentante` varchar(2) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '', - `CifDniRepresentante` varchar(13) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '', - `NombreRepresentante` varchar(50) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '', + `PersonaFisicaJuridica` varchar(1) NOT NULL, + `SiglaNacionRepresentante` varchar(2) NOT NULL DEFAULT '', + `CifDniRepresentante` varchar(13) NOT NULL DEFAULT '', + `NombreRepresentante` varchar(50) NOT NULL DEFAULT '', `TipoDocumentoPersona` smallint(6) NOT NULL, - `TipoCif` varchar(1) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '', - `MotivoBajaClienteLc` varchar(30) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '', + `TipoCif` varchar(1) NOT NULL DEFAULT '', + `MotivoBajaClienteLc` varchar(30) NOT NULL DEFAULT '', `PuntosSR` decimal(28,10) NOT NULL DEFAULT 0.0000000000, - `TarjetaSR` varchar(100) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '', + `TarjetaSR` varchar(100) NOT NULL DEFAULT '', `FechaNacimiento` datetime DEFAULT NULL, - `Domicilio2` varchar(40) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '', - `CuentaProvision` varchar(15) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '', + `Domicilio2` varchar(40) NOT NULL DEFAULT '', + `CuentaProvision` varchar(15) NOT NULL DEFAULT '', `CodigoTransportista` int(11) NOT NULL DEFAULT 0, - `FormadePago` varchar(35) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '', - `ObservacionesCliente` varchar(50) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '', - `CodigoTipoClienteLc` varchar(3) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '', - `TipoCliente` varchar(10) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '', - `CodigoActividadLc` varchar(2) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '', - `Actividad` varchar(50) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '', - `IndicadorIva` varchar(1) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '', - `CodigoRuta_` varchar(10) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '', - `NombreEmpleado` varchar(10) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '', - `PrimerApellidoEmpleado` varchar(15) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '', - `SegundoApellidoEmpleado` varchar(15) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '', + `FormadePago` varchar(35) NOT NULL DEFAULT '', + `ObservacionesCliente` varchar(50) NOT NULL DEFAULT '', + `CodigoTipoClienteLc` varchar(3) NOT NULL DEFAULT '', + `TipoCliente` varchar(10) NOT NULL DEFAULT '', + `CodigoActividadLc` varchar(2) NOT NULL DEFAULT '', + `Actividad` varchar(50) NOT NULL DEFAULT '', + `IndicadorIva` varchar(1) NOT NULL DEFAULT '', + `CodigoRuta_` varchar(10) NOT NULL DEFAULT '', + `NombreEmpleado` varchar(10) NOT NULL DEFAULT '', + `PrimerApellidoEmpleado` varchar(15) NOT NULL DEFAULT '', + `SegundoApellidoEmpleado` varchar(15) 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, - `ReferenciaMandato` varchar(35) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '', + `ReferenciaMandato` varchar(35) 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, - `CodigoSeccion` varchar(10) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '', - `CodigoSector_` varchar(10) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '', - `CodigoProyecto` varchar(10) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '', + `CodigoSeccion` varchar(10) NOT NULL DEFAULT '', + `CodigoSector_` varchar(10) NOT NULL DEFAULT '', + `CodigoProyecto` varchar(10) NOT NULL DEFAULT '', PRIMARY KEY (`CodigoEmpresa`,`ClienteOProveedor`,`CodigoClienteProveedor`), KEY `CodigoCuenta` (`CodigoCuenta`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; @@ -16303,7 +16037,7 @@ CREATE TABLE `config` ( `id` int(11) NOT NULL AUTO_INCREMENT, `pendingTaxAccount` varchar(100) DEFAULT NULL COMMENT 'Cuenta contable IVA pendiente', PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3; +) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -16314,14 +16048,15 @@ DROP TABLE IF EXISTS `invoiceInList`; /*!50001 DROP VIEW IF EXISTS `invoiceInList`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `invoiceInList` AS SELECT - 1 AS `id`, - 1 AS `supplierRef`, - 1 AS `serial`, - 1 AS `supplierFk`, - 1 AS `issued`, - 1 AS `isVatDeductible`, - 1 AS `serialNumber` */; +/*!50001 CREATE TABLE `invoiceInList` ( + `id` tinyint NOT NULL, + `supplierRef` tinyint NOT NULL, + `serial` tinyint NOT NULL, + `supplierFk` tinyint NOT NULL, + `issued` tinyint NOT NULL, + `isVatDeductible` tinyint NOT NULL, + `serialNumber` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -16337,7 +16072,7 @@ CREATE TABLE `invoiceType` ( PRIMARY KEY (`code`), UNIQUE KEY `code_UNIQUE` (`code`), UNIQUE KEY `codeSage_UNIQUE` (`codeSage`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -16349,40 +16084,40 @@ DROP TABLE IF EXISTS `movConta`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `movConta` ( `OrdenMovimientos` int(11) NOT NULL AUTO_INCREMENT, - `MovPosicion` varchar(64) COLLATE utf8mb3_unicode_ci NOT NULL, + `MovPosicion` varchar(64) NOT NULL, `Ejercicio` smallint(6) NOT NULL, `CodigoEmpresa` smallint(6) NOT NULL, `Asiento` int(11) NOT NULL, - `CargoAbono` varchar(1) COLLATE utf8mb3_unicode_ci NOT NULL, - `CodigoCuenta` varchar(15) CHARACTER SET utf8mb3 NOT NULL, - `Contrapartida` varchar(15) COLLATE utf8mb3_unicode_ci NOT NULL, + `CargoAbono` varchar(1) NOT NULL, + `CodigoCuenta` varchar(15) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, + `Contrapartida` varchar(15) NOT NULL, `FechaAsiento` datetime NOT NULL, - `TipoDocumento` varchar(6) COLLATE utf8mb3_unicode_ci NOT NULL, - `DocumentoConta` varchar(9) COLLATE utf8mb3_unicode_ci NOT NULL, - `Comentario` varchar(40) COLLATE utf8mb3_unicode_ci NOT NULL, + `TipoDocumento` varchar(6) NOT NULL, + `DocumentoConta` varchar(9) NOT NULL, + `Comentario` varchar(40) NOT NULL, `ImporteAsiento` decimal(28,10) NOT NULL, `CodigoDiario` smallint(6) NOT NULL, - `CodigoCanal` varchar(10) COLLATE utf8mb3_unicode_ci NOT NULL, - `CodigoActividad` varchar(1) COLLATE utf8mb3_unicode_ci NOT NULL, + `CodigoCanal` varchar(10) NOT NULL, + `CodigoActividad` varchar(1) NOT NULL, `FechaVencimiento` datetime DEFAULT NULL, `NumeroPeriodo` smallint(6) NOT NULL, `CodigoUsuario` smallint(6) NOT NULL, `FechaGrabacion` datetime NOT NULL, - `TipoEntrada` varchar(2) COLLATE utf8mb3_unicode_ci NOT NULL, - `CodigoDepartamento` varchar(10) COLLATE utf8mb3_unicode_ci NOT NULL, - `CodigoSeccion` varchar(10) COLLATE utf8mb3_unicode_ci NOT NULL, - `CodigoDivisa` varchar(3) COLLATE utf8mb3_unicode_ci NOT NULL, + `TipoEntrada` varchar(2) NOT NULL, + `CodigoDepartamento` varchar(10) NOT NULL, + `CodigoSeccion` varchar(10) NOT NULL, + `CodigoDivisa` varchar(3) NOT NULL, `ImporteCambio` decimal(28,10) NOT NULL, `ImporteDivisa` decimal(28,10) NOT NULL, `FactorCambio` decimal(28,10) NOT NULL, - `CodigoProyecto` varchar(10) COLLATE utf8mb3_unicode_ci NOT NULL, + `CodigoProyecto` varchar(10) NOT NULL, `LibreN1` int(11) NOT NULL, `LibreN2` int(11) NOT NULL, - `LibreA1` varchar(15) COLLATE utf8mb3_unicode_ci NOT NULL, - `LibreA2` varchar(15) COLLATE utf8mb3_unicode_ci NOT NULL, - `IdDelegacion` varchar(10) COLLATE utf8mb3_unicode_ci NOT NULL, - `MovCartera` varchar(64) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `IdProcesoIME` varchar(64) COLLATE utf8mb3_unicode_ci NOT NULL, + `LibreA1` varchar(15) NOT NULL, + `LibreA2` varchar(15) NOT NULL, + `IdDelegacion` varchar(10) NOT NULL, + `MovCartera` varchar(64) DEFAULT NULL, + `IdProcesoIME` varchar(64) NOT NULL, `TipoCarteraIME` smallint(6) NOT NULL, `TipoAnaliticaIME` smallint(6) NOT NULL, `StatusTraspasadoIME` tinyint(4) NOT NULL, @@ -16416,64 +16151,64 @@ CREATE TABLE `movConta` ( `RecargoEquivalencia4` decimal(28,10) NOT NULL, `CodigoTransaccion4` tinyint(4) NOT NULL, `Año` smallint(6) NOT NULL, - `Serie` varchar(10) COLLATE utf8mb3_unicode_ci NOT NULL, + `Serie` varchar(10) NOT NULL, `Factura` int(11) NOT NULL, - `SuFacturaNo` varchar(40) COLLATE utf8mb3_unicode_ci NOT NULL, + `SuFacturaNo` varchar(40) NOT NULL, `FechaFactura` datetime NOT NULL, `ImporteFactura` decimal(28,10) NOT NULL, - `TipoFactura` varchar(1) COLLATE utf8mb3_unicode_ci NOT NULL, - `CodigoCuentaFactura` varchar(15) COLLATE utf8mb3_unicode_ci NOT NULL, - `CifDni` varchar(13) COLLATE utf8mb3_unicode_ci NOT NULL, - `Nombre` varchar(35) COLLATE utf8mb3_unicode_ci NOT NULL, + `TipoFactura` varchar(1) NOT NULL, + `CodigoCuentaFactura` varchar(15) NOT NULL, + `CifDni` varchar(13) NOT NULL, + `Nombre` varchar(35) NOT NULL, `CodigoRetencion` smallint(6) NOT NULL, `BaseRetencion` decimal(28,10) NOT NULL, `PorRetencion` decimal(28,10) NOT NULL, `ImporteRetencion` decimal(28,10) NOT NULL, `AbonoIva` smallint(6) NOT NULL, - `CodigoActividadF` varchar(1) COLLATE utf8mb3_unicode_ci NOT NULL, + `CodigoActividadF` varchar(1) NOT NULL, `Intracomunitaria` smallint(6) NOT NULL, `CodigoTerritorio` smallint(6) NOT NULL, - `SiglaNacion` varchar(2) COLLATE utf8mb3_unicode_ci NOT NULL, + `SiglaNacion` varchar(2) NOT NULL, `RetencionInformativa` smallint(6) NOT NULL, `EjercicioFacturaOriginal` smallint(6) NOT NULL, - `SerieFacturaOriginal` varchar(10) COLLATE utf8mb3_unicode_ci NOT NULL, + `SerieFacturaOriginal` varchar(10) NOT NULL, `NumeroFacturaOriginal` int(11) NOT NULL, `EjercicioFactura` smallint(6) NOT NULL, - `CobroPagoRetencion` varchar(1) COLLATE utf8mb3_unicode_ci NOT NULL, + `CobroPagoRetencion` varchar(1) NOT NULL, `FechaOperacion` datetime NOT NULL, `Exclusion347` smallint(6) NOT NULL, - `MovIdentificadorIME` varchar(64) COLLATE utf8mb3_unicode_ci NOT NULL, - `Previsiones` varchar(1) COLLATE utf8mb3_unicode_ci NOT NULL, + `MovIdentificadorIME` varchar(64) NOT NULL, + `Previsiones` varchar(1) NOT NULL, `MantenerAsiento` tinyint(4) NOT NULL, `OrdenMovIME` smallint(6) NOT NULL, `Metalico347` smallint(6) NOT NULL, - `ClaveOperacionFactura_` varchar(1) COLLATE utf8mb3_unicode_ci NOT NULL, - `SerieAgrupacion_` varchar(10) COLLATE utf8mb3_unicode_ci NOT NULL, + `ClaveOperacionFactura_` varchar(1) NOT NULL, + `SerieAgrupacion_` varchar(10) NOT NULL, `NumeroFacturaInicial_` int(11) NOT NULL, `NumeroFacturaFinal_` int(11) NOT NULL, - `IdAsientoExterno` text COLLATE utf8mb3_unicode_ci NOT NULL, - `IdDiarioExterno` varchar(10) COLLATE utf8mb3_unicode_ci NOT NULL, - `IdFacturaExterno` text COLLATE utf8mb3_unicode_ci NOT NULL, - `IdMovimiento` varchar(40) COLLATE utf8mb3_unicode_ci NOT NULL, + `IdAsientoExterno` varchar(50) NOT NULL, + `IdDiarioExterno` varchar(10) NOT NULL, + `IdFacturaExterno` varchar(50) NOT NULL, + `IdMovimiento` varchar(40) NOT NULL, `IdCuadre` smallint(6) NOT NULL, `FechaCuadre` datetime NOT NULL, - `TipoCuadre` varchar(4) COLLATE utf8mb3_unicode_ci NOT NULL, + `TipoCuadre` varchar(4) NOT NULL, `AgrupacionCuadre` int(11) NOT NULL, `StatusSaldo` smallint(6) NOT NULL, `StatusConciliacion` smallint(6) NOT NULL, `CodigoConciliacion` int(11) NOT NULL, `FechaConciliacion` datetime NOT NULL, `TipoConciliacion` smallint(6) NOT NULL, - `IndicadorContaBanco` varchar(1) COLLATE utf8mb3_unicode_ci NOT NULL, - `Descripcion3` varchar(40) COLLATE utf8mb3_unicode_ci NOT NULL, - `Descripcion4` varchar(40) COLLATE utf8mb3_unicode_ci NOT NULL, - `Descripcion5` varchar(40) COLLATE utf8mb3_unicode_ci NOT NULL, - `Descripcion6` varchar(40) COLLATE utf8mb3_unicode_ci NOT NULL, - `Descripcion7` varchar(40) COLLATE utf8mb3_unicode_ci NOT NULL, - `Descripcion8` text COLLATE utf8mb3_unicode_ci NOT NULL, - `Descripcion9` text COLLATE utf8mb3_unicode_ci NOT NULL, - `Descripcion2` text COLLATE utf8mb3_unicode_ci NOT NULL, - `Descripcion1` text COLLATE utf8mb3_unicode_ci NOT NULL, + `IndicadorContaBanco` varchar(1) NOT NULL, + `Descripcion3` varchar(40) NOT NULL, + `Descripcion4` varchar(40) NOT NULL, + `Descripcion5` varchar(40) NOT NULL, + `Descripcion6` varchar(40) NOT NULL, + `Descripcion7` varchar(40) NOT NULL, + `Descripcion8` varchar(50) NOT NULL, + `Descripcion9` varchar(50) NOT NULL, + `Descripcion2` varchar(250) NOT NULL, + `Descripcion1` varchar(250) NOT NULL, `Punteo1` smallint(6) NOT NULL, `Punteo9` smallint(6) NOT NULL, `Punteo8` smallint(6) NOT NULL, @@ -16490,13 +16225,13 @@ CREATE TABLE `movConta` ( `CriterioIva` tinyint(4) NOT NULL, `FechaMaxVencimiento` datetime NOT NULL, `TipoCriterioCaja` tinyint(4) NOT NULL, - `MovFacturaOrigenIME` text COLLATE utf8mb3_unicode_ci NOT NULL, - `IdFacturaExternoFinal` text COLLATE utf8mb3_unicode_ci NOT NULL, - `IdFacturaExternoInicial` text COLLATE utf8mb3_unicode_ci NOT NULL, - `IdFacturaExternoOriginal` text COLLATE utf8mb3_unicode_ci NOT NULL, + `MovFacturaOrigenIME` varchar(50) NOT NULL, + `IdFacturaExternoFinal` varchar(50) NOT NULL, + `IdFacturaExternoInicial` varchar(50) NOT NULL, + `IdFacturaExternoOriginal` varchar(50) NOT NULL, `NumFacturasExternoAgrupacion` int(11) NOT NULL, - `CodigoMedioCobro` varchar(1) COLLATE utf8mb3_unicode_ci NOT NULL, - `MedioCobro` varchar(31) COLLATE utf8mb3_unicode_ci NOT NULL, + `CodigoMedioCobro` varchar(1) NOT NULL, + `MedioCobro` varchar(31) NOT NULL, `IvaDeducible1` smallint(6) NOT NULL DEFAULT 1, `IvaDeducible2` smallint(6) NOT NULL DEFAULT 1, `IvaDeducible3` smallint(6) NOT NULL DEFAULT 1, @@ -16507,7 +16242,7 @@ CREATE TABLE `movConta` ( `CuotaIvaOriginal` decimal(28,10) NOT NULL, `ClaseAbonoRectificativas` smallint(6) NOT NULL, `RecargoEquivalenciaOriginal` decimal(28,10) NOT NULL, - `ObjetoFactura` text COLLATE utf8mb3_unicode_ci NOT NULL, + `ObjetoFactura` varchar(500) NOT NULL, `enlazadoSage` tinyint(1) NOT NULL DEFAULT 0, PRIMARY KEY (`OrdenMovimientos`,`LibreN1`), KEY `ix_movconta2` (`IdProcesoIME`), @@ -16516,8 +16251,30 @@ CREATE TABLE `movConta` ( KEY `ix_movconta` (`enlazadoSage`,`IdProcesoIME`), KEY `movConta_IdProcesoIME` (`IdProcesoIME`), KEY `movConta_Asiento2` (`Asiento`,`IdProcesoIME`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; +) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_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 */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8mb4 */ ; +/*!50003 SET character_set_results = utf8mb4 */ ; +/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; +DELIMITER ;; +/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `sage`.`movConta_BEFORE_UPDATE` + BEFORE UPDATE ON `movConta` + FOR EACH ROW +BEGIN + IF NEW.enlazadoSage = TRUE THEN + UPDATE vn.XDiario SET enlazadoSage = TRUE WHERE ASIEN = NEW.Asiento; + END IF; +END */;; +DELIMITER ; +/*!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 */ ; -- -- Table structure for table `movContaIVA` @@ -16528,7 +16285,7 @@ DROP TABLE IF EXISTS `movContaIVA`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `movContaIVA` ( `id` int(11) NOT NULL, - `CodigoDivisa` varchar(3) COLLATE utf8mb3_unicode_ci NOT NULL, + `CodigoDivisa` varchar(3) NOT NULL, `BaseIva1` double DEFAULT NULL, `PorBaseCorrectora1` double DEFAULT NULL, `PorIva1` double DEFAULT NULL, @@ -16562,33 +16319,33 @@ CREATE TABLE `movContaIVA` ( `CodigoTransaccion4` double NOT NULL DEFAULT 0, `CodigoIva4` smallint(6) NOT NULL, `Año` int(11) DEFAULT NULL, - `Serie` varchar(10) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `Serie` varchar(10) DEFAULT NULL, `Factura` int(11) DEFAULT NULL, - `SuFacturaNo` varchar(40) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `SuFacturaNo` varchar(40) DEFAULT NULL, `FechaFactura` date DEFAULT NULL, `ImporteFactura` double DEFAULT NULL, - `TipoFactura` varchar(1) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `CodigoCuentaFactura` varchar(15) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `CifDni` varchar(13) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `Nombre` varchar(35) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `TipoFactura` varchar(1) DEFAULT NULL, + `CodigoCuentaFactura` varchar(15) DEFAULT NULL, + `CifDni` varchar(13) DEFAULT NULL, + `Nombre` varchar(35) DEFAULT NULL, `CodigoRetencion` int(2) DEFAULT NULL, `BaseRetencion` double DEFAULT NULL, `PorRetencion` double DEFAULT NULL, `ImporteRetencion` double DEFAULT NULL, - `SiglaNacion` varchar(2) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'ES', + `SiglaNacion` varchar(2) NOT NULL DEFAULT 'ES', `EjercicioFactura` int(2) DEFAULT NULL, `FechaOperacion` date DEFAULT NULL, `Exclusion347` int(2) DEFAULT NULL, `MantenerAsiento` int(2) DEFAULT -1, `Metalico347` int(2) DEFAULT NULL, - `ClaveOperacionFactura` varchar(1) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `ClaveOperacionFactura` varchar(1) DEFAULT NULL, `TipoRectificativa` int(2) DEFAULT NULL, `FechaFacturaOriginal` date DEFAULT NULL, `CuotaIvaOriginal` double DEFAULT NULL, `BaseImponibleOriginal` double DEFAULT NULL, `ClaseAbonoRectificativas` int(2) DEFAULT NULL, `RecargoEquivalenciaOriginal` double DEFAULT NULL, - `LibreA1` varchar(15) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `LibreA1` varchar(15) DEFAULT NULL, `IvaDeducible1` int(2) NOT NULL DEFAULT -1, `IvaDeducible2` int(2) NOT NULL DEFAULT -1, `IvaDeducible3` int(2) NOT NULL DEFAULT -1, @@ -16615,7 +16372,7 @@ CREATE TABLE `pgcToSage` ( `accountTaxInput` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL, `accountTaxOutput` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COMMENT='Tabla relaciona cuentas pgc con Código de IVA y Código de Transacción en Sage'; +) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci 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 */; -- @@ -16627,25 +16384,25 @@ DROP TABLE IF EXISTS `planCuentasPGC`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `planCuentasPGC` ( `CodigoEmpresa` smallint(6) NOT NULL, - `CodigoCuenta` varchar(15) CHARACTER SET utf8mb3 NOT NULL, - `Cuenta` varchar(50) COLLATE utf8mb3_unicode_ci NOT NULL, - `ClienteOProveedor` varchar(1) COLLATE utf8mb3_unicode_ci NOT NULL, - `CodigoDivisa` varchar(3) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '', + `CodigoCuenta` varchar(15) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, + `Cuenta` varchar(50) NOT NULL, + `ClienteOProveedor` varchar(1) NOT NULL, + `CodigoDivisa` varchar(3) NOT NULL DEFAULT '', `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 utf8mb3_unicode_ci NOT NULL DEFAULT '', + `AnaCodigoCuenta` varchar(15) NOT NULL DEFAULT '', `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 utf8mb3_unicode_ci NOT NULL DEFAULT '', + `CuentaPatrimonio_` varchar(15) NOT NULL DEFAULT '', `CuentaVarios` smallint(6) NOT NULL DEFAULT 0, `TodasLasActividades` smallint(6) NOT NULL DEFAULT 0, - `ValorDelegacion` varchar(10) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '', - `ValorDepartamento` varchar(10) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '', - `ValorProyecto` varchar(10) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '', - `ValorCanal` varchar(10) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '', - `ValorSeccion` varchar(10) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '', + `ValorDelegacion` varchar(10) NOT NULL DEFAULT '', + `ValorDepartamento` varchar(10) NOT NULL DEFAULT '', + `ValorProyecto` varchar(10) NOT NULL DEFAULT '', + `ValorCanal` varchar(10) NOT NULL DEFAULT '', + `ValorSeccion` varchar(10) NOT NULL DEFAULT '', PRIMARY KEY (`CodigoEmpresa`,`CodigoCuenta`), KEY `CodigoCuenta` (`CodigoCuenta`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; @@ -16659,9 +16416,10 @@ DROP TABLE IF EXISTS `supplierLastThreeMonths`; /*!50001 DROP VIEW IF EXISTS `supplierLastThreeMonths`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `supplierLastThreeMonths` AS SELECT - 1 AS `supplierFk`, - 1 AS `companyFk` */; +/*!50001 CREATE TABLE `supplierLastThreeMonths` ( + `supplierFk` tinyint NOT NULL, + `companyFk` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -16671,8 +16429,6 @@ SET character_set_client = @saved_cs_client; -- -- Dumping routines for database 'sage' -- -/*!50003 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `company_getCode` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -16680,27 +16436,29 @@ SET character_set_client = @saved_cs_client; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `company_getCode`(vCompanyFk INT) RETURNS int(2) READS SQL DATA BEGIN /** - * Devuelve la correspondencía del código de empresa de sage. + * Devuelve la correspondencía del código de empresa de sage. * Tiene en cuenta el entorno - * + * * @param vSelf Id de empresa de verdnatura * @return Código de empresa sage */ DECLARE vCompanySageFk INT(2); - - SELECT IF(c.environment = 'production', - co.companyCode, + + SELECT IF(c.environment = 'production', + co.companyCode, co.companyCodeTest ) INTO vCompanySageFk FROM util.config c JOIN vn.company co WHERE co.id = vCompanyFk; - + RETURN vCompanySageFk; END ;; DELIMITER ; @@ -16708,15 +16466,15 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `accountingMovements_add` */; /*!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 = utf8mb4 */ ; -/*!50003 SET character_set_results = utf8mb4 */ ; -/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET character_set_client = utf8mb3 */ ; +/*!50003 SET character_set_results = utf8mb3 */ ; +/*!50003 SET collation_connection = utf8mb3_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `accountingMovements_add`(vYear INT, vCompanyFk INT) BEGIN @@ -17118,7 +16876,7 @@ BEGIN AND ImporteAsiento < 0; -- Comprobación que los importes e ivas sean correctos, avisa vía CAU - SELECT GROUP_CONCAT(Asiento ORDER BY Asiento ASC SEPARATOR ' \n\r') INTO vBookEntries + SELECT GROUP_CONCAT(Asiento ORDER BY Asiento ASC SEPARATOR ',') INTO vBookEntries FROM(SELECT sub.Asiento FROM (SELECT mc.Asiento, SUM(mc.ImporteAsiento) amount FROM movConta mc @@ -17148,11 +16906,7 @@ BEGIN AND sub.amountTaxableBase/2 <> sub2.amountTaxableBase) sub; IF vBookEntries IS NOT NULL THEN - CALL vn.mail_insert('cau@verdnatura.es, administracion@verdnatura.es', - 'noreply@verdnatura.es', - CONCAT('Asientos contables importados incorrectamente'), - CONCAT('

Existen asientos que difieren entre la info. de XDiario y la que se ha importado a Sage.

- Asientos nº ', vBookEntries, '
')); + SELECT util.notification_send ("book-entries-imported-incorrectly", CONCAT('{"bookEntries":"', vBookEntries,'"}'), null); END IF; END ;; DELIMITER ; @@ -17160,8 +16914,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `clientSupplier_add` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -17169,22 +16921,24 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `clientSupplier_add`(vCompanyFk INT) BEGIN /** - * Prepara los datos de clientes y proveedores para exportarlos a Sage + * Prepara los datos de clientes y proveedores para exportarlos a Sage * @vCompanyFk Empresa dela que se quiere trasladar datos */ DECLARE vCountryCeutaMelillaFk INT; DECLARE vCountryCanariasCode, vCountryCeutaMelillaCode VARCHAR(2); SELECT SiglaNacion INTO vCountryCanariasCode - FROM Naciones + FROM Naciones WHERE Nacion ='ISLAS CANARIAS'; SELECT CodigoNacion, SiglaNacion INTO vCountryCeutaMelillaFk, vCountryCeutaMelillaCode - FROM Naciones + FROM Naciones WHERE Nacion ='CEUTA Y MELILLA'; TRUNCATE TABLE clientesProveedores; @@ -17215,7 +16969,7 @@ BEGIN CodigoRetencion, Email1, iban) - SELECT + SELECT company_getCode(vCompanyFk), 'C', c.id, @@ -17232,12 +16986,12 @@ BEGIN IF(n.SiglaNacion = vCountryCanariasCode COLLATE utf8mb3_unicode_ci, IF(@isCeutaMelilla := IF(pr.Provincia IN ('CEUTA', 'MELILLA'), TRUE, FALSE), vCountryCeutaMelillaFk, IF (@isCanarias, vCountryCanariasCode, n.CodigoNacion)), n.CodigoNacion), IF(n.SiglaNacion = vCountryCanariasCode COLLATE utf8mb3_unicode_ci, IF(@isCeutaMelilla, vCountryCeutaMelillaCode, IF (@isCanarias, vCountryCanariasCode, n.SiglaNacion)), n.SiglaNacion), IF((c.fi REGEXP '^([[:blank:]]|[[:digit:]])'), 'J','F'), - IF(cu.code IN('ES','EX'), - 1, + IF(cu.code IN('ES','EX'), + 1, IF((cu.isUeeMember AND c.isVies), 2, 4)), IFNULL(c.taxTypeSageFk,0), - IF(n.SiglaNacion = vCountryCanariasCode COLLATE utf8mb3_unicode_ci, - IF(@isCeutaMelilla, 'CEUTA Y MELILLA', IF (@isCanarias, 'ISLAS CANARIAS', n.Nacion)), + IF(n.SiglaNacion = vCountryCanariasCode COLLATE utf8mb3_unicode_ci, + IF(@isCeutaMelilla, 'CEUTA Y MELILLA', IF (@isCanarias, 'ISLAS CANARIAS', n.Nacion)), n.Nacion), IFNULL(c.phone, ''), IFNULL(c.mobile, ''), @@ -17251,7 +17005,7 @@ BEGIN LEFT JOIN Naciones n ON n.countryFk = cu.id LEFT JOIN vn.province p ON p.id = c.provinceFk LEFT JOIN Provincias pr ON pr.provinceFk = p.id - WHERE c.isRelevant + WHERE c.isRelevant AND clm.companyFk = vCompanyFk UNION ALL SELECT company_getCode(vCompanyFk), @@ -17280,15 +17034,15 @@ BEGIN IFNULL(SUBSTR(sc.email, 1, (COALESCE(NULLIF(LOCATE(',', sc.email), 0), 99) - 1)), ''), IFNULL(iban, '') FROM vn.supplier s - JOIN supplierLastThreeMonths pl ON pl.supplierFk = s.id + JOIN supplierLastThreeMonths pl ON pl.supplierFk = s.id LEFT JOIN vn.country co ON co.id = s.countryFk LEFT JOIN Naciones n ON n.countryFk = co.id LEFT JOIN vn.province p ON p.id = s.provinceFk LEFT JOIN Provincias pr ON pr.provinceFk = p.id LEFT JOIN vn.supplierContact sc ON sc.supplierFk = s.id LEFT JOIN vn.supplierAccount sa ON sa.supplierFk = s.id - WHERE pl.companyFk = vCompanyFk AND - s.isActive AND + WHERE pl.companyFk = vCompanyFk AND + s.isActive AND s.nif <> '' GROUP BY pl.supplierFk, pl.companyFk; END ;; @@ -17297,8 +17051,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `invoiceIn_add` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -17306,15 +17058,17 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `invoiceIn_add`(vInvoiceInFk INT, vXDiarioFk INT) BEGIN /** * Traslada la info de contabilidad relacionada con las facturas recibidas - * + * * @vInvoiceInFk Factura recibida * @vXDiarioFk Id tabla XDiario - */ + */ DECLARE vDone BOOL DEFAULT FALSE; DECLARE vBase DOUBLE; DECLARE vVat DOUBLE; @@ -17330,24 +17084,24 @@ BEGIN DECLARE vInvoiceTypeReceived VARCHAR(1); DECLARE vInvoiceTypeInformative VARCHAR(1); - DECLARE vCursor CURSOR FOR + DECLARE vCursor CURSOR FOR SELECT it.taxableBase, CAST((( it.taxableBase / 100) * t.PorcentajeIva) AS DECIMAL (10,2)), t.PorcentajeIva, it.transactionTypeSageFk, it.taxTypeSageFk, t.isIntracommunity, - tt.ClaveOperacionDefecto + tt.ClaveOperacionDefecto FROM vn.invoiceIn i - JOIN vn.invoiceInTax it ON it.InvoiceInFk = i.id + JOIN vn.invoiceInTax it ON it.InvoiceInFk = i.id JOIN TiposIva t ON t.CodigoIva = it.taxTypeSageFk JOIN TiposTransacciones tt ON tt.CodigoTransaccion = it.transactionTypeSageFk LEFT JOIN vn.dua d ON d.id = vInvoiceInFk - WHERE i.id = vInvoiceInFk + WHERE i.id = vInvoiceInFk AND d.id IS NULL; - + DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE; - + DELETE FROM movContaIVA WHERE id = vXDiarioFk; @@ -17370,22 +17124,22 @@ BEGIN vTaxCode, vIsIntracommunity, vOperationCode; - - IF vDone THEN + + IF vDone THEN LEAVE l; END IF; - SET vTransactionCodeOld = vTransactionCode; - SET vTaxCodeOld = vTaxCode; + SET vTransactionCodeOld = vTransactionCode; + SET vTaxCodeOld = vTaxCode; - IF vOperationCode IS NOT NULL THEN + IF vOperationCode IS NOT NULL THEN UPDATE movContaIVA SET ClaveOperacionFactura = vOperationCode WHERE id = vXDiarioFk; END IF; - + SET vCounter = vCounter + 1; - CASE vCounter + CASE vCounter WHEN 1 THEN UPDATE movContaIVA SET BaseIva1 = vBase, @@ -17421,21 +17175,21 @@ BEGIN WHERE id = vXDiarioFk; ELSE SELECT vXDiarioFk INTO vXDiarioFk; - END CASE; + END CASE; IF vIsIntracommunity THEN UPDATE movContaIVA SET Intracomunitaria = TRUE WHERE id = vXDiarioFk; END IF; - - SET vTransactionCodeOld = vTransactionCode; - SET vTaxCodeOld = vTaxCode; - + + SET vTransactionCodeOld = vTransactionCode; + SET vTaxCodeOld = vTaxCode; + END LOOP; CLOSE vCursor; - + UPDATE movContaIVA mci JOIN tmp.invoiceIn ii ON ii.id = vInvoiceInFk JOIN vn.XDiario x ON x.id = mci.id @@ -17447,11 +17201,11 @@ BEGIN mci.Serie = ii.serial, mci.Factura = ii.serialNumber, mci.FechaFactura = ii.issued, - mci.ImporteFactura = IFNULL(mci.BaseIva1, 0) + IFNULL(mci.CuotaIva1, 0) + - IFNULL(mci.BaseIva2, 0) + IFNULL(mci.CuotaIva2, 0) + - IFNULL(mci.BaseIva3, 0) + IFNULL(mci.CuotaIva3, 0) + + mci.ImporteFactura = IFNULL(mci.BaseIva1, 0) + IFNULL(mci.CuotaIva1, 0) + + IFNULL(mci.BaseIva2, 0) + IFNULL(mci.CuotaIva2, 0) + + IFNULL(mci.BaseIva3, 0) + IFNULL(mci.CuotaIva3, 0) + IFNULL(mci.BaseIva4, 0) + IFNULL(mci.CuotaIva4, 0), - mci.TipoFactura = IF(id.id, IF( ii.serial = vSerialDua COLLATE utf8mb3_unicode_ci, vInvoiceTypeReceived, vInvoiceTypeInformative), vInvoiceTypeReceived), + mci.TipoFactura = IF(id.id, IF( ii.serial = vSerialDua COLLATE utf8mb3_unicode_ci, vInvoiceTypeReceived, vInvoiceTypeInformative), vInvoiceTypeReceived), mci.CodigoCuentaFactura = x.SUBCTA, mci.CifDni = IF(LEFT(TRIM(s.nif), 2) = n.SiglaNacion, SUBSTRING(TRIM(s.nif), 3), s.nif), mci.Nombre = s.name, @@ -17479,7 +17233,7 @@ BEGIN JOIN (SELECT SUM(x2.BASEEURO) taxableBase, SUM(x2.EURODEBE) taxBase FROM vn.XDiario x1 JOIN vn.XDiario x2 ON x1.ASIEN = x2.ASIEN - WHERE x2.BASEEURO <> 0 + WHERE x2.BASEEURO <> 0 AND x1.id = vXDiarioFk )sub JOIN ClavesOperacion co ON co.Descripcion = 'Arrendamiento de locales de negocio' @@ -17487,8 +17241,8 @@ BEGIN mci.ClaveOperacionFactura = IF( t.Retencion = 'ARRENDAMIENTO Y SUBARRENDAMIENTO', co.ClaveOperacionFactura_, mci.ClaveOperacionFactura), mci.BaseRetencion = IF (t.Retencion = 'ACTIVIDADES AGRICOLAS O GANADERAS', sub.taxableBase + sub.taxBase, sub.taxableBase), mci.PorRetencion = t.PorcentajeRetencion, - mci.ImporteRetencion = iit.taxableBase * - 1 - WHERE mci.id = vXDiarioFk + mci.ImporteRetencion = iit.taxableBase * - 1 + WHERE mci.id = vXDiarioFk AND e.name = 'Retenciones' AND id.id IS NULL; @@ -17498,8 +17252,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `invoiceIn_manager` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -17507,14 +17259,16 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `invoiceIn_manager`(vYear INT, vCompanyFk INT) BEGIN /** - * Traslada la info de contabilidad relacionada con las facturas recibidas - * + * Traslada la info de contabilidad relacionada con las facturas recibidas + * * @vYear Año contable del que se quiere trasladar la información - * @vCompany Empresa de la que se quiere trasladar datos + * @vCompany Empresa de la que se quiere trasladar datos */ DECLARE vDone BOOL DEFAULT FALSE; DECLARE vInvoiceFk INT; @@ -17526,22 +17280,22 @@ BEGIN DECLARE vAccountTaxOutstanding VARCHAR(10); DECLARE vInvoiceTypeSended VARCHAR(1); DECLARE vCursor CURSOR FOR - SELECT IFNULL(x.CLAVE, x.FACTURA) invoiceInFk, + SELECT IFNULL(x.CLAVE, x.FACTURA) invoiceInFk, x.id XDiarioFk - FROM vn.XDiario x + FROM vn.XDiario x JOIN(SELECT DISTINCT(x.ASIEN) FROM vn.XDiario x LEFT JOIN vn.invoiceIn ii ON x.CLAVE = ii.id LEFT JOIN vn.invoiceInTax it ON it.invoiceInFk = ii.id - WHERE(it.taxTypeSageFk IS NOT NULL OR x.SERIE = vSerialDua COLLATE utf8mb3_unicode_ci) - AND x.enlazadoSage = FALSE + WHERE(it.taxTypeSageFk IS NOT NULL OR x.SERIE = vSerialDua COLLATE utf8mb3_unicode_ci) + AND x.enlazadoSage = FALSE AND x.FECHA BETWEEN vDatedFrom AND vDatedTo - AND x.empresa_id = vCompanyFk + AND x.empresa_id = vCompanyFk ) sub ON sub.ASIEN = x.ASIEN WHERE x.CLAVE IS NOT NULL; DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE; - + SELECT CAST(CONCAT(vYear, '-01-01') AS DATETIME), util.dayEnd(CAST(CONCAT(vYear, '-12-31') AS DATE)) INTO vDatedFrom, vDatedTo; @@ -17555,15 +17309,15 @@ BEGIN SELECT codeSage INTO vInvoiceTypeSended FROM invoiceType WHERE `code` ='sended'; - + DROP TEMPORARY TABLE IF EXISTS tmp.invoiceDua; CREATE TEMPORARY TABLE tmp.invoiceDua - SELECT x.id + SELECT x.id FROM vn.XDiario x JOIN vn.company c ON c.id = x.empresa_id JOIN (SELECT ASIEN - FROM vn.XDiario x - WHERE x.enlazadoSage = FALSE + FROM vn.XDiario x + WHERE x.enlazadoSage = FALSE AND x.SUBCTA = vAccountTaxOutstanding COLLATE utf8mb3_unicode_ci AND x.FECHA BETWEEN vDatedFrom AND vDatedTo )sub ON sub.ASIEN = x.ASIEN @@ -17582,7 +17336,7 @@ BEGIN FROM vn.invoiceIn i JOIN vn.currency c ON c.id = i.currencyFk WHERE i.bookEntried BETWEEN vDatedFrom AND vDatedTo - UNION ALL + UNION ALL SELECT d.id, d.code, vSerialDua, @@ -17591,8 +17345,8 @@ BEGIN FALSE, d.id, '' -- EUROS - FROM vn.dua d - WHERE d.issued IS NOT NULL + FROM vn.dua d + WHERE d.issued IS NOT NULL AND code IS NOT NULL; OPEN vCursor; @@ -17600,7 +17354,7 @@ BEGIN l: LOOP FETCH vCursor INTO vInvoiceFk, vXDiarioFk; - IF vDone THEN + IF vDone THEN LEAVE l; END IF; CALL invoiceIn_add(vInvoiceFk, vXDiarioFk); @@ -17688,21 +17442,21 @@ BEGIN JOIN (SELECT x.ASIEN, x.id FROM vn.XDiario x JOIN(SELECT DISTINCT(x.ASIEN) ASIEN - FROM vn.XDiario x + FROM vn.XDiario x JOIN (SELECT DISTINCT(ASIEN) FROM vn.XDiario x - WHERE SUBCTA LIKE '472%' + WHERE SUBCTA LIKE '472%' AND x.enlazadoSage = FALSE AND x.empresa_id = vCompanyFk AND x.FECHA BETWEEN vDatedFrom AND vDatedTo ) sub ON sub.ASIEN = x.ASIEN WHERE x.SUBCTA LIKE '477%' )sub2 ON sub2.ASIEN = x.ASIEN - WHERE x.CONTRA IS NOT NULL + WHERE x.CONTRA IS NOT NULL AND x.SUBCTA LIKE '477%' GROUP BY x.ASIEN )sub3 ON sub3.ASIEN = x.ASIEN; - + INSERT INTO movContaIVA (`id`, `CodigoDivisa`, @@ -17773,9 +17527,9 @@ BEGIN `FechaGrabacion`, `Intracomunitaria`, `moveData`) - SELECT * + SELECT * FROM tmp.movContaIVA; - + DROP TEMPORARY TABLE tmp.movContaIVA; END ;; @@ -17784,8 +17538,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `invoiceOut_add` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -17793,14 +17545,16 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `invoiceOut_add`(IN vInvoiceOutFk INT, IN vXDiarioFk INT) BEGIN /** - * Traslada la info de contabilidad relacionada con las facturas emitidas - * + * Traslada la info de contabilidad relacionada con las facturas emitidas + * * @vYear Año contable del que se quiere trasladar la información - * @vCompany Empresa de la que se quiere trasladar datos + * @vCompany Empresa de la que se quiere trasladar datos */ DECLARE vDone BOOL DEFAULT FALSE; DECLARE vMaxLengthName INT DEFAULT 35; @@ -17820,12 +17574,12 @@ BEGIN DECLARE vHasCustomsAccountingNote BOOL; DECLARE vCursor CURSOR FOR - SELECT oit.taxableBase, - oit.vat, - pgc.rate, - pgc.mod347, - pgcRE.rate, - oitRE.vat, + SELECT oit.taxableBase, + oit.vat, + pgc.rate, + pgc.mod347, + pgcRE.rate, + oitRE.vat, tc.transactionCode, tc.taxCode, tc.isIntracommunity, @@ -17834,7 +17588,7 @@ BEGIN JOIN vn.pgc ON pgc.code = oit.pgcFk LEFT JOIN vn.pgcEqu e ON e.vatFk = oit.pgcFk LEFT JOIN vn.pgcEqu eRE ON eRE.equFk = oit.pgcFk - LEFT JOIN vn.invoiceOutTax oitRE ON oitRE.invoiceOutFk = oit.invoiceOutFk + LEFT JOIN vn.invoiceOutTax oitRE ON oitRE.invoiceOutFk = oit.invoiceOutFk AND oitRE.pgcFk = e.equFk LEFT JOIN vn.pgc pgcRE ON pgcRE.code = oitRE.pgcFk LEFT JOIN vn.taxCode tc ON tc.code = pgc.code COLLATE 'utf8mb3_unicode_ci' @@ -17850,12 +17604,12 @@ BEGIN WHERE ASIEN = (SELECT ASIEN FROM vn.XDiario WHERE id = vXDiarioFk); SELECT codeSage INTO vInvoiceTypeSended - FROM invoiceType + FROM invoiceType WHERE code = IF(vHasCustomsAccountingNote, 'informative', 'sended'); - + DELETE FROM movContaIVA WHERE id = vXDiarioFk; - + INSERT INTO movContaIVA(id) VALUES (vXDiarioFk); OPEN vCursor; @@ -17872,13 +17626,13 @@ BEGIN vIsIntracommunity, vOperationCode; - IF vDone THEN + IF vDone THEN LEAVE l; END IF; SET vCounter = vCounter + 1; - - CASE vCounter + + CASE vCounter WHEN 1 THEN UPDATE movContaIVA SET BaseIva1 = vBase, @@ -17919,7 +17673,7 @@ BEGIN CodigoTransaccion4 = vTransactionCode, CodigoIva4 = vTaxCode WHERE id = vXDiarioFk; - END CASE; + END CASE; UPDATE movContaIVA SET Exclusion347 = NOT vMod347, @@ -17930,7 +17684,7 @@ BEGIN END LOOP; CLOSE vCursor; - + UPDATE movContaIVA mci JOIN vn.invoiceOut i ON i.id = vInvoiceOutFk LEFT JOIN vn.invoiceCorrection ic ON ic.correctedFk = vInvoiceOutFk @@ -17955,25 +17709,25 @@ BEGIN mci.MantenerAsiento = TRUE, mci.FechaFacturaOriginal = x.FECHA_EX WHERE mci.id = vXDiarioFk; - + SELECT correctedFk INTO vInvoiceOutCorrectedFk FROM vn.invoiceCorrection WHERE correctingFk = vInvoiceOutFk; - - IF vInvoiceOutCorrectedFk THEN + + IF vInvoiceOutCorrectedFk THEN UPDATE movContaIVA mci JOIN vn.invoiceOut i ON i.id = vInvoiceOutCorrectedFk JOIN vn.invoiceCorrection ic ON ic.correctedFk = vInvoiceOutCorrectedFk - JOIN (SELECT SUM(IF(IFNULL(e.vatFk, TRUE), iot.taxableBase, 0)) taxableBase, + JOIN (SELECT SUM(IF(IFNULL(e.vatFk, TRUE), iot.taxableBase, 0)) taxableBase, SUM(IF(IFNULL(e.vatFk, TRUE), iot.vat, 0)) vat, SUM(IF(IFNULL(e.vatFk, TRUE), 0, iot.vat)) equ FROM vn.invoiceOutTax iot - LEFT JOIN vn.pgcEqu e ON e.vatFk = iot.pgcFk + LEFT JOIN vn.pgcEqu e ON e.vatFk = iot.pgcFk WHERE iot.invoiceOutFk = vInvoiceOutCorrectedFk ) tax JOIN ClavesOperacion co ON co.Descripcion = 'Factura rectificativa' SET mci.TipoRectificativa = 2, - mci.ClaseAbonoRectificativas = 1, + mci.ClaseAbonoRectificativas = 1, mci.FechaFacturaOriginal = i.issued, mci.FechaOperacion = i.issued, mci.BaseImponibleOriginal = tax.taxableBase, @@ -17991,8 +17745,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `invoiceOut_manager` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -18000,14 +17752,16 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `invoiceOut_manager`(vYear INT, vCompanyFk INT) BEGIN /** - * Traslada la info de contabilidad relacionada con las facturas emitidas - * + * Traslada la info de contabilidad relacionada con las facturas emitidas + * * @vYear Año contable del que se quiere trasladar la información - * @vCompany Empresa de la que se quiere trasladar datos + * @vCompany Empresa de la que se quiere trasladar datos */ DECLARE vDone BOOL DEFAULT FALSE; DECLARE vInvoiceFk INT; @@ -18024,7 +17778,7 @@ BEGIN JOIN (SELECT x.ASIEN, CONCAT(x.SERIE, x.FACTURA) refFk FROM vn.XDiario x WHERE x.enlazadoSage = FALSE - AND x.FACTURA + AND x.FACTURA AND x.empresa_id = vCompanyFk AND x.FECHA BETWEEN vDatedFrom AND vDatedTo GROUP BY refFk @@ -18033,19 +17787,19 @@ BEGIN )sub2 ON sub2.refFk = i.ref; DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE; - + SELECT CAST(CONCAT(vYear, '-01-01') AS DATETIME), util.dayEnd(CAST(CONCAT(vYear, '-12-31') AS DATE)) INTO vDatedFrom, vDatedTo; - + OPEN vCursor; l: LOOP FETCH vCursor INTO vInvoiceFk, vXDiarioFk; - IF vDone THEN + IF vDone THEN LEAVE l; END IF; - + CALL invoiceOut_add(vInvoiceFk, vXDiarioFk); END LOOP; @@ -18058,8 +17812,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `pgc_add` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -18067,11 +17819,13 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `pgc_add`(vCompanyFk INT) BEGIN /** - * Añade cuentas del plan general contable para exportarlos a Sage + * Añade cuentas del plan general contable para exportarlos a Sage * @vCompanyFk Empresa de la que se quiere trasladar datos */ TRUNCATE TABLE planCuentasPGC; @@ -18081,25 +17835,25 @@ BEGIN CodigoCuenta, Cuenta, ClienteOProveedor) - SELECT * + SELECT * FROM (SELECT company_getCode(vCompanyFk) companyFk, e.id accountFk, UCASE(e.name), '' FROM vn.expence e - UNION + UNION SELECT company_getCode(vCompanyFk), - b.account, + b.account, UCASE(b.bank), - '' + '' FROM vn.bank b WHERE b.isActive AND b.`account` - UNION + UNION SELECT CodigoEmpresa, CodigoCuenta, Nombre, - ClienteOProveedor + ClienteOProveedor FROM clientesProveedores)sub GROUP BY companyFk, accountFk; END ;; @@ -18126,12 +17880,12 @@ DROP TABLE IF EXISTS `ACL`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `ACL` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `model` varchar(512) CHARACTER SET utf8mb3 DEFAULT NULL, - `property` varchar(512) CHARACTER SET utf8mb3 DEFAULT NULL, - `accessType` set('READ','WRITE','*') COLLATE utf8mb3_unicode_ci DEFAULT 'READ', - `permission` set('DENY','ALLOW') COLLATE utf8mb3_unicode_ci DEFAULT 'ALLOW', - `principalType` set('ROLE','USER') COLLATE utf8mb3_unicode_ci DEFAULT 'ROLE', - `principalId` varchar(512) CHARACTER SET utf8mb3 DEFAULT NULL, + `model` varchar(512) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL, + `property` varchar(512) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL, + `accessType` set('READ','WRITE','*') DEFAULT 'READ', + `permission` set('DENY','ALLOW') DEFAULT 'ALLOW', + `principalType` set('ROLE','USER') DEFAULT 'ROLE', + `principalId` varchar(512) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL, PRIMARY KEY (`id`), KEY `model_ix` (`model`(255)) COMMENT 'ernesto 3.8.2020. Mysql pide indices', KEY `property_ix` (`property`(255)), @@ -18147,9 +17901,9 @@ DROP TABLE IF EXISTS `AccessToken`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `AccessToken` ( - `id` varchar(255) CHARACTER SET utf8mb3 NOT NULL, + `id` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, `ttl` int(11) DEFAULT NULL, - `scopes` varchar(255) CHARACTER SET utf8mb3 DEFAULT NULL, + `scopes` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL, `created` datetime DEFAULT NULL, `userId` int(11) DEFAULT NULL, PRIMARY KEY (`id`) @@ -18164,15 +17918,16 @@ DROP TABLE IF EXISTS `Account`; /*!50001 DROP VIEW IF EXISTS `Account`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `Account` AS SELECT - 1 AS `id`, - 1 AS `name`, - 1 AS `password`, - 1 AS `roleFk`, - 1 AS `active`, - 1 AS `email`, - 1 AS `created`, - 1 AS `updated` */; +/*!50001 CREATE TABLE `Account` ( + `id` tinyint NOT NULL, + `name` tinyint NOT NULL, + `password` tinyint NOT NULL, + `roleFk` tinyint NOT NULL, + `active` tinyint NOT NULL, + `email` tinyint NOT NULL, + `created` tinyint NOT NULL, + `updated` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -18183,12 +17938,13 @@ DROP TABLE IF EXISTS `Role`; /*!50001 DROP VIEW IF EXISTS `Role`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `Role` AS SELECT - 1 AS `id`, - 1 AS `name`, - 1 AS `description`, - 1 AS `created`, - 1 AS `modified` */; +/*!50001 CREATE TABLE `Role` ( + `id` tinyint NOT NULL, + `name` tinyint NOT NULL, + `description` tinyint NOT NULL, + `created` tinyint NOT NULL, + `modified` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -18199,11 +17955,12 @@ DROP TABLE IF EXISTS `RoleMapping`; /*!50001 DROP VIEW IF EXISTS `RoleMapping`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `RoleMapping` AS SELECT - 1 AS `id`, - 1 AS `principalType`, - 1 AS `principalId`, - 1 AS `roleId` */; +/*!50001 CREATE TABLE `RoleMapping` ( + `id` tinyint NOT NULL, + `principalType` tinyint NOT NULL, + `principalId` tinyint NOT NULL, + `roleId` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -18214,14 +17971,15 @@ DROP TABLE IF EXISTS `User`; /*!50001 DROP VIEW IF EXISTS `User`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `User` AS SELECT - 1 AS `id`, - 1 AS `realm`, - 1 AS `username`, - 1 AS `password`, - 1 AS `email`, - 1 AS `emailVerified`, - 1 AS `verificationToken` */; +/*!50001 CREATE TABLE `User` ( + `id` tinyint NOT NULL, + `realm` tinyint NOT NULL, + `username` tinyint NOT NULL, + `password` tinyint NOT NULL, + `email` tinyint NOT NULL, + `emailVerified` tinyint NOT NULL, + `verificationToken` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -18232,8 +17990,8 @@ DROP TABLE IF EXISTS `defaultViewConfig`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `defaultViewConfig` ( - `tableCode` varchar(25) COLLATE utf8mb3_unicode_ci NOT NULL, - `columns` text COLLATE utf8mb3_unicode_ci NOT NULL + `tableCode` varchar(25) NOT NULL, + `columns` text NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='The default configuration of columns for views'; /*!40101 SET character_set_client = @saved_cs_client */; @@ -18246,10 +18004,10 @@ DROP TABLE IF EXISTS `fieldAcl`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `fieldAcl` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `model` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `property` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `actionType` set('insert','update','*') COLLATE utf8mb3_unicode_ci DEFAULT '*', - `role` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `model` varchar(255) DEFAULT NULL, + `property` varchar(255) DEFAULT NULL, + `actionType` set('insert','update','*') DEFAULT '*', + `role` varchar(45) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -18262,7 +18020,7 @@ DROP TABLE IF EXISTS `module`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `module` ( - `code` varchar(45) COLLATE utf8mb3_unicode_ci NOT NULL, + `code` varchar(45) NOT NULL, PRIMARY KEY (`code`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -18276,8 +18034,8 @@ DROP TABLE IF EXISTS `printConfig`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `printConfig` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `itRecipient` varchar(50) COLLATE utf8mb3_unicode_ci DEFAULT NULL COMMENT 'IT recipients for report mailing', - `incidencesEmail` varchar(50) COLLATE utf8mb3_unicode_ci DEFAULT NULL COMMENT 'CAU destinatary email', + `itRecipient` varchar(50) DEFAULT NULL COMMENT 'IT recipients for report mailing', + `incidencesEmail` varchar(50) DEFAULT NULL COMMENT 'CAU destinatary email', PRIMARY KEY (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='Print service config'; /*!40101 SET character_set_client = @saved_cs_client */; @@ -18290,9 +18048,9 @@ DROP TABLE IF EXISTS `url`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `url` ( - `appName` varchar(100) COLLATE utf8mb3_unicode_ci NOT NULL, - `environment` varchar(100) COLLATE utf8mb3_unicode_ci NOT NULL, - `url` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL, + `appName` varchar(100) NOT NULL, + `environment` varchar(100) NOT NULL, + `url` varchar(255) NOT NULL, PRIMARY KEY (`appName`,`environment`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -18307,8 +18065,8 @@ DROP TABLE IF EXISTS `userConfigView`; CREATE TABLE `userConfigView` ( `id` int(11) NOT NULL AUTO_INCREMENT, `userFk` int(10) unsigned NOT NULL, - `tableCode` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL, - `configuration` text COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `tableCode` varchar(255) NOT NULL, + `configuration` text DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `uniqueUser_TableCode` (`userFk`,`tableCode`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; @@ -18326,7 +18084,7 @@ CREATE TABLE `userConfigView` ( -- Current Database: `stock` -- -CREATE DATABASE /*!32312 IF NOT EXISTS*/ `stock` /*!40100 DEFAULT CHARACTER SET utf8mb3 */; +CREATE DATABASE /*!32312 IF NOT EXISTS*/ `stock` /*!40100 DEFAULT CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci */; USE `stock`; @@ -18353,7 +18111,7 @@ CREATE TABLE `inbound` ( UNIQUE KEY `source` (`tableName`,`tableId`), KEY `warehouseFk` (`warehouseFk`,`itemFk`,`dated`,`expired`,`available`), KEY `isSync` (`isSync`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_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 */ ; @@ -18369,7 +18127,7 @@ DELIMITER ;; FOR EACH ROW BEGIN SET NEW.isPicked = NEW.isPicked OR NEW.dated < util.VN_CURDATE(); - + CALL visible_log( NEW.isPicked, NEW.warehouseFk, @@ -18431,7 +18189,7 @@ CREATE TABLE `inboundPick` ( PRIMARY KEY (`inboundFk`,`outboundFk`,`quantity`), UNIQUE KEY `buyFk` (`inboundFk`,`outboundFk`), KEY `saleFk` (`outboundFk`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -18448,7 +18206,7 @@ CREATE TABLE `log` ( `tableId` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `tableName` (`tableName`,`tableId`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -18476,7 +18234,7 @@ CREATE TABLE `outbound` ( KEY `warehouseFk` (`warehouseFk`,`itemFk`,`dated`), KEY `expired` (`expired`), KEY `isSync` (`isSync`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_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 */ ; @@ -18493,7 +18251,7 @@ DELIMITER ;; BEGIN SET NEW.lack = NEW.quantity; SET NEW.isPicked = NEW.isPicked OR NEW.dated < util.VN_CURDATE(); - + CALL visible_log( NEW.isPicked, NEW.warehouseFk, @@ -18553,7 +18311,7 @@ CREATE TABLE `visible` ( `warehouseFk` int(10) unsigned NOT NULL, `quantity` int(11) NOT NULL, PRIMARY KEY (`itemFk`,`warehouseFk`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -18565,14 +18323,14 @@ DELIMITER ;; /*!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 = utf8mb4 */ ;; -/*!50003 SET character_set_results = utf8mb4 */ ;; -/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;; +/*!50003 SET character_set_client = utf8mb3 */ ;; +/*!50003 SET character_set_results = utf8mb3 */ ;; +/*!50003 SET collation_connection = utf8mb3_general_ci */ ;; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;; /*!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 `log_clean` ON SCHEDULE EVERY 1 DAY STARTS '2022-01-28 09:29:18' ON COMPLETION PRESERVE ENABLE DO CALL log_clean */ ;; +/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `log_clean` ON SCHEDULE EVERY 1 DAY STARTS '2022-01-28 09:29:18' ON COMPLETION PRESERVE DISABLE ON SLAVE DO CALL log_clean */ ;; /*!50003 SET time_zone = @saved_time_zone */ ;; /*!50003 SET sql_mode = @saved_sql_mode */ ;; /*!50003 SET character_set_client = @saved_cs_client */ ;; @@ -18602,8 +18360,6 @@ DELIMITER ; -- -- Dumping routines for database 'stock' -- -/*!50003 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `inbound_addPick` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -18611,6 +18367,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `inbound_addPick`( vSelf INT, @@ -18631,8 +18389,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `inbound_removePick` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -18640,6 +18396,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `inbound_removePick`( vSelf INT, @@ -18664,8 +18422,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `inbound_requestQuantity` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -18673,6 +18429,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `inbound_requestQuantity`( vSelf INT, @@ -18704,7 +18462,7 @@ BEGIN DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE; - + SET vSupplied = 0; OPEN vPicks; @@ -18720,7 +18478,7 @@ BEGIN SET vPickGranted = LEAST(vRequested - vSupplied, vPickQuantity); SET vSupplied = vSupplied + vPickGranted; CALL inbound_removePick(vSelf, vOutboundFk, vPickGranted, vPickQuantity); - + UPDATE outbound SET isSync = FALSE, lack = lack + vPickGranted @@ -18738,8 +18496,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `inbound_sync` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -18747,6 +18503,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `inbound_sync`(vSelf INT) BEGIN @@ -18800,7 +18558,7 @@ BEGIN END IF; SET vSupplied = LEAST(vAvailable, vLack); - + IF vSupplied > 0 THEN SET vAvailable = vAvailable - vSupplied; UPDATE outbound @@ -18813,7 +18571,7 @@ BEGIN SET vSupplied = vSupplied + vSuppliedFromRequest; SET vAvailable = vAvailable - vSuppliedFromRequest; END IF; - + IF vSupplied > 0 THEN CALL inbound_addPick(vSelf, vOutboundFk, vSupplied); END IF; @@ -18835,8 +18593,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `log_add` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -18844,6 +18600,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `log_add`(IN `vTableName` VARCHAR(255), IN `vNewId` VARCHAR(255), IN `vOldId` VARCHAR(255)) proc: BEGIN @@ -18869,8 +18627,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `log_clean` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -18878,6 +18634,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `log_clean`() BEGIN @@ -18889,8 +18647,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `log_delete` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -18898,6 +18654,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `log_delete`(vTableName VARCHAR(255), vTableId INT) proc: BEGIN @@ -18921,8 +18679,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `log_refreshAll` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -18930,6 +18686,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `log_refreshAll`() BEGIN @@ -18942,7 +18700,7 @@ BEGIN DO RELEASE_LOCK('stock.log_sync'); RESIGNAL; END; - + IF !GET_LOCK('stock.log_sync', 30) THEN CALL util.throw('Lock timeout exceeded'); END IF; @@ -18967,8 +18725,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `log_refreshBuy` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -18976,6 +18732,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `log_refreshBuy`( `vTableName` VARCHAR(255), @@ -19054,8 +18812,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `log_refreshOrder` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -19063,6 +18819,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `log_refreshOrder`( `vTableName` VARCHAR(255), @@ -19114,8 +18872,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `log_refreshSale` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -19123,6 +18879,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `log_refreshSale`( `vTableName` VARCHAR(255), @@ -19192,8 +18950,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `log_sync` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -19201,6 +18957,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `log_sync`(vSync BOOL) proc: BEGIN @@ -19328,8 +19086,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `log_syncNoWait` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -19337,6 +19093,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `log_syncNoWait`() BEGIN @@ -19357,8 +19115,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `outbound_requestQuantity` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -19366,6 +19122,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `outbound_requestQuantity`( vSelf INT, @@ -19413,7 +19171,7 @@ BEGIN SET vPickGranted = LEAST(vRequested - vSupplied, vPickQuantity); SET vSupplied = vSupplied + vPickGranted; CALL inbound_removePick(vInboundFk, vSelf, vPickGranted, vPickQuantity); - + UPDATE inbound SET isSync = FALSE, available = available + vPickGranted @@ -19431,8 +19189,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `outbound_sync` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -19440,6 +19196,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `outbound_sync`(vSelf INT) BEGIN @@ -19522,8 +19280,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `visible_log` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -19531,6 +19287,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `visible_log`( vIsPicked BOOL, @@ -19572,8 +19330,8 @@ DROP TABLE IF EXISTS `binlogQueue`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `binlogQueue` ( - `code` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL, - `logName` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL, + `code` varchar(255) NOT NULL, + `logName` varchar(255) NOT NULL, `position` bigint(20) unsigned NOT NULL, PRIMARY KEY (`code`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='Binary log position of asynchronous queues'; @@ -19588,9 +19346,9 @@ DROP TABLE IF EXISTS `config`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `config` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `dbVersion` char(11) CHARACTER SET utf8mb3 DEFAULT NULL COMMENT 'The current database version', + `dbVersion` char(11) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT 'The current database version', `hasTriggersDisabled` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'Defines if triggers are disabled', - `environment` varchar(45) CHARACTER SET utf8mb3 DEFAULT NULL COMMENT 'The current Database environment', + `environment` varchar(45) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT 'The current Database environment', `lastDump` datetime DEFAULT NULL COMMENT 'Timestamp of the last data dump', PRIMARY KEY (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='Global configuration table'; @@ -19607,10 +19365,10 @@ CREATE TABLE `debug` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `created` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `connectionId` int(10) unsigned DEFAULT NULL, - `user` varchar(255) CHARACTER SET utf8mb3 DEFAULT NULL, - `host` varchar(255) CHARACTER SET utf8mb3 DEFAULT NULL, - `variable` varchar(255) CHARACTER SET utf8mb3 DEFAULT NULL, - `value` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `user` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL, + `host` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL, + `variable` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL, + `value` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`), KEY `created` (`created`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='Log de depuración'; @@ -19626,8 +19384,8 @@ DROP TABLE IF EXISTS `eventLog`; CREATE TABLE `eventLog` ( `id` int(11) NOT NULL AUTO_INCREMENT, `date` datetime NOT NULL, - `event` varchar(512) COLLATE utf8mb3_unicode_ci NOT NULL, - `error` varchar(1024) COLLATE utf8mb3_unicode_ci NOT NULL, + `event` varchar(512) NOT NULL, + `error` varchar(1024) NOT NULL, PRIMARY KEY (`id`), KEY `date` (`date`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='Event scheduler error log'; @@ -19641,11 +19399,12 @@ DROP TABLE IF EXISTS `eventLogGrouped`; /*!50001 DROP VIEW IF EXISTS `eventLogGrouped`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `eventLogGrouped` AS SELECT - 1 AS `lastHappened`, - 1 AS `nErrors`, - 1 AS `event`, - 1 AS `error` */; +/*!50001 CREATE TABLE `eventLogGrouped` ( + `lastHappened` tinyint NOT NULL, + `nErrors` tinyint NOT NULL, + `event` tinyint NOT NULL, + `error` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -19657,8 +19416,8 @@ DROP TABLE IF EXISTS `notification`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `notification` ( `id` int(11) NOT NULL, - `name` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `description` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `name` varchar(255) DEFAULT NULL, + `description` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `name` (`name`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; @@ -19704,10 +19463,10 @@ DROP TABLE IF EXISTS `notificationQueue`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `notificationQueue` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `notificationFk` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `notificationFk` varchar(255) DEFAULT NULL, `params` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`params`)), `authorFk` int(10) unsigned DEFAULT NULL, - `status` enum('pending','sent','error') COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'pending', + `status` enum('pending','sent','error') NOT NULL DEFAULT 'pending', `created` datetime DEFAULT current_timestamp(), PRIMARY KEY (`id`), KEY `notificationFk` (`notificationFk`), @@ -19739,16 +19498,15 @@ CREATE TABLE `notificationSubscription` ( -- Table structure for table `version` -- - DROP TABLE IF EXISTS `version`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `version` ( - `code` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL, - `number` char(11) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `gitCommit` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `code` varchar(50) NOT NULL, + `number` char(11) DEFAULT NULL, + `gitCommit` varchar(255) DEFAULT NULL, `updated` datetime DEFAULT NULL, - `lastNumber` char(11) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `lastNumber` char(11) DEFAULT NULL, PRIMARY KEY (`code`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -19761,13 +19519,13 @@ DROP TABLE IF EXISTS `versionLog`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `versionLog` ( - `code` varchar(50) COLLATE utf8mb3_unicode_ci NOT NULL, - `number` char(11) COLLATE utf8mb3_unicode_ci NOT NULL, - `file` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL, - `user` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `code` varchar(50) NOT NULL, + `number` char(11) NOT NULL, + `file` varchar(255) NOT NULL, + `user` varchar(255) DEFAULT NULL, `updated` datetime NOT NULL, `errorNumber` int(10) unsigned DEFAULT NULL, - `errorMessage` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `errorMessage` varchar(255) DEFAULT NULL, PRIMARY KEY (`code`,`number`,`file`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -19781,14 +19539,14 @@ DELIMITER ;; /*!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 = utf8mb4 */ ;; -/*!50003 SET character_set_results = utf8mb4 */ ;; -/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;; +/*!50003 SET character_set_client = utf8mb3 */ ;; +/*!50003 SET character_set_results = utf8mb3 */ ;; +/*!50003 SET collation_connection = utf8mb3_general_ci */ ;; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;; /*!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 `slowLog_prune` ON SCHEDULE EVERY 1 DAY STARTS '2021-10-08 00:00:00' ON COMPLETION PRESERVE ENABLE DO CALL util.slowLog_prune */ ;; +/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `slowLog_prune` ON SCHEDULE EVERY 1 DAY STARTS '2021-10-08 00:00:00' ON COMPLETION PRESERVE DISABLE ON SLAVE DO CALL util.slowLog_prune */ ;; /*!50003 SET time_zone = @saved_time_zone */ ;; /*!50003 SET sql_mode = @saved_sql_mode */ ;; /*!50003 SET character_set_client = @saved_cs_client */ ;; @@ -19800,8 +19558,6 @@ DELIMITER ; -- -- Dumping routines for database 'util' -- -/*!50003 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `accountShortToStandard` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -19809,6 +19565,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `accountShortToStandard`(vAccount VARCHAR(10)) RETURNS varchar(10) CHARSET utf8 COLLATE utf8_unicode_ci DETERMINISTIC @@ -19820,8 +19578,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `capitalizeFirst` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -19829,6 +19585,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `capitalizeFirst`(vString VARCHAR(255)) RETURNS varchar(255) CHARSET utf8 NO SQL @@ -19848,11 +19606,11 @@ BEGIN WHILE vI < vLen DO SET vSpaceIni = vI; - + WHILE MID(vString, vI, 1) REGEXP '[[:space:]]' DO SET vI = vI + 1; END WHILE; - + SET vWordIni = vI; SET vI = vWordIni + 1; @@ -19874,8 +19632,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `crypt` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -19883,25 +19639,25 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `crypt`(vText VARCHAR(255), vKey VARCHAR(255)) RETURNS varchar(255) CHARSET utf8 READS SQL DATA BEGIN DECLARE vResult VARCHAR(255); - + CALL vn.crypt(vText, vKey, vResult); RETURN vResult; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `cryptOff` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -19909,25 +19665,25 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `cryptOff`(vText VARCHAR(255), vKey VARCHAR(255)) RETURNS varchar(255) CHARSET utf8 READS SQL DATA BEGIN DECLARE vResult VARCHAR(255); - + CALL vn.cryptOff(vText, vKey, vResult); RETURN vResult; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `dayEnd` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -19935,6 +19691,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `dayEnd`(vDated DATE) RETURNS datetime NO SQL @@ -19953,8 +19711,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `firstDayOfMonth` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -19962,6 +19718,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `firstDayOfMonth`(vDate DATE) RETURNS date NO SQL @@ -19980,8 +19738,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `firstDayOfYear` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -19989,6 +19745,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `firstDayOfYear`(vDate DATE) RETURNS date NO SQL @@ -20007,8 +19765,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `formatRow` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -20016,6 +19772,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `formatRow`(vType CHAR(3), vValues VARCHAR(512)) RETURNS varchar(512) CHARSET utf8 COLLATE utf8_unicode_ci DETERMINISTIC @@ -20040,8 +19798,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `formatTable` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -20049,6 +19805,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `formatTable`(vFields VARCHAR(512), vOldValues VARCHAR(512), vNewValues VARCHAR(512)) RETURNS text CHARSET utf8 COLLATE utf8_unicode_ci DETERMINISTIC @@ -20075,8 +19833,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `hasDateOverlapped` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -20084,10 +19840,12 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `hasDateOverlapped`(vSarted1 DATE, vEnded1 DATE, vSarted2 DATE, vEnded2 DATE) RETURNS tinyint(1) DETERMINISTIC -BEGIN +BEGIN RETURN GREATEST(vSarted1, vSarted2) <= LEAST(vEnded1,vEnded2); @@ -20097,8 +19855,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `hmacSha2` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -20106,6 +19862,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `hmacSha2`(`vAlg` SMALLINT, `vMsg` MEDIUMBLOB, `vKey` MEDIUMBLOB) RETURNS varchar(128) CHARSET utf8 NO SQL @@ -20116,7 +19874,7 @@ BEGIN */ DECLARE vHashlen INT UNSIGNED; DECLARE vOpad, vIpad TINYBLOB; - + CASE vAlg WHEN 224 THEN SET vHashlen = 64; WHEN 256 THEN SET vHashlen = 64; @@ -20124,16 +19882,16 @@ BEGIN WHEN 512 THEN SET vHashlen = 128; ELSE CALL throw ('WRONG_ALGORYTHM_IDENTIFICATOR_USED'); END CASE; - + IF LENGTH(vKey) > vHashlen THEN SET vKey = UNHEX(SHA2(vKey, vAlg)); END IF; - + SET vKey = RPAD(vKey, vHashlen, 0x00); - + SET vIpad = stringXor(vKey, 0x36); SET vOpad = stringXor(vKey, 0x5C); - + RETURN SHA2(CONCAT(vOpad, UNHEX(SHA2(CONCAT(vIpad, vMsg), vAlg))), vAlg); END ;; DELIMITER ; @@ -20141,8 +19899,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `isLeapYear` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -20150,21 +19906,63 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `isLeapYear`(vYear INT) RETURNS tinyint(1) DETERMINISTIC BEGIN RETURN (DAYOFYEAR(CONCAT(vYear, "-02-29")) IS NOT NULL); - + END ;; DELIMITER ; /*!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 `json_removeNulls` */; +/*!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 = utf8mb4 */ ; +/*!50003 SET character_set_results = utf8mb4 */ ; +/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; +DELIMITER ;; +CREATE DEFINER=`root`@`localhost` FUNCTION `json_removeNulls`(vObject JSON) RETURNS longtext CHARSET utf8mb4 COLLATE utf8mb4_bin +BEGIN +/** + * Elimina las propiedades con valor NULL de un objeto. + * + * @param vObject El objeto en formato JSON + * @return El objeto JSON sin propiedades a NULL + */ + DECLARE vKeys JSON; + DECLARE vKey VARCHAR(255); + DECLARE vValue VARCHAR(255); + DECLARE i INT DEFAULT 0; + DECLARE vCount INT; + + SET vKeys = JSON_KEYS(vObject); + SET vCount = JSON_LENGTH(vKeys); + WHILE i < vCount DO + SET vKey = JSON_VALUE(vKeys, CONCAT('$[',i,']')); + SET vValue = JSON_VALUE(vObject, CONCAT('$.', vKey)); + IF vValue IS NULL THEN + SET vObject = JSON_REMOVE(vObject, CONCAT('$.', vKey)); + END IF; + SET i := i + 1; + END WHILE; + + RETURN vObject; +END ;; +DELIMITER ; +/*!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 `lang` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -20172,6 +19970,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `lang`() RETURNS char(2) CHARSET utf8 NO SQL @@ -20189,8 +19989,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `lastDayOfYear` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -20198,6 +19996,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `lastDayOfYear`(vDate DATE) RETURNS date NO SQL @@ -20216,8 +20016,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `midnight` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -20225,11 +20023,13 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `midnight`() RETURNS datetime READS SQL DATA BEGIN - + RETURN TIMESTAMP(util.VN_CURDATE(), '23:59:59'); END ;; @@ -20238,8 +20038,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `nextWeek` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -20247,6 +20045,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `nextWeek`(vYearWeek INT) RETURNS int(11) DETERMINISTIC @@ -20257,7 +20057,7 @@ BEGIN * modo 3. */ DECLARE vYear INT DEFAULT FLOOR(vYearWeek / 100); - + IF vYearWeek < YEARWEEK(CONCAT(vYear, '-12-31'), 3) THEN RETURN vYearWeek + 1; ELSE @@ -20269,8 +20069,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `notification_send` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -20278,6 +20076,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb3 */ ; /*!50003 SET character_set_results = utf8mb3 */ ; /*!50003 SET collation_connection = utf8mb3_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `notification_send`(vNotificationName VARCHAR(255), vParams TEXT, vAuthorFk INT) RETURNS int(11) MODIFIES SQL DATA @@ -20290,14 +20090,9 @@ BEGIN * @param vAuthorFk The notification author or %NULL if there is no author * @return The notification id */ - DECLARE vNotificationFk INT; - - SELECT id INTO vNotificationFk - FROM `notification` - WHERE `name` = vNotificationName; INSERT INTO notificationQueue - SET notificationFk = vNotificationFk, + SET notificationFk = vNotificationName, params = vParams, authorFk = vAuthorFk; @@ -20308,8 +20103,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `quarterFirstDay` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -20317,6 +20110,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `quarterFirstDay`(vYear INT, vQuarter INT) RETURNS date DETERMINISTIC @@ -20328,8 +20123,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `quoteIdentifier` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -20337,6 +20130,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `quoteIdentifier`(vString TEXT) RETURNS text CHARSET utf8mb3 NO SQL @@ -20349,8 +20144,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `stringXor` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -20358,6 +20151,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `stringXor`(vString MEDIUMBLOB, vConst TINYINT UNSIGNED) RETURNS mediumblob NO SQL @@ -20368,16 +20163,16 @@ BEGIN */ DECLARE vLen, vPos INT UNSIGNED; DECLARE vResult MEDIUMBLOB; - + SET vLen = LENGTH(vString); SET vPos = 1; SET vResult = ''; - + WHILE vPos <= vLen DO SET vResult = CONCAT(vResult, LPAD(HEX( ORD(SUBSTR(vString, vPos, 1)) ^ vConst), 2, '0')); SET vPos = vPos + 1; END WHILE; - + RETURN UNHEX(vResult); END ;; DELIMITER ; @@ -20385,8 +20180,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `today` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -20394,6 +20187,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `today`() RETURNS date DETERMINISTIC @@ -20412,8 +20207,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `tomorrow` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -20421,6 +20214,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `tomorrow`() RETURNS date DETERMINISTIC @@ -20437,8 +20232,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `twoDaysAgo` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -20446,6 +20239,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `twoDaysAgo`() RETURNS date DETERMINISTIC @@ -20462,8 +20257,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `yearRelativePosition` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -20471,6 +20264,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `yearRelativePosition`(vYear INT) RETURNS varchar(20) CHARSET utf8 DETERMINISTIC @@ -20487,11 +20282,11 @@ BEGIN IF vYear = vCurYear THEN RETURN 'curYear'; END IF; - + IF vYear = vCurYear - 1 THEN RETURN 'lastYear'; END IF; - + IF vYear = vCurYear - 2 THEN RETURN 'twoYearsAgo'; END IF; @@ -20503,8 +20298,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `yesterday` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -20512,6 +20305,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `yesterday`() RETURNS date DETERMINISTIC @@ -20528,8 +20323,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `checkHex` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -20537,6 +20330,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `checkHex`(vParam VARCHAR(255)) BEGIN @@ -20554,8 +20349,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `compareObjects` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -20563,6 +20356,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `compareObjects`(vChain VARCHAR(45),vCompare VARCHAR(45)) READS SQL DATA @@ -20578,10 +20373,10 @@ BEGIN */ SET vChain = CONCAT('%', vChain, '%'); SET vCompare = CONCAT('%', vCompare, '%'); - SELECT * FROM + SELECT * FROM ( SELECT t1.* FROM - ( + ( SELECT `db`, `name`, @@ -20608,7 +20403,7 @@ BEGIN 'TRIGGER', `ACTION_STATEMENT`, NULL, - NULL + NULL FROM `information_schema`.`TRIGGERS` WHERE `ACTION_STATEMENT` LIKE vChain COLLATE utf8_general_ci UNION ALL @@ -20618,7 +20413,7 @@ BEGIN 'VIEW', `VIEW_DEFINITION`, NULL, - NULL + NULL FROM `information_schema`.`VIEWS` WHERE `VIEW_DEFINITION` LIKE vChain COLLATE utf8_general_ci ) t1 @@ -20649,7 +20444,7 @@ BEGIN 'TRIGGER', `ACTION_STATEMENT`, NULL, - NULL + NULL FROM `information_schema`.`TRIGGERS` WHERE `ACTION_STATEMENT` LIKE vCompare COLLATE utf8_general_ci UNION ALL @@ -20659,7 +20454,7 @@ BEGIN 'VIEW', `VIEW_DEFINITION`, NULL, - NULL + NULL FROM `information_schema`.`VIEWS` WHERE `VIEW_DEFINITION` LIKE vCompare COLLATE utf8_general_ci) t2 ON t2.name = t1.name ORDER BY t1.`db`, t1.`name` @@ -20670,8 +20465,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `debugAdd` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -20679,6 +20472,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `debugAdd`(vVariable VARCHAR(255), vValue VARCHAR(255)) MODIFIES SQL DATA @@ -20690,7 +20485,7 @@ BEGIN * @param vValue Valor de la variable */ DECLARE vIndex INT DEFAULT INSTR(USER(), '@'); - + INSERT INTO debug SET `connectionId` = CONNECTION_ID(), `user` = LEFT(USER(), vIndex - 1), @@ -20703,8 +20498,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `exec` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -20712,6 +20505,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `exec`(vSqlQuery TEXT) SQL SECURITY INVOKER @@ -20734,8 +20529,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `findObject` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -20743,6 +20536,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `findObject`(vChain VARCHAR(45)) READS SQL DATA @@ -20757,7 +20552,7 @@ BEGIN SET vChain = CONCAT('%', vChain, '%'); SELECT * FROM - ( + ( SELECT `routine_schema` `schema`, `routine_name` `name`, @@ -20784,7 +20579,7 @@ BEGIN 'TRIGGER', `ACTION_STATEMENT`, NULL, - NULL + NULL FROM `information_schema`.`TRIGGERS` WHERE `ACTION_STATEMENT` LIKE vChain COLLATE utf8_general_ci UNION ALL @@ -20794,7 +20589,7 @@ BEGIN 'VIEW', `VIEW_DEFINITION`, NULL, - NULL + NULL FROM `information_schema`.`VIEWS` WHERE `VIEW_DEFINITION` LIKE vChain COLLATE utf8_general_ci ) t @@ -20805,8 +20600,119 @@ 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 PROCEDURE IF EXISTS `log_add` */; +/*!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 = utf8mb4 */ ; +/*!50003 SET character_set_results = utf8mb4 */ ; +/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; +DELIMITER ;; +CREATE DEFINER=`root`@`localhost` PROCEDURE `log_add`( + vSchema VARCHAR(45), + vEntity VARCHAR(45), + vChangedModel VARCHAR(45), + vOriginFk INT, + vChangedModelId INT, + vActionCode VARCHAR(45), + vOldInstance JSON, + vNewInstance JSON) +BEGIN +/** + * Guarda las acciones realizadas por el usuario + * + * @param vOriginFk Id del registro de origen + * @param vActionCode Código de la acción {insert | delete | update} + * @param vScheme Esquema al que pertenece la tabla. + * @param vEntity Nombre que hace referencia a la tabla. + * @param vOldInstance Valores antiguos + * @param vNewInstance Valores nuevos + */ + CALL util.log_addWithUser(vSchema, vEntity, + vChangedModel, vOriginFk, vChangedModelId, vActionCode, vOldInstance, vNewInstance, account.myUser_getId()); +END ;; +DELIMITER ; +/*!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 PROCEDURE IF EXISTS `log_addWithUser` */; +/*!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 = utf8mb4 */ ; +/*!50003 SET character_set_results = utf8mb4 */ ; +/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; +DELIMITER ;; +CREATE DEFINER=`root`@`localhost` PROCEDURE `log_addWithUser`( + vSchema VARCHAR(45), + vEntity VARCHAR(45), + vChangedModel VARCHAR(45), + vOriginFk INT, + vChangedModelId INT, + vActionCode VARCHAR(45), + vOldInstance JSON, + vNewInstance JSON, + vUserId INT) +BEGIN +/** + * Guarda las acciones realizadas por el usuario + * + * @param vScheme Esquema al que pertenece la tabla. + * @param vEntity Nombre que hace referencia a la tabla donde se insertará el log + * @param vChangedModel Nombre que hace referencia a la tabla que se modifica + * @param vOriginFk Id del registro de la tabla origen + * @param vChangedModelId Id del registro de la tabla a la que se realiza la acción + * @param vActionCode Código de la acción {insert | delete | update} + * @param vOldInstance JSON que contiene los valores viejos + * @param vNewInstance JSON que contiene los valores nuevos + * @param vUserId Id del usuario que realiza la acción + */ + DECLARE vTableName VARCHAR(255) DEFAULT CONCAT(IFNULL(vEntity, ''), 'Log'); + DECLARE vKeys JSON; + DECLARE vKey VARCHAR(255); + DECLARE vOldValue VARCHAR(255); + DECLARE vNewValue VARCHAR(255); + DECLARE vValue VARCHAR(255); + DECLARE i INT DEFAULT 0; + DECLARE vCount INT; + + SET vSchema = util.quoteIdentifier(vSchema); + SET vTableName = util.quoteIdentifier(vTableName); + + CASE vActionCode + WHEN 'insert' THEN + SELECT json_removeNulls(vNewInstance) INTO vNewInstance; + WHEN 'update' THEN + SET vKeys = JSON_KEYS(vOldInstance); + SET vCount = JSON_LENGTH(vOldInstance); + WHILE i < vCount DO + SET vKey = JSON_VALUE(vKeys, CONCAT('$[',i,']')); + SET vOldValue = JSON_VALUE(vOldInstance, CONCAT('$.',vKey)); + SET vNewValue = JSON_VALUE(vNewInstance, CONCAT('$.',vKey)); + IF (vOldValue = vNewValue) THEN + SET vOldInstance = JSON_REMOVE(vOldInstance, CONCAT('$.',vKey)); + SET vNewInstance = JSON_REMOVE(vNewInstance, CONCAT('$.',vKey)); + END IF; + SET i := i + 1; + END WHILE; + WHEN 'delete' THEN + SELECT json_removeNulls(vOldInstance) INTO vOldInstance; + END CASE; + + EXECUTE IMMEDIATE CONCAT( + 'INSERT INTO ', vSchema, '.', vTableName, ' SET changedModel = ?, originFk = ?, changedModelId= ?, action = ?, oldInstance = ?, newInstance = ?, userFk = ?' + ) USING vChangedModel, vOriginFk, vChangedModelId, vActionCode, vOldInstance, vNewInstance, vUserId; +END ;; +DELIMITER ; +/*!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 PROCEDURE IF EXISTS `procNoOverlap` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -20814,6 +20720,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `procNoOverlap`(procName VARCHAR(255)) SQL SECURITY INVOKER @@ -20842,8 +20750,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `proc_changedPrivs` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -20851,6 +20757,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `proc_changedPrivs`() BEGIN @@ -20870,8 +20778,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `proc_restorePrivs` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -20879,6 +20785,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `proc_restorePrivs`() BEGIN @@ -20898,8 +20806,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `proc_savePrivs` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -20907,6 +20813,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `proc_savePrivs`() BEGIN @@ -20926,8 +20834,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `slowLog_prune` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -20935,6 +20841,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb3 */ ; /*!50003 SET character_set_results = utf8mb3 */ ; /*!50003 SET collation_connection = utf8mb3_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `slowLog_prune`() BEGIN @@ -20962,8 +20870,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `throw` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -20971,6 +20877,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `throw`(vMessage CHAR(55)) BEGIN @@ -20987,8 +20895,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `time_createTable` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -20996,6 +20902,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `time_createTable`(vStarted DATE, vEnded DATE) BEGIN @@ -21008,15 +20916,13 @@ BEGIN INSERT INTO tmp.time (dated) VALUES (vCurrentDate); SET vCurrentDate = DATE_ADD(vCurrentDate, INTERVAL 1 DAY); END WHILE; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `warn` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -21024,6 +20930,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `warn`(vCode CHAR(35)) BEGIN @@ -21052,10 +20960,11 @@ DROP TABLE IF EXISTS `NewView`; /*!50001 DROP VIEW IF EXISTS `NewView`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `NewView` AS SELECT - 1 AS `clientFk`, - 1 AS `lastShipped`, - 1 AS `notBuyingMonths` */; +/*!50001 CREATE TABLE `NewView` ( + `clientFk` tinyint NOT NULL, + `lastShipped` tinyint NOT NULL, + `notBuyingMonths` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -21069,21 +20978,21 @@ CREATE TABLE `XDiario` ( `id` int(11) NOT NULL AUTO_INCREMENT, `ASIEN` double DEFAULT NULL, `FECHA` datetime DEFAULT NULL, - `SUBCTA` varchar(12) CHARACTER SET utf8mb3 DEFAULT NULL, - `CONTRA` varchar(12) CHARACTER SET utf8mb3 DEFAULT NULL, - `CONCEPTO` varchar(50) CHARACTER SET utf8mb3 DEFAULT NULL, + `SUBCTA` varchar(12) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL, + `CONTRA` varchar(12) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL, + `CONCEPTO` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL, `EURODEBE` decimal(10,2) DEFAULT NULL, `EUROHABER` decimal(10,2) DEFAULT NULL, `BASEEURO` decimal(10,2) DEFAULT NULL, - `SERIE` varchar(1) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `FACTURA` varchar(8) COLLATE utf8mb3_unicode_ci DEFAULT '0', + `SERIE` varchar(1) DEFAULT NULL, + `FACTURA` varchar(8) DEFAULT '0', `BASEIMPO` decimal(10,2) DEFAULT NULL, `IVA` decimal(10,2) DEFAULT NULL, `RECEQUIV` decimal(10,2) DEFAULT 0.00, - `DOCUMENTO` varchar(10) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `DEPARTA` varchar(3) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `DOCUMENTO` varchar(10) DEFAULT NULL, + `DEPARTA` varchar(3) DEFAULT NULL, `CLAVE` int(11) DEFAULT NULL, - `ESTADO` varchar(1) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `ESTADO` varchar(1) DEFAULT NULL, `NCASADO` decimal(10,2) DEFAULT NULL, `TCASADO` decimal(10,2) DEFAULT NULL, `TRANS` decimal(10,2) DEFAULT NULL, @@ -21091,22 +21000,22 @@ CREATE TABLE `XDiario` ( `DEBEME` decimal(10,2) DEFAULT NULL, `HABERME` decimal(10,2) DEFAULT NULL, `PTAHABER` decimal(10,2) DEFAULT NULL, - `AUXILIAR` varchar(1) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `SUCURSAL` varchar(4) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `AUXILIAR` varchar(1) DEFAULT NULL, + `SUCURSAL` varchar(4) DEFAULT NULL, `PTADEBE` decimal(10,2) DEFAULT NULL, - `CODDIVISA` varchar(5) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `CODDIVISA` varchar(5) DEFAULT NULL, `IMPAUXME` decimal(10,2) DEFAULT NULL, - `MONEDAUSO` varchar(1) COLLATE utf8mb3_unicode_ci DEFAULT '2', + `MONEDAUSO` varchar(1) DEFAULT '2', `NOCONV` tinyint(1) NOT NULL DEFAULT 0, - `NUMEROINV` varchar(10) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `TIPOOPE` varchar(1) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `NUMEROINV` varchar(10) DEFAULT NULL, + `TIPOOPE` varchar(1) DEFAULT NULL, `NFACTICK` tinyint(1) NOT NULL DEFAULT 1, `TERIDNIF` tinyint(1) NOT NULL DEFAULT 2, - `TERNIF` varchar(20) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'I.F.', - `TERNOM` varchar(50) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'Nombre Importador', + `TERNIF` varchar(20) NOT NULL DEFAULT 'I.F.', + `TERNOM` varchar(50) NOT NULL DEFAULT 'Nombre Importador', `OPBIENES` tinyint(1) NOT NULL DEFAULT 1, - `TIPOFAC` varchar(1) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `TIPOIVA` varchar(1) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `TIPOFAC` varchar(1) DEFAULT NULL, + `TIPOIVA` varchar(1) DEFAULT NULL, `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', @@ -21115,17 +21024,17 @@ CREATE TABLE `XDiario` ( `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 utf8mb3_unicode_ci DEFAULT NULL, - `METALEJE` varchar(4) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `CLIENTE` varchar(12) DEFAULT NULL, + `METALEJE` varchar(4) DEFAULT NULL, `FECHA_OP` date DEFAULT NULL COMMENT 'FEcha de operacion', - `FACTURAEX` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL COMMENT 'Numero de factura del proveedor', + `FACTURAEX` varchar(45) DEFAULT NULL COMMENT 'Numero de factura del proveedor', `TIPOCLAVE` int(3) DEFAULT NULL, `TIPOEXENCI` int(3) DEFAULT NULL, `TIPONOSUJE` int(3) DEFAULT NULL, `TIPOFACT` int(3) DEFAULT NULL, `TIPORECTIF` int(3) DEFAULT NULL, - `SERIE_RT` varchar(2) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `FACTU_RT` varchar(10) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `SERIE_RT` varchar(2) DEFAULT NULL, + `FACTU_RT` varchar(10) DEFAULT NULL, `BASEIMP_RT` decimal(10,2) DEFAULT NULL, `BASEIMP_RF` decimal(10,2) DEFAULT NULL, `RECTIFICA` int(1) NOT NULL DEFAULT 0, @@ -21146,16 +21055,28 @@ CREATE TABLE `XDiario` ( /*!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 = utf8mb4 */ ; -/*!50003 SET character_set_results = utf8mb4 */ ; -/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET character_set_client = utf8mb3 */ ; +/*!50003 SET character_set_results = utf8mb3 */ ; +/*!50003 SET collation_connection = utf8mb3_general_ci */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; +/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`XDiario_beforeInsert` BEFORE INSERT ON `XDiario` FOR EACH ROW BEGIN + IF NEW.SUBCTA <=> '' THEN + SET NEW.SUBCTA = NULL; + END IF; + IF NEW.SUBCTA IS NOT NULL AND NOT LENGTH(NEW.SUBCTA) <=> 10 THEN + CALL util.throw('INVALID_STRING_LENGTH'); + END IF; + IF NEW.CONTRA <=> '' THEN + SET NEW.CONTRA = NULL; + END IF; + IF NEW.CONTRA IS NOT NULL AND NOT LENGTH(NEW.CONTRA) <=> 10 THEN + CALL util.throw('INVALID_STRING_LENGTH'); + END IF; CALL XDiario_checkDate(NEW.FECHA); CALL XDiario_checkDate(NEW.FECHA_EX); CALL XDiario_checkDate(NEW.FECHA_OP); @@ -21170,16 +21091,32 @@ DELIMITER ; /*!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 = utf8mb4 */ ; -/*!50003 SET character_set_results = utf8mb4 */ ; -/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET character_set_client = utf8mb3 */ ; +/*!50003 SET character_set_results = utf8mb3 */ ; +/*!50003 SET collation_connection = utf8mb3_general_ci */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; +/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`XDiario_beforeUpdate` BEFORE UPDATE ON `XDiario` FOR EACH ROW BEGIN + IF NOT NEW.SUBCTA <=> OLD.SUBCTA THEN + IF NEW.SUBCTA <=> '' THEN + SET NEW.SUBCTA = NULL; + END IF; + IF NEW.SUBCTA IS NOT NULL AND NOT LENGTH(NEW.SUBCTA) <=> 10 THEN + CALL util.throw('INVALID_STRING_LENGTH'); + END IF; + END IF; + IF NOT NEW.CONTRA <=> OLD.CONTRA THEN + IF NEW.CONTRA <=> '' THEN + SET NEW.CONTRA = NULL; + END IF; + IF NEW.CONTRA IS NOT NULL AND NOT LENGTH(NEW.CONTRA) <=> 10 THEN + CALL util.throw('INVALID_STRING_LENGTH'); + END IF; + END IF; IF NOT NEW.FECHA <=> OLD.FECHA THEN CALL XDiario_checkDate(NEW.FECHA); END IF; @@ -21210,10 +21147,11 @@ 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 VIEW `__coolerPathDetail` AS SELECT - 1 AS `id`, - 1 AS `coolerPathFk`, - 1 AS `hallway` */; +/*!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; -- @@ -21237,7 +21175,7 @@ CREATE TABLE `absenceType` ( `isNaturalDay` tinyint(1) DEFAULT 0 COMMENT 'Para el cálculo de los salarios de los repartidores', `isCalculate` tinyint(1) DEFAULT 0 COMMENT 'Para el cálculo de los salarios de los repartidores', PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3; +) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -21249,13 +21187,13 @@ DROP TABLE IF EXISTS `accounting`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `accounting` ( `id` int(11) NOT NULL DEFAULT 0, - `bank` varchar(50) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `account` varchar(10) CHARACTER SET utf8mb3 DEFAULT NULL, + `bank` varchar(50) DEFAULT NULL, + `account` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL, `accountingTypeFk` smallint(6) NOT NULL DEFAULT 0, `entityFk` int(10) unsigned DEFAULT NULL, `isActive` tinyint(4) NOT NULL DEFAULT 1, `currencyFk` tinyint(3) unsigned DEFAULT 1, - `code` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `code` varchar(45) DEFAULT NULL, PRIMARY KEY (`id`), KEY `BancosBanco` (`bank`), KEY `fk_Bancos_entity1_idx` (`entityFk`), @@ -21291,9 +21229,9 @@ DROP TABLE IF EXISTS `accountingType`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `accountingType` ( `id` smallint(6) NOT NULL DEFAULT 0, - `description` varchar(100) COLLATE utf8mb3_unicode_ci NOT NULL, - `receiptDescription` varchar(50) COLLATE utf8mb3_unicode_ci DEFAULT NULL COMMENT 'Descripción por defecto al crear nuevo recibo', - `code` varchar(20) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `description` varchar(100) NOT NULL, + `receiptDescription` varchar(50) DEFAULT NULL COMMENT 'Descripción por defecto al crear nuevo recibo', + `code` varchar(20) DEFAULT NULL, `isAutoConciliated` tinyint(1) DEFAULT 1 COMMENT 'Si hay que marcar como conciliado el recibo al usar este tipo', `maxAmount` int(11) DEFAULT NULL, `daysInFuture` int(11) DEFAULT 0, @@ -21329,13 +21267,13 @@ DROP TABLE IF EXISTS `address`; CREATE TABLE `address` ( `id` int(11) NOT NULL AUTO_INCREMENT, `clientFk` int(11) NOT NULL DEFAULT 0, - `street` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `city` varchar(50) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `street` varchar(255) DEFAULT NULL, + `city` varchar(50) DEFAULT NULL, `provinceFk` smallint(5) unsigned DEFAULT NULL, - `postalCode` varchar(10) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `phone` varchar(15) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `mobile` varchar(15) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `nickname` varchar(40) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `postalCode` varchar(10) DEFAULT NULL, + `phone` varchar(15) DEFAULT NULL, + `mobile` varchar(15) DEFAULT NULL, + `nickname` varchar(40) DEFAULT NULL, `isDefaultAddress` tinyint(1) NOT NULL DEFAULT 0, `agencyModeFk` int(11) NOT NULL DEFAULT 2, `isActive` tinyint(4) NOT NULL DEFAULT 1, @@ -21343,7 +21281,7 @@ CREATE TABLE `address` ( `latitude` decimal(11,7) DEFAULT NULL, `isEqualizated` tinyint(1) DEFAULT NULL, `customsAgentFk` int(11) DEFAULT NULL, - `incotermsFk` varchar(3) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `incotermsFk` varchar(3) DEFAULT NULL, `isLogifloraAllowed` tinyint(4) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), KEY `Id_Agencia` (`agencyModeFk`), @@ -21385,11 +21323,11 @@ BEGIN END IF; IF NEW.isEqualizated IS NULL THEN - SELECT isEqualizated + SELECT isEqualizated INTO vIsEqualizated FROM client WHERE id = NEW.clientFk; - + SET NEW.isEqualizated = vIsEqualizated; END IF; END */;; @@ -21411,11 +21349,11 @@ DELIMITER ;; BEFORE UPDATE ON `address` FOR EACH ROW BEGIN - + IF !(NEW.phone <=> OLD.phone) AND (NEW.phone <> '') THEN CALL pbx.phone_isValid(NEW.phone); END IF; - + IF !(NEW.mobile <=> OLD.mobile) AND (NEW.mobile <> '')THEN CALL pbx.phone_isValid(NEW.mobile); END IF; @@ -21441,16 +21379,16 @@ DELIMITER ;; BEGIN -- Recargos de equivalencia distintos implican facturacion por consignatario IF NEW.isEqualizated != OLD.isEqualizated THEN - IF + IF (SELECT COUNT(*) FROM ( SELECT DISTINCT (isEqualizated = FALSE) as Equ - FROM address + FROM address WHERE clientFk = NEW.clientFk ) t1 ) > 1 - THEN - UPDATE client + THEN + UPDATE client SET hasToInvoiceByAddress = TRUE WHERE id = NEW.clientFk; END IF; @@ -21458,10 +21396,10 @@ BEGIN IF NEW.isDefaultAddress AND NEW.isActive = FALSE THEN CALL util.throw ('Cannot desactivate the default address'); END IF; - + IF NOT (NEW.isEqualizated <=> OLD.isEqualizated) THEN INSERT IGNORE INTO ticketRecalc (ticketFk) - SELECT id FROM ticket t + SELECT id FROM ticket t WHERE t.addressFk = NEW.id AND t.refFk IS NULL; END IF; @@ -21526,7 +21464,7 @@ CREATE TABLE `addressObservation` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, `addressFk` int(11) NOT NULL, `observationTypeFk` tinyint(3) unsigned NOT NULL, - `description` text COLLATE utf8mb3_unicode_ci NOT NULL, + `description` text NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `Id_Consigna` (`addressFk`,`observationTypeFk`), KEY `addressObservationFgn_idx` (`observationTypeFk`), @@ -21544,7 +21482,7 @@ DROP TABLE IF EXISTS `agency`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `agency` ( `id` smallint(5) unsigned NOT NULL AUTO_INCREMENT, - `name` varchar(25) COLLATE utf8mb3_unicode_ci NOT NULL, + `name` varchar(25) NOT NULL, `warehouseFk` smallint(5) unsigned DEFAULT NULL COMMENT 'A nulo si se puede enrutar desde todos los almacenes', `warehouseAliasFk` smallint(5) unsigned DEFAULT NULL, `isOwn` tinyint(1) NOT NULL DEFAULT 0, @@ -21609,20 +21547,20 @@ DROP TABLE IF EXISTS `agencyMode`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `agencyMode` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `name` varchar(50) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `description` varchar(50) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `name` varchar(50) DEFAULT NULL, + `description` varchar(50) DEFAULT NULL, `deliveryMethodFk` int(11) DEFAULT NULL, `m3` double 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, - `reportMail` varchar(100) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `reportMail` varchar(100) 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 DEFAULT NULL COMMENT 'obsoleta', - `code` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `code` varchar(45) DEFAULT NULL, `isRiskFree` tinyint(1) NOT NULL DEFAULT 0, `hasWeightVolumetric` int(11) NOT NULL DEFAULT 0 COMMENT 'Tiene en cuenta el peso volumetrico para los calculos', PRIMARY KEY (`id`), @@ -21635,6 +21573,25 @@ CREATE TABLE `agencyMode` ( ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; +-- +-- Table structure for table `agencyModeItemType` +-- + +DROP TABLE IF EXISTS `agencyModeItemType`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `agencyModeItemType` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `agencyModeFk` int(11) NOT NULL, + `itemTypeFk` smallint(5) unsigned NOT NULL, + PRIMARY KEY (`id`), + KEY `agencyModeItemType_FK` (`agencyModeFk`), + KEY `agencyModeItemType_FK_1` (`itemTypeFk`), + CONSTRAINT `agencyModeItemType_FK` FOREIGN KEY (`agencyModeFk`) REFERENCES `agencyMode` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `agencyModeItemType_FK_1` FOREIGN KEY (`itemTypeFk`) REFERENCES `itemType` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='Combinaciones prohibidas entre agencyMode e itemType al calcular el catálogo de items'; +/*!40101 SET character_set_client = @saved_cs_client */; + -- -- Temporary table structure for view `agencyTerm` -- @@ -21643,15 +21600,16 @@ 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 VIEW `agencyTerm` AS SELECT - 1 AS `agencyFk`, - 1 AS `minimumPackages`, - 1 AS `kmPrice`, - 1 AS `packagePrice`, - 1 AS `routePrice`, - 1 AS `minimumKm`, - 1 AS `minimumM3`, - 1 AS `m3Price` */; +/*!50001 CREATE TABLE `agencyTerm` ( + `agencyFk` 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; -- @@ -21666,7 +21624,7 @@ CREATE TABLE `agencyTermConfig` ( `vatAccountSupported` varchar(15) DEFAULT NULL, `vatPercentage` decimal(28,10) DEFAULT NULL, `transaction` varchar(50) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -21677,7 +21635,7 @@ DROP TABLE IF EXISTS `alertLevel`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `alertLevel` ( - `code` varchar(45) CHARACTER SET utf8mb3 NOT NULL, + `code` varchar(45) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, `id` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; @@ -21691,8 +21649,8 @@ DROP TABLE IF EXISTS `amortizationType`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `amortizationType` ( - `code` varchar(45) CHARACTER SET utf8mb3 NOT NULL, - `description` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `code` varchar(45) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, + `description` varchar(255) DEFAULT NULL, PRIMARY KEY (`code`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -21705,11 +21663,32 @@ DROP TABLE IF EXISTS `annualAverageInvoiced`; /*!50001 DROP VIEW IF EXISTS `annualAverageInvoiced`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `annualAverageInvoiced` AS SELECT - 1 AS `clientFk`, - 1 AS `invoiced` */; +/*!50001 CREATE TABLE `annualAverageInvoiced` ( + `clientFk` tinyint NOT NULL, + `invoiced` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; +-- +-- Table structure for table `arcRead` +-- + +DROP TABLE IF EXISTS `arcRead`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `arcRead` ( + `id` smallint(2) unsigned NOT NULL AUTO_INCREMENT, + `printerFk` tinyint(3) unsigned DEFAULT NULL, + `ip` varchar(50) NOT NULL, + `counter` smallint(2) unsigned DEFAULT NULL COMMENT 'Número de etiquetas leídas del pallet actual por el arco', + `error` varchar(50) DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `arcRead_ip_UN` (`ip`), + KEY `worker_printer_FK` (`printerFk`), + CONSTRAINT `worker_printer_FK` FOREIGN KEY (`printerFk`) REFERENCES `printer` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + -- -- Table structure for table `assignedTicketToWorker` -- @@ -21727,6 +21706,21 @@ CREATE TABLE `assignedTicketToWorker` ( ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='Tabla para relacionar un ticket con el sacador del altillo '; /*!40101 SET character_set_client = @saved_cs_client */; +-- +-- Table structure for table `auctionConfig` +-- + +DROP TABLE IF EXISTS `auctionConfig`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `auctionConfig` ( + `conversionCoefficient` double NOT NULL DEFAULT 1 COMMENT 'value used to calculate the used space of an item in a container', + `warehosueFk` smallint(6) unsigned NOT NULL DEFAULT 7 COMMENT 'default warehouse used for the calculation', + KEY `auctionConfig_FK` (`warehosueFk`), + CONSTRAINT `auctionConfig_FK` FOREIGN KEY (`warehosueFk`) REFERENCES `warehouse` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + -- -- Table structure for table `autoRadioConfig` -- @@ -21736,11 +21730,11 @@ DROP TABLE IF EXISTS `autoRadioConfig`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `autoRadioConfig` ( `id` int(11) NOT NULL, - `password` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `user` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `url` varchar(75) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `password` varchar(45) DEFAULT NULL, + `user` varchar(45) DEFAULT NULL, + `url` varchar(75) DEFAULT NULL, `client` int(32) DEFAULT NULL, - `center` varchar(2) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `center` varchar(2) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -21756,7 +21750,7 @@ CREATE TABLE `autoRadioLogCall` ( `id` int(11) NOT NULL AUTO_INCREMENT, `ticketFk` int(11) NOT NULL, `created` timestamp NOT NULL DEFAULT current_timestamp(), - `response` longtext COLLATE utf8mb3_unicode_ci NOT NULL, + `response` longtext 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 @@ -21772,7 +21766,7 @@ DROP TABLE IF EXISTS `autonomy`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `autonomy` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `name` varchar(100) COLLATE utf8mb3_unicode_ci NOT NULL, + `name` varchar(100) NOT NULL, `countryFk` mediumint(8) unsigned NOT NULL, `geoFk` int(11) DEFAULT NULL, PRIMARY KEY (`id`), @@ -21794,8 +21788,8 @@ DELIMITER ;; /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`autonomy_BI` BEFORE INSERT ON `autonomy` FOR EACH ROW -BEGIN - +BEGIN + SET NEW.geoFk = zoneGeo_new('autonomy', NEW.`name`, (SELECT geoFk FROM country WHERE id = NEW.countryFk)); END */;; @@ -21845,7 +21839,7 @@ DELIMITER ;; AFTER DELETE ON `autonomy` FOR EACH ROW BEGIN - CALL zoneGeo_delete(OLD.geoFk); + CALL zoneGeo_delete(OLD.geoFk); END */;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -21862,19 +21856,19 @@ DROP TABLE IF EXISTS `awb`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `awb` ( `id` smallint(11) unsigned NOT NULL AUTO_INCREMENT, - `code` varchar(18) COLLATE utf8mb3_unicode_ci NOT NULL, + `code` varchar(18) NOT NULL, `package` float unsigned NOT NULL, `weight` float unsigned DEFAULT NULL, `created` timestamp NOT NULL DEFAULT current_timestamp(), `transitoryFk` int(11) DEFAULT NULL, `taxFk` int(10) unsigned DEFAULT 62, - `duakk` varchar(18) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `duakk` varchar(18) DEFAULT NULL, `docFk` int(11) DEFAULT NULL, `amount` double NOT NULL DEFAULT 0, `freightFk` int(11) DEFAULT NULL, `m3` double unsigned DEFAULT NULL, `stems` int(10) unsigned DEFAULT NULL, - `flightFk` varchar(10) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `flightFk` varchar(10) DEFAULT NULL, `volumeWeight` float unsigned DEFAULT NULL, `hb` decimal(10,1) unsigned DEFAULT NULL, `rate` decimal(10,2) unsigned DEFAULT NULL, @@ -21886,7 +21880,7 @@ CREATE TABLE `awb` ( `isChecked` tinyint(3) DEFAULT 0, `isTransitoryChecked` tinyint(3) DEFAULT 0, `year` int(4) DEFAULT NULL, - `observation` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `observation` varchar(45) DEFAULT NULL, `hasFreightPrepaid` tinyint(3) DEFAULT 0, `invoiceInPaletizedFk` mediumint(8) unsigned DEFAULT NULL, `propertyNumber` int(11) DEFAULT NULL, @@ -21921,7 +21915,7 @@ DELIMITER ;; BEFORE INSERT ON `awb` FOR EACH ROW BEGIN - + SET NEW.year= year(util.VN_CURDATE()); @@ -21940,10 +21934,11 @@ DROP TABLE IF EXISTS `awbVolume`; /*!50001 DROP VIEW IF EXISTS `awbVolume`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `awbVolume` AS SELECT - 1 AS `awbFk`, - 1 AS `volume`, - 1 AS `buyFk` */; +/*!50001 CREATE TABLE `awbVolume` ( + `awbFk` tinyint NOT NULL, + `volume` tinyint NOT NULL, + `buyFk` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -21954,15 +21949,16 @@ DROP TABLE IF EXISTS `bank`; /*!50001 DROP VIEW IF EXISTS `bank`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `bank` AS SELECT - 1 AS `id`, - 1 AS `bank`, - 1 AS `account`, - 1 AS `cash`, - 1 AS `entityFk`, - 1 AS `isActive`, - 1 AS `currencyFk`, - 1 AS `code` */; +/*!50001 CREATE TABLE `bank` ( + `id` tinyint NOT NULL, + `bank` tinyint NOT NULL, + `account` tinyint NOT NULL, + `cash` tinyint NOT NULL, + `entityFk` tinyint NOT NULL, + `isActive` tinyint NOT NULL, + `currencyFk` tinyint NOT NULL, + `code` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -21975,8 +21971,8 @@ DROP TABLE IF EXISTS `bankEntity`; CREATE TABLE `bankEntity` ( `countryFk` mediumint(8) unsigned NOT NULL DEFAULT 1, `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `name` varchar(45) COLLATE utf8mb3_unicode_ci NOT NULL, - `bic` varchar(11) CHARACTER SET utf8mb3 NOT NULL, + `name` varchar(45) NOT NULL, + `bic` varchar(11) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `bic_UNIQUE` (`bic`), KEY `fg_entity1_idx` (`countryFk`), @@ -22048,26 +22044,27 @@ 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 VIEW `bankPolicy` AS SELECT - 1 AS `id`, - 1 AS `ref`, - 1 AS `amount`, - 1 AS `balanceInterestDrawn`, - 1 AS `commissionAvailableBalances`, - 1 AS `openingCommission`, - 1 AS `started`, - 1 AS `ended`, - 1 AS `bankFk`, - 1 AS `companyFk`, - 1 AS `supplierFk`, - 1 AS `description`, - 1 AS `hasGuarantee`, - 1 AS `dmsFk`, - 1 AS `notaryFk`, - 1 AS `currencyFk`, - 1 AS `amortizationTypeFk`, - 1 AS `periodicityTypeFk`, - 1 AS `insuranceExpired` */; +/*!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; -- @@ -22078,7 +22075,7 @@ DROP TABLE IF EXISTS `beach`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `beach` ( - `code` varchar(45) COLLATE utf8mb3_unicode_ci NOT NULL, + `code` varchar(45) NOT NULL, `warehouseFk` smallint(6) NOT NULL DEFAULT 60, PRIMARY KEY (`code`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='Ubicaciones respecto a la playa del almacén'; @@ -22111,8 +22108,8 @@ DROP TABLE IF EXISTS `bookingPlanner`; CREATE TABLE `bookingPlanner` ( `id` int(10) NOT NULL AUTO_INCREMENT, `effectived` timestamp NOT NULL DEFAULT current_timestamp(), - `pgcFk` varchar(10) COLLATE utf8mb3_unicode_ci NOT NULL, - `taxAreaFk` varchar(15) CHARACTER SET utf8mb3 NOT NULL DEFAULT 'SPAIN', + `pgcFk` varchar(10) NOT NULL, + `taxAreaFk` varchar(15) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci 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, @@ -22140,10 +22137,10 @@ CREATE TABLE `botanicExport` ( `ediGenusFk` mediumint(8) unsigned NOT NULL, `ediSpecieFk` mediumint(8) unsigned DEFAULT NULL, `countryFk` mediumint(8) unsigned DEFAULT NULL, - `restriction` enum('Sin restriccion','Importacion Prohibida','pasaporte fitosanitario','pasaporte individual','declaracion origen') CHARACTER SET utf8mb3 NOT NULL, - `description` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `restriction` enum('Sin restriccion','Importacion Prohibida','pasaporte fitosanitario','pasaporte individual','declaracion origen') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, + `description` varchar(45) DEFAULT NULL, `isProtectedZone` tinyint(1) NOT NULL DEFAULT 0, - `code` enum('importProhibited','phytosanitaryPassport','individualPassport') COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `code` enum('importProhibited','phytosanitaryPassport','individualPassport') DEFAULT NULL, PRIMARY KEY (`id`), KEY `Id_Paises` (`countryFk`), KEY `botanicExport_ibfk_2_idx` (`ediGenusFk`), @@ -22184,7 +22181,7 @@ DROP TABLE IF EXISTS `budget`; CREATE TABLE `budget` ( `id` int(11) NOT NULL AUTO_INCREMENT, `created` timestamp NOT NULL DEFAULT current_timestamp(), - `name` varchar(100) COLLATE utf8mb3_unicode_ci NOT NULL, + `name` varchar(100) NOT NULL, `started` date DEFAULT NULL, `finished` date DEFAULT NULL, `userFk` int(10) unsigned DEFAULT NULL, @@ -22256,7 +22253,7 @@ CREATE TABLE `budgetNotes` ( `id` int(11) NOT NULL AUTO_INCREMENT, `budgetFk` int(11) NOT NULL, `created` timestamp NOT NULL DEFAULT current_timestamp(), - `txt` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL, + `txt` varchar(255) NOT NULL, `userFk` int(10) unsigned DEFAULT NULL, PRIMARY KEY (`id`), KEY `budgetNotes_FK` (`budgetFk`), @@ -22278,11 +22275,11 @@ DELIMITER ;; BEFORE INSERT ON `budgetNotes` FOR EACH ROW BEGIN - + IF ISNULL(NEW.userFk) THEN - + SET NEW.userFk = account.myUser_getId(); - + END IF; END */;; @@ -22328,6 +22325,7 @@ CREATE TABLE `business` ( KEY `business_departmentFk_idx` (`departmentFk`), KEY `business_workerBusinessProfessionalCategoryFk_idx` (`workerBusinessProfessionalCategoryFk`), KEY `business_calendarTypeFk_idx` (`calendarTypeFk`), + KEY `business_workerBusinessCategoryFk` (`workerBusinessCategoryFk`), KEY `business_workerBusinessTypeFk_idx` (`workerBusinessTypeFk`), KEY `business_workerBusinessAgreementFk_idx` (`workerBusinessAgreementFk`), CONSTRAINT `business_calendarTypeFk` FOREIGN KEY (`calendarTypeFk`) REFERENCES `postgresql`.`calendar_labour_type` (`calendar_labour_type_id`) ON UPDATE CASCADE, @@ -22335,10 +22333,11 @@ CREATE TABLE `business` ( CONSTRAINT `business_departmentFk` FOREIGN KEY (`departmentFk`) REFERENCES `department` (`id`) ON UPDATE CASCADE, CONSTRAINT `business_occupationCodeFk` FOREIGN KEY (`occupationCodeFk`) REFERENCES `occupationCode` (`code`) ON UPDATE CASCADE, CONSTRAINT `business_workerBusinessAgreementFk` FOREIGN KEY (`workerBusinessAgreementFk`) REFERENCES `postgresql`.`labour_agreement` (`labour_agreement_id`) ON UPDATE CASCADE, + CONSTRAINT `business_workerBusinessCategoryFk` FOREIGN KEY (`workerBusinessCategoryFk`) REFERENCES `vn2008`.`payroll_categorias` (`codcategoria`) ON UPDATE CASCADE, CONSTRAINT `business_workerBusinessProfessionalCategoryFk` FOREIGN KEY (`workerBusinessProfessionalCategoryFk`) REFERENCES `postgresql`.`professional_category` (`professional_category_id`) ON UPDATE CASCADE, CONSTRAINT `business_workerBusinessTypeFk` FOREIGN KEY (`workerBusinessTypeFk`) REFERENCES `workerBusinessType` (`id`) ON UPDATE CASCADE, CONSTRAINT `business_workerFk` FOREIGN KEY (`workerFk`) REFERENCES `worker` (`id`) ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3; +) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_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 */ ; @@ -22396,28 +22395,28 @@ DELIMITER ;; FOR EACH ROW BEGIN DECLARE isOverlapping BOOL; - + IF NEW.ended IS NULL THEN SET NEW.payedHolidays = 0; END IF; IF !(OLD.started <=> NEW.started AND OLD.ended <=> NEW.ended) THEN - + SELECT COUNT(*) > 0 INTO isOverlapping FROM business b WHERE (util.hasDateOverlapped( - NEW.started, + NEW.started, IFNULL(NEW.ended, b.started), b.started, IFNULL(b.ended, NEW.started)) OR (NEW.ended <=> NULL AND b.ended <=> NULL)) AND b.id <> OLD.id AND workerFk = OLD.workerFk; - - IF isOverlapping THEN + + IF isOverlapping THEN CALL util.throw ('IS_OVERLAPPING'); END IF; - + END IF; END */;; @@ -22479,11 +22478,12 @@ DROP TABLE IF EXISTS `businessCalendar`; /*!50001 DROP VIEW IF EXISTS `businessCalendar`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `businessCalendar` AS SELECT - 1 AS `id`, - 1 AS `businessFk`, - 1 AS `absenceTypeFk`, - 1 AS `dated` */; +/*!50001 CREATE TABLE `businessCalendar` ( + `id` tinyint NOT NULL, + `businessFk` tinyint NOT NULL, + `absenceTypeFk` tinyint NOT NULL, + `dated` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -22495,7 +22495,7 @@ DROP TABLE IF EXISTS `businessReasonEnd`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `businessReasonEnd` ( `id` tinyint(3) NOT NULL AUTO_INCREMENT, - `reason` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `reason` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -22508,8 +22508,8 @@ DROP TABLE IF EXISTS `businessType`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `businessType` ( - `code` varchar(100) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '', - `description` varchar(100) COLLATE utf8mb3_unicode_ci NOT NULL, + `code` varchar(100) NOT NULL DEFAULT '', + `description` varchar(100) NOT NULL, PRIMARY KEY (`code`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -22537,8 +22537,8 @@ CREATE TABLE `buy` ( `containerFk` smallint(5) unsigned DEFAULT NULL, `comissionValue` decimal(10,3) NOT NULL DEFAULT 0.000, `packageValue` decimal(10,3) NOT NULL DEFAULT 0.000, - `location` varchar(5) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `packageFk` varchar(10) COLLATE utf8mb3_unicode_ci DEFAULT '--', + `location` varchar(5) DEFAULT NULL, + `packageFk` varchar(10) DEFAULT '--', `price1` decimal(10,2) DEFAULT 0.00, `price2` decimal(10,2) DEFAULT 0.00, `price3` decimal(10,2) DEFAULT 0.00, @@ -22663,7 +22663,7 @@ trig: BEGIN LEAVE trig; END IF; - IF @isTriggerDisabled THEN + IF @isTriggerDisabled THEN LEAVE trig; END IF; @@ -22769,12 +22769,12 @@ trig: BEGIN OR !(NEW.created <=> OLD.created) THEN CALL stock.log_add('buy', NEW.id, OLD.id); END IF; - + IF @isModeInventory THEN LEAVE trig; END IF; - IF @isTriggerDisabled THEN + IF @isTriggerDisabled THEN LEAVE trig; END IF; @@ -22784,24 +22784,24 @@ trig: BEGIN INTO vIsBuyerToBeEmailed, vLanded FROM entry e JOIN travel t ON t.id = e.travelFk - JOIN warehouse w ON w.id = t.warehouseInFk + JOIN warehouse w ON w.id = t.warehouseInFk WHERE e.id = NEW.entryFk; - - SELECT it.workerFk, i.longName + + SELECT it.workerFk, i.longName INTO vBuyerFk, vItemName FROM itemCategory k JOIN itemType it ON it.categoryFk = k.id JOIN item i ON i.typeFk = it.id WHERE i.id = OLD.itemFk; - IF vIsBuyerToBeEmailed AND - vBuyerFk != account.myUser_getId() AND + IF vIsBuyerToBeEmailed AND + vBuyerFk != account.myUser_getId() AND vLanded = util.VN_CURDATE() THEN - IF !(NEW.itemFk <=> OLD.itemFk) OR - !(NEW.quantity <=> OLD.quantity) OR + IF !(NEW.itemFk <=> OLD.itemFk) OR + !(NEW.quantity <=> OLD.quantity) OR !(NEW.packing <=> OLD.packing) OR - !(NEW.grouping <=> OLD.grouping) OR - !(NEW.packageFk <=> OLD.packageFk) OR + !(NEW.grouping <=> OLD.grouping) OR + !(NEW.packageFk <=> OLD.packageFk) OR !(NEW.weight <=> OLD.weight) THEN CALL vn.mail_insert( CONCAT(account.user_getNameFromId(vBuyerFk),'@verdnatura.es'), @@ -22830,7 +22830,7 @@ DELIMITER ;; /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`buy_beforeDelete` BEFORE DELETE ON buy FOR EACH ROW -BEGIN +BEGIN IF OLD.printedStickers <> 0 THEN CALL util.throw("it is not possible to delete buys with printed labels "); END IF; @@ -22852,15 +22852,17 @@ DELIMITER ;; /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`buy_afterDelete` AFTER DELETE ON `buy` FOR EACH ROW -trig: BEGIN +trig: BEGIN DECLARE vValues VARCHAR(255); - IF @isTriggerDisabled THEN + IF @isTriggerDisabled THEN LEAVE trig; END IF; CALL stock.log_add('buy', NULL, OLD.id); + CALL util.debugAdd('buy_deleted', CONCAT(OLD.id,' ', OLD.itemFk,' ', OLD.entryFk, ' ', vn.getWorkerCode())); + /*IF entry_isInventoryOrPrevious(OLD.entryFk) THEN SET vValues = CONCAT_WS(',', OLD.entryFk, @@ -22888,7 +22890,7 @@ DROP TABLE IF EXISTS `buyMark`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `buyMark` ( `id` int(11) NOT NULL, - `comment` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `comment` varchar(255) DEFAULT NULL, `mark` tinyint(1) DEFAULT NULL, `odbcDate` timestamp NULL DEFAULT current_timestamp(), PRIMARY KEY (`id`), @@ -22904,9 +22906,10 @@ DROP TABLE IF EXISTS `buyer`; /*!50001 DROP VIEW IF EXISTS `buyer`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `buyer` AS SELECT - 1 AS `userFk`, - 1 AS `nickname` */; +/*!50001 CREATE TABLE `buyer` ( + `userFk` tinyint NOT NULL, + `nickname` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -22917,11 +22920,12 @@ DROP TABLE IF EXISTS `buyerSales`; /*!50001 DROP VIEW IF EXISTS `buyerSales`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `buyerSales` AS SELECT - 1 AS `importe`, - 1 AS `comprador`, - 1 AS `año`, - 1 AS `semana` */; +/*!50001 CREATE TABLE `buyerSales` ( + `importe` tinyint NOT NULL, + `comprador` tinyint NOT NULL, + `año` tinyint NOT NULL, + `semana` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -22937,12 +22941,13 @@ CREATE TABLE `calendar` ( `dayOffTypeFk` int(11) NOT NULL, `dated` date NOT NULL, PRIMARY KEY (`id`), + UNIQUE KEY `calendar_UN` (`businessFk`,`dated`), KEY `calendar_employee_business_labour_id_idx` (`businessFk`), KEY `calendar_employee_calendar_state_calendar_state_id_idx` (`dayOffTypeFk`), KEY `id_index` (`id`), CONSTRAINT `calendar_FK` FOREIGN KEY (`dayOffTypeFk`) REFERENCES `absenceType` (`id`) ON UPDATE CASCADE, - CONSTRAINT `calendar_businessFk` FOREIGN KEY (`businessFk`) REFERENCES `business` (`id`) ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3; + CONSTRAINT `calendar_businessFk` FOREIGN KEY (`businessFk`) REFERENCES `business` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -22966,7 +22971,7 @@ CREATE TABLE `calendarHolidays` ( CONSTRAINT `calendarHolidaysNameFk` FOREIGN KEY (`calendarHolidaysNameFk`) REFERENCES `calendarHolidaysName` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `calendarholidaystypeFk` FOREIGN KEY (`calendarHolidaysTypeFk`) REFERENCES `calendarHolidaysType` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `workCenterFk` FOREIGN KEY (`workCenterFk`) REFERENCES `workCenter` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3; +) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -22980,7 +22985,7 @@ CREATE TABLE `calendarHolidaysName` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(100) DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3; +) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -22995,7 +23000,7 @@ CREATE TABLE `calendarHolidaysType` ( `name` varchar(50) NOT NULL, `hexColour` char(7) NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3; +) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -23007,7 +23012,7 @@ DROP TABLE IF EXISTS `campaign`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `campaign` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `code` enum('mothersDay','allSaints','valentinesDay') COLLATE utf8mb3_unicode_ci NOT NULL, + `code` enum('mothersDay','allSaints','valentinesDay') NOT NULL, `dated` datetime NOT NULL DEFAULT current_timestamp(), `scopeDays` int(11) NOT NULL DEFAULT 15, PRIMARY KEY (`id`), @@ -23024,8 +23029,8 @@ DROP TABLE IF EXISTS `category`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `category` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `description` varchar(45) COLLATE utf8mb3_unicode_ci NOT NULL, - `nick` varchar(3) COLLATE utf8mb3_unicode_ci NOT NULL, + `description` varchar(45) NOT NULL, + `nick` varchar(3) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -23039,7 +23044,7 @@ DROP TABLE IF EXISTS `chain`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `chain` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `name` varchar(45) COLLATE utf8mb3_unicode_ci NOT NULL, + `name` varchar(45) NOT NULL, `rappel` decimal(5,2) NOT NULL DEFAULT 0.00, `componentFk` int(11) DEFAULT NULL, PRIMARY KEY (`id`), @@ -23058,13 +23063,13 @@ DROP TABLE IF EXISTS `chat`; CREATE TABLE `chat` ( `id` int(11) NOT NULL AUTO_INCREMENT, `senderFk` int(10) unsigned DEFAULT NULL, - `recipient` varchar(50) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `recipient` varchar(50) DEFAULT NULL, `dated` datetime DEFAULT NULL, `checkUserStatus` tinyint(1) DEFAULT NULL, - `message` text COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `message` text DEFAULT NULL, `status` tinyint(1) DEFAULT NULL, `attempts` int(1) DEFAULT NULL, - `error` text COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `error` text DEFAULT NULL, PRIMARY KEY (`id`), KEY `chat_FK` (`senderFk`), CONSTRAINT `chat_FK` FOREIGN KEY (`senderFk`) REFERENCES `account`.`user` (`id`) ON UPDATE CASCADE @@ -23080,10 +23085,10 @@ DROP TABLE IF EXISTS `chatConfig`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `chatConfig` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `host` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL, - `api` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL, - `user` varchar(50) COLLATE utf8mb3_unicode_ci NOT NULL, - `password` varchar(50) COLLATE utf8mb3_unicode_ci NOT NULL, + `host` varchar(255) NOT NULL, + `api` varchar(255) NOT NULL, + `user` varchar(50) NOT NULL, + `password` varchar(50) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -23099,7 +23104,7 @@ CREATE TABLE `claim` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `ticketCreated` date NOT NULL, `claimStateFk` int(10) unsigned NOT NULL DEFAULT 1, - `observation` text COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `observation` text DEFAULT NULL, `clientFk` int(11) NOT NULL, `workerFk` int(11) NOT NULL, `responsibility` int(1) unsigned NOT NULL DEFAULT 3, @@ -23108,7 +23113,7 @@ CREATE TABLE `claim` ( `ticketFk` int(11) DEFAULT NULL, `hasToPickUp` tinyint(1) NOT NULL, `packages` smallint(10) unsigned DEFAULT 0 COMMENT 'packages received by the client', - `rma` varchar(100) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `rma` varchar(100) DEFAULT NULL, PRIMARY KEY (`id`), KEY `cl_est_id` (`claimStateFk`), KEY `Id_Cliente` (`clientFk`), @@ -23158,7 +23163,7 @@ BEGIN FROM sale WHERE id = NEW.saleFk; - UPDATE claim + UPDATE claim SET ticketFk = vTicket WHERE id = NEW.claimFk; END */;; @@ -23191,7 +23196,7 @@ DROP TABLE IF EXISTS `claimDestination`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `claimDestination` ( `id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT, - `description` varchar(15) COLLATE utf8mb3_unicode_ci NOT NULL, + `description` varchar(15) NOT NULL, `addressFk` int(10) DEFAULT NULL COMMENT 'Indica el consignatario para el ticket que regulariza el inventario', PRIMARY KEY (`id`), KEY `clSolAddressFk_idx` (`addressFk`), @@ -23286,14 +23291,14 @@ CREATE TABLE `claimLog` ( `id` int(11) NOT NULL AUTO_INCREMENT, `originFk` int(10) unsigned NOT NULL, `userFk` int(10) unsigned DEFAULT NULL, - `action` set('insert','update','delete') COLLATE utf8mb3_unicode_ci NOT NULL, + `action` set('insert','update','delete') NOT NULL, `creationDate` timestamp NULL DEFAULT current_timestamp(), - `description` text CHARACTER SET utf8mb3 DEFAULT NULL, - `changedModel` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `oldInstance` text COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `newInstance` text COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `description` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL, + `changedModel` varchar(45) DEFAULT NULL, + `oldInstance` text DEFAULT NULL, + `newInstance` text DEFAULT NULL, `changedModelId` int(11) DEFAULT NULL, - `changedModelValue` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `changedModelValue` varchar(45) DEFAULT NULL, PRIMARY KEY (`id`), KEY `originFk` (`originFk`), KEY `userFk` (`userFk`), @@ -23313,7 +23318,7 @@ CREATE TABLE `claimObservation` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, `claimFk` int(10) unsigned NOT NULL, `workerFk` int(10) unsigned DEFAULT NULL, - `text` text COLLATE utf8mb3_unicode_ci NOT NULL, + `text` text NOT NULL, `created` timestamp NOT NULL DEFAULT current_timestamp(), PRIMARY KEY (`id`), KEY `worker_key` (`workerFk`), @@ -23352,7 +23357,7 @@ DROP TABLE IF EXISTS `claimReason`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `claimReason` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `description` varchar(45) COLLATE utf8mb3_unicode_ci NOT NULL, + `description` varchar(45) NOT NULL, `isTired` tinyint(1) NOT NULL DEFAULT 0, PRIMARY KEY (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='Motivos de las fallos'; @@ -23367,7 +23372,7 @@ DROP TABLE IF EXISTS `claimRedelivery`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `claimRedelivery` ( `id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT, - `description` varchar(45) COLLATE utf8mb3_unicode_ci NOT NULL, + `description` varchar(45) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='Método por el cual el cliente nos devuelve la mercancía'; /*!40101 SET character_set_client = @saved_cs_client */; @@ -23381,7 +23386,7 @@ DROP TABLE IF EXISTS `claimResponsible`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `claimResponsible` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `description` varchar(45) COLLATE utf8mb3_unicode_ci NOT NULL, + `description` varchar(45) NOT NULL, `responsability` tinyint(4) NOT NULL DEFAULT 0 COMMENT 'if=1 >sensib >culpa', PRIMARY KEY (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='Responsables de las causas'; @@ -23396,7 +23401,7 @@ DROP TABLE IF EXISTS `claimResult`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `claimResult` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `description` varchar(45) COLLATE utf8mb3_unicode_ci NOT NULL, + `description` varchar(45) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='Consecuencias de los motivos'; /*!40101 SET character_set_client = @saved_cs_client */; @@ -23410,11 +23415,11 @@ DROP TABLE IF EXISTS `claimRma`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `claimRma` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `code` varchar(100) COLLATE utf8mb3_unicode_ci NOT NULL, + `code` varchar(100) NOT NULL, `created` timestamp NOT NULL DEFAULT current_timestamp(), `workerFk` int(10) unsigned NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; +) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -23426,8 +23431,8 @@ DROP TABLE IF EXISTS `claimState`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `claimState` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `code` varchar(45) CHARACTER SET utf8mb3 DEFAULT NULL, - `description` varchar(15) COLLATE utf8mb3_unicode_ci NOT NULL, + `code` varchar(45) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL, + `description` varchar(15) NOT NULL, `roleFk` int(10) unsigned NOT NULL DEFAULT 1, `priority` int(11) NOT NULL DEFAULT 1, `hasToNotify` tinyint(4) DEFAULT 0, @@ -23446,22 +23451,22 @@ DROP TABLE IF EXISTS `client`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `client` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `name` varchar(50) COLLATE utf8mb3_unicode_ci NOT NULL, + `name` varchar(50) NOT NULL, `defaultAddressFk` int(11) DEFAULT NULL, - `street` longtext COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `fi` varchar(14) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `phone` varchar(15) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `email` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `street` longtext DEFAULT NULL, + `fi` varchar(14) DEFAULT NULL, + `phone` varchar(15) DEFAULT NULL, + `email` varchar(255) DEFAULT NULL, `dueDay` smallint(6) NOT NULL DEFAULT 5, `isTaxDataChecked` tinyint(1) NOT NULL DEFAULT 0, - `mobile` varchar(15) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `accountingAccount` varchar(10) CHARACTER SET utf8mb3 NOT NULL, + `mobile` varchar(15) DEFAULT NULL, + `accountingAccount` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, `isEqualizated` tinyint(1) NOT NULL DEFAULT 0, - `city` varchar(25) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `provinceFk` smallint(5) unsigned DEFAULT NULL, - `postcode` varchar(8) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `socialName` varchar(60) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `contact` varchar(50) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `city` varchar(25) DEFAULT NULL, + `provinceFk` smallint(5) unsigned NOT NULL, + `postcode` varchar(8) DEFAULT NULL, + `socialName` varchar(60) DEFAULT NULL, + `contact` varchar(50) DEFAULT NULL, `hasToInvoice` tinyint(1) NOT NULL DEFAULT 1, `isFreezed` tinyint(1) NOT NULL DEFAULT 0, `salesPersonFk` int(10) unsigned DEFAULT NULL, @@ -23487,15 +23492,16 @@ CREATE TABLE `client` ( `hasToInvoiceByAddress` tinyint(1) DEFAULT 0, `isCreatedAsServed` tinyint(1) DEFAULT 0, `hasInvoiceSimplified` tinyint(1) NOT NULL DEFAULT 0, - `iban` varchar(45) CHARACTER SET utf8mb3 DEFAULT NULL, + `hasElectronicInvoice` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'Registro de facturas mediante FACe', + `iban` varchar(45) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL, `hasLcr` tinyint(1) NOT NULL DEFAULT 0, `bankEntityFk` int(10) unsigned DEFAULT NULL, - `typeFk` varchar(20) CHARACTER SET utf8mb3 NOT NULL DEFAULT 'normal', + `typeFk` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'normal', `taxTypeSageFk` smallint(6) DEFAULT NULL COMMENT 'Tipo de Iva por defecto asociado al cliente en SAGE', `transactionTypeSageFk` tinyint(4) DEFAULT NULL COMMENT 'Tipo de transacción por defecto asociado al cliente en SAGE', `transferorFk` int(11) DEFAULT NULL COMMENT 'Cliente que le ha transmitido la titularidad de la empresa', `lastSalesPersonFk` int(10) unsigned DEFAULT NULL COMMENT 'ultimo comercial que tuvo, para el calculo del peso en los rankings de equipo', - `businessTypeFk` varchar(20) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `businessTypeFk` varchar(20) NOT NULL DEFAULT 'florist', `hasIncoterms` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'Received incoterms authorization from client', PRIMARY KEY (`id`), UNIQUE KEY `IF` (`fi`), @@ -23556,7 +23562,7 @@ BEGIN END IF; SET NEW.accountingAccount = 4300000000 + NEW.id; - + SET NEW.lastSalesPersonFk = NEW.salesPersonFk; END */;; DELIMITER ; @@ -23584,19 +23590,19 @@ BEGIN IF !(NEW.phone <=> OLD.phone) AND (NEW.phone <> '') THEN CALL pbx.phone_isValid(NEW.phone); END IF; - + IF !(NEW.mobile <=> OLD.mobile) AND (NEW.mobile <> '')THEN CALL pbx.phone_isValid(NEW.mobile); END IF; SELECT id INTO vPayMethodFk - FROM vn.payMethod + FROM vn.payMethod WHERE code = 'bankDraft'; - + IF NEW.payMethodFk = vPayMethodFk AND NEW.dueDay = 0 THEN SET NEW.dueDay = 5; END IF; - + -- Avisar al comercial si ha llegado la documentación sepa/core IF NEW.hasSepaVnl AND !OLD.hasSepaVnl THEN @@ -23609,7 +23615,7 @@ BEGIN IF vText IS NOT NULL THEN - INSERT INTO mail(receiver, replyTo, `subject`, body) + INSERT INTO mail(receiver, replyTo, `subject`, body) SELECT CONCAT(IF(ac.id,u.name, 'jgallego'), '@verdnatura.es'), 'administracion@verdnatura.es', @@ -23620,16 +23626,16 @@ BEGIN LEFT JOIN account.account ac ON ac.id = u.id WHERE w.id = NEW.salesPersonFk; END IF; - + IF NEW.salespersonFk IS NULL AND OLD.salespersonFk IS NOT NULL THEN - IF (SELECT COUNT(clientFk) + IF (SELECT COUNT(clientFk) FROM clientProtected WHERE clientFk = NEW.id ) > 0 THEN CALL util.throw("HAS_CLIENT_PROTECTED"); END IF; END IF; - + IF !(NEW.salesPersonFk <=> OLD.salesPersonFk) THEN SET NEW.lastSalesPersonFk = IFNULL(NEW.salesPersonFk, OLD.salesPersonFk); END IF; @@ -23660,18 +23666,18 @@ BEGIN IF !(NEW.defaultAddressFk <=> OLD.defaultAddressFk) THEN UPDATE `address` SET isDefaultAddress = 0 WHERE clientFk = NEW.id; - + UPDATE `address` SET isDefaultAddress = 1 - WHERE id = NEW.defaultAddressFk; + WHERE id = NEW.defaultAddressFk; END IF; IF NOT (NEW.provinceFk <=> OLD.provinceFk) OR NOT (NEW.isVies <=> OLD.isVies) THEN INSERT IGNORE INTO ticketRecalc (ticketFk) - SELECT id FROM ticket t + SELECT id FROM ticket t WHERE t.clientFk = NEW.id AND t.refFk IS NULL; END IF; - + IF NOT NEW.isActive THEN UPDATE account.`user` SET active = FALSE @@ -23732,7 +23738,7 @@ CREATE TABLE `clientConsumptionQueue` ( `params` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`params`)), `queued` datetime NOT NULL DEFAULT current_timestamp(), `printed` datetime DEFAULT NULL, - `status` varchar(50) COLLATE utf8mb3_unicode_ci DEFAULT '', + `status` varchar(50) DEFAULT '', PRIMARY KEY (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='Queue for client consumption PDF mailing'; /*!40101 SET character_set_client = @saved_cs_client */; @@ -23747,8 +23753,8 @@ DROP TABLE IF EXISTS `clientContact`; CREATE TABLE `clientContact` ( `id` int(11) NOT NULL AUTO_INCREMENT, `clientFk` int(11) NOT NULL, - `name` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `phone` varchar(15) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `name` varchar(45) DEFAULT NULL, + `phone` varchar(15) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -23786,15 +23792,15 @@ DELIMITER ;; AFTER INSERT ON clientCredit FOR EACH ROW BEGIN - + DECLARE vSender VARCHAR(50); SELECT u.name INTO vSender FROM account.`user` u WHERE u.id = NEW.workerFk; - + IF vSender IN ('juanvi','pepe') THEN - + CALL `vn`.`mail_insert`('pako@verdnatura.es', NULL, CONCAT('ClientCredit ',vSender, ' ', NEW.clientFk, ' ' , NEW.amount, ' €'), @@ -23844,25 +23850,6 @@ CREATE TABLE `clientDms` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; --- --- Table structure for table `clientItemCategory` --- - -DROP TABLE IF EXISTS `clientItemCategory`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `clientItemCategory` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `clientFk` int(11) NOT NULL, - `itemCategoryFk` int(10) unsigned NOT NULL, - PRIMARY KEY (`id`), - KEY `clientItemCategory_FK` (`clientFk`), - KEY `clientItemCategory_FK_1` (`itemCategoryFk`), - CONSTRAINT `clientItemCategory_FK` FOREIGN KEY (`clientFk`) REFERENCES `client` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `clientItemCategory_FK_1` FOREIGN KEY (`itemCategoryFk`) REFERENCES `itemCategory` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - -- -- Table structure for table `clientItemType` -- @@ -23874,14 +23861,13 @@ CREATE TABLE `clientItemType` ( `id` int(11) NOT NULL AUTO_INCREMENT, `created` timestamp NOT NULL DEFAULT current_timestamp(), `clientFk` int(11) NOT NULL, - `itemTypeFk` varchar(3) COLLATE utf8mb3_unicode_ci NOT NULL, - `isAllowed` tinyint(1) DEFAULT 0, + `itemTypeFk` smallint(5) unsigned NOT NULL DEFAULT 1, PRIMARY KEY (`id`), KEY `clientItemType_FK` (`clientFk`), KEY `clientItemType_FK_1` (`itemTypeFk`), CONSTRAINT `clientItemType_FK` FOREIGN KEY (`clientFk`) REFERENCES `client` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `clientItemType_FK_1` FOREIGN KEY (`itemTypeFk`) REFERENCES `itemType` (`code`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='son familias de productos que se quieren sustraer a la oferta del cliente'; + CONSTRAINT `clientItemType_FK_1` FOREIGN KEY (`itemTypeFk`) REFERENCES `itemType` (`id`) +) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='son familias de productos que se quieren sustraer a la oferta del cliente'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -23895,14 +23881,14 @@ CREATE TABLE `clientLog` ( `id` int(11) NOT NULL AUTO_INCREMENT, `originFk` int(11) NOT NULL, `userFk` int(10) unsigned DEFAULT NULL, - `action` set('insert','update','delete') COLLATE utf8mb3_unicode_ci NOT NULL, + `action` set('insert','update','delete') NOT NULL, `creationDate` timestamp NULL DEFAULT current_timestamp(), - `description` text CHARACTER SET utf8mb3 DEFAULT NULL, - `changedModel` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `oldInstance` text COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `newInstance` text COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `description` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL, + `changedModel` varchar(45) DEFAULT NULL, + `oldInstance` text DEFAULT NULL, + `newInstance` text DEFAULT NULL, `changedModelId` int(11) DEFAULT NULL, - `changedModelValue` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `changedModelValue` varchar(45) DEFAULT NULL, PRIMARY KEY (`id`), KEY `originFk` (`originFk`), KEY `userFk` (`userFk`), @@ -23919,10 +23905,11 @@ DROP TABLE IF EXISTS `clientLost`; /*!50001 DROP VIEW IF EXISTS `clientLost`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `clientLost` AS SELECT - 1 AS `clientFk`, - 1 AS `lastShipped`, - 1 AS `notBuyingMonths` */; +/*!50001 CREATE TABLE `clientLost` ( + `clientFk` tinyint NOT NULL, + `lastShipped` tinyint NOT NULL, + `notBuyingMonths` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -23953,7 +23940,7 @@ CREATE TABLE `clientObservation` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, `clientFk` int(11) NOT NULL, `workerFk` int(10) unsigned DEFAULT NULL, - `text` text COLLATE utf8mb3_unicode_ci NOT NULL, + `text` text NOT NULL, `created` timestamp NOT NULL DEFAULT current_timestamp(), PRIMARY KEY (`id`), KEY `Id_Trabajador` (`workerFk`), @@ -23990,9 +23977,10 @@ DROP TABLE IF EXISTS `clientPhoneBook`; /*!50001 DROP VIEW IF EXISTS `clientPhoneBook`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `clientPhoneBook` AS SELECT - 1 AS `clientFk`, - 1 AS `phone` */; +/*!50001 CREATE TABLE `clientPhoneBook` ( + `clientFk` tinyint NOT NULL, + `phone` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -24061,8 +24049,8 @@ DROP TABLE IF EXISTS `clientType`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `clientType` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `code` varchar(20) CHARACTER SET utf8mb3 NOT NULL, - `type` varchar(45) COLLATE utf8mb3_unicode_ci NOT NULL, + `code` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, + `type` varchar(45) NOT NULL, `isCreatedAsServed` tinyint(1) DEFAULT 0, PRIMARY KEY (`id`), UNIQUE KEY `code_UNIQUE` (`code`) @@ -24112,19 +24100,19 @@ DROP TABLE IF EXISTS `cmr`; CREATE TABLE `cmr` ( `id` int(11) NOT NULL AUTO_INCREMENT, `ticketFk` int(11) DEFAULT NULL, - `truckPlate` varchar(30) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `observations` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `senderInstruccions` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT 'Flowers 4º C. Plants 14º C', - `paymentInstruccions` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT 'Carriage paid', - `specialAgreements` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `truckPlate` varchar(30) DEFAULT NULL, + `observations` varchar(255) DEFAULT NULL, + `senderInstruccions` varchar(255) DEFAULT 'Flowers 4º C. Plants 14º C', + `paymentInstruccions` varchar(255) DEFAULT 'Carriage paid', + `specialAgreements` varchar(255) DEFAULT NULL, `created` timestamp NULL DEFAULT current_timestamp(), `companyFk` smallint(5) unsigned DEFAULT NULL, `addressToFk` int(11) DEFAULT NULL, `addressFromFk` int(11) DEFAULT NULL, `supplierFk` int(11) DEFAULT NULL, - `packagesList` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `merchandiseDetail` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `state` varchar(100) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `packagesList` varchar(255) DEFAULT NULL, + `merchandiseDetail` varchar(255) DEFAULT NULL, + `state` varchar(100) DEFAULT NULL, `landed` datetime DEFAULT NULL COMMENT 'Hora de llegada a destino', `ead` datetime DEFAULT NULL COMMENT 'Estimated Arriving Date', PRIMARY KEY (`id`), @@ -24157,23 +24145,23 @@ BEGIN DECLARE vLastSenderInstructions VARCHAR(255); DECLARE vLastId INT; DECLARE vCurrentAgency INT; - + SELECT am.agencyFk INTO vCurrentAgency FROM vn.agencyMode am JOIN vn.ticket t ON t.agencyModeFk = am.id WHERE t.id = NEW.ticketFk; - + SELECT MAX(cmr.id) INTO vLastId FROM cmr JOIN vn.ticket t ON t.id = cmr.ticketFk JOIN vn.agencyMode am ON am.id = t.agencyModeFk - WHERE am.agencyFk = vCurrentAgency + WHERE am.agencyFk = vCurrentAgency ; - + SELECT senderInstruccions INTO vLastSenderInstructions FROM cmr WHERE id = vLastId; - + SET NEW.senderInstruccions = vLastSenderInstructions; END */;; @@ -24224,41 +24212,42 @@ DROP TABLE IF EXISTS `cmr_list`; /*!50001 DROP VIEW IF EXISTS `cmr_list`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `cmr_list` AS SELECT - 1 AS `cmrFk`, - 1 AS `ticketFk`, - 1 AS `truckPlate`, - 1 AS `observations`, - 1 AS `senderInstruccions`, - 1 AS `paymentInstruccions`, - 1 AS `specialAgreements`, - 1 AS `created`, - 1 AS `packagesList`, - 1 AS `clientName`, - 1 AS `clientPostalCode`, - 1 AS `clientStreet`, - 1 AS `clientCity`, - 1 AS `clientProvince`, - 1 AS `clientCountry`, - 1 AS `companyName`, - 1 AS `companyStreet`, - 1 AS `companyPostCode`, - 1 AS `companyCity`, - 1 AS `companyCountry`, - 1 AS `warehouseAddress`, - 1 AS `shipped`, - 1 AS `clientOficialName`, - 1 AS `supplierFk`, - 1 AS `carrierName`, - 1 AS `carrierStreet`, - 1 AS `carrierPostCode`, - 1 AS `carrierCity`, - 1 AS `carrierCountry`, - 1 AS `phone`, - 1 AS `mobile`, - 1 AS `addressFk`, - 1 AS `stamp`, - 1 AS `merchandiseDetail` */; +/*!50001 CREATE TABLE `cmr_list` ( + `cmrFk` tinyint NOT NULL, + `ticketFk` tinyint NOT NULL, + `truckPlate` tinyint NOT NULL, + `observations` tinyint NOT NULL, + `senderInstruccions` tinyint NOT NULL, + `paymentInstruccions` tinyint NOT NULL, + `specialAgreements` tinyint NOT NULL, + `created` tinyint NOT NULL, + `packagesList` tinyint NOT NULL, + `clientName` tinyint NOT NULL, + `clientPostalCode` tinyint NOT NULL, + `clientStreet` tinyint NOT NULL, + `clientCity` tinyint NOT NULL, + `clientProvince` tinyint NOT NULL, + `clientCountry` tinyint NOT NULL, + `companyName` tinyint NOT NULL, + `companyStreet` tinyint NOT NULL, + `companyPostCode` tinyint NOT NULL, + `companyCity` tinyint NOT NULL, + `companyCountry` tinyint NOT NULL, + `warehouseAddress` tinyint NOT NULL, + `shipped` tinyint NOT NULL, + `clientOficialName` tinyint NOT NULL, + `supplierFk` tinyint NOT NULL, + `carrierName` tinyint NOT NULL, + `carrierStreet` tinyint NOT NULL, + `carrierPostCode` tinyint NOT NULL, + `carrierCity` tinyint NOT NULL, + `carrierCountry` tinyint NOT NULL, + `phone` tinyint NOT NULL, + `mobile` tinyint NOT NULL, + `addressFk` tinyint NOT NULL, + `stamp` tinyint NOT NULL, + `merchandiseDetail` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -24273,7 +24262,7 @@ CREATE TABLE `collection` ( `created` timestamp NOT NULL DEFAULT current_timestamp(), `workerFk` int(10) unsigned DEFAULT NULL, `stateFk` tinyint(3) unsigned DEFAULT NULL, - `itemPackingTypeFk` varchar(1) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `itemPackingTypeFk` varchar(1) DEFAULT NULL, `saleTotalCount` int(11) NOT NULL DEFAULT 0, `salePickedCount` int(11) NOT NULL DEFAULT 0, `trainFk` int(11) NOT NULL DEFAULT 1, @@ -24307,33 +24296,33 @@ DELIMITER ;; BEFORE UPDATE ON `collection` FOR EACH ROW BEGIN - + DECLARE vStateFk INT; DECLARE vTotalLines INT; DECLARE vPickedLines INT; - IF NEW.saleTotalCount <= NEW.salePickedCount - AND (NEW.saleTotalCount != OLD.saleTotalCount + IF NEW.saleTotalCount <= NEW.salePickedCount + AND (NEW.saleTotalCount != OLD.saleTotalCount OR NEW.salePickedCount != OLD.salePickedCount) - THEN - + THEN + SELECT id INTO vStateFk - FROM vn.state + FROM vn.state WHERE code = 'PREPARED'; - + SET NEW.stateFk = vStateFk; - + END IF; - IF NEW.saleTotalCount > NEW.salePickedCount - AND (NEW.saleTotalCount != OLD.saleTotalCount OR NEW.salePickedCount != OLD.salePickedCount) THEN + IF NEW.saleTotalCount > NEW.salePickedCount + AND (NEW.saleTotalCount != OLD.saleTotalCount OR NEW.salePickedCount != OLD.salePickedCount) THEN SELECT id INTO vStateFk - FROM vn.state + FROM vn.state WHERE code = 'ON_PREPARATION'; - + SET NEW.stateFk = vStateFk; - + END IF; END */;; @@ -24352,11 +24341,11 @@ DROP TABLE IF EXISTS `collectionColors`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `collectionColors` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `code` varchar(20) COLLATE utf8mb3_unicode_ci NOT NULL, + `code` varchar(20) NOT NULL, `shelve` int(11) NOT NULL DEFAULT 1, `wagon` int(11) NOT NULL DEFAULT 1, `trainFk` int(11) NOT NULL DEFAULT 1, - `rgb` char(7) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `rgb` char(7) DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `collectionColors_UN` (`shelve`,`wagon`,`trainFk`), KEY `collectionColors_FK` (`trainFk`), @@ -24432,7 +24421,7 @@ CREATE TABLE `collectionVolumetry` ( `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 utf8mb3_unicode_ci NOT NULL DEFAULT 'H', + `itemPackingTypeFk` varchar(1) NOT NULL DEFAULT 'H', `trainFk` int(11) NOT NULL DEFAULT 1, PRIMARY KEY (`id`), KEY `collectionVolumetry_FK` (`itemPackingTypeFk`), @@ -24481,16 +24470,16 @@ DROP TABLE IF EXISTS `company`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `company` ( `id` smallint(5) unsigned NOT NULL, - `code` char(3) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `register` varchar(120) COLLATE utf8mb3_unicode_ci NOT NULL, + `code` char(3) DEFAULT NULL, + `register` varchar(120) NOT NULL, `workerManagerFk` int(10) unsigned NOT NULL, `registered` date NOT NULL, `expired` date DEFAULT NULL, `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 utf8mb3_unicode_ci NOT NULL, - `email` varchar(30) COLLATE utf8mb3_unicode_ci NOT NULL, + `rgb` varchar(6) NOT NULL, + `email` varchar(30) NOT NULL, `stamp` blob DEFAULT NULL, `created` timestamp NOT NULL ON UPDATE current_timestamp(), `clientFk` int(11) DEFAULT NULL, @@ -24500,8 +24489,8 @@ CREATE TABLE `company` ( `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 utf8mb3_unicode_ci DEFAULT NULL COMMENT 'pie de paginas en las facturas', - `phytosanitary` longtext COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `footnotes` longtext DEFAULT NULL COMMENT 'pie de paginas en las facturas', + `phytosanitary` longtext DEFAULT NULL, `fhAdminNumber` int(11) DEFAULT NULL COMMENT 'número de cliente en FloraHolland', PRIMARY KEY (`id`), UNIQUE KEY `companyCode_UNIQUE` (`code`), @@ -24526,7 +24515,7 @@ DROP TABLE IF EXISTS `companyGroup`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `companyGroup` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `code` varchar(45) COLLATE utf8mb3_unicode_ci NOT NULL, + `code` varchar(45) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -24555,12 +24544,12 @@ DROP TABLE IF EXISTS `component`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `component` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `name` varchar(45) COLLATE utf8mb3_unicode_ci NOT NULL, + `name` varchar(45) NOT NULL, `typeFk` int(11) NOT NULL, `classRate` smallint(6) DEFAULT NULL, `tax` double DEFAULT NULL, `isRenewable` tinyint(2) NOT NULL DEFAULT 1, - `code` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `code` varchar(45) DEFAULT NULL, `isRequired` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'Son componentes imprescindibles en toda venta', PRIMARY KEY (`id`), KEY `series_componentes_idx` (`typeFk`), @@ -24578,10 +24567,10 @@ DROP TABLE IF EXISTS `componentType`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `componentType` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `type` varchar(45) COLLATE utf8mb3_unicode_ci NOT NULL, + `type` varchar(45) 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, - `code` varchar(20) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `code` varchar(20) DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `Serie_UNIQUE` (`type`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='Permite organizar de forma ordenada los distintos componentes'; @@ -24596,7 +24585,7 @@ DROP TABLE IF EXISTS `confectionType`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `confectionType` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, - `description` varchar(45) COLLATE utf8mb3_unicode_ci NOT NULL, + `description` varchar(45) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -24615,9 +24604,9 @@ CREATE TABLE `config` ( `inventoried` datetime DEFAULT NULL, `itemLog` int(11) DEFAULT 0, `weekGoal` int(11) DEFAULT NULL, - `photosPath` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `photosPath` varchar(255) DEFAULT NULL, `cashBoxNumber` int(11) DEFAULT 0, - `redCode` varchar(50) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `redCode` varchar(50) DEFAULT NULL, `TabletTime` datetime DEFAULT NULL, `t0` int(11) NOT NULL DEFAULT 0, `t1` int(11) NOT NULL DEFAULT 0, @@ -24629,7 +24618,7 @@ CREATE TABLE `config` ( `campaignLife` tinyint(3) unsigned NOT NULL, `truckDays` tinyint(3) unsigned NOT NULL, `transportCharges` double NOT NULL, - `escanerPath` varchar(50) COLLATE utf8mb3_unicode_ci NOT NULL, + `escanerPath` varchar(50) NOT NULL, `printedTurn` int(4) DEFAULT NULL, `truckLength` int(11) DEFAULT 24, `fuelConsumption` int(11) DEFAULT NULL, @@ -24640,8 +24629,8 @@ CREATE TABLE `config` ( `kmPrice` decimal(10,1) DEFAULT NULL, `routeOption` int(11) DEFAULT 1, `dbproduccion` tinyint(1) NOT NULL DEFAULT 1, - `mdbServer` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL, - `fakeEmail` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `mdbServer` varchar(255) NOT NULL, + `fakeEmail` varchar(255) DEFAULT NULL, `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', @@ -24659,7 +24648,7 @@ DROP TABLE IF EXISTS `contactChannel`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `contactChannel` ( `id` smallint(6) NOT NULL AUTO_INCREMENT, - `name` varchar(45) COLLATE utf8mb3_unicode_ci NOT NULL, + `name` varchar(45) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='Canal por el que nos ha conocido un cliente y se ha dado de'; /*!40101 SET character_set_client = @saved_cs_client */; @@ -24673,8 +24662,8 @@ DROP TABLE IF EXISTS `continent`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `continent` ( `id` tinyint(4) NOT NULL AUTO_INCREMENT, - `name` varchar(50) COLLATE utf8mb3_unicode_ci NOT NULL, - `code` varchar(2) CHARACTER SET utf8mb3 NOT NULL, + `name` varchar(50) NOT NULL, + `code` varchar(2) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `continent_name_uindex` (`name`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='World continents'; @@ -24693,8 +24682,8 @@ CREATE TABLE `contratos_subvencion_270619` ( `cod_centroFk` int(11) NOT NULL, `CodContratoFk` int(11) NOT NULL, `journey` decimal(5,2) NOT NULL DEFAULT 8.00, - `name` varchar(50) COLLATE utf8mb3_unicode_ci NOT NULL, - `nif` varchar(12) COLLATE utf8mb3_unicode_ci NOT NULL, + `name` varchar(50) NOT NULL, + `nif` varchar(12) NOT NULL, PRIMARY KEY (`id`), KEY `contratos_subvencion_270619_fk2_idx` (`cod_centroFk`), KEY `contratos_subvencion_270619_fk1_idx` (`workerFk`), @@ -24738,7 +24727,7 @@ DROP TABLE IF EXISTS `conveyorBuildingClass`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `conveyorBuildingClass` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `description` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `description` varchar(255) DEFAULT NULL, `priority` int(11) NOT NULL DEFAULT 0, `weightThreshold` int(11) NOT NULL, PRIMARY KEY (`id`) @@ -24754,7 +24743,7 @@ DROP TABLE IF EXISTS `conveyorConfig`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `conveyorConfig` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `itemName` varchar(45) COLLATE utf8mb3_unicode_ci NOT NULL, + `itemName` varchar(45) NOT NULL, `length` int(11) DEFAULT NULL, `width` int(11) DEFAULT NULL, `height` int(11) DEFAULT NULL, @@ -24784,7 +24773,7 @@ CREATE TABLE `conveyorExpedition` ( `isIn` tinyint(4) NOT NULL DEFAULT 0, `productionMinute` int(11) DEFAULT NULL, `isOut` tinyint(4) NOT NULL DEFAULT 0, - `truck` varchar(20) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `truck` varchar(20) DEFAULT NULL, `criterion` int(11) DEFAULT NULL, `isHeavy` tinyint(1) NOT NULL DEFAULT 1, PRIMARY KEY (`expeditionFk`), @@ -24803,7 +24792,7 @@ DROP TABLE IF EXISTS `conveyorMode`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `conveyorMode` ( - `code` varchar(20) COLLATE utf8mb3_unicode_ci NOT NULL, + `code` varchar(20) NOT NULL, `saturacion` int(11) NOT NULL, `gap` int(11) NOT NULL, `isActive` tinyint(4) NOT NULL DEFAULT 0, @@ -24820,7 +24809,7 @@ DROP TABLE IF EXISTS `conveyorType`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `conveyorType` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `description` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `description` varchar(45) DEFAULT NULL, `color` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; @@ -24834,7 +24823,7 @@ DROP TABLE IF EXISTS `corridor`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `corridor` ( - `code` varchar(1) COLLATE utf8mb3_unicode_ci NOT NULL COMMENT 'letra que da nombre al pasillo', + `code` varchar(1) 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', `prepOrder` int(10) unsigned NOT NULL COMMENT 'orden de preparacion de los pasillos', PRIMARY KEY (`code`) @@ -24850,9 +24839,9 @@ DROP TABLE IF EXISTS `country`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `country` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, - `country` varchar(25) COLLATE utf8mb3_unicode_ci NOT NULL, + `country` varchar(25) NOT NULL, `CEE` tinyint(1) NOT NULL DEFAULT 1, - `code` varchar(2) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `code` varchar(2) DEFAULT NULL, `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, @@ -24999,7 +24988,7 @@ DROP TABLE IF EXISTS `cplusCorrectingType`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `cplusCorrectingType` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `description` varchar(45) COLLATE utf8mb3_unicode_ci NOT NULL, + `description` varchar(45) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -25013,7 +25002,7 @@ DROP TABLE IF EXISTS `cplusInvoiceType472`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `cplusInvoiceType472` ( `id` int(10) unsigned NOT NULL, - `description` varchar(255) CHARACTER SET utf8mb3 NOT NULL, + `description` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='(*18) TIPO FACTURA (Asientos)SOPORTADO – DEDUCIBLE (472)'; /*!40101 SET character_set_client = @saved_cs_client */; @@ -25027,7 +25016,7 @@ DROP TABLE IF EXISTS `cplusInvoiceType477`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `cplusInvoiceType477` ( `id` int(10) unsigned NOT NULL, - `description` varchar(255) CHARACTER SET utf8mb3 NOT NULL, + `description` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='(*18) TIPO FACTURA (Asientos)REPERCUTIDO - DEVENGADO (477)'; /*!40101 SET character_set_client = @saved_cs_client */; @@ -25041,7 +25030,7 @@ DROP TABLE IF EXISTS `cplusRectificationType`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `cplusRectificationType` ( `id` int(10) unsigned NOT NULL, - `description` varchar(255) CHARACTER SET utf8mb3 NOT NULL, + `description` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='(*20) TIPO RECTIFICATIVA (Asientos)'; /*!40101 SET character_set_client = @saved_cs_client */; @@ -25055,7 +25044,7 @@ DROP TABLE IF EXISTS `cplusSubjectOp`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `cplusSubjectOp` ( `id` int(10) unsigned NOT NULL, - `description` varchar(255) CHARACTER SET utf8mb3 NOT NULL, + `description` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='(*17) TIPO OPERACIÓN SUJETA/NO SUJETA (Asientos)'; /*!40101 SET character_set_client = @saved_cs_client */; @@ -25069,7 +25058,7 @@ DROP TABLE IF EXISTS `cplusTaxBreak`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `cplusTaxBreak` ( `id` int(10) unsigned NOT NULL, - `description` varchar(255) CHARACTER SET utf8mb3 NOT NULL, + `description` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='(*16) TIPO EXENCIÓN (Asientos)'; /*!40101 SET character_set_client = @saved_cs_client */; @@ -25083,7 +25072,7 @@ DROP TABLE IF EXISTS `cplusTerIdNif`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `cplusTerIdNif` ( `id` int(11) NOT NULL, - `description` varchar(255) CHARACTER SET utf8mb3 NOT NULL, + `description` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -25097,7 +25086,7 @@ DROP TABLE IF EXISTS `cplusTrascendency472`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `cplusTrascendency472` ( `id` int(10) unsigned NOT NULL, - `description` varchar(255) CHARACTER SET utf8mb3 NOT NULL, + `description` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='(*15) CLAVE DE RÉGIMEN ESPECIAL O TRASCENDENCIA(Asientos)SOPORTADO – DEDUCIBLE (472)'; /*!40101 SET character_set_client = @saved_cs_client */; @@ -25111,7 +25100,7 @@ DROP TABLE IF EXISTS `cplusTrascendency477`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `cplusTrascendency477` ( `id` int(10) unsigned NOT NULL, - `description` varchar(255) CHARACTER SET utf8mb3 NOT NULL, + `description` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='(*15) CLAVE DE RÉGIMEN ESPECIAL O TRASCENDENCIA(Asientos) REPERCUTIDO - DEVENGADO (477)'; /*!40101 SET character_set_client = @saved_cs_client */; @@ -25220,7 +25209,7 @@ BEGIN UPDATE `client` c JOIN vn.creditClassification cc ON cc.client = c.id SET creditInsurance = NEW.credit WHERE cc.id = NEW.creditClassification; - + END */;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -25237,8 +25226,8 @@ DROP TABLE IF EXISTS `currency`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `currency` ( `id` tinyint(3) unsigned NOT NULL, - `code` varchar(3) COLLATE utf8mb3_unicode_ci NOT NULL, - `name` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `code` varchar(3) NOT NULL, + `name` varchar(45) DEFAULT NULL, `ratio` double NOT NULL DEFAULT 1, PRIMARY KEY (`id`), UNIQUE KEY `Moneda_UNIQUE` (`code`) @@ -25254,11 +25243,11 @@ DROP TABLE IF EXISTS `customsAgent`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `customsAgent` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `fiscalName` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL, - `street` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `nif` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL, - `phone` varchar(16) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `email` varchar(150) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `fiscalName` varchar(50) NOT NULL, + `street` varchar(50) DEFAULT NULL, + `nif` varchar(50) NOT NULL, + `phone` varchar(16) DEFAULT NULL, + `email` varchar(150) DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `nif_UNIQUE` (`nif`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; @@ -25289,12 +25278,13 @@ DROP TABLE IF EXISTS `defaulter`; /*!50001 DROP VIEW IF EXISTS `defaulter`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `defaulter` AS SELECT - 1 AS `clientFk`, - 1 AS `created`, - 1 AS `amount`, - 1 AS `defaulterSinced`, - 1 AS `hasChanged` */; +/*!50001 CREATE TABLE `defaulter` ( + `clientFk` tinyint NOT NULL, + `created` tinyint NOT NULL, + `amount` tinyint NOT NULL, + `defaulterSinced` tinyint NOT NULL, + `hasChanged` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -25326,8 +25316,8 @@ DROP TABLE IF EXISTS `deliveryMethod`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `deliveryMethod` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `description` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `code` varchar(45) COLLATE utf8mb3_unicode_ci NOT NULL, + `description` varchar(45) DEFAULT NULL, + `code` varchar(45) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `code` (`code`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; @@ -25342,8 +25332,8 @@ DROP TABLE IF EXISTS `deliveryPoint`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `deliveryPoint` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `name` varchar(45) COLLATE utf8mb3_unicode_ci NOT NULL, - `ubication` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `name` varchar(45) NOT NULL, + `ubication` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -25356,18 +25346,18 @@ DROP TABLE IF EXISTS `delivery_zip`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `delivery_zip` ( - `postal_code` varchar(2) COLLATE utf8mb3_unicode_ci NOT NULL, - `country_code` varchar(5) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `place_name` varchar(150) COLLATE utf8mb3_unicode_ci NOT NULL, - `admin_name1` varchar(150) COLLATE utf8mb3_unicode_ci NOT NULL, - `code_name1` varchar(150) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `admin_name2` varchar(150) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `code_name2` varchar(2) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `admin_name3` varchar(150) COLLATE utf8mb3_unicode_ci NOT NULL, - `code_name3` varchar(5) COLLATE utf8mb3_unicode_ci NOT NULL, - `latitude` varchar(10) COLLATE utf8mb3_unicode_ci NOT NULL, - `longitude` varchar(10) COLLATE utf8mb3_unicode_ci NOT NULL, - `accuracy` varchar(1) COLLATE utf8mb3_unicode_ci NOT NULL, + `postal_code` varchar(2) NOT NULL, + `country_code` varchar(5) DEFAULT NULL, + `place_name` varchar(150) NOT NULL, + `admin_name1` varchar(150) NOT NULL, + `code_name1` varchar(150) DEFAULT NULL, + `admin_name2` varchar(150) DEFAULT NULL, + `code_name2` varchar(2) DEFAULT NULL, + `admin_name3` varchar(150) NOT NULL, + `code_name3` varchar(5) NOT NULL, + `latitude` varchar(10) NOT NULL, + `longitude` varchar(10) NOT NULL, + `accuracy` varchar(1) NOT NULL, `delivery_zipPK` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`delivery_zipPK`), KEY `country_code_idx` (`country_code`), @@ -25387,8 +25377,8 @@ DROP TABLE IF EXISTS `department`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `department` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `code` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `name` varchar(45) COLLATE utf8mb3_unicode_ci NOT NULL, + `code` varchar(45) DEFAULT NULL, + `name` varchar(45) NOT NULL, `lft` int(11) DEFAULT NULL, `rgt` int(11) DEFAULT NULL, `workerFk` int(10) unsigned DEFAULT NULL COMMENT 'Id_Trabajador es el jefe del departamento', @@ -25398,10 +25388,10 @@ CREATE TABLE `department` ( `depth` int(11) NOT NULL DEFAULT 0, `sons` decimal(10,0) NOT NULL DEFAULT 0, `parentFk` int(11) DEFAULT 1, - `path` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `chatName` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `path` varchar(255) DEFAULT NULL, + `chatName` varchar(45) DEFAULT NULL, `isTeleworking` tinyint(1) DEFAULT 0, - `notificationEmail` varchar(150) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `notificationEmail` varchar(150) 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()', `hasToCheckLogin` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'Para comprobar en el login de la app', @@ -25479,7 +25469,7 @@ BEGIN JOIN vn.department d ON d.id = b.departmentFk SET b.departmentFk = d.parentFk WHERE b.departmentFk = OLD.id; - + END */;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -25499,9 +25489,9 @@ DELIMITER ;; AFTER DELETE ON `department` FOR EACH ROW BEGIN - + UPDATE vn.department_recalc SET isChanged = TRUE; - + UPDATE vn.business b JOIN vn.department d ON d.id = b.departmentFk SET b.departmentFk = d.parentFk @@ -25521,9 +25511,10 @@ DROP TABLE IF EXISTS `departmentTree`; /*!50001 DROP VIEW IF EXISTS `departmentTree`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `departmentTree` AS SELECT - 1 AS `id`, - 1 AS `dep` */; +/*!50001 CREATE TABLE `departmentTree` ( + `id` tinyint NOT NULL, + `dep` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -25549,8 +25540,8 @@ DROP TABLE IF EXISTS `device`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `device` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `sn` varchar(50) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `model` varchar(50) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `sn` varchar(50) DEFAULT NULL, + `model` varchar(50) DEFAULT NULL, `userFk` int(10) unsigned NOT NULL, PRIMARY KEY (`id`), KEY `device_fk1_idx` (`userFk`), @@ -25567,16 +25558,41 @@ DROP TABLE IF EXISTS `deviceLog`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `deviceLog` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `android_id` varchar(100) COLLATE utf8mb3_unicode_ci NOT NULL, + `android_id` varchar(100) NOT NULL, `userFk` int(10) unsigned DEFAULT NULL, `created` timestamp NOT NULL DEFAULT current_timestamp(), - `nameApp` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `versionApp` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `nameApp` varchar(45) DEFAULT NULL, + `versionApp` varchar(45) DEFAULT NULL, + `deviceProductionFk` int(10) DEFAULT NULL, PRIMARY KEY (`id`), KEY `deviceLog_FK` (`userFk`), CONSTRAINT `deviceLog_FK` FOREIGN KEY (`userFk`) REFERENCES `worker` (`id`) ON UPDATE CASCADE ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_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 */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8mb4 */ ; +/*!50003 SET character_set_results = utf8mb4 */ ; +/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; +DELIMITER ;; +/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`deviceLog_beforeInsert` +BEFORE INSERT +ON deviceLog FOR EACH ROW +BEGIN + DECLARE vDeviceProductionFk INTEGER; + SELECT dp.id INTO vDeviceProductionFk + FROM deviceProduction dp + WHERE dp.android_id = NEW.android_id; + SET NEW.deviceProductionFk = vDeviceProductionFk; +END */;; +DELIMITER ; +/*!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 */ ; -- -- Table structure for table `deviceProduction` @@ -25587,24 +25603,67 @@ DROP TABLE IF EXISTS `deviceProduction`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `deviceProduction` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `imei` varchar(50) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `modelFk` varchar(50) COLLATE utf8mb3_unicode_ci NOT NULL, - `macWifi` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `serialNumber` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `departmentFk` int(11) DEFAULT NULL, - `isOutOfService` tinyint(1) NOT NULL DEFAULT 0 COMMENT '0: Ok - 1: No disponible - 2: Sat', - `android_id` varchar(50) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `imei` varchar(50) DEFAULT NULL, + `modelFk` varchar(50) NOT NULL, + `macWifi` varchar(45) DEFAULT NULL, + `serialNumber` varchar(45) DEFAULT NULL, + `android_id` varchar(50) DEFAULT NULL, `purchased` date NOT NULL DEFAULT '1900-01-01' COMMENT 'Fecha de compra', + `stateFk` varchar(50) DEFAULT 'idle', + `isInScalefusion` tinyint(1) DEFAULT 0 COMMENT 'Para saber si esta en Scalefusion', + `description` varchar(100) DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `device_id_UNIQUE` (`id`), UNIQUE KEY `sn_UNIQUE` (`imei`), UNIQUE KEY `serial_number_UN` (`serialNumber`), KEY `deviceProductionModelsFgn` (`modelFk`), - 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 + KEY `deviceProduction_FK` (`stateFk`), + CONSTRAINT `deviceProductionModelsFgn` FOREIGN KEY (`modelFk`) REFERENCES `deviceProductionModels` (`code`) ON UPDATE CASCADE, + CONSTRAINT `deviceProduction_FK` FOREIGN KEY (`stateFk`) REFERENCES `deviceProductionState` (`code`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_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 */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8mb4 */ ; +/*!50003 SET character_set_results = utf8mb4 */ ; +/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; +DELIMITER ;; +/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`deviceProduction_afterInsert` + AFTER INSERT + ON deviceProduction FOR EACH ROW +BEGIN + INSERT INTO deviceProductionLog (originFk, userFk, newInstance, action, changedModel, changedModelId) + VALUES(NEW.id, account.myUser_getId(), NEW.stateFk, 'INSERT', 'deviceProduction', NEW.id); +END */;; +DELIMITER ; +/*!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 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 = utf8mb4 */ ; +/*!50003 SET character_set_results = utf8mb4 */ ; +/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; +DELIMITER ;; +/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`deviceProduction_afterUpdate` + BEFORE UPDATE + ON vn.deviceProduction FOR EACH ROW +BEGIN + INSERT INTO deviceProductionLog (originFk, userFk, newInstance, oldInstance , action, changedModel, changedModelId) + VALUES(OLD.id, account.myUser_getId(), NEW.stateFk, OLD.stateFk , 'update', 'deviceProduction', OLD.id); +END */;; +DELIMITER ; +/*!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 */ ; -- -- Table structure for table `deviceProductionConfig` @@ -25646,6 +25705,28 @@ DELIMITER ; /*!50003 SET character_set_results = @saved_cs_results */ ; /*!50003 SET collation_connection = @saved_col_connection */ ; +-- +-- Table structure for table `deviceProductionLog` +-- + +DROP TABLE IF EXISTS `deviceProductionLog`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `deviceProductionLog` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `originFk` int(11) NOT NULL, + `userFk` int(10) unsigned DEFAULT NULL, + `deviceProduction` int(10) unsigned NOT NULL, + `action` set('insert','update','delete','retired') NOT NULL, + `created` timestamp NULL DEFAULT current_timestamp(), + `oldInstance` varchar(50) DEFAULT NULL, + `newInstance` varchar(50) DEFAULT NULL, + `changedModel` varchar(50) DEFAULT NULL, + `changedModelId` int(11) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + -- -- Table structure for table `deviceProductionModels` -- @@ -25654,7 +25735,21 @@ DROP TABLE IF EXISTS `deviceProductionModels`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `deviceProductionModels` ( - `code` varchar(50) COLLATE utf8mb3_unicode_ci NOT NULL, + `code` varchar(50) NOT NULL, + PRIMARY KEY (`code`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `deviceProductionState` +-- + +DROP TABLE IF EXISTS `deviceProductionState`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `deviceProductionState` ( + `code` varchar(50) NOT NULL, + `description` varchar(50) NOT NULL, PRIMARY KEY (`code`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -25677,6 +25772,35 @@ CREATE TABLE `deviceProductionUser` ( CONSTRAINT `deviceProductionUser_PK` FOREIGN KEY (`userFk`) REFERENCES `account`.`user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_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 */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8mb4 */ ; +/*!50003 SET character_set_results = utf8mb4 */ ; +/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; +DELIMITER ;; +/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`deviceProductionUser_afterDelete` + AFTER DELETE + ON deviceProductionUser FOR EACH ROW +BEGIN + INSERT INTO deviceProductionLog (originFk, userFk, oldInstance, action, changedModel, changedModelId) + SELECT + OLD.deviceProductionFk, + account.myUser_getId(), + stateFk, + 'DELETE', + 'deviceProductionUser', + OLD.deviceProductionFk + FROM deviceProduction + WHERE id = OLD.deviceProductionFk; +END */;; +DELIMITER ; +/*!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 */ ; -- -- Table structure for table `disabilityGrade` @@ -25687,7 +25811,7 @@ DROP TABLE IF EXISTS `disabilityGrade`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `disabilityGrade` ( `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Grados de discapacidad Modelo 145 IRPF', - `description` varchar(45) COLLATE utf8mb3_unicode_ci NOT NULL, + `description` varchar(45) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -25702,12 +25826,12 @@ DROP TABLE IF EXISTS `dms`; CREATE TABLE `dms` ( `id` int(11) NOT NULL AUTO_INCREMENT, `dmsTypeFk` int(11) NOT NULL DEFAULT 1, - `reference` varchar(50) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `description` varchar(200) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `reference` varchar(50) DEFAULT NULL, + `description` varchar(200) DEFAULT NULL, `companyFk` smallint(5) unsigned NOT NULL DEFAULT 442, `hardCopyNumber` mediumint(8) unsigned DEFAULT NULL, - `contentType` varchar(150) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `file` varchar(30) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `contentType` varchar(150) DEFAULT NULL, + `file` varchar(30) DEFAULT NULL, `hasFile` tinyint(4) NOT NULL DEFAULT 0, `workerFk` int(10) unsigned DEFAULT NULL, `created` timestamp NULL DEFAULT current_timestamp(), @@ -25739,20 +25863,20 @@ DELIMITER ;; BEGIN DECLARE vHardCopyNumber INT; DECLARE vDmsTypeCode INT; - + IF (SELECT NOT hasDms FROM warehouse WHERE id = NEW.warehouseFk) THEN CALL util.throw('this warehouse has not dms'); END IF; IF NEW.hasFile THEN - SELECT 1 + MAX(hardCopyNumber) INTO vHardCopyNumber - FROM dms + SELECT 1 + MAX(hardCopyNumber) INTO vHardCopyNumber + FROM dms WHERE warehouseFk = NEW.warehouseFk; - + SET NEW.hardCopyNumber = IFNULL(vHardCopyNumber,1); END IF; - - SELECT code INTO vDmsTypeCode + + SELECT code INTO vDmsTypeCode FROM dmsType WHERE NEW.dmsTypeFk = id; IF (vDmsTypeCode ='ticket') THEN UPDATE ticket SET isSigned = 1 WHERE id = NEW.reference; @@ -25777,24 +25901,24 @@ DELIMITER ;; FOR EACH ROW BEGIN DECLARE vHardCopyNumber INT; - + IF (NEW.hasFile <> 0) AND (OLD.hasFile = 0) AND (NEW.hardCopyNumber IS NULL) - OR + OR (NEW.hardCopyNumber = OLD.hardCopyNumber AND OLD.warehouseFk <> NEW.warehouseFk) THEN - - IF (SELECT NOT hasDms FROM warehouse WHERE id = NEW.warehouseFk) THEN + + IF (SELECT NOT hasDms FROM warehouse WHERE id = NEW.warehouseFk) THEN SET NEW.warehouseFk = (SELECT id FROM warehouse WHERE name = 'Algemesi'); END IF; - - SELECT 1 + MAX(hardCopyNumber) INTO vHardCopyNumber - FROM dms + + SELECT 1 + MAX(hardCopyNumber) INTO vHardCopyNumber + FROM dms WHERE warehouseFk = NEW.warehouseFk; - + SET NEW.hardCopyNumber = IFNULL(vHardCopyNumber,1); END IF; - + IF ((NEW.hardCopyNumber = 0) OR NEW.hardCopyNumber IS NULL) AND (OLD.hardCopyNumber <> 0) THEN - + SET NEW.hasFile = 0; END IF; END */;; @@ -25815,14 +25939,14 @@ DELIMITER ;; /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`dms_beforeDelete` BEFORE DELETE ON `dms` FOR EACH ROW -BEGIN +BEGIN DECLARE vCanNotBeDeleted INT; - SELECT COUNT(*) INTO vCanNotBeDeleted - FROM dmsType dt - WHERE NOT (code <=> 'trash') + SELECT COUNT(*) INTO vCanNotBeDeleted + FROM dmsType dt + WHERE NOT (code <=> 'trash') AND dt.id = OLD.dmsTypeFk; - - IF vCanNotBeDeleted THEN + + IF vCanNotBeDeleted THEN CALL util.throw('A dms can not be deleted'); END IF; END */;; @@ -25842,7 +25966,7 @@ DROP TABLE IF EXISTS `dmsRecover`; CREATE TABLE `dmsRecover` ( `id` int(11) NOT NULL AUTO_INCREMENT, `ticketFk` int(11) DEFAULT NULL, - `sign` text COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `sign` text DEFAULT NULL, `created` timestamp NULL DEFAULT current_timestamp(), PRIMARY KEY (`id`), KEY `ticketFk_idx` (`ticketFk`), @@ -25859,11 +25983,11 @@ DROP TABLE IF EXISTS `dmsType`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `dmsType` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `name` varchar(45) COLLATE utf8mb3_unicode_ci NOT NULL, - `path` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL, + `name` varchar(45) NOT NULL, + `path` varchar(255) NOT NULL, `writeRoleFk` int(10) unsigned DEFAULT NULL, `readRoleFk` int(10) unsigned DEFAULT NULL, - `code` varchar(45) COLLATE utf8mb3_unicode_ci NOT NULL, + `code` varchar(45) NOT NULL, `monthToDelete` int(10) unsigned DEFAULT NULL COMMENT 'Meses en el pasado para ir borrando registros, dejar a null para no borrarlos nunca', PRIMARY KEY (`id`), KEY `readRoleFk` (`readRoleFk`), @@ -25881,8 +26005,8 @@ DROP TABLE IF EXISTS `dock`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `dock` ( - `code` varchar(10) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '', - `description` varchar(50) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `code` varchar(10) NOT NULL DEFAULT '', + `description` varchar(50) DEFAULT NULL, PRIMARY KEY (`code`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='Se utiliza para el panel de grafana: https://grafana.verdnatura.es/d/w9w3Uo-7z/'; /*!40101 SET character_set_client = @saved_cs_client */; @@ -25896,10 +26020,11 @@ DROP TABLE IF EXISTS `docuware`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `docuware` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `code` varchar(50) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `fileCabinetName` varchar(50) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `dialogName` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `find` varchar(50) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `code` varchar(50) NOT NULL, + `fileCabinetName` varchar(50) NOT NULL, + `action` varchar(255) NOT NULL, + `dialogName` varchar(100) NOT NULL, + `findById` varchar(50) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -25913,8 +26038,8 @@ DROP TABLE IF EXISTS `docuwareConfig`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `docuwareConfig` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `url` varchar(75) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `token` varchar(1000) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `url` varchar(75) DEFAULT NULL, + `cookie` varchar(1000) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -25928,7 +26053,7 @@ DROP TABLE IF EXISTS `dua`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `dua` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `code` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `code` varchar(45) DEFAULT NULL, `awbFk` smallint(11) unsigned NOT NULL, `issued` date DEFAULT NULL, `operated` date DEFAULT NULL, @@ -26085,12 +26210,13 @@ DROP TABLE IF EXISTS `ediGenus`; /*!50001 DROP VIEW IF EXISTS `ediGenus`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `ediGenus` AS SELECT - 1 AS `id`, - 1 AS `latinGenusName`, - 1 AS `entried`, - 1 AS `dued`, - 1 AS `modified` */; +/*!50001 CREATE TABLE `ediGenus` ( + `id` tinyint NOT NULL, + `latinGenusName` tinyint NOT NULL, + `entried` tinyint NOT NULL, + `dued` tinyint NOT NULL, + `modified` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -26101,13 +26227,14 @@ DROP TABLE IF EXISTS `ediSpecie`; /*!50001 DROP VIEW IF EXISTS `ediSpecie`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `ediSpecie` AS SELECT - 1 AS `id`, - 1 AS `genusFk`, - 1 AS `latinSpeciesName`, - 1 AS `entried`, - 1 AS `dued`, - 1 AS `modified` */; +/*!50001 CREATE TABLE `ediSpecie` ( + `id` tinyint NOT NULL, + `genusFk` tinyint NOT NULL, + `latinSpeciesName` tinyint NOT NULL, + `entried` tinyint NOT NULL, + `dued` tinyint NOT NULL, + `modified` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -26119,7 +26246,7 @@ DROP TABLE IF EXISTS `educationLevel`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `educationLevel` ( `id` smallint(6) NOT NULL, - `name` varchar(200) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `name` varchar(200) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='Nivel de formación mismo de a3'; /*!40101 SET character_set_client = @saved_cs_client */; @@ -26137,12 +26264,12 @@ CREATE TABLE `ektEntryAssign` ( `sub` mediumint(8) unsigned DEFAULT NULL, `pro` mediumint(8) unsigned DEFAULT NULL, `auction` int(11) DEFAULT NULL, - `warehouseOutFk` int(11) DEFAULT NULL, - `warehouseInFk` int(11) DEFAULT NULL, - `agencyModeFk` int(11) DEFAULT NULL, - `supplierFk` int(11) DEFAULT NULL, + `warehouseOutFk` int(11) NOT NULL, + `warehouseInFk` int(11) NOT NULL, + `agencyModeFk` int(11) NOT NULL, + `supplierFk` int(11) NOT NULL, `entryFk` int(11) DEFAULT NULL, - `ref` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `ref` varchar(45) DEFAULT NULL, `addressFk` int(11) DEFAULT NULL, `companyFk` smallint(5) unsigned NOT NULL DEFAULT 442, PRIMARY KEY (`id`), @@ -26178,10 +26305,14 @@ DELIMITER ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; -/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER ektEntryAssign_afterUpdate -AFTER UPDATE -ON ektEntryAssign FOR EACH ROW - UPDATE entry SET reference = NEW.`ref` WHERE id = NEW.entryFk */;; +/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER vn.ektEntryAssign_afterUpdate + AFTER UPDATE ON ektEntryAssign + FOR EACH ROW +BEGIN + IF NOT(NEW.`ref` <=> OLD.`ref`) OR NOT(NEW.`entryFk` <=> OLD.`entryFk`) THEN + UPDATE entry SET reference = NEW.`ref` WHERE id = NEW.entryFk; + END IF; +END */;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; /*!50003 SET character_set_client = @saved_cs_client */ ; @@ -26196,11 +26327,12 @@ DROP TABLE IF EXISTS `ektSubAddress`; /*!50001 DROP VIEW IF EXISTS `ektSubAddress`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `ektSubAddress` AS SELECT - 1 AS `sub`, - 1 AS `clientFk`, - 1 AS `nickname`, - 1 AS `addressFk` */; +/*!50001 CREATE TABLE `ektSubAddress` ( + `sub` tinyint NOT NULL, + `clientFk` tinyint NOT NULL, + `nickname` tinyint NOT NULL, + `addressFk` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -26212,8 +26344,8 @@ DROP TABLE IF EXISTS `emergencyMedia`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `emergencyMedia` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `name` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `value` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL COMMENT 'Table to save all emergency phones', + `name` varchar(45) DEFAULT NULL, + `value` varchar(45) DEFAULT NULL COMMENT 'Table to save all emergency phones', PRIMARY KEY (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -26227,7 +26359,7 @@ DROP TABLE IF EXISTS `energyInput`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `energyInput` ( `input` int(11) NOT NULL COMMENT 'The input number', - `description` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL, + `description` varchar(255) NOT NULL, `consumption` int(11) NOT NULL COMMENT 'Consumption in watts', PRIMARY KEY (`input`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='Defines inputs and the power of each one'; @@ -26260,16 +26392,16 @@ CREATE TABLE `entry` ( `id` int(11) NOT NULL AUTO_INCREMENT, `supplierFk` int(11) NOT NULL DEFAULT 644, `dated` datetime NOT NULL, - `invoiceNumber` varchar(50) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `invoiceNumber` varchar(50) DEFAULT NULL, `isBooked` tinyint(1) NOT NULL DEFAULT 0, `isExcludedFromAvailable` tinyint(1) NOT NULL DEFAULT 0, - `notes` longtext COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `notes` longtext 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 utf8mb3_unicode_ci DEFAULT NULL, + `evaNotes` varchar(45) DEFAULT NULL, `travelFk` int(11) unsigned DEFAULT NULL, `currencyFk` tinyint(3) unsigned DEFAULT 1, `companyFk` smallint(5) unsigned NOT NULL DEFAULT 442, @@ -26283,8 +26415,8 @@ CREATE TABLE `entry` ( `auction` int(11) DEFAULT NULL, `invoiceAmount` decimal(10,2) DEFAULT NULL, `buyerFk` int(10) unsigned DEFAULT NULL, - `typeFk` varchar(100) COLLATE utf8mb3_unicode_ci DEFAULT NULL COMMENT 'Tipo de entrada', - `reference` varchar(50) COLLATE utf8mb3_unicode_ci DEFAULT NULL COMMENT 'Referencia para eti', + `typeFk` varchar(100) DEFAULT NULL COMMENT 'Tipo de entrada', + `reference` varchar(50) DEFAULT NULL COMMENT 'Referencia para eti', `ref` varchar(50) GENERATED ALWAYS AS (`invoiceNumber`) VIRTUAL COMMENT 'Columna virtual provisional para Salix', `observationEditorFk` INT(10) unsigned NULL COMMENT 'Último usuario que ha modificado el campo evaNotes', PRIMARY KEY (`id`), @@ -26339,7 +26471,7 @@ DELIMITER ;; /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`entry_afterInsert` AFTER INSERT ON `entry` FOR EACH ROW -BEGIN +BEGIN CALL travel_requestRecalc(NEW.travelFk); END */;; DELIMITER ; @@ -26379,7 +26511,7 @@ BEGIN SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'A cloned entry cannot be moved to a travel with different warehouses'; END IF; - + IF NEW.travelFk IS NULL THEN SELECT COUNT(*) INTO vPrintedCount FROM buy @@ -26399,7 +26531,7 @@ BEGIN END IF; IF !(NEW.travelFk <=> OLD.travelFk) - OR !(NEW.currencyFk <=> OLD.currencyFk) THEN + OR !(NEW.currencyFk <=> OLD.currencyFk) THEN SET NEW.commission = entry_getCommission(NEW.travelFk, NEW.currencyFk,NEW.supplierFk); END IF; @@ -26434,7 +26566,7 @@ BEGIN OR !(NEW.isRaid <=> OLD.isRaid) THEN CALL stock.log_add('entry', NEW.id, OLD.id); END IF; - + IF !(NEW.travelFk <=> OLD.travelFk) THEN CALL travel_requestRecalc(OLD.travelFk); CALL travel_requestRecalc(NEW.travelFk); @@ -26487,7 +26619,7 @@ DELIMITER ;; /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`entry_afterDelete` AFTER DELETE ON `entry` FOR EACH ROW -BEGIN +BEGIN CALL travel_requestRecalc(OLD.travelFk); END */;; DELIMITER ; @@ -26505,7 +26637,7 @@ DROP TABLE IF EXISTS `entryConfig`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `entryConfig` ( `defaultEntry` int(11) NOT NULL, - `mailToNotify` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `mailToNotify` varchar(255) DEFAULT NULL, `inventorySupplierFk` int(11) DEFAULT 4, PRIMARY KEY (`defaultEntry`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; @@ -26522,14 +26654,14 @@ CREATE TABLE `entryLog` ( `id` int(11) NOT NULL AUTO_INCREMENT, `originFk` int(11) NOT NULL, `userFk` int(10) unsigned NOT NULL, - `action` set('insert','update','delete') COLLATE utf8mb3_unicode_ci NOT NULL, + `action` set('insert','update','delete') NOT NULL, `creationDate` timestamp NULL DEFAULT current_timestamp(), - `description` text CHARACTER SET utf8mb3 DEFAULT NULL, - `changedModel` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `oldInstance` text COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `newInstance` text COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `description` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL, + `changedModel` varchar(45) DEFAULT NULL, + `oldInstance` text DEFAULT NULL, + `newInstance` text DEFAULT NULL, `changedModelId` int(11) DEFAULT NULL, - `changedModelValue` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `changedModelValue` varchar(45) DEFAULT NULL, PRIMARY KEY (`id`), KEY `logEntry_ibfk_1` (`originFk`), KEY `entryLog_ibfk_2` (`userFk`), @@ -26549,7 +26681,7 @@ CREATE TABLE `entryObservation` ( `id` int(11) NOT NULL AUTO_INCREMENT, `entryFk` int(11) NOT NULL, `observationTypeFk` tinyint(3) unsigned DEFAULT NULL, - `description` text COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `description` text DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `entryFk_observationTypeFk_UNIQUE` (`entryFk`,`observationTypeFk`), KEY `observationType_id_observationTypeFk` (`observationTypeFk`), @@ -26566,8 +26698,8 @@ DROP TABLE IF EXISTS `entryType`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `entryType` ( - `code` varchar(100) COLLATE utf8mb3_unicode_ci NOT NULL, - `description` varchar(100) COLLATE utf8mb3_unicode_ci NOT NULL, + `code` varchar(100) NOT NULL, + `description` varchar(100) NOT NULL, PRIMARY KEY (`code`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -26594,9 +26726,9 @@ DROP TABLE IF EXISTS `envialiaAgency`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `envialiaAgency` ( - `id` varchar(6) COLLATE utf8mb3_unicode_ci NOT NULL, - `route` varchar(3) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `agencyName` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `id` varchar(6) NOT NULL, + `route` varchar(3) DEFAULT NULL, + `agencyName` varchar(45) DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `id_UNIQUE` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; @@ -26611,9 +26743,9 @@ DROP TABLE IF EXISTS `envialiaCity`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `envialiaCity` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `city` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL, - `postalCode` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL, - `agencyFk` varchar(45) COLLATE utf8mb3_unicode_ci NOT NULL, + `city` varchar(255) NOT NULL, + `postalCode` varchar(255) NOT NULL, + `agencyFk` varchar(45) NOT NULL, PRIMARY KEY (`id`), KEY `agencyFk` (`agencyFk`), KEY `postalCode` (`postalCode`) @@ -26628,11 +26760,11 @@ DROP TABLE IF EXISTS `envialiaConfig`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `envialiaConfig` ( - `serviceType` varchar(3) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '024' COMMENT 'Tipo de servicio en horas. 024 -> servicio las 24h', - `numBox` varchar(3) COLLATE utf8mb3_unicode_ci DEFAULT '001' COMMENT 'cajas por envio', + `serviceType` varchar(3) NOT NULL DEFAULT '024' COMMENT 'Tipo de servicio en horas. 024 -> servicio las 24h', + `numBox` varchar(3) DEFAULT '001' COMMENT 'cajas por envio', `startRange` bigint(25) DEFAULT NULL COMMENT 'Principio del rango que nos proporciona enviaría', `endRange` bigint(25) DEFAULT NULL COMMENT 'limite del rango que nos proporciona enviaría', - `cargoAgency` varchar(25) COLLATE utf8mb3_unicode_ci DEFAULT '004666' COMMENT 'numero de verdnatura dado por enviaría', + `cargoAgency` varchar(25) 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', `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', @@ -26649,7 +26781,7 @@ DROP TABLE IF EXISTS `errorLogApp`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `errorLogApp` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `error` varchar(55) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `error` varchar(55) DEFAULT NULL, `date` datetime DEFAULT NULL, `workerFk` int(11) DEFAULT NULL, PRIMARY KEY (`id`) @@ -26666,16 +26798,16 @@ DROP TABLE IF EXISTS `errorProduction`; CREATE TABLE `errorProduction` ( `id` int(11) NOT NULL AUTO_INCREMENT, `userFk` int(11) DEFAULT NULL, - `firstname` varchar(100) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `lastname` varchar(100) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `rol` varchar(100) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `firstname` varchar(100) DEFAULT NULL, + `lastname` varchar(100) DEFAULT NULL, + `rol` varchar(100) DEFAULT NULL, `ticketNumber` int(11) DEFAULT NULL, `lineNumber` int(11) DEFAULT NULL, `error` int(11) DEFAULT NULL, `volume` double DEFAULT NULL, - `hourStart` varchar(100) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `hourEnd` varchar(100) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `hourWorked` varchar(100) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `hourStart` varchar(100) DEFAULT NULL, + `hourEnd` varchar(100) DEFAULT NULL, + `hourWorked` varchar(100) DEFAULT NULL, `dated` date DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; @@ -26713,10 +26845,11 @@ DROP TABLE IF EXISTS `exchangeInsuranceEntry`; /*!50001 DROP VIEW IF EXISTS `exchangeInsuranceEntry`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `exchangeInsuranceEntry` AS SELECT - 1 AS `dated`, - 1 AS `Dolares`, - 1 AS `rate` */; +/*!50001 CREATE TABLE `exchangeInsuranceEntry` ( + `dated` tinyint NOT NULL, + `Dolares` tinyint NOT NULL, + `rate` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -26727,10 +26860,11 @@ 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 VIEW `exchangeInsuranceIn` AS SELECT - 1 AS `dated`, - 1 AS `amount`, - 1 AS `rate` */; +/*!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; -- @@ -26741,10 +26875,11 @@ DROP TABLE IF EXISTS `exchangeInsuranceOut`; /*!50001 DROP VIEW IF EXISTS `exchangeInsuranceOut`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `exchangeInsuranceOut` AS SELECT - 1 AS `received`, - 1 AS `divisa`, - 1 AS `rate` */; +/*!50001 CREATE TABLE `exchangeInsuranceOut` ( + `received` tinyint NOT NULL, + `divisa` tinyint NOT NULL, + `rate` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -26755,14 +26890,15 @@ 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 VIEW `exchangeReportSourcePrevious` AS SELECT - 1 AS `dated`, - 1 AS `amountIn`, - 1 AS `rateIn`, - 1 AS `amountOut`, - 1 AS `rateOut`, - 1 AS `amountEntry`, - 1 AS `rateEntry` */; +/*!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; -- @@ -26774,7 +26910,7 @@ DROP TABLE IF EXISTS `excuse`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `excuse` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `txt` varchar(255) CHARACTER SET latin1 NOT NULL, + `txt` varchar(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL, `date` datetime NOT NULL DEFAULT current_timestamp(), PRIMARY KEY (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; @@ -26793,13 +26929,13 @@ CREATE TABLE `expedition` ( `ticketFk` int(10) NOT NULL, `freightItemFk` int(11) DEFAULT 1 COMMENT 'itemFk del artículo que nos va a facturar el proveedor de transporte.', `created` timestamp NULL DEFAULT current_timestamp(), - `itemFk` int(11) DEFAULT NULL COMMENT 'Si es necesario el itemFk del cubo, se obtiene mediante packagingFk, join packing.itemFk', + `itemFk__` int(11) DEFAULT NULL COMMENT 'Si es necesario el itemFk del cubo, se obtiene mediante packagingFk, join packing.itemFk', `counter` smallint(5) unsigned NOT NULL, `workerFk` int(10) unsigned DEFAULT NULL, - `externalId` varchar(20) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `packagingFk` varchar(10) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `itemPackingTypeFk` varchar(1) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `hostFk` varchar(6) COLLATE utf8mb3_unicode_ci NOT NULL, + `externalId` varchar(20) DEFAULT NULL, + `packagingFk` varchar(10) DEFAULT NULL, + `itemPackingTypeFk` varchar(1) DEFAULT NULL, + `hostFk` varchar(6) NOT NULL, `stateTypeFk` int(11) DEFAULT NULL COMMENT 'Ultimo estado de la expedicion', `hasNewRoute` bit(1) NOT NULL DEFAULT b'0', `isBox` int(11) GENERATED ALWAYS AS (`freightItemFk`) VIRTUAL COMMENT 'Columna virtual provisional para Salix', @@ -26836,17 +26972,17 @@ BEGIN DECLARE intcounter INT; DECLARE vShipFk INT; - IF NEW.freightItemFk IS NOT NULL THEN + IF NEW.freightItemFk IS NOT NULL THEN UPDATE ticket SET packages = nz(packages) + 1 WHERE id = NEW.ticketFk; - SELECT IFNULL(MAX(counter),0) +1 INTO intcounter - FROM expedition e - INNER JOIN ticket t1 ON e.ticketFk = t1.id + SELECT IFNULL(MAX(counter),0) +1 INTO intcounter + FROM expedition e + INNER JOIN ticket t1 ON e.ticketFk = t1.id LEFT JOIN ticketState ts ON ts.ticket = t1.id - INNER JOIN ticket t2 ON t2.addressFk = t1.addressFk AND DATE(t2.shipped) = DATE(t1.shipped) + INNER JOIN ticket t2 ON t2.addressFk = t1.addressFk AND DATE(t2.shipped) = DATE(t1.shipped) AND t1.warehouseFk = t2.warehouseFk - WHERE t2.id = NEW.ticketFk AND ts.alertLevel < 3 AND t1.companyFk = t2.companyFk + WHERE t2.id = NEW.ticketFk AND ts.alertLevel < 3 AND t1.companyFk = t2.companyFk AND t1.agencyModeFk = t2.agencyModeFk; SET NEW.`counter` = intcounter; @@ -26871,9 +27007,9 @@ DELIMITER ;; FOR EACH ROW BEGIN IF NEW.counter <> OLD.counter THEN - IF (SELECT COUNT(*) FROM expedition e + IF (SELECT COUNT(*) FROM expedition e INNER JOIN ticket t1 ON e.ticketFk = t1.id - INNER JOIN ticket t2 ON t2.addressFk = t1.addressFk AND DATE(t2.shipped) = DATE(t1.shipped) + INNER JOIN ticket t2 ON t2.addressFk = t1.addressFk AND DATE(t2.shipped) = DATE(t1.shipped) WHERE t1.id = NEW.ticketFk AND counter = NEW.counter) > 0 THEN SET NEW.id = NULL; END IF; @@ -26897,11 +27033,11 @@ DELIMITER ;; BEFORE DELETE ON `expedition` FOR EACH ROW BEGIN - UPDATE ticket t - SET packages = (SELECT COUNT(counter)-1 + UPDATE ticket t + SET packages = (SELECT COUNT(counter)-1 FROM expedition e WHERE e.ticketFk = OLD.ticketFk and e.freightItemFk) - WHERE t.id = OLD.ticketFk; - + WHERE t.id = OLD.ticketFk; + END */;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -26933,18 +27069,19 @@ DROP TABLE IF EXISTS `expeditionCommon`; /*!50001 DROP VIEW IF EXISTS `expeditionCommon`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `expeditionCommon` AS SELECT - 1 AS `truckFk`, - 1 AS `etd`, - 1 AS `description`, - 1 AS `palletFk`, - 1 AS `routeFk`, - 1 AS `scanFk`, - 1 AS `expeditionFk`, - 1 AS `expeditionTruckFk`, - 1 AS `warehouseFk`, - 1 AS `lastPacked`, - 1 AS `ticketFk` */; +/*!50001 CREATE TABLE `expeditionCommon` ( + `truckFk` tinyint NOT NULL, + `etd` tinyint NOT NULL, + `description` tinyint NOT NULL, + `palletFk` tinyint NOT NULL, + `routeFk` tinyint NOT NULL, + `scanFk` tinyint NOT NULL, + `expeditionFk` tinyint NOT NULL, + `expeditionTruckFk` tinyint NOT NULL, + `warehouseFk` tinyint NOT NULL, + `lastPacked` tinyint NOT NULL, + `ticketFk` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -26957,12 +27094,12 @@ DROP TABLE IF EXISTS `expeditionMistake`; CREATE TABLE `expeditionMistake` ( `expeditionFk` int(11) NOT NULL, `workerFk` int(10) unsigned NOT NULL COMMENT 'Quien marca el error', - `typeFk` varchar(15) COLLATE utf8mb3_unicode_ci NOT NULL, + `typeFk` varchar(15) NOT NULL, `created` timestamp NOT NULL DEFAULT current_timestamp(), PRIMARY KEY (`expeditionFk`), KEY `expeditionMistake_FK_1` (`workerFk`), KEY `expeditionMistake_FK_2` (`typeFk`), - CONSTRAINT `expeditionMistake_FK` FOREIGN KEY (`expeditionFk`) REFERENCES `expedition` (`id`) ON UPDATE CASCADE, + CONSTRAINT `expeditionMistake_FK` FOREIGN KEY (`expeditionFk`) REFERENCES `expedition` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `expeditionMistake_FK_1` FOREIGN KEY (`workerFk`) REFERENCES `worker` (`id`) ON UPDATE CASCADE, CONSTRAINT `expeditionMistake_FK_2` FOREIGN KEY (`typeFk`) REFERENCES `expeditionMistakeType` (`code`) ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='Errores de encajadores'; @@ -26976,8 +27113,8 @@ DROP TABLE IF EXISTS `expeditionMistakeType`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `expeditionMistakeType` ( - `code` varchar(15) COLLATE utf8mb3_unicode_ci NOT NULL, - `description` varchar(45) COLLATE utf8mb3_unicode_ci NOT NULL, + `code` varchar(15) NOT NULL, + `description` varchar(45) NOT NULL, PRIMARY KEY (`code`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -27015,13 +27152,13 @@ DELIMITER ;; BEGIN DECLARE vNewPosition INT; - + SELECT MAX(position) + 1 INTO vNewPosition FROM vn.expeditionPallet WHERE truckFk = NEW.truckFk; - + SET NEW.position = IFNULL(vNewPosition,1); - + END */;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -27037,15 +27174,16 @@ 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 VIEW `expeditionPallet_Print` AS SELECT - 1 AS `truck`, - 1 AS `routeFk`, - 1 AS `zone`, - 1 AS `eti`, - 1 AS `palletFk`, - 1 AS `isMatch`, - 1 AS `warehouseFk`, - 1 AS `nombreDia` */; +/*!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; -- @@ -27056,13 +27194,14 @@ DROP TABLE IF EXISTS `expeditionRoute_Monitor`; /*!50001 DROP VIEW IF EXISTS `expeditionRoute_Monitor`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `expeditionRoute_Monitor` AS SELECT - 1 AS `routeFk`, - 1 AS `tickets`, - 1 AS `expeditions`, - 1 AS `scanned`, - 1 AS `lastPacked`, - 1 AS `created` */; +/*!50001 CREATE TABLE `expeditionRoute_Monitor` ( + `routeFk` tinyint NOT NULL, + `tickets` tinyint NOT NULL, + `expeditions` tinyint NOT NULL, + `scanned` tinyint NOT NULL, + `lastPacked` tinyint NOT NULL, + `created` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -27073,13 +27212,14 @@ DROP TABLE IF EXISTS `expeditionRoute_freeTickets`; /*!50001 DROP VIEW IF EXISTS `expeditionRoute_freeTickets`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `expeditionRoute_freeTickets` AS SELECT - 1 AS `routeFk`, - 1 AS `ticket`, - 1 AS `code`, - 1 AS `almacen`, - 1 AS `updated`, - 1 AS `parkingCode` */; +/*!50001 CREATE TABLE `expeditionRoute_freeTickets` ( + `routeFk` tinyint NOT NULL, + `ticket` tinyint NOT NULL, + `code` tinyint NOT NULL, + `almacen` tinyint NOT NULL, + `updated` tinyint NOT NULL, + `parkingCode` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -27120,7 +27260,7 @@ DELIMITER ;; BEGIN SET NEW.workerFk = vn.getUser(); - + END */;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -27136,16 +27276,17 @@ DROP TABLE IF EXISTS `expeditionScan_Monitor`; /*!50001 DROP VIEW IF EXISTS `expeditionScan_Monitor`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `expeditionScan_Monitor` AS SELECT - 1 AS `truckFk`, - 1 AS `ETD`, - 1 AS `description`, - 1 AS `palletFk`, - 1 AS `position`, - 1 AS `built`, - 1 AS `scanFk`, - 1 AS `expeditionFk`, - 1 AS `scanned` */; +/*!50001 CREATE TABLE `expeditionScan_Monitor` ( + `truckFk` tinyint NOT NULL, + `ETD` tinyint NOT NULL, + `description` tinyint NOT NULL, + `palletFk` tinyint NOT NULL, + `position` tinyint NOT NULL, + `built` tinyint NOT NULL, + `scanFk` tinyint NOT NULL, + `expeditionFk` tinyint NOT NULL, + `scanned` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -27181,9 +27322,9 @@ DELIMITER ;; BEFORE INSERT ON expeditionState FOR EACH ROW BEGIN - + SET NEW.userFk = account.myUser_getId(); - + END */;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -27207,7 +27348,7 @@ BEGIN UPDATE vn.expedition e SET e.stateTypeFk = NEW.typeFk WHERE e.id = NEW.expeditionFk; - + END */;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -27224,8 +27365,8 @@ DROP TABLE IF EXISTS `expeditionStateType`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `expeditionStateType` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `description` varchar(100) COLLATE utf8mb3_unicode_ci NOT NULL, - `code` varchar(100) COLLATE utf8mb3_unicode_ci NOT NULL, + `description` varchar(100) NOT NULL, + `code` varchar(100) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='Posibles estados de una expedición'; /*!40101 SET character_set_client = @saved_cs_client */; @@ -27238,21 +27379,22 @@ DROP TABLE IF EXISTS `expeditionSticker`; /*!50001 DROP VIEW IF EXISTS `expeditionSticker`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `expeditionSticker` AS SELECT - 1 AS `expeditionFk`, - 1 AS `ticketFk`, - 1 AS `addressFk`, - 1 AS `clientFk`, - 1 AS `street`, - 1 AS `postalCode`, - 1 AS `city`, - 1 AS `nickname`, - 1 AS `routeFk`, - 1 AS `beachFk`, - 1 AS `zona`, - 1 AS `province`, - 1 AS `phone`, - 1 AS `workerCode` */; +/*!50001 CREATE TABLE `expeditionSticker` ( + `expeditionFk` tinyint NOT NULL, + `ticketFk` tinyint NOT NULL, + `addressFk` tinyint NOT NULL, + `clientFk` tinyint NOT NULL, + `street` tinyint NOT NULL, + `postalCode` tinyint NOT NULL, + `city` tinyint NOT NULL, + `nickname` tinyint NOT NULL, + `routeFk` tinyint NOT NULL, + `beachFk` tinyint NOT NULL, + `zona` tinyint NOT NULL, + `province` tinyint NOT NULL, + `phone` tinyint NOT NULL, + `workerCode` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -27263,11 +27405,12 @@ DROP TABLE IF EXISTS `expeditionTicket_NoBoxes`; /*!50001 DROP VIEW IF EXISTS `expeditionTicket_NoBoxes`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `expeditionTicket_NoBoxes` AS SELECT - 1 AS `ticketFk`, - 1 AS `warehouseFk`, - 1 AS `routeFk`, - 1 AS `description` */; +/*!50001 CREATE TABLE `expeditionTicket_NoBoxes` ( + `ticketFk` tinyint NOT NULL, + `warehouseFk` tinyint NOT NULL, + `routeFk` tinyint NOT NULL, + `description` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -27278,13 +27421,14 @@ DROP TABLE IF EXISTS `expeditionTimeExpended`; /*!50001 DROP VIEW IF EXISTS `expeditionTimeExpended`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `expeditionTimeExpended` AS SELECT - 1 AS `ticketFk`, - 1 AS `started`, - 1 AS `finished`, - 1 AS `cajas`, - 1 AS `code`, - 1 AS `warehouseFk` */; +/*!50001 CREATE TABLE `expeditionTimeExpended` ( + `ticketFk` tinyint NOT NULL, + `started` tinyint NOT NULL, + `finished` tinyint NOT NULL, + `cajas` tinyint NOT NULL, + `code` tinyint NOT NULL, + `warehouseFk` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -27296,13 +27440,23 @@ DROP TABLE IF EXISTS `expeditionTruck`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `expeditionTruck` ( `id` int(11) NOT NULL AUTO_INCREMENT, + `roadmapFk` int(10) unsigned DEFAULT NULL, + `warehouseFk` smallint(6) unsigned DEFAULT NULL, `ETD` datetime DEFAULT NULL, - `description` varchar(45) COLLATE utf8mb3_unicode_ci NOT NULL, + `description` varchar(45) NOT NULL, `bufferFk` int(11) DEFAULT NULL COMMENT 'buffer destino de las cajas', + `created` timestamp NULL DEFAULT current_timestamp(), + `userFk` int(10) unsigned DEFAULT NULL, PRIMARY KEY (`id`), KEY `expeditionTruck_idx1` (`ETD`), KEY `expeditionTruck_FK` (`bufferFk`), - CONSTRAINT `expeditionTruck_FK` FOREIGN KEY (`bufferFk`) REFERENCES `srt`.`buffer` (`id`) ON DELETE SET NULL ON UPDATE CASCADE + KEY `expeditionTruck_FK_1` (`warehouseFk`), + KEY `expeditionTruck_FK_2` (`roadmapFk`), + KEY `expeditionTruck_FK_3` (`userFk`), + CONSTRAINT `expeditionTruck_FK` FOREIGN KEY (`bufferFk`) REFERENCES `srt`.`buffer` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, + CONSTRAINT `expeditionTruck_FK_1` FOREIGN KEY (`warehouseFk`) REFERENCES `warehouse` (`id`) ON UPDATE CASCADE, + CONSTRAINT `expeditionTruck_FK_2` FOREIGN KEY (`roadmapFk`) REFERENCES `roadmap` (`id`) ON UPDATE CASCADE, + CONSTRAINT `expeditionTruck_FK_3` FOREIGN KEY (`userFk`) REFERENCES `account`.`user` (`id`) ON UPDATE CASCADE ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; @@ -27358,17 +27512,18 @@ DROP TABLE IF EXISTS `expeditionTruck_Control`; /*!50001 DROP VIEW IF EXISTS `expeditionTruck_Control`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `expeditionTruck_Control` AS SELECT - 1 AS `id`, - 1 AS `ETD`, - 1 AS `description`, - 1 AS `ticketsSinBultos`, - 1 AS `pallets`, - 1 AS `routes`, - 1 AS `scans`, - 1 AS `expeditions`, - 1 AS `fallos`, - 1 AS `lastPacked` */; +/*!50001 CREATE TABLE `expeditionTruck_Control` ( + `id` tinyint NOT NULL, + `ETD` tinyint NOT NULL, + `description` tinyint NOT NULL, + `ticketsSinBultos` tinyint NOT NULL, + `pallets` tinyint NOT NULL, + `routes` tinyint NOT NULL, + `scans` tinyint NOT NULL, + `expeditions` tinyint NOT NULL, + `fallos` tinyint NOT NULL, + `lastPacked` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -27379,16 +27534,17 @@ DROP TABLE IF EXISTS `expeditionTruck_Control_Detail`; /*!50001 DROP VIEW IF EXISTS `expeditionTruck_Control_Detail`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `expeditionTruck_Control_Detail` AS SELECT - 1 AS `id`, - 1 AS `ETD`, - 1 AS `destino`, - 1 AS `pallet`, - 1 AS `routes`, - 1 AS `scans`, - 1 AS `destinos`, - 1 AS `fallos`, - 1 AS `lastPacked` */; +/*!50001 CREATE TABLE `expeditionTruck_Control_Detail` ( + `id` tinyint NOT NULL, + `ETD` tinyint NOT NULL, + `destino` tinyint NOT NULL, + `pallet` tinyint NOT NULL, + `routes` tinyint NOT NULL, + `scans` tinyint NOT NULL, + `destinos` tinyint NOT NULL, + `fallos` tinyint NOT NULL, + `lastPacked` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -27399,17 +27555,18 @@ DROP TABLE IF EXISTS `expeditionTruck_Control_Detail_Pallet`; /*!50001 DROP VIEW IF EXISTS `expeditionTruck_Control_Detail_Pallet`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `expeditionTruck_Control_Detail_Pallet` AS SELECT - 1 AS `id`, - 1 AS `ETD`, - 1 AS `destino`, - 1 AS `pallet`, - 1 AS `route`, - 1 AS `scans`, - 1 AS `destinos`, - 1 AS `fallos`, - 1 AS `expeditionTruckFk`, - 1 AS `lastPacked` */; +/*!50001 CREATE TABLE `expeditionTruck_Control_Detail_Pallet` ( + `id` tinyint NOT NULL, + `ETD` tinyint NOT NULL, + `destino` tinyint NOT NULL, + `pallet` tinyint NOT NULL, + `route` tinyint NOT NULL, + `scans` tinyint NOT NULL, + `destinos` tinyint NOT NULL, + `fallos` tinyint NOT NULL, + `expeditionTruckFk` tinyint NOT NULL, + `lastPacked` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -27424,7 +27581,7 @@ CREATE TABLE `expence` ( `name` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL, `isWithheld` tinyint(4) NOT NULL DEFAULT 0, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -27435,9 +27592,10 @@ DROP TABLE IF EXISTS `firstTicketShipped`; /*!50001 DROP VIEW IF EXISTS `firstTicketShipped`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `firstTicketShipped` AS SELECT - 1 AS `shipped`, - 1 AS `clientFk` */; +/*!50001 CREATE TABLE `firstTicketShipped` ( + `shipped` tinyint NOT NULL, + `clientFk` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -27448,13 +27606,14 @@ DROP TABLE IF EXISTS `floraHollandBuyedItems`; /*!50001 DROP VIEW IF EXISTS `floraHollandBuyedItems`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `floraHollandBuyedItems` AS SELECT - 1 AS `itemFk`, - 1 AS `longName`, - 1 AS `quantity`, - 1 AS `buyingValue`, - 1 AS `landed`, - 1 AS `companyFk` */; +/*!50001 CREATE TABLE `floraHollandBuyedItems` ( + `itemFk` tinyint NOT NULL, + `longName` tinyint NOT NULL, + `quantity` tinyint NOT NULL, + `buyingValue` tinyint NOT NULL, + `landed` tinyint NOT NULL, + `companyFk` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -27507,8 +27666,8 @@ DROP TABLE IF EXISTS `fuelType`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `fuelType` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `name` varchar(45) COLLATE utf8mb3_unicode_ci NOT NULL, - `code` varchar(45) COLLATE utf8mb3_unicode_ci NOT NULL, + `name` varchar(45) NOT NULL, + `code` varchar(45) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `code_UNIQUE` (`code`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; @@ -27523,7 +27682,7 @@ DROP TABLE IF EXISTS `gateArea`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `gateArea` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `name` varchar(45) COLLATE utf8mb3_unicode_ci NOT NULL, + `name` varchar(45) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `name_UNIQUE` (`name`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; @@ -27540,13 +27699,13 @@ CREATE TABLE `genericAllocation` ( `id` int(11) NOT NULL AUTO_INCREMENT, `itemFk` int(11) NOT NULL, `typeFk` smallint(5) unsigned NOT NULL COMMENT ' vn.itemType.id', - `origin` varchar(50) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `color` varchar(50) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `quality` varchar(10) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `numFlores` varchar(10) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `category` varchar(50) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `productor` varchar(50) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `longName` varchar(100) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `origin` varchar(50) DEFAULT NULL, + `color` varchar(50) DEFAULT NULL, + `quality` varchar(10) DEFAULT NULL, + `numFlores` varchar(10) DEFAULT NULL, + `category` varchar(50) DEFAULT NULL, + `productor` varchar(50) DEFAULT NULL, + `longName` varchar(100) DEFAULT NULL, `size` int(11) DEFAULT NULL, `startDated` date DEFAULT NULL, `endDated` date DEFAULT NULL, @@ -27574,7 +27733,7 @@ DROP TABLE IF EXISTS `genus`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `genus` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `name` varchar(100) COLLATE utf8mb3_unicode_ci NOT NULL, + `name` varchar(100) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `genus_PK2` (`name`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; @@ -27591,8 +27750,8 @@ CREATE TABLE `glsConfig` ( `id` int(11) NOT NULL AUTO_INCREMENT, `service` int(1) DEFAULT NULL, `schedule` int(1) DEFAULT NULL, - `token` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `labelType` varchar(3) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `token` varchar(45) DEFAULT NULL, + `labelType` varchar(3) DEFAULT NULL, `supplierFk` int(11) DEFAULT NULL, `package` int(1) DEFAULT NULL, `refund` int(1) DEFAULT NULL, @@ -27611,21 +27770,21 @@ DROP TABLE IF EXISTS `greuge`; CREATE TABLE `greuge` ( `Id` int(10) unsigned NOT NULL AUTO_INCREMENT, `clientFk` int(10) unsigned NOT NULL, - `description` varchar(45) COLLATE utf8mb3_unicode_ci NOT NULL, + `description` varchar(45) 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(), `greugeTypeFk` int(11) DEFAULT NULL, `ticketFk` int(11) DEFAULT NULL, - `userFK` int(10) unsigned DEFAULT NULL, + `userFk` int(10) unsigned DEFAULT NULL, PRIMARY KEY (`Id`), KEY `greuges_type_fk_idx` (`greugeTypeFk`), KEY `Id_Ticket_Greuge_Ticket_idx` (`ticketFk`), KEY `Greuges_cliente_idx` (`clientFk`), KEY `greuge_shipped_IDX` (`shipped`) USING BTREE, - KEY `greuge_FK` (`userFK`), + KEY `greuge_FK` (`userFk`), CONSTRAINT `Id_Ticket_Greuge_Ticket` FOREIGN KEY (`ticketFk`) REFERENCES `ticket` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `greuge_FK` FOREIGN KEY (`userFK`) REFERENCES `account`.`user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `greuge_FK` FOREIGN KEY (`userFk`) REFERENCES `account`.`user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `greuges_type_fk` FOREIGN KEY (`greugeTypeFk`) REFERENCES `greugeType` (`id`) ON DELETE SET NULL ON UPDATE CASCADE ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci ROW_FORMAT=COMPACT; /*!40101 SET character_set_client = @saved_cs_client */; @@ -27676,8 +27835,8 @@ DROP TABLE IF EXISTS `greugeType`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `greugeType` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `name` varchar(45) COLLATE utf8mb3_unicode_ci NOT NULL, - `code` varchar(45) COLLATE utf8mb3_unicode_ci NOT NULL, + `name` varchar(45) NOT NULL, + `code` varchar(45) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -27691,10 +27850,10 @@ DROP TABLE IF EXISTS `host`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `host` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `code` varchar(30) CHARACTER SET utf8mb3 NOT NULL, - `description` varchar(50) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `code` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, + `description` varchar(50) DEFAULT NULL, `workerFk` int(10) unsigned DEFAULT NULL, - `windowsSerial` varchar(40) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `windowsSerial` varchar(40) DEFAULT NULL, `printerFk` tinyint(3) unsigned DEFAULT NULL, `warehouseFk` smallint(5) unsigned DEFAULT 60, `companyFk` smallint(5) unsigned DEFAULT 442, @@ -27750,7 +27909,7 @@ CREATE TABLE `improvedGeneralLog` ( `tables` char(64) NOT NULL DEFAULT '', `type` set('Select','Insert','Update','Delete') DEFAULT NULL, PRIMARY KEY (`user`,`db`,`tables`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -27766,7 +27925,7 @@ CREATE TABLE `improvedGeneralLogProcedures` ( `routine` char(64) NOT NULL DEFAULT '', `type` enum('FUNCTION','PROCEDURE') NOT NULL, PRIMARY KEY (`user`,`db`,`routine`,`type`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -27777,8 +27936,8 @@ DROP TABLE IF EXISTS `incoterms`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `incoterms` ( - `code` varchar(3) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '', - `name` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `code` varchar(3) NOT NULL DEFAULT '', + `name` varchar(45) DEFAULT NULL, PRIMARY KEY (`code`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='Internacional Commercial Terms'; /*!40101 SET character_set_client = @saved_cs_client */; @@ -27791,14 +27950,14 @@ DROP TABLE IF EXISTS `ink`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `ink` ( - `id` char(3) COLLATE utf8mb3_unicode_ci NOT NULL, - `name` varchar(50) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `id` char(3) NOT NULL, + `name` varchar(50) DEFAULT NULL, `picture` blob NOT NULL, `showOrder` int(11) NOT NULL, `ball` blob DEFAULT NULL, `isCargex` tinyint(4) NOT NULL DEFAULT 0, - `dutchCode` varchar(3) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `hex` varchar(6) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `dutchCode` varchar(3) DEFAULT NULL, + `hex` varchar(6) DEFAULT NULL, `isRealColor` tinyint(1) NOT NULL DEFAULT 1, PRIMARY KEY (`id`), UNIQUE KEY `dutchCode_UNIQUE` (`dutchCode`), @@ -27814,9 +27973,9 @@ DROP TABLE IF EXISTS `inkI18n`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `inkI18n` ( - `inkFk` char(3) COLLATE utf8mb3_unicode_ci NOT NULL, - `lang` char(2) CHARACTER SET utf8mb3 NOT NULL, - `name` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL, + `inkFk` char(3) NOT NULL, + `lang` char(2) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, + `name` varchar(255) NOT NULL, PRIMARY KEY (`inkFk`,`lang`), CONSTRAINT `inkI18n_FK` FOREIGN KEY (`inkFk`) REFERENCES `ink` (`id`) ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; @@ -27830,9 +27989,10 @@ DROP TABLE IF EXISTS `inkL10n`; /*!50001 DROP VIEW IF EXISTS `inkL10n`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `inkL10n` AS SELECT - 1 AS `id`, - 1 AS `name` */; +/*!50001 CREATE TABLE `inkL10n` ( + `id` tinyint NOT NULL, + `name` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -27844,7 +28004,7 @@ DROP TABLE IF EXISTS `intrastat`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `intrastat` ( `id` int(8) unsigned zerofill NOT NULL, - `description` varchar(50) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `description` varchar(50) DEFAULT NULL, `taxClassFk` tinyint(3) unsigned NOT NULL DEFAULT 2, `taxCodeFk` tinyint(2) unsigned NOT NULL DEFAULT 64, PRIMARY KEY (`id`), @@ -27870,7 +28030,7 @@ CREATE TABLE `inventoryFailure` ( `throwerFk` int(10) unsigned DEFAULT NULL, `guiltyFk` int(10) unsigned DEFAULT NULL, `causeFk` int(11) DEFAULT NULL, - `explanation` varchar(250) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `explanation` varchar(250) DEFAULT NULL, PRIMARY KEY (`id`), KEY `inventoryFailure_fk1_idx` (`itemFk`), KEY `inventoryFailure_fk2_idx` (`throwerFk`), @@ -27894,7 +28054,7 @@ DROP TABLE IF EXISTS `inventoryFailureCause`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `inventoryFailureCause` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `description` varchar(100) COLLATE utf8mb3_unicode_ci NOT NULL, + `description` varchar(100) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -27933,15 +28093,16 @@ DROP TABLE IF EXISTS `invoiceCorrectionDataSource`; /*!50001 DROP VIEW IF EXISTS `invoiceCorrectionDataSource`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `invoiceCorrectionDataSource` AS SELECT - 1 AS `itemFk`, - 1 AS `quantity`, - 1 AS `concept`, - 1 AS `price`, - 1 AS `discount`, - 1 AS `refFk`, - 1 AS `saleFk`, - 1 AS `shipped` */; +/*!50001 CREATE TABLE `invoiceCorrectionDataSource` ( + `itemFk` tinyint NOT NULL, + `quantity` tinyint NOT NULL, + `concept` tinyint NOT NULL, + `price` tinyint NOT NULL, + `discount` tinyint NOT NULL, + `refFk` tinyint NOT NULL, + `saleFk` tinyint NOT NULL, + `shipped` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -27953,7 +28114,7 @@ DROP TABLE IF EXISTS `invoiceCorrectionType`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `invoiceCorrectionType` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `description` varchar(100) COLLATE utf8mb3_unicode_ci NOT NULL, + `description` varchar(100) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `description_UNIQUE` (`description`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; @@ -27969,10 +28130,10 @@ DROP TABLE IF EXISTS `invoiceIn`; CREATE TABLE `invoiceIn` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, `serialNumber` mediumint(11) unsigned DEFAULT NULL COMMENT 'insertado por Trigger', - `serial` char(1) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'R', + `serial` char(1) NOT NULL DEFAULT 'R', `supplierFk` int(11) NOT NULL, `issued` date DEFAULT NULL COMMENT 'Fecha de emision de la factura', - `supplierRef` varchar(50) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `supplierRef` varchar(50) 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(), @@ -27988,7 +28149,7 @@ CREATE TABLE `invoiceIn` ( `bookEntried` date DEFAULT NULL COMMENT 'Fecha Asiento', `isVatDeductible` tinyint(1) NOT NULL DEFAULT 1, `withholdingSageFk` smallint(6) DEFAULT NULL COMMENT 'Tipos de retención SAGE', - `expenceFkDeductible` varchar(10) CHARACTER SET utf8mb3 DEFAULT NULL, + `expenceFkDeductible` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL, PRIMARY KEY (`id`), KEY `proveedor_id` (`supplierFk`), KEY `empresa_id` (`companyFk`), @@ -28032,49 +28193,49 @@ BEGIN DECLARE vIssuingCountry, vhostCountry INT; DECLARE vActive TINYINT; DECLARE vWithholdingSageFk INT; - - SELECT withholdingSageFk INTO vWithholdingSageFk - FROM vn.supplier + + SELECT withholdingSageFk INTO vWithholdingSageFk + FROM vn.supplier WHERE id = NEW.supplierFk; - SET NEW.withholdingSageFk = vWithholdingSageFk; - - SELECT countryFk, isActive INTO vIssuingCountry, vActive - FROM vn.supplier + SET NEW.withholdingSageFk = vWithholdingSageFk; + + SELECT countryFk, isActive INTO vIssuingCountry, vActive + FROM vn.supplier WHERE id = NEW.supplierFk; - - SELECT countryFk INTO vhostCountry - FROM vn.supplier + + SELECT countryFk INTO vhostCountry + FROM vn.supplier WHERE id = NEW.companyFk; IF vActive = 0 THEN CALL util.throw('INACTIVE_PROVIDER'); END IF; - - IF (SELECT COUNT(*) FROM vn.invoiceIn - WHERE supplierRef = NEW.supplierRef - AND supplierFk = NEW.supplierFk + + IF (SELECT COUNT(*) FROM vn.invoiceIn + WHERE supplierRef = NEW.supplierRef + AND supplierFk = NEW.supplierFk AND YEAR(issued) = YEAR(NEW.issued) ) THEN CALL util.throw('reference duplicated'); END IF; - + SELECT CASE WHEN (SELECT account FROM vn.supplier where id = NEW.supplierFk) LIKE '___3______' THEN 'C' - WHEN (SELECT vIssuingCountry=vhostCountry from vn.country p1 join vn.country p2 ON p2.id = vhostCountry AND p1.id = vIssuingCountry + WHEN (SELECT vIssuingCountry=vhostCountry from vn.country p1 join vn.country p2 ON p2.id = vhostCountry AND p1.id = vIssuingCountry where p1.CEE < 2 and p2.CEE < 2) = 1 THEN 'R' - WHEN (SELECT vIssuingCountry <> vhostCountry from vn.country p1 join vn.country p2 ON p2.id = vhostCountry AND p1.id = vIssuingCountry - where p1.CEE < 2 and p2.CEE < 2) = 1 THEN 'E' + WHEN (SELECT vIssuingCountry <> vhostCountry from vn.country p1 join vn.country p2 ON p2.id = vhostCountry AND p1.id = vIssuingCountry + where p1.CEE < 2 and p2.CEE < 2) = 1 THEN 'E' WHEN (SELECT vIssuingCountry<>vhostCountry from vn.country p1 join vn.country p2 ON p2.id = vhostCountry AND p1.id = vIssuingCountry - where NOT p1.CEE < 2 AND not p1.id = 1) = 1 THEN 'W' + where NOT p1.CEE < 2 AND not p1.id = 1) = 1 THEN 'W' END INTO vSerie; - + SET NEW.serial = IFNULL(vSerie,'R'); IF vSerie LIKE 'W' THEN - SELECT IFNULL(MAX(serialNumber) + 1,1) INTO vNumReceived - FROM invoiceIn - WHERE `serial` LIKE NEW.serial AND - YEAR(issued) = YEAR(NEW.issued) AND + SELECT IFNULL(MAX(serialNumber) + 1,1) INTO vNumReceived + FROM invoiceIn + WHERE `serial` LIKE NEW.serial AND + YEAR(issued) = YEAR(NEW.issued) AND companyFk = NEW.companyFk; SET NEW.serialNumber = vNumReceived; END IF; @@ -28100,9 +28261,9 @@ BEGIN DECLARE vWithholdingSageFk INT; - IF (SELECT COUNT(*) FROM vn.invoiceIn - WHERE supplierRef = NEW.supplierRef - AND supplierFk = NEW.supplierFk + IF (SELECT COUNT(*) FROM vn.invoiceIn + WHERE supplierRef = NEW.supplierRef + AND supplierFk = NEW.supplierFk AND YEAR(issued) = YEAR(NEW.issued) AND id <> NEW.id ) THEN @@ -28112,7 +28273,7 @@ BEGIN IF NEW.supplierFk != OLD.supplierFk THEN CALL supplier_checkIsActive(NEW.supplierFk); SELECT withholdingSageFk INTO vWithholdingSageFk - FROM vn.supplier + FROM vn.supplier WHERE id = NEW.supplierFk; SET NEW.withholdingSageFk = vWithholdingSageFk; END IF; @@ -28137,23 +28298,23 @@ DELIMITER ;; FOR EACH ROW BEGIN - IF NEW.issued != OLD.issued + IF NEW.issued != OLD.issued OR NEW.currencyFk != OLD.currencyFk THEN UPDATE invoiceInTax iit JOIN invoiceIn ii ON ii.id = iit.invoiceInFk LEFT JOIN referenceRate rr ON rr.dated = ii.issued - AND rr.currencyFk = ii.currencyFk + AND rr.currencyFk = ii.currencyFk SET iit.taxableBase = IF(iit.foreignValue IS NULL, iit.taxableBase, iit.foreignValue / rr.value) WHERE ii.id = NEW.id; - + UPDATE invoiceInDueDay iidd JOIN invoiceIn ii ON ii.id = iidd.invoiceInFk LEFT JOIN referenceRate rr ON rr.dated = ii.issued - AND rr.currencyFk = ii.currencyFk + AND rr.currencyFk = ii.currencyFk SET iidd.amount = IF(iidd.foreignValue IS NULL, iidd.amount, iidd.foreignValue / rr.value) - WHERE ii.id = NEW.id; - + WHERE ii.id = NEW.id; + END IF; END */;; @@ -28163,6 +28324,24 @@ DELIMITER ; /*!50003 SET character_set_results = @saved_cs_results */ ; /*!50003 SET collation_connection = @saved_col_connection */ ; +-- +-- Table structure for table `invoiceInConfig` +-- + +DROP TABLE IF EXISTS `invoiceInConfig`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `invoiceInConfig` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `retentionRate` int(3) NOT NULL, + `retentionName` varchar(25) NOT NULL, + `sageWithholdingFk` smallint(6) NOT NULL, + PRIMARY KEY (`id`), + KEY `invoiceInConfig_sageWithholdingFk` (`sageWithholdingFk`), + CONSTRAINT `invoiceInConfig_sageWithholdingFk` FOREIGN KEY (`sageWithholdingFk`) REFERENCES `sage`.`TiposRetencion` (`CodigoRetencion`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + -- -- Table structure for table `invoiceInDueDay` -- @@ -28199,13 +28378,13 @@ DELIMITER ;; FOR EACH ROW BEGIN DECLARE vIsNotified BOOLEAN; - - SELECT isNotified INTO vIsNotified - FROM vn.invoiceIn ii + + SELECT isNotified INTO vIsNotified + FROM vn.invoiceIn ii JOIN vn.supplier s ON s.id = ii.supplierFk JOIN vn.payMethod pm ON pm.id = s.payMethodFk WHERE ii.id = NEW.invoiceInFk; - + IF (NEW.dueDated <= util.VN_CURDATE() AND vIsNotified) THEN CALL mail_insert( @@ -28213,12 +28392,12 @@ BEGIN 'begonya@verdnatura.es', 'Añadido vencimiento en el pasado', CONCAT( - account.myUser_getName(), ' ha añadido un vencimiento de ', + account.myUser_getName(), ' ha añadido un vencimiento de ', NEW.amount, '€ en una fecha pasada en la recibida ', NEW.invoiceInFk ) ); END IF; - + END */;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -28239,13 +28418,13 @@ DELIMITER ;; FOR EACH ROW BEGIN DECLARE vIsNotified BOOLEAN; - - SELECT isNotified INTO vIsNotified - FROM vn.invoiceIn ii + + SELECT isNotified INTO vIsNotified + FROM vn.invoiceIn ii JOIN vn.supplier s ON s.id = ii.supplierFk JOIN vn.payMethod pm ON pm.id = s.payMethodFk WHERE ii.id = NEW.invoiceInFk; - + IF (NEW.dueDated <= util.VN_CURDATE() AND vIsNotified) THEN CALL mail_insert( @@ -28253,12 +28432,12 @@ BEGIN 'begonya@verdnatura.es', 'Añadido vencimiento en el pasado', CONCAT( - account.myUser_getName(), ' ha añadido un vencimiento de ', + account.myUser_getName(), ' ha añadido un vencimiento de ', NEW.amount,'€ en una fecha pasada en la recibida ',NEW.invoiceInFk ) ); END IF; - + END */;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -28302,14 +28481,14 @@ CREATE TABLE `invoiceInLog` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `originFk` mediumint(8) unsigned NOT NULL, `userFk` int(10) unsigned DEFAULT NULL, - `action` set('insert','update','delete') COLLATE utf8mb3_unicode_ci NOT NULL, + `action` set('insert','update','delete') NOT NULL, `creationDate` timestamp NULL DEFAULT current_timestamp(), - `description` text CHARACTER SET utf8mb3 DEFAULT NULL, - `changedModel` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `oldInstance` text COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `newInstance` text COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `description` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL, + `changedModel` varchar(45) DEFAULT NULL, + `oldInstance` text DEFAULT NULL, + `newInstance` text DEFAULT NULL, `changedModelId` int(11) DEFAULT NULL, - `changedModelValue` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `changedModelValue` varchar(45) DEFAULT NULL, PRIMARY KEY (`id`), KEY `originFk` (`originFk`), KEY `userFk` (`userFk`), @@ -28327,12 +28506,12 @@ DROP TABLE IF EXISTS `invoiceInSage`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `invoiceInSage` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `taxClassFk` varchar(1) COLLATE utf8mb3_unicode_ci NOT NULL, - `invoiceInSerialFk` varchar(2) COLLATE utf8mb3_unicode_ci NOT NULL, + `taxClassFk` varchar(1) NOT NULL, + `invoiceInSerialFk` varchar(2) 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', - `expenceFk` varchar(10) CHARACTER SET utf8mb3 NOT NULL, + `expenceFk` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, `withholdingSageFk` smallint(6) DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `invoiceInSafe_unique` (`taxClassFk`,`invoiceInSerialFk`,`isService`,`withholdingSageFk`), @@ -28359,10 +28538,10 @@ DROP TABLE IF EXISTS `invoiceInSerial`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `invoiceInSerial` ( - `code` varchar(2) COLLATE utf8mb3_unicode_ci NOT NULL, - `description` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `code` varchar(2) NOT NULL, + `description` varchar(45) DEFAULT NULL, `cplusTerIdNifFk` int(11) NOT NULL DEFAULT 1, - `taxAreaFk` varchar(15) CHARACTER SET utf8mb3 DEFAULT NULL, + `taxAreaFk` varchar(15) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL, PRIMARY KEY (`code`), KEY `InvoiceInSerial_Fk1_idx` (`cplusTerIdNifFk`), KEY `InvoiceInSerialTaxArea_idx` (`taxAreaFk`), @@ -28383,7 +28562,7 @@ CREATE TABLE `invoiceInTax` ( `invoiceInFk` mediumint(8) unsigned NOT NULL, `taxCodeFk` int(10) DEFAULT NULL, `taxableBase` decimal(10,2) NOT NULL, - `expenceFk` varchar(10) CHARACTER SET utf8mb3 NOT NULL, + `expenceFk` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, `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', @@ -28411,8 +28590,8 @@ DROP TABLE IF EXISTS `invoiceInTaxBookingAccount`; CREATE TABLE `invoiceInTaxBookingAccount` ( `id` int(10) NOT NULL AUTO_INCREMENT, `effectived` timestamp NOT NULL DEFAULT current_timestamp(), - `account` varchar(10) COLLATE utf8mb3_unicode_ci NOT NULL, - `taxAreaFk` varchar(15) CHARACTER SET utf8mb3 NOT NULL, + `account` varchar(10) NOT NULL, + `taxAreaFk` varchar(15) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, `priority` int(2) unsigned DEFAULT NULL, `taxClassFk` tinyint(3) unsigned NOT NULL DEFAULT 1, `countryFk` mediumint(8) unsigned NOT NULL DEFAULT 1, @@ -28436,8 +28615,8 @@ DROP TABLE IF EXISTS `invoiceOut`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `invoiceOut` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `ref` varchar(20) COLLATE utf8mb3_unicode_ci NOT NULL, - `serial` varchar(2) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `ref` varchar(20) NOT NULL, + `serial` varchar(2) DEFAULT NULL, `issued` date DEFAULT NULL, `amount` decimal(12,2) DEFAULT 0.00, `dued` datetime DEFAULT NULL, @@ -28530,15 +28709,15 @@ DELIMITER ;; FOR EACH ROW BEGIN CALL clientRisk_update(NEW.clientFk, NEW.companyFk, NEW.amount); - IF (SELECT COUNT(*) - FROM client - WHERE id = NEW.clientFk + IF (SELECT COUNT(*) + FROM client + WHERE id = NEW.clientFk AND businessTypeFk = 'officialOrganism' ) THEN CALL mail_insert('administracion@verdnatura.es', NULL, CONCAT('Se ha emitido una factura al organismo: ', NEW.clientFk), - CONCAT('Presentar factura en FACE https://salix.verdnatura.es/#!/invoice-out/', + CONCAT('Presentar factura en FACE https://salix.verdnatura.es/#!/invoice-out/', NEW.id, '/summary')); END IF; @@ -28601,7 +28780,7 @@ 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, - `expenceFk` varchar(10) CHARACTER SET utf8mb3 NOT NULL, + `expenceFk` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, `created` timestamp NULL DEFAULT current_timestamp(), PRIMARY KEY (`id`), KEY `invoiceOutExpence_FK_1_idx` (`invoiceOutFk`), @@ -28611,23 +28790,6 @@ CREATE TABLE `invoiceOutExpence` ( ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='Desglosa la base imponible de una factura en funcion del tipo de gasto/venta'; /*!40101 SET character_set_client = @saved_cs_client */; --- --- Table structure for table `invoiceOutQueue` --- - -DROP TABLE IF EXISTS `invoiceOutQueue`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `invoiceOutQueue` ( - `invoiceFk` int(10) unsigned NOT NULL, - `queued` datetime NOT NULL DEFAULT current_timestamp(), - `printed` datetime DEFAULT NULL, - `status` varchar(50) COLLATE utf8mb3_unicode_ci DEFAULT '', - PRIMARY KEY (`invoiceFk`), - CONSTRAINT `invoiceOut_queue_invoiceOut_id_fk` FOREIGN KEY (`invoiceFk`) REFERENCES `invoiceOut` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='Queue for PDF invoicing'; -/*!40101 SET character_set_client = @saved_cs_client */; - -- -- Table structure for table `invoiceOutSerial` -- @@ -28636,13 +28798,13 @@ DROP TABLE IF EXISTS `invoiceOutSerial`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `invoiceOutSerial` ( - `code` varchar(2) COLLATE utf8mb3_unicode_ci NOT NULL, - `description` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `code` varchar(2) NOT NULL, + `description` varchar(45) DEFAULT NULL, `isTaxed` tinyint(1) NOT NULL DEFAULT 1, - `taxAreaFk` varchar(15) CHARACTER SET utf8mb3 NOT NULL DEFAULT 'NATIONAL', + `taxAreaFk` varchar(15) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'NATIONAL', `isCEE` tinyint(1) NOT NULL DEFAULT 0, `cplusInvoiceType477Fk` int(10) unsigned DEFAULT 1, - `footNotes` longtext COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `footNotes` longtext DEFAULT NULL, `isRefEditable` tinyint(4) NOT NULL DEFAULT 0, PRIMARY KEY (`code`), KEY `taxAreaFk_idx` (`taxAreaFk`), @@ -28663,7 +28825,7 @@ CREATE TABLE `invoiceOutTax` ( `taxableBase` decimal(10,2) NOT NULL, `created` timestamp NOT NULL DEFAULT current_timestamp(), `vat` decimal(10,2) NOT NULL DEFAULT 0.00, - `pgcFk` varchar(10) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '0000000000', + `pgcFk` varchar(10) NOT NULL DEFAULT '0000000000', PRIMARY KEY (`id`), UNIQUE KEY `invoiceOutTax_Resctriccion` (`invoiceOutFk`,`pgcFk`), KEY `invoiceOutFk_idx` (`invoiceOutFk`), @@ -28682,11 +28844,11 @@ DROP TABLE IF EXISTS `invoiceOutTaxConfig`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `invoiceOutTaxConfig` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `taxClassCodeFk` varchar(1) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `taxClassCodeFk` varchar(1) DEFAULT NULL, `taxTypeSageFk` smallint(6) DEFAULT NULL, `transactionTypeSageFk` tinyint(4) DEFAULT NULL, `isService` tinyint(1) DEFAULT 0, - `expenceFk` varchar(10) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `expenceFk` varchar(10) DEFAULT NULL, PRIMARY KEY (`id`), KEY `invoiceOutTaxConfig_FK` (`taxClassCodeFk`), KEY `invoiceOutTaxConfig_FK_1` (`taxTypeSageFk`), @@ -28707,44 +28869,44 @@ DROP TABLE IF EXISTS `item`; CREATE TABLE `item` ( `id` int(11) NOT NULL AUTO_INCREMENT, `equivalent` int(11) unsigned DEFAULT NULL, - `name` varchar(50) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `name` varchar(50) DEFAULT NULL, `size` int(10) unsigned DEFAULT NULL, `stems` int(11) DEFAULT 1, `minPrice` double DEFAULT 0, `isToPrint` tinyint(1) NOT NULL DEFAULT 0, - `family` varchar(3) CHARACTER SET utf8mb3 NOT NULL DEFAULT 'VT', + `family` varchar(3) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'VT', `box` tinyint(1) NOT NULL DEFAULT 0, - `category` varchar(3) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `category` varchar(3) DEFAULT NULL, `originFk` tinyint(2) unsigned NOT NULL, `doPhoto` tinyint(4) NOT NULL DEFAULT 0, - `image` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `inkFk` varchar(3) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `image` varchar(255) DEFAULT NULL, + `inkFk` varchar(3) 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(), - `comment` varchar(150) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `comment` varchar(150) DEFAULT NULL, `typeFk` smallint(5) unsigned NOT NULL, `generic` tinyint(1) unsigned zerofill NOT NULL DEFAULT 0, `producerFk` mediumint(3) unsigned DEFAULT NULL, - `description` varchar(1000) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `description` varchar(1000) 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, - `expenceFk` varchar(10) CHARACTER SET utf8mb3 NOT NULL DEFAULT '7001000000', + `relevancy` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'La web ordena de forma descendiente por este campo para mostrar los artículos', + `expenceFk` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT '7001000000', `isActive` tinyint(1) NOT NULL DEFAULT 1, - `longName` varchar(50) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `subName` varchar(50) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `tag5` varchar(20) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `value5` varchar(50) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `tag6` varchar(20) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `value6` varchar(50) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `tag7` varchar(20) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `value7` varchar(50) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `tag8` varchar(20) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `value8` varchar(50) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `tag9` varchar(20) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `value9` varchar(50) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `tag10` varchar(20) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `value10` varchar(50) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `longName` varchar(50) DEFAULT NULL, + `subName` varchar(50) DEFAULT NULL, + `tag5` varchar(20) DEFAULT NULL, + `value5` varchar(50) DEFAULT NULL, + `tag6` varchar(20) DEFAULT NULL, + `value6` varchar(50) DEFAULT NULL, + `tag7` varchar(20) DEFAULT NULL, + `value7` varchar(50) DEFAULT NULL, + `tag8` varchar(20) DEFAULT NULL, + `value8` varchar(50) DEFAULT NULL, + `tag9` varchar(20) DEFAULT NULL, + `value9` varchar(50) DEFAULT NULL, + `tag10` varchar(20) DEFAULT NULL, + `value10` varchar(50) DEFAULT NULL, `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, @@ -28753,10 +28915,10 @@ CREATE TABLE `item` ( `isFragile` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'articulos solo para recogidas por su fragilidad', `numberOfItemsPerCask` int(11) DEFAULT NULL COMMENT 'Campo para Floramondo', `embalageCode` int(11) DEFAULT NULL COMMENT 'Campo para Floramondo', - `quality` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL COMMENT 'Campo para Floramondo', + `quality` varchar(255) 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', - `itemPackingTypeFk` varchar(1) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `itemPackingTypeFk` varchar(1) 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', `packingShelve` int(11) DEFAULT NULL COMMENT 'unidades que caben en una bandeja, en el caso de los sacadores', @@ -28782,11 +28944,11 @@ CREATE TABLE `item` ( KEY `item_lastUsed_IDX` (`lastUsed`) USING BTREE, KEY `item_expenceFk_idx` (`expenceFk`), CONSTRAINT `item_FK` FOREIGN KEY (`genericFk`) REFERENCES `item` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, + CONSTRAINT `item_FK_1` FOREIGN KEY (`typeFk`) REFERENCES `itemType` (`id`), CONSTRAINT `item_expenceFk` FOREIGN KEY (`expenceFk`) REFERENCES `expence` (`id`) ON UPDATE CASCADE, CONSTRAINT `item_family` FOREIGN KEY (`family`) REFERENCES `itemFamily` (`code`) ON UPDATE CASCADE, CONSTRAINT `item_ibfk_1` FOREIGN KEY (`originFk`) REFERENCES `origin` (`id`) ON UPDATE CASCADE, CONSTRAINT `item_ibfk_2` FOREIGN KEY (`intrastatFk`) REFERENCES `intrastat` (`id`) ON UPDATE CASCADE, - CONSTRAINT `item_ibfk_5` FOREIGN KEY (`typeFk`) REFERENCES `itemType` (`id`) ON UPDATE CASCADE, CONSTRAINT `itemsupplyResponseFk` FOREIGN KEY (`supplyResponseFk`) REFERENCES `edi`.`supplyResponse` (`ID`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `producer_id` FOREIGN KEY (`producerFk`) REFERENCES `producer` (`id`) ON UPDATE CASCADE ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; @@ -28807,13 +28969,13 @@ BEGIN DECLARE vItemPackingType VARCHAR(1); IF NEW.itemPackingTypeFk IS NULL THEN - + SELECT itemPackingTypeFk INTO vItemPackingType - FROM vn.itemType it + FROM vn.itemType it WHERE id = NEW.typeFk; SET NEW.itemPackingTypeFk = vItemPackingType; - + END IF; END */;; DELIMITER ; @@ -28869,23 +29031,23 @@ DELIMITER ;; BEFORE UPDATE ON `item` FOR EACH ROW BEGIN - + DECLARE vNewPackingShelve INT; - IF ISNULL(NEW.packingShelve) AND NOT ISNULL(NEW.packingOut) THEN - - SELECT NEW.packingOut * vc.shelveVolume / vc.standardFlowerBox + IF ISNULL(NEW.packingShelve) AND NOT ISNULL(NEW.packingOut) THEN + + SELECT NEW.packingOut * vc.shelveVolume / vc.standardFlowerBox INTO vNewPackingShelve FROM vn.volumeConfig vc; - + SET NEW.packingShelve = vNewPackingShelve; - + END IF; IF NEW.itemPackingTypeFk = '' THEN SET NEW.itemPackingTypeFk = NULL; - + END IF; END */;; @@ -28953,7 +29115,7 @@ DROP TABLE IF EXISTS `itemBarcode`; CREATE TABLE `itemBarcode` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `itemFk` int(11) NOT NULL, - `code` varchar(22) COLLATE utf8mb3_unicode_ci NOT NULL, + `code` varchar(22) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `code` (`code`), UNIQUE KEY `Id_Article_2` (`itemFk`,`code`), @@ -28990,9 +29152,10 @@ DROP TABLE IF EXISTS `itemBotanicalWithGenus`; /*!50001 DROP VIEW IF EXISTS `itemBotanicalWithGenus`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `itemBotanicalWithGenus` AS SELECT - 1 AS `itemFk`, - 1 AS `ediBotanic` */; +/*!50001 CREATE TABLE `itemBotanicalWithGenus` ( + `itemFk` tinyint NOT NULL, + `ediBotanic` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -29004,14 +29167,14 @@ DROP TABLE IF EXISTS `itemCategory`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `itemCategory` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `name` varchar(45) COLLATE utf8mb3_unicode_ci NOT NULL, + `name` varchar(45) NOT NULL, `order` int(10) unsigned DEFAULT NULL, `display` tinyint(4) NOT NULL DEFAULT 1, - `color` char(6) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `color` char(6) 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, - `icon` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `code` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `icon` varchar(45) DEFAULT NULL, + `code` varchar(45) DEFAULT NULL, `isReclining` tinyint(4) NOT NULL DEFAULT 1, `departmentFk` int(11) DEFAULT NULL COMMENT 'Departamento responsable del manufacturado de esta categoria', PRIMARY KEY (`id`), @@ -29055,8 +29218,8 @@ DROP TABLE IF EXISTS `itemCategoryI18n`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `itemCategoryI18n` ( `categoryFk` int(10) unsigned NOT NULL, - `lang` char(2) CHARACTER SET utf8mb3 NOT NULL, - `name` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL, + `lang` char(2) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, + `name` varchar(255) NOT NULL, PRIMARY KEY (`categoryFk`,`lang`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -29069,26 +29232,12 @@ DROP TABLE IF EXISTS `itemCategoryL10n`; /*!50001 DROP VIEW IF EXISTS `itemCategoryL10n`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `itemCategoryL10n` AS SELECT - 1 AS `id`, - 1 AS `name` */; +/*!50001 CREATE TABLE `itemCategoryL10n` ( + `id` tinyint NOT NULL, + `name` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; --- --- Table structure for table `itemCleanConfig` --- - -DROP TABLE IF EXISTS `itemCleanConfig`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `itemCleanConfig` ( - `id` int(11) NOT NULL, - `quantity` int(11) NOT NULL COMMENT 'Indica el número de items que va a procesar', - `isStop` tinyint(1) DEFAULT NULL COMMENT 'Si está a TRUE para el proceso a tiempo real', - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - -- -- Table structure for table `itemCleanLog` -- @@ -29098,7 +29247,6 @@ DROP TABLE IF EXISTS `itemCleanLog`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `itemCleanLog` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `itemFrom` int(11) DEFAULT NULL COMMENT 'Indica el item por donde ha empezado', `itemDeleted` int(11) DEFAULT NULL COMMENT 'Indica la cantidad de items que ha eliminado', `created` timestamp NULL DEFAULT current_timestamp(), PRIMARY KEY (`id`) @@ -29113,9 +29261,10 @@ DROP TABLE IF EXISTS `itemColor`; /*!50001 DROP VIEW IF EXISTS `itemColor`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `itemColor` AS SELECT - 1 AS `itemFk`, - 1 AS `color` */; +/*!50001 CREATE TABLE `itemColor` ( + `itemFk` tinyint NOT NULL, + `color` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -29129,8 +29278,13 @@ CREATE TABLE `itemConfig` ( `id` int(11) NOT NULL, `isItemTagTriggerDisabled` tinyint(1) NOT NULL DEFAULT 1, `monthToDeactivate` int(3) NOT NULL DEFAULT 24, - `wasteRecipients` varchar(50) COLLATE utf8mb3_unicode_ci NOT NULL COMMENT 'Weekly waste report schedule recipients', - PRIMARY KEY (`id`) + `wasteRecipients` varchar(50) NOT NULL COMMENT 'Weekly waste report schedule recipients', + `defaultTag` int(11) NOT NULL DEFAULT 56, + `validPriorities` varchar(50) NOT NULL DEFAULT '[1,2,3]', + `defaultPriority` int(11) NOT NULL DEFAULT 2, + PRIMARY KEY (`id`), + KEY `itemConfig_FK` (`defaultTag`), + CONSTRAINT `itemConfig_FK` FOREIGN KEY (`defaultTag`) REFERENCES `tag` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -29198,15 +29352,15 @@ BEGIN IF NEW.itemFk IN (95, 98) THEN SET NEW.cm3 = 0; END IF; - + IF !(NEW.cm3delivery <=> OLD.cm3delivery) THEN INSERT IGNORE INTO `vn`.`routeRecalc` (`routeFk`) - SELECT r.id + SELECT r.id FROM vn.itemCost ic JOIN vn.sale s ON s.itemFk = ic.itemFk - JOIN vn.ticket t ON t.id = s.ticketFk AND t.warehouseFk = ic.warehouseFk + JOIN vn.ticket t ON t.id = s.ticketFk AND t.warehouseFk = ic.warehouseFk JOIN vn.route r ON r.id = t.routeFk - WHERE r.isOk = FALSE + WHERE r.isOk = FALSE AND ic.itemFk = NEW.itemFk AND r.created >= util.VN_CURDATE() GROUP BY r.id; @@ -29233,14 +29387,15 @@ DROP TABLE IF EXISTS `itemEntryIn`; /*!50001 DROP VIEW IF EXISTS `itemEntryIn`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `itemEntryIn` AS SELECT - 1 AS `warehouseInFk`, - 1 AS `landed`, - 1 AS `itemFk`, - 1 AS `quantity`, - 1 AS `isReceived`, - 1 AS `isVirtualStock`, - 1 AS `entryFk` */; +/*!50001 CREATE TABLE `itemEntryIn` ( + `warehouseInFk` tinyint NOT NULL, + `landed` tinyint NOT NULL, + `itemFk` tinyint NOT NULL, + `quantity` tinyint NOT NULL, + `isReceived` tinyint NOT NULL, + `isVirtualStock` tinyint NOT NULL, + `entryFk` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -29251,13 +29406,14 @@ DROP TABLE IF EXISTS `itemEntryOut`; /*!50001 DROP VIEW IF EXISTS `itemEntryOut`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `itemEntryOut` AS SELECT - 1 AS `warehouseOutFk`, - 1 AS `shipped`, - 1 AS `itemFk`, - 1 AS `quantity`, - 1 AS `isDelivered`, - 1 AS `entryFk` */; +/*!50001 CREATE TABLE `itemEntryOut` ( + `warehouseOutFk` tinyint NOT NULL, + `shipped` tinyint NOT NULL, + `itemFk` tinyint NOT NULL, + `quantity` tinyint NOT NULL, + `isDelivered` tinyint NOT NULL, + `entryFk` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -29268,8 +29424,8 @@ DROP TABLE IF EXISTS `itemFamily`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `itemFamily` ( - `code` varchar(3) CHARACTER SET utf8mb3 NOT NULL, - `description` varchar(45) COLLATE utf8mb3_unicode_ci NOT NULL, + `code` varchar(3) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, + `description` varchar(45) NOT NULL, PRIMARY KEY (`code`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -29283,8 +29439,8 @@ DROP TABLE IF EXISTS `itemImageQueue`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `itemImageQueue` ( `itemFk` int(11) NOT NULL, - `url` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `error` text COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `url` varchar(255) DEFAULT NULL, + `error` text DEFAULT NULL, `attempts` int(11) DEFAULT 0, `created` timestamp NULL DEFAULT current_timestamp(), `updated` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), @@ -29302,10 +29458,11 @@ DROP TABLE IF EXISTS `itemInk`; /*!50001 DROP VIEW IF EXISTS `itemInk`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `itemInk` AS SELECT - 1 AS `longName`, - 1 AS `inkFk`, - 1 AS `color` */; +/*!50001 CREATE TABLE `itemInk` ( + `longName` tinyint NOT NULL, + `inkFk` tinyint NOT NULL, + `color` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -29318,7 +29475,7 @@ DROP TABLE IF EXISTS `itemLabel`; CREATE TABLE `itemLabel` ( `id` int(11) NOT NULL AUTO_INCREMENT, `itemFk` int(11) DEFAULT NULL, - `itemName` varchar(20) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `itemName` varchar(20) DEFAULT NULL, `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`) @@ -29336,14 +29493,14 @@ CREATE TABLE `itemLog` ( `id` int(11) NOT NULL AUTO_INCREMENT, `originFk` int(11) NOT NULL, `userFk` int(10) unsigned DEFAULT NULL, - `action` set('insert','update','delete') COLLATE utf8mb3_unicode_ci NOT NULL, + `action` set('insert','update','delete') NOT NULL, `creationDate` timestamp NULL DEFAULT current_timestamp(), - `description` text CHARACTER SET utf8mb3 DEFAULT NULL, - `changedModel` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `oldInstance` text COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `newInstance` text COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `description` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL, + `changedModel` varchar(45) DEFAULT NULL, + `oldInstance` text DEFAULT NULL, + `newInstance` text DEFAULT NULL, `changedModelId` int(11) DEFAULT NULL, - `changedModelValue` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `changedModelValue` varchar(45) DEFAULT NULL, PRIMARY KEY (`id`), KEY `itemLogItemFk_idx` (`originFk`), KEY `itemLogUserFk_idx` (`userFk`), @@ -29361,8 +29518,8 @@ DROP TABLE IF EXISTS `itemMatchProperties`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `itemMatchProperties` ( `itemFk` int(11) NOT NULL, - `name` varchar(80) COLLATE utf8mb3_unicode_ci NOT NULL, - `producer` varchar(80) COLLATE utf8mb3_unicode_ci NOT NULL, + `name` varchar(80) NOT NULL, + `producer` varchar(80) NOT NULL, `size` int(11) NOT NULL, PRIMARY KEY (`itemFk`,`name`,`producer`,`size`), CONSTRAINT `itemFk___fk` FOREIGN KEY (`itemFk`) REFERENCES `item` (`id`) ON DELETE CASCADE ON UPDATE CASCADE @@ -29377,8 +29534,9 @@ DROP TABLE IF EXISTS `itemPackingType`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `itemPackingType` ( - `code` varchar(1) COLLATE utf8mb3_unicode_ci NOT NULL, - `description` varchar(100) COLLATE utf8mb3_unicode_ci NOT NULL, + `code` varchar(1) NOT NULL, + `description` varchar(100) NOT NULL, + `isActive` tinyint(1) NOT NULL, PRIMARY KEY (`code`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='Define la linea de encajado para cada producto'; /*!40101 SET character_set_client = @saved_cs_client */; @@ -29419,21 +29577,22 @@ DROP TABLE IF EXISTS `itemPlacementSupplyList`; /*!50001 DROP VIEW IF EXISTS `itemPlacementSupplyList`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `itemPlacementSupplyList` AS SELECT - 1 AS `id`, - 1 AS `itemFk`, - 1 AS `quantity`, - 1 AS `priority`, - 1 AS `created`, - 1 AS `userFk`, - 1 AS `repoUserFk`, - 1 AS `saldo`, - 1 AS `longName`, - 1 AS `subName`, - 1 AS `size`, - 1 AS `workerCode`, - 1 AS `repoCode`, - 1 AS `sectorFk` */; +/*!50001 CREATE TABLE `itemPlacementSupplyList` ( + `id` tinyint NOT NULL, + `itemFk` tinyint NOT NULL, + `quantity` tinyint NOT NULL, + `priority` tinyint NOT NULL, + `created` tinyint NOT NULL, + `userFk` tinyint NOT NULL, + `repoUserFk` tinyint NOT NULL, + `saldo` tinyint NOT NULL, + `longName` tinyint NOT NULL, + `subName` tinyint NOT NULL, + `size` tinyint NOT NULL, + `workerCode` tinyint NOT NULL, + `repoCode` tinyint NOT NULL, + `sectorFk` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -29444,9 +29603,10 @@ DROP TABLE IF EXISTS `itemProductor`; /*!50001 DROP VIEW IF EXISTS `itemProductor`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `itemProductor` AS SELECT - 1 AS `itemFk`, - 1 AS `productor` */; +/*!50001 CREATE TABLE `itemProductor` ( + `itemFk` tinyint NOT NULL, + `productor` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -29475,12 +29635,13 @@ DROP TABLE IF EXISTS `itemSearch`; /*!50001 DROP VIEW IF EXISTS `itemSearch`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `itemSearch` AS SELECT - 1 AS `itemFk`, - 1 AS `concept`, - 1 AS `quantity`, - 1 AS `nickname`, - 1 AS `shipped` */; +/*!50001 CREATE TABLE `itemSearch` ( + `itemFk` tinyint NOT NULL, + `concept` tinyint NOT NULL, + `quantity` tinyint NOT NULL, + `nickname` tinyint NOT NULL, + `shipped` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -29493,13 +29654,14 @@ DROP TABLE IF EXISTS `itemShelving`; CREATE TABLE `itemShelving` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `itemFk` int(11) NOT NULL, - `shelvingFk` varchar(10) CHARACTER SET utf8mb3 NOT NULL, + `shelvingFk` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, `visible` int(11) NOT NULL DEFAULT 0, `created` timestamp NOT NULL DEFAULT current_timestamp(), `grouping` smallint(5) unsigned DEFAULT NULL, `packing` int(11) unsigned DEFAULT NULL, - `packagingFk` varchar(10) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `packagingFk` varchar(10) DEFAULT NULL, `userFk` int(10) unsigned DEFAULT NULL, + `isChecked` tinyint(1) DEFAULT NULL COMMENT 'Este valor cambia al escanear un carro. True: Existe. False: Nuevo. Null: No escaneado', PRIMARY KEY (`id`), KEY `itemShelving_fk1_idx` (`itemFk`), KEY `itemShelving_fk2_idx` (`shelvingFk`), @@ -29523,10 +29685,10 @@ DELIMITER ;; BEFORE INSERT ON `itemShelving` FOR EACH ROW BEGIN - + SET NEW.userFk = account.myUser_getId(); - + END */;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -29633,8 +29795,8 @@ DELIMITER ;; /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`itemShelving_BEFORE_DELETE` BEFORE DELETE ON `itemShelving` FOR EACH ROW -INSERT INTO vn.itemShelvingLog(itemShelvingFk, - workerFk, +INSERT INTO vn.itemShelvingLog(itemShelvingFk, + workerFk, accion, shelvingFk, itemFk) @@ -29657,30 +29819,31 @@ DROP TABLE IF EXISTS `itemShelvingAvailable`; /*!50001 DROP VIEW IF EXISTS `itemShelvingAvailable`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `itemShelvingAvailable` AS SELECT - 1 AS `saleFk`, - 1 AS `Modificado`, - 1 AS `ticketFk`, - 1 AS `isPicked`, - 1 AS `itemFk`, - 1 AS `quantity`, - 1 AS `concept`, - 1 AS `size`, - 1 AS `Estado`, - 1 AS `sectorProdPriority`, - 1 AS `available`, - 1 AS `sectorFk`, - 1 AS `matricula`, - 1 AS `parking`, - 1 AS `itemShelving`, - 1 AS `Agency`, - 1 AS `shipped`, - 1 AS `grouping`, - 1 AS `packing`, - 1 AS `hour`, - 1 AS `isPreviousPreparable`, - 1 AS `physicalVolume`, - 1 AS `warehouseFk` */; +/*!50001 CREATE TABLE `itemShelvingAvailable` ( + `saleFk` tinyint NOT NULL, + `Modificado` tinyint NOT NULL, + `ticketFk` tinyint NOT NULL, + `isPicked` tinyint NOT NULL, + `itemFk` tinyint NOT NULL, + `quantity` tinyint NOT NULL, + `concept` tinyint NOT NULL, + `size` tinyint NOT NULL, + `Estado` tinyint NOT NULL, + `sectorProdPriority` tinyint NOT NULL, + `available` tinyint NOT NULL, + `sectorFk` tinyint NOT NULL, + `matricula` tinyint NOT NULL, + `parking` tinyint NOT NULL, + `itemShelving` tinyint NOT NULL, + `Agency` tinyint NOT NULL, + `shipped` tinyint NOT NULL, + `grouping` tinyint NOT NULL, + `packing` tinyint NOT NULL, + `hour` tinyint NOT NULL, + `isPreviousPreparable` tinyint NOT NULL, + `physicalVolume` tinyint NOT NULL, + `warehouseFk` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -29691,17 +29854,18 @@ DROP TABLE IF EXISTS `itemShelvingList`; /*!50001 DROP VIEW IF EXISTS `itemShelvingList`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `itemShelvingList` AS SELECT - 1 AS `shelvingFk`, - 1 AS `visible`, - 1 AS `created`, - 1 AS `parking`, - 1 AS `itemFk`, - 1 AS `longName`, - 1 AS `size`, - 1 AS `subName`, - 1 AS `parked`, - 1 AS `sectorFk` */; +/*!50001 CREATE TABLE `itemShelvingList` ( + `shelvingFk` tinyint NOT NULL, + `visible` tinyint NOT NULL, + `created` tinyint NOT NULL, + `parking` tinyint NOT NULL, + `itemFk` tinyint NOT NULL, + `longName` tinyint NOT NULL, + `size` tinyint NOT NULL, + `subName` tinyint NOT NULL, + `parked` tinyint NOT NULL, + `sectorFk` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -29716,9 +29880,9 @@ CREATE TABLE `itemShelvingLog` ( `itemShelvingFk` int(10) unsigned DEFAULT NULL, `workerFk` int(11) DEFAULT NULL, `created` timestamp NOT NULL DEFAULT current_timestamp(), - `accion` varchar(20) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `accion` varchar(20) DEFAULT NULL, `itemFk` int(11) DEFAULT NULL, - `shelvingFk` varchar(10) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `shelvingFk` varchar(10) DEFAULT NULL, `quantity` int(11) DEFAULT NULL, `visible` int(11) DEFAULT NULL, `available` int(11) DEFAULT NULL, @@ -29762,20 +29926,21 @@ DROP TABLE IF EXISTS `itemShelvingPlacementSupplyStock`; /*!50001 DROP VIEW IF EXISTS `itemShelvingPlacementSupplyStock`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `itemShelvingPlacementSupplyStock` AS SELECT - 1 AS `itemShelvingFk`, - 1 AS `itemFk`, - 1 AS `packing`, - 1 AS `stock`, - 1 AS `longName`, - 1 AS `size`, - 1 AS `subName`, - 1 AS `shelving`, - 1 AS `parking`, - 1 AS `created`, - 1 AS `priority`, - 1 AS `parkingFk`, - 1 AS `sectorFk` */; +/*!50001 CREATE TABLE `itemShelvingPlacementSupplyStock` ( + `itemShelvingFk` tinyint NOT NULL, + `itemFk` tinyint NOT NULL, + `packing` tinyint NOT NULL, + `stock` tinyint NOT NULL, + `longName` tinyint NOT NULL, + `size` tinyint NOT NULL, + `subName` tinyint NOT NULL, + `shelving` tinyint NOT NULL, + `parking` tinyint NOT NULL, + `created` tinyint NOT NULL, + `priority` tinyint NOT NULL, + `parkingFk` tinyint NOT NULL, + `sectorFk` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -29816,7 +29981,7 @@ DELIMITER ;; BEGIN UPDATE vn.sale - SET isPicked = TRUE + SET isPicked = TRUE WHERE id = NEW.saleFk; END */;; @@ -29834,13 +29999,14 @@ DROP TABLE IF EXISTS `itemShelvingSaleSum`; /*!50001 DROP VIEW IF EXISTS `itemShelvingSaleSum`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `itemShelvingSaleSum` AS SELECT - 1 AS `id`, - 1 AS `itemShelvingFk`, - 1 AS `saleFk`, - 1 AS `quantity`, - 1 AS `created`, - 1 AS `sectorFk` */; +/*!50001 CREATE TABLE `itemShelvingSaleSum` ( + `id` tinyint NOT NULL, + `itemShelvingFk` tinyint NOT NULL, + `saleFk` tinyint NOT NULL, + `quantity` tinyint NOT NULL, + `created` tinyint NOT NULL, + `sectorFk` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -29851,22 +30017,23 @@ DROP TABLE IF EXISTS `itemShelvingStock`; /*!50001 DROP VIEW IF EXISTS `itemShelvingStock`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `itemShelvingStock` AS SELECT - 1 AS `itemFk`, - 1 AS `visible`, - 1 AS `packing`, - 1 AS `grouping`, - 1 AS `sector`, - 1 AS `visibleOriginal`, - 1 AS `removed`, - 1 AS `sectorFk`, - 1 AS `warehouseFk`, - 1 AS `shelvingFk`, - 1 AS `parkingCode`, - 1 AS `parkingFk`, - 1 AS `itemShelvingFk`, - 1 AS `created`, - 1 AS `isPreviousPrepared` */; +/*!50001 CREATE TABLE `itemShelvingStock` ( + `itemFk` tinyint NOT NULL, + `visible` tinyint NOT NULL, + `packing` tinyint NOT NULL, + `grouping` tinyint NOT NULL, + `sector` tinyint NOT NULL, + `visibleOriginal` tinyint NOT NULL, + `removed` tinyint NOT NULL, + `sectorFk` tinyint NOT NULL, + `warehouseFk` tinyint NOT NULL, + `shelvingFk` tinyint NOT NULL, + `parkingCode` tinyint NOT NULL, + `parkingFk` tinyint NOT NULL, + `itemShelvingFk` tinyint NOT NULL, + `created` tinyint NOT NULL, + `isPreviousPrepared` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -29877,20 +30044,21 @@ DROP TABLE IF EXISTS `itemShelvingStockFull`; /*!50001 DROP VIEW IF EXISTS `itemShelvingStockFull`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `itemShelvingStockFull` AS SELECT - 1 AS `itemFk`, - 1 AS `quantity`, - 1 AS `packing`, - 1 AS `grouping`, - 1 AS `sector`, - 1 AS `removed`, - 1 AS `sectorFk`, - 1 AS `warehouseFk`, - 1 AS `shelvingFk`, - 1 AS `parkingCode`, - 1 AS `parkingFk`, - 1 AS `itemShelvingFk`, - 1 AS `created` */; +/*!50001 CREATE TABLE `itemShelvingStockFull` ( + `itemFk` tinyint NOT NULL, + `quantity` tinyint NOT NULL, + `packing` tinyint NOT NULL, + `grouping` tinyint NOT NULL, + `sector` tinyint NOT NULL, + `removed` tinyint NOT NULL, + `sectorFk` tinyint NOT NULL, + `warehouseFk` tinyint NOT NULL, + `shelvingFk` tinyint NOT NULL, + `parkingCode` tinyint NOT NULL, + `parkingFk` tinyint NOT NULL, + `itemShelvingFk` tinyint NOT NULL, + `created` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -29901,10 +30069,11 @@ DROP TABLE IF EXISTS `itemShelvingStockRemoved`; /*!50001 DROP VIEW IF EXISTS `itemShelvingStockRemoved`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `itemShelvingStockRemoved` AS SELECT - 1 AS `itemShelvingFk`, - 1 AS `itemFk`, - 1 AS `removed` */; +/*!50001 CREATE TABLE `itemShelvingStockRemoved` ( + `itemShelvingFk` tinyint NOT NULL, + `itemFk` tinyint NOT NULL, + `removed` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -29915,10 +30084,11 @@ DROP TABLE IF EXISTS `itemShelvingStock_byWarehouse`; /*!50001 DROP VIEW IF EXISTS `itemShelvingStock_byWarehouse`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `itemShelvingStock_byWarehouse` AS SELECT - 1 AS `itemFk`, - 1 AS `visible`, - 1 AS `warehouseFk` */; +/*!50001 CREATE TABLE `itemShelvingStock_byWarehouse` ( + `itemFk` tinyint NOT NULL, + `visible` tinyint NOT NULL, + `warehouseFk` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -29932,7 +30102,7 @@ CREATE TABLE `itemTag` ( `id` int(11) NOT NULL AUTO_INCREMENT, `itemFk` int(11) NOT NULL, `tagFk` int(11) NOT NULL, - `value` varchar(50) COLLATE utf8mb3_unicode_ci NOT NULL, + `value` varchar(50) NOT NULL, `intValue` int(11) DEFAULT NULL, `priority` int(2) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), @@ -29988,7 +30158,7 @@ trig: BEGIN IF @isTriggerDisabled OR visTriggerDisabled THEN LEAVE trig; END IF; - + SET vItemFk = NEW.itemFk; DROP TEMPORARY TABLE IF EXISTS tmp.item; CREATE TEMPORARY TABLE tmp.item @@ -30013,7 +30183,7 @@ DELIMITER ;; /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`itemTag_beforeUpdate` BEFORE UPDATE ON `itemTag` FOR EACH ROW -BEGIN +BEGIN IF !(OLD.`value` <=> NEW.`value`) OR !(OLD.intValue <=> NEW.intValue) THEN SET NEW.intValue = itemTag_getIntValue(NEW.`value`); @@ -30046,7 +30216,7 @@ trig: BEGIN IF @isTriggerDisabled OR visTriggerDisabled THEN LEAVE trig; END IF; - + SET vItemFk = NEW.itemFk; DROP TEMPORARY TABLE IF EXISTS tmp.item; CREATE TEMPORARY TABLE tmp.item @@ -30082,7 +30252,7 @@ trig: BEGIN IF @isTriggerDisabled OR visTriggerDisabled THEN LEAVE trig; END IF; - + SET vItemFk = OLD.itemFk; DROP TEMPORARY TABLE IF EXISTS tmp.item; CREATE TEMPORARY TABLE tmp.item @@ -30104,8 +30274,9 @@ DROP TABLE IF EXISTS `itemTagged`; /*!50001 DROP VIEW IF EXISTS `itemTagged`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `itemTagged` AS SELECT - 1 AS `itemFk` */; +/*!50001 CREATE TABLE `itemTagged` ( + `itemFk` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -30139,16 +30310,17 @@ DROP TABLE IF EXISTS `itemTicketOut`; /*!50001 DROP VIEW IF EXISTS `itemTicketOut`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `itemTicketOut` AS SELECT - 1 AS `warehouseFk`, - 1 AS `shipped`, - 1 AS `itemFk`, - 1 AS `quantity`, - 1 AS `isPicked`, - 1 AS `reserved`, - 1 AS `refFk`, - 1 AS `saleFk`, - 1 AS `ticketFk` */; +/*!50001 CREATE TABLE `itemTicketOut` ( + `warehouseFk` tinyint NOT NULL, + `shipped` tinyint NOT NULL, + `itemFk` tinyint NOT NULL, + `quantity` tinyint NOT NULL, + `isPicked` tinyint NOT NULL, + `reserved` tinyint NOT NULL, + `refFk` tinyint NOT NULL, + `saleFk` tinyint NOT NULL, + `ticketFk` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -30159,18 +30331,18 @@ DROP TABLE IF EXISTS `itemType`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `itemType` ( - `id` smallint(5) unsigned NOT NULL AUTO_INCREMENT, - `code` varchar(3) COLLATE utf8mb3_unicode_ci NOT NULL, - `name` varchar(30) COLLATE utf8mb3_unicode_ci NOT NULL, + `id` smallint(5) unsigned NOT NULL, + `code` varchar(3) NOT NULL, + `name` varchar(30) NOT NULL, `gramsMax` int(11) DEFAULT NULL, `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(), - `transaction` 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 utf8mb3_unicode_ci DEFAULT NULL, + `location__` varchar(10) DEFAULT NULL, `life` smallint(5) unsigned DEFAULT NULL, `maneuver` double NOT NULL DEFAULT 0.21, `target` double NOT NULL DEFAULT 0.15, @@ -30179,29 +30351,29 @@ CREATE TABLE `itemType` ( `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 utf8mb3_unicode_ci DEFAULT NULL, - `temperatureFk` varchar(10) CHARACTER SET utf8mb3 DEFAULT NULL, + `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) DEFAULT NULL, + `temperatureFk` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL, `isUnconventionalSize` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'familia con productos cuyas medidas no son aptas para la cinta transportadora o paletizar', `isLaid` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'Indica si el producto se puede tumbar a efectos del transporte desde Holanda', `maxRefs` int(10) unsigned DEFAULT NULL COMMENT 'Indica el número máximo de referencias', `isMergeable` tinyint(1) NOT NULL DEFAULT 1 COMMENT 'Articulos que al mergear los tickets se fusionara la linea', - PRIMARY KEY (`code`), - UNIQUE KEY `tipo_id_UNIQUE` (`id`), + PRIMARY KEY (`id`), UNIQUE KEY `Tipo_UNIQUE` (`name`,`categoryFk`), + UNIQUE KEY `itemType_UN` (`code`), KEY `Trabajador` (`workerFk`), KEY `reino_id` (`categoryFk`), KEY `Tipos_fk3_idx` (`making`), - KEY `warehouseFk5_idx` (`warehouseFk`), + KEY `warehouseFk5_idx` (`warehouseFk__`), KEY `temperatureFk` (`temperatureFk`), CONSTRAINT `Tipos_fk3` FOREIGN KEY (`making`) REFERENCES `confectionType` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `Trabajador` FOREIGN KEY (`workerFk`) REFERENCES `worker` (`id`) ON UPDATE CASCADE, CONSTRAINT `itemType_ibfk_1` FOREIGN KEY (`categoryFk`) REFERENCES `itemCategory` (`id`) ON UPDATE CASCADE, CONSTRAINT `temperatureFk` FOREIGN KEY (`temperatureFk`) REFERENCES `temperature` (`code`), - CONSTRAINT `warehouseFk5` FOREIGN KEY (`warehouseFk`) REFERENCES `warehouse` (`id`) ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='Protege la tabla tipos de updates para los 4 parámetros de los compradores, en funcion del valor del campo CodigoRojo de tblContadores.'; + CONSTRAINT `warehouseFk5` FOREIGN KEY (`warehouseFk__`) REFERENCES `warehouse` (`id`) ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='Protege la tabla tipos de updates para los 4 parámetros de los compradores, en funcion del valor del campo CodigoRojo de tblContadores.'; /*!40101 SET character_set_client = @saved_cs_client */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -30243,8 +30415,8 @@ DROP TABLE IF EXISTS `itemTypeI18n`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `itemTypeI18n` ( `typeFk` smallint(5) unsigned NOT NULL, - `lang` char(2) CHARACTER SET utf8mb3 NOT NULL, - `name` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL, + `lang` char(2) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, + `name` varchar(255) NOT NULL, PRIMARY KEY (`typeFk`,`lang`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -30257,9 +30429,10 @@ DROP TABLE IF EXISTS `itemTypeL10n`; /*!50001 DROP VIEW IF EXISTS `itemTypeL10n`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `itemTypeL10n` AS SELECT - 1 AS `id`, - 1 AS `name` */; +/*!50001 CREATE TABLE `itemTypeL10n` ( + `id` tinyint NOT NULL, + `name` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -30277,7 +30450,7 @@ CREATE TABLE `itemTypeRestriction` ( PRIMARY KEY (`id`), 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 + CONSTRAINT `itemTypeRestriction_FK` FOREIGN KEY (`itemTypeFk`) REFERENCES `itemType` (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -30298,7 +30471,7 @@ CREATE TABLE `itemTypeTag` ( KEY `itemTypeTagTipo_idx` (`itemTypeFk`), KEY `itemTypeTagTag_idx` (`tagFk`), CONSTRAINT `itemTypeTagTag` FOREIGN KEY (`tagFk`) REFERENCES `tag` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - CONSTRAINT `itemTypeTagTipos` FOREIGN KEY (`itemTypeFk`) REFERENCES `itemType` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION + CONSTRAINT `itemTypeTag_FK` FOREIGN KEY (`itemTypeFk`) REFERENCES `itemType` (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -30310,8 +30483,9 @@ DROP TABLE IF EXISTS `item_Free_Id`; /*!50001 DROP VIEW IF EXISTS `item_Free_Id`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `item_Free_Id` AS SELECT - 1 AS `newId` */; +/*!50001 CREATE TABLE `item_Free_Id` ( + `newId` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -30322,23 +30496,24 @@ DROP TABLE IF EXISTS `labelInfo`; /*!50001 DROP VIEW IF EXISTS `labelInfo`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `labelInfo` AS SELECT - 1 AS `itemId`, - 1 AS `itemName`, - 1 AS `stickers`, - 1 AS `life`, - 1 AS `colorCode`, - 1 AS `stems`, - 1 AS `category`, - 1 AS `productor`, - 1 AS `packing`, - 1 AS `warehouse_id`, - 1 AS `size`, - 1 AS `isPickedOff`, - 1 AS `notes`, - 1 AS `wh_in`, - 1 AS `entryId`, - 1 AS `buyId` */; +/*!50001 CREATE TABLE `labelInfo` ( + `itemId` tinyint NOT NULL, + `itemName` tinyint NOT NULL, + `stickers` tinyint NOT NULL, + `life` tinyint NOT NULL, + `colorCode` tinyint NOT NULL, + `stems` tinyint NOT NULL, + `category` tinyint NOT NULL, + `productor` tinyint NOT NULL, + `packing` tinyint NOT NULL, + `warehouse_id` tinyint NOT NULL, + `size` tinyint NOT NULL, + `isPickedOff` tinyint NOT NULL, + `notes` tinyint NOT NULL, + `wh_in` tinyint NOT NULL, + `entryId` tinyint NOT NULL, + `buyId` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -30350,7 +30525,7 @@ DROP TABLE IF EXISTS `labourTree`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `labourTree` ( `id` int(11) NOT NULL DEFAULT 0, - `name` varchar(45) COLLATE utf8mb3_unicode_ci NOT NULL, + `name` varchar(45) NOT NULL, `lft` int(11) NOT NULL, `rgt` int(11) NOT NULL, `depth` bigint(22) NOT NULL DEFAULT 0, @@ -30367,9 +30542,10 @@ DROP TABLE IF EXISTS `lastHourProduction`; /*!50001 DROP VIEW IF EXISTS `lastHourProduction`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `lastHourProduction` AS SELECT - 1 AS `warehouseFk`, - 1 AS `m3` */; +/*!50001 CREATE TABLE `lastHourProduction` ( + `warehouseFk` tinyint NOT NULL, + `m3` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -30380,20 +30556,21 @@ DROP TABLE IF EXISTS `lastPurchases`; /*!50001 DROP VIEW IF EXISTS `lastPurchases`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `lastPurchases` AS SELECT - 1 AS `landed`, - 1 AS `warehouseFk`, - 1 AS `warehouse`, - 1 AS `longName`, - 1 AS `subName`, - 1 AS `entryFk`, - 1 AS `stickers`, - 1 AS `packing`, - 1 AS `ref`, - 1 AS `itemFk`, - 1 AS `pro`, - 1 AS `ektRef`, - 1 AS `agj` */; +/*!50001 CREATE TABLE `lastPurchases` ( + `landed` tinyint NOT NULL, + `warehouseFk` tinyint NOT NULL, + `warehouse` tinyint NOT NULL, + `longName` tinyint NOT NULL, + `subName` tinyint NOT NULL, + `entryFk` tinyint NOT NULL, + `stickers` tinyint NOT NULL, + `packing` tinyint NOT NULL, + `ref` tinyint NOT NULL, + `itemFk` tinyint NOT NULL, + `pro` tinyint NOT NULL, + `ektRef` tinyint NOT NULL, + `agj` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -30404,13 +30581,14 @@ DROP TABLE IF EXISTS `lastTopClaims`; /*!50001 DROP VIEW IF EXISTS `lastTopClaims`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `lastTopClaims` AS SELECT - 1 AS `itemFk`, - 1 AS `itemName`, - 1 AS `itemTypeName`, - 1 AS `claimsNumber`, - 1 AS `claimedAmount`, - 1 AS `totalAmount` */; +/*!50001 CREATE TABLE `lastTopClaims` ( + `itemFk` tinyint NOT NULL, + `itemName` tinyint NOT NULL, + `itemTypeName` tinyint NOT NULL, + `claimsNumber` tinyint NOT NULL, + `claimedAmount` tinyint NOT NULL, + `totalAmount` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -30451,15 +30629,15 @@ DROP TABLE IF EXISTS `machine`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `machine` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `plate` varchar(20) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `serialNumber` varchar(30) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `maker` varchar(50) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `model` varchar(20) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `plate` varchar(20) DEFAULT NULL, + `serialNumber` varchar(30) DEFAULT NULL, + `maker` varchar(50) DEFAULT NULL, + `model` varchar(20) DEFAULT NULL, `purchased` date DEFAULT NULL, `warehouseFk` int(11) DEFAULT NULL, `departmentFk` int(11) DEFAULT NULL, - `type` varchar(100) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `use` varchar(100) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `type` varchar(100) DEFAULT NULL, + `use` varchar(100) DEFAULT NULL, `productionYear` int(11) DEFAULT NULL, `photo` blob DEFAULT NULL, `workerFk` int(10) unsigned DEFAULT NULL, @@ -30490,7 +30668,7 @@ DELIMITER ;; BEFORE INSERT ON `machine` FOR EACH ROW BEGIN - + SET NEW.workerFk = vn.getUser(); END */;; @@ -30511,7 +30689,7 @@ CREATE TABLE `machineDetail` ( `id` int(11) NOT NULL AUTO_INCREMENT, `machineFk` int(11) NOT NULL, `dated` date NOT NULL, - `action` varchar(100) COLLATE utf8mb3_unicode_ci NOT NULL, + `action` varchar(100) NOT NULL, `value` decimal(10,2) DEFAULT NULL, `workerFk` int(10) unsigned NOT NULL, `dmsFk` int(11) DEFAULT NULL, @@ -30588,18 +30766,18 @@ DROP TABLE IF EXISTS `mail`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `mail` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `receiver` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `sender` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `replyTo` varchar(50) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `subject` varchar(100) COLLATE utf8mb3_unicode_ci NOT NULL, - `body` text COLLATE utf8mb3_unicode_ci NOT NULL, + `receiver` varchar(255) DEFAULT NULL, + `sender` varchar(255) DEFAULT NULL, + `replyTo` varchar(50) DEFAULT NULL, + `subject` varchar(100) NOT NULL, + `body` text NOT NULL, `sent` tinyint(2) NOT NULL DEFAULT 0, `creationDate` timestamp NOT NULL DEFAULT current_timestamp(), - `attachment` varchar(100) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `status` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'OK', + `attachment` varchar(100) DEFAULT NULL, + `status` varchar(255) NOT NULL DEFAULT 'OK', `senderFk` int(10) unsigned DEFAULT NULL, `recipientFk` int(10) unsigned DEFAULT NULL, - `plainTextBody` text COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `plainTextBody` text DEFAULT NULL, PRIMARY KEY (`id`), KEY `sent_idx` (`sent`), KEY `creation_idx` (`creationDate`), @@ -30624,9 +30802,9 @@ DELIMITER ;; BEGIN IF NEW.sender IS NOT NULL THEN - + SET NEW.receiver = NEW.sender; - + END IF; END */;; @@ -30645,8 +30823,8 @@ DROP TABLE IF EXISTS `mailTemplates`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `mailTemplates` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `name` varchar(50) CHARACTER SET utf8mb3 NOT NULL, - `attachmentPath` text CHARACTER SET utf8mb3 NOT NULL, + `name` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, + `attachmentPath` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -30662,7 +30840,7 @@ CREATE TABLE `mandate` ( `id` int(11) NOT NULL AUTO_INCREMENT, `clientFk` int(11) NOT NULL, `companyFk` smallint(5) unsigned NOT NULL, - `code` varchar(32) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `code` varchar(32) DEFAULT NULL, `created` timestamp NULL DEFAULT current_timestamp(), `finished` timestamp NULL DEFAULT NULL, `mandateTypeFk` smallint(5) NOT NULL, @@ -30689,8 +30867,8 @@ DELIMITER ;; FOR EACH ROW BEGIN IF (NEW.code IS NULL) THEN - SET NEW.code=CONCAT(NEW.clientFk,'-',(SELECT AUTO_INCREMENT - FROM information_schema.TABLES + SET NEW.code=CONCAT(NEW.clientFk,'-',(SELECT AUTO_INCREMENT + FROM information_schema.TABLES WHERE TABLE_SCHEMA='vn' and TABLE_NAME='mandate')); END IF; END */;; @@ -30709,7 +30887,7 @@ DROP TABLE IF EXISTS `mandateType`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `mandateType` ( `id` smallint(5) NOT NULL AUTO_INCREMENT, - `name` varchar(45) COLLATE utf8mb3_unicode_ci NOT NULL, + `name` varchar(45) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -30723,14 +30901,34 @@ DROP TABLE IF EXISTS `manuscript`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `manuscript` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `code` varchar(45) CHARACTER SET utf8mb3 NOT NULL, - `description` text COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `code` varchar(45) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, + `description` text DEFAULT NULL, `enabled` tinyint(1) NOT NULL DEFAULT 1, PRIMARY KEY (`id`), UNIQUE KEY `code_UNIQUE` (`code`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; +-- +-- Table structure for table `mdbApp` +-- + +DROP TABLE IF EXISTS `mdbApp`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `mdbApp` ( + `app` varchar(100) NOT NULL, + `baselineBranchFk` varchar(255) NOT NULL, + `userFk` int(10) unsigned DEFAULT NULL, + `locked` datetime DEFAULT NULL, + PRIMARY KEY (`app`), + KEY `mdbApp_FK` (`userFk`), + KEY `mdbApp_FK_1` (`baselineBranchFk`), + CONSTRAINT `mdbApp_FK` FOREIGN KEY (`userFk`) REFERENCES `account`.`user` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, + CONSTRAINT `mdbApp_FK_1` FOREIGN KEY (`baselineBranchFk`) REFERENCES `mdbBranch` (`name`) ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + -- -- Table structure for table `mdbBranch` -- @@ -30739,11 +30937,28 @@ DROP TABLE IF EXISTS `mdbBranch`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `mdbBranch` ( - `name` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '', + `name` varchar(255) NOT NULL DEFAULT '', + `dsName` varchar(255) DEFAULT NULL, PRIMARY KEY (`name`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; +-- +-- Table structure for table `mdbConfig` +-- + +DROP TABLE IF EXISTS `mdbConfig`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `mdbConfig` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `issueTrackerUrl` varchar(255) NOT NULL, + `issueNumberRegex` varchar(255) NOT NULL, + `chatDestination` varchar(255) NOT NULL COMMENT 'User (@) or channel (#) to send the message', + PRIMARY KEY (`id`) +) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='Global configuration parameters for Access'; +/*!40101 SET character_set_client = @saved_cs_client */; + -- -- Table structure for table `mdbVersion` -- @@ -30752,8 +30967,8 @@ DROP TABLE IF EXISTS `mdbVersion`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `mdbVersion` ( - `app` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL, - `branchFk` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL, + `app` varchar(255) NOT NULL, + `branchFk` varchar(255) NOT NULL, `version` int(11) DEFAULT NULL, PRIMARY KEY (`app`,`branchFk`), KEY `mdbVersion_branchFk` (`branchFk`), @@ -30761,6 +30976,29 @@ CREATE TABLE `mdbVersion` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; +-- +-- Table structure for table `mdbVersionTree` +-- + +DROP TABLE IF EXISTS `mdbVersionTree`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `mdbVersionTree` ( + `app` varchar(255) NOT NULL, + `version` int(10) unsigned NOT NULL, + `branchFk` varchar(255) NOT NULL, + `fromVersion` int(10) unsigned NOT NULL, + `userFk` int(10) unsigned NOT NULL, + `description` text DEFAULT NULL, + `created` timestamp NOT NULL DEFAULT current_timestamp(), + PRIMARY KEY (`app`,`version`), + KEY `mdbVersionTree_FK` (`userFk`), + KEY `mdbVersionTree_FK_2` (`branchFk`), + CONSTRAINT `mdbVersionTree_FK` FOREIGN KEY (`userFk`) REFERENCES `account`.`user` (`id`) ON UPDATE CASCADE, + CONSTRAINT `mdbVersionTree_FK_2` FOREIGN KEY (`branchFk`) REFERENCES `mdbBranch` (`name`) ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + -- -- Table structure for table `medicalCenter` -- @@ -30770,7 +31008,7 @@ DROP TABLE IF EXISTS `medicalCenter`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `medicalCenter` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `name` varchar(45) COLLATE utf8mb3_unicode_ci NOT NULL, + `name` varchar(45) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -30787,11 +31025,11 @@ CREATE TABLE `medicalReview` ( `workerFk` int(10) unsigned NOT NULL, `centerFk` int(11) NOT NULL, `date` date DEFAULT NULL, - `time` varchar(5) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `time` varchar(5) DEFAULT NULL, `isFit` tinyint(1) DEFAULT NULL, `amount` double DEFAULT NULL, - `invoice` varchar(10) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `remark` longtext COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `invoice` varchar(10) DEFAULT NULL, + `remark` longtext DEFAULT NULL, PRIMARY KEY (`id`), KEY `frgcenter_idx` (`centerFk`), KEY `frgnkWorker_idx` (`workerFk`), @@ -30809,10 +31047,10 @@ DROP TABLE IF EXISTS `message`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `message` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `uuid` varchar(50) CHARACTER SET utf8mb3 NOT NULL, - `sender` varchar(50) CHARACTER SET utf8mb3 NOT NULL, - `recipient` varchar(50) CHARACTER SET utf8mb3 NOT NULL, - `message` longtext CHARACTER SET utf8mb3 DEFAULT NULL, + `uuid` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, + `sender` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, + `recipient` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, + `message` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL, `sendDate` timestamp NULL DEFAULT current_timestamp(), PRIMARY KEY (`id`), KEY `sender` (`sender`), @@ -30830,13 +31068,13 @@ DROP TABLE IF EXISTS `messageInbox`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `messageInbox` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `uuid` varchar(50) CHARACTER SET utf8mb3 NOT NULL, - `sender` varchar(50) CHARACTER SET utf8mb3 NOT NULL, - `recipient` varchar(45) CHARACTER SET utf8mb3 NOT NULL, - `finalRecipient` varchar(50) CHARACTER SET utf8mb3 NOT NULL, - `message` longtext CHARACTER SET utf8mb3 DEFAULT NULL, + `uuid` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, + `sender` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, + `recipient` varchar(45) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, + `finalRecipient` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, + `message` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL, `sendDate` timestamp NULL DEFAULT current_timestamp(), - `read` varchar(45) CHARACTER SET utf8mb3 NOT NULL DEFAULT '0', + `read` varchar(45) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `uuid` (`uuid`(8)), KEY `finalRecipient` (`finalRecipient`) @@ -30851,15 +31089,16 @@ DROP TABLE IF EXISTS `mistake`; /*!50001 DROP VIEW IF EXISTS `mistake`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `mistake` AS SELECT - 1 AS `revisador`, - 1 AS `concept`, - 1 AS `sacador`, - 1 AS `firstName`, - 1 AS `lastName`, - 1 AS `description`, - 1 AS `created`, - 1 AS `workerFk` */; +/*!50001 CREATE TABLE `mistake` ( + `revisador` tinyint NOT NULL, + `concept` tinyint NOT NULL, + `sacador` tinyint NOT NULL, + `firstName` tinyint NOT NULL, + `lastName` tinyint NOT NULL, + `description` tinyint NOT NULL, + `created` tinyint NOT NULL, + `workerFk` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -30870,15 +31109,16 @@ DROP TABLE IF EXISTS `mistakeRatio`; /*!50001 DROP VIEW IF EXISTS `mistakeRatio`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `mistakeRatio` AS SELECT - 1 AS `revisador`, - 1 AS `sacador`, - 1 AS `firstName`, - 1 AS `lastName`, - 1 AS `description`, - 1 AS `created`, - 1 AS `workerFk`, - 1 AS `saleFk` */; +/*!50001 CREATE TABLE `mistakeRatio` ( + `revisador` tinyint NOT NULL, + `sacador` tinyint NOT NULL, + `firstName` tinyint NOT NULL, + `lastName` tinyint NOT NULL, + `description` tinyint NOT NULL, + `created` tinyint NOT NULL, + `workerFk` tinyint NOT NULL, + `saleFk` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -30890,7 +31130,7 @@ DROP TABLE IF EXISTS `mistakeType`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `mistakeType` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `description` varchar(45) COLLATE utf8mb3_unicode_ci NOT NULL, + `description` varchar(45) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -30904,12 +31144,12 @@ DROP TABLE IF EXISTS `mobileAppVersionControl`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `mobileAppVersionControl` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `appName` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `version` varchar(45) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '0', + `appName` varchar(45) DEFAULT NULL, + `version` varchar(45) NOT NULL DEFAULT '0', `isVersionCritical` tinyint(1) DEFAULT 0, - `urlProduction` varchar(100) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `urlBeta` varchar(100) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `versionBeta` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `urlProduction` varchar(100) DEFAULT NULL, + `urlBeta` varchar(100) DEFAULT NULL, + `versionBeta` varchar(45) DEFAULT NULL, `isVersionBetaCritical` tinyint(1) DEFAULT 0, PRIMARY KEY (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='Tabla para llevar el control de las Versions de las aplicaciones móvil '; @@ -30940,7 +31180,7 @@ DROP TABLE IF EXISTS `mrwService`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `mrwService` ( - `agencyModeCodeFk` varchar(45) COLLATE utf8mb3_unicode_ci NOT NULL, + `agencyModeCodeFk` varchar(45) NOT NULL, `clientType` int(11) unsigned NOT NULL, `serviceType` int(11) unsigned DEFAULT NULL, PRIMARY KEY (`agencyModeCodeFk`), @@ -30956,10 +31196,10 @@ DROP TABLE IF EXISTS `mrwServiceWeekday`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `mrwServiceWeekday` ( - `agencyModeCodeFk` varchar(45) COLLATE utf8mb3_unicode_ci NOT NULL, - `weekdays` set('mon','tue','wed','thu','fri','sat','sun') COLLATE utf8mb3_unicode_ci NOT NULL, + `agencyModeCodeFk` varchar(45) NOT NULL, + `weekdays` set('mon','tue','wed','thu','fri','sat','sun') NOT NULL, `serviceType` int(11) unsigned NOT NULL, - `params` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `params` varchar(255) DEFAULT NULL, PRIMARY KEY (`agencyModeCodeFk`), CONSTRAINT `mrwServiceWeekday_agencyModeCodeFk` FOREIGN KEY (`agencyModeCodeFk`) REFERENCES `agencyMode` (`code`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='Configuración de los servicios en relación con el día de la semana para MRW'; @@ -30973,12 +31213,13 @@ DROP TABLE IF EXISTS `newBornSales`; /*!50001 DROP VIEW IF EXISTS `newBornSales`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `newBornSales` AS SELECT - 1 AS `amount`, - 1 AS `clientFk`, - 1 AS `userFk`, - 1 AS `dated`, - 1 AS `firstShipped` */; +/*!50001 CREATE TABLE `newBornSales` ( + `amount` tinyint NOT NULL, + `clientFk` tinyint NOT NULL, + `userFk` tinyint NOT NULL, + `dated` tinyint NOT NULL, + `firstShipped` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -30990,10 +31231,10 @@ DROP TABLE IF EXISTS `noticeCategory`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `noticeCategory` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `keyName` varchar(50) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `name` varchar(50) COLLATE utf8mb3_unicode_ci NOT NULL, - `subject` varchar(50) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `description` text COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `keyName` varchar(50) DEFAULT NULL, + `name` varchar(50) NOT NULL, + `subject` varchar(50) DEFAULT NULL, + `description` text DEFAULT NULL, `isEnabled` tinyint(1) NOT NULL DEFAULT 1, `requiredRole` int(11) NOT NULL DEFAULT 1, PRIMARY KEY (`id`), @@ -31027,8 +31268,8 @@ DROP TABLE IF EXISTS `observationType`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `observationType` ( `id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT, - `description` varchar(15) COLLATE utf8mb3_unicode_ci NOT NULL, - `code` varchar(45) COLLATE utf8mb3_unicode_ci NOT NULL, + `description` varchar(15) NOT NULL, + `code` varchar(45) NOT NULL, `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=utf8mb3 COLLATE=utf8mb3_unicode_ci; @@ -31042,8 +31283,8 @@ DROP TABLE IF EXISTS `occupationCode`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `occupationCode` ( - `code` varchar(1) CHARACTER SET utf8mb3 NOT NULL, - `name` varchar(100) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `code` varchar(1) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, + `name` varchar(100) DEFAULT NULL, PRIMARY KEY (`code`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='Código de ocupación de la seguridad social'; /*!40101 SET character_set_client = @saved_cs_client */; @@ -31059,7 +31300,7 @@ CREATE TABLE `operator` ( `workerFk` int(10) unsigned NOT NULL, `numberOfWagons` int(11) DEFAULT 1, `trainFk` int(11) NOT NULL DEFAULT 1, - `itemPackingTypeFk` varchar(1) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'H', + `itemPackingTypeFk` varchar(1) NOT NULL DEFAULT 'H', `warehouseFk` smallint(6) unsigned NOT NULL DEFAULT 60, PRIMARY KEY (`workerFk`), KEY `operator_FK` (`workerFk`), @@ -31081,11 +31322,12 @@ DROP TABLE IF EXISTS `operatorWorkerCode`; /*!50001 DROP VIEW IF EXISTS `operatorWorkerCode`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `operatorWorkerCode` AS SELECT - 1 AS `workerFk`, - 1 AS `fullName`, - 1 AS `code`, - 1 AS `numberOfWagons` */; +/*!50001 CREATE TABLE `operatorWorkerCode` ( + `workerFk` tinyint NOT NULL, + `fullName` tinyint NOT NULL, + `code` tinyint NOT NULL, + `numberOfWagons` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -31114,8 +31356,8 @@ DROP TABLE IF EXISTS `origin`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `origin` ( `id` tinyint(2) unsigned NOT NULL AUTO_INCREMENT, - `code` varchar(3) COLLATE utf8mb3_unicode_ci NOT NULL, - `name` varchar(20) COLLATE utf8mb3_unicode_ci NOT NULL, + `code` varchar(3) NOT NULL, + `name` varchar(20) NOT NULL, `warehouseFk` smallint(5) unsigned DEFAULT 4, `countryFk` mediumint(8) unsigned NOT NULL DEFAULT 1, PRIMARY KEY (`id`), @@ -31135,8 +31377,8 @@ DROP TABLE IF EXISTS `originI18n`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `originI18n` ( `originFk` tinyint(2) unsigned NOT NULL, - `lang` char(2) CHARACTER SET utf8mb3 NOT NULL, - `name` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL, + `lang` char(2) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, + `name` varchar(255) NOT NULL, PRIMARY KEY (`originFk`,`lang`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -31149,9 +31391,10 @@ DROP TABLE IF EXISTS `originL10n`; /*!50001 DROP VIEW IF EXISTS `originL10n`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `originL10n` AS SELECT - 1 AS `id`, - 1 AS `name` */; +/*!50001 CREATE TABLE `originL10n` ( + `id` tinyint NOT NULL, + `name` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -31163,20 +31406,20 @@ DROP TABLE IF EXISTS `osTicketConfig`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `osTicketConfig` ( `id` int(11) NOT NULL, - `host` varchar(100) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `user` varchar(100) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `password` varchar(100) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `oldStatus` varchar(100) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `host` varchar(100) DEFAULT NULL, + `user` varchar(100) DEFAULT NULL, + `password` varchar(100) DEFAULT NULL, + `oldStatus` varchar(100) DEFAULT NULL, `newStatusId` int(11) DEFAULT NULL, `day` int(11) DEFAULT NULL, - `comment` varchar(100) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `hostDb` varchar(100) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `userDb` varchar(100) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `passwordDb` varchar(100) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `comment` varchar(100) DEFAULT NULL, + `hostDb` varchar(100) DEFAULT NULL, + `userDb` varchar(100) DEFAULT NULL, + `passwordDb` varchar(100) DEFAULT NULL, `portDb` int(11) DEFAULT NULL, - `responseType` varchar(100) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `responseType` varchar(100) DEFAULT NULL, `fromEmailId` int(11) DEFAULT NULL, - `replyTo` varchar(100) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `replyTo` varchar(100) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -31221,8 +31464,8 @@ DROP TABLE IF EXISTS `packageEquivalent`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `packageEquivalent` ( - `packagingFk` varchar(10) COLLATE utf8mb3_unicode_ci NOT NULL, - `equivalentFk` varchar(10) COLLATE utf8mb3_unicode_ci NOT NULL, + `packagingFk` varchar(10) NOT NULL, + `equivalentFk` varchar(10) NOT NULL, PRIMARY KEY (`packagingFk`,`equivalentFk`), KEY `packageEquivalent_fk2_idx` (`equivalentFk`), CONSTRAINT `packageEquivalent_fk1` FOREIGN KEY (`packagingFk`) REFERENCES `packaging` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, @@ -31238,9 +31481,10 @@ DROP TABLE IF EXISTS `packageEquivalentItem`; /*!50001 DROP VIEW IF EXISTS `packageEquivalentItem`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `packageEquivalentItem` AS SELECT - 1 AS `itemFk`, - 1 AS `equivalentFk` */; +/*!50001 CREATE TABLE `packageEquivalentItem` ( + `itemFk` tinyint NOT NULL, + `equivalentFk` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -31251,7 +31495,7 @@ DROP TABLE IF EXISTS `packaging`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `packaging` ( - `id` varchar(10) COLLATE utf8mb3_unicode_ci NOT NULL, + `id` varchar(10) NOT NULL, `volume` decimal(10,2) DEFAULT 0.00, `width` decimal(10,2) DEFAULT 0.00, `depth` decimal(10,2) DEFAULT 0.00, @@ -31268,7 +31512,7 @@ CREATE TABLE `packaging` ( `isBox` tinyint(1) NOT NULL DEFAULT 0, `cubicPackage` decimal(10,2) DEFAULT NULL, `returnCost` decimal(10,2) NOT NULL DEFAULT 0.00, - `cmrName` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `cmrName` varchar(45) DEFAULT NULL, `freightItemFk` int(11) DEFAULT NULL, `hasCompressionVariations` tinyint(1) DEFAULT 0 COMMENT 'Floramondo puede servirlos no llenos del todo', `conveyorBuildingClassFk` int(11) DEFAULT NULL, @@ -31338,8 +31582,8 @@ CREATE TABLE `packagingConfig` ( `upperGap` int(11) NOT NULL, `previousPreparationMinimumSize` int(11) NOT NULL, `defaultConveyorBuildingClass` int(11) NOT NULL, - `palletPackaging` varchar(10) COLLATE utf8mb3_unicode_ci DEFAULT 'pallet USA', - `carryPackaging` varchar(10) COLLATE utf8mb3_unicode_ci DEFAULT 'cc', + `palletPackaging` varchar(10) DEFAULT 'pallet USA', + `carryPackaging` varchar(10) DEFAULT 'cc', `freightItemPackaging` int(11) DEFAULT 71, PRIMARY KEY (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='Altura mínima para preparar pedidos en preparacion previa'; @@ -31354,7 +31598,7 @@ DROP TABLE IF EXISTS `packagingGifts`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `packagingGifts` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `description` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL, + `description` varchar(255) NOT NULL, `photo` blob DEFAULT NULL, `started` date NOT NULL, `ended` date NOT NULL, @@ -31379,7 +31623,7 @@ DROP TABLE IF EXISTS `packagingWithFreight`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `packagingWithFreight` ( - `packagingFk` varchar(10) COLLATE utf8mb3_unicode_ci NOT NULL, + `packagingFk` varchar(10) NOT NULL, `priority` int(11) NOT NULL, PRIMARY KEY (`packagingFk`), UNIQUE KEY `packagingWithFreight_UN` (`priority`), @@ -31395,7 +31639,7 @@ DROP TABLE IF EXISTS `packagingWithoutFreight`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `packagingWithoutFreight` ( - `packagingFk` varchar(10) COLLATE utf8mb3_unicode_ci NOT NULL, + `packagingFk` varchar(10) NOT NULL, `priority` int(11) NOT NULL, PRIMARY KEY (`packagingFk`), UNIQUE KEY `packagingWithoutFreight_UN` (`priority`), @@ -31412,11 +31656,11 @@ DROP TABLE IF EXISTS `packingSite`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `packingSite` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `code` varchar(10) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `code` varchar(10) DEFAULT NULL, `hostFk` int(11) NOT NULL, `printerFk` tinyint(3) unsigned DEFAULT NULL, `collectionFk` int(11) DEFAULT NULL COMMENT 'Last collection packed on this site', - `monitorId` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `monitorId` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `packingSite_UN` (`code`), KEY `packingSite_FK_1` (`printerFk`), @@ -31437,9 +31681,9 @@ DROP TABLE IF EXISTS `packingSiteConfig`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `packingSiteConfig` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `shinobiUrl` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL, - `shinobiToken` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL, - `shinobiGroupKey` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL, + `shinobiUrl` varchar(255) NOT NULL, + `shinobiToken` varchar(255) NOT NULL, + `shinobiGroupKey` varchar(255) NOT NULL, `avgBoxingTime` int(3) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; @@ -31454,13 +31698,13 @@ DROP TABLE IF EXISTS `packingSiteLog`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `packingSiteLog` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `packingSiteFk` varchar(10) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `hostFk` varchar(15) COLLATE utf8mb3_unicode_ci NOT NULL, + `packingSiteFk` varchar(10) DEFAULT NULL, + `hostFk` varchar(15) NOT NULL, `workerFk` int(10) unsigned NOT NULL, - `printerModelFk` varchar(50) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `typeErrorFk` varchar(30) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `printerModelFk` varchar(50) DEFAULT NULL, + `typeErrorFk` varchar(30) DEFAULT NULL, `creationDate` timestamp NULL DEFAULT current_timestamp(), - `description` text COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `description` text DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `packingSiteLog_UN` (`id`), KEY `packingSiteLog_FK` (`workerFk`), @@ -31482,8 +31726,8 @@ DROP TABLE IF EXISTS `packingSiteTypeError`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `packingSiteTypeError` ( - `code` varchar(30) COLLATE utf8mb3_unicode_ci NOT NULL, - `description` varchar(100) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `code` varchar(30) NOT NULL, + `description` varchar(100) DEFAULT NULL, PRIMARY KEY (`code`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -31496,9 +31740,9 @@ DROP TABLE IF EXISTS `paperSize`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `paperSize` ( - `code` varchar(100) COLLATE utf8mb3_unicode_ci NOT NULL, - `color` varchar(100) COLLATE utf8mb3_unicode_ci NOT NULL, - `alias` varchar(100) COLLATE utf8mb3_unicode_ci NOT NULL, + `code` varchar(100) NOT NULL, + `color` varchar(100) NOT NULL, + `alias` varchar(100) NOT NULL, PRIMARY KEY (`code`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -31512,10 +31756,10 @@ DROP TABLE IF EXISTS `parking`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `parking` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `column` varchar(5) CHARACTER SET utf8mb3 DEFAULT '--', - `row` varchar(5) CHARACTER SET utf8mb3 DEFAULT '--', + `column` varchar(5) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT '--', + `row` varchar(5) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT '--', `sectorFk` int(11) NOT NULL DEFAULT 2, - `code` varchar(8) CHARACTER SET utf8mb3 DEFAULT NULL, + `code` varchar(8) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL, `pickingOrder` int(11) DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `code_UNIQUE` (`code`), @@ -31560,7 +31804,7 @@ DELIMITER ;; BEGIN -- SET new.`code` = CONCAT(new.`column`,' - ',new.`row`) ; - + END */;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -31577,7 +31821,7 @@ DROP TABLE IF EXISTS `payDem`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `payDem` ( `id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT, - `payDem` varchar(15) COLLATE utf8mb3_unicode_ci NOT NULL, + `payDem` varchar(15) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -31605,9 +31849,9 @@ DROP TABLE IF EXISTS `payMethod`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `payMethod` ( `id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT, - `code` varchar(50) CHARACTER SET utf8mb3 DEFAULT NULL, - `name` varchar(20) COLLATE utf8mb3_unicode_ci NOT NULL, - `solution` varchar(1) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `code` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL, + `name` varchar(20) NOT NULL, + `solution` varchar(1) DEFAULT NULL, `outstandingDebt` tinyint(3) unsigned zerofill NOT NULL DEFAULT 000, `graceDays` int(11) unsigned NOT NULL DEFAULT 0, `isIbanRequiredForClients` tinyint(3) DEFAULT 0, @@ -31636,7 +31880,7 @@ CREATE TABLE `payment` ( `bankFk` int(11) NOT NULL DEFAULT 0, `payMethodFk` tinyint(3) unsigned NOT NULL, `bankingFees` double(6,2) unsigned NOT NULL DEFAULT 0.00, - `concept` varchar(30) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `concept` varchar(30) 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, @@ -31685,13 +31929,13 @@ BEGIN SELECT account INTO cuenta_banco FROM bank WHERE id = NEW.bankFk; - + SELECT account INTO cuenta_proveedor FROM supplier WHERE id = NEW.supplierFk; - + CALL vn.ledger_next(vNewBookEntry); - + INSERT INTO XDiario ( ASIEN, FECHA, SUBCTA, @@ -31717,7 +31961,7 @@ BEGIN cuenta_banco CONTRA, NEW.amount EURODEBE, 0 EUROHABER) gf; - + IF NEW.bankingFees <> 0 THEN INSERT INTO XDiario ( ASIEN, FECHA, @@ -31739,7 +31983,7 @@ BEGIN FROM supplier s JOIN country c ON s.countryFk = c.id WHERE s.id = NEW.supplierFk; - END IF; + END IF; END IF; SET NEW.dueDated = IFNULL(NEW.dueDated, NEW.received); @@ -31747,15 +31991,15 @@ BEGIN SELECT isActive INTO isSupplierActive FROM supplier WHERE id = NEW.supplierFk; - + IF isSupplierActive = FALSE THEN CALL util.throw('SUPPLIER_INACTIVE'); END IF; - + IF ISNULL(NEW.workerFk) THEN SET NEW.workerFk = account.myUser_getId(); END IF; - + END */;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -31777,12 +32021,12 @@ DELIMITER ;; BEGIN DECLARE vIsPayMethodChecked BOOLEAN; DECLARE vEmail VARCHAR(150); - + SELECT isPayMethodChecked INTO vIsPayMethodChecked FROM supplier WHERE id = NEW.supplierFk; - - + + IF vIsPayMethodChecked = FALSE THEN SELECT notificationEmail INTO vEmail @@ -31891,8 +32135,8 @@ DROP TABLE IF EXISTS `periodicityType`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `periodicityType` ( - `code` varchar(45) CHARACTER SET utf8mb3 NOT NULL, - `description` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `code` varchar(45) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, + `description` varchar(45) DEFAULT NULL, PRIMARY KEY (`code`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -31905,9 +32149,10 @@ DROP TABLE IF EXISTS `personMedia`; /*!50001 DROP VIEW IF EXISTS `personMedia`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `personMedia` AS SELECT - 1 AS `workerFk`, - 1 AS `mediaValue` */; +/*!50001 CREATE TABLE `personMedia` ( + `workerFk` tinyint NOT NULL, + `mediaValue` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -31919,7 +32164,7 @@ DROP TABLE IF EXISTS `personalProtectionEquipment`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `personalProtectionEquipment` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `name` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL, + `name` varchar(255) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -31932,9 +32177,9 @@ DROP TABLE IF EXISTS `pgc`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `pgc` ( - `code` varchar(10) COLLATE utf8mb3_unicode_ci NOT NULL, + `code` varchar(10) NOT NULL, `rate` decimal(10,2) NOT NULL, - `name` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `name` varchar(45) DEFAULT NULL, `cplusTaxBreakFk` int(10) unsigned DEFAULT 1, `mod340` tinyint(1) NOT NULL DEFAULT 0, `mod347` tinyint(1) NOT NULL DEFAULT 0, @@ -31956,8 +32201,8 @@ DROP TABLE IF EXISTS `pgcEqu`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `pgcEqu` ( - `vatFk` varchar(10) COLLATE utf8mb3_unicode_ci NOT NULL COMMENT 'Cuenta de IVA', - `equFk` varchar(10) COLLATE utf8mb3_unicode_ci NOT NULL COMMENT 'Cuenta de recargo de equivalencia', + `vatFk` varchar(10) NOT NULL COMMENT 'Cuenta de IVA', + `equFk` varchar(10) NOT NULL COMMENT 'Cuenta de recargo de equivalencia', PRIMARY KEY (`vatFk`,`equFk`), KEY `pgcEqu_fk2_idx` (`equFk`), CONSTRAINT `pgcEqu_fk1` FOREIGN KEY (`vatFk`) REFERENCES `pgc` (`code`) ON DELETE CASCADE ON UPDATE CASCADE, @@ -31973,8 +32218,8 @@ DROP TABLE IF EXISTS `pgcMaster`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `pgcMaster` ( - `code` varchar(10) COLLATE utf8mb3_unicode_ci NOT NULL, - `description` varchar(100) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `code` varchar(10) NOT NULL, + `description` varchar(100) DEFAULT NULL, PRIMARY KEY (`code`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='tan solo tiene las cuentas de contaplus'; /*!40101 SET character_set_client = @saved_cs_client */; @@ -31987,11 +32232,12 @@ DROP TABLE IF EXISTS `phoneBook`; /*!50001 DROP VIEW IF EXISTS `phoneBook`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `phoneBook` AS SELECT - 1 AS `Tipo`, - 1 AS `Id`, - 1 AS `Cliente`, - 1 AS `Telefono` */; +/*!50001 CREATE TABLE `phoneBook` ( + `Tipo` tinyint NOT NULL, + `Id` tinyint NOT NULL, + `Cliente` tinyint NOT NULL, + `Telefono` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -32004,7 +32250,7 @@ DROP TABLE IF EXISTS `plantpassport`; CREATE TABLE `plantpassport` ( `producerFk` mediumint(3) unsigned NOT NULL, `plantpassportAuthorityFk` mediumint(3) unsigned NOT NULL, - `number` varchar(25) CHARACTER SET utf8mb3 DEFAULT NULL, + `number` varchar(25) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL, `isRequested` tinyint(2) NOT NULL DEFAULT 0, PRIMARY KEY (`producerFk`,`plantpassportAuthorityFk`), KEY `plantpassport_authority_idx` (`plantpassportAuthorityFk`), @@ -32023,7 +32269,7 @@ DROP TABLE IF EXISTS `plantpassportAuthority`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `plantpassportAuthority` ( `id` mediumint(3) unsigned NOT NULL, - `denomination` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `denomination` varchar(45) DEFAULT NULL, `countryFk` mediumint(8) unsigned DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `denomination_UNIQUE` (`denomination`), @@ -32040,7 +32286,7 @@ DROP TABLE IF EXISTS `postCode`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `postCode` ( - `code` varchar(30) COLLATE utf8mb3_unicode_ci NOT NULL, + `code` varchar(30) NOT NULL, `townFk` int(11) NOT NULL, `geoFk` int(11) DEFAULT NULL, PRIMARY KEY (`code`,`townFk`), @@ -32156,18 +32402,18 @@ CREATE TABLE `ppe` ( `value` decimal(10,2) NOT NULL DEFAULT 0.00, `planFk` int(11) NOT NULL, `groupFk` int(11) DEFAULT NULL, - `account` varchar(10) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `endowment` varchar(10) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `elementAccount` varchar(10) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `nature` varchar(30) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `location` varchar(10) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `account` varchar(10) DEFAULT NULL, + `endowment` varchar(10) DEFAULT NULL, + `elementAccount` varchar(10) DEFAULT NULL, + `nature` varchar(30) DEFAULT NULL, + `location` varchar(10) DEFAULT NULL, `discharged` date DEFAULT NULL, - `cause` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `cause` varchar(45) DEFAULT NULL, `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, - `description` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `description` varchar(45) DEFAULT NULL, PRIMARY KEY (`id`), KEY `ppe_fk1_idx` (`workerFk`), KEY `ppe_fk2_idx` (`planFk`), @@ -32236,7 +32482,7 @@ DROP TABLE IF EXISTS `ppeGroup`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `ppeGroup` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `description` varchar(45) COLLATE utf8mb3_unicode_ci NOT NULL, + `description` varchar(45) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='Tipo de inmovilizado'; /*!40101 SET character_set_client = @saved_cs_client */; @@ -32249,8 +32495,8 @@ DROP TABLE IF EXISTS `ppeLocation`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `ppeLocation` ( - `code` varchar(10) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '', - `description` varchar(100) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `code` varchar(10) NOT NULL DEFAULT '', + `description` varchar(100) DEFAULT NULL, PRIMARY KEY (`code`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -32365,13 +32611,14 @@ CREATE TABLE `printQueue` ( `printerFk` tinyint(3) unsigned DEFAULT NULL, `priorityFk` tinyint(3) unsigned NOT NULL DEFAULT 3 COMMENT '1 - high, 2 - normal, 3 - low', `reportFk` tinyint(3) unsigned DEFAULT NULL, - `statusCode` enum('queued','error','printing','printed') COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'queued', + `statusCode` enum('queued','error','printing','printed') NOT NULL DEFAULT 'queued', `started` datetime DEFAULT NULL, `finished` datetime DEFAULT NULL, `workerFk` int(11) DEFAULT NULL, - `error` text COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `error` text DEFAULT NULL, `errorNumber` int(11) DEFAULT NULL, `created` timestamp NOT NULL DEFAULT current_timestamp(), + `serverId` int(10) unsigned DEFAULT NULL COMMENT 'Indica el id del servidor de impresión', PRIMARY KEY (`id`), KEY `statusCode` (`statusCode`), KEY `printerFk` (`printerFk`), @@ -32393,8 +32640,8 @@ DROP TABLE IF EXISTS `printQueueArgs`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `printQueueArgs` ( `printQueueFk` int(10) unsigned NOT NULL, - `name` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL, - `value` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL, + `name` varchar(255) NOT NULL, + `value` varchar(255) NOT NULL, PRIMARY KEY (`printQueueFk`,`name`), KEY `printQueueArgs_printQueueFk_idx` (`printQueueFk`), CONSTRAINT `printQueueArgs_printQueueFk` FOREIGN KEY (`printQueueFk`) REFERENCES `printQueue` (`id`) ON DELETE CASCADE ON UPDATE CASCADE @@ -32409,8 +32656,8 @@ DROP TABLE IF EXISTS `printQueueConfig`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `printQueueConfig` ( - `networkDrive` varchar(10) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'X:\\', - `dmsPath` varchar(45) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT ' \\\\server\\dms', + `networkDrive` varchar(10) NOT NULL DEFAULT 'X:\\', + `dmsPath` varchar(45) NOT NULL DEFAULT ' \\\\server\\dms', `printQueueLimit` int(11) NOT NULL DEFAULT 30 COMMENT 'Número máximo de filas de la cola de impresión a mostrar al enviar correo a través del evento vn.printQueue_check' ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -32423,16 +32670,16 @@ DROP TABLE IF EXISTS `printer`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `printer` ( - `id` tinyint(3) unsigned NOT NULL, - `name` varchar(50) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `path` varchar(50) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `modelFk` varchar(50) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `macWifi` varchar(20) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `ipAddress` varchar(15) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `reference` varchar(50) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(50) DEFAULT NULL, + `path` varchar(50) DEFAULT NULL, + `modelFk` varchar(50) DEFAULT NULL, + `macWifi` varchar(20) DEFAULT NULL, + `ipAddress` varchar(15) DEFAULT NULL, + `reference` varchar(50) DEFAULT NULL, `isLabeler` tinyint(1) DEFAULT 0 COMMENT 'Indica si es impresora de etiquetas', `sectorFk` int(11) DEFAULT NULL, - `paperSizeFk` varchar(100) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `paperSizeFk` varchar(100) DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `printer_UN` (`reference`), UNIQUE KEY `printer_UN1` (`macWifi`), @@ -32444,7 +32691,7 @@ CREATE TABLE `printer` ( CONSTRAINT `printer_FK` FOREIGN KEY (`modelFk`) REFERENCES `printerModel` (`code`) ON UPDATE CASCADE, CONSTRAINT `printer_FK_1` FOREIGN KEY (`paperSizeFk`) REFERENCES `paperSize` (`code`), CONSTRAINT `printer_sectorFk` FOREIGN KEY (`sectorFk`) REFERENCES `sector` (`id`) ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; +) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -32455,7 +32702,7 @@ DROP TABLE IF EXISTS `printerModel`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `printerModel` ( - `code` varchar(50) COLLATE utf8mb3_unicode_ci NOT NULL, + `code` varchar(50) NOT NULL, PRIMARY KEY (`code`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -32484,7 +32731,7 @@ DROP TABLE IF EXISTS `producer`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `producer` ( `id` mediumint(3) unsigned NOT NULL AUTO_INCREMENT, - `name` varchar(50) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `name` varchar(50) DEFAULT NULL, `isVisible` tinyint(1) NOT NULL DEFAULT 1, `created` timestamp NULL DEFAULT current_timestamp(), PRIMARY KEY (`id`), @@ -32530,12 +32777,13 @@ DROP TABLE IF EXISTS `productionVolume`; /*!50001 DROP VIEW IF EXISTS `productionVolume`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `productionVolume` AS SELECT - 1 AS `hora`, - 1 AS `minuto`, - 1 AS `cm3`, - 1 AS `warehouseFk`, - 1 AS `created` */; +/*!50001 CREATE TABLE `productionVolume` ( + `hora` tinyint NOT NULL, + `minuto` tinyint NOT NULL, + `cm3` tinyint NOT NULL, + `warehouseFk` tinyint NOT NULL, + `created` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -32546,9 +32794,10 @@ DROP TABLE IF EXISTS `productionVolume_LastHour`; /*!50001 DROP VIEW IF EXISTS `productionVolume_LastHour`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `productionVolume_LastHour` AS SELECT - 1 AS `m3`, - 1 AS `warehouseFk` */; +/*!50001 CREATE TABLE `productionVolume_LastHour` ( + `m3` tinyint NOT NULL, + `warehouseFk` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -32560,7 +32809,7 @@ DROP TABLE IF EXISTS `professionalCategory`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `professionalCategory` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `description` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `description` varchar(45) DEFAULT NULL, `salary` decimal(10,2) DEFAULT NULL, `salaryorSeniority` decimal(10,2) DEFAULT NULL, `year` int(2) DEFAULT NULL, @@ -32577,7 +32826,7 @@ DROP TABLE IF EXISTS `profileType`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `profileType` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `name` varchar(15) COLLATE utf8mb3_unicode_ci NOT NULL, + `name` varchar(15) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -32592,16 +32841,16 @@ DROP TABLE IF EXISTS `project`; CREATE TABLE `project` ( `id` int(11) NOT NULL AUTO_INCREMENT, `created` timestamp NOT NULL DEFAULT current_timestamp(), - `name` varchar(100) COLLATE utf8mb3_unicode_ci NOT NULL, + `name` varchar(100) NOT NULL, `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, - `location` varchar(100) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `location` varchar(100) DEFAULT NULL, `amount` decimal(15,2) DEFAULT NULL, - `stateFk` varchar(25) COLLATE utf8mb3_unicode_ci DEFAULT 'open', + `stateFk` varchar(25) DEFAULT 'open', PRIMARY KEY (`id`), KEY `project_FK` (`userFk`), KEY `project_FK_1` (`departmentFk`), @@ -32624,7 +32873,7 @@ DROP TABLE IF EXISTS `projectNotes`; CREATE TABLE `projectNotes` ( `id` int(11) NOT NULL AUTO_INCREMENT, `created` timestamp NOT NULL DEFAULT current_timestamp(), - `txt` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL, + `txt` varchar(255) NOT NULL, `userFk` int(10) unsigned DEFAULT NULL, `projectFk` int(11) NOT NULL, PRIMARY KEY (`id`), @@ -32647,11 +32896,11 @@ DELIMITER ;; BEFORE INSERT ON projectNotes FOR EACH ROW BEGIN - + IF ISNULL(NEW.userFk) THEN - + SET NEW.userFk = account.myUser_getId(); - + END IF; END */;; @@ -32669,8 +32918,8 @@ DROP TABLE IF EXISTS `projectState`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `projectState` ( - `code` varchar(25) COLLATE utf8mb3_unicode_ci NOT NULL, - `description` varchar(100) COLLATE utf8mb3_unicode_ci NOT NULL, + `code` varchar(25) NOT NULL, + `description` varchar(100) NOT NULL, PRIMARY KEY (`code`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -32684,12 +32933,12 @@ DROP TABLE IF EXISTS `property`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `property` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `name` varchar(250) COLLATE utf8mb3_unicode_ci NOT NULL, - `cadaster` varchar(200) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `name` varchar(250) NOT NULL, + `cadaster` varchar(200) DEFAULT NULL, `smallholding` int(11) DEFAULT NULL, - `area` varchar(100) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `area` varchar(100) DEFAULT NULL, `townFk` int(11) NOT NULL, - `registry` varchar(200) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `registry` varchar(200) DEFAULT NULL, `volume` int(11) DEFAULT NULL, `book` int(11) DEFAULT NULL, `page` int(11) DEFAULT NULL, @@ -32699,11 +32948,13 @@ CREATE TABLE `property` ( `propertyGroupFk` int(11) NOT NULL, `companyFk` smallint(5) unsigned NOT NULL, `photo` blob DEFAULT NULL, - `allocation` varchar(200) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `allocation` varchar(200) DEFAULT NULL, `m2` decimal(10,2) DEFAULT NULL, `tome` int(11) DEFAULT NULL, - `url` varchar(250) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `protocol` varchar(100) COLLATE utf8mb3_unicode_ci DEFAULT NULL COMMENT 'numero de protocolo notarial de la escritura de compra venta', + `url` varchar(250) DEFAULT NULL, + `protocol` varchar(100) DEFAULT NULL COMMENT 'numero de protocolo notarial de la escritura de compra venta', + `purchased` date NOT NULL DEFAULT util.VN_CURDATE() COMMENT 'date of purchase of the property', + `booked` date DEFAULT NULL COMMENT 'date of completion of property registration', PRIMARY KEY (`id`), KEY `property_FK` (`propertyGroupFk`), KEY `property_FK_1` (`townFk`), @@ -32742,7 +32993,7 @@ DROP TABLE IF EXISTS `propertyGroup`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `propertyGroup` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `description` varchar(100) COLLATE utf8mb3_unicode_ci NOT NULL, + `description` varchar(100) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -32758,7 +33009,7 @@ CREATE TABLE `propertyNotes` ( `id` int(11) NOT NULL AUTO_INCREMENT, `propertyFk` int(11) NOT NULL, `created` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), - `note` text COLLATE utf8mb3_unicode_ci NOT NULL, + `note` text NOT NULL, `userFk` int(10) unsigned DEFAULT NULL, PRIMARY KEY (`id`), KEY `propertyNotes_FK_1` (`userFk`), @@ -32777,7 +33028,7 @@ DROP TABLE IF EXISTS `province`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `province` ( `id` smallint(6) unsigned NOT NULL AUTO_INCREMENT, - `name` varchar(30) COLLATE utf8mb3_unicode_ci NOT NULL, + `name` varchar(30) NOT NULL, `countryFk` mediumint(8) unsigned NOT NULL, `warehouseFk` smallint(6) unsigned DEFAULT NULL COMMENT 'warehouse responsable de las rutas', `zoneFk` tinyint(4) DEFAULT NULL, @@ -32807,10 +33058,10 @@ DELIMITER ;; BEFORE INSERT ON `province` FOR EACH ROW BEGIN - + SET NEW.geoFk = zoneGeo_new('province', NEW.`name`, (SELECT geoFk FROM autonomy WHERE id = NEW.autonomyFk)); - + SET NEW.countryFk = (SELECT a.countryFk FROM vn.autonomy a WHERE a.id = NEW.autonomyFk); END */;; @@ -32831,14 +33082,14 @@ DELIMITER ;; /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`province_beforeUpdate` BEFORE UPDATE ON `province` FOR EACH ROW -BEGIN - +BEGIN + IF !(OLD.autonomyFk <=> NEW.autonomyFk) THEN - + SET NEW.countryFk = (SELECT a.countryFk FROM vn.autonomy a WHERE a.id = NEW.autonomyFk); END IF; - + END */;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -32886,7 +33137,7 @@ DELIMITER ;; AFTER DELETE ON `province` FOR EACH ROW BEGIN - CALL zoneGeo_delete(OLD.geoFk); + CALL zoneGeo_delete(OLD.geoFk); END */;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -32918,8 +33169,8 @@ DROP TABLE IF EXISTS `queuePriority`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `queuePriority` ( `id` tinyint(3) unsigned NOT NULL DEFAULT 0, - `priority` varchar(50) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `code` varchar(6) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `priority` varchar(50) DEFAULT NULL, + `code` varchar(6) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -32984,7 +33235,7 @@ DROP TABLE IF EXISTS `receipt`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `receipt` ( `Id` int(11) NOT NULL AUTO_INCREMENT, - `invoiceFk` varchar(50) COLLATE utf8mb3_unicode_ci DEFAULT NULL COMMENT 'nombre incorrecto, renombrar a description', + `invoiceFk` varchar(50) DEFAULT NULL COMMENT 'nombre incorrecto, renombrar a description', `amountPaid` decimal(10,2) NOT NULL DEFAULT 0.00, `payed` datetime DEFAULT NULL, `workerFk` int(10) unsigned DEFAULT NULL, @@ -33026,7 +33277,7 @@ BEGIN FROM accounting a JOIN accountingType at2 ON at2.id = a.accountingTypeFk WHERE a.id = NEW.bankFk; - + SET NEW.isConciliate = vIsAutoConciliated; END IF; END */;; @@ -33131,14 +33382,14 @@ DROP TABLE IF EXISTS `recipe`; CREATE TABLE `recipe` ( `id` int(11) NOT NULL AUTO_INCREMENT, `itemFk` int(11) NOT NULL COMMENT 'bouquet al que hace referencia la receta', - `name` varchar(50) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `name` varchar(50) DEFAULT NULL, `size` int(10) unsigned DEFAULT NULL, `originFk` tinyint(2) unsigned DEFAULT NULL, `typeFk` smallint(5) unsigned DEFAULT NULL, - `longName` varchar(50) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `longName` varchar(50) DEFAULT NULL, `quantity` int(11) NOT NULL DEFAULT 1, - `element` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `inkFk` varchar(3) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `element` varchar(45) DEFAULT NULL, + `inkFk` varchar(3) DEFAULT NULL, PRIMARY KEY (`id`), KEY `recipe_ix_1` (`element`), KEY `recipe_ix_2` (`itemFk`), @@ -33157,7 +33408,7 @@ DROP TABLE IF EXISTS `recipe_log`; CREATE TABLE `recipe_log` ( `id` int(11) NOT NULL AUTO_INCREMENT, `recipe_ItemFk` int(11) NOT NULL, - `element` varchar(45) COLLATE utf8mb3_unicode_ci NOT NULL, + `element` varchar(45) NOT NULL, `selected_ItemFk` int(11) NOT NULL, PRIMARY KEY (`id`), KEY `recipe_log_ix1` (`recipe_ItemFk`), @@ -33197,7 +33448,7 @@ DROP TABLE IF EXISTS `referenceCurrent`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `referenceCurrent` ( - `dated` date NOT NULL, + `dated` date NOT NULL DEFAULT current_timestamp(), `value` decimal(10,4) NOT NULL, `currencyFk` tinyint(3) unsigned NOT NULL, PRIMARY KEY (`dated`,`currencyFk`), @@ -33243,14 +33494,14 @@ DROP TABLE IF EXISTS `report`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `report` ( - `id` tinyint(3) unsigned NOT NULL, - `name` varchar(50) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `paperSizeFk` varchar(100) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `method` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL COMMENT 'Salix method', + `id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(50) DEFAULT NULL, + `paperSizeFk` varchar(100) DEFAULT NULL, + `method` varchar(255) DEFAULT NULL COMMENT 'Salix method', PRIMARY KEY (`id`), KEY `report_FK` (`paperSizeFk`), CONSTRAINT `report_FK` FOREIGN KEY (`paperSizeFk`) REFERENCES `paperSize` (`code`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; +) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -33262,13 +33513,38 @@ DROP TABLE IF EXISTS `returnBuckets`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `returnBuckets` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `freightContainerType` varchar(15) COLLATE utf8mb3_unicode_ci NOT NULL, + `freightContainerType` varchar(15) NOT NULL, `freightPackagingEmpty` double NOT NULL DEFAULT 0, `freightPackagingFull` double NOT NULL DEFAULT 0, PRIMARY KEY (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; +-- +-- Table structure for table `roadmap` +-- + +DROP TABLE IF EXISTS `roadmap`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `roadmap` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `tractorPlate` varchar(10) DEFAULT NULL, + `trailerPlate` varchar(12) DEFAULT NULL, + `phone` varchar(15) DEFAULT NULL, + `supplierFk` int(11) DEFAULT NULL, + `etd` datetime DEFAULT NULL, + `observations` varchar(255) DEFAULT NULL, + `created` timestamp NULL DEFAULT current_timestamp(), + `userFk` int(10) unsigned DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `supplierFk` (`supplierFk`), + KEY `userFk` (`userFk`), + CONSTRAINT `roadmap_ibfk_1` FOREIGN KEY (`supplierFk`) REFERENCES `supplier` (`id`) ON UPDATE CASCADE, + CONSTRAINT `roadmap_ibfk_2` FOREIGN KEY (`userFk`) REFERENCES `account`.`user` (`id`) ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + -- -- Temporary table structure for view `role` -- @@ -33277,11 +33553,12 @@ DROP TABLE IF EXISTS `role`; /*!50001 DROP VIEW IF EXISTS `role`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `role` AS SELECT - 1 AS `id`, - 1 AS `name`, - 1 AS `description`, - 1 AS `hasLogin` */; +/*!50001 CREATE TABLE `role` ( + `id` tinyint NOT NULL, + `name` tinyint NOT NULL, + `description` tinyint NOT NULL, + `hasLogin` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -33306,7 +33583,7 @@ CREATE TABLE `route` ( `gestdocFk` int(11) DEFAULT NULL, `cost` double unsigned DEFAULT NULL, `m3` decimal(10,1) unsigned DEFAULT NULL, - `description` text COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `description` text DEFAULT NULL, `zoneFk` int(11) DEFAULT NULL, `priority` int(11) NOT NULL DEFAULT 0, `invoiceInFk` mediumint(8) unsigned DEFAULT NULL, @@ -33362,19 +33639,39 @@ DELIMITER ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; +/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`route_afterInsert` + AFTER INSERT ON `route` + FOR EACH ROW +BEGIN + CALL route_calcCommission(NEW.id); +END */;; +DELIMITER ; +/*!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 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 = utf8mb4 */ ; +/*!50003 SET character_set_results = utf8mb4 */ ; +/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; +DELIMITER ;; /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`route_beforeUpdate` BEFORE UPDATE ON `route` FOR EACH ROW BEGIN DECLARE vKmMax INT; - + IF NEW.isOk <> FALSE AND OLD.isOk = FALSE THEN - SET NEW.m3 = ( SELECT SUM(litros)/1000 - FROM vn.saleVolume s - JOIN vn.ticket t ON s.ticketFk = t.id + SET NEW.m3 = ( SELECT SUM(litros)/1000 + FROM vn.saleVolume s + JOIN vn.ticket t ON s.ticketFk = t.id WHERE t.routeFk = NEW.id); END IF; - + IF NEW.kmEnd < NEW.kmStart AND NEW.kmEnd <> 0 THEN CALL util.throw ('KmEnd menor que kmStart'); END IF; @@ -33408,15 +33705,15 @@ BEGIN IF IFNULL(NEW.gestdocFk,0) <> IFNULL(OLD.gestdocFk,0) AND NEW.gestdocFk > 0 THEN -- JGF 09/09/14 cuando se añade un gestdoc a una ruta, se le asigna automagicamente a todos sus Tickets - + -- Inserta el gestdoc en todos los tickets de la ruta INSERT INTO ticketDms(ticketFk,dmsFk) SELECT id, NEW.gestdocFk FROM ticket WHERE routeFk = NEW.id ON DUPLICATE KEY UPDATE dmsFk = NEW.gestdocFk; - -- Update del firmado - UPDATE ticket t - JOIN ticketDms tg ON t.id = tg.ticketFk + -- Update del firmado + UPDATE ticket t + JOIN ticketDms tg ON t.id = tg.ticketFk SET isSigned = 1 WHERE t.routeFk = NEW.id; END IF; @@ -33444,7 +33741,7 @@ DROP TABLE IF EXISTS `routeAction`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `routeAction` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `name` varchar(45) COLLATE utf8mb3_unicode_ci NOT NULL, + `name` varchar(45) NOT NULL, `price` decimal(10,2) DEFAULT NULL, `isMainlineDelivered` tinyint(4) NOT NULL DEFAULT 0, PRIMARY KEY (`id`) @@ -33525,8 +33822,8 @@ CREATE TABLE `routeConfig` ( `maxSalaryCategory2` decimal(6,2) DEFAULT NULL, `distributionM3Category1` decimal(5,2) DEFAULT NULL, `distributionM3Category2` decimal(5,2) DEFAULT NULL, - `plusCategory1Concept` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `plusCategory2Concept` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `plusCategory1Concept` varchar(45) DEFAULT NULL, + `plusCategory2Concept` varchar(45) DEFAULT NULL, `defaultCompanyFk` smallint(5) unsigned DEFAULT 442, `kmHeavy` decimal(5,2) DEFAULT NULL COMMENT 'Comisión por kilometro vehículo pesado', `kmLight` decimal(5,2) DEFAULT NULL COMMENT 'Comisión por kilometro vehículo ligero', @@ -33583,14 +33880,14 @@ CREATE TABLE `routeLog` ( `id` int(11) NOT NULL AUTO_INCREMENT, `originFk` int(10) unsigned NOT NULL, `userFk` int(10) unsigned DEFAULT NULL, - `action` set('insert','update','delete') COLLATE utf8mb3_unicode_ci NOT NULL, + `action` set('insert','update','delete') NOT NULL, `creationDate` timestamp NULL DEFAULT current_timestamp(), - `description` text CHARACTER SET utf8mb3 DEFAULT NULL, - `changedModel` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `oldInstance` text COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `newInstance` text COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `description` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL, + `changedModel` varchar(45) DEFAULT NULL, + `oldInstance` text DEFAULT NULL, + `newInstance` text DEFAULT NULL, `changedModelId` int(11) DEFAULT NULL, - `changedModelValue` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `changedModelValue` varchar(45) DEFAULT NULL, PRIMARY KEY (`id`), KEY `originFk` (`originFk`), KEY `userFk` (`userFk`), @@ -33599,6 +33896,38 @@ CREATE TABLE `routeLog` ( ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; +-- +-- Table structure for table `routeMaster` +-- + +DROP TABLE IF EXISTS `routeMaster`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `routeMaster` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `warehoseFk` smallint(6) unsigned DEFAULT NULL, + `km` int(11) NOT NULL DEFAULT 0, + `packages` int(11) NOT NULL DEFAULT 0, + `vehicleCost` decimal(10,2) NOT NULL DEFAULT 0.00, + `staffCost` decimal(10,2) NOT NULL DEFAULT 0.00, + `vehicle` decimal(10,2) NOT NULL DEFAULT 0.00, + `staff` decimal(10,2) NOT NULL DEFAULT 0.00, + `fuel` int(11) NOT NULL DEFAULT 0, + `freelancers` decimal(10,2) NOT NULL DEFAULT 0.00, + `year` int(11) NOT NULL DEFAULT 0, + `mounth` int(11) NOT NULL DEFAULT 0, + `expense` decimal(10,2) NOT NULL DEFAULT 0.00, + `freelancersPackages` int(11) NOT NULL DEFAULT 0, + `kmCost` decimal(10,2) NOT NULL DEFAULT 0.00, + `packageCost` decimal(10,2) NOT NULL DEFAULT 0.00, + `freelancerPackageCost` decimal(10,2) NOT NULL DEFAULT 0.00, + `created` timestamp NULL DEFAULT current_timestamp(), + PRIMARY KEY (`id`), + KEY `fk_rutas_warehouse_id_idx` (`warehoseFk`), + CONSTRAINT `routeMaster_FK` FOREIGN KEY (`warehoseFk`) REFERENCES `warehouse` (`id`) +) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + -- -- Table structure for table `routeRecalc` -- @@ -33639,15 +33968,15 @@ DROP TABLE IF EXISTS `routesMonitor`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `routesMonitor` ( `routeFk` int(10) unsigned NOT NULL, - `name` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `beachFk` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `name` varchar(45) DEFAULT NULL, + `beachFk` varchar(45) DEFAULT NULL, `ticketPacked` int(11) DEFAULT NULL, `ticketFree` int(11) DEFAULT NULL, `ticketProduction` int(11) DEFAULT NULL, `packages` int(11) DEFAULT NULL, - `note` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `note` varchar(255) DEFAULT NULL, `dated` date DEFAULT NULL, - `dockFk` varchar(10) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `dockFk` varchar(10) DEFAULT NULL, `m3` decimal(10,1) DEFAULT NULL, `priority` int(11) NOT NULL DEFAULT 0, `etd` time DEFAULT NULL, @@ -33673,14 +34002,15 @@ DROP TABLE IF EXISTS `routesReduced`; /*!50001 DROP VIEW IF EXISTS `routesReduced`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `routesReduced` AS SELECT - 1 AS `description`, - 1 AS `name`, - 1 AS `routeFk`, - 1 AS `ETD`, - 1 AS `bufferFk`, - 1 AS `beachFk`, - 1 AS `itempackingTypeFk` */; +/*!50001 CREATE TABLE `routesReduced` ( + `description` tinyint NOT NULL, + `name` tinyint NOT NULL, + `routeFk` tinyint NOT NULL, + `ETD` tinyint NOT NULL, + `bufferFk` tinyint NOT NULL, + `beachFk` tinyint NOT NULL, + `itempackingTypeFk` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -33694,10 +34024,10 @@ CREATE TABLE `sale` ( `id` int(11) NOT NULL AUTO_INCREMENT, `itemFk` int(11) NOT NULL, `ticketFk` int(11) NOT NULL, - `concept` varchar(50) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `concept` varchar(50) DEFAULT NULL, `quantity` decimal(10,2) NOT NULL DEFAULT 0.00, `originalQuantity` double(9,1) DEFAULT NULL, - `price` decimal(10,2) DEFAULT 0.00, + `price` decimal(10,2) NOT NULL 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, @@ -33725,7 +34055,6 @@ DELIMITER ;; AFTER INSERT ON `sale` FOR EACH ROW BEGIN - IF (SELECT COUNT(*) from item i WHERE id = NEW.itemFk AND family = 'SER') THEN CALL util.throw('Cannot insert a service item into a ticket'); END IF; @@ -33733,26 +34062,31 @@ BEGIN CALL stock.log_add('sale', NEW.id, NULL); CALL ticket_requestRecalc(NEW.ticketFk); - IF NEW.quantity > 0 THEN - + IF NEW.quantity > 0 THEN + UPDATE vn.collection c - JOIN vn.ticketCollection tc ON tc.collectionFk = c.id AND tc.ticketFk = NEW.ticketFk + JOIN vn.ticketCollection tc ON tc.collectionFk = c.id + AND tc.ticketFk = NEW.ticketFk JOIN vn.item i ON i.id = NEW.itemFk - AND (c.itemPackingTypeFk = i.itemPackingTypeFk - OR ISNULL(c.itemPackingTypeFk)) + AND (c.itemPackingTypeFk = i.itemPackingTypeFk + OR c.itemPackingTypeFk IS NULL) SET c.saleTotalCount = c.saleTotalCount + 1; - + INSERT IGNORE INTO `vn`.`routeRecalc` (`routeFk`) - SELECT r.id + SELECT r.id FROM vn.sale s JOIN vn.ticket t ON t.id = s.ticketFk JOIN vn.route r ON r.id = t.routeFk - WHERE r.isOk = FALSE + WHERE r.isOk = FALSE AND s.id = NEW.id AND r.created >= util.VN_CURDATE() GROUP BY r.id; END IF; + IF NEW.quantity = 0 THEN + CALL util.debugAdd('saleZeroQuantity', + CONCAT('[', user(), ']', ' Inserted sale: ', NEW.id)); + END IF; END */;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -33772,7 +34106,7 @@ DELIMITER ;; BEFORE UPDATE ON `sale` FOR EACH ROW BEGIN -/* +/* IF (SELECT COUNT(*) from item i WHERE id = NEW.itemFk AND family = 'SER') THEN CALL util.throw('Cannot insert a service item into a ticket'); END IF; @@ -33783,7 +34117,7 @@ BEGIN IF old.discount > 0 AND NEW.discount = 0 THEN INSERT INTO ticketLog - SET originFk = NEW.ticketFk, userFk = account.myUser_getId(), `action` = 'insert', + SET originFk = NEW.ticketFk, userFk = account.myUser_getId(), `action` = 'insert', description = CONCAT('Cambio de descuento del item :', ' ', new.itemFk, ' de ', old.discount ,' a 0 '); END IF; END */;; @@ -33795,11 +34129,11 @@ DELIMITER ; /*!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 = utf8mb3 */ ; -/*!50003 SET character_set_results = utf8mb3 */ ; -/*!50003 SET collation_connection = utf8mb3_general_ci */ ; +/*!50003 SET character_set_client = utf8mb4 */ ; +/*!50003 SET character_set_results = utf8mb4 */ ; +/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`sale_afterUpdate` AFTER UPDATE ON `sale` @@ -33809,7 +34143,7 @@ BEGIN DECLARE vPickedLines INT; DECLARE vCollectionFk INT; DECLARE vUserRole VARCHAR(255); - + IF !(NEW.id <=> OLD.id) OR !(NEW.ticketFk <=> OLD.ticketFk) OR !(NEW.itemFk <=> OLD.itemFk) @@ -33832,45 +34166,45 @@ BEGIN UPDATE ticketRequest SET ticketFk = NEW.ticketFk WHERE saleFk = NEW.id; END IF; - + SELECT account.myUser_getName() INTO vUserRole; SELECT account.user_getMysqlRole(vUserRole) INTO vUserRole; IF !(OLD.quantity <=> NEW.quantity) THEN - SELECT COUNT(*) INTO vIsToSendMail - FROM vncontrol.inter i - JOIN vn.state s ON s.id = i.state_id - WHERE s.code='PACKED' - AND i.Id_Ticket = OLD.ticketFk + SELECT COUNT(*) INTO vIsToSendMail + FROM ticketTracking tt + JOIN vn.state s ON s.id = tt.stateFk + WHERE s.code='PACKED' + AND tt.ticketFk = OLD.ticketFk AND vUserRole IN ('salesPerson', 'salesTeamBoss') LIMIT 1; - + IF vIsToSendMail THEN CALL vn.mail_insert('jefesventas@verdnatura.es', 'noreply@verdnatura.es', CONCAT('Ticket ', OLD.ticketFk ,' modificada cantidad tras encajado'), CONCAT('Ticket ', OLD.ticketFk ,'.
', - 'Modificada la catidad de ', OLD.quantity, ' a ' , NEW.quantity, + 'Modificada la catidad de ', OLD.quantity, ' a ' , NEW.quantity, ' del artículo ', OLD.itemFk, ' tras estado encajado del ticket.
', 'Este email se ha generado automáticamente' ) ); END IF; IF (OLD.quantity > NEW.quantity) THEN INSERT INTO saleComponent(saleFk, componentFk, value) - SELECT NEW.id, cm.id, sc.value + SELECT NEW.id, cm.id, sc.value FROM saleComponent sc JOIN component cd ON cd.id = sc.componentFk JOIN component cm ON cm.code = 'mana' WHERE saleFk = NEW.id AND cd.code = 'lastUnitsDiscount' ON DUPLICATE KEY UPDATE value = sc.value + VALUES(value); - - DELETE sc.* + + DELETE sc.* FROM vn.saleComponent sc JOIN component c ON c.id = sc.componentFk WHERE saleFk = NEW.id AND c.code = 'lastUnitsDiscount'; - END IF; + END IF; INSERT IGNORE INTO `vn`.`routeRecalc` (`routeFk`) - SELECT r.id + SELECT r.id FROM vn.sale s JOIN vn.ticket t ON t.id = s.ticketFk JOIN vn.route r ON r.id = t.routeFk @@ -33881,19 +34215,21 @@ BEGIN END IF; IF !(ABS(NEW.isPicked) <=> ABS(OLD.isPicked)) AND NEW.quantity > 0 THEN - UPDATE vn.collection c JOIN vn.ticketCollection tc ON tc.collectionFk = c.id AND tc.ticketFk = NEW.ticketFk SET c.salePickedCount = c.salePickedCount + IF(NEW.isPicked != 0, 1, -1); - END IF; IF !(NEW.quantity <=> OLD.quantity) AND (NEW.quantity = 0 OR OLD.quantity = 0) THEN - UPDATE vn.collection c JOIN vn.ticketCollection tc ON tc.collectionFk = c.id AND tc.ticketFk = NEW.ticketFk SET c.saleTotalCount = c.saleTotalCount + IF(OLD.quantity = 0, 1, -1); END IF; + + IF NEW.quantity = 0 THEN + CALL util.debugAdd('saleZeroQuantity', + CONCAT('[', user(), ']', ' Updated sale: ', NEW.id)); + END IF; END */;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -33915,11 +34251,11 @@ DELIMITER ;; BEGIN IF OLD.quantity > 0 THEN INSERT IGNORE INTO `vn`.`routeRecalc` (`routeFk`) - SELECT r.id + SELECT r.id FROM vn.sale s JOIN vn.ticket t ON t.id = s.ticketFk JOIN vn.route r ON r.id = t.routeFk - WHERE r.isOk = FALSE + WHERE r.isOk = FALSE AND s.id = OLD.id AND r.created >= util.VN_CURDATE() GROUP BY r.id; @@ -33952,15 +34288,15 @@ BEGIN SELECT account.myUser_getName() INTO vUserRole; SELECT account.user_getMysqlRole(vUserRole) INTO vUserRole; - SELECT COUNT(*) INTO vIsToSendMail - FROM vncontrol.inter i - JOIN vn.state s ON s.id = i.state_id - WHERE s.code='PACKED' - AND i.Id_Ticket = OLD.ticketFk + SELECT COUNT(*) INTO vIsToSendMail + FROM ticketTracking tt + JOIN vn.state s ON s.id = tt.stateFk + WHERE s.code='PACKED' + AND tt.ticketFk = OLD.ticketFk AND vUserRole IN ('salesPerson', 'salesBoss') - LIMIT 1; + LIMIT 1; - IF vIsToSendMail THEN + IF vIsToSendMail THEN CALL vn.mail_insert('jefesventas@verdnatura.es', 'noreply@verdnatura.es', CONCAT('Ticket ', OLD.ticketFk ,' eliminado artículo tras encajado' ), @@ -33969,16 +34305,14 @@ BEGIN ); END IF; - IF OLD.quantity > 0 THEN - + IF OLD.quantity > 0 THEN UPDATE vn.collection c JOIN vn.ticketCollection tc ON tc.collectionFk = c.id AND tc.ticketFk = OLD.ticketFk - JOIN vn.item i ON i.id = OLD.itemFk - AND (c.itemPackingTypeFk = i.itemPackingTypeFk + JOIN vn.item i ON i.id = OLD.itemFk + AND (c.itemPackingTypeFk = i.itemPackingTypeFk OR ISNULL(c.itemPackingTypeFk)) SET c.saleTotalCount = c.saleTotalCount - 1, c.salePickedCount = c.salePickedCount - ABS(OLD.isPicked); - END IF; END */;; DELIMITER ; @@ -34017,10 +34351,10 @@ DELIMITER ;; /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`BEFORE_INSERT` BEFORE INSERT ON `saleBuy` FOR EACH ROW -BEGIN - +BEGIN + SET NEW.workerFk = vn.getUser(); - + END */;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -34039,13 +34373,13 @@ DELIMITER ;; /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`saleBuy_AI` AFTER INSERT ON `saleBuy` FOR EACH ROW -BEGIN +BEGIN /* Activar de nuevo cuando volvamos a vender fruta y verdura - * + * UPDATE vn.sale s SET s.concept = CONCAT(s.concept, ' Lote: ', NEW.buyFk) WHERE s.id = NEW.saleFk; -*/ +*/ END */;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -34053,21 +34387,6 @@ DELIMITER ; /*!50003 SET character_set_results = @saved_cs_results */ ; /*!50003 SET collation_connection = @saved_col_connection */ ; --- --- Table structure for table `saleChecked` --- - -DROP TABLE IF EXISTS `saleChecked`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `saleChecked` ( - `saleFk` int(11) NOT NULL, - `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=utf8mb3 COLLATE=utf8mb3_unicode_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - -- -- Table structure for table `saleCloned` -- @@ -34113,15 +34432,16 @@ DROP TABLE IF EXISTS `saleCost`; /*!50001 DROP VIEW IF EXISTS `saleCost`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `saleCost` AS SELECT - 1 AS `itemFk`, - 1 AS `ticketFk`, - 1 AS `concept`, - 1 AS `quantity`, - 1 AS `discount`, - 1 AS `price`, - 1 AS `component`, - 1 AS `coste` */; +/*!50001 CREATE TABLE `saleCost` ( + `itemFk` tinyint NOT NULL, + `ticketFk` tinyint NOT NULL, + `concept` tinyint NOT NULL, + `quantity` tinyint NOT NULL, + `discount` tinyint NOT NULL, + `price` tinyint NOT NULL, + `component` tinyint NOT NULL, + `coste` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -34189,11 +34509,12 @@ DROP TABLE IF EXISTS `saleLabel`; /*!50001 DROP VIEW IF EXISTS `saleLabel`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `saleLabel` AS SELECT - 1 AS `saleFk`, - 1 AS `label`, - 1 AS `stem`, - 1 AS `created` */; +/*!50001 CREATE TABLE `saleLabel` ( + `saleFk` tinyint NOT NULL, + `label` tinyint NOT NULL, + `stem` tinyint NOT NULL, + `created` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -34227,14 +34548,15 @@ DROP TABLE IF EXISTS `saleMistakeList`; /*!50001 DROP VIEW IF EXISTS `saleMistakeList`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `saleMistakeList` AS SELECT - 1 AS `saleFk`, - 1 AS `workerFk`, - 1 AS `sacador`, - 1 AS `created`, - 1 AS `revisador`, - 1 AS `description`, - 1 AS `controlled` */; +/*!50001 CREATE TABLE `saleMistakeList` ( + `saleFk` tinyint NOT NULL, + `workerFk` tinyint NOT NULL, + `sacador` tinyint NOT NULL, + `created` tinyint NOT NULL, + `revisador` tinyint NOT NULL, + `description` tinyint NOT NULL, + `controlled` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -34245,14 +34567,15 @@ DROP TABLE IF EXISTS `saleMistake_list__2`; /*!50001 DROP VIEW IF EXISTS `saleMistake_list__2`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `saleMistake_list__2` AS SELECT - 1 AS `saleFk`, - 1 AS `workerFk`, - 1 AS `sacador`, - 1 AS `created`, - 1 AS `revisador`, - 1 AS `description`, - 1 AS `controlled` */; +/*!50001 CREATE TABLE `saleMistake_list__2` ( + `saleFk` tinyint NOT NULL, + `workerFk` tinyint NOT NULL, + `sacador` tinyint NOT NULL, + `created` tinyint NOT NULL, + `revisador` tinyint NOT NULL, + `description` tinyint NOT NULL, + `controlled` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -34263,8 +34586,9 @@ DROP TABLE IF EXISTS `saleSaleTracking`; /*!50001 DROP VIEW IF EXISTS `saleSaleTracking`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `saleSaleTracking` AS SELECT - 1 AS `saleFk` */; +/*!50001 CREATE TABLE `saleSaleTracking` ( + `saleFk` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -34296,19 +34620,21 @@ CREATE TABLE `saleTracking` ( `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) DEFAULT NULL, + `workerFk` int(10) unsigned NOT NULL, + `actionFk__` int(11) DEFAULT NULL, `id` int(11) NOT NULL AUTO_INCREMENT, `stateFk` tinyint(3) unsigned NOT NULL, PRIMARY KEY (`id`), - UNIQUE KEY `saleTracking_UN` (`saleFk`,`workerFk`,`actionFk`,`stateFk`), + UNIQUE KEY `saleTracking_UN` (`saleFk`,`workerFk`,`stateFk`), KEY `Id_Movimiento` (`saleFk`), KEY `fgnStateFk_idx` (`stateFk`), KEY `saleTracking_idx5` (`created`), - KEY `saleTracking_fk2_idx` (`actionFk`), + KEY `saleTracking_fk2_idx` (`actionFk__`), + KEY `saleTracking_FK_2` (`workerFk`), CONSTRAINT `fgnStateFk` FOREIGN KEY (`stateFk`) REFERENCES `state` (`id`) ON UPDATE CASCADE, CONSTRAINT `saleTracking_FK` FOREIGN KEY (`saleFk`) REFERENCES `sale` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `saleTracking_FK_1` FOREIGN KEY (`actionFk`) REFERENCES `ticketTrackingState` (`id`) ON UPDATE CASCADE + CONSTRAINT `saleTracking_FK_1` FOREIGN KEY (`actionFk__`) REFERENCES `ticketTrackingState__` (`id`) ON UPDATE CASCADE, + CONSTRAINT `saleTracking_FK_2` FOREIGN KEY (`workerFk`) REFERENCES `worker` (`id`) ON UPDATE CASCADE ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; @@ -34320,45 +34646,18 @@ CREATE TABLE `saleTracking` ( /*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; -/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`saleTracking_beforeInsert` - BEFORE INSERT ON `saleTracking` - FOR EACH ROW -BEGIN - IF(NEW.stateFk = 14) THEN - SET NEW.actionFk = 3; - END IF; - - IF(NEW.stateFk = 8) THEN - SET NEW.actionFk = 4; - END IF; - -END */;; -DELIMITER ; -/*!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 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 = utf8mb4 */ ; -/*!50003 SET character_set_results = utf8mb4 */ ; -/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; -/*!50003 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; -DELIMITER ;; /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`saleTracking_After_Insert` AFTER INSERT ON `saleTracking` FOR EACH ROW BEGIN - - IF NEW.isChecked THEN - + + IF NEW.isChecked THEN + UPDATE vn.sale s - SET s.isPicked = TRUE + SET s.isPicked = TRUE WHERE s.id = NEW.saleFk AND s.isPicked = 0; - + END IF; END */;; @@ -34376,20 +34675,21 @@ DROP TABLE IF EXISTS `saleValue`; /*!50001 DROP VIEW IF EXISTS `saleValue`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `saleValue` AS SELECT - 1 AS `warehouse`, - 1 AS `client`, - 1 AS `clientTypeFk`, - 1 AS `buyer`, - 1 AS `itemTypeFk`, - 1 AS `family`, - 1 AS `itemFk`, - 1 AS `concept`, - 1 AS `quantity`, - 1 AS `cost`, - 1 AS `value`, - 1 AS `year`, - 1 AS `week` */; +/*!50001 CREATE TABLE `saleValue` ( + `warehouse` tinyint NOT NULL, + `client` tinyint NOT NULL, + `clientTypeFk` tinyint NOT NULL, + `buyer` tinyint NOT NULL, + `itemTypeFk` tinyint NOT NULL, + `family` tinyint NOT NULL, + `itemFk` tinyint NOT NULL, + `concept` tinyint NOT NULL, + `quantity` tinyint NOT NULL, + `cost` tinyint NOT NULL, + `value` tinyint NOT NULL, + `year` tinyint NOT NULL, + `week` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -34400,23 +34700,24 @@ DROP TABLE IF EXISTS `saleVolume`; /*!50001 DROP VIEW IF EXISTS `saleVolume`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `saleVolume` AS SELECT - 1 AS `ticketFk`, - 1 AS `saleFk`, - 1 AS `litros`, - 1 AS `routeFk`, - 1 AS `shipped`, - 1 AS `landed`, - 1 AS `volume`, - 1 AS `physicalWeight`, - 1 AS `weight`, - 1 AS `physicalVolume`, - 1 AS `freight`, - 1 AS `zoneFk`, - 1 AS `clientFk`, - 1 AS `isPicked`, - 1 AS `eurosValue`, - 1 AS `itemPackingTypeFk` */; +/*!50001 CREATE TABLE `saleVolume` ( + `ticketFk` tinyint NOT NULL, + `saleFk` tinyint NOT NULL, + `litros` tinyint NOT NULL, + `routeFk` tinyint NOT NULL, + `shipped` tinyint NOT NULL, + `landed` tinyint NOT NULL, + `volume` tinyint NOT NULL, + `physicalWeight` tinyint NOT NULL, + `weight` tinyint NOT NULL, + `physicalVolume` tinyint NOT NULL, + `freight` tinyint NOT NULL, + `zoneFk` tinyint NOT NULL, + `clientFk` tinyint NOT NULL, + `isPicked` tinyint NOT NULL, + `eurosValue` tinyint NOT NULL, + `itemPackingTypeFk` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -34427,11 +34728,12 @@ DROP TABLE IF EXISTS `saleVolume_Today_VNH`; /*!50001 DROP VIEW IF EXISTS `saleVolume_Today_VNH`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `saleVolume_Today_VNH` AS SELECT - 1 AS `Cliente`, - 1 AS `Provincia`, - 1 AS `Pais`, - 1 AS `volume` */; +/*!50001 CREATE TABLE `saleVolume_Today_VNH` ( + `Cliente` tinyint NOT NULL, + `Provincia` tinyint NOT NULL, + `Pais` tinyint NOT NULL, + `volume` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -34442,10 +34744,11 @@ DROP TABLE IF EXISTS `sale_freightComponent`; /*!50001 DROP VIEW IF EXISTS `sale_freightComponent`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `sale_freightComponent` AS SELECT - 1 AS `ticketFk`, - 1 AS `amount`, - 1 AS `shipped` */; +/*!50001 CREATE TABLE `sale_freightComponent` ( + `ticketFk` tinyint NOT NULL, + `amount` tinyint NOT NULL, + `shipped` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -34456,7 +34759,7 @@ DROP TABLE IF EXISTS `salesPersonGoal`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `salesPersonGoal` ( - `salesPersonName` varchar(100) CHARACTER SET utf8mb3 NOT NULL DEFAULT '', + `salesPersonName` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT '', `month` int(11) DEFAULT NULL, `year` int(11) DEFAULT NULL, `goal` int(11) DEFAULT NULL, @@ -34472,9 +34775,10 @@ DROP TABLE IF EXISTS `salesPersonSince`; /*!50001 DROP VIEW IF EXISTS `salesPersonSince`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `salesPersonSince` AS SELECT - 1 AS `workerFk`, - 1 AS `started` */; +/*!50001 CREATE TABLE `salesPersonSince` ( + `workerFk` tinyint NOT NULL, + `started` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -34485,20 +34789,20 @@ DROP TABLE IF EXISTS `salesPreparedLastHour`; /*!50001 DROP VIEW IF EXISTS `salesPreparedLastHour`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `salesPreparedLastHour` AS SELECT - 1 AS `warehouseFk`, - 1 AS `saleFk`, - 1 AS `isChecked`, - 1 AS `originalQuantity`, - 1 AS `accion`, - 1 AS `created`, - 1 AS `code`, - 1 AS `firstname`, - 1 AS `lastName`, - 1 AS `workerCode`, - 1 AS `litros`, - 1 AS `concept`, - 1 AS `departmentName` */; +/*!50001 CREATE TABLE `salesPreparedLastHour` ( + `warehouseFk` tinyint NOT NULL, + `saleFk` tinyint NOT NULL, + `isChecked` tinyint NOT NULL, + `originalQuantity` tinyint NOT NULL, + `created` tinyint NOT NULL, + `code` tinyint NOT NULL, + `firstname` tinyint NOT NULL, + `lastName` tinyint NOT NULL, + `workerCode` tinyint NOT NULL, + `litros` tinyint NOT NULL, + `concept` tinyint NOT NULL, + `departmentName` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -34509,8 +34813,9 @@ DROP TABLE IF EXISTS `salesPreviousPreparated`; /*!50001 DROP VIEW IF EXISTS `salesPreviousPreparated`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `salesPreviousPreparated` AS SELECT - 1 AS `saleFk` */; +/*!50001 CREATE TABLE `salesPreviousPreparated` ( + `saleFk` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -34522,13 +34827,13 @@ DROP TABLE IF EXISTS `sample`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `sample` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `code` varchar(25) CHARACTER SET utf8mb3 NOT NULL, - `description` varchar(105) COLLATE utf8mb3_unicode_ci NOT NULL, + `code` varchar(25) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, + `description` varchar(105) 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, - `model` varchar(25) COLLATE utf8mb3_unicode_ci DEFAULT NULL COMMENT 'Model name in plural', + `model` varchar(25) DEFAULT NULL COMMENT 'Model name in plural', PRIMARY KEY (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -34542,16 +34847,16 @@ DROP TABLE IF EXISTS `sector`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `sector` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `description` varchar(45) COLLATE utf8mb3_unicode_ci NOT NULL, + `description` varchar(45) NOT NULL, `warehouseFk` smallint(6) unsigned NOT NULL DEFAULT 1, `isPreviousPreparedByPacking` tinyint(4) NOT NULL DEFAULT 1, - `code` varchar(15) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `code` varchar(15) DEFAULT NULL, `isPreviousPrepared` tinyint(1) NOT NULL DEFAULT 0, `isPackagingArea` tinyint(1) NOT NULL DEFAULT 0, `reportFk` tinyint(3) unsigned DEFAULT NULL, `sonFk` int(11) DEFAULT NULL, `isMain` tinyint(1) NOT NULL DEFAULT 0, - `itemPackingTypeFk` varchar(1) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `itemPackingTypeFk` varchar(1) DEFAULT NULL, `workerFk` int(11) DEFAULT NULL, `printerFk` tinyint(3) unsigned DEFAULT NULL, `isHideForPickers` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'sector a ocultar a los sacadores', @@ -34617,9 +34922,9 @@ DROP TABLE IF EXISTS `sectorProductivity`; CREATE TABLE `sectorProductivity` ( `id` int(11) NOT NULL AUTO_INCREMENT, `workerFk` int(11) DEFAULT NULL, - `firstName` varchar(50) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `lastName` varchar(50) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `sector` varchar(50) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `firstName` varchar(50) DEFAULT NULL, + `lastName` varchar(50) DEFAULT NULL, + `sector` varchar(50) DEFAULT NULL, `ticketCount` int(11) DEFAULT NULL, `saleCount` int(11) DEFAULT NULL, `error` int(11) DEFAULT NULL, @@ -34667,9 +34972,9 @@ BEGIN IF NEW.workerFk = NEW.workerSubstitute THEN CALL util.throw ('worker and workerSubstitute must be different'); ELSE - INSERT IGNORE INTO sharingCartDaily (ownerFk, substituteFk, dated) - SELECT NEW.workerFk, NEW.workerSubstitute, dated - FROM time + INSERT IGNORE INTO sharingCartDaily (ownerFk, substituteFk, dated) + SELECT NEW.workerFk, NEW.workerSubstitute, dated + FROM time WHERE dated BETWEEN NEW.started AND NEW.ended; END IF; END */;; @@ -34694,14 +34999,14 @@ BEGIN IF NEW.workerFk = NEW.workerSubstitute THEN CALL util.throw ('worker and workerSubstitute must be different'); ELSE - DELETE sc FROM sharingCartDaily sc - WHERE sc.dated BETWEEN OLD.started AND OLD.ended AND - sc.ownerFk = OLD.workerFk AND + DELETE sc FROM sharingCartDaily sc + WHERE sc.dated BETWEEN OLD.started AND OLD.ended AND + sc.ownerFk = OLD.workerFk AND sc.substituteFk = OLD.workerSubstitute; - - INSERT IGNORE INTO sharingCartDaily (ownerFk, substituteFk, dated) - SELECT NEW.workerFk, NEW.workerSubstitute, dated - FROM time + + INSERT IGNORE INTO sharingCartDaily (ownerFk, substituteFk, dated) + SELECT NEW.workerFk, NEW.workerSubstitute, dated + FROM time WHERE dated BETWEEN NEW.started AND NEW.ended; END IF; @@ -34724,9 +35029,9 @@ DELIMITER ;; BEFORE DELETE ON `sharingCart` FOR EACH ROW BEGIN - DELETE sc FROM sharingCartDaily sc - WHERE sc.dated BETWEEN OLD.started AND OLD.ended AND - sc.ownerFk = OLD.workerFk AND + DELETE sc FROM sharingCartDaily sc + WHERE sc.dated BETWEEN OLD.started AND OLD.ended AND + sc.ownerFk = OLD.workerFk AND sc.substituteFk = OLD.workerSubstitute; END */;; DELIMITER ; @@ -34828,7 +35133,7 @@ DROP TABLE IF EXISTS `shelving`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `shelving` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `code` varchar(10) CHARACTER SET utf8mb3 NOT NULL, + `code` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, `parkingFk` int(11) DEFAULT NULL, `isPrinted` tinyint(4) NOT NULL DEFAULT 0, `priority` int(11) NOT NULL DEFAULT 0, @@ -34859,9 +35164,9 @@ DELIMITER ;; BEGIN IF NEW.code = "" THEN - + CALL util.throw('NOT_EMPTY_CODE_ALLOWED'); - + END IF; END */;; @@ -34883,13 +35188,13 @@ DELIMITER ;; BEFORE UPDATE ON `shelving` FOR EACH ROW BEGIN - + IF NEW.code = "" THEN - + CALL util.throw('NOT_EMPTY_CODE_ALLOWED'); - + END IF; - + END */;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -34908,14 +35213,14 @@ CREATE TABLE `shelvingLog` ( `id` int(11) NOT NULL AUTO_INCREMENT, `originFk` int(11) NOT NULL, `userFk` int(10) unsigned DEFAULT NULL, - `action` set('insert','update','delete','select') COLLATE utf8mb3_unicode_ci NOT NULL, + `action` set('insert','update','delete','select') NOT NULL, `creationDate` timestamp NULL DEFAULT current_timestamp(), - `description` text CHARACTER SET utf8mb3 DEFAULT NULL, - `changedModel` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `oldInstance` text COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `newInstance` text COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `description` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL, + `changedModel` varchar(45) DEFAULT NULL, + `oldInstance` text DEFAULT NULL, + `newInstance` text DEFAULT NULL, `changedModelId` int(11) DEFAULT NULL, - `changedModelValue` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `changedModelValue` varchar(45) DEFAULT NULL, PRIMARY KEY (`id`), KEY `userFk` (`userFk`), KEY `originFk` (`originFk`), @@ -34937,7 +35242,7 @@ CREATE TABLE `silexACL` ( `role` varchar(20) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `module_UNIQUE` (`module`,`method`) USING BTREE -) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3; +) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -35003,8 +35308,8 @@ DROP TABLE IF EXISTS `smartTag`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `smartTag` ( - `code` varchar(12) CHARACTER SET utf8mb3 NOT NULL, - `shelvingFk` varchar(10) CHARACTER SET utf8mb3 DEFAULT NULL, + `code` varchar(12) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, + `shelvingFk` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL, `level` int(11) DEFAULT NULL, PRIMARY KEY (`code`), KEY `smartTag_shelving_fk` (`shelvingFk`), @@ -35022,11 +35327,11 @@ DROP TABLE IF EXISTS `sms`; CREATE TABLE `sms` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, `senderFk` int(10) unsigned NOT NULL, - `sender` varchar(15) CHARACTER SET utf8mb3 NOT NULL DEFAULT '693474205', - `destination` varchar(15) CHARACTER SET utf8mb3 NOT NULL, - `message` varchar(160) COLLATE utf8mb3_unicode_ci NOT NULL, + `sender` varchar(15) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT '693474205', + `destination` varchar(15) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, + `message` varchar(160) NOT NULL, `statusCode` smallint(9) DEFAULT 0, - `status` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT 'OK', + `status` varchar(255) DEFAULT 'OK', `created` timestamp NOT NULL DEFAULT current_timestamp(), PRIMARY KEY (`id`), KEY `sms_FK` (`senderFk`), @@ -35043,9 +35348,9 @@ DROP TABLE IF EXISTS `smsConfig`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `smsConfig` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `uri` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL, - `title` varchar(50) COLLATE utf8mb3_unicode_ci NOT NULL, - `apiKey` varchar(50) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `uri` varchar(255) NOT NULL, + `title` varchar(50) NOT NULL, + `apiKey` varchar(50) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='SMS configuration parameters'; /*!40101 SET character_set_client = @saved_cs_client */; @@ -35081,7 +35386,7 @@ DELIMITER ;; FOR EACH ROW BEGIN UPDATE vn2008.Clientes c - JOIN creditClassification cc ON c.Id_Cliente = cc.client + JOIN creditClassification cc ON c.Id_Cliente = cc.client JOIN creditInsurance ci ON ci.creditClassification = cc.id SET creditInsurance = ci.credit * 2 WHERE ci.id = NEW.creditInsurance; END */;; @@ -35105,12 +35410,12 @@ DELIMITER ;; BEGIN IF NEW.dateLeaving IS NOT NULL THEN UPDATE vn2008.Clientes c - JOIN creditClassification cc ON c.Id_Cliente = cc.client + JOIN creditClassification cc ON c.Id_Cliente = cc.client JOIN creditInsurance ci ON ci.creditClassification = cc.id SET creditInsurance = ci.credit WHERE ci.id = OLD.creditInsurance; ELSE UPDATE vn2008.Clientes c - JOIN creditClassification cc ON c.Id_Cliente = cc.client + JOIN creditClassification cc ON c.Id_Cliente = cc.client JOIN creditInsurance ci ON ci.creditClassification = cc.id SET creditInsurance = ci.credit * 2 WHERE ci.id = OLD.creditInsurance; END IF; @@ -35134,7 +35439,7 @@ DELIMITER ;; FOR EACH ROW BEGIN UPDATE vn2008.Clientes c - JOIN creditClassification cc ON c.Id_Cliente = cc.client + JOIN creditClassification cc ON c.Id_Cliente = cc.client JOIN creditInsurance ci ON ci.creditClassification = cc.id SET creditInsurance = ci.credit WHERE ci.id = OLD.creditInsurance; END */;; @@ -35180,8 +35485,8 @@ DROP TABLE IF EXISTS `specialLabels`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `specialLabels` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `description` varchar(100) COLLATE utf8mb3_unicode_ci NOT NULL, - `reportName` varchar(100) COLLATE utf8mb3_unicode_ci NOT NULL, + `description` varchar(100) NOT NULL, + `reportName` varchar(100) NOT NULL, `isVisible` tinyint(1) NOT NULL DEFAULT 0, `image` blob DEFAULT NULL, PRIMARY KEY (`id`) @@ -35218,7 +35523,7 @@ DROP TABLE IF EXISTS `specie`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `specie` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `name` varchar(100) COLLATE utf8mb3_unicode_ci NOT NULL, + `name` varchar(100) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `specie_UN` (`name`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; @@ -35298,7 +35603,7 @@ CREATE TABLE `splitFilter` ( `id` int(11) NOT NULL AUTO_INCREMENT, `autonomyFk` int(11) DEFAULT NULL, `clientFk` int(11) DEFAULT NULL, - `nickname` varchar(100) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `nickname` varchar(100) DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `splitFilter_UN` (`autonomyFk`), UNIQUE KEY `splitFilter_UN1` (`clientFk`), @@ -35319,7 +35624,7 @@ DROP TABLE IF EXISTS `starredModule`; CREATE TABLE `starredModule` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `workerFk` int(10) unsigned NOT NULL, - `moduleFk` varchar(45) COLLATE utf8mb3_unicode_ci NOT NULL, + `moduleFk` varchar(45) NOT NULL, `position` int(11) NOT NULL, PRIMARY KEY (`id`), KEY `starred_workerFk` (`workerFk`), @@ -35338,10 +35643,10 @@ DROP TABLE IF EXISTS `state`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `state` ( `id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT, - `name` varchar(20) COLLATE utf8mb3_unicode_ci NOT NULL, + `name` varchar(20) NOT NULL, `order` tinyint(3) unsigned DEFAULT NULL, `alertLevel` int(11) NOT NULL DEFAULT 0, - `code` varchar(45) CHARACTER SET utf8mb3 NOT NULL, + `code` varchar(45) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, `sectorProdPriority` tinyint(3) DEFAULT NULL, `nextStateFk` tinyint(3) unsigned NOT NULL COMMENT 'Estado al que tiene que cambiar el ticket despues de preparacion previa', `isPreviousPreparable` tinyint(1) NOT NULL DEFAULT 0, @@ -35352,7 +35657,7 @@ CREATE TABLE `state` ( `isOK` tinyint(4) NOT NULL DEFAULT 0, `graphCategory` int(11) NOT NULL DEFAULT 0, `isNotValidated` tinyint(1) DEFAULT 0 COMMENT 'Los tienen que ser validados por un comercial para prepararse', - `classColor` varchar(12) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `classColor` varchar(12) DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `code_UNIQUE` (`code`), KEY `state_id3` (`semaphore`), @@ -35363,6 +35668,22 @@ CREATE TABLE `state` ( ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; +-- +-- Table structure for table `stateI18n` +-- + +DROP TABLE IF EXISTS `stateI18n`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `stateI18n` ( + `stateFk` tinyint(3) unsigned NOT NULL, + `lang` char(2) NOT NULL, + `name` varchar(255) NOT NULL, + PRIMARY KEY (`stateFk`,`lang`), + CONSTRAINT `stateI18n_state_id` FOREIGN KEY (`stateFk`) REFERENCES `state` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + -- -- Table structure for table `stockBuyed` -- @@ -35378,7 +35699,7 @@ CREATE TABLE `stockBuyed` ( `creationDate` timestamp NULL DEFAULT current_timestamp(), `reserved` decimal(10,2) DEFAULT NULL, `requested` decimal(10,2) DEFAULT NULL, - `description` varchar(100) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `description` varchar(100) 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 @@ -35461,35 +35782,53 @@ CREATE TABLE `supplier` ( CONSTRAINT `supplier_withholdingFk` FOREIGN KEY (`withholdingSageFk`) REFERENCES `sage`.`TiposRetencion` (`CodigoRetencion`) ON UPDATE CASCADE, CONSTRAINT `supplier_workerFk` FOREIGN KEY (`workerFk`) REFERENCES `worker` (`id`) ON UPDATE CASCADE, CONSTRAINT `suppplier_supplierActivityFk` FOREIGN KEY (`supplierActivityFk`) REFERENCES `supplierActivity` (`code`) ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3; +) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_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 */ ; /*!50003 SET @saved_col_connection = @@collation_connection */ ; -/*!50003 SET character_set_client = utf8mb4 */ ; -/*!50003 SET character_set_results = utf8mb4 */ ; -/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET character_set_client = utf8mb3 */ ; +/*!50003 SET character_set_results = utf8mb3 */ ; +/*!50003 SET collation_connection = utf8mb3_general_ci */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; +/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`supplier_beforeUpdate` BEFORE UPDATE ON `supplier` FOR EACH ROW BEGIN - DECLARE vHasChange BOOL DEFAULT FALSE; + DECLARE vHasChange BOOL; + DECLARE vPayMethodChanged BOOL; DECLARE vPayMethodHasVerified BOOL; + DECLARE vParams JSON; + DECLARE vOldPayMethodName VARCHAR(20); + DECLARE vNewPayMethodName VARCHAR(20); SELECT hasVerified INTO vPayMethodHasVerified FROM payMethod WHERE id = NEW.payMethodFk; - SET vHasChange = (NEW.payDemFk <> OLD.payDemFk) OR (NEW.payDay <> OLD.payDay); + SET vPayMethodChanged = NOT(NEW.payMethodFk <=> OLD.payMethodFk); - IF vPayMethodHasVerified AND !vHasChange THEN - SET vHasChange = (NEW.payMethodFk <> OLD.payMethodFk); + IF vPayMethodChanged THEN + SELECT name INTO vOldPayMethodName + FROM payMethod + WHERE id = OLD.payMethodFk; + SELECT name INTO vNewPayMethodName + FROM payMethod + WHERE id = NEW.payMethodFk; + + SET vParams = JSON_OBJECT( + 'name', NEW.name, + 'oldPayMethod', vOldPayMethodName, + 'newPayMethod', vNewPayMethodName + ); + SELECT util.notification_send('supplier-pay-method-update', vParams, NULL) INTO @id; END IF; - IF vHasChange THEN + SET vHasChange = NOT(NEW.payDemFk <=> OLD.payDemFk AND NEW.payDay <=> OLD.payDay) OR vPayMethodChanged; + + IF vHasChange AND vPayMethodHasVerified THEN SET NEW.isPayMethodChecked = FALSE; END IF; @@ -35510,14 +35849,14 @@ DROP TABLE IF EXISTS `supplierAccount`; CREATE TABLE `supplierAccount` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, `supplierFk` int(11) DEFAULT NULL, - `iban` varchar(30) CHARACTER SET utf8mb3 DEFAULT NULL, - `office` varchar(4) CHARACTER SET utf8mb3 DEFAULT NULL, - `DC` varchar(2) CHARACTER SET utf8mb3 DEFAULT NULL, - `number` varchar(10) CHARACTER SET utf8mb3 DEFAULT NULL, - `description` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL COMMENT 'obsoleta(comprobar)', + `iban` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL, + `office` varchar(4) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL, + `DC` varchar(2) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL, + `number` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL, + `description` varchar(45) DEFAULT NULL COMMENT 'obsoleta(comprobar)', `bankEntityFk` int(10) unsigned DEFAULT NULL, `bankFk` int(11) DEFAULT NULL COMMENT 'obsoleta(comprobar)', - `beneficiary` varchar(50) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `beneficiary` varchar(50) DEFAULT NULL, PRIMARY KEY (`id`), KEY `fk_proveedores_proveedores_account_idx` (`supplierFk`), KEY `fk_Proveedores_account_entity1_idx` (`bankEntityFk`), @@ -35567,7 +35906,7 @@ BEGIN FROM vn.supplier s JOIN vn.payMethod pm ON pm.id = s.payMethodFk WHERE s.id = OLD.supplierFk; - + IF OLD.iban <> NEW.iban OR OLD.bankEntityFk <> NEW.bankEntityFk AND vPayMethodHasVerified THEN UPDATE vn.supplier SET isPayMethodChecked = FALSE @@ -35611,8 +35950,8 @@ DROP TABLE IF EXISTS `supplierActivity`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `supplierActivity` ( - `code` varchar(45) CHARACTER SET utf8mb3 NOT NULL, - `name` varchar(45) COLLATE utf8mb3_unicode_ci NOT NULL, + `code` varchar(45) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, + `name` varchar(45) NOT NULL, PRIMARY KEY (`code`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -35627,13 +35966,13 @@ DROP TABLE IF EXISTS `supplierAddress`; CREATE TABLE `supplierAddress` ( `id` int(11) NOT NULL AUTO_INCREMENT, `supplierFk` int(11) DEFAULT NULL, - `nickname` varchar(40) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `street` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `nickname` varchar(40) DEFAULT NULL, + `street` varchar(255) DEFAULT NULL, `provinceFk` smallint(6) unsigned DEFAULT NULL, - `postalCode` varchar(10) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `city` varchar(50) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `phone` varchar(15) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `mobile` varchar(15) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `postalCode` varchar(10) DEFAULT NULL, + `city` varchar(50) DEFAULT NULL, + `phone` varchar(15) DEFAULT NULL, + `mobile` varchar(15) DEFAULT NULL, PRIMARY KEY (`id`), KEY `supplierAddress_province_fk` (`provinceFk`), CONSTRAINT `supplierAddress_province_fk` FOREIGN KEY (`provinceFk`) REFERENCES `province` (`id`) ON UPDATE CASCADE @@ -35674,17 +36013,30 @@ DROP TABLE IF EXISTS `supplierContact`; CREATE TABLE `supplierContact` ( `id` int(11) NOT NULL AUTO_INCREMENT, `supplierFk` int(11) DEFAULT NULL, - `phone` varchar(16) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `mobile` varchar(16) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `email` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `observation` text COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `name` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `phone` varchar(16) DEFAULT NULL, + `mobile` varchar(16) DEFAULT NULL, + `email` varchar(255) DEFAULT NULL, + `observation` text DEFAULT NULL, + `name` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`), KEY `supplier_id` (`supplierFk`), CONSTRAINT `supplier_id` FOREIGN KEY (`supplierFk`) REFERENCES `supplier` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; +-- +-- Table structure for table `supplierDebtConfig` +-- + +DROP TABLE IF EXISTS `supplierDebtConfig`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `supplierDebtConfig` ( + `dated` date NOT NULL DEFAULT '2014-12-31' COMMENT 'date from which we start counting', + `invalidBalances` double NOT NULL DEFAULT 0.5 COMMENT 'balances not to be paid' +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + -- -- Table structure for table `supplierExpense` -- @@ -35698,7 +36050,7 @@ CREATE TABLE `supplierExpense` ( `supplierFk` int(11) NOT NULL, `currencyFk` tinyint(3) unsigned NOT NULL DEFAULT 2, `amount` decimal(10,2) NOT NULL DEFAULT 0.00, - `description` varchar(50) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `description` varchar(50) DEFAULT NULL, `companyFk` smallint(5) unsigned NOT NULL DEFAULT 442, `dmsFk` int(11) DEFAULT NULL, `created` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), @@ -35729,14 +36081,14 @@ CREATE TABLE `supplierLog` ( `id` int(11) NOT NULL AUTO_INCREMENT, `originFk` int(11) NOT NULL, `userFk` int(10) unsigned NOT NULL, - `action` set('insert','update','delete') COLLATE utf8mb3_unicode_ci NOT NULL, + `action` set('insert','update','delete') NOT NULL, `creationDate` timestamp NULL DEFAULT current_timestamp(), - `description` text CHARACTER SET utf8mb3 DEFAULT NULL, - `changedModel` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `oldInstance` text COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `newInstance` text COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `description` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL, + `changedModel` varchar(45) DEFAULT NULL, + `oldInstance` text DEFAULT NULL, + `newInstance` text DEFAULT NULL, `changedModelId` int(11) DEFAULT NULL, - `changedModelValue` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `changedModelValue` varchar(45) DEFAULT NULL, PRIMARY KEY (`id`), KEY `logSupplier_ibfk_1` (`originFk`), KEY `supplierLog_ibfk_2` (`userFk`), @@ -35753,17 +36105,18 @@ DROP TABLE IF EXISTS `supplierPackaging`; /*!50001 DROP VIEW IF EXISTS `supplierPackaging`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `supplierPackaging` AS SELECT - 1 AS `supplierFk`, - 1 AS `itemFk`, - 1 AS `longName`, - 1 AS `supplier`, - 1 AS `entryFk`, - 1 AS `landed`, - 1 AS `out`, - 1 AS `in`, - 1 AS `warehouse`, - 1 AS `buyingValue` */; +/*!50001 CREATE TABLE `supplierPackaging` ( + `supplierFk` tinyint NOT NULL, + `itemFk` tinyint NOT NULL, + `longName` tinyint NOT NULL, + `supplier` tinyint NOT NULL, + `entryFk` tinyint NOT NULL, + `landed` tinyint NOT NULL, + `out` tinyint NOT NULL, + `in` tinyint NOT NULL, + `warehouse` tinyint NOT NULL, + `buyingValue` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -35774,10 +36127,10 @@ DROP TABLE IF EXISTS `tablet`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `tablet` ( - `uuid` varchar(100) COLLATE utf8mb3_unicode_ci NOT NULL, - `name` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `place` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `macwifi` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT '0', + `uuid` varchar(100) NOT NULL, + `name` varchar(45) DEFAULT NULL, + `place` varchar(45) DEFAULT NULL, + `macwifi` varchar(45) DEFAULT '0', PRIMARY KEY (`uuid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -35790,7 +36143,7 @@ DROP TABLE IF EXISTS `tabletDepartment`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `tabletDepartment` ( - `tabletFk` varchar(100) COLLATE utf8mb3_unicode_ci NOT NULL, + `tabletFk` varchar(100) NOT NULL, `departmentFk` int(11) NOT NULL, PRIMARY KEY (`tabletFk`,`departmentFk`), KEY `departmentFk_idx` (`departmentFk`), @@ -35808,14 +36161,14 @@ DROP TABLE IF EXISTS `tag`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `tag` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `code` varchar(45) CHARACTER SET utf8mb3 DEFAULT NULL, - `name` varchar(25) COLLATE utf8mb3_unicode_ci NOT NULL, + `code` varchar(45) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL, + `name` varchar(25) NOT NULL, `isFree` tinyint(1) NOT NULL DEFAULT 1, `isQuantitatif` tinyint(4) NOT NULL DEFAULT 0, - `sourceTable` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `unit` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `ediTypeFk` varchar(3) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `overwrite` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL COMMENT 'nombre del campo de item a sobreescribir con el valor del tag, hay que añadir el código correspondiente en item_refreshTags', + `sourceTable` varchar(255) DEFAULT NULL, + `unit` varchar(45) DEFAULT NULL, + `ediTypeFk` varchar(3) DEFAULT NULL, + `overwrite` varchar(45) DEFAULT NULL COMMENT 'nombre del campo de item a sobreescribir con el valor del tag, hay que añadir el código correspondiente en item_refreshTags', PRIMARY KEY (`id`), UNIQUE KEY `tagNameIdx` (`name`,`ediTypeFk`), UNIQUE KEY `tagEdiTypeFkIdx` (`ediTypeFk`) @@ -35852,8 +36205,8 @@ DROP TABLE IF EXISTS `tagAbbreviation`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `tagAbbreviation` ( - `value` varchar(20) COLLATE utf8mb3_unicode_ci NOT NULL, - `abbreviation` varchar(10) COLLATE utf8mb3_unicode_ci NOT NULL, + `value` varchar(20) NOT NULL, + `abbreviation` varchar(10) NOT NULL, `tagFk` int(11) DEFAULT NULL, PRIMARY KEY (`value`), KEY `tagAbbreviation_FK` (`tagFk`), @@ -35870,8 +36223,8 @@ DROP TABLE IF EXISTS `tagI18n`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `tagI18n` ( `tagFk` int(10) unsigned NOT NULL, - `lang` char(2) CHARACTER SET utf8mb3 NOT NULL, - `name` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL, + `lang` char(2) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, + `name` varchar(255) NOT NULL, PRIMARY KEY (`tagFk`,`lang`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -35884,9 +36237,10 @@ DROP TABLE IF EXISTS `tagL10n`; /*!50001 DROP VIEW IF EXISTS `tagL10n`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `tagL10n` AS SELECT - 1 AS `id`, - 1 AS `name` */; +/*!50001 CREATE TABLE `tagL10n` ( + `id` tinyint NOT NULL, + `name` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -35897,8 +36251,8 @@ DROP TABLE IF EXISTS `taxArea`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `taxArea` ( - `code` varchar(15) CHARACTER SET utf8mb3 NOT NULL, - `ClaveOperacionFactura` varchar(1) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `code` varchar(15) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, + `ClaveOperacionFactura` varchar(1) DEFAULT NULL, `CodigoTransaccion` int(2) DEFAULT NULL, PRIMARY KEY (`code`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; @@ -35913,8 +36267,8 @@ DROP TABLE IF EXISTS `taxClass`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `taxClass` ( `id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT, - `description` varchar(30) COLLATE utf8mb3_unicode_ci NOT NULL, - `code` varchar(1) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'R', + `description` varchar(30) NOT NULL, + `code` varchar(1) NOT NULL DEFAULT 'R', PRIMARY KEY (`id`), UNIQUE KEY `code_UNIQUE` (`code`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; @@ -35948,16 +36302,16 @@ DROP TABLE IF EXISTS `taxCode`; CREATE TABLE `taxCode` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `dated` date NOT NULL, - `code` varchar(10) CHARACTER SET utf8mb3 NOT NULL, + `code` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci 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, - `type` char(1) COLLATE utf8mb3_unicode_ci NOT NULL COMMENT 'Solo rellenar si en el asiento ira en el DEBE', + `type` char(1) 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(), - `transactionCode` varchar(2) COLLATE utf8mb3_unicode_ci DEFAULT NULL COMMENT 'Código de Transacción de SAGE', - `operationCode` varchar(1) COLLATE utf8mb3_unicode_ci DEFAULT NULL COMMENT 'Código de operaciones de SAGE', + `transactionCode` varchar(2) DEFAULT NULL COMMENT 'Código de Transacción de SAGE', + `operationCode` varchar(1) 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, PRIMARY KEY (`id`), @@ -35978,11 +36332,11 @@ DROP TABLE IF EXISTS `taxType`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `taxType` ( `id` tinyint(2) NOT NULL AUTO_INCREMENT, - `nickname` varchar(6) COLLATE utf8mb3_unicode_ci NOT NULL, + `nickname` varchar(6) NOT NULL, `isAccrued` tinyint(4) NOT NULL DEFAULT 0, - `serial` char(1) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `TIPOOPE` varchar(1) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT ' ' COMMENT 'respetar el nombre de la columna, se utiliza en contaplus', - `description` varchar(100) COLLATE utf8mb3_unicode_ci NOT NULL, + `serial` char(1) DEFAULT NULL, + `TIPOOPE` varchar(1) NOT NULL DEFAULT ' ' COMMENT 'respetar el nombre de la columna, se utiliza en contaplus', + `description` varchar(100) NOT NULL, `countryFk` mediumint(8) unsigned NOT NULL, PRIMARY KEY (`id`), KEY `serie_id` (`serial`), @@ -35999,9 +36353,9 @@ DROP TABLE IF EXISTS `temperature`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `temperature` ( - `code` varchar(10) CHARACTER SET utf8mb3 NOT NULL, - `description` text COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `name` varchar(10) COLLATE utf8mb3_unicode_ci NOT NULL, + `code` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, + `description` text DEFAULT NULL, + `name` varchar(10) NOT NULL, PRIMARY KEY (`code`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -36014,8 +36368,8 @@ DROP TABLE IF EXISTS `thermograph`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `thermograph` ( - `id` varchar(45) COLLATE utf8mb3_unicode_ci NOT NULL, - `model` enum('TL30','SENSITECH','TREKVIEW1','TREKVIEW2','DISPOSABLE','TEMPMATE') COLLATE utf8mb3_unicode_ci NOT NULL, + `id` varchar(45) NOT NULL, + `model` enum('TL30','SENSITECH','TREKVIEW1','TREKVIEW2','DISPOSABLE','TEMPMATE') NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -36032,20 +36386,20 @@ CREATE TABLE `ticket` ( `clientFk` int(11) NOT NULL DEFAULT 0, `warehouseFk` smallint(6) unsigned NOT NULL DEFAULT 1, `shipped` datetime NOT NULL, - `nickname` varchar(50) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `refFk` varchar(20) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `nickname` varchar(50) DEFAULT NULL, + `refFk` varchar(20) DEFAULT NULL, `addressFk` int(11) NOT NULL DEFAULT 0, `workerFk` int(11) DEFAULT NULL, - `observations` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL COMMENT 'eliminar', + `observations` varchar(255) 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, - `location` varchar(15) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `location` varchar(15) 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, - `solution` varchar(5) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `solution` varchar(5) DEFAULT NULL, `routeFk` int(10) unsigned DEFAULT NULL, `priority` tinyint(3) unsigned DEFAULT NULL, `hasPriority` tinyint(1) unsigned NOT NULL DEFAULT 1, @@ -36085,21 +36439,21 @@ CREATE TABLE `ticket` ( /*!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 = utf8mb3 */ ; -/*!50003 SET character_set_results = utf8mb3 */ ; -/*!50003 SET collation_connection = utf8mb3_general_ci */ ; +/*!50003 SET character_set_client = utf8mb4 */ ; +/*!50003 SET character_set_results = utf8mb4 */ ; +/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`ticket_afterInsert` AFTER INSERT ON `ticket` FOR EACH ROW BEGIN - + DECLARE vClientType VARCHAR(255); DECLARE vStateCode VARCHAR(255); DECLARE vTransferorFirstShipped DATE; - + -- Borrar cuando se cambie el insert ticket en la APP móvil SELECT typeFk INTO vClientType @@ -36111,9 +36465,9 @@ BEGIN SET vStateCode = 'FREE'; END IF; - INSERT INTO vncontrol.inter(Id_Ticket, state_id, Id_Trabajador) - SELECT NEW.id, id, account.myUser_getId() - FROM state + INSERT INTO ticketTracking(ticketFk, stateFk, workerFk) + SELECT NEW.id, id, account.myUser_getId() + FROM state WHERE `code` = vStateCode COLLATE utf8_general_ci; IF YEAR(NEW.shipped) > 2000 THEN @@ -36126,7 +36480,7 @@ BEGIN INSERT INTO bs.clientNewBorn(clientFk, firstShipped, lastShipped) VALUES(NEW.clientFk, IFNULL(vTransferorFirstShipped, util.VN_CURDATE()), util.VN_CURDATE()) ON DUPLICATE KEY UPDATE lastShipped = util.VN_CURDATE(); - + END IF; END */;; @@ -36149,17 +36503,17 @@ DELIMITER ;; FOR EACH ROW BEGIN DECLARE vNewTime TIME; - + IF !(NEW.routeFk <=> OLD.routeFk) THEN - INSERT IGNORE INTO `vn`.`routeRecalc` (`routeFk`) - SELECT r.id + INSERT IGNORE INTO `vn`.`routeRecalc` (`routeFk`) + SELECT r.id FROM vn.route r - WHERE r.isOk = FALSE + WHERE r.isOk = FALSE AND r.id IN (OLD.routeFk,NEW.routeFk) AND r.created >= util.VN_CURDATE() GROUP BY r.id; END IF; - + IF !(DATE(NEW.shipped) <=> DATE(OLD.shipped)) THEN IF YEAR(NEW.shipped) < 2000 THEN SIGNAL SQLSTATE '46000' @@ -36171,13 +36525,13 @@ BEGIN END IF; END IF; - + IF !(NEW.isDeleted <=> OLD.isDeleted) AND NEW.isDeleted THEN - INSERT IGNORE INTO `vn`.`routeRecalc` (`routeFk`) - SELECT r.id + INSERT IGNORE INTO `vn`.`routeRecalc` (`routeFk`) + SELECT r.id FROM vn.ticket t JOIN vn.route r ON r.id = t.routeFk - WHERE r.isOk = FALSE + WHERE r.isOk = FALSE AND t.id = NEW.id AND r.created >= util.VN_CURDATE() GROUP BY r.id; @@ -36187,7 +36541,7 @@ BEGIN SET NEW.zoneFk = NULL; END IF; - IF NEW.routeFk AND NEW.isDeleted THEN + IF NEW.routeFk AND NEW.isDeleted THEN CALL util.throw ('This ticket is deleted'); END IF; @@ -36196,22 +36550,22 @@ BEGIN FROM vn.ticket WHERE routeFk = NEW.routeFk HAVING MAX(TIME(shipped)) > TIME(NEW.shipped); - + IF vNewTime THEN SET NEW.shipped = TIMESTAMP(DATE(NEW.shipped), vNewTime); INSERT INTO vn.ticketLog - SET originFk = NEW.id, - userFk = account.myUser_getId(), - `action` = 'update', + SET originFk = NEW.id, + userFk = account.myUser_getId(), + `action` = 'update', description = CONCAT('Cambia la hora por cambio de ruta de ', TIME(OLD.shipped), ' a ', TIME(NEW.shipped)); END IF; INSERT IGNORE INTO zoneAgencyMode (agencyModeFk,zoneFk) - SELECT r.agencyModeFk, NEW.zoneFk FROM route r + SELECT r.agencyModeFk, NEW.zoneFk FROM route r WHERE r.id = NEW.routeFk; - + CALL vn.routeUpdateM3(NEW.routeFk); END IF; END */;; @@ -36245,7 +36599,7 @@ BEGIN OR !(NEW.companyFk <=> OLD.companyFk) THEN CALL ticket_requestRecalc(NEW.id); END IF; - + IF NEW.clientFk = 2067 AND !(NEW.clientFk <=> OLD.clientFk) THEN -- Fallo que se insertan no se sabe como tickets en este cliente CALL mail_insert( @@ -36255,10 +36609,10 @@ BEGIN CONCAT(account.myUser_getName(), ' ha modificado el ticket ',NEW.id) ); END IF; - + IF NEW.routeFk <> OLD.routeFk THEN - UPDATE expedition + UPDATE expedition SET hasNewRoute = TRUE WHERE ticketFk = NEW.id; @@ -36282,11 +36636,11 @@ DELIMITER ;; /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`ticket_beforeDelete` BEFORE DELETE ON `ticket` FOR EACH ROW -BEGIN - INSERT IGNORE INTO `vn`.`routeRecalc` (`routeFk`) - SELECT r.id +BEGIN + INSERT IGNORE INTO `vn`.`routeRecalc` (`routeFk`) + SELECT r.id FROM vn.route r - WHERE r.isOk = FALSE + WHERE r.isOk = FALSE AND r.id = OLD.routeFk AND r.created >= util.VN_CURDATE() GROUP BY r.id; @@ -36315,7 +36669,7 @@ CREATE TABLE `ticketCollection` ( `created` timestamp NOT NULL DEFAULT current_timestamp(), `level` int(11) DEFAULT NULL, `wagon` int(11) NOT NULL DEFAULT 0, - `smartTagFk` varchar(12) CHARACTER SET utf8mb3 DEFAULT NULL, + `smartTagFk` varchar(12) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_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', `liters` int(11) DEFAULT NULL COMMENT 'volumen del pedido en litros', @@ -36342,28 +36696,28 @@ DELIMITER ;; /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER ticketCollection_afterDelete AFTER DELETE ON ticketCollection FOR EACH ROW -BEGIN - +BEGIN + DECLARE vSalesRemaining INT; SELECT count(*) INTO vSalesRemaining FROM vn.ticketCollection tc - JOIN sale s ON s.ticketFk = tc.ticketFk + JOIN sale s ON s.ticketFk = tc.ticketFk WHERE collectionFk = OLD.collectionFk AND tc.id != OLD.id; - + IF NOT vSalesRemaining THEN - + DELETE FROM vn.collection WHERE id = OLD.collectionFk; - + ELSE - - UPDATE vn.collection + + UPDATE vn.collection SET saleTotalCount = vSalesRemaining WHERE id = OLD.collectionFk; - + END IF; - + END */;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -36382,6 +36736,7 @@ 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', + `packagingInvoicingDated` date NOT NULL DEFAULT '2017-11-21' COMMENT 'Fecha desde la cual se gestiona el registro de embalajes de tickets (tabla vn.ticketPackaging)', PRIMARY KEY (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -36415,13 +36770,13 @@ DELIMITER ;; BEFORE DELETE ON `ticketDms` FOR EACH ROW BEGIN - UPDATE dms - SET dmsTypeFk = (SELECT id - FROM dmsType + UPDATE dms + SET dmsTypeFk = (SELECT id + FROM dmsType WHERE `code` = 'trash' ) - WHERE id = OLD.dmsFk AND ( SELECT IF(COUNT(*) > 0, FALSE, TRUE) - FROM ticketDms + WHERE id = OLD.dmsFk AND ( SELECT IF(COUNT(*) > 0, FALSE, TRUE) + FROM ticketDms WHERE dmsFk = OLD.dmsFk ) ; END */;; @@ -36475,7 +36830,7 @@ DROP TABLE IF EXISTS `ticketDown_SelectionType`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `ticketDown_SelectionType` ( `id` int(11) NOT NULL, - `description` varchar(45) COLLATE utf8mb3_unicode_ci NOT NULL, + `description` varchar(45) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `description_UNIQUE` (`description`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; @@ -36485,14 +36840,13 @@ CREATE TABLE `ticketDown_SelectionType` ( -- Table structure for table `ticketLastState` -- - 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, `ticketTrackingFk` int(11) NOT NULL, - `name` varchar(15) COLLATE utf8mb3_unicode_ci NOT NULL, + `name` varchar(15) NOT NULL, PRIMARY KEY (`ticketFk`), KEY `double_foreign` (`ticketFk`,`ticketTrackingFk`), CONSTRAINT `Id_Ticket` FOREIGN KEY (`ticketFk`) REFERENCES `ticket` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, @@ -36508,9 +36862,10 @@ DROP TABLE IF EXISTS `ticketLastUpdated`; /*!50001 DROP VIEW IF EXISTS `ticketLastUpdated`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `ticketLastUpdated` AS SELECT - 1 AS `ticketFk`, - 1 AS `lastUpdated` */; +/*!50001 CREATE TABLE `ticketLastUpdated` ( + `ticketFk` tinyint NOT NULL, + `lastUpdated` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -36521,23 +36876,10 @@ DROP TABLE IF EXISTS `ticketLastUpdatedList`; /*!50001 DROP VIEW IF EXISTS `ticketLastUpdatedList`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `ticketLastUpdatedList` AS SELECT - 1 AS `ticketFk`, - 1 AS `created` */; -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 VIEW `ticketLocation` AS SELECT - 1 AS `ticketFk`, - 1 AS `longitude`, - 1 AS `latitude` */; +/*!50001 CREATE TABLE `ticketLastUpdatedList` ( + `ticketFk` tinyint NOT NULL, + `created` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -36551,14 +36893,14 @@ CREATE TABLE `ticketLog` ( `id` int(11) NOT NULL AUTO_INCREMENT, `originFk` int(11) NOT NULL, `userFk` int(10) unsigned DEFAULT NULL, - `action` set('insert','update','delete','select') COLLATE utf8mb3_unicode_ci NOT NULL, + `action` set('insert','update','delete','select') NOT NULL, `creationDate` timestamp NULL DEFAULT current_timestamp(), - `description` text CHARACTER SET utf8mb3 DEFAULT NULL, - `changedModel` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `oldInstance` text COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `newInstance` text COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `description` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL, + `changedModel` varchar(45) DEFAULT NULL, + `oldInstance` text DEFAULT NULL, + `newInstance` text DEFAULT NULL, `changedModelId` int(11) DEFAULT NULL, - `changedModelValue` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `changedModelValue` varchar(45) DEFAULT NULL, PRIMARY KEY (`id`), KEY `logTicketoriginFk` (`originFk`), KEY `logTicketuserFk` (`userFk`), @@ -36575,23 +36917,24 @@ 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 VIEW `ticketMRW` AS SELECT - 1 AS `id_Agencia`, - 1 AS `empresa_id`, - 1 AS `Consignatario`, - 1 AS `DOMICILIO`, - 1 AS `POBLACION`, - 1 AS `CODPOSTAL`, - 1 AS `telefono`, - 1 AS `movil`, - 1 AS `IF`, - 1 AS `Id_Ticket`, - 1 AS `warehouse_id`, - 1 AS `Id_Consigna`, - 1 AS `CodigoPais`, - 1 AS `Fecha`, - 1 AS `province_id`, - 1 AS `landing` */; +/*!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; -- @@ -36602,13 +36945,14 @@ DROP TABLE IF EXISTS `ticketNotInvoiced`; /*!50001 DROP VIEW IF EXISTS `ticketNotInvoiced`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `ticketNotInvoiced` AS SELECT - 1 AS `companyFk`, - 1 AS `companyCode`, - 1 AS `clientFk`, - 1 AS `clientName`, - 1 AS `shipped`, - 1 AS `value` */; +/*!50001 CREATE TABLE `ticketNotInvoiced` ( + `companyFk` tinyint NOT NULL, + `companyCode` tinyint NOT NULL, + `clientFk` tinyint NOT NULL, + `clientName` tinyint NOT NULL, + `shipped` tinyint NOT NULL, + `value` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -36622,7 +36966,7 @@ CREATE TABLE `ticketObservation` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, `ticketFk` int(11) NOT NULL, `observationTypeFk` tinyint(3) unsigned NOT NULL, - `description` text COLLATE utf8mb3_unicode_ci NOT NULL, + `description` text NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `Id_Ticket` (`ticketFk`,`observationTypeFk`), KEY `observation_type_id` (`observationTypeFk`), @@ -36656,7 +37000,7 @@ DROP TABLE IF EXISTS `ticketPackaging`; CREATE TABLE `ticketPackaging` ( `id` int(11) NOT NULL AUTO_INCREMENT, `ticketFk` int(11) NOT NULL, - `packagingFk` varchar(10) COLLATE utf8mb3_unicode_ci NOT NULL, + `packagingFk` varchar(10) NOT NULL, `quantity` int(10) DEFAULT 0, `created` timestamp NOT NULL DEFAULT current_timestamp(), `pvp` double DEFAULT NULL, @@ -36702,7 +37046,7 @@ DROP TABLE IF EXISTS `ticketPackagingStartingStock`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `ticketPackagingStartingStock` ( `clientFk` int(11) NOT NULL, - `packagingFk` varchar(10) COLLATE utf8mb3_unicode_ci NOT NULL, + `packagingFk` varchar(10) NOT NULL, `itemFk` int(11) NOT NULL, `sent` int(11) DEFAULT NULL, `returned` int(11) DEFAULT NULL, @@ -36724,17 +37068,18 @@ DROP TABLE IF EXISTS `ticketPackingList`; /*!50001 DROP VIEW IF EXISTS `ticketPackingList`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `ticketPackingList` AS SELECT - 1 AS `nickname`, - 1 AS `ticketFk`, - 1 AS `agencyMode`, - 1 AS `flag`, - 1 AS `province`, - 1 AS `itemFk`, - 1 AS `concept`, - 1 AS `quantity`, - 1 AS `litros`, - 1 AS `observaciones` */; +/*!50001 CREATE TABLE `ticketPackingList` ( + `nickname` tinyint NOT NULL, + `ticketFk` tinyint NOT NULL, + `agencyMode` tinyint NOT NULL, + `flag` tinyint NOT NULL, + `province` tinyint NOT NULL, + `itemFk` tinyint NOT NULL, + `concept` tinyint NOT NULL, + `quantity` tinyint NOT NULL, + `litros` tinyint NOT NULL, + `observaciones` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -36773,7 +37118,7 @@ DELIMITER ;; BEGIN SET NEW.workerFk = vn.getUser(); - + END */;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -36789,16 +37134,17 @@ DROP TABLE IF EXISTS `ticketPreviousPreparingList`; /*!50001 DROP VIEW IF EXISTS `ticketPreviousPreparingList`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `ticketPreviousPreparingList` AS SELECT - 1 AS `ticketFk`, - 1 AS `code`, - 1 AS `saleLines`, - 1 AS `alreadyMadeSaleLines`, - 1 AS `madeRate`, - 1 AS `created`, - 1 AS `parking`, - 1 AS `sectorFk`, - 1 AS `alertCode` */; +/*!50001 CREATE TABLE `ticketPreviousPreparingList` ( + `ticketFk` tinyint NOT NULL, + `code` tinyint NOT NULL, + `saleLines` tinyint NOT NULL, + `alreadyMadeSaleLines` tinyint NOT NULL, + `madeRate` tinyint NOT NULL, + `created` tinyint NOT NULL, + `parking` tinyint NOT NULL, + `sectorFk` tinyint NOT NULL, + `alertCode` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -36884,16 +37230,16 @@ DROP TABLE IF EXISTS `ticketRequest`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `ticketRequest` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `description` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `description` varchar(255) DEFAULT NULL, `ordered` datetime DEFAULT NULL, `shipped` datetime DEFAULT NULL, - `salesPersonCode` varchar(3) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `buyerCode` varchar(3) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'NOE', + `salesPersonCode` varchar(3) DEFAULT NULL, + `buyerCode` varchar(3) NOT NULL DEFAULT 'NOE', `quantity` int(11) DEFAULT NULL, `price` double DEFAULT NULL, `itemFk` double DEFAULT NULL, `clientFk` int(11) DEFAULT NULL, - `response` longtext COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `response` longtext DEFAULT NULL, `total` int(11) DEFAULT NULL, `buyed` datetime DEFAULT NULL, `saleFk` int(11) DEFAULT NULL, @@ -36988,7 +37334,7 @@ DROP TABLE IF EXISTS `ticketService`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `ticketService` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `description` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `description` varchar(45) 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, @@ -37018,7 +37364,7 @@ DELIMITER ;; BEGIN CALL ticket_requestRecalc(NEW.ticketFk); - + END */;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -37087,7 +37433,24 @@ CREATE TABLE `ticketServiceType` ( PRIMARY KEY (`id`), KEY `ticketServiceType_expenceFk_idx` (`expenceFk`), CONSTRAINT `ticketServiceType_expenceFk` FOREIGN KEY (`expenceFk`) REFERENCES `expence` (`id`) ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COMMENT='Lista de los posibles servicios a elegir'; +) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci COMMENT='Lista de los posibles servicios a elegir'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `ticketSms` +-- + +DROP TABLE IF EXISTS `ticketSms`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ticketSms` ( + `smsFk` mediumint(8) unsigned NOT NULL, + `ticketFk` int(11) DEFAULT NULL, + PRIMARY KEY (`smsFk`), + KEY `ticketSms_FK_1` (`ticketFk`), + CONSTRAINT `ticketSms_FK` FOREIGN KEY (`smsFk`) REFERENCES `sms` (`id`) ON UPDATE CASCADE, + CONSTRAINT `ticketSms_FK_1` FOREIGN KEY (`ticketFk`) REFERENCES `ticket` (`id`) ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -37098,19 +37461,20 @@ DROP TABLE IF EXISTS `ticketState`; /*!50001 DROP VIEW IF EXISTS `ticketState`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `ticketState` AS SELECT - 1 AS `updated`, - 1 AS `stateFk`, - 1 AS `workerFk`, - 1 AS `ticketFk`, - 1 AS `state`, - 1 AS `productionOrder`, - 1 AS `alertLevel`, - 1 AS `code`, - 1 AS `ticket`, - 1 AS `worker`, - 1 AS `isPreviousPreparable`, - 1 AS `isPicked` */; +/*!50001 CREATE TABLE `ticketState` ( + `updated` tinyint NOT NULL, + `stateFk` tinyint NOT NULL, + `workerFk` tinyint NOT NULL, + `ticketFk` tinyint NOT NULL, + `state` tinyint NOT NULL, + `productionOrder` tinyint NOT NULL, + `alertLevel` tinyint NOT NULL, + `code` tinyint NOT NULL, + `ticket` tinyint NOT NULL, + `worker` tinyint NOT NULL, + `isPreviousPreparable` tinyint NOT NULL, + `isPicked` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -37121,15 +37485,16 @@ DROP TABLE IF EXISTS `ticketStateToday`; /*!50001 DROP VIEW IF EXISTS `ticketStateToday`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `ticketStateToday` AS SELECT - 1 AS `ticket`, - 1 AS `state`, - 1 AS `productionOrder`, - 1 AS `alertLevel`, - 1 AS `worker`, - 1 AS `code`, - 1 AS `updated`, - 1 AS `isPicked` */; +/*!50001 CREATE TABLE `ticketStateToday` ( + `ticket` tinyint NOT NULL, + `state` tinyint NOT NULL, + `productionOrder` tinyint NOT NULL, + `alertLevel` tinyint NOT NULL, + `worker` tinyint NOT NULL, + `code` tinyint NOT NULL, + `updated` tinyint NOT NULL, + `isPicked` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -37143,7 +37508,7 @@ CREATE TABLE `ticketTracking` ( `id` int(11) NOT NULL AUTO_INCREMENT, `stateFk` tinyint(3) unsigned NOT NULL, `failFk` int(10) unsigned NOT NULL DEFAULT 21, - `notes` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `notes` varchar(255) DEFAULT NULL, `created` timestamp NULL DEFAULT current_timestamp(), `ticketFk` int(11) DEFAULT NULL, `workerFk` int(11) DEFAULT NULL, @@ -37175,18 +37540,18 @@ BEGIN DECLARE vState VARCHAR(15); DECLARE vZoneFk INT; DECLARE vBoardingStateFk INT; - + SELECT s.code INTO vState FROM state s WHERE s.id = NEW.stateFk; - + SELECT t.zonefk INTO vZoneFk FROM ticket t - WHERE t.id = NEW.ticketFk; - + WHERE t.id = NEW.ticketFk; + IF vState = 'OK' AND vZoneFk IS NULL THEN CALL util.throw("ASSIGN_ZONE_FIRST"); - END IF; + END IF; END */;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -37207,11 +37572,11 @@ DELIMITER ;; FOR EACH ROW BEGIN DECLARE vNumTicketsPrepared INT; - + REPLACE vn.ticketLastState(ticketFk, ticketTrackingFk, name) SELECT NEW.ticketFk, NEW.id, `name` FROM state - WHERE id = NEW.stateFk; + WHERE id = NEW.stateFk; END */;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -37234,21 +37599,21 @@ BEGIN DECLARE vTicketFk INT; DECLARE vTicketTrackingFk INT; DECLARE vStateName VARCHAR(15); - + IF NEW.stateFk <> OLD.stateFk THEN REPLACE vn.ticketLastState(ticketFk, ticketTrackingFk, name) SELECT NEW.ticketFk, NEW.id, `name` FROM state WHERE id = NEW.stateFk; END IF; - + IF NEW.ticketFk <> OLD.ticketFk THEN SELECT i.ticketFk, i.id, s.`name` - INTO vTicketFk, vTicketTrackingFk, vStateName - FROM ticketTracking i - JOIN state s ON i.stateFk = s.id - WHERE ticketFk = NEW.ticketFk - ORDER BY created DESC + INTO vTicketFk, vTicketTrackingFk, vStateName + FROM ticketTracking i + JOIN state s ON i.stateFk = s.id + WHERE ticketFk = NEW.ticketFk + ORDER BY created DESC LIMIT 1; IF vTicketFk > 0 THEN @@ -37284,18 +37649,18 @@ BEGIN DELETE FROM vn.ticketLastState WHERE ticketFk = OLD.ticketFk; END; - + CALL util.debugAdd('deletedState', CONCAT('interFk: ', OLD.id, ' ticketFk: ', OLD.ticketFk, ' stateFk: ', OLD.stateFk)); SELECT i.ticketFk, i.id, s.`name` - INTO vTicketFk, vTicketTrackingFk, vStateName - FROM ticketTracking i - JOIN state s ON i.stateFk = s.id - WHERE ticketFk = OLD.ticketFk - ORDER BY created DESC + INTO vTicketFk, vTicketTrackingFk, vStateName + FROM ticketTracking i + JOIN state s ON i.stateFk = s.id + WHERE ticketFk = OLD.ticketFk + ORDER BY created DESC LIMIT 1; IF vTicketFk > 0 THEN @@ -37310,35 +37675,19 @@ DELIMITER ; /*!50003 SET collation_connection = @saved_col_connection */ ; -- --- Table structure for table `ticketTrackingState` +-- Table structure for table `ticketTrackingState__` -- -DROP TABLE IF EXISTS `ticketTrackingState`; +DROP TABLE IF EXISTS `ticketTrackingState__`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; -CREATE TABLE `ticketTrackingState` ( +CREATE TABLE `ticketTrackingState__` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `action` varchar(15) COLLATE utf8mb3_unicode_ci NOT NULL, + `action` varchar(15) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; --- --- Temporary table structure for view `ticketTracking__` --- - -DROP TABLE IF EXISTS `ticketTracking__`; -/*!50001 DROP VIEW IF EXISTS `ticketTracking__`*/; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; -/*!50001 CREATE VIEW `ticketTracking__` AS SELECT - 1 AS `id`, - 1 AS `stateFk`, - 1 AS `created`, - 1 AS `ticketFk`, - 1 AS `workerFk` */; -SET character_set_client = @saved_cs_client; - -- -- Table structure for table `ticketTrolley` -- @@ -37363,8 +37712,8 @@ DROP TABLE IF EXISTS `ticketUpdateAction`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `ticketUpdateAction` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `description` varchar(45) COLLATE utf8mb3_unicode_ci NOT NULL, - `code` varchar(45) COLLATE utf8mb3_unicode_ci NOT NULL, + `description` varchar(45) NOT NULL, + `code` varchar(45) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='En esta tabla pondremos las distintas opciones que se ofrecen al comecial o al cliente al cambiar alguno de los parametros básicos de un ticket'; /*!40101 SET character_set_client = @saved_cs_client */; @@ -37398,9 +37747,9 @@ CREATE TABLE `till` ( `id` int(11) NOT NULL AUTO_INCREMENT, `dated` date NOT NULL, `isAccountable` tinyint(1) NOT NULL DEFAULT 0, - `serie` varchar(2) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `serie` varchar(2) DEFAULT NULL, `number` int(11) DEFAULT NULL, - `concept` varchar(50) COLLATE utf8mb3_unicode_ci NOT NULL, + `concept` varchar(50) NOT NULL, `in` decimal(10,2) DEFAULT NULL, `out` decimal(10,2) DEFAULT NULL, `bankFk` int(11) DEFAULT 1, @@ -37412,7 +37761,7 @@ CREATE TABLE `till` ( `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 utf8mb3_unicode_ci DEFAULT NULL, + `calculatedCode` varchar(255) DEFAULT NULL, `InForeignValue` decimal(10,2) DEFAULT NULL, `OutForeignValue` decimal(10,2) DEFAULT NULL, PRIMARY KEY (`id`), @@ -37516,6 +37865,22 @@ DELIMITER ; /*!50003 SET character_set_results = @saved_cs_results */ ; /*!50003 SET collation_connection = @saved_col_connection */ ; +-- +-- Table structure for table `timeControlDevice` +-- + +DROP TABLE IF EXISTS `timeControlDevice`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `timeControlDevice` ( + `id` int(10) NOT NULL AUTO_INCREMENT, + `name` varchar(255) DEFAULT NULL, + `key` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `name_UNIQUE` (`name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + -- -- Table structure for table `town` -- @@ -37525,7 +37890,7 @@ DROP TABLE IF EXISTS `town`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `town` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `name` varchar(100) COLLATE utf8mb3_unicode_ci NOT NULL, + `name` varchar(100) NOT NULL, `provinceFk` smallint(6) unsigned NOT NULL, `geoFk` int(11) DEFAULT NULL, PRIMARY KEY (`id`), @@ -37634,22 +37999,23 @@ DROP TABLE IF EXISTS `tr2`; /*!50001 DROP VIEW IF EXISTS `tr2`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `tr2` AS SELECT - 1 AS `id`, - 1 AS `shipped`, - 1 AS `shipmentHour`, - 1 AS `landed`, - 1 AS `landingHour`, - 1 AS `warehouseInFk`, - 1 AS `warehouseOutFk`, - 1 AS `agencyFk`, - 1 AS `ref`, - 1 AS `isDelivered`, - 1 AS `isReceived`, - 1 AS `m3`, - 1 AS `kg`, - 1 AS `cargoSupplierFk`, - 1 AS `totalEntries` */; +/*!50001 CREATE TABLE `tr2` ( + `id` tinyint NOT NULL, + `shipped` tinyint NOT NULL, + `shipmentHour` tinyint NOT NULL, + `landed` tinyint NOT NULL, + `landingHour` tinyint NOT NULL, + `warehouseInFk` tinyint NOT NULL, + `warehouseOutFk` tinyint NOT NULL, + `agencyFk` tinyint NOT NULL, + `ref` tinyint NOT NULL, + `isDelivered` tinyint NOT NULL, + `isReceived` tinyint NOT NULL, + `m3` tinyint NOT NULL, + `kg` tinyint NOT NULL, + `cargoSupplierFk` tinyint NOT NULL, + `totalEntries` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -37660,14 +38026,15 @@ DROP TABLE IF EXISTS `traceabilityBuy`; /*!50001 DROP VIEW IF EXISTS `traceabilityBuy`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `traceabilityBuy` AS SELECT - 1 AS `buyFk`, - 1 AS `quantity`, - 1 AS `landed`, - 1 AS `warehouseName`, - 1 AS `entryFk`, - 1 AS `supplierName`, - 1 AS `itemFk` */; +/*!50001 CREATE TABLE `traceabilityBuy` ( + `buyFk` tinyint NOT NULL, + `quantity` tinyint NOT NULL, + `landed` tinyint NOT NULL, + `warehouseName` tinyint NOT NULL, + `entryFk` tinyint NOT NULL, + `supplierName` tinyint NOT NULL, + `itemFk` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -37678,13 +38045,14 @@ DROP TABLE IF EXISTS `traceabilitySale`; /*!50001 DROP VIEW IF EXISTS `traceabilitySale`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `traceabilitySale` AS SELECT - 1 AS `ticketFk`, - 1 AS `buyFk`, - 1 AS `shipped`, - 1 AS `nickname`, - 1 AS `quantity`, - 1 AS `worker` */; +/*!50001 CREATE TABLE `traceabilitySale` ( + `ticketFk` tinyint NOT NULL, + `buyFk` tinyint NOT NULL, + `shipped` tinyint NOT NULL, + `nickname` tinyint NOT NULL, + `quantity` tinyint NOT NULL, + `worker` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -37696,7 +38064,7 @@ DROP TABLE IF EXISTS `train`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `train` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `name` varchar(100) COLLATE utf8mb3_unicode_ci NOT NULL, + `name` varchar(100) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='Define la configuración de los carros que se utilizan para sacar pedidos'; /*!40101 SET character_set_client = @saved_cs_client */; @@ -37710,7 +38078,7 @@ DROP TABLE IF EXISTS `trainingCenter`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `trainingCenter` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `name` varchar(45) COLLATE utf8mb3_unicode_ci NOT NULL, + `name` varchar(45) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -37729,9 +38097,9 @@ CREATE TABLE `trainingCourse` ( `centerFk` int(11) DEFAULT NULL, `started` datetime NOT NULL, `ended` datetime NOT NULL, - `invoice` varchar(50) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `invoice` varchar(50) DEFAULT NULL, `amount` double DEFAULT NULL, - `remark` longtext COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `remark` longtext DEFAULT NULL, `hasDiscount` tinyint(1) NOT NULL DEFAULT 0, `hasDiploma` tinyint(1) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), @@ -37753,7 +38121,7 @@ DROP TABLE IF EXISTS `trainingCourseType`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `trainingCourseType` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `name` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL, + `name` varchar(255) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='Lista de las formaciones'; /*!40101 SET character_set_client = @saved_cs_client */; @@ -37774,7 +38142,7 @@ CREATE TABLE `travel` ( `warehouseInFk` smallint(6) unsigned DEFAULT NULL, `warehouseOutFk` smallint(6) unsigned DEFAULT NULL, `agencyFk` int(11) DEFAULT NULL, - `ref` varchar(20) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `ref` varchar(20) DEFAULT NULL, `isDelivered` tinyint(1) NOT NULL DEFAULT 0, `isReceived` tinyint(1) NOT NULL DEFAULT 0, `m3` decimal(10,2) unsigned DEFAULT NULL, @@ -37875,7 +38243,7 @@ BEGIN CALL stock.log_add('travel', NEW.id, OLD.id); IF !(NEW.shipped <=> OLD.shipped) THEN - UPDATE entry + UPDATE entry SET commission = entry_getCommission(travelFk, currencyFk,supplierFk) WHERE travelFk = NEW.id; END IF; @@ -37912,7 +38280,7 @@ CREATE TABLE `travelClonedWeekly` ( `agencyModeFk` int(11) NOT NULL, `weekDay` tinyint(3) unsigned NOT NULL, `duration` tinyint(3) unsigned NOT NULL, - `ref` varchar(50) COLLATE utf8mb3_unicode_ci NOT NULL, + `ref` varchar(50) NOT NULL, `supplierFk` int(11) DEFAULT NULL, `kg` decimal(10,0) unsigned DEFAULT NULL, `travelFk` int(11) unsigned DEFAULT NULL COMMENT 'Travel origen para clonar ademas sus entradas', @@ -37941,14 +38309,14 @@ CREATE TABLE `travelLog` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `originFk` int(10) unsigned NOT NULL, `userFk` int(10) unsigned DEFAULT NULL, - `action` set('insert','update','delete') COLLATE utf8mb3_unicode_ci NOT NULL, + `action` set('insert','update','delete') NOT NULL, `creationDate` timestamp NULL DEFAULT current_timestamp(), - `description` text CHARACTER SET utf8mb3 DEFAULT NULL, - `changedModel` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `oldInstance` text COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `newInstance` text COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `description` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL, + `changedModel` varchar(45) DEFAULT NULL, + `oldInstance` text DEFAULT NULL, + `newInstance` text DEFAULT NULL, `changedModelId` int(11) DEFAULT NULL, - `changedModelValue` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `changedModelValue` varchar(45) DEFAULT NULL, PRIMARY KEY (`id`), KEY `originFk` (`originFk`), KEY `userFk` (`userFk`), @@ -37968,7 +38336,7 @@ CREATE TABLE `travelObservation` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `originFk` int(11) NOT NULL, `userFk` int(11) NOT NULL, - `description` text COLLATE utf8mb3_unicode_ci NOT NULL, + `description` text NOT NULL, `created` timestamp NOT NULL DEFAULT current_timestamp(), PRIMARY KEY (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='Observaciones de travel'; @@ -37996,13 +38364,13 @@ DROP TABLE IF EXISTS `travelThermograph`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `travelThermograph` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `thermographFk` varchar(45) COLLATE utf8mb3_unicode_ci NOT NULL, + `thermographFk` varchar(45) NOT NULL, `created` date NOT NULL, `warehouseFk` smallint(6) unsigned NOT NULL, `travelFk` int(10) unsigned DEFAULT NULL, - `result` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `result` varchar(45) DEFAULT NULL, `dmsFk` int(11) DEFAULT NULL, - `temperatureFk` varchar(10) CHARACTER SET utf8mb3 DEFAULT 'cool' COMMENT 'En la versión de Agosto de Salix se empezará a usar este campo y se actualizaran los anteriores mirando temperature.', + `temperatureFk` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT 'cool' COMMENT 'En la versión de Agosto de Salix se empezará a usar este campo y se actualizaran los anteriores mirando temperature.', PRIMARY KEY (`id`), KEY `thermograph_fk_idx` (`thermographFk`), KEY `gestdoc_fk_idx` (`dmsFk`), @@ -38063,14 +38431,14 @@ CREATE TABLE `userLog` ( `id` int(11) NOT NULL AUTO_INCREMENT, `originFk` int(10) unsigned NOT NULL, `userFk` int(10) unsigned DEFAULT NULL, - `action` set('insert','update','delete') COLLATE utf8mb3_unicode_ci NOT NULL, + `action` set('insert','update','delete') NOT NULL, `creationDate` timestamp NULL DEFAULT current_timestamp(), - `description` text CHARACTER SET utf8mb3 DEFAULT NULL, - `changedModel` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `oldInstance` text COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `newInstance` text COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `description` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL, + `changedModel` varchar(45) DEFAULT NULL, + `oldInstance` text DEFAULT NULL, + `newInstance` text DEFAULT NULL, `changedModelId` int(11) DEFAULT NULL, - `changedModelValue` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `changedModelValue` varchar(45) DEFAULT NULL, PRIMARY KEY (`id`), KEY `originFk` (`originFk`), KEY `userFk` (`userFk`), @@ -38089,8 +38457,8 @@ DROP TABLE IF EXISTS `userPhone`; CREATE TABLE `userPhone` ( `id` int(11) NOT NULL AUTO_INCREMENT, `userFk` int(10) unsigned NOT NULL, - `typeFk` varchar(45) COLLATE utf8mb3_unicode_ci NOT NULL, - `phone` varchar(25) COLLATE utf8mb3_unicode_ci NOT NULL, + `typeFk` varchar(45) NOT NULL, + `phone` varchar(25) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `UserFk_Phone` (`userFk`,`typeFk`,`phone`), KEY `fgnTypeFk` (`typeFk`), @@ -38107,8 +38475,8 @@ DROP TABLE IF EXISTS `userPhoneType`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `userPhoneType` ( - `code` varchar(45) COLLATE utf8mb3_unicode_ci NOT NULL, - `description` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `code` varchar(45) NOT NULL, + `description` varchar(255) DEFAULT NULL, PRIMARY KEY (`code`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -38122,18 +38490,18 @@ DROP TABLE IF EXISTS `vehicle`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `vehicle` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `numberPlate` varchar(10) COLLATE utf8mb3_unicode_ci NOT NULL, - `model` varchar(20) COLLATE utf8mb3_unicode_ci NOT NULL, - `tradeMark` varchar(20) COLLATE utf8mb3_unicode_ci NOT NULL, + `numberPlate` varchar(10) NOT NULL, + `model` varchar(20) NOT NULL, + `tradeMark` varchar(20) NOT NULL, `companyFk` smallint(5) unsigned NOT NULL DEFAULT 442, `m3` double DEFAULT NULL, `isActive` tinyint(4) NOT NULL DEFAULT 1, `warehouseFk` smallint(6) unsigned DEFAULT NULL, - `description` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `description` varchar(45) DEFAULT NULL, `deliveryPointFk` int(11) DEFAULT 6 COMMENT 'Direccion para Buscaman', `isKmTruckRate` tinyint(4) NOT NULL DEFAULT 0 COMMENT 'Computar km como camión en el cálculo de salario de reparto', `photo` blob DEFAULT NULL, - `chassis` varchar(100) COLLATE utf8mb3_unicode_ci DEFAULT NULL COMMENT 'numero de bastidor', + `chassis` varchar(100) DEFAULT NULL COMMENT 'numero de bastidor', `fuelTypeFk` int(11) DEFAULT NULL, `ppeFk` int(11) DEFAULT NULL, PRIMARY KEY (`id`), @@ -38150,6 +38518,18 @@ CREATE TABLE `vehicle` ( ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; +-- +-- Table structure for table `vehicleConfig` +-- + +DROP TABLE IF EXISTS `vehicleConfig`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `vehicleConfig` ( + `eventEarlyDays` int(11) DEFAULT 15 COMMENT 'Previous days on which the expiration of an event must be notified' +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + -- -- Table structure for table `vehicleDms` -- @@ -38181,13 +38561,14 @@ CREATE TABLE `vehicleEvent` ( `started` date DEFAULT NULL, `finished` date DEFAULT NULL, `vehicleStateFk` int(11) DEFAULT NULL, - `description` varchar(250) COLLATE utf8mb3_unicode_ci NOT NULL, + `description` varchar(250) NOT NULL, `vehicleFk` int(11) NOT NULL, `userFk` int(10) unsigned NOT NULL, + `notified` datetime DEFAULT NULL, PRIMARY KEY (`id`), KEY `vehicleEvent_FK` (`vehicleStateFk`), KEY `vehicleEvent_FK_1` (`userFk`), - CONSTRAINT `vehicleEvent_FK` FOREIGN KEY (`vehicleStateFk`) REFERENCES `vehicleState` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `vehicleEvent_FK` FOREIGN KEY (`vehicleStateFk`) REFERENCES `vehicleState` (`id`), CONSTRAINT `vehicleEvent_FK_1` FOREIGN KEY (`userFk`) REFERENCES `account`.`user` (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -38223,7 +38604,7 @@ 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(), - `note` text COLLATE utf8mb3_unicode_ci NOT NULL, + `note` text NOT NULL, `userFk` int(10) unsigned DEFAULT NULL, PRIMARY KEY (`id`), KEY `vehicleNotes_FK_1` (`userFk`), @@ -38241,10 +38622,11 @@ DROP TABLE IF EXISTS `vehicleState`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `vehicleState` ( - `id` int(11) NOT NULL, - `state` varchar(100) COLLATE utf8mb3_unicode_ci NOT NULL, + `id` int(11) NOT NULL AUTO_INCREMENT, + `state` varchar(100) NOT NULL, + `hasToNotify` int(11) DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; +) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -38280,7 +38662,7 @@ DROP TABLE IF EXISTS `wagon`; CREATE TABLE `wagon` ( `id` int(11) NOT NULL AUTO_INCREMENT, `volume` int(11) NOT NULL DEFAULT 150 COMMENT 'Volumen en litros', - `plate` varchar(10) COLLATE utf8mb3_unicode_ci NOT NULL COMMENT 'Matrícula', + `plate` varchar(10) NOT NULL COMMENT 'Matrícula', PRIMARY KEY (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -38314,10 +38696,10 @@ DROP TABLE IF EXISTS `warehouse`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `warehouse` ( `id` smallint(6) unsigned NOT NULL AUTO_INCREMENT, - `name` varchar(20) COLLATE utf8mb3_unicode_ci NOT NULL, - `code` varchar(3) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `name` varchar(20) NOT NULL, + `code` varchar(3) DEFAULT NULL, `isFeedStock` tinyint(1) unsigned NOT NULL DEFAULT 0, - `addressName` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `addressName` varchar(45) 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, @@ -38341,6 +38723,7 @@ CREATE TABLE `warehouse` ( `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, + `isHalt` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'Almacén en el que descargan nuestros troncales', PRIMARY KEY (`id`), UNIQUE KEY `name_UNIQUE` (`name`), KEY `Id_Paises` (`countryFk`), @@ -38369,7 +38752,7 @@ DELIMITER ;; BEGIN IF NEW.isFeedStock THEN INSERT INTO warehouseAlias(`name`) VALUES(NEW.`name`); - INSERT INTO warehouseJoined(warehouseFk, warehouseAliasFk) + INSERT INTO warehouseJoined(warehouseFk, warehouseAliasFk) VALUES(NEW.id,LAST_INSERT_ID()); END IF; END */;; @@ -38393,7 +38776,7 @@ DELIMITER ;; BEGIN IF NEW.isFeedStock IS TRUE and OLD.isFeedStock IS FALSE then INSERT INTO warehouseAlias(`name`) VALUES(NEW.`name`); - INSERT INTO warehouseJoined(warehouseFk, warehouseAliasFk) + INSERT INTO warehouseJoined(warehouseFk, warehouseAliasFk) VALUES(NEW.id,LAST_INSERT_ID()); END IF; END */;; @@ -38412,7 +38795,7 @@ DROP TABLE IF EXISTS `warehouseAlias`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `warehouseAlias` ( `id` smallint(5) unsigned NOT NULL AUTO_INCREMENT, - `name` varchar(15) COLLATE utf8mb3_unicode_ci NOT NULL, + `name` varchar(15) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `name_UNIQUE` (`name`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; @@ -38437,7 +38820,7 @@ CREATE TABLE `workCenter` ( PRIMARY KEY (`id`), KEY `workCenter_geoFk_idx` (`geoFk`), CONSTRAINT `workCenter_geoFk` FOREIGN KEY (`geoFk`) REFERENCES `zoneGeo` (`id`) ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -38464,12 +38847,12 @@ DROP TABLE IF EXISTS `worker`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `worker` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `code` varchar(3) COLLATE utf8mb3_unicode_ci NOT NULL, - `firstName` varchar(50) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `lastName` varchar(50) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `code` varchar(3) NOT NULL, + `firstName` varchar(50) DEFAULT NULL, + `lastName` varchar(50) DEFAULT NULL, `sub` int(11) unsigned DEFAULT NULL, `photo` blob DEFAULT NULL, - `phone` varchar(9) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `phone` varchar(9) DEFAULT NULL, `mobileExtension` int(4) DEFAULT NULL, `userFk` int(10) unsigned DEFAULT NULL, `bossFk` int(11) NOT NULL DEFAULT 103, @@ -38479,17 +38862,17 @@ CREATE TABLE `worker` ( `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 utf8mb3_unicode_ci NOT NULL, + `maritalStatus` enum('S','M') NOT NULL, `labelerFk` tinyint(3) unsigned DEFAULT NULL, `originCountryFk` mediumint(8) unsigned DEFAULT NULL COMMENT 'País de origen', `educationLevelFk` smallint(6) DEFAULT NULL, - `SSN` varchar(15) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `fi` varchar(15) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `SSN` varchar(15) DEFAULT NULL, + `fi` varchar(15) DEFAULT NULL, `birth` date DEFAULT NULL, `isDisable` tinyint(1) NOT NULL DEFAULT 0, `isFreelance` tinyint(1) NOT NULL DEFAULT 0, `isSsDiscounted` tinyint(1) NOT NULL DEFAULT 0, - `sex` enum('M','F') COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'F' COMMENT 'M Masculino F Femenino', + `sex` enum('M','F') NOT NULL DEFAULT 'F' COMMENT 'M Masculino F Femenino', `businessFk` int(11) DEFAULT NULL, `balance` decimal(10,2) DEFAULT NULL, PRIMARY KEY (`id`), @@ -38541,7 +38924,9 @@ DELIMITER ;; BEFORE UPDATE ON worker FOR EACH ROW BEGIN - CALL vn.printer_checkSector(NEW.labelerFk, NEW.sectorFk); + IF NOT (NEW.labelerFk <=> OLD.labelerFk AND NEW.sectorFk <=> OLD.sectorFk) THEN + CALL vn.printer_checkSector(NEW.labelerFk, NEW.sectorFk); + END IF; END */;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -38592,10 +38977,11 @@ DROP TABLE IF EXISTS `workerBusinessDated`; /*!50001 DROP VIEW IF EXISTS `workerBusinessDated`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `workerBusinessDated` AS SELECT - 1 AS `dated`, - 1 AS `businessFk`, - 1 AS `workerFk` */; +/*!50001 CREATE TABLE `workerBusinessDated` ( + `dated` tinyint NOT NULL, + `businessFk` tinyint NOT NULL, + `workerFk` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -38607,7 +38993,7 @@ DROP TABLE IF EXISTS `workerBusinessType`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `workerBusinessType` ( `id` int(11) NOT NULL, - `name` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL, + `name` varchar(255) 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', @@ -38623,11 +39009,12 @@ DROP TABLE IF EXISTS `workerCalendar`; /*!50001 DROP VIEW IF EXISTS `workerCalendar`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `workerCalendar` AS SELECT - 1 AS `businessFk`, - 1 AS `workerFk`, - 1 AS `absenceTypeFk`, - 1 AS `dated` */; +/*!50001 CREATE TABLE `workerCalendar` ( + `businessFk` tinyint NOT NULL, + `workerFk` tinyint NOT NULL, + `absenceTypeFk` tinyint NOT NULL, + `dated` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -38641,9 +39028,9 @@ CREATE TABLE `workerClockLog` ( `id` int(11) NOT NULL AUTO_INCREMENT, `originFk` int(11) NOT NULL, `userFk` int(10) unsigned NOT NULL, - `action` set('insert','update','delete','select') COLLATE utf8mb3_unicode_ci NOT NULL, + `action` set('insert','update','delete','select') NOT NULL, `creationDate` timestamp NULL DEFAULT current_timestamp(), - `description` text COLLATE utf8mb3_unicode_ci NOT NULL, + `description` text NOT NULL, PRIMARY KEY (`id`), KEY `logWorkerClockoriginFk` (`originFk`), KEY `logWorkerClockuserFk` (`userFk`) @@ -38660,6 +39047,7 @@ DROP TABLE IF EXISTS `workerConfig`; CREATE TABLE `workerConfig` ( `id` int(11) NOT NULL AUTO_INCREMENT, `businessUpdated` date DEFAULT NULL, + `roleFk` int(10) unsigned NOT NULL COMMENT 'Rol por defecto al dar de alta un trabajador nuevo', PRIMARY KEY (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -38672,9 +39060,10 @@ DROP TABLE IF EXISTS `workerDepartment`; /*!50001 DROP VIEW IF EXISTS `workerDepartment`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `workerDepartment` AS SELECT - 1 AS `workerFk`, - 1 AS `departmentFk` */; +/*!50001 CREATE TABLE `workerDepartment` ( + `workerFk` tinyint NOT NULL, + `departmentFk` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -38738,8 +39127,8 @@ DROP TABLE IF EXISTS `workerEmergencyBoss`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `workerEmergencyBoss` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `name` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `value` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL COMMENT 'Table to save all responsible people phones', + `name` varchar(45) DEFAULT NULL, + `value` varchar(45) DEFAULT NULL COMMENT 'Table to save all responsible people phones', PRIMARY KEY (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -38770,11 +39159,11 @@ DROP TABLE IF EXISTS `workerIrpf`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `workerIrpf` ( `workerFk` int(10) unsigned NOT NULL, - `spouseNif` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `spouseNif` varchar(45) 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', - `familySituation` enum('1','2','3') COLLATE utf8mb3_unicode_ci DEFAULT '1', + `familySituation` enum('1','2','3') 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', @@ -38820,7 +39209,7 @@ CREATE TABLE `workerJourney` ( KEY `workerJourney_dated_idx` (`dated`), KEY `workerJourney_businessFk` (`businessFk`), CONSTRAINT `fk_workerJourney_user` FOREIGN KEY (`userFk`) REFERENCES `account`.`user` (`id`) ON UPDATE CASCADE, - CONSTRAINT `workerJourney_businessFk` FOREIGN KEY (`businessFk`) REFERENCES `business` (`id`) ON UPDATE CASCADE + CONSTRAINT `workerJourney_businessFk` FOREIGN KEY (`businessFk`) REFERENCES `business` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -38832,14 +39221,15 @@ DROP TABLE IF EXISTS `workerLabour`; /*!50001 DROP VIEW IF EXISTS `workerLabour`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `workerLabour` AS SELECT - 1 AS `businessFk`, - 1 AS `workerFk`, - 1 AS `workCenterFk`, - 1 AS `started`, - 1 AS `ended`, - 1 AS `departmentFk`, - 1 AS `payedHolidays` */; +/*!50001 CREATE TABLE `workerLabour` ( + `businessFk` tinyint NOT NULL, + `workerFk` tinyint NOT NULL, + `workCenterFk` tinyint NOT NULL, + `started` tinyint NOT NULL, + `ended` tinyint NOT NULL, + `departmentFk` tinyint NOT NULL, + `payedHolidays` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -38853,14 +39243,14 @@ CREATE TABLE `workerLog` ( `id` int(11) NOT NULL AUTO_INCREMENT, `originFk` int(10) unsigned NOT NULL, `userFk` int(10) unsigned NOT NULL, - `action` set('insert','update','delete') COLLATE utf8mb3_unicode_ci NOT NULL, + `action` set('insert','update','delete') NOT NULL, `creationDate` timestamp NULL DEFAULT current_timestamp(), - `description` text COLLATE utf8mb3_unicode_ci NOT NULL, - `changedModel` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `oldInstance` text COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `newInstance` text COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `description` text NOT NULL, + `changedModel` varchar(45) DEFAULT NULL, + `oldInstance` text DEFAULT NULL, + `newInstance` text DEFAULT NULL, `changedModelId` int(11) DEFAULT NULL, - `changedModelValue` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `changedModelValue` varchar(45) DEFAULT NULL, PRIMARY KEY (`id`), KEY `workerFk_idx` (`originFk`), KEY `userFk_idx` (`userFk`), @@ -38912,9 +39302,10 @@ DROP TABLE IF EXISTS `workerMedia`; /*!50001 DROP VIEW IF EXISTS `workerMedia`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `workerMedia` AS SELECT - 1 AS `workerFk`, - 1 AS `mediaValue` */; +/*!50001 CREATE TABLE `workerMedia` ( + `workerFk` tinyint NOT NULL, + `mediaValue` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -38927,7 +39318,7 @@ DROP TABLE IF EXISTS `workerMistake`; CREATE TABLE `workerMistake` ( `id` int(11) NOT NULL AUTO_INCREMENT, `userFk` int(10) unsigned NOT NULL, - `workerMistakeTypeFk` varchar(10) COLLATE utf8mb3_unicode_ci NOT NULL, + `workerMistakeTypeFk` varchar(10) NOT NULL, `created` timestamp NOT NULL DEFAULT current_timestamp(), PRIMARY KEY (`id`), KEY `workerMistake_fk1_idx` (`userFk`), @@ -38945,8 +39336,8 @@ DROP TABLE IF EXISTS `workerMistakeType`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `workerMistakeType` ( - `code` varchar(10) COLLATE utf8mb3_unicode_ci NOT NULL, - `description` varchar(45) COLLATE utf8mb3_unicode_ci NOT NULL, + `code` varchar(10) NOT NULL, + `description` varchar(45) NOT NULL, PRIMARY KEY (`code`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -38986,7 +39377,7 @@ DROP TABLE IF EXISTS `workerShelving`; CREATE TABLE `workerShelving` ( `id` int(11) NOT NULL AUTO_INCREMENT, `workerFk` int(10) unsigned NOT NULL, - `shelvingFk` varchar(10) CHARACTER SET utf8mb3 NOT NULL, + `shelvingFk` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, `collectionFk` int(11) DEFAULT NULL, `created` timestamp NOT NULL DEFAULT current_timestamp(), PRIMARY KEY (`id`), @@ -39007,14 +39398,15 @@ DROP TABLE IF EXISTS `workerSpeedExpedition`; /*!50001 DROP VIEW IF EXISTS `workerSpeedExpedition`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `workerSpeedExpedition` AS SELECT - 1 AS `ticketFk`, - 1 AS `litros`, - 1 AS `literLastHour`, - 1 AS `litersByMinute`, - 1 AS `workerCode`, - 1 AS `cajas`, - 1 AS `warehouseFk` */; +/*!50001 CREATE TABLE `workerSpeedExpedition` ( + `ticketFk` tinyint NOT NULL, + `litros` tinyint NOT NULL, + `literLastHour` tinyint NOT NULL, + `litersByMinute` tinyint NOT NULL, + `workerCode` tinyint NOT NULL, + `cajas` tinyint NOT NULL, + `warehouseFk` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -39025,16 +39417,17 @@ DROP TABLE IF EXISTS `workerSpeedSaleTracking`; /*!50001 DROP VIEW IF EXISTS `workerSpeedSaleTracking`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `workerSpeedSaleTracking` AS SELECT - 1 AS `warehouseFk`, - 1 AS `accion`, - 1 AS `workerCode`, - 1 AS `sumaLitros`, - 1 AS `started`, - 1 AS `finished`, - 1 AS `sumaLitrosLastHour`, - 1 AS `litersByMinute`, - 1 AS `departmentName` */; +/*!50001 CREATE TABLE `workerSpeedSaleTracking` ( + `warehouseFk` tinyint NOT NULL, + `state` tinyint NOT NULL, + `workerCode` tinyint NOT NULL, + `sumaLitros` tinyint NOT NULL, + `started` tinyint NOT NULL, + `finished` tinyint NOT NULL, + `sumaLitrosLastHour` tinyint NOT NULL, + `litersByMinute` tinyint NOT NULL, + `departmentName` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -39063,9 +39456,10 @@ DROP TABLE IF EXISTS `workerTeamCollegues`; /*!50001 DROP VIEW IF EXISTS `workerTeamCollegues`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `workerTeamCollegues` AS SELECT - 1 AS `workerFk`, - 1 AS `collegueFk` */; +/*!50001 CREATE TABLE `workerTeamCollegues` ( + `workerFk` tinyint NOT NULL, + `collegueFk` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -39082,7 +39476,7 @@ CREATE TABLE `workerTimeControl` ( `manual` tinyint(4) NOT NULL DEFAULT 0, `order` int(11) DEFAULT NULL, `warehouseFk` smallint(6) unsigned DEFAULT NULL, - `direction` enum('in','out','middle') COLLATE utf8mb3_unicode_ci DEFAULT 'middle', + `direction` enum('in','out','middle') DEFAULT 'middle', `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`), @@ -39105,9 +39499,9 @@ DELIMITER ;; AFTER INSERT ON `workerTimeControl` FOR EACH ROW BEGIN - IF NEW.timed > DATE_ADD(util.VN_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 IF; END */;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -39129,11 +39523,11 @@ CREATE TABLE `workerTimeControlConfig` ( `shortWeekBreak` int(11) NOT NULL, `longWeekBreak` int(11) NOT NULL, `weekScope` int(11) NOT NULL, - `mailPass` varchar(45) COLLATE utf8mb3_bin NOT NULL, - `mailHost` varchar(45) COLLATE utf8mb3_bin NOT NULL, - `mailSuccessFolder` varchar(45) COLLATE utf8mb3_bin NOT NULL, - `mailErrorFolder` varchar(45) COLLATE utf8mb3_bin NOT NULL, - `mailUser` varchar(45) COLLATE utf8mb3_bin NOT NULL, + `mailPass` varchar(45) NOT NULL, + `mailHost` varchar(45) NOT NULL, + `mailSuccessFolder` varchar(45) NOT NULL, + `mailErrorFolder` varchar(45) NOT NULL, + `mailUser` varchar(45) NOT NULL, `minHoursToBreak` decimal(5,2) unsigned NOT NULL COMMENT 'Horas mínimas que se deben trabajar para añadir descanso remunerado', `breakHours` decimal(5,2) unsigned NOT NULL COMMENT 'Descanso remunerado', `hoursCompleteWeek` int(10) unsigned NOT NULL COMMENT 'Horas a realizar por semana para que se considere jornada completa', @@ -39145,6 +39539,8 @@ CREATE TABLE `workerTimeControlConfig` ( `dayMaxTime` int(11) DEFAULT NULL COMMENT 'Tiempo máximo desde la entrada hasta la salida, expresado en segundos', `shortWeekDays` int(11) DEFAULT NULL COMMENT 'Días a tener en cuenta para calcular el descanso corto', `longWeekDays` int(11) DEFAULT NULL COMMENT 'Días a tener en cuenta para calcular el descanso largo', + `teleworkingStart` int(11) DEFAULT NULL COMMENT 'Hora comienzo jornada de los teletrabajdores expresada en segundos', + `teleworkingStartBreakTime` int(11) DEFAULT NULL COMMENT 'Hora comienzo descanso de los teletrabjadores expresada en segundos', PRIMARY KEY (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin COMMENT='All values in seconds'; /*!40101 SET character_set_client = @saved_cs_client */; @@ -39159,7 +39555,7 @@ DROP TABLE IF EXISTS `workerTimeControlConfig_`; CREATE TABLE `workerTimeControlConfig_` ( `id` int(11) NOT NULL AUTO_INCREMENT, `warehouseFk` smallint(6) unsigned NOT NULL, - `host` varchar(45) COLLATE utf8mb3_unicode_ci NOT NULL, + `host` varchar(45) NOT NULL, PRIMARY KEY (`id`), KEY `warehouseFk_1_idx` (`warehouseFk`), CONSTRAINT `warehouseFk_2` FOREIGN KEY (`warehouseFk`) REFERENCES `warehouse` (`id`) ON UPDATE CASCADE @@ -39177,7 +39573,7 @@ CREATE TABLE `workerTimeControlLog` ( `id` int(11) NOT NULL AUTO_INCREMENT, `userFk` int(10) NOT NULL, `created` datetime NOT NULL DEFAULT current_timestamp(), - `description` varchar(45) COLLATE utf8mb3_unicode_ci NOT NULL, + `description` varchar(45) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='Log de fichadas, se rellena cuando el fichador(tablet) no autoriza el fichaje (PROC:vn.workerTimeControl_check)'; /*!40101 SET character_set_client = @saved_cs_client */; @@ -39194,10 +39590,10 @@ CREATE TABLE `workerTimeControlMail` ( `workerFk` int(10) unsigned NOT NULL, `year` int(4) NOT NULL, `week` int(2) NOT NULL, - `state` enum('SENDED','CONFIRMED','REVISE') COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'SENDED', + `state` enum('SENDED','CONFIRMED','REVISE') 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', - `reason` text COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `reason` text DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `workerFk_UNIQUE` (`workerFk`,`year`,`week`), KEY `workerFk_idx` (`workerFk`), @@ -39222,11 +39618,11 @@ CREATE TABLE `workerTimeControlParams` ( `weekMaxBreak` int(11) NOT NULL, `weekMaxScope` int(11) NOT NULL, `askInOut` int(11) NOT NULL COMMENT 'Tiempo desde la última fichada que determinará si se pregunta al usuario por la dirección de la fichada', - `mailPass` varchar(45) COLLATE utf8mb3_bin NOT NULL, - `mailHost` varchar(45) COLLATE utf8mb3_bin NOT NULL, - `mailSuccessFolder` varchar(45) COLLATE utf8mb3_bin NOT NULL, - `mailErrorFolder` varchar(45) COLLATE utf8mb3_bin NOT NULL, - `mailUser` varchar(45) COLLATE utf8mb3_bin NOT NULL, + `mailPass` varchar(45) NOT NULL, + `mailHost` varchar(45) NOT NULL, + `mailSuccessFolder` varchar(45) NOT NULL, + `mailErrorFolder` varchar(45) NOT NULL, + `mailUser` varchar(45) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin COMMENT='All values in seconds'; /*!40101 SET character_set_client = @saved_cs_client */; @@ -39240,7 +39636,7 @@ DROP TABLE IF EXISTS `workerTimeControlPin`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `workerTimeControlPin` ( `workerFk` int(10) unsigned NOT NULL, - `pin` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL, + `pin` varchar(255) NOT NULL, PRIMARY KEY (`workerFk`), CONSTRAINT `workerFk_.1` FOREIGN KEY (`workerFk`) REFERENCES `worker` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; @@ -39258,7 +39654,7 @@ CREATE TABLE `workerTimeControlSchedule` ( `time` time DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `punique_trhf` (`time`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3; +) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -39269,15 +39665,16 @@ DROP TABLE IF EXISTS `workerTimeControlUserInfo`; /*!50001 DROP VIEW IF EXISTS `workerTimeControlUserInfo`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `workerTimeControlUserInfo` AS SELECT - 1 AS `userFk`, - 1 AS `name`, - 1 AS `surname`, - 1 AS `user`, - 1 AS `password`, - 1 AS `bcryptPassword`, - 1 AS `departmentFk`, - 1 AS `dni` */; +/*!50001 CREATE TABLE `workerTimeControlUserInfo` ( + `userFk` tinyint NOT NULL, + `name` tinyint NOT NULL, + `surname` tinyint NOT NULL, + `user` tinyint NOT NULL, + `password` tinyint NOT NULL, + `bcryptPassword` tinyint NOT NULL, + `departmentFk` tinyint NOT NULL, + `dni` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -39288,13 +39685,14 @@ DROP TABLE IF EXISTS `workerTimeJourneyNG`; /*!50001 DROP VIEW IF EXISTS `workerTimeJourneyNG`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `workerTimeJourneyNG` AS SELECT - 1 AS `userFk`, - 1 AS `dated`, - 1 AS `Journey`, - 1 AS `dayName`, - 1 AS `name`, - 1 AS `firstname` */; +/*!50001 CREATE TABLE `workerTimeJourneyNG` ( + `userFk` tinyint NOT NULL, + `dated` tinyint NOT NULL, + `Journey` tinyint NOT NULL, + `dayName` tinyint NOT NULL, + `name` tinyint NOT NULL, + `firstname` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -39305,11 +39703,12 @@ DROP TABLE IF EXISTS `workerWithoutTractor`; /*!50001 DROP VIEW IF EXISTS `workerWithoutTractor`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `workerWithoutTractor` AS SELECT - 1 AS `workerFk`, - 1 AS `Trabajador`, - 1 AS `Colecciones`, - 1 AS `created` */; +/*!50001 CREATE TABLE `workerWithoutTractor` ( + `workerFk` tinyint NOT NULL, + `Trabajador` tinyint NOT NULL, + `Colecciones` tinyint NOT NULL, + `created` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -39322,12 +39721,12 @@ DROP TABLE IF EXISTS `workers20190711`; CREATE TABLE `workers20190711` ( `person_id` int(11) NOT NULL DEFAULT 0, `business_id` int(11) NOT NULL DEFAULT 0, - `Apellidos` varchar(60) CHARACTER SET utf8mb3 NOT NULL, - `Nombre` varchar(20) CHARACTER SET utf8mb3 DEFAULT NULL, - `nif` varchar(15) CHARACTER SET utf8mb3 DEFAULT NULL, + `Apellidos` varchar(60) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, + `Nombre` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL, + `nif` varchar(15) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL, `Fecha_Inicio` date DEFAULT NULL, `Fecha_Fin` date DEFAULT NULL, - `departamento` varchar(45) COLLATE utf8mb3_unicode_ci NOT NULL, + `departamento` varchar(45) NOT NULL, `Jornada_Semanal` smallint(6) DEFAULT NULL, `Codigo_Contrato` int(11) DEFAULT NULL, `userFk` int(11) NOT NULL, @@ -39347,9 +39746,9 @@ DROP TABLE IF EXISTS `workers20190711_FichadasAbril`; CREATE TABLE `workers20190711_FichadasAbril` ( `id` int(11) NOT NULL AUTO_INCREMENT, `person_id` int(11) NOT NULL DEFAULT 0, - `nif` varchar(15) CHARACTER SET utf8mb3 DEFAULT NULL, - `Apellidos` varchar(60) CHARACTER SET utf8mb3 NOT NULL, - `Nombre` varchar(20) CHARACTER SET utf8mb3 DEFAULT NULL, + `nif` varchar(15) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL, + `Apellidos` varchar(60) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, + `Nombre` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL, `Fecha` date DEFAULT NULL, `Hora` int(2) DEFAULT NULL, `Minuto` int(2) DEFAULT NULL, @@ -39369,9 +39768,9 @@ DROP TABLE IF EXISTS `workers20190711_FichadasJulio11`; CREATE TABLE `workers20190711_FichadasJulio11` ( `id` int(11) NOT NULL AUTO_INCREMENT, `person_id` int(11) NOT NULL DEFAULT 0, - `nif` varchar(15) CHARACTER SET utf8mb3 DEFAULT NULL, - `Apellidos` varchar(60) CHARACTER SET utf8mb3 NOT NULL, - `Nombre` varchar(20) CHARACTER SET utf8mb3 DEFAULT NULL, + `nif` varchar(15) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL, + `Apellidos` varchar(60) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, + `Nombre` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL, `Fecha` date DEFAULT NULL, `Hora` int(2) DEFAULT NULL, `Minuto` int(2) DEFAULT NULL, @@ -39391,9 +39790,9 @@ DROP TABLE IF EXISTS `workers20190711_FichadasJunio`; CREATE TABLE `workers20190711_FichadasJunio` ( `id` int(11) NOT NULL AUTO_INCREMENT, `person_id` int(11) NOT NULL DEFAULT 0, - `nif` varchar(15) CHARACTER SET utf8mb3 DEFAULT NULL, - `Apellidos` varchar(60) CHARACTER SET utf8mb3 NOT NULL, - `Nombre` varchar(20) CHARACTER SET utf8mb3 DEFAULT NULL, + `nif` varchar(15) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL, + `Apellidos` varchar(60) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, + `Nombre` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL, `Fecha` date DEFAULT NULL, `Hora` int(2) DEFAULT NULL, `Minuto` int(2) DEFAULT NULL, @@ -39413,9 +39812,9 @@ DROP TABLE IF EXISTS `workers20190711_FichadasMayo`; CREATE TABLE `workers20190711_FichadasMayo` ( `id` int(11) NOT NULL AUTO_INCREMENT, `person_id` int(11) NOT NULL DEFAULT 0, - `nif` varchar(15) CHARACTER SET utf8mb3 DEFAULT NULL, - `Apellidos` varchar(60) CHARACTER SET utf8mb3 NOT NULL, - `Nombre` varchar(20) CHARACTER SET utf8mb3 DEFAULT NULL, + `nif` varchar(15) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL, + `Apellidos` varchar(60) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, + `Nombre` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL, `Fecha` date DEFAULT NULL, `Hora` int(2) DEFAULT NULL, `Minuto` int(2) DEFAULT NULL, @@ -39435,9 +39834,9 @@ DROP TABLE IF EXISTS `workers20190711_FichadasOctubre`; CREATE TABLE `workers20190711_FichadasOctubre` ( `id` int(11) NOT NULL AUTO_INCREMENT, `person_id` int(11) NOT NULL DEFAULT 0, - `nif` varchar(15) CHARACTER SET utf8mb3 DEFAULT NULL, - `Apellidos` varchar(60) CHARACTER SET utf8mb3 NOT NULL, - `Nombre` varchar(20) CHARACTER SET utf8mb3 DEFAULT NULL, + `nif` varchar(15) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL, + `Apellidos` varchar(60) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, + `Nombre` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL, `Fecha` date DEFAULT NULL, `Hora` int(2) DEFAULT NULL, `Minuto` int(2) DEFAULT NULL, @@ -39457,9 +39856,9 @@ DROP TABLE IF EXISTS `workers20190711_Garrote`; CREATE TABLE `workers20190711_Garrote` ( `id` int(11) NOT NULL AUTO_INCREMENT, `person_id` int(11) NOT NULL DEFAULT 0, - `nif` varchar(15) CHARACTER SET utf8mb3 DEFAULT NULL, - `Apellidos` varchar(60) CHARACTER SET utf8mb3 NOT NULL, - `Nombre` varchar(20) CHARACTER SET utf8mb3 DEFAULT NULL, + `nif` varchar(15) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL, + `Apellidos` varchar(60) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, + `Nombre` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL, `Fecha` date DEFAULT NULL, `Hora` int(2) DEFAULT NULL, `Minuto` int(2) DEFAULT NULL, @@ -39509,6 +39908,20 @@ DELIMITER ; /*!50003 SET character_set_results = @saved_cs_results */ ; /*!50003 SET collation_connection = @saved_col_connection */ ; +-- +-- Table structure for table `zipConfig` +-- + +DROP TABLE IF EXISTS `zipConfig`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `zipConfig` ( + `id` double(10,2) NOT NULL, + `maxSize` int(11) DEFAULT NULL COMMENT 'in MegaBytes', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + -- -- Table structure for table `zone` -- @@ -39533,7 +39946,7 @@ CREATE TABLE `zone` ( KEY `fk_zone_2_idx` (`agencyModeFk`), KEY `zone_name_idx` (`name`), CONSTRAINT `fk_zone_2` FOREIGN KEY (`agencyModeFk`) REFERENCES `agencyMode` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3; +) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -39593,15 +40006,16 @@ DROP TABLE IF EXISTS `zoneEstimatedDelivery`; /*!50001 DROP VIEW IF EXISTS `zoneEstimatedDelivery`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE VIEW `zoneEstimatedDelivery` AS SELECT - 1 AS `zoneFk`, - 1 AS `hourTheoretical`, - 1 AS `totalVolume`, - 1 AS `remainingVolume`, - 1 AS `speed`, - 1 AS `hourEffective`, - 1 AS `minutesLess`, - 1 AS `etc` */; +/*!50001 CREATE TABLE `zoneEstimatedDelivery` ( + `zoneFk` tinyint NOT NULL, + `hourTheoretical` tinyint NOT NULL, + `totalVolume` tinyint NOT NULL, + `remainingVolume` tinyint NOT NULL, + `speed` tinyint NOT NULL, + `hourEffective` tinyint NOT NULL, + `minutesLess` tinyint NOT NULL, + `etc` tinyint NOT NULL +) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- @@ -39627,7 +40041,7 @@ CREATE TABLE `zoneEvent` ( PRIMARY KEY (`id`), UNIQUE KEY `zoneFk` (`zoneFk`,`type`,`dated`), CONSTRAINT `zoneEvent_ibfk_1` FOREIGN KEY (`zoneFk`) REFERENCES `zone` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3; +) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -39647,7 +40061,7 @@ CREATE TABLE `zoneExclusion` ( 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=utf8mb3; +) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_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 */ ; @@ -39661,10 +40075,10 @@ DELIMITER ;; /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`zoneExclusion_BI` BEFORE INSERT ON `zoneExclusion` FOR EACH ROW -BEGIN - +BEGIN + SET NEW.userFk = account.myUser_getId(); - + END */;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -39683,10 +40097,10 @@ DELIMITER ;; /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `vn`.`zoneExclusion_BU` BEFORE UPDATE ON `zoneExclusion` FOR EACH ROW -BEGIN - +BEGIN + SET NEW.userFk = account.myUser_getId(); - + END */;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -39710,7 +40124,7 @@ CREATE TABLE `zoneExclusionGeo` ( KEY `zoneExclusionGeo2_FK_1` (`geoFk`), CONSTRAINT `zoneExclusionGeo_FK` FOREIGN KEY (`geoFk`) REFERENCES `zoneGeo` (`id`) ON UPDATE CASCADE, CONSTRAINT `zoneExclusionGeo_FK_1` FOREIGN KEY (`zoneExclusionFk`) REFERENCES `zoneExclusion` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3; +) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -39729,7 +40143,7 @@ CREATE TABLE `zoneFilter` ( KEY `zoneFilter_FK` (`zoneFk`), 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 + CONSTRAINT `zoneFilter_FK_1` FOREIGN KEY (`itemTypeFk`) REFERENCES `itemType` (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='recoge los parámetros para filtrar determinados productos según la zona'; /*!40101 SET character_set_client = @saved_cs_client */; @@ -39742,10 +40156,10 @@ DROP TABLE IF EXISTS `zoneGeo`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `zoneGeo` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `type` set('country','province','town','postCode','autonomy') CHARACTER SET utf8mb3 NOT NULL, - `name` varchar(100) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `type` set('country','province','town','postCode','autonomy') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, + `name` varchar(100) DEFAULT NULL, `parentFk` int(10) unsigned DEFAULT NULL, - `path` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `path` varchar(255) DEFAULT NULL, `lft` int(11) DEFAULT NULL, `rgt` int(11) DEFAULT NULL, `depth` bigint(22) NOT NULL DEFAULT 0, @@ -39811,7 +40225,7 @@ CREATE TABLE `zoneGeoRecalc` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `isChanged` tinyint(4) NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3; +) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -39832,6 +40246,25 @@ CREATE TABLE `zoneIncluded` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; +-- +-- Table structure for table `zoneItemType` +-- + +DROP TABLE IF EXISTS `zoneItemType`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `zoneItemType` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `zoneFk` int(11) NOT NULL, + `itemTypeFk` smallint(5) unsigned NOT NULL, + PRIMARY KEY (`id`), + KEY `zoneItemType_FK` (`zoneFk`), + KEY `zoneItemType_FK_1` (`itemTypeFk`), + CONSTRAINT `zoneItemType_FK` FOREIGN KEY (`zoneFk`) REFERENCES `zone` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `zoneItemType_FK_1` FOREIGN KEY (`itemTypeFk`) REFERENCES `itemType` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='Combinaciones prohibidas entre zone e itemType al calcular el catálogo de items'; +/*!40101 SET character_set_client = @saved_cs_client */; + -- -- Table structure for table `zoneLog` -- @@ -39843,14 +40276,14 @@ CREATE TABLE `zoneLog` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `originFk` int(10) NOT NULL, `userFk` int(10) unsigned DEFAULT NULL, - `action` set('insert','update','delete') COLLATE utf8mb3_unicode_ci NOT NULL, + `action` set('insert','update','delete') NOT NULL, `creationDate` timestamp NULL DEFAULT current_timestamp(), - `description` text CHARACTER SET utf8mb3 DEFAULT NULL, - `changedModel` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `oldInstance` text COLLATE utf8mb3_unicode_ci DEFAULT NULL, - `newInstance` text COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `description` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL, + `changedModel` varchar(45) DEFAULT NULL, + `oldInstance` text DEFAULT NULL, + `newInstance` text DEFAULT NULL, `changedModelId` int(11) DEFAULT NULL, - `changedModelValue` varchar(45) COLLATE utf8mb3_unicode_ci DEFAULT NULL, + `changedModelValue` varchar(45) DEFAULT NULL, PRIMARY KEY (`id`), KEY `originFk` (`originFk`), KEY `userFk` (`userFk`), @@ -39875,7 +40308,7 @@ CREATE TABLE `zoneWarehouse` ( KEY `warehouseFk` (`warehouseFk`), CONSTRAINT `zoneWarehouse_fk_warehouse` FOREIGN KEY (`warehouseFk`) REFERENCES `warehouse` (`id`) ON UPDATE CASCADE, CONSTRAINT `zoneWarehouse_ibfk_1` FOREIGN KEY (`zoneFk`) REFERENCES `zone` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3; +) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -39887,14 +40320,14 @@ DELIMITER ;; /*!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 = utf8mb4 */ ;; -/*!50003 SET character_set_results = utf8mb4 */ ;; -/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;; +/*!50003 SET character_set_client = utf8mb3 */ ;; +/*!50003 SET character_set_results = utf8mb3 */ ;; +/*!50003 SET collation_connection = utf8mb3_general_ci */ ;; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;; /*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ;; /*!50003 SET @saved_time_zone = @@time_zone */ ;; /*!50003 SET time_zone = 'SYSTEM' */ ;; -/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `collection_make` ON SCHEDULE EVERY 5 MINUTE STARTS '2022-09-15 00:00:00' ON COMPLETION PRESERVE ENABLE DO CALL vn.collection_make */ ;; +/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `collection_make` ON SCHEDULE EVERY 5 MINUTE STARTS '2022-09-15 00:00:00' ON COMPLETION PRESERVE DISABLE ON SLAVE DO CALL vn.collection_make */ ;; /*!50003 SET time_zone = @saved_time_zone */ ;; /*!50003 SET sql_mode = @saved_sql_mode */ ;; /*!50003 SET character_set_client = @saved_cs_client */ ;; @@ -39905,14 +40338,14 @@ DELIMITER ;; /*!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 = utf8mb4 */ ;; -/*!50003 SET character_set_results = utf8mb4 */ ;; -/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;; +/*!50003 SET character_set_client = utf8mb3 */ ;; +/*!50003 SET character_set_results = utf8mb3 */ ;; +/*!50003 SET collation_connection = utf8mb3_general_ci */ ;; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;; /*!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 `department_doCalc` ON SCHEDULE EVERY 15 SECOND STARTS '2019-11-15 00:00:00' ON COMPLETION PRESERVE ENABLE DO CALL vn.department_doCalc */ ;; +/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `department_doCalc` ON SCHEDULE EVERY 15 SECOND STARTS '2019-11-15 00:00:00' ON COMPLETION PRESERVE DISABLE ON SLAVE DO CALL vn.department_doCalc */ ;; /*!50003 SET time_zone = @saved_time_zone */ ;; /*!50003 SET sql_mode = @saved_sql_mode */ ;; /*!50003 SET character_set_client = @saved_cs_client */ ;; @@ -39923,14 +40356,14 @@ DELIMITER ;; /*!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 = utf8mb4 */ ;; -/*!50003 SET character_set_results = utf8mb4 */ ;; -/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;; +/*!50003 SET character_set_client = utf8mb3 */ ;; +/*!50003 SET character_set_results = utf8mb3 */ ;; +/*!50003 SET collation_connection = utf8mb3_general_ci */ ;; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;; /*!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 `envialiaThreHoldChecker` ON SCHEDULE EVERY 1 DAY STARTS '2022-01-28 09:52:46' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `envialiaThreHoldChecker` ON SCHEDULE EVERY 1 DAY STARTS '2022-01-28 09:52:46' ON COMPLETION NOT PRESERVE DISABLE ON SLAVE DO BEGIN DECLARE vActualNumber BIGINT; DECLARE vEndRange BIGINT; DECLARE vIsAlreadyNotified BOOLEAN; @@ -39969,14 +40402,14 @@ DELIMITER ;; /*!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 = utf8mb4 */ ;; -/*!50003 SET character_set_results = utf8mb4 */ ;; -/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;; +/*!50003 SET character_set_client = utf8mb3 */ ;; +/*!50003 SET character_set_results = utf8mb3 */ ;; +/*!50003 SET collation_connection = utf8mb3_general_ci */ ;; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;; /*!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 `mysqlConnectionsSorter_kill` ON SCHEDULE EVERY 1 MINUTE STARTS '2021-10-28 09:56:27' ON COMPLETION NOT PRESERVE ENABLE DO CALL mysqlConnectionsSorter_kill() */ ;; +/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `mysqlConnectionsSorter_kill` ON SCHEDULE EVERY 1 MINUTE STARTS '2021-10-28 09:56:27' ON COMPLETION NOT PRESERVE DISABLE ON SLAVE DO CALL mysqlConnectionsSorter_kill() */ ;; /*!50003 SET time_zone = @saved_time_zone */ ;; /*!50003 SET sql_mode = @saved_sql_mode */ ;; /*!50003 SET character_set_client = @saved_cs_client */ ;; @@ -39987,14 +40420,14 @@ DELIMITER ;; /*!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 = utf8mb4 */ ;; -/*!50003 SET character_set_results = utf8mb4 */ ;; -/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;; +/*!50003 SET character_set_client = utf8mb3 */ ;; +/*!50003 SET character_set_results = utf8mb3 */ ;; +/*!50003 SET collation_connection = utf8mb3_general_ci */ ;; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;; /*!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 `printQueue_check` ON SCHEDULE EVERY 10 MINUTE STARTS '2022-01-28 09:52:46' ON COMPLETION PRESERVE ENABLE DO BEGIN +/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `printQueue_check` ON SCHEDULE EVERY 10 MINUTE STARTS '2022-01-28 09:52:46' ON COMPLETION PRESERVE DISABLE ON SLAVE DO BEGIN DECLARE vCurrentCount INT; DECLARE vCheckSum INT; @@ -40096,14 +40529,14 @@ DELIMITER ;; /*!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 = utf8mb4 */ ;; -/*!50003 SET character_set_results = utf8mb4 */ ;; -/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;; +/*!50003 SET character_set_client = utf8mb3 */ ;; +/*!50003 SET character_set_results = utf8mb3 */ ;; +/*!50003 SET collation_connection = utf8mb3_general_ci */ ;; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;; /*!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 `route_doRecalc` ON SCHEDULE EVERY 10 SECOND STARTS '2021-07-08 07:32:23' ON COMPLETION PRESERVE ENABLE DO CALL route_doRecalc */ ;; +/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `route_doRecalc` ON SCHEDULE EVERY 10 SECOND STARTS '2021-07-08 07:32:23' ON COMPLETION PRESERVE DISABLE ON SLAVE DO CALL route_doRecalc */ ;; /*!50003 SET time_zone = @saved_time_zone */ ;; /*!50003 SET sql_mode = @saved_sql_mode */ ;; /*!50003 SET character_set_client = @saved_cs_client */ ;; @@ -40150,14 +40583,14 @@ DELIMITER ;; /*!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 = utf8mb4 */ ;; -/*!50003 SET character_set_results = utf8mb4 */ ;; -/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;; +/*!50003 SET character_set_client = utf8mb3 */ ;; +/*!50003 SET character_set_results = utf8mb3 */ ;; +/*!50003 SET collation_connection = utf8mb3_general_ci */ ;; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;; /*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ;; /*!50003 SET @saved_time_zone = @@time_zone */ ;; /*!50003 SET time_zone = 'SYSTEM' */ ;; -/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `ticket_doRecalc` ON SCHEDULE EVERY 10 SECOND STARTS '2022-01-28 09:29:18' ON COMPLETION PRESERVE ENABLE DO CALL ticket_doRecalc */ ;; +/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `ticket_doRecalc` ON SCHEDULE EVERY 10 SECOND STARTS '2022-01-28 09:29:18' ON COMPLETION PRESERVE DISABLE ON SLAVE DO CALL ticket_doRecalc */ ;; /*!50003 SET time_zone = @saved_time_zone */ ;; /*!50003 SET sql_mode = @saved_sql_mode */ ;; /*!50003 SET character_set_client = @saved_cs_client */ ;; @@ -40168,14 +40601,32 @@ DELIMITER ;; /*!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 = utf8mb4 */ ;; -/*!50003 SET character_set_results = utf8mb4 */ ;; -/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;; +/*!50003 SET character_set_client = utf8mb3 */ ;; +/*!50003 SET character_set_results = utf8mb3 */ ;; +/*!50003 SET collation_connection = utf8mb3_general_ci */ ;; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;; /*!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 `travel_doRecalc` ON SCHEDULE EVERY 15 SECOND STARTS '2019-05-17 10:52:29' ON COMPLETION PRESERVE ENABLE DO CALL travel_doRecalc */ ;; +/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `travel_doRecalc` ON SCHEDULE EVERY 15 SECOND STARTS '2019-05-17 10:52:29' ON COMPLETION PRESERVE DISABLE ON SLAVE DO CALL travel_doRecalc */ ;; +/*!50003 SET time_zone = @saved_time_zone */ ;; +/*!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 */ ;; +/*!50106 DROP EVENT IF EXISTS `vehicle_notify` */;; +DELIMITER ;; +/*!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 = utf8mb3 */ ;; +/*!50003 SET character_set_results = utf8mb3 */ ;; +/*!50003 SET collation_connection = utf8mb3_general_ci */ ;; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ;; +/*!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 `vehicle_notify` ON SCHEDULE EVERY 1 DAY STARTS '2022-01-01 00:07:00' ON COMPLETION NOT PRESERVE DISABLE ON SLAVE COMMENT 'Notifies subscribed users of events in vehicles that are about t' DO CALL vn.vehicle_notifyEvents */ ;; /*!50003 SET time_zone = @saved_time_zone */ ;; /*!50003 SET sql_mode = @saved_sql_mode */ ;; /*!50003 SET character_set_client = @saved_cs_client */ ;; @@ -40186,14 +40637,14 @@ DELIMITER ;; /*!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 = utf8mb4 */ ;; -/*!50003 SET character_set_results = utf8mb4 */ ;; -/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;; +/*!50003 SET character_set_client = utf8mb3 */ ;; +/*!50003 SET character_set_results = utf8mb3 */ ;; +/*!50003 SET collation_connection = utf8mb3_general_ci */ ;; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;; /*!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 `workerTimeControl_sendMail` ON SCHEDULE EVERY 1 WEEK STARTS '2020-11-25 08:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `workerTimeControl_sendMail` ON SCHEDULE EVERY 1 WEEK STARTS '2020-11-25 08:00:00' ON COMPLETION NOT PRESERVE DISABLE ON SLAVE DO BEGIN DECLARE vWeek,vYear INT; SELECT week,year INTO vWeek,vYear @@ -40214,14 +40665,14 @@ DELIMITER ;; /*!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 = utf8mb4 */ ;; -/*!50003 SET character_set_results = utf8mb4 */ ;; -/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;; +/*!50003 SET character_set_client = utf8mb3 */ ;; +/*!50003 SET character_set_results = utf8mb3 */ ;; +/*!50003 SET collation_connection = utf8mb3_general_ci */ ;; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;; /*!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 `worker_updateChangedBusiness` ON SCHEDULE EVERY 1 DAY STARTS '2000-01-01 00:00:05' ON COMPLETION NOT PRESERVE ENABLE DO CALL worker_updateChangedBusiness */ ;; +/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `worker_updateChangedBusiness` ON SCHEDULE EVERY 1 DAY STARTS '2000-01-01 00:00:05' ON COMPLETION NOT PRESERVE DISABLE ON SLAVE DO CALL worker_updateChangedBusiness */ ;; /*!50003 SET time_zone = @saved_time_zone */ ;; /*!50003 SET sql_mode = @saved_sql_mode */ ;; /*!50003 SET character_set_client = @saved_cs_client */ ;; @@ -40232,14 +40683,14 @@ DELIMITER ;; /*!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 = utf8mb4 */ ;; -/*!50003 SET character_set_results = utf8mb4 */ ;; -/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;; +/*!50003 SET character_set_client = utf8mb3 */ ;; +/*!50003 SET character_set_results = utf8mb3 */ ;; +/*!50003 SET collation_connection = utf8mb3_general_ci */ ;; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;; /*!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 `zoneGeo_doCalc` ON SCHEDULE EVERY 15 SECOND STARTS '2019-09-13 15:30:47' ON COMPLETION PRESERVE ENABLE DO CALL vn.zoneGeo_doCalc */ ;; +/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `zoneGeo_doCalc` ON SCHEDULE EVERY 15 SECOND STARTS '2019-09-13 15:30:47' ON COMPLETION PRESERVE DISABLE ON SLAVE DO CALL vn.zoneGeo_doCalc */ ;; /*!50003 SET time_zone = @saved_time_zone */ ;; /*!50003 SET sql_mode = @saved_sql_mode */ ;; /*!50003 SET character_set_client = @saved_cs_client */ ;; @@ -40251,8 +40702,6 @@ DELIMITER ; -- -- Dumping routines for database 'vn' -- -/*!50003 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `addressTaxArea` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -40260,6 +40709,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `addressTaxArea`(vAddresId INT, vCompanyId INT) RETURNS varchar(25) CHARSET utf8mb3 DETERMINISTIC @@ -40292,8 +40743,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `address_getGeo` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -40301,6 +40750,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `address_getGeo`(vSelf INT) RETURNS int(11) DETERMINISTIC @@ -40314,7 +40765,7 @@ BEGIN DECLARE vGeoFk INT; SELECT p.geoFk INTO vGeoFk - FROM address a + FROM address a JOIN town t ON t.provinceFk = a.provinceFk JOIN postCode p ON p.townFk = t.id AND p.`code` = a.postalCode WHERE a.id = vSelf @@ -40328,8 +40779,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `barcodeToItem` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -40337,16 +40786,18 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `barcodeToItem`(vBarcode VARCHAR(22)) RETURNS int(11) DETERMINISTIC BEGIN - + /** * Obtiene el id del artículo * * @param vBarcode código de barras - * + * * return id del item */ @@ -40356,43 +40807,41 @@ BEGIN FROM vn.item WHERE id = vBarcode OR comment = vBarcode LIMIT 1; - - IF vItemFk THEN + + IF vItemFk THEN RETURN vItemFk; END IF; - SELECT itemFk INTO vItemFk - FROM buy + SELECT itemFk INTO vItemFk + FROM buy WHERE id = vBarcode; - - IF vItemFk THEN + + IF vItemFk THEN RETURN vItemFk; END IF; - - SELECT itemFk INTO vItemFk - FROM itemBarcode + + SELECT itemFk INTO vItemFk + FROM itemBarcode WHERE code = vBarcode; - - IF vItemFk THEN + + IF vItemFk THEN RETURN vItemFk; END IF; - SELECT i.id INTO vItemFk + SELECT i.id INTO vItemFk FROM vn.item i WHERE i.name LIKE CONCAT('%',vBarcode,'%') ORDER BY i.id ASC LIMIT 1; - + RETURN vItemFk; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `botanicExport_isUpdatable` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -40400,15 +40849,17 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `botanicExport_isUpdatable`(vEdiGenusFk MEDIUMINT,vEdiSpecieFk MEDIUMINT, vCountryFk MEDIUMINT,vRestriction MEDIUMINT) RETURNS int(11) DETERMINISTIC BEGIN DECLARE vIsUpdatable INTEGER; - SELECT COUNT(*) INTO vIsUpdatable - FROM botanicExport - WHERE ediGenusFk = vEdiGenusFk + SELECT COUNT(*) INTO vIsUpdatable + FROM botanicExport + WHERE ediGenusFk = vEdiGenusFk AND (vEdiSpecieFk = ediSpecieFk OR IFNULL(vEdiSpecieFk,ediSpecieFk) IS NULL) AND (vCountryFk = countryFk OR IFNULL(vCountryFk,countryFk) IS NULL) AND vRestriction = restriction; @@ -40419,8 +40870,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `buy_getUnitVolume` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -40428,6 +40877,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `buy_getUnitVolume`(vSelf INT) RETURNS int(11) DETERMINISTIC @@ -40454,8 +40905,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `buy_getVolume` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -40463,6 +40912,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `buy_getVolume`(vSelf INT) RETURNS int(11) DETERMINISTIC @@ -40487,8 +40938,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `catalog_componentReverse` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -40496,6 +40945,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `catalog_componentReverse`(vWarehouse INT, vCost DECIMAL(10,3), @@ -40505,16 +40956,16 @@ CREATE DEFINER=`root`@`localhost` FUNCTION `catalog_componentReverse`(vWarehouse DETERMINISTIC BEGIN /* Calcula los componentes para un cliente a partir de un coste y volumen - * @param vWarehouse + * @param vWarehouse * @param vCost Valor de coste del articulo * @param vM3 m3 del articulo - * @param vAddressFk + * @param vAddressFk * @param vZoneFk - * @return vRetailedPrice precio de venta sin iva + * @return vRetailedPrice precio de venta sin iva * @return tmp.catalog_component (warehouseFk, itemFk, componentFk, cost) */ - - DECLARE vBoxVolume BIGINT; + + DECLARE vBoxVolume BIGINT; DECLARE vCustomer INT; DECLARE vComponentRecovery INT DEFAULT 17; DECLARE vComponentMana INT DEFAULT 39; @@ -40523,11 +40974,11 @@ BEGIN DECLARE vComponentCost INT DEFAULT 28; DECLARE vRetailedPrice DECIMAL(10,2); DECLARE vItem INT DEFAULT 98; - + SELECT volume INTO vBoxVolume FROM vn.packaging WHERE id = '94'; - + SELECT clientFk INTO vCustomer FROM address WHERE id = vAddressFk; DROP TEMPORARY TABLE IF EXISTS tmp.catalog_component; @@ -40551,7 +41002,7 @@ BEGIN -- Margen -- No se aplica margen, cau 12589 /* INSERT INTO tmp.catalog_component (warehouseFk, itemFk, componentFk, cost) - SELECT vWarehouse, vItem, vComponentMargin, (vCost / ((100 - rate2) / 100)) - vCost + SELECT vWarehouse, vItem, vComponentMargin, (vCost / ((100 - rate2) / 100)) - vCost FROM vn.rate WHERE dated <= util.VN_CURDATE() AND warehouseFk = vWarehouse @@ -40560,7 +41011,7 @@ BEGIN */ -- Recobro INSERT INTO tmp.catalog_component (warehouseFk, itemFk, componentFk, cost) - SELECT vWarehouse, vItem, vComponentRecovery, ROUND(LEAST(recobro,0.25), 3) + SELECT vWarehouse, vItem, vComponentRecovery, ROUND(LEAST(recobro,0.25), 3) FROM bi.claims_ratio WHERE Id_Cliente = vCustomer AND recobro > 0.009; @@ -40577,7 +41028,7 @@ BEGIN ROUND( vM3 * (z.price - z.bonus) - * z.inflation + * z.inflation / vBoxVolume, 4 ) FROM zone z @@ -40594,8 +41045,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `clientGetDebt` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -40603,6 +41052,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `clientGetDebt`(`vClient` INT, `vDate` DATE) RETURNS decimal(10,2) READS SQL DATA @@ -40614,11 +41065,8 @@ BEGIN * @param vDate date to check the risk * @return client risk */ - DECLARE vDebt DECIMAL(10,2); - SELECT vn.client_getDebt(vClient,vDate) INTO vDebt; - RETURN vDebt; END ;; DELIMITER ; @@ -40626,8 +41074,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `clientGetMana` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -40635,6 +41081,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `clientGetMana`(vClient INT) RETURNS decimal(10,2) DETERMINISTIC @@ -40652,30 +41100,30 @@ BEGIN DECLARE vAutoManaComponent INT; DECLARE vManaBank INT; DECLARE vManaGreugeType INT; - + SELECT id INTO vManaGreugeType FROM greugeType WHERE code = 'mana'; SELECT id INTO vManaBank FROM bank WHERE code = 'mana'; SELECT id INTO vManaComponent FROM component WHERE code = 'mana'; SELECT id INTO vAutoManaComponent FROM component WHERE code = 'autoMana'; - + SELECT COUNT(*) INTO vHasMana FROM `client` c WHERE c.id = vClient AND c.typeFk = 'normal'; - + IF NOT vHasMana THEN RETURN 0; END IF; - + SELECT max(dated) INTO vFromDated FROM clientManaCache; SELECT sum(mana) INTO vMana - FROM + FROM ( SELECT mana FROM clientManaCache WHERE clientFk = vClient - AND dated = vFromDated + AND dated = vFromDated UNION ALL SELECT s.quantity * value FROM ticket t @@ -40683,7 +41131,7 @@ BEGIN JOIN sale s on s.ticketFk = t.id JOIN saleComponent sc on sc.saleFk = s.id WHERE sc.componentFk IN (vManaComponent, vAutoManaComponent) - AND t.shipped > vFromDated + AND t.shipped > vFromDated AND t.shipped < TIMESTAMPADD(DAY,1,util.VN_CURDATE()) AND a.clientFk = vClient UNION ALL @@ -40710,8 +41158,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `clientGetSalesPerson` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -40719,6 +41165,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `clientGetSalesPerson`(vClientFk INT, vDated DATE) RETURNS int(11) DETERMINISTIC @@ -40733,8 +41181,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `clientTaxArea` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -40742,12 +41188,14 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `clientTaxArea`(vClientId INT, vCompanyId INT) RETURNS varchar(25) CHARSET utf8 READS SQL DATA BEGIN /** - * Devuelve el area de un cliente, + * Devuelve el area de un cliente, * intracomunitario, extracomunitario o nacional. * * @param vClient Id del cliente @@ -40768,8 +41216,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `client_getDebt` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -40777,6 +41223,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `client_getDebt`(`vClient` INT, `vDate` DATE) RETURNS decimal(10,2) READS SQL DATA @@ -40794,7 +41242,7 @@ BEGIN SELECT COUNT(*) INTO vHasDebt FROM `client` c WHERE c.id = vClient AND c.typeFk = 'normal'; - + IF NOT vHasDebt THEN RETURN 0; END IF; @@ -40813,8 +41261,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `client_getFromPhone` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -40822,6 +41268,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `client_getFromPhone`(vPhone VARCHAR(255)) RETURNS int(11) DETERMINISTIC @@ -40868,8 +41316,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `client_getSalesPerson` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -40877,13 +41323,15 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `client_getSalesPerson`(vClientFk INT, vDated DATE) RETURNS int(11) DETERMINISTIC BEGIN /** - * Dado un id cliente y una fecha, devuelve su comercial para ese dia, teniendo - * en cuenta la jerarquía de las tablas: 1º la de sharingclient, 2º la de + * Dado un id cliente y una fecha, devuelve su comercial para ese dia, teniendo + * en cuenta la jerarquía de las tablas: 1º la de sharingclient, 2º la de * sharingcart y tercero la de clientes. * * @param vClientFk El id del cliente @@ -40921,29 +41369,29 @@ BEGIN l: LOOP SELECT workerSubstitute INTO vWorkerSubstituteFk - FROM sharingCart + FROM sharingCart WHERE util.VN_CURDATE() BETWEEN started AND ended AND workerFk = vSalesPersonFk ORDER BY id LIMIT 1; - + IF vWorkerSubstituteFk IS NULL THEN LEAVE l; END IF; - + SELECT COUNT(*) > 0 INTO vLoop FROM tmp.stack WHERE substitute = vWorkerSubstituteFk; IF vLoop THEN LEAVE l; END IF; - + INSERT INTO tmp.stack SET substitute = vWorkerSubstituteFk; - + SET vSalesPersonFk = vWorkerSubstituteFk; END LOOP; - + DROP TEMPORARY TABLE tmp.stack; END IF; @@ -40954,8 +41402,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `client_getSalesPersonByTicket` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -40963,6 +41409,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `client_getSalesPersonByTicket`(vTicketFk INT) RETURNS int(11) DETERMINISTIC @@ -40977,11 +41425,11 @@ BEGIN **/ DECLARE vClientFk INT; DECLARE vDated DATE; - + SELECT clientFk, shipped INTO vClientFk, vDated FROM ticket WHERE id = vTicketFk; - + RETURN client_getSalesPerson(vClientFk, vDated); END ;; DELIMITER ; @@ -40989,8 +41437,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `client_getSalesPersonCode` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -40998,6 +41444,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `client_getSalesPersonCode`(vClientFk INT, vDated DATE) RETURNS varchar(3) CHARSET utf8 DETERMINISTIC @@ -41012,12 +41460,12 @@ BEGIN **/ DECLARE vWorkerCode CHAR(3); DECLARE vSalesPersonFk INT; - + SET vSalesPersonFk = client_getSalesPerson(vClientFk, vDated); SELECT code INTO vWorkerCode - FROM worker + FROM worker WHERE id = vSalesPersonFk; RETURN vWorkerCode; @@ -41027,8 +41475,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `client_getSalesPersonCodeByTicket` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -41036,6 +41482,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `client_getSalesPersonCodeByTicket`(vTicketFk INT) RETURNS varchar(3) CHARSET utf8 DETERMINISTIC @@ -41050,11 +41498,11 @@ BEGIN **/ DECLARE vClientFk INT; DECLARE vDated DATE; - + SELECT clientFk, shipped INTO vClientFk, vDated FROM ticket WHERE id = vTicketFk; - + RETURN client_getSalesPersonCode(vClientFk, vDated); END ;; DELIMITER ; @@ -41062,8 +41510,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `collectionExpeditionLacks` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -41071,6 +41517,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `collectionExpeditionLacks`(vCollectionFk INT) RETURNS varchar(100) CHARSET utf8 COLLATE utf8_unicode_ci DETERMINISTIC @@ -41098,8 +41546,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `collection_isPacked` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -41107,6 +41553,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `collection_isPacked`(vSelf INT) RETURNS tinyint(1) DETERMINISTIC @@ -41132,8 +41580,41 @@ 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 `currency_getCommission` */; +/*!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 = utf8mb4 */ ; +/*!50003 SET character_set_results = utf8mb4 */ ; +/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; +DELIMITER ;; +CREATE DEFINER=`root`@`localhost` FUNCTION `currency_getCommission`(vSelf INT) RETURNS int(11) + DETERMINISTIC +BEGIN +/** + * Devuelve el tipo de cambio en el dia de hoy dada el tipo de moneda + * + * @param vSelf id del tipo de moneda + * @return devuelve la comision + */ + DECLARE vCommission INT; + + SELECT ROUND(-100 * (1 - (1 / r.value))) INTO vCommission + FROM referenceCurrent r + WHERE r.currencyFk = vSelf + AND r.`dated` <= util.VN_CURDATE() + ORDER BY r.`dated` DESC + LIMIT 1; + + RETURN vCommission; +END ;; +DELIMITER ; +/*!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 `currentRate` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -41141,13 +41622,15 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `currentRate`(vCurrencyFk INT, vDated DATE) RETURNS decimal(10,4) READS SQL DATA BEGIN DECLARE curRate DECIMAL(10,4); - + SELECT value INTO curRate FROM referenceRate WHERE dated <= vDated @@ -41163,8 +41646,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `deviceProductionUser_accessGranted` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -41172,29 +41653,31 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `deviceProductionUser_accessGranted`(vUserFK INT(10) , android_id VARCHAR(50)) RETURNS tinyint(1) DETERMINISTIC BEGIN /* * Comprueba si el usuario puede entrar en la aplicacion de almacen con ese movil - * + * * */ - + /*DECLARE vIsGranted BOOLEAN; DECLARE vDeviceProductionFk INT(11) DEFAULT NULL; - SELECT dp.id INTO vDeviceProductionFk - FROM vn.deviceProduction dp + SELECT dp.id INTO vDeviceProductionFk + FROM vn.deviceProduction dp WHERE dp.android_id = android_id; IF vDeviceProductionFk THEN - - SELECT COUNT(*) INTO vIsGranted - FROM vn.deviceProductionUser dpu - WHERE dpu.userFk = vUserFK + + SELECT COUNT(*) INTO vIsGranted + FROM vn.deviceProductionUser dpu + WHERE dpu.userFk = vUserFK AND dpu.deviceProductionFk = vDeviceProductionFk; - + RETURN vIsGranted; END IF;*/ RETURN TRUE; @@ -41204,8 +41687,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `duaTax_getRate` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -41213,21 +41694,23 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `duaTax_getRate`(vDua INT, vTaxClass INT) RETURNS decimal(5,2) DETERMINISTIC BEGIN DECLARE vCountryFk INTEGER; - + SELECT s.countryFk INTO vCountryFk FROM dua d JOIN supplier s ON s.id = d.companyFk WHERE d.id = vDua; - + RETURN (SELECT rate FROM (SELECT taxClassFk, rate - FROM invoiceInTaxBookingAccount + FROM invoiceInTaxBookingAccount WHERE effectived <= util.VN_CURDATE() AND countryFk = vCountryFk AND taxClassFk = vTaxClass @@ -41241,8 +41724,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `ekt_getEntry` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -41250,29 +41731,31 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `ekt_getEntry`(vEktFk INT) RETURNS int(11) READS SQL DATA BEGIN /** - * Devuelve el numero de entrada para el ekt - * + * Devuelve el numero de entrada para el ekt + * * @param vEktFk Identificador de edi.ekt - */ + */ DECLARE vTravelFk INT; DECLARE vEntryFk INT DEFAULT 0; DECLARE vEntryAssignFk INT; - SELECT ea.id + SELECT ea.id INTO vEntryAssignFk FROM edi.ekt e - JOIN vn.ektEntryAssign ea ON + JOIN vn.ektEntryAssign ea ON IFNULL(ea.sub, e.sub) <=> e.sub AND IFNULL(ea.kop, e.kop) <=> e.kop AND IFNULL(ea.pro, e.pro) <=> e.pro AND IFNULL(ea.auction, e.auction) <=> e.auction WHERE e.id = vEktFk - ORDER BY + ORDER BY IF(ea.sub,1,0) * 1000 + IF(ea.kop,1,0) * 100 + IF(ea.pro,1,0) * 10 + @@ -41283,7 +41766,7 @@ BEGIN IF vTravelFk THEN - SELECT MAX(e.id) + SELECT MAX(e.id) INTO vEntryFk FROM vn.entry e JOIN vn.ektEntryAssign ea ON ea.id = vEntryAssignFk @@ -41295,16 +41778,16 @@ BEGIN AND e.companyFk <=> ea.companyFk; IF vEntryFk IS NULL THEN - INSERT INTO vn.entry(travelFk, supplierFk, companyFk, currencyFk, kop, sub, ref, pro, auction) + INSERT INTO vn.entry(travelFk, supplierFk, companyFk, currencyFk, kop, sub, reference, pro, auction) SELECT vTravelFk, ea.supplierFk, ea.companyFk, cu.id, ea.kop, ea.sub, ea.ref, ea.pro, ea.auction FROM vn.ektEntryAssign ea - JOIN vn.currency cu ON cu.code = 'EUR' + JOIN vn.currency cu ON cu.code = 'EUR' WHERE ea.id = vEntryAssignFk; SET vEntryFk = LAST_INSERT_ID(); END IF; - UPDATE vn.ektEntryAssign + UPDATE vn.ektEntryAssign SET entryFk = vEntryFk WHERE id = vEntryAssignFk; @@ -41323,8 +41806,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `ekt_getTravel` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -41332,13 +41813,15 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `ekt_getTravel`(vEntryAssignFk INT, vEktFk INT) RETURNS int(11) READS SQL DATA BEGIN /** * Devuelve un vn.travel.id - * + * * @param vEntryAssignFk Identificador de vn.entryAssign */ DECLARE vTravelFk INT; @@ -41379,8 +41862,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `entry_getCommission` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -41388,6 +41869,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!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, @@ -41400,36 +41883,36 @@ BEGIN DECLARE vCurrentCommission INT; DECLARE vIsCurrencyUsd INT; DECLARE vLastEntryFk INT; - + SELECT count(*) INTO vIsCurrencyUsd FROM currency c WHERE c.code = 'USD' AND id = vCurrencyFk; - + IF NOT vIsCurrencyUsd THEN - + SELECT e.id INTO vLastEntryFk FROM vn.entry e JOIN vn.travel tr ON tr.id = e.travelFk WHERE e.supplierFk = vSupplierFk ORDER BY tr.landed DESC LIMIT 1; - + IF vLastEntryFk THEN - + SELECT commission INTO vCurrentCommission FROM vn.entry WHERE id = vLastEntryFk; - + ELSE - + SELECT commission INTO vCurrentCommission FROM supplier s WHERE s.id = vSupplierFk; - + END IF; - + RETURN vCurrentCommission; - + ELSE SELECT ROUND(-100 * (1 - (1 / r.value))) INTO vCommission @@ -41438,19 +41921,17 @@ BEGIN WHERE t.id = vTravelFk ORDER BY r.`dated` DESC LIMIT 1; - + RETURN IFNULL(vCommission, 0); - + END IF; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `entry_getCurrency` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -41458,6 +41939,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!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, @@ -41481,8 +41964,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `entry_getForLogiflora` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -41490,14 +41971,16 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `entry_getForLogiflora`(vLanded DATE, vWarehouseFk INT) RETURNS int(11) READS SQL DATA BEGIN - + /** * Devuelve una entrada para Logiflora. Si no existe la crea. - * + * * @param vLanded Fecha de llegada al almacén * @param vWarehouseFk Identificador de vn.warehouse */ @@ -41505,59 +41988,57 @@ BEGIN DECLARE vTravelFk INT; DECLARE vEntryFk INT; DECLARE previousEntryFk INT; - + SET vTravelFk = vn.travel_getForLogiflora(vLanded, vWarehouseFk); - + IF vLanded THEN - - SELECT IFNULL(MAX(id),0) INTO vEntryFk + + SELECT IFNULL(MAX(id),0) INTO vEntryFk FROM vn.entry - WHERE travelFk = vTravelFk + WHERE travelFk = vTravelFk AND isRaid; IF NOT vEntryFk THEN - + INSERT INTO vn.entry(travelFk, supplierFk, commission, companyFk, currencyFk, isRaid) SELECT vTravelFk, s.id, 4, c.id, cu.id, TRUE FROM vn.supplier s JOIN vn.company c ON c.code = 'VNL' JOIN vn.currency cu ON cu.code = 'EUR' WHERE s.name = 'KONINKLIJE COOPERATIEVE BLOEMENVEILING FLORAHOLLAN'; - - SELECT MAX(id) INTO vEntryFk + + SELECT MAX(id) INTO vEntryFk FROM vn.entry WHERE travelFk = vTravelFk; - + END IF; + + END IF; - END IF; - - SELECT entryFk INTO previousEntryFk + SELECT entryFk INTO previousEntryFk FROM edi.warehouseFloramondo wf WHERE wf.warehouseFk = vWarehouseFk; - + IF IFNULL(previousEntryFk,0) != vEntryFk THEN - - UPDATE buy b - SET b.printedStickers = 0 + + UPDATE buy b + SET b.printedStickers = 0 WHERE entryFk = previousEntryFk; DELETE FROM buy WHERE entryFk = previousEntryFk; - + DELETE FROM entry WHERE id = previousEntryFk; - + END IF; - + RETURN vEntryFk; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `entry_isInventoryOrPrevious` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -41565,6 +42046,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `entry_isInventoryOrPrevious`(vSelf INT) RETURNS int(11) DETERMINISTIC @@ -41586,8 +42069,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `expedition_checkRoute` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -41595,6 +42076,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `expedition_checkRoute`(vPalletFk INT,vExpeditionFk INT) RETURNS tinyint(1) DETERMINISTIC @@ -41611,17 +42094,17 @@ BEGIN DECLARE vHasDistinctRoutes BOOL; SELECT t.routeFk INTO vRouteFk - FROM vn.expedition e + FROM vn.expedition e JOIN vn.ticket t ON e.ticketFk = t.id WHERE e.id = vExpeditionFk; - + SELECT COUNT(*) > 0 INTO vHasDistinctRoutes FROM vn.expeditionScan es JOIN vn.expedition e ON es.expeditionFk = e.id JOIN vn.ticket t ON e.ticketFk = t.id WHERE es.palletFk = vPalletFk AND t.routeFk <> vRouteFk; - + RETURN vHasDistinctRoutes; END ;; @@ -41630,8 +42113,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `firstDayOfWeek` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -41639,6 +42120,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `firstDayOfWeek`(vYear INT, vWeek INT) RETURNS date DETERMINISTIC @@ -41666,8 +42149,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `getAlert3State` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -41675,6 +42156,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `getAlert3State`(vTicket INT) RETURNS varchar(45) CHARSET utf8 COLLATE utf8_unicode_ci READS SQL DATA @@ -41682,27 +42165,27 @@ BEGIN DECLARE vDeliveryType INTEGER DEFAULT 0; DECLARE isWaitingForPickUp BOOLEAN DEFAULT FALSE; DECLARE vCode VARCHAR(45); - + SELECT am.deliveryMethodFk - INTO vDeliveryType + INTO vDeliveryType FROM ticket t JOIN agencyMode am ON am.id = t.agencyModeFk WHERE t.id = vTicket; - + CASE vDeliveryType WHEN 1 THEN -- AGENCIAS SET vCode = 'DELIVERED'; - + WHEN 2 THEN -- REPARTO SET vCode = 'ON_DELIVERY'; - + ELSE -- MERCADO, OTROS SELECT MIN(t.warehouseFk <> w.id) INTO isWaitingForPickUp - FROM ticket t + FROM ticket t LEFT JOIN warehouse w ON w.pickUpagencyModeFk = t.agencyModeFk WHERE t.id = vTicket; - + IF isWaitingForPickUp THEN SET vCode = 'WAITING_FOR_PICKUP'; ELSE @@ -41716,8 +42199,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `getAlert3StateTest` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -41725,6 +42206,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `getAlert3StateTest`(vTicket INT) RETURNS varchar(45) CHARSET latin1 READS SQL DATA @@ -41732,28 +42215,28 @@ BEGIN DECLARE vDeliveryType INTEGER DEFAULT 0; DECLARE isWaitingForPickUp BOOLEAN DEFAULT FALSE; DECLARE vCode VARCHAR(45); - - SELECT + + SELECT a.Vista - INTO vDeliveryType + INTO vDeliveryType FROM vn2008.Tickets t JOIN vn2008.Agencias a ON a.Id_Agencia = t.Id_Agencia WHERE Id_Ticket = vTicket; - + CASE vDeliveryType WHEN 1 THEN -- AGENCIAS SET vCode = 'DELIVERED'; - + WHEN 2 THEN -- REPARTO SET vCode = 'ON_DELIVERY'; - + ELSE -- MERCADO, OTROS SELECT t.warehouse_id <> w.warehouse_id INTO isWaitingForPickUp - FROM vn2008.Tickets t - LEFT JOIN vn2008.warehouse_pickup w + FROM vn2008.Tickets t + LEFT JOIN vn2008.warehouse_pickup w ON w.agency_id = t.Id_Agencia AND w.warehouse_id = t.warehouse_id WHERE t.Id_Ticket = vTicket; - + IF isWaitingForPickUp THEN SET vCode = 'WAITING_FOR_PICKUP'; ELSE @@ -41767,8 +42250,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `getDueDate` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -41776,6 +42257,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `getDueDate`(vDated DATE, vDayToPay INT) RETURNS date NO SQL @@ -41795,8 +42278,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `getInventoryDate` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -41804,6 +42285,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `getInventoryDate`() RETURNS date DETERMINISTIC @@ -41815,8 +42298,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `getNewItemId` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -41824,6 +42305,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `getNewItemId`() RETURNS int(11) READS SQL DATA @@ -41844,8 +42327,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `getNextDueDate` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -41853,6 +42334,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `getNextDueDate`(vDated DATE, vGapDays INT, vPayDay INT) RETURNS date NO SQL @@ -41861,16 +42344,16 @@ BEGIN DECLARE vReturn DATE; DECLARE vDuaDate DATE; DECLARE vDuaDateDay INT; - + SELECT TIMESTAMPADD(DAY, vGapDays, vDated) INTO vDuaDate; IF vDuaDate = CONCAT(YEAR(vDuaDate), '-03-01') THEN - SET vDuaDate = TIMESTAMPADD (DAY , -1, vDuaDate); + SET vDuaDate = TIMESTAMPADD (DAY , -1, vDuaDate); ELSEIF vDuaDate = CONCAT(YEAR(vDuaDate), '-02-29') THEN - SET vDuaDate = TIMESTAMPADD (DAY , -2, vDuaDate); + SET vDuaDate = TIMESTAMPADD (DAY , -2, vDuaDate); END IF; - IF MONTH(vDuaDate) = 2 AND vPayDay = 30 THEN + IF MONTH(vDuaDate) = 2 AND vPayDay = 30 THEN IF util.isLeapYear(YEAR(vDuaDate)) THEN SET vPayDay = 29; ELSE @@ -41878,7 +42361,7 @@ BEGIN END IF; END IF; - SELECT DAY(vDuaDate) INTO vDuaDateDay; + SELECT DAY(vDuaDate) INTO vDuaDateDay; RETURN TIMESTAMPADD(MONTH, (vDuaDateDay > vPayDay), DATE_FORMAT(vDuaDate, CONCAT('%y/%m/', vPayDay))); END ;; DELIMITER ; @@ -41886,8 +42369,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `getShipmentHour` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -41895,16 +42376,18 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `getShipmentHour`(vTicket INT) RETURNS int(11) READS SQL DATA BEGIN DECLARE vShipmentHour INT; - + SELECT HOUR(shipped) INTO vShipmentHour FROM ticket WHERE id = vTicket; - + IF vShipmentHour = 0 THEN DROP TEMPORARY TABLE IF EXISTS tmp.production_buffer; @@ -41919,11 +42402,11 @@ BEGIN JOIN agencyMode am on am.id = t.agencyModeFk JOIN address a on a.id = t.addressFk WHERE t.id = vTicket; - - SELECT Hora INTO vShipmentHour + + SELECT Hora INTO vShipmentHour FROM tmp.production_buffer; END IF; - + RETURN vShipmentHour; END ;; DELIMITER ; @@ -41931,8 +42414,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `getSpecialPrice` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -41940,6 +42421,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `getSpecialPrice`(vItemFk int(11),vClientFk int(11)) RETURNS decimal(10,2) READS SQL DATA @@ -41948,12 +42431,12 @@ BEGIN SELECT rate3 INTO price FROM vn.priceFixed - WHERE itemFk = vItemFk + WHERE itemFk = vItemFk AND util.VN_CURDATE() BETWEEN started AND ended ORDER BY created DESC LIMIT 1; - SELECT `value` INTO price + SELECT `value` INTO price FROM vn.specialPrice - WHERE itemFk = vItemFk + WHERE itemFk = vItemFk AND clientFk = vClientFk ; RETURN price; END ;; @@ -41962,8 +42445,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `getTicketToPrepare` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -41971,6 +42452,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `getTicketToPrepare`(`vWorker` INT, `vWarehouse` INT) RETURNS int(11) READS SQL DATA @@ -41978,61 +42461,40 @@ BEGIN /** * Devuelve el ticket que debe de preparar el trabajador * - * @param vWorker Id del trabajador + * @param vWorker Id del trabajador * @param vWarehouse Id del almacén * @return Id del ticket * * #UPDATED PAK 2019/08/16 * #PENDING REVIEW **/ - + DECLARE vToday DATETIME DEFAULT util.VN_CURDATE(); DECLARE vYesterday DATETIME; DECLARE vTodayvMidniight DATETIME DEFAULT midnight(vToday); DECLARE vTicket INT DEFAULT NULL; - DECLARE PREVIOUS_PREPARATION INT; - DECLARE vHasBeenPreviouslyPrepared INT DEFAULT 0; + DECLARE PREVIOUS_PREPARATION INT; + DECLARE vHasBeenPreviouslyPrepared INT DEFAULT 0; - -- Si hay algun ticket previamente seleccionado, y se ha quedado sin empezar, lo recupera en primer lugar. - /* - SELECT i.Id_Ticket INTO vTicket - FROM vncontrol.inter i - JOIN vn.state s ON s.id = i.state_id - LEFT JOIN - (SELECT DISTINCT s.ticketFk - 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 > util.VN_CURDATE() - -- AND tst.`code` = 'ON_PREPARATION' - ) sub ON sub.ticketFk = i.Id_Ticket - WHERE odbc_date > util.VN_CURDATE() - AND s.`code` = 'ON_PREPARATION' - AND i.Id_Trabajador = vWorker - AND sub.ticketFk IS NULL - LIMIT 1; - - IF vTicket IS NULL THEN - */ - SELECT id INTO PREVIOUS_PREPARATION + SELECT id INTO PREVIOUS_PREPARATION FROM vn.state WHERE code LIKE 'PREVIOUS_PREPARATION'; SET vYesterday = TIMESTAMPADD(DAY,-1,vToday); - + DROP TEMPORARY TABLE IF EXISTS tmp.workerComercial; CREATE TEMPORARY TABLE tmp.workerComercial ENGINE = MEMORY - SELECT workerFk as worker FROM `grant` g - JOIN grantGroup gg ON g.`groupFk` = gg.id + SELECT workerFk as worker FROM `grant` g + JOIN grantGroup gg ON g.`groupFk` = gg.id WHERE gg.description = 'Comerciales'; - - DELETE wc.* + + DELETE wc.* FROM tmp.workerComercial wc JOIN `grant` g ON g.workerFk = wc.worker - JOIN grantGroup gg ON g.`groupFk` = gg.id - WHERE gg.description = 'Gerencia'; - + JOIN grantGroup gg ON g.`groupFk` = gg.id + WHERE gg.description = 'Gerencia'; + DROP TEMPORARY TABLE IF EXISTS tmp.production_buffer; CREATE TEMPORARY TABLE tmp.production_buffer ENGINE = MEMORY @@ -42053,18 +42515,18 @@ BEGIN LEFT JOIN vn.zone z ON z.id = t.zoneFk WHERE t.shipped BETWEEN vYesterday AND vTodayvMidniight AND t.warehouseFk = vWarehouse - AND + AND ( (tls.code = 'PRINTED' AND wc.worker IS NULL) - OR + OR (tls.code ='PICKER_DESIGNED' AND tls.worker = vWorker) - OR + OR (tls.code = 'PRINTED_BACK') - OR + OR (tls.code = 'PRINTED PREVIOUS') ); - - + + SELECT ticket INTO vTicket FROM tmp.production_buffer ORDER BY (code = 'PICKER_DESIGNED') DESC, (code = 'PRINTED PREVIOUS') DESC ,Hora, Minuto, loadingOrder @@ -42072,18 +42534,18 @@ BEGIN -- Aviso de ticket para bajar SELECT COUNT(*) INTO vHasBeenPreviouslyPrepared - FROM vncontrol.inter - WHERE Id_Ticket = vTicket - AND state_id = PREVIOUS_PREPARATION; - - IF vHasBeenPreviouslyPrepared AND ticketWarehouseGet(vTicket) = 1 THEN - + FROM ticketTracking + WHERE ticketFk = vTicket + AND stateFk = PREVIOUS_PREPARATION; + + IF vHasBeenPreviouslyPrepared AND ticketWarehouseGet(vTicket) = 1 THEN + INSERT IGNORE INTO vn.ticketDown(ticketFk) VALUES(vTicket); - + END IF; -- END IF; - + RETURN vTicket; END ;; @@ -42092,8 +42554,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `getTicketTrolleyLabelCount` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -42101,13 +42561,15 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `getTicketTrolleyLabelCount`(vTicket INT) RETURNS int(11) READS SQL DATA BEGIN DECLARE vLabelCount INT DEFAULT 0; - SELECT labelCount INTO vLabelCount + SELECT labelCount INTO vLabelCount FROM ticketTrolley WHERE ticket = vTicket; @@ -42123,8 +42585,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `getUser` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -42132,6 +42592,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `getUser`() RETURNS int(11) DETERMINISTIC @@ -42146,8 +42608,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `getUserId` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -42155,6 +42615,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `getUserId`(userName varchar(30)) RETURNS int(11) READS SQL DATA @@ -42173,8 +42635,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `getWorkerCode` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -42182,6 +42642,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `getWorkerCode`() RETURNS varchar(3) CHARSET utf8 READS SQL DATA @@ -42199,8 +42661,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `hasAnyNegativeBase` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -42208,10 +42668,12 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `hasAnyNegativeBase`() RETURNS tinyint(1) DETERMINISTIC -BEGIN +BEGIN /* Calcula si existe alguna base imponible negativa * Requiere la tabla temporal vn.ticketToInvoice(id) @@ -42219,14 +42681,14 @@ BEGIN * returns BOOLEAN */ DECLARE hasAnyNegativeBase BOOLEAN; - + DROP TEMPORARY TABLE IF EXISTS tmp.ticket; CREATE TEMPORARY TABLE tmp.ticket (KEY (ticketFk)) ENGINE = MEMORY SELECT id ticketFk FROM ticketToInvoice; - + CALL ticket_getTax(NULL); SELECT COUNT(*) INTO hasAnyNegativeBase @@ -42239,17 +42701,15 @@ BEGIN DROP TEMPORARY TABLE tmp.ticketTax; DROP TEMPORARY TABLE tmp.ticket; - + RETURN hasAnyNegativeBase; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `hasItemsInSector` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -42257,31 +42717,31 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `hasItemsInSector`(vTicketFk INT, vSectorFk INT) RETURNS tinyint(1) DETERMINISTIC BEGIN DECLARE vItemCount INT; - + SELECT count(*) INTO vItemCount - FROM vn.sale s + FROM vn.sale s JOIN vn.itemShelving ish ON ish.itemFk = s.itemFk JOIN vn.shelving sh ON sh.code = ish.shelvingFk JOIN vn.parking p ON p.id = sh.parkingFk WHERE s.ticketFk = vTicketFk AND p.sectorFk = vSectorFk; - + RETURN vItemCount; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `hasSomeNegativeBase` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -42289,6 +42749,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `hasSomeNegativeBase`(vTicket INT) RETURNS tinyint(1) READS SQL DATA @@ -42296,7 +42758,7 @@ BEGIN DECLARE vCountry INT; DECLARE hasSomeNegativeBase BOOLEAN; - SELECT s.countryFk + SELECT s.countryFk INTO vCountry FROM supplier s JOIN ticket t ON t.companyFk = s.id @@ -42305,9 +42767,9 @@ BEGIN SELECT COUNT(*) INTO hasSomeNegativeBase FROM ( SELECT SUM(ROUND(s.quantity * s.price * (100 - s.discount)/100,2)) taxableBase - FROM sale s + FROM sale s JOIN item i ON i.id = s.itemFk - JOIN itemTaxCountry itc + JOIN itemTaxCountry itc ON itc.itemFk = i.id AND itc.countryFk = vCountry WHERE s.ticketFk = vTicket GROUP BY itc.taxClassFk @@ -42321,8 +42783,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `invoiceOutAmount` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -42330,6 +42790,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `invoiceOutAmount`(vInvoiceRef VARCHAR(15)) RETURNS decimal(10,2) READS SQL DATA @@ -42337,12 +42799,12 @@ BEGIN DECLARE totalAmount DECIMAL(10,2); SELECT SUM(vat) INTO totalAmount - FROM ( + FROM ( SELECT iot.vat FROM invoiceOutTax iot JOIN invoiceOut io ON io.id = iot.invoiceOutFk WHERE io.ref = vInvoiceRef - UNION ALL + UNION ALL SELECT ioe.amount FROM invoiceOutExpence ioe JOIN invoiceOut io ON io.id = ioe.invoiceOutFk @@ -42356,8 +42818,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `invoiceOut_getPath` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -42365,6 +42825,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `invoiceOut_getPath`(vSelf INT) RETURNS varchar(255) CHARSET utf8 DETERMINISTIC @@ -42372,7 +42834,7 @@ BEGIN DECLARE vIssued DATE; DECLARE vSerial VARCHAR(15); - SELECT issued, ref + SELECT issued, ref INTO vIssued, vSerial FROM invoiceOut WHERE id = vSelf; @@ -42389,15 +42851,15 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `invoiceOut_getWeight` */; /*!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 = utf8mb4 */ ; -/*!50003 SET character_set_results = utf8mb4 */ ; -/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET character_set_client = utf8mb3 */ ; +/*!50003 SET character_set_results = utf8mb3 */ ; +/*!50003 SET collation_connection = utf8mb3_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `invoiceOut_getWeight`(vInvoice VARCHAR(15)) RETURNS decimal(10,2) READS SQL DATA @@ -42410,9 +42872,9 @@ BEGIN */ DECLARE vTotalWeight DECIMAL(10,2); - SELECT SUM(CAST(IFNULL(i.stems, 1) * s.quantity * - IF(ic.grams, ic.grams, i.density * ic.cm3delivery / 1000) - / 1000 AS DECIMAL(10,2))) + SELECT SUM(CAST(IFNULL(i.stems, 1) + * s.quantity + * IF(ic.grams, ic.grams, IFNULL(i.weightByPiece, 0)) / 1000 AS DECIMAL(10,2))) INTO vTotalWeight FROM ticket t JOIN sale s ON s.ticketFk = t.id @@ -42420,7 +42882,7 @@ BEGIN JOIN itemCost ic ON ic.itemFk = i.id AND ic.warehouseFk = t.warehouseFk WHERE t.refFk = vInvoice - AND i.intrastatFk ; + AND i.intrastatFk; RETURN vTotalWeight; END ;; @@ -42429,8 +42891,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `invoiceSerial` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -42438,14 +42898,16 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `invoiceSerial`(vClientFk INT, vCompanyFk INT, vType CHAR(1)) RETURNS char(1) CHARSET utf8 DETERMINISTIC BEGIN /** - * Obtiene la serie de de una factura + * Obtiene la serie de de una factura * dependiendo del area del cliente. - * + * * @param vClientFk Id del cliente * @param vCompanyFk Id de la empresa * @param vType Tipo de factura ["R", "M", "G"] @@ -42467,8 +42929,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `invoiceSerialArea` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -42476,6 +42936,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `invoiceSerialArea`(vType CHAR(1), vTaxArea VARCHAR(25)) RETURNS char(1) CHARSET utf8mb3 COLLATE utf8mb3_unicode_ci DETERMINISTIC @@ -42513,8 +42975,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `isIntrastatEntry` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -42522,6 +42982,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `isIntrastatEntry`(vEntryFk INT) RETURNS int(11) READS SQL DATA @@ -42544,7 +43006,7 @@ BEGIN JOIN vn.entry e ON e.companyFk = co.id WHERE e.id = vEntryFk AND c.isUeeMember = TRUE; - + IF vSupplierCountry != vClientCountry AND vSupplierCountry * vClientCountry > 0 THEN SET isIntrastatOperation = TRUE; END IF; @@ -42556,8 +43018,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `isLogifloraDay` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -42565,30 +43025,30 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `isLogifloraDay`(vShipped DATE, vWarehouse INT) RETURNS tinyint(1) DETERMINISTIC BEGIN - + DECLARE vIsLogifloraDay BOOLEAN; SELECT COUNT(*) INTO vIsLogifloraDay FROM edi.warehouseFloramondo wf - JOIN vn.floramondoConfig fc + JOIN vn.floramondoConfig fc WHERE wf.warehouseFk = vWarehouse AND vShipped BETWEEN DATE(TIMESTAMPADD(DAY, wf.travellingDays , fc.nextLanded)) AND DATE(TIMESTAMPADD(DAY, wf.travellingDays + wf.dayRange , fc.nextLanded)); - + RETURN vIsLogifloraDay; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `isPalletHomogeneus` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -42596,6 +43056,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `isPalletHomogeneus`(vExpedition INT) RETURNS tinyint(1) READS SQL DATA @@ -42617,7 +43079,7 @@ BEGIN WHERE sl.scan_id = vScanId AND t.Id_Ruta ) t1; - + RETURN vDistinctRoutesInThePallet = 1; END ;; DELIMITER ; @@ -42625,8 +43087,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `itemPacking` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -42634,6 +43094,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `itemPacking`(vBarcode VARCHAR(22), vWarehouseFk INT) RETURNS int(11) DETERMINISTIC @@ -42641,20 +43103,20 @@ BEGIN DECLARE vPacking INTEGER DEFAULT 0; DECLARE vItemFk INTEGER; - + SELECT vn.barcodeToItem(vBarcode) INTO vItemFk; - - SELECT IFNULL(packing,0) INTO vPacking - FROM vn.buy + + SELECT IFNULL(packing,0) INTO vPacking + FROM vn.buy WHERE id = CAST(vBarcode AS DECIMAL(18,0)); - - - - + + + + IF NOT vPacking THEN CALL cache.last_buy_refresh(FALSE); SELECT IFNULL(packing,1) INTO vPacking - FROM + FROM (SELECT packing , created FROM vn.itemShelving WHERE itemFk = vItemFk @@ -42667,19 +43129,17 @@ BEGIN ) packings ORDER BY created desc LIMIT 1; - + END IF; - + RETURN vPacking; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `itemShelvingPlacementSupply_ClosestGet` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -42687,6 +43147,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `itemShelvingPlacementSupply_ClosestGet`(vParkingFk INT) RETURNS int(11) READS SQL DATA @@ -42696,11 +43158,11 @@ BEGIN DECLARE vColumn INT; DECLARE vClosestParkingFk INT; DECLARE vSectorFk INT; - + SELECT p.column, sectorFk INTO vColumn, vSectorFk FROM vn.parking p WHERE p.id = vParkingFk; - + SELECT itemShelvingFk INTO vClosestParkingFk FROM ( @@ -42710,20 +43172,18 @@ BEGIN JOIN vn.itemPlacementSupplyList ipsl ON ipsl.sectorFk = ispss.sectorFk AND ipsl.itemFk = ispss.itemFk WHERE p.sectorFk = vSectorFk AND ipsl.saldo > 0 - ) sub + ) sub ORDER BY distance LIMIT 1; - + RETURN vClosestParkingFk; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `itemsInSector_get` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -42731,31 +43191,31 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `itemsInSector_get`(vTicketFk INT, vSectorFk INT) RETURNS int(11) READS SQL DATA BEGIN DECLARE vItemCount INT; - + SELECT count(*) INTO vItemCount - FROM vn.sale s + FROM vn.sale s JOIN vn.itemShelving ish ON ish.itemFk = s.itemFk JOIN vn.shelving sh ON sh.code = ish.shelvingFk JOIN vn.parking p ON p.id = sh.parkingFk WHERE s.ticketFk = vTicketFk AND p.sectorFk = vSectorFk; - + RETURN vItemCount; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `itemTag_getIntValue` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -42763,6 +43223,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `itemTag_getIntValue`(vValue VARCHAR(255)) RETURNS int(11) DETERMINISTIC @@ -42778,8 +43240,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `item_getFhImage` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -42787,6 +43247,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `item_getFhImage`(itemFk INT) RETURNS varchar(255) CHARSET utf8 COLLATE utf8_unicode_ci DETERMINISTIC @@ -42807,8 +43269,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `item_getPackage` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -42816,41 +43276,41 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `item_getPackage`(vItemFk INT) RETURNS varchar(50) CHARSET utf8 COLLATE utf8_unicode_ci DETERMINISTIC BEGIN - + DECLARE vDiameter INT; DECLARE vPackageFk VARCHAR(50); DECLARE vCoeficient DOUBLE DEFAULT 1.08; - + SELECT MAX(LEFT(value,3)) INTO vDiameter - FROM vn.itemTag it + FROM vn.itemTag it JOIN vn.tag t ON t.id = it.tagFk WHERE it.itemFk = vItemFk AND t.overwrite = 'diameter'; - + SELECT 8000 + FLOOR(vc.ccLength * vc.ccWidth / (vCoeficient * PI() * (vDiameter / 2) * (vDiameter / 2))) INTO vPackageFk FROM vn.volumeConfig vc; - + INSERT IGNORE INTO vn.packaging(id, width, `depth`) - SELECT vPackageFk, - FLOOR(vc.ccWidth / FLOOR(vc.ccWidth / vDiameter)), + SELECT vPackageFk, + FLOOR(vc.ccWidth / FLOOR(vc.ccWidth / vDiameter)), FLOOR(vc.ccLength / FLOOR(vc.ccLength / vDiameter)) FROM vn.volumeConfig vc; - + RETURN vPackageFk; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `item_getVolume` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -42858,6 +43318,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `item_getVolume`(vSelf INT, vPackaging VARCHAR(10)) RETURNS int(11) DETERMINISTIC @@ -42879,7 +43341,7 @@ BEGIN FROM packaging p JOIN item i ON i.id = vSelf WHERE p.id = vPackaging; - + RETURN vVolume; END ;; @@ -42888,8 +43350,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `lastDayOfWeek` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -42897,10 +43357,12 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `lastDayOfWeek`(vYear INT, vWeek INT) RETURNS date DETERMINISTIC -BEGIN +BEGIN /** * Returns the date of the last day of the week * @@ -42924,8 +43386,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `machine_checkPlate` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -42933,22 +43393,24 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `machine_checkPlate`(vPlate VARCHAR(10)) RETURNS tinyint(1) READS SQL DATA BEGIN /** * Comprueba si existe matrícula - * + * * @param vPlate matrícula del vehículo * @return Devuelve TRUE en caso de que exista - * + * */ - + IF (SELECT COUNT(*) - FROM machine m + FROM machine m WHERE m.plate = vPlate - ) THEN + ) THEN RETURN TRUE; ELSE RETURN FALSE; @@ -42959,8 +43421,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `messageSend` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -42968,6 +43428,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `messageSend`(vRecipient VARCHAR(255) CHARSET utf8, vMessage TEXT CHARSET utf8) RETURNS int(11) READS SQL DATA @@ -42975,9 +43437,9 @@ BEGIN DECLARE result INT; DECLARE vSenderFk INT; - SELECT id INTO vSenderFk + SELECT id INTO vSenderFk FROM account.user WHERE `name` = account.myUser_getName(); - + RETURN (SELECT messageSendWithUser(vSenderFk, vRecipient, vMessage)); END ;; DELIMITER ; @@ -42985,8 +43447,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `messageSendWithUser` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -42994,6 +43454,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `messageSendWithUser`(vSenderFK INT, vRecipient VARCHAR(255) CHARSET utf8, vMessage TEXT CHARSET utf8) RETURNS int(11) DETERMINISTIC @@ -43004,9 +43466,9 @@ BEGIN DECLARE vSendDate DATETIME DEFAULT util.VN_NOW(); DECLARE vSender VARCHAR(255) CHARSET utf8; - SELECT `name` INTO vSender + SELECT `name` INTO vSender FROM account.user WHERE id = vSenderFK; - + SET vRecipient = LOWER(vRecipient); DROP TEMPORARY TABLE IF EXISTS tRecipients; @@ -43027,7 +43489,7 @@ BEGIN IF vCount = 0 THEN RETURN vCount; - END IF; + END IF; SET vUuid = UUID(); @@ -43038,7 +43500,7 @@ BEGIN message = vMessage, sendDate = vSendDate; - INSERT INTO messageInbox (uuid, sender, recipient, finalRecipient, message, sendDate) + INSERT INTO messageInbox (uuid, sender, recipient, finalRecipient, message, sendDate) SELECT vUuid, vSender, vRecipient, finalRecipient, vMessage, vSendDate FROM tRecipients; @@ -43050,8 +43512,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `MIDNIGHT` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -43059,6 +43519,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `MIDNIGHT`(vDate DATE) RETURNS datetime DETERMINISTIC @@ -43070,8 +43532,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `nz` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -43079,6 +43539,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `nz`(vQuantity DOUBLE) RETURNS double DETERMINISTIC @@ -43096,8 +43558,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `orderTotalVolume` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -43105,6 +43565,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `orderTotalVolume`(vOrderId INT) RETURNS decimal(10,3) READS SQL DATA @@ -43112,7 +43574,7 @@ BEGIN -- Devuelte el volumen total de la orden sumada DECLARE vWarehouseId INTEGER; DECLARE vVolume DECIMAL(10,3); - + SELECT IFNULL(SUM(o.amount * ic.cm3delivery)/1000000,0) INTO vVolume FROM hedera.orderRow o JOIN item i ON i.id = o.itemFk @@ -43127,8 +43589,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `orderTotalVolumeBoxes` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -43136,6 +43596,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `orderTotalVolumeBoxes`(vOrderId INT) RETURNS decimal(10,3) READS SQL DATA @@ -43163,8 +43625,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `packaging_calculate` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -43172,6 +43632,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `packaging_calculate`(isPackageReturnable TINYINT(1), packagingReturnFk INT(11), @@ -43189,7 +43651,7 @@ BEGIN WHERE cb.id = packagingReturnFk; SET vValue = IF (vAmount IS NULL, - IFNULL(base,0), + IFNULL(base,0), vAmount / IFNULL(upload, 0) + IFNULL(base, 0)); ELSE SET vValue = IFNULL(price, 0) + IFNULL(base, 0); @@ -43202,8 +43664,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `phytoPassport` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -43211,12 +43671,14 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `phytoPassport`(vRef VARCHAR(15)) RETURNS text CHARSET utf8 DETERMINISTIC BEGIN DECLARE vPhyto TEXT CHARSET utf8 COLLATE utf8_unicode_ci; -SELECT +SELECT GROUP_CONCAT(i.id, ':', ppa.denomination, @@ -43257,8 +43719,38 @@ 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 `priceFixed_getRate2` */; +/*!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 = utf8mb4 */ ; +/*!50003 SET character_set_results = utf8mb4 */ ; +/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; +DELIMITER ;; +CREATE DEFINER=`root`@`localhost` FUNCTION `priceFixed_getRate2`(vFixedPriceFk INT, vRate3 DOUBLE) RETURNS double +BEGIN + + DECLARE vWarehouse INT; + DECLARE vRate2 DOUBLE; + + SELECT round(vRate3 * (1 + ((r.rate2 - r.rate3)/100)), 2) INTO vRate2 + FROM vn.rate r + JOIN vn.priceFixed p ON p.id = vFixedPriceFk + WHERE r.dated <= p.started + AND r.warehouseFk = p.warehouseFk + ORDER BY r.dated DESC + LIMIT 1; + + RETURN vRate2; + +END ;; +DELIMITER ; +/*!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 `routeProposal` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -43266,6 +43758,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `routeProposal`(vTicketFk INT) RETURNS int(11) READS SQL DATA @@ -43273,20 +43767,20 @@ BEGIN DECLARE vRouteFk INT; DECLARE vAddressFk INT; - + DECLARE vLanded DATE; DECLARE vZoneFk INT; DECLARE vSignificativeFriendship INT DEFAULT 6; DECLARE vVolumeMax DECIMAL(5,1) DEFAULT 10; - + SELECT addressFk, zoneFk, landed INTO vAddressFk, vZoneFk, vLanded - FROM vn.ticket + FROM vn.ticket WHERE id = vTicketFk; - + -- Se inicia la selección de rutas posibles con aquellas cuyas agencias alguna vez han estado asociadas con nuestra zona DROP TEMPORARY TABLE IF EXISTS tmp.route; CREATE TEMPORARY TABLE tmp.route - SELECT r.id routeFk, + SELECT r.id routeFk, zf.friendship zoneFriendship FROM vn.route r JOIN cache.zoneAgencyFriendship zf ON zf.agencyModeFk = r.agencyModeFk @@ -43294,16 +43788,16 @@ BEGIN AND zf.zoneFk = vZoneFk AND r.created = vLanded ORDER BY friendship; - + -- Se eliminan aquellas que superan el volumen máximo DELETE r.* - FROM tmp.route r + FROM tmp.route r JOIN (SELECT routeFk, sum(volume) volume FROM vn.saleVolume WHERE landed = vLanded GROUP BY routeFk) sub ON sub.routeFk = r.routeFk WHERE sub.volume > vVolumeMax; - + -- Se ordenan las que quedan en función con la afinidad del resto de consignatarios de cada ruta SELECT routeFk INTO vRouteFk FROM @@ -43315,7 +43809,7 @@ BEGIN ORDER BY zoneFriendship DESC, friendshipSum DESC ) sub LIMIT 1; - + RETURN vRouteFk; END ;; DELIMITER ; @@ -43323,8 +43817,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `routeProposal_` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -43332,6 +43824,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `routeProposal_`(vTicketFk INT) RETURNS int(11) READS SQL DATA @@ -43340,9 +43834,9 @@ BEGIN DECLARE vRouteFk INT; DECLARE vAddressFk INT; DECLARE vShipped DATETIME; - + SELECT addressFk, date(shipped) INTO vAddressFk, vShipped - FROM vn.ticket + FROM vn.ticket WHERE id = vTicketFk; SELECT routeFk INTO vRouteFk @@ -43356,7 +43850,7 @@ BEGIN ORDER BY friendshipSum DESC ) sub LIMIT 1; - + RETURN vRouteFk; END ;; DELIMITER ; @@ -43364,8 +43858,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `routeProposal_beta` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -43373,6 +43865,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `routeProposal_beta`(vTicketFk INT) RETURNS int(11) READS SQL DATA @@ -43380,20 +43874,20 @@ BEGIN DECLARE vRouteFk INT; DECLARE vAddressFk INT; - + DECLARE vLanded DATE; DECLARE vZoneFk INT; DECLARE vSignificativeFriendship INT DEFAULT 6; DECLARE vVolumeMax DECIMAL(5,1) DEFAULT 10; - + SELECT addressFk, zoneFk, landed INTO vAddressFk, vZoneFk, vLanded - FROM vn.ticket + FROM vn.ticket WHERE id = vTicketFk; - + -- Se inicia la selección de rutas posibles con aquellas cuyas agencias alguna vez han estado asociadas con nuestra zona DROP TEMPORARY TABLE IF EXISTS tmp.route; CREATE TEMPORARY TABLE tmp.route - SELECT r.id routeFk, + SELECT r.id routeFk, zf.friendship zoneFriendship FROM vn.route r JOIN cache.zoneAgencyFriendship zf ON zf.agencyModeFk = r.agencyModeFk @@ -43401,16 +43895,16 @@ BEGIN AND zf.zoneFk = vZoneFk AND r.created = vLanded ORDER BY friendship; - + -- Se eliminan aquellas que superan el volumen máximo DELETE r.* - FROM tmp.route r + FROM tmp.route r JOIN (SELECT routeFk, sum(volume) volume FROM vn.saleVolume WHERE landed = vLanded GROUP BY routeFk) sub ON sub.routeFk = r.routeFk WHERE sub.volume > vVolumeMax; - + -- Se ordenan las que quedan en función con la afinidad del resto de consignatarios de cada ruta SELECT routeFk INTO vRouteFk FROM @@ -43422,7 +43916,7 @@ BEGIN ORDER BY zoneFriendship DESC, friendshipSum DESC ) sub LIMIT 1; - + RETURN vRouteFk; END ;; DELIMITER ; @@ -43430,8 +43924,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `specie_IsForbidden` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -43439,38 +43931,38 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `specie_IsForbidden`(vItemFk INT, vAddressFk INT) RETURNS tinyint(1) READS SQL DATA BEGIN - + DECLARE vIsForbbiden BOOL; DECLARE vLeft INT; SELECT zg.lft INTO vLeft - FROM vn.address a - JOIN vn.zoneGeo zg ON zg.name = a.postalCode + FROM vn.address a + JOIN vn.zoneGeo zg ON zg.name = a.postalCode WHERE a.id = vAddressFk; - + SELECT sgi.isForbidden INTO vIsForbbiden - FROM vn.specieGeoInvasive sgi - JOIN vn.zoneGeo zg ON zg.id = sgi.zoneGeofk + FROM vn.specieGeoInvasive sgi + JOIN vn.zoneGeo zg ON zg.id = sgi.zoneGeofk JOIN vn.itemBotanical ib ON ib.genusFk = sgi.genusFk AND sgi.specieFk IN ('sp.',ib.specieFk) WHERE vLeft BETWEEN zg.lft AND zg.rgt AND ib.itemFk = vItemFk - ORDER BY zg.`depth` DESC + ORDER BY zg.`depth` DESC LIMIT 1; RETURN IFNULL(vIsForbbiden, FALSE); - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `testCIF` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -43478,11 +43970,13 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `testCIF`(vCIF VARCHAR(9)) RETURNS varchar(10) CHARSET utf8 COLLATE utf8_unicode_ci DETERMINISTIC BEGIN - + DECLARE vLetraInicial VARCHAR(1); DECLARE vLetraFinal VARCHAR(1); DECLARE vParteNumerica VARCHAR(7); @@ -43494,68 +43988,66 @@ BEGIN SET vLetraInicial = SUBSTR(vCIF, 1, 1); SET vLetraFinal = SUBSTR(vCIF, 9, 1); SET vParteNumerica = SUBSTR(vCIF, 2, 7); - - WHILE i < 7 DO - + + WHILE i < 7 DO + SET i = i + 1; - + SET vNumero = CAST(SUBSTR(vParteNumerica, i, 1) AS DECIMAL(1,0)); - + IF i MOD 2 THEN - + SET vNumero = vNumero * 2; SET vNumero = vNumero MOD 10 + FLOOR(vNumero/10); - + END IF; - + SET vSuma = vSuma + vNumero; - + END WHILE; - + SET vSuma = vSuma MOD 10; - + IF vSuma > 0 THEN - + SET vSuma = 10 - vSuma; - + END IF; - + -- Comprobación de dígito de control IF CAST(vLetraFinal AS DECIMAL(1,0)) = vSuma THEN - + SET vResult = TRUE; - + END IF; - + IF vSuma = 0 THEN - + SET vSuma = 10; - + END IF; - + IF CHAR(64 + vSuma) = vLetraFinal THEN - + SET vResult = TRUE; - + END IF; - + -- Sólo se aceptan letras como caracter inicial IF ASCII(vLetraInicial) < 65 OR ASCII(vLetraInicial) > 87 THEN -- Ha de ser entre la A y la W - + SET vResult = FALSE; - + END IF; - + RETURN vResult; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `testNIE` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -43563,11 +44055,13 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `testNIE`(vNIE VARCHAR(9)) RETURNS tinyint(1) DETERMINISTIC BEGIN - + DECLARE vIndice INT; DECLARE vNumero VARCHAR(7); DECLARE vOperador VARCHAR(9); @@ -43576,53 +44070,51 @@ BEGIN DECLARE vLetraFinal VARCHAR(1); DECLARE vLetrasFinalesPosibles VARCHAR(24) DEFAULT "TRWAGMYFPDXBNJZSQVHLCKE"; DECLARE vLetraInicialEsIncorrecta BOOL DEFAULT FALSE; - + SET vLetraInicial = SUBSTR(vNIE, 1, 1); SET vLetraFinal = SUBSTR(vNIE, 9, 1); SET vNumero = SUBSTR(vNIE, 2, 7); CASE vLetraInicial - + WHEN 'X' THEN - + SET vOperador = "0"; - + WHEN 'Y' THEN - + SET vOperador = "1"; - + WHEN 'Z' THEN - + SET vOperador = "2"; - + ELSE - + SET vLetraInicialEsIncorrecta = TRUE; - + END CASE; - + SET vOperador = CONCAT(vOperador, vNumero); SET vParteNumerica = CAST(vOperador AS DECIMAL(8,0)); SET vIndice = Round(vParteNumerica Mod 23, 0) + 1; IF SUBSTR(vLetrasFinalesPosibles, vIndice, 1) = vLetraFinal AND vLetraInicialEsIncorrecta = FALSE THEN - + RETURN TRUE; - + ELSE - + RETURN FALSE; - + END IF; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `testNIF` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -43630,6 +44122,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `testNIF`(vNIF VARCHAR(9)) RETURNS tinyint(1) DETERMINISTIC @@ -43639,31 +44133,29 @@ BEGIN DECLARE vParteNumerica DECIMAL(8,0); DECLARE vLetra VARCHAR(1); DECLARE vLetrasPosibles VARCHAR(24) DEFAULT "TRWAGMYFPDXBNJZSQVHLCKE"; - + SET vLetra = SUBSTRING(vNIF, 9, 1); - + SET vParteNumerica = CAST(SUBSTRING(vNIF, 1, 8) AS DECIMAL(8,0)); - + SET vIndice = Round(vParteNumerica MOD 23, 0) + 1; - + If SUBSTRING(vLetrasPosibles, vIndice, 1) = vLetra Then - + RETURN TRUE; - + ELSE - + RETURN FALSE; - + END IF; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `ticketCollection_getNoPacked` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -43671,25 +44163,27 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `ticketCollection_getNoPacked`(vCollectionFk INT) RETURNS varchar(100) CHARSET utf8 COLLATE utf8_unicode_ci DETERMINISTIC BEGIN - + /* * return message with tickets and collection if there is tickets of a collection without expeditions - * + * * @param vCollectionFk the collection to check * @return an array with collection and tickets without expeditions - * + * */ - + DECLARE vAnswer VARCHAR(100) DEFAULT ''; IF collection_isPacked(vCollectionFk) = FALSE THEN SELECT CONCAT('Colección: ',tc.collectionFk,' Tickets: ' , GROUP_CONCAT(tc.ticketFk) ) INTO vAnswer FROM vn.ticketCollection tc - LEFT JOIN vn.expedition e ON e.ticketFk = tc.ticketFk + LEFT JOIN vn.expedition e ON e.ticketFk = tc.ticketFk WHERE tc.collectionFk = vCollectionFk AND ISNULL(e.id); END IF; @@ -43701,8 +44195,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `ticketGetTotal` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -43710,6 +44202,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `ticketGetTotal`(vTicketId INT) RETURNS decimal(10,2) READS SQL DATA @@ -43735,17 +44229,15 @@ BEGIN DROP TEMPORARY TABLE tmp.ticket, tmp.ticketTotal; - + RETURN vTotal; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `ticketPositionInPath` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -43753,11 +44245,13 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `ticketPositionInPath`(vTicketId INT) RETURNS varchar(10) CHARSET utf8 DETERMINISTIC BEGIN - + DECLARE vRestTicketsMaxOrder INT; DECLARE vRestTicketsMinOrder INT; DECLARE vRestTicketsPacking INT; @@ -43769,7 +44263,7 @@ BEGIN DECLARE vExpeditionsCount INT; DECLARE vIsValenciaPath BOOLEAN DEFAULT FALSE; -SELECT `order` +SELECT `order` INTO PACKING_ORDER FROM state WHERE code = 'PACKING'; @@ -43780,7 +44274,7 @@ SELECT t.routeFk, t.warehouseFk, IFNULL(ts.productionOrder,0) LEFT JOIN ticketState ts on ts.ticket = t.id WHERE t.id = vTicketId; -SELECT (ag.`name` = 'VN_VALENCIA') +SELECT (ag.`name` = 'VN_VALENCIA') INTO vIsValenciaPath FROM vn2008.Rutas r JOIN vn2008.Agencias a on a.Id_Agencia = r.Id_Agencia @@ -43794,7 +44288,7 @@ IF vIsValenciaPath THEN -- Rutas Valencia FROM expedition e JOIN ticket t ON t.id = e.ticketFk WHERE t.routeFk = vMyPath; - + SELECT MAX(ts.productionOrder), MIN(ts.productionOrder) INTO vRestTicketsMaxOrder, vRestTicketsMinOrder FROM ticket t @@ -43803,7 +44297,7 @@ IF vIsValenciaPath THEN -- Rutas Valencia AND t.warehouseFk = vMyWarehouse AND t.id != vTicketid; - SELECT COUNT(*) + SELECT COUNT(*) INTO vRestTicketsPacking FROM ticket t LEFT JOIN ticketState ts on t.id = ts.ticket @@ -43835,8 +44329,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `ticketSplitCounter` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -43844,6 +44336,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `ticketSplitCounter`(vTicketFk INT) RETURNS varchar(15) CHARSET utf8 READS SQL DATA @@ -43858,17 +44352,15 @@ BEGIN LEFT JOIN vn2008.movement_label l ON l.Id_Movimiento = s.id WHERE ticketFk = vTicketFk ) sub; - + RETURN IFNULL(vSplitCounter,'--'); - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `ticketTotalVolume` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -43876,6 +44368,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `ticketTotalVolume`(vTicketId INT) RETURNS decimal(10,3) READS SQL DATA @@ -43895,8 +44389,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `ticketTotalVolumeBoxes` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -43904,26 +44396,28 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `ticketTotalVolumeBoxes`(vTicketId INT) RETURNS decimal(10,1) DETERMINISTIC BEGIN -/* +/* * Devuelve el volumen estimado del ticket sumado, en cajas * * vTicketId Numero de ticket - * + * */ DECLARE vVolumeBoxM3 DOUBLE; DECLARE vTicketTotalVolumeBoxes DECIMAL(10,1); DECLARE vVnBoxId VARCHAR(10) DEFAULT '94'; - + SELECT volume / 1000000 INTO vVolumeBoxM3 FROM packaging WHERE id = vVnBoxId; - + SET vTicketTotalVolumeBoxes = ticketTotalVolume(vTicketId) / vVolumeBoxM3; - + RETURN vTicketTotalVolumeBoxes; END ;; @@ -43932,8 +44426,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `ticketWarehouseGet` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -43941,6 +44433,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `ticketWarehouseGet`(vTicketFk INT) RETURNS int(11) READS SQL DATA @@ -43948,7 +44442,7 @@ BEGIN DECLARE vWarehouseFk INT; SELECT warehouseFk INTO vWarehouseFk - FROM ticket + FROM ticket WHERE id = vTicketFk; RETURN vWarehouseFk; @@ -43958,8 +44452,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `ticket_CC_volume` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -43967,22 +44459,24 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `ticket_CC_volume`(vTicketFk INT) RETURNS decimal(10,1) READS SQL DATA BEGIN - + DECLARE vCC DECIMAL(10,1); SELECT sum(sv.volume * IF(i.itemPackingTypeFk = 'H', vc.dutchCompressionRate, 1)) / (p.volume / 1000000) INTO vCC - FROM vn.saleVolume sv - JOIN vn.sale s ON s.id = sv.saleFk - JOIN vn.item i ON i.id = s.itemFk + FROM vn.saleVolume sv + JOIN vn.sale s ON s.id = sv.saleFk + JOIN vn.item i ON i.id = s.itemFk JOIN vn.packaging p ON p.id = 'CC' - JOIN vn.volumeConfig vc + JOIN vn.volumeConfig vc WHERE sv.ticketFk = vTicketFk; - + RETURN vCC; END ;; @@ -43991,8 +44485,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `ticket_get` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -44000,48 +44492,50 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `ticket_get`(vParamFk INT) RETURNS int(11) READS SQL DATA proc:BEGIN - + /* Devuelve el número de ticket o collection consultando en varias tablas posibles - * + * * @param vParamFk Número a validar * @return vValidFk Identificador validado */ - + DECLARE vValidFk INT; -- Tabla vn.saleGroup SELECT s.ticketFk INTO vValidFk FROM vn.sale s JOIN vn.saleGroupDetail sgd ON sgd.saleFk = s.id - JOIN vn.saleGroup sg ON sg.id = sgd.saleGroupFk + JOIN vn.saleGroup sg ON sg.id = sgd.saleGroupFk WHERE sg.id = vParamFk AND sg.created > TIMESTAMPADD(WEEK,-1, util.VN_CURDATE()) LIMIT 1; - + IF vValidFk THEN - + RETURN vValidFk; - + LEAVE proc; - + END IF; -- Tabla vn.collection SELECT c.id INTO vValidFk - FROM vn.collection c + FROM vn.collection c WHERE c.id = vParamFk AND c.created > TIMESTAMPADD(WEEK,-1, util.VN_CURDATE()); - + IF vValidFk THEN - + RETURN vValidFk; - + LEAVE proc; - + END IF; -- Tabla vn.ticket @@ -44049,25 +44543,23 @@ proc:BEGIN FROM vn.ticket t WHERE t.id = vParamFk AND t.shipped > TIMESTAMPADD(WEEK,-1, util.VN_CURDATE()); - + IF vValidFk THEN - + RETURN vValidFk; - + LEAVE proc; - + END IF; RETURN NULL; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `ticket_getFreightCost` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -44075,6 +44567,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `ticket_getFreightCost`(vTicketFk INT) RETURNS decimal(10,2) DETERMINISTIC @@ -44085,8 +44579,8 @@ BEGIN * @vTicketFk Id del ticket a calcular */ DECLARE deliveryPrice DECIMAL (10,2); - - IF (SELECT isVolumetric FROM ticket t JOIN zone z ON t.zoneFk = z.id + + IF (SELECT isVolumetric FROM ticket t JOIN zone z ON t.zoneFk = z.id WHERE t.id = vTicketFk) THEN SELECT SUM(sv.freight) INTO deliveryPrice FROM vn.saleVolume sv @@ -44097,7 +44591,7 @@ BEGIN LEFT JOIN expedition e ON e.ticketFk = t.id JOIN expeditionBoxVol ebv ON ebv.boxFk = e.freightItemFk WHERE t.id = vTicketFk; - + END IF; RETURN deliveryPrice; END ;; @@ -44106,8 +44600,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `ticket_getWeight` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -44115,22 +44607,24 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `ticket_getWeight`(vTicketFk INT) RETURNS decimal(10,3) READS SQL DATA BEGIN /** * Devuelve el peso total del ticket - * + * * @return Total peso */ - + DECLARE vWeight DECIMAL(10,3); SELECT sum(weight) INTO vWeight FROM saleVolume WHERE ticketFk = vTicketFk; - + RETURN vWeight; END ;; @@ -44139,8 +44633,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `ticket_getWithParameters` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -44148,6 +44640,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `ticket_getWithParameters`(vClientFk INT, vWarehouseFk INT, vShipped DATE, vAddressFk INT, vCompanyFk INT, vAgencyModeFk INT) RETURNS int(11) DETERMINISTIC @@ -44161,10 +44655,10 @@ BEGIN * @param vAddressFk Consignatario * @param vCompanyFk Empresa * @param vAgencyModeFk agencia - */ - + */ + DECLARE vTicket INT; - + SELECT t.id INTO vTicket FROM vn.ticket t WHERE (t.clientFk <=> vClientFk OR vClientFk IS NULL) @@ -44174,7 +44668,7 @@ BEGIN AND (t.companyFk <=> vCompanyFk OR vCompanyFk IS NULL) AND (t.agencyModeFk <=> vAgencyModeFk OR vAgencyModeFk IS NULL) LIMIT 1; - + IF vTicket IS NULL THEN CALL vn.ticket_add( vClientFk, @@ -44190,7 +44684,7 @@ BEGIN vTicket ); END IF; - + RETURN vTicket; END ;; DELIMITER ; @@ -44198,8 +44692,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `ticket_HasUbication` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -44207,19 +44699,21 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `ticket_HasUbication`(vTicketFk INT) RETURNS tinyint(1) READS SQL DATA BEGIN - + DECLARE hasUbication BOOL; SELECT COUNT(*) INTO hasUbication FROM vn.ticket t JOIN vn.routesMonitor rm ON rm.routeFk = t.routeFk - WHERE rm.beachFk + WHERE rm.beachFk AND t.id = vTicketFk; - + RETURN hasUbication; END ;; @@ -44228,8 +44722,41 @@ 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 `ticket_isOutClosureZone` */; +/*!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 = utf8mb4 */ ; +/*!50003 SET character_set_results = utf8mb4 */ ; +/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; +DELIMITER ;; +CREATE DEFINER=`root`@`localhost` FUNCTION `ticket_isOutClosureZone`(vSelf INT) RETURNS tinyint(1) + DETERMINISTIC +BEGIN +/** + * Devuelve true/false si la hora actual supera la hora del cierre del ticket más el tiempo configurado en packingDelay + * + * @param vSelf Ticket id + * @return true o false + */ + DECLARE vIsTicketInTime BOOL; + + SELECT TIMEDIFF(util.VN_CURTIME(), zc.hour + INTERVAL tc.packingDelay HOUR) > 0 INTO vIsTicketInTime + FROM vn.ticket t + JOIN vn.zoneClosure zc ON zc.zoneFk = t.zoneFk + LEFT JOIN vn.ticketConfig tc ON TRUE + WHERE t.id = vSelf + AND zc.dated = util.VN_CURDATE(); + + RETURN vIsTicketInTime; +END ;; +DELIMITER ; +/*!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 `till_new` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -44237,6 +44764,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!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 @@ -44320,8 +44849,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `timeWorkerControl_getDirection` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -44329,12 +44856,14 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `timeWorkerControl_getDirection`(vUserFk INT, vTimed DATETIME) RETURNS varchar(6) CHARSET utf8 COLLATE utf8_unicode_ci READS SQL DATA BEGIN /** - * Verifica la dirección de la fichada + * Verifica la dirección de la fichada * @param vUserFk Identificador del trabajador * @param vTimed Hora de la fichada * @return Retorna sentido de la fichada 'in, out, middle' @@ -44347,40 +44876,40 @@ BEGIN DECLARE vDayStayMax INT; DECLARE vTimedSeconds INT; DECLARE vLastTimeIn INT; - + SELECT UNIX_TIMESTAMP(vTimed) INTO vTimedSeconds; - + SELECT dayStayMax INTO vDayStayMax FROM vn.workerTimeControlParams; SELECT timed, direction INTO vNext,vNextDirection - FROM vn.workerTimeControl - WHERE userFk = vUserFk + FROM vn.workerTimeControl + WHERE userFk = vUserFk AND direction IN ('in','out') AND timed > vTimed ORDER BY timed ASC LIMIT 1; - + SELECT timed, direction INTO vPrevious, vPreviousDirection - FROM vn.workerTimeControl - WHERE userFk = vUserFk + FROM vn.workerTimeControl + WHERE userFk = vUserFk AND direction IN ('in','out') AND timed < vTimed ORDER BY timed DESC - LIMIT 1; - - IF (vTimedSeconds - UNIX_TIMESTAMP(vPrevious) + UNIX_TIMESTAMP(vNext) - vTimedSeconds)<= vDayStayMax AND vPreviousDirection = 'in' AND vNextDirection = 'out' THEN + LIMIT 1; + + IF (vTimedSeconds - UNIX_TIMESTAMP(vPrevious) + UNIX_TIMESTAMP(vNext) - vTimedSeconds)<= vDayStayMax AND vPreviousDirection = 'in' AND vNextDirection = 'out' THEN RETURN 'middle'; END IF; - - + + IF (vTimedSeconds> UNIX_TIMESTAMP(vPrevious)) THEN - IF vPreviousDirection = 'in' THEN + IF vPreviousDirection = 'in' THEN RETURN 'out'; ELSE SELECT UNIX_TIMESTAMP(MAX(timed)) INTO vLastTimeIn - FROM vn.workerTimeControl - WHERE userFk = vUserFk + FROM vn.workerTimeControl + WHERE userFk = vUserFk AND direction ='in' AND timed < vPrevious; IF vTimedSeconds - vLastTimeIn <= vDayStayMax THEN @@ -44396,8 +44925,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `time_getSalesYear` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -44405,6 +44932,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `time_getSalesYear`(vMonth INT, vYear INT) RETURNS int(11) DETERMINISTIC @@ -44421,8 +44950,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `travel_getForLogiflora` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -44430,15 +44957,17 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `travel_getForLogiflora`(vLanded DATE, vWarehouseFk INT) RETURNS int(11) READS SQL DATA BEGIN - + /** * Devuelve un número de travel para compras de Logiflora a partir de la fecha de llegada y del almacén. * Si no existe lo genera. - * + * * @param vLanded Fecha de llegada al almacén * @param vWarehouseFk Identificador de vn.warehouse */ @@ -44446,8 +44975,8 @@ BEGIN DECLARE vTravelFk INT; IF vLanded THEN - - SELECT IFNULL(MAX(tr.id),0) INTO vTravelFk + + SELECT IFNULL(MAX(tr.id),0) INTO vTravelFk FROM vn.travel tr JOIN vn.warehouse wIn ON wIn.id = tr.warehouseInFk JOIN vn.warehouse wOut ON wOut.id = tr.warehouseOutFk @@ -44458,14 +44987,14 @@ BEGIN AND landed = vLanded; IF NOT vTravelFk THEN - + INSERT INTO vn.travel(landed, shipped, warehouseInFk, warehouseOutFk, agencyModeFk) - SELECT vLanded, util.VN_CURDATE(), vWarehouseFk, wOut.id, am.id - FROM vn.warehouse wOut + 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'; - - SELECT MAX(tr.id) INTO vTravelFk + + SELECT MAX(tr.id) INTO vTravelFk FROM vn.travel tr JOIN vn.warehouse wIn ON wIn.id = tr.warehouseInFk JOIN vn.warehouse wOut ON wOut.id = tr.warehouseOutFk @@ -44473,19 +45002,17 @@ BEGIN AND wOut.name = 'Holanda' AND landed = vLanded; END IF; - + END IF; - + RETURN vTravelFk; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `validationCode` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -44493,6 +45020,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `validationCode`(vString VARCHAR(255)) RETURNS int(11) DETERMINISTIC @@ -44504,29 +45033,27 @@ BEGIN DECLARE vChar INT; SET vLength = length(vString); - + WHILE vLength > 0 DO - + SET vChar = MID(vString,vLength,1); - + SET vSeed = vSeed + ASCII(vChar); - + SET vLength = vLength - 1; - + END WHILE; SET vCode = FLOOR(SQRT(vSeed)*1000000) mod 1000; RETURN vCode; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `validationCode_beta` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -44534,6 +45061,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `validationCode_beta`(vString VARCHAR(255)) RETURNS int(11) DETERMINISTIC @@ -44545,29 +45074,27 @@ BEGIN DECLARE vChar INT; SET vLength = length(vString); - + WHILE vLength > 0 DO - + SET vChar = MID(vString,vLength,1); - + SET vSeed = vSeed + ASCII(vChar); - + SET vLength = vLength - 1; - + END WHILE; SET vCode = FLOOR(SQRT(vSeed)*1000000) mod 1000; RETURN vCode; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `workerIsBoss` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -44575,6 +45102,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `workerIsBoss`(vUserId INT) RETURNS int(11) DETERMINISTIC @@ -44625,8 +45154,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `workerMachinery_isRegistered` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -44634,22 +45161,24 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `workerMachinery_isRegistered`(vWorkerFk VARCHAR(10)) RETURNS tinyint(1) READS SQL DATA BEGIN /** * Comprueba si existen registros en las últimas horas (maxHours de machineWorkerConfig) del trabajador vWorkerFk y si tiene a nulo la hora outTimed (indica la hora que deja el vehículo) - * + * * @param vWorkerFk id del trabajador * @return Devuelve TRUE/FALSE en caso de que haya o no registros */ - - IF (SELECT COUNT(*) + + IF (SELECT COUNT(*) FROM machineWorker m WHERE m.workerFk = vWorkerFk - AND m.inTimed >= TIMESTAMPADD(HOUR , -(SELECT maxHours from machineWorkerConfig), util.VN_NOW()) AND ISNULL(m.outTimed)) - THEN + AND m.inTimed >= TIMESTAMPADD(HOUR , -(SELECT maxHours from machineWorkerConfig), util.VN_NOW()) AND ISNULL(m.outTimed)) + THEN RETURN TRUE; ELSE RETURN FALSE; @@ -44661,8 +45190,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `workerNigthlyHours_calculate` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -44670,6 +45197,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `workerNigthlyHours_calculate`(vTimeIn DATETIME, vTimeOut DATETIME) RETURNS decimal(5,2) READS SQL DATA @@ -44681,15 +45210,15 @@ BEGIN * @param vTimeOut * @return vNigthlyHours */ - DECLARE vNigthlyHours DECIMAL(5,2); + DECLARE vNigthlyHours DECIMAL(5,2); DECLARE vSecondsPerHour INT(4) DEFAULT 3600; - + SELECT GREATEST(0, TIMESTAMPDIFF(SECOND, - IF(TIME(vTimeIn) BETWEEN endNightlyHours AND startNightlyHours, - CONCAT(DATE(vTimeIn), ' ', startNightlyHours), + IF(TIME(vTimeIn) BETWEEN endNightlyHours AND startNightlyHours, + CONCAT(DATE(vTimeIn), ' ', startNightlyHours), vTimeIn), - IF(TIME(vTimeOut) BETWEEN endNightlyHours AND startNightlyHours, - CONCAT(DATE(vTimeOut), ' ', endNightlyHours), + IF(TIME(vTimeOut) BETWEEN endNightlyHours AND startNightlyHours, + CONCAT(DATE(vTimeOut), ' ', endNightlyHours), vTimeOut))) / vSecondsPerHour INTO vNigthlyHours FROM vn.workerTimeControlConfig; @@ -44700,8 +45229,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `workerTimeControl_add` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -44709,6 +45236,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!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) DETERMINISTIC @@ -44721,47 +45250,47 @@ BEGIN SELECT dayStayMax INTO vDayStayMax FROM workerTimeControlParams; - + SELECT timeWorkerControl_getDirection(vUserFk,vTimed) INTO vDirection; IF vDirection = 'out' THEN - + SELECT MAX(timed) INTO vLastIn - FROM workerTimeControl - WHERE userFk = vUserFk + FROM workerTimeControl + WHERE userFk = vUserFk AND direction = 'in' AND timed < vTimed; - + UPDATE workerTimeControl wtc SET wtc.direction = 'middle' WHERE userFk = vUserFk AND direction = 'out' AND timed BETWEEN vLastIn AND vTimed; - + ELSE IF vDirection = 'in' THEN - - SELECT COUNT(*) INTO vHasDirectionOut + + SELECT COUNT(*) INTO vHasDirectionOut FROM workerTimeControl wtc - WHERE userFk = vUserFk + WHERE userFk = vUserFk AND direction = 'out' - AND timed BETWEEN vTimed AND TIMESTAMPADD(SECOND, 50400, vTimed); + AND timed BETWEEN vTimed AND TIMESTAMPADD(SECOND, 50400, vTimed); UPDATE workerTimeControl wtc SET wtc.direction = IF (vHasDirectionOut,'middle','out') WHERE userFk = vUserFk AND direction = 'in' - AND timed BETWEEN vTimed AND TIMESTAMPADD(SECOND, 50400, vTimed); + AND timed BETWEEN vTimed AND TIMESTAMPADD(SECOND, 50400, vTimed); END IF; END IF; - + INSERT INTO workerTimeControl(userFk, timed, warehouseFk, direction, manual) VALUES(vUserFk, vTimed, vWarehouseFk, vDirection, vIsManual); - + SET vLastInsertedId = LAST_INSERT_ID(); - + CALL workerTimeControlSOWP(vUserFk, vTimed); - + RETURN vLastInsertedId; END ;; DELIMITER ; @@ -44769,8 +45298,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `workerTimeControl_addDirection` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -44778,6 +45305,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!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) DETERMINISTIC @@ -44790,47 +45319,47 @@ BEGIN SELECT dayStayMax INTO vDayStayMax FROM workerTimeControlParams; - + SELECT timeWorkerControl_getDirection(vUserFk,vTimed) INTO vDirection; IF vDirection = 'out' THEN - + SELECT MAX(timed) INTO vLastIn - FROM workerTimeControl - WHERE userFk = vUserFk + FROM workerTimeControl + WHERE userFk = vUserFk AND direction = 'in' AND timed < vTimed; - + UPDATE workerTimeControl wtc SET wtc.direction = 'middle' WHERE userFk = vUserFk AND direction = 'out' AND timed BETWEEN vLastIn AND vTimed; - + ELSE IF vDirection = 'in' THEN - - SELECT COUNT(*) INTO vHasDirectionOut + + SELECT COUNT(*) INTO vHasDirectionOut FROM workerTimeControl wtc - WHERE userFk = vUserFk + WHERE userFk = vUserFk AND direction = 'out' - AND timed BETWEEN vTimed AND TIMESTAMPADD(SECOND, 50400, vTimed); + AND timed BETWEEN vTimed AND TIMESTAMPADD(SECOND, 50400, vTimed); UPDATE workerTimeControl wtc SET wtc.direction = IF (vHasDirectionOut,'middle','out') WHERE userFk = vUserFk AND direction = 'in' - AND timed BETWEEN vTimed AND TIMESTAMPADD(SECOND, 50400, vTimed); + AND timed BETWEEN vTimed AND TIMESTAMPADD(SECOND, 50400, vTimed); END IF; END IF; - + INSERT INTO workerTimeControl(userFk, timed, warehouseFk, direction, manual) VALUES(vUserFk, vTimed, vWarehouseFk, vDirection, vIsManual); - + SET vLastInsertedId = LAST_INSERT_ID(); - + CALL workerTimeControlSOWP(vUserFk, vTimed); - + RETURN vLastInsertedId; END ;; DELIMITER ; @@ -44838,8 +45367,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `worker_isWorking` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -44847,6 +45374,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `worker_isWorking`(vWorkerFk INT) RETURNS tinyint(1) READS SQL DATA @@ -44856,17 +45385,17 @@ BEGIN * @return Devuelve TRUE en caso de que este trabajando. Si se encuentra en un descanso devolverá FALSE */ DECLARE vLastIn DATETIME ; - + SELECT MAX(timed) INTO vLastIn - FROM vn.workerTimeControl + FROM vn.workerTimeControl WHERE userFk = vWorkerFk AND direction = 'in'; - IF (SELECT MOD(COUNT(*),2) - FROM vn.workerTimeControl - WHERE userFk = vWorkerFk AND + IF (SELECT MOD(COUNT(*),2) + FROM vn.workerTimeControl + WHERE userFk = vWorkerFk AND timed >= vLastIn - ) THEN + ) THEN RETURN TRUE; ELSE RETURN FALSE; @@ -44877,8 +45406,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `xdiario_new` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -44886,6 +45413,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!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, @@ -44933,8 +45462,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP FUNCTION IF EXISTS `zoneGeo_new` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -44942,6 +45469,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` FUNCTION `zoneGeo_new`(vType VARCHAR(255), vName VARCHAR(255), vParentFk INT) RETURNS int(11) NO SQL @@ -44961,7 +45490,7 @@ BEGIN SET `type` = vType, `name` = vName, parentFk = vParentFk; - + SET vSelf = LAST_INSERT_ID(); UPDATE zoneGeoRecalc SET isChanged = TRUE; @@ -44973,8 +45502,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `addNoteFromDelivery` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -44982,10 +45509,12 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `addNoteFromDelivery`(idTicket INT,nota TEXT) BEGIN - + DECLARE observationTypeFk INT DEFAULT 3; /*3 = REPARTIDOR*/ INSERT INTO ticketObservation(ticketFk,observationTypeFk,description) @@ -44999,8 +45528,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `addressTaxArea` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -45008,29 +45535,31 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `addressTaxArea`() READS SQL DATA BEGIN /** - * Devuelve el taxArea para un conjunto de Consignatarios y empresas, + * Devuelve el taxArea para un conjunto de Consignatarios y empresas, * * @table tmp.addressCompany(addressFk, companyFk) valores a calcular * @return tmp.addressTaxArea(addressFk,companyFk) */ DECLARE vSpainCountryCode INT DEFAULT 1; - + DROP TEMPORARY TABLE IF EXISTS tmp.addressTaxArea; CREATE TEMPORARY TABLE tmp.addressTaxArea (PRIMARY KEY (addressFk, companyFk)) ENGINE = MEMORY - SELECT CASE - WHEN (NOT cClient.isUeeMember OR NOT cSupplier.isUeeMember) AND s.countryFk != c.countryFk THEN + SELECT CASE + WHEN (NOT cClient.isUeeMember OR NOT cSupplier.isUeeMember) AND s.countryFk != c.countryFk THEN 'WORLD' - WHEN cClient.isUeeMember AND cSupplier.isUeeMember AND c.countryFk != s.countryFk AND c.isVies THEN + WHEN cClient.isUeeMember AND cSupplier.isUeeMember AND c.countryFk != s.countryFk AND c.isVies THEN 'CEE' - WHEN a.isEqualizated AND c.countryFk = vSpainCountryCode THEN + WHEN a.isEqualizated AND c.countryFk = vSpainCountryCode THEN 'EQU' ELSE 'NATIONAL' @@ -45047,8 +45576,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `agencyHourGetFirstShipped` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -45056,6 +45583,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `agencyHourGetFirstShipped`(vAgencyMode INT, vAddress INT, vWarehouse INT) BEGIN @@ -45067,27 +45596,27 @@ BEGIN * @param vAddress id de la direccion * @param vWarehouse id del warehouse * @return vShipped la primera fecha disponible y vLanded la fecha de llegada/recojida -*/ +*/ DECLARE vAgency INT; DECLARE vShipped DATE; DECLARE vLanded DATE DEFAULT util.VN_CURDATE(); SELECT agencyFk INTO vAgency FROM agencyMode WHERE id= vAgencyMode; l: LOOP - + CALL agencyHourGetShipped(vLanded,vAddress,vAgency); - SELECT shipped INTO vShipped + SELECT shipped INTO vShipped FROM tmp.agencyHourGetShipped WHERE warehouseFk = vWarehouse LIMIT 1; - + IF vShipped THEN LEAVE l; END IF; - + SET vLanded = DATE_ADD(vLanded, INTERVAL +1 DAY); - + END LOOP; - + SELECT vShipped,vLanded; END ;; DELIMITER ; @@ -45095,8 +45624,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `agencyHourGetLanded` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -45104,6 +45631,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `agencyHourGetLanded`(vDated DATE, vAddress INT, vAgency INT, vWarehouse INT) BEGIN @@ -45138,15 +45667,13 @@ BEGIN LIMIT 1 ) t WHERE IF(vDated = util.VN_CURDATE(), t.maxHour > HOUR(util.VN_NOW()), TRUE) AND t.substractDay < 225; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `agencyHourGetWarehouse` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -45154,6 +45681,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `agencyHourGetWarehouse`(vAddress INT, vDate DATE, vWarehouse INT) BEGIN @@ -45161,14 +45690,14 @@ BEGIN * DEPRECATED usar zoneGetWarehouse * Devuelve el listado de agencias disponibles para la fecha, * dirección y warehouuse pasadas - * + * * @param vAddress no puede ser NULL * @param vWarehouse warehouse donde comprobaremos las agencias y fecha * @param vDate Fecha de recogida * @table agencyModeWarehouseList Listado de agencias disponibles */ DECLARE vAgency INT; - DECLARE vDone BOOL DEFAULT FALSE; + DECLARE vDone BOOL DEFAULT FALSE; DECLARE vCur CURSOR FOR SELECT DISTINCT a.id FROM agency a @@ -45192,13 +45721,13 @@ BEGIN PRIMARY KEY(id) ) ENGINE = MEMORY; - + OPEN vCur; FETCH vCur INTO vAgency; WHILE NOT vDone DO - + INSERT INTO tmp.agencyModeWarehouseList SELECT am.id, am.name, am.description,am.deliveryMethodFk, TIMESTAMPADD(DAY, -ah.substractDay, vDate), w.name FROM agencyHour ah @@ -45227,7 +45756,7 @@ BEGIN END WHILE; CLOSE vCur; - + SELECT * FROM tmp.agencyModeWarehouseList; DROP TEMPORARY TABLE tmp.agencyModeWarehouseList; END ;; @@ -45236,8 +45765,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `agencyHourListGetShipped` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -45245,6 +45772,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `agencyHourListGetShipped`(vDate DATE, vAddress INT, vAgency INT) BEGIN @@ -45253,17 +45782,15 @@ BEGIN CALL vn.agencyHourGetShipped(vDate, vAddress, vAgency); SELECT * FROM tmp.agencyHourGetShipped; - + DROP TEMPORARY TABLE IF EXISTS tmp.agencyHourGetShipped; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `available_calc` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -45271,6 +45798,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `available_calc`( vDate DATE, @@ -45293,7 +45822,7 @@ BEGIN DECLARE cWarehouses CURSOR FOR SELECT warehouseFk, shipped FROM tmp.zoneGetShipped; - + DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE; @@ -45302,7 +45831,7 @@ BEGIN CALL vn.zone_getShipped (vDate, vAddress, vAgencyMode, FALSE); DROP TEMPORARY TABLE IF EXISTS tmp.availableCalc; - CREATE TEMPORARY TABLE tmp.availableCalc( + CREATE TEMPORARY TABLE tmp.availableCalc( calcFk INT UNSIGNED, PRIMARY KEY (calcFk) ) @@ -45313,7 +45842,7 @@ BEGIN l: LOOP SET vDone = FALSE; FETCH cWarehouses INTO vWarehouse, vShipment; - + IF vDone THEN LEAVE l; END IF; @@ -45332,8 +45861,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `bankEntity_checkBic` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -45341,12 +45868,14 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `bankEntity_checkBic`(vBic VARCHAR(255)) BEGIN /** * If the bic length is Incorrect throw exception - * + * * @param vBic bic code */ @@ -45354,7 +45883,7 @@ BEGIN SELECT bicLength INTO vConfigBicLenght FROM vn.bankEntityConfig bec; - + IF LENGTH(vBic) <> vConfigBicLenght THEN CALL util.throw(CONCAT('bic must be of length ', vConfigBicLenght )); END IF; @@ -45364,8 +45893,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `bankPolicy_notifyExpired` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -45373,6 +45900,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `bankPolicy_notifyExpired`() BEGIN @@ -45381,14 +45910,14 @@ BEGIN * Manda correo cuando caduca un seguro * de los leasing * -*/ +*/ INSERT INTO mail (receiver,replyTo,subject,body) SELECT 'administracion@verdnatura.es' receiver, 'noreply@verdnatura.es' replyTo, CONCAT('El seguro de la poliza ',b.id,' ',b.bank,' ha finalizado.') subject, CONCAT('El seguro de la poliza ',b.id,' ',b.bank,' ha finalizado.') body - FROM vn.bankPolicy bp - LEFT JOIN vn.supplier s + FROM vn.bankPolicy bp + LEFT JOIN vn.supplier s ON s.id = bp.supplierFk LEFT JOIN vn.bank b ON b.id = bp.bankFk @@ -45399,8 +45928,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `buyUltimate` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -45408,6 +45935,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `buyUltimate`(vWarehouseFk SMALLINT, vDated DATE) BEGIN @@ -45449,8 +45978,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `buyUltimateFromInterval` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -45458,6 +45985,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `buyUltimateFromInterval`(vWarehouseFk SMALLINT, vStarted DATE, vEnded DATE) BEGIN @@ -45592,8 +46121,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `buy_afterUpsert` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -45601,6 +46128,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `buy_afterUpsert`(vSelf INT) BEGIN @@ -45619,19 +46148,19 @@ BEGIN DECLARE vIsFeedStock BOOL; DECLARE vWeight DECIMAL(10,2); DECLARE vPacking INT; - - SELECT b.entryFk, - b.itemFk, - i.packingOut, - ic.merchandise, + + SELECT b.entryFk, + b.itemFk, + i.packingOut, + ic.merchandise, vc.standardFlowerBox, b.weight, - b.packing - INTO - vEntryFk, - vItemFk, - vPackingOut, - vIsMerchandise, + b.packing + INTO + vEntryFk, + vItemFk, + vPackingOut, + vIsMerchandise, vStandardFlowerBox, vWeight, vPacking @@ -45639,7 +46168,7 @@ BEGIN LEFT JOIN item i ON i.id = b.itemFk LEFT JOIN itemType it ON it.id = i.typeFk LEFT JOIN itemCategory ic ON ic.id = it.categoryFk - LEFT JOIN packaging p ON p.id = b.packageFk AND NOT p.isBox + LEFT JOIN packaging p ON p.id = b.packageFk AND NOT p.isBox JOIN volumeConfig vc ON TRUE WHERE b.id = vSelf; @@ -45656,7 +46185,7 @@ BEGIN warehouseFk = vWarehouse, cm3 = buy_getUnitVolume(vSelf), cm3Delivery = IFNULL((vStandardFlowerBox * 1000) / vPackingOut, buy_getUnitVolume(vSelf)); - + IF vWeight AND vPacking THEN UPDATE itemCost SET grams = vWeight * 1000 / vPacking @@ -45677,15 +46206,13 @@ BEGIN WHERE b.id = vSelf; END IF; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `buy_checkGrouping` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -45693,6 +46220,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `buy_checkGrouping`(vGrouping INT) BEGIN @@ -45711,8 +46240,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `buy_getSplit` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -45720,12 +46247,14 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `buy_getSplit`(vSelf INT, vDated DATE) BEGIN /** * Devuelve las ventas de una compra - * + * * @param vSelf Identificador de vn.buy */ DECLARE vItemFk INT; @@ -45821,11 +46350,11 @@ BEGIN -- Devuelve los splits creados SELECT CONCAT(sp.counter,'/',sp.labels) labels, COALESCE(sfc.nickname, sfa.nickname, a.nickname) destination, - s.itemFk, - i.longName, - i.`size`, - vn.ticketSplitCounter(t.id) counter, - IF(sfa.id OR sfc.id, + s.itemFk, + i.longName, + i.`size`, + vn.ticketSplitCounter(t.id) counter, + IF(sfa.id OR sfc.id, a.nickname, CONCAT(a.id, ' ', p.`name`,' (', c.`code`,')')) destination2 FROM tmp.split sp @@ -45850,8 +46379,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `buy_getVolume` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -45859,6 +46386,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `buy_getVolume`() BEGIN @@ -45871,12 +46400,12 @@ BEGIN item_getVolume(b.itemFk, b.packageFk)) / vc.trolleyM3 / 1000000 ,1) AS DECIMAL(10,2)) carros , CAST(ROUND(SUM(GREATEST(b.stickers ,b.quantity /b.packing ) * item_getVolume(b.itemFk, b.packageFk)) / vc.palletM3 / 1000000,1) AS DECIMAL(10,2)) espais - FROM buy b + FROM buy b JOIN tmp.buy tb ON tb.buyFk = b.id JOIN volumeConfig vc JOIN item i ON i.id = b.itemFk JOIN itemType it ON it.id = i.typeFk - LEFT JOIN temperature t ON t.code = it.temperatureFk + LEFT JOIN temperature t ON t.code = it.temperatureFk GROUP BY Temp; END ;; DELIMITER ; @@ -45884,8 +46413,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `buy_getVolumeByAgency` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -45893,32 +46420,32 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `buy_getVolumeByAgency`(vDated DATE, vAgencyFk INT) BEGIN - + DROP TEMPORARY TABLE IF EXISTS tmp.buy; CREATE TEMPORARY TABLE tmp.buy (buyFk INT NOT NULL, PRIMARY KEY (buyFk)) ENGINE = MEMORY; - INSERT INTO tmp.buy + INSERT INTO tmp.buy SELECT b.id - FROM buy b - JOIN entry e ON e.id = b.entryFk - JOIN travel t ON t.id = e.travelFk + FROM buy b + JOIN entry e ON e.id = b.entryFk + JOIN travel t ON t.id = e.travelFk WHERE t.landed = vDated AND t.agencyModeFk IN (0, vAgencyFk); CALL buy_getVolume(); DROP TEMPORARY TABLE tmp.buy; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `buy_getVolumeByEntry` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -45926,30 +46453,30 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `buy_getVolumeByEntry`(vEntryFk INT) BEGIN - + DROP TEMPORARY TABLE IF EXISTS tmp.buy; CREATE TEMPORARY TABLE tmp.buy (buyFk INT NOT NULL, PRIMARY KEY (buyFk)) ENGINE = MEMORY; - - INSERT INTO tmp.buy + + INSERT INTO tmp.buy SELECT b.id - FROM buy b - JOIN entry e ON e.id = b.entryFk + FROM buy b + JOIN entry e ON e.id = b.entryFk WHERE e.id = vEntryFk; CALL buy_getVolume(); DROP TEMPORARY TABLE tmp.buy; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `buy_recalcPrices` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -45957,6 +46484,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `buy_recalcPrices`() BEGIN @@ -46013,8 +46542,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `buy_recalcPricesByAwb` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -46022,6 +46549,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `buy_recalcPricesByAwb`(IN awbFk varchar(18)) BEGIN @@ -46029,12 +46558,12 @@ BEGIN * inserta en tmp.buyRecalc las compras de un awb * * @param awbFk - */ + */ DROP TEMPORARY TABLE IF EXISTS tmp.buyRecalc; CREATE TEMPORARY TABLE tmp.buyRecalc SELECT b.id - FROM buy b + FROM buy b JOIN entry e ON e.id = b.entryFk JOIN duaEntry de ON de.entryFk = e.id JOIN dua d ON d.id = de.duaFk @@ -46050,8 +46579,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `buy_recalcPricesByBuy` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -46059,6 +46586,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `buy_recalcPricesByBuy`(IN vBuyFk INT(11)) BEGIN @@ -46066,7 +46595,7 @@ BEGIN * Recalcula los precios de una compra * * @param vBuyFk - */ + */ DROP TEMPORARY TABLE IF EXISTS tmp.buyRecalc; CREATE TEMPORARY TABLE tmp.buyRecalc @@ -46081,8 +46610,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `buy_recalcPricesByEntry` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -46090,6 +46617,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `buy_recalcPricesByEntry`(IN vEntryFk INT(11)) BEGIN @@ -46097,12 +46626,12 @@ BEGIN * Recalcula los precios de una entrada * * @param vEntryFk - */ + */ DROP TEMPORARY TABLE IF EXISTS tmp.buyRecalc; CREATE TEMPORARY TABLE tmp.buyRecalc SELECT b.id - FROM buy b + FROM buy b WHERE b.entryFk = vEntryFk; CALL buy_recalcPrices(); @@ -46114,8 +46643,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `buy_scan` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -46123,6 +46650,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `buy_scan`(vBarcode VARCHAR(512)) BEGIN @@ -46142,12 +46671,12 @@ BEGIN LIMIT 0; INSERT INTO tBuy(buyFk) - SELECT b.id + SELECT b.id FROM buy b JOIN tmp.ekt t ON t.ektFk = b.ektFk JOIN vn.entry en ON en.id = b.entryFk JOIN vn.travel tr ON tr.id = en.travelFk - JOIN vn.warehouse w ON w.id = tr.warehouseInFk + JOIN vn.warehouse w ON w.id = tr.warehouseInFk JOIN vn.country c ON c.id = w.countryFk AND c.code = 'NL'; SELECT b.id buy, i.doPhoto do_photo, b.stickers - b.printedStickers stickersToPrint @@ -46166,8 +46695,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `buy_updateGrouping` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -46175,6 +46702,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `buy_updateGrouping`(vWarehouseFk INT, vItemFk INT, vGrouping INT) BEGIN @@ -46184,14 +46713,14 @@ BEGIN * @param vWarehouseFk Id del almacén * @param vItemFk Id del Artículo * @param vGrouping Cantidad de grouping - */ - + */ + CALL vn.buyUltimate(vWarehouseFk, util.VN_CURDATE()); UPDATE vn.buy b JOIN tmp.buyUltimate bu ON b.id = bu.buyFk - SET b.`grouping` = vGrouping - WHERE bu.warehouseFk = vWarehouseFk + SET b.`grouping` = vGrouping + WHERE bu.warehouseFk = vWarehouseFk AND bu.itemFk = vItemFk; DROP TEMPORARY TABLE tmp.buyUltimate; @@ -46201,8 +46730,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `buy_updatePacking` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -46210,11 +46737,13 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `buy_updatePacking`(vWarehouseFk INT, vItemFk INT, vPacking INT) BEGIN /** - * Actualiza packing + * Actualiza packing * * @param vWarehouseFk warehouse del item * @param vItemFk id del item @@ -46224,8 +46753,8 @@ BEGIN UPDATE buy b JOIN tmp.buyUltimate bu ON b.id = bu.buyFk - SET b.packing = vPacking - WHERE bu.warehouseFk = vWarehouseFk + SET b.packing = vPacking + WHERE bu.warehouseFk = vWarehouseFk AND bu.itemFk = vItemFk; DROP TEMPORARY TABLE tmp.buyUltimate; @@ -46236,8 +46765,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `catalog_calcFromItem` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -46245,6 +46772,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `catalog_calcFromItem`( vLanded DATE, @@ -46264,7 +46793,7 @@ BEGIN */ DROP TEMPORARY TABLE IF EXISTS tmp.item; CREATE TEMPORARY TABLE tmp.item - ENGINE = MEMORY + ENGINE = MEMORY SELECT vItemFk itemFk; CALL catalog_calculate(vLanded, vAddressFk, vAgencyModeFk); @@ -46275,8 +46804,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `catalog_calculate` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -46284,9 +46811,11 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `catalog_calculate`(vLanded DATE, vAddressFk INT, vAgencyModeFk INT) -BEGIN +BEGIN /** * Calcula los articulos disponibles y sus precios * @@ -46294,13 +46823,12 @@ BEGIN * @param vLanded Fecha de recepcion de mercancia * @param vAddressFk Id del consignatario * @param vAgencyModeFk Id de la agencia - * @return tmp.ticketCalculateItem(itemFk, available, producer, + * @return tmp.ticketCalculateItem(itemFk, available, producer, * item, size, stems, category, inkFk, image, origin, price) * @return tmp.ticketLot(warehouseFk, itemFk, available, buyFk) * @return tmp.ticketComponent * @return tmp.ticketComponentPrice */ - DECLARE vAvailableCalc INT; DECLARE vAvailableNoRaidsCalc INT; DECLARE vShipped DATE; @@ -46330,22 +46858,22 @@ BEGIN DROP TEMPORARY TABLE IF EXISTS tmp.ticketCalculateItem; CREATE TEMPORARY TABLE tmp.ticketCalculateItem( - itemFk INT(11) NOT NULL, + itemFk INT(11) NOT NULL, available INT(11), - producer VARCHAR(50), - item VARCHAR(50), - size INT(10) UNSIGNED, - stems INT(11), - category VARCHAR(3), - inkFk VARCHAR(3), + producer VARCHAR(50), + item VARCHAR(50), + size INT(10) UNSIGNED, + stems INT(11), + category VARCHAR(3), + inkFk VARCHAR(3), image VARCHAR(50), - origin VARCHAR(3), + origin VARCHAR(3), price DECIMAL(10,2), priceKg DECIMAL(10,2), `grouping` INT(10) UNSIGNED, PRIMARY KEY `itemFk` (`itemFk`) ) ENGINE = MEMORY DEFAULT CHARSET=utf8; - + OPEN cTravelTree; l: LOOP @@ -46367,20 +46895,20 @@ BEGIN bu.buyFk, vZoneFk FROM `cache`.available a - LEFT JOIN cache.availableNoRaids anr ON anr.item_id = a.item_id + LEFT JOIN cache.availableNoRaids anr ON anr.item_id = a.item_id AND anr.calc_id = vAvailableNoRaidsCalc JOIN tmp.item i ON i.itemFk = a.item_id JOIN vn.item it ON it.id = i.itemFk JOIN vn.`zone` z ON z.id = vZoneFk - LEFT JOIN tmp.buyUltimate bu ON bu.itemFk = a.item_id - LEFT JOIN edi.supplyResponse sr ON sr.ID = it.supplyResponseFk - LEFT JOIN edi.VMPSettings v ON v.VMPID = sr.vmpID + LEFT JOIN tmp.buyUltimate bu ON bu.itemFk = a.item_id + LEFT JOIN edi.supplyResponse sr ON sr.ID = it.supplyResponseFk + LEFT JOIN edi.VMPSettings v ON v.VMPID = sr.vmpID LEFT JOIN edi.marketPlace mp ON mp.id = sr.MarketPlaceID LEFT JOIN (SELECT isVNHSupplier, isEarlyBird, TRUE AS itemAllowed FROM vn.addressFilter af - JOIN (SELECT ad.provinceFk, p.countryFk, ad.isLogifloraAllowed - FROM vn.address ad - JOIN vn.province p ON p.id = ad.provinceFk + JOIN (SELECT ad.provinceFk, p.countryFk, ad.isLogifloraAllowed + FROM vn.address ad + JOIN vn.province p ON p.id = ad.provinceFk WHERE ad.id = vAddressFk ) sub2 ON sub2.provinceFk <=> IFNULL(af.provinceFk, sub2.provinceFk) AND sub2.countryFk <=> IFNULL(af.countryFk, sub2.countryFk) @@ -46397,19 +46925,23 @@ BEGIN JOIN vn.itemType itt ON itt.id = it.typeFk JOIN vn.itemCategory itc on itc.id = itt.categoryFk JOIN vn.address ad ON ad.id = vAddressFk - LEFT JOIN vn.clientItemType cit + LEFT JOIN vn.clientItemType cit ON cit.clientFk = ad.clientFk AND cit.itemTypeFk = itt.id - LEFT JOIN vn.clientItemCategory cic - ON cic.clientFk = ad.clientFk - AND cic.itemCategoryFk = itc.id + LEFT JOIN vn.zoneItemType zit + ON zit.zoneFk = vZoneFk + AND zit.itemTypeFk = itt.id + LEFT JOIN vn.agencyModeItemType ait + ON ait.agencyModeFk = vAgencyModeFk + AND ait.itemTypeFk = itt.id WHERE a.calc_id = vAvailableCalc AND a.available > 0 AND (sub.itemAllowed OR NOT it.isFloramondo OR anr.available > 0) AND (ag.isAnyVolumeAllowed OR NOT itt.isUnconventionalSize) - AND (itc.isReclining OR ISNULL(it.`size`) OR it.`size` < z.itemMaxSize OR ISNULL(z.itemMaxSize)) - AND NOT (cit.isAllowed <=> FALSE) - AND (ISNULL(cic.itemCategoryFk) OR cit.isAllowed); + AND (itc.isReclining OR it.`size` IS NULL OR it.`size` < z.itemMaxSize OR z.itemMaxSize IS NULL) + AND cit.id IS NULL + AND zit.id IS NULL + AND ait.id IS NULL; DROP TEMPORARY TABLE tmp.buyUltimate; @@ -46465,15 +46997,12 @@ BEGIN END LOOP; CLOSE cTravelTree; - END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `catalog_componentCalculate` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -46481,48 +47010,39 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; -CREATE DEFINER=`root`@`localhost` PROCEDURE `catalog_componentCalculate`( vZoneFk INT, - vAddressFk INT, - vShipped DATE, - vWarehouseFk INT) +CREATE DEFINER=`root`@`localhost` PROCEDURE `catalog_componentCalculate`( + vZoneFk INT, + vAddressFk INT, + vShipped DATE, + vWarehouseFk INT +) BEGIN - /** - * Calcula los componentes de los articulos de tmp.ticketLot - * - * @param vZoneFk para calcular el transporte - * @param vAddressFk Consignatario - * @param vShipped dia de salida del pedido - * @param vWarehouseFk warehouse de salida del pedido - * @table tmp.ticketLot (warehouseFk, available, itemFk, buyFk, zoneFk) - * @table tmp.ticketComponent(warehouseFk, itemFk, componentFk, cost) - * - * @return tmp.ticketComponentPrice (warehouseFk, itemFk, rate, `grouping`, price, priceKg) - */ - +/** + * Calcula los componentes de los articulos de tmp.ticketLot + * + * @param vZoneFk para calcular el transporte + * @param vAddressFk Consignatario + * @param vShipped dia de salida del pedido + * @param vWarehouseFk warehouse de salida del pedido + * @table tmp.ticketLot (warehouseFk, available, itemFk, buyFk, zoneFk) + * @table tmp.ticketComponent(warehouseFk, itemFk, componentFk, cost) + * + * @return tmp.ticketComponentPrice (warehouseFk, itemFk, rate, `grouping`, price, priceKg) + */ DECLARE vClientFk INT; - DECLARE vIsFrenchVNHBuyer BOOLEAN DEFAULT FALSE; DECLARE vVNHWarehouseFk INT DEFAULT 7; - DECLARE vFrenchDiscount DECIMAL(3,2) DEFAULT 0.12; SELECT clientFk INTO vClientFK FROM address WHERE id = vAddressFk; - - SELECT (c.country = 'FRANCIA' AND vWarehouseFk = vVNHWarehouseFk) - INTO vIsFrenchVNHBuyer - FROM vn.country c - JOIN vn.province p ON p.countryFk = c.id - JOIN vn.address a ON a.provinceFk = p.id - WHERE a.id = vAddressFk; - - DROP TEMPORARY TABLE IF EXISTS tmp.ticketComponentCalculate; - - CREATE TEMPORARY TABLE tmp.ticketComponentCalculate + + CREATE OR REPLACE TEMPORARY TABLE tmp.ticketComponentCalculate (PRIMARY KEY (itemFk, warehouseFk)) ENGINE = MEMORY - SELECT - tl.itemFk, + SELECT tl.itemFk, tl.warehouseFk, tl.available, IF(i.hasMinPrice, GREATEST(i.minPrice,IFNULL(pf.rate2, b.price2)),IFNULL(pf.rate2, b.price2)) rate2, @@ -46530,7 +47050,7 @@ BEGIN IFNULL(pf.packing, GREATEST(b.grouping, b.packing)) packing, IFNULL(pf.`grouping`, b.`grouping`) `grouping`, ABS(IFNULL(pf.box, b.groupingMode)) groupingMode, - tl.buyFk, + tl.buyFk, i.typeFk, IF(i.hasKgPrice, b.weight / b.packing, NULL) weightGrouping FROM tmp.ticketLot tl @@ -46538,8 +47058,8 @@ BEGIN JOIN item i ON i.id = tl.itemFk JOIN itemType it ON it.id = i.typeFk JOIN itemCategory ic ON ic.id = it.categoryFk - LEFT JOIN specialPrice sp ON sp.itemFk = i.id - AND sp.clientFk = vClientFk + LEFT JOIN specialPrice sp ON sp.itemFk = i.id + AND sp.clientFk = vClientFk LEFT JOIN ( SELECT * FROM ( SELECT pf.itemFk, @@ -46551,13 +47071,13 @@ BEGIN zw.warehouseFk FROM priceFixed pf JOIN zoneWarehouse zw ON zw.zoneFk = vZoneFk - AND zw.warehouseFk IN (pf.warehouseFk,0) + AND zw.warehouseFk IN (pf.warehouseFk,0) WHERE vShipped BETWEEN pf.started AND pf.ended ORDER BY pf.itemFk, pf.warehouseFk DESC LIMIT 10000000000000000000 ) tpf GROUP BY tpf.itemFk, tpf.warehouseFk - ) pf ON pf.itemFk = tl.itemFk + ) pf ON pf.itemFk = tl.itemFk AND pf.warehouseFk = tl.warehouseFk WHERE b.buyingValue + b.freightValue + b.packageValue + b.comissionValue > 0.01 AND ic.merchandise @@ -46566,8 +47086,7 @@ BEGIN -- Coste INSERT INTO tmp.ticketComponent (warehouseFk, itemFk, componentFk, cost) - SELECT - tcc.warehouseFk, + SELECT tcc.warehouseFk, tcc.itemFk, c2.id, b.buyingValue + b.freightValue + b.packageValue + b.comissionValue @@ -46577,8 +47096,7 @@ BEGIN -- Margen INSERT INTO tmp.ticketComponent (warehouseFk, itemFk, componentFk, cost) - SELECT - tcc.warehouseFk, + SELECT tcc.warehouseFk, tcc.itemFk, c2.id, tcc.rate3 - b.buyingValue - b.freightValue - b.packageValue - b.comissionValue @@ -46586,31 +47104,15 @@ BEGIN JOIN vn.component c2 ON c2.code = 'margin' JOIN buy b ON b.id = tcc.buyFk; - -- Promo Francia - IF vIsFrenchVNHBuyer THEN - - INSERT INTO tmp.ticketComponent (warehouseFk, itemFk, componentFk, cost) - SELECT - tcc.warehouseFk, - tcc.itemFk, - c2.id, - - vFrenchDiscount * (b.buyingValue + b.freightValue + b.packageValue + b.comissionValue) / ( 1 - vFrenchDiscount) - FROM tmp.ticketComponentCalculate tcc - JOIN vn.component c2 ON c2.code = 'frenchOffer' - JOIN buy b ON b.id = tcc.buyFk; - - END IF; - - DROP TEMPORARY TABLE IF EXISTS tmp.ticketComponentBase; - CREATE TEMPORARY TABLE tmp.ticketComponentBase ENGINE = MEMORY + CREATE OR REPLACE TEMPORARY TABLE tmp.ticketComponentBase ENGINE = MEMORY SELECT tc.itemFk, ROUND(SUM(tc.cost), 4) AS base, tc.warehouseFk FROM tmp.ticketComponent tc JOIN tmp.ticketComponentCalculate tcc ON tcc.itemFk = tc.itemFk AND tcc.warehouseFk = tc.warehouseFk GROUP BY tc.itemFk, warehouseFk; - + -- RECOBRO INSERT INTO tmp.ticketComponent(warehouseFk, itemFk, componentFk, cost) - SELECT tcb.warehouseFk, tcb.itemFk, c2.id, + SELECT tcb.warehouseFk, tcb.itemFk, c2.id, ROUND(tcb.base * LEAST( MAX(GREATEST(IFNULL(cr.priceIncreasing,0), @@ -46627,37 +47129,43 @@ BEGIN LEFT JOIN claimRatio cr1 ON cr1.clientFk = cy1.rightOx LEFT JOIN clientYoke cy2 ON cy2.rightOx = cr.clientFk LEFT JOIN claimRatio cr2 ON cr2.clientFk = cy2.leftOx - WHERE GREATEST(IFNULL(cr.priceIncreasing,0), IFNULL(cr1.priceIncreasing,0), IFNULL(cr2.priceIncreasing,0)) > 0.009 - GROUP BY tcb.itemFk; + WHERE GREATEST( + IFNULL(cr.priceIncreasing,0), + IFNULL(cr1.priceIncreasing,0), + IFNULL(cr2.priceIncreasing,0)) > 0.009 + GROUP BY tcb.itemFk; -- Mana auto INSERT INTO tmp.ticketComponent(warehouseFk, itemFk, componentFk, cost) - SELECT tcb.warehouseFk, tcb.itemFk, c2.id, ROUND(base * (0.01 + wm.pricesModifierRate), 3) as manaAuto + SELECT tcb.warehouseFk, + tcb.itemFk, + c2.id, + ROUND(base * (0.01 + wm.pricesModifierRate), 3) manaAuto FROM tmp.ticketComponentBase tcb JOIN `client` c on c.id = vClientFk - JOIN workerMana wm ON c.salesPersonFk = wm.workerFk + JOIN workerMana wm ON c.salesPersonFk = wm.workerFk JOIN vn.component c2 ON c2.code = 'autoMana' WHERE wm.isPricesModifierActivated HAVING manaAuto <> 0; - + -- Precios especiales INSERT INTO tmp.ticketComponent(warehouseFk, itemFk, componentFk, cost) SELECT tcb.warehouseFk, tcb.itemFk, c2.id, GREATEST( - IFNULL(ROUND(tcb.base * c2.tax, 4), 0), + IFNULL(ROUND(tcb.base * c2.tax, 4), 0), IF(i.hasMinPrice, i.minPrice,0) - tcc.rate3 ) cost FROM tmp.ticketComponentBase tcb JOIN vn.component c2 ON c2.code = 'lastUnitsDiscount' - JOIN tmp.ticketComponentCalculate tcc ON tcc.itemFk = tcb.itemFk AND tcc.warehouseFk = tcb.warehouseFk + JOIN tmp.ticketComponentCalculate tcc ON tcc.itemFk = tcb.itemFk AND tcc.warehouseFk = tcb.warehouseFk LEFT JOIN specialPrice sp ON sp.clientFk = vClientFk AND sp.itemFk = tcc.itemFk JOIN vn.item i ON i.id = tcb.itemFk WHERE sp.value IS NULL AND i.supplyResponseFk IS NULL; - -- Individual + -- Individual INSERT INTO tmp.ticketComponent(warehouseFk, itemFk, componentFk, cost) SELECT tcb.warehouseFk, tcb.itemFk, @@ -46668,23 +47176,22 @@ BEGIN JOIN vn.client c ON c.id = vClientFk JOIN vn.businessType bt ON bt.code = c.businessTypeFk WHERE bt.code = 'individual'; - + -- Venta por paquetes INSERT INTO tmp.ticketComponent(warehouseFk, itemFk, componentFk, cost) - SELECT tcc.warehouseFk, tcc.itemFk, c2.id, tcc.rate2 - tcc.rate3 + SELECT tcc.warehouseFk, tcc.itemFk, c2.id, tcc.rate2 - tcc.rate3 FROM tmp.ticketComponentCalculate tcc JOIN vn.component c2 ON c2.code = 'salePerPackage' JOIN buy b ON b.id = tcc.buyFk LEFT JOIN specialPrice sp ON sp.clientFk = vClientFk AND sp.itemFk = tcc.itemFk WHERE sp.value IS NULL; - DROP TEMPORARY TABLE IF EXISTS tmp.zone; - CREATE TEMPORARY TABLE IF NOT EXISTS tmp.zone (INDEX (id)) + CREATE OR REPLACE TEMPORARY TABLE tmp.`zone` (INDEX (id)) ENGINE = MEMORY SELECT vZoneFk id; CALL zone_getOptionsForShipment(vShipped, TRUE); - + -- Reparto INSERT INTO tmp.ticketComponent SELECT tcc.warehouseFK, @@ -46698,14 +47205,13 @@ BEGIN JOIN agencyMode am ON am.id = z.agencyModeFk JOIN vn.volumeConfig vc JOIN vn.component c2 ON c2.code = 'delivery' - LEFT JOIN itemCost ic ON ic.warehouseFk = tcc.warehouseFk + LEFT JOIN itemCost ic ON ic.warehouseFk = tcc.warehouseFk AND ic.itemFk = tcc.itemFk HAVING cost <> 0; DROP TEMPORARY TABLE tmp.zoneOption; - DROP TEMPORARY TABLE IF EXISTS tmp.ticketComponentCopy; - CREATE TEMPORARY TABLE tmp.ticketComponentCopy ENGINE = MEMORY + CREATE OR REPLACE TEMPORARY TABLE tmp.ticketComponentCopy ENGINE = MEMORY SELECT * FROM tmp.ticketComponent; -- Precio especial @@ -46736,9 +47242,7 @@ BEGIN WHERE tcc.warehouseFk = vWarehouseFk GROUP BY tcc.itemFk, tcc.warehouseFk; - - DROP TEMPORARY TABLE IF EXISTS tmp.ticketComponentSum; - CREATE TEMPORARY TABLE tmp.ticketComponentSum + CREATE OR REPLACE TEMPORARY TABLE tmp.ticketComponentSum (INDEX (itemFk, warehouseFk)) ENGINE = MEMORY SELECT SUM(cost) sumCost, tc.itemFk, tc.warehouseFk, c.classRate @@ -46746,8 +47250,7 @@ BEGIN JOIN component c ON c.id = tc.componentFk GROUP BY tc.itemFk, tc.warehouseFk, c.classRate; - DROP TEMPORARY TABLE IF EXISTS tmp.ticketComponentRate; - CREATE TEMPORARY TABLE tmp.ticketComponentRate ENGINE = MEMORY + CREATE OR REPLACE TEMPORARY TABLE tmp.ticketComponentRate ENGINE = MEMORY SELECT tcc.warehouseFk, tcc.itemFk, 1 rate, @@ -46755,15 +47258,14 @@ BEGIN CAST(SUM(tcs.sumCost) AS DECIMAL(10,2)) price, CAST(SUM(tcs.sumCost) AS DECIMAL(10,2)) / weightGrouping priceKg FROM tmp.ticketComponentCalculate tcc - JOIN tmp.ticketComponentSum tcs ON tcs.itemFk = tcc.itemFk + JOIN tmp.ticketComponentSum tcs ON tcs.itemFk = tcc.itemFk AND tcs.warehouseFk = tcc.warehouseFk - WHERE IFNULL(tcs.classRate, 1) = 1 + WHERE IFNULL(tcs.classRate, 1) = 1 AND tcc.groupingMode < 2 AND (tcc.packing > tcc.`grouping` or tcc.groupingMode = 0) GROUP BY tcs.warehouseFk, tcs.itemFk; INSERT INTO tmp.ticketComponentRate (warehouseFk, itemFk, rate, `grouping`, price, priceKg) - SELECT - tcc.warehouseFk, + SELECT tcc.warehouseFk, tcc.itemFk, 2 rate, tcc.packing `grouping`, @@ -46772,13 +47274,13 @@ BEGIN FROM tmp.ticketComponentCalculate tcc JOIN tmp.ticketComponentSum tcs ON tcs.itemFk = tcc.itemFk AND tcs.warehouseFk = tcc.warehouseFk - WHERE tcc.available IS NULL OR (IFNULL(tcs.classRate, 2) = 2 + WHERE tcc.available IS NULL + OR (IFNULL(tcs.classRate, 2) = 2 AND tcc.packing > 0 AND tcc.available >= tcc.packing) GROUP BY tcs.warehouseFk, tcs.itemFk; INSERT INTO tmp.ticketComponentRate (warehouseFk, itemFk, rate, `grouping`, price, priceKg) - SELECT - tcc.warehouseFk, + SELECT tcc.warehouseFk, tcc.itemFk, 3 rate, tcc.available `grouping`, @@ -46795,22 +47297,19 @@ BEGIN SELECT * FROM tmp.ticketComponentRate ORDER BY price LIMIT 10000000000000000000 ) t GROUP BY itemFk, warehouseFk, `grouping`; - + DROP TEMPORARY TABLE tmp.ticketComponentCalculate, tmp.ticketComponentSum, tmp.ticketComponentBase, tmp.ticketComponentRate, tmp.ticketComponentCopy; - END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `catalog_componentPrepare` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -46818,10 +47317,12 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `catalog_componentPrepare`() BEGIN - + DROP TEMPORARY TABLE IF EXISTS tmp.ticketComponent; CREATE TEMPORARY TABLE tmp.ticketComponent ( `warehouseFk` INT UNSIGNED NOT NULL, @@ -46831,9 +47332,9 @@ BEGIN INDEX `itemWarehouse` USING BTREE (`itemFk` ASC, `warehouseFk` ASC), UNIQUE `fkItemWarehouseComponent` (`itemFk` ASC, `warehouseFk` ASC, `componentFk` ASC) )ENGINE=MEMORY DEFAULT CHARSET=utf8; - + DROP TEMPORARY TABLE IF EXISTS tmp.ticketComponentPrice; - CREATE TEMPORARY TABLE tmp.ticketComponentPrice ( + CREATE TEMPORARY TABLE tmp.ticketComponentPrice ( `warehouseFk` INT UNSIGNED NOT NULL, `itemFk` INT NOT NULL, `rate` INT NOT NULL, @@ -46842,15 +47343,13 @@ BEGIN `priceKg` DECIMAL(10,4), INDEX `itemWarehouse` USING BTREE (`itemFk` ASC, `warehouseFk` ASC), UNIQUE `fkItemWarehouseRate` (`itemFk` ASC, `warehouseFk` ASC, `rate` ASC) - )ENGINE=MEMORY DEFAULT CHARSET=utf8; + )ENGINE=MEMORY DEFAULT CHARSET=utf8; END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `catalog_componentPurge` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -46858,10 +47357,12 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `catalog_componentPurge`() BEGIN - DROP TEMPORARY TABLE + DROP TEMPORARY TABLE tmp.ticketComponentPrice, tmp.ticketComponent, tmp.ticketLot; @@ -46871,8 +47372,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `catalog_test` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -46880,17 +47379,19 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `catalog_test`() proc: BEGIN /** * Calcula los articulos disponibles y sus precios - * + * * @table tmp.item(itemFk) Listado de artículos a calcular * @param vLanded Fecha de recepcion de mercancia * @param vAddressFk Id del consignatario * @param vAgencyModeFk Id de la agencia - * @return tmp.ticketCalculateItem(itemFk, available, producer, + * @return tmp.ticketCalculateItem(itemFk, available, producer, * item, size, stems, category, inkFk, image, origin, price) * @return tmp.ticketLot(warehouseFk, itemFk, available, buyFk) * @return tmp.ticketComponent @@ -46912,10 +47413,10 @@ proc: BEGIN DROP TEMPORARY TABLE IF EXISTS tmp.item; CREATE TEMPORARY TABLE tmp.item - ENGINE = MEMORY + ENGINE = MEMORY SELECT 10 itemFk; -- Establece los almacenes y las fechas que van a entrar al disponible -SELECT 1; +SELECT 1; CALL vn.zone_getShipped (vLanded, vAddressFk, vAgencyModeFk, FALSE); SELECT 2; DROP TEMPORARY TABLE IF EXISTS tmp.ticketLot; @@ -46930,25 +47431,25 @@ SELECT 2; KEY `item_warehouse` (`itemFk`,`warehouseFk`) USING HASH ) ENGINE=MEMORY DEFAULT CHARSET=utf8; CALL catalog_componentPrepare(); - + SELECT 3; DROP TEMPORARY TABLE IF EXISTS tmp.ticketCalculateItem; CREATE TEMPORARY TABLE tmp.ticketCalculateItem( - itemFk INT(11) NOT NULL, + itemFk INT(11) NOT NULL, available INT(11), - producer VARCHAR(50), - item VARCHAR(50), - size INT(10) UNSIGNED, - stems INT(11), - category VARCHAR(3), - inkFk VARCHAR(3), + producer VARCHAR(50), + item VARCHAR(50), + size INT(10) UNSIGNED, + stems INT(11), + category VARCHAR(3), + inkFk VARCHAR(3), image VARCHAR(50), - origin VARCHAR(3), + origin VARCHAR(3), price DECIMAL(10,2), priceKg DECIMAL(10,2), PRIMARY KEY `itemFk` (`itemFk`) ) ENGINE = MEMORY DEFAULT CHARSET=utf8; - + OPEN cTravelTree; l: LOOP @@ -46975,35 +47476,35 @@ SELECT 5; LEFT JOIN tmp.buyUltimate bu ON bu.itemFk = i.item_id WHERE i.calc_id = vAvailableCalc AND i.available > 0; - + DROP TEMPORARY TABLE tmp.buyUltimate; - + CALL vn.catalog_componentCalculate(vZoneFk, vAddressFk, vShipped, vWarehouseFk); SELECT 6; INSERT INTO tmp.ticketCalculateItem ( - itemFk, - available, - producer, - item, - size, - stems, - category, + itemFk, + available, + producer, + item, + size, + stems, + category, inkFk, image, origin, price, priceKg) - SELECT - tl.itemFk, + SELECT + tl.itemFk, SUM(tl.available) available, - p.name producer, - i.name item, - i.size size, - i.stems, - i.category, - i.inkFk, + p.name producer, + i.name item, + i.size size, + i.stems, + i.category, + i.inkFk, i.image, - o.code origin, + o.code origin, bl.price, bl.priceKg FROM tmp.ticketLot tl @@ -47011,11 +47512,11 @@ SELECT 6; LEFT JOIN producer p ON p.id = i.producerFk AND p.isVisible JOIN origin o ON o.id = i.originFk JOIN ( - SELECT * + SELECT * FROM (SELECT price, itemFk, priceKg FROM tmp.ticketComponentPrice WHERE warehouseFk = vWarehouseFk - ORDER BY (rate = 2) DESC + ORDER BY (rate = 2) DESC LIMIT 10000000000000000000) sub GROUP BY itemFk ) bl ON bl.itemFk = tl.itemFk @@ -47027,16 +47528,14 @@ SELECT 6; CLOSE cTravelTree; DROP TEMPORARY TABLE tmp.item; -SELECT 7; - +SELECT 7; + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `clean` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -47044,6 +47543,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `clean`() BEGIN @@ -47054,6 +47555,7 @@ BEGIN DECLARE v26Month DATE; DECLARE v3Month DATE; DECLARE vTrashId VARCHAR(15); + DECLARE v5Years DATE; SET vDateShort = util.VN_CURDATE() - INTERVAL 2 MONTH; SET vOneYearAgo = util.VN_CURDATE() - INTERVAL 1 YEAR; @@ -47061,6 +47563,7 @@ BEGIN SET v18Month = util.VN_CURDATE() - INTERVAL 18 MONTH; SET v26Month = util.VN_CURDATE() - INTERVAL 26 MONTH; SET v3Month = util.VN_CURDATE() - INTERVAL 3 MONTH; + SET v5Years = util.VN_CURDATE() - INTERVAL 5 YEAR; DELETE FROM ticketParking WHERE created < vDateShort; DELETE FROM routesMonitor WHERE dated < vDateShort; @@ -47086,8 +47589,6 @@ BEGIN DELETE FROM claim WHERE ticketCreated < vFourYearsAgo; DELETE FROM message WHERE sendDate < vDateShort; -- Robert ubicacion anterior de trevelLog comentario para debug - DELETE sc FROM saleChecked sc - JOIN sale s ON sc.saleFk = s.id WHERE s.created < vDateShort; DELETE FROM zoneEvent WHERE `type` = 'day' AND dated < v3Month; DELETE bm FROM buyMark bm @@ -47095,7 +47596,9 @@ BEGIN JOIN entry e ON e.id = b.entryFk JOIN travel t ON t.id = e.travelFk WHERE t.landed <= vDateShort; - DELETE FROM vn.buy WHERE created < vDateShort AND entryFk = 9200; + DELETE b FROM vn.buy b + JOIN vn.entryConfig e ON e.defaultEntry = b.entryFk + WHERE b.created < vDateShort; DELETE FROM vn.itemShelvingLog WHERE created < vDateShort; DELETE FROM vn.stockBuyed WHERE creationDate < vDateShort; DELETE FROM vn.itemCleanLog WHERE created < util.VN_NOW() - INTERVAL 1 YEAR; @@ -47176,7 +47679,7 @@ BEGIN FROM vn.route r WHERE created < TIMESTAMPADD(YEAR,-4,util.VN_CURDATE()); - UPDATE tmp.routeToDelete tmp + UPDATE tmp.routeToDelete tmp JOIN vn.dms d ON d.id = tmp.gestdocFk SET d.dmsTypeFk = vTrashId; @@ -47212,14 +47715,17 @@ BEGIN CALL shelving_clean; + DELETE FROM chat WHERE dated < v5Years; + + DELETE tt FROM ticketTracking tt JOIN vn.ticket t ON tt.ticketFk = t.id + WHERE t.shipped <= vDateShort; + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `clean_logiflora` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -47227,6 +47733,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `clean_logiflora`() BEGIN @@ -47318,8 +47826,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `clearShelvingList` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -47327,6 +47833,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `clearShelvingList`(vShelvingFk VARCHAR(8)) BEGIN @@ -47339,8 +47847,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `clientCreate` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -47348,12 +47854,14 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `clientCreate`( vFirstname VARCHAR(50), - vSurnames VARCHAR(50), - vFi VARCHAR(9), - vAddress TEXT, + vSurnames VARCHAR(50), + vFi VARCHAR(9), + vAddress TEXT, vPostcode CHAR(5), vCity VARCHAR(25), vProvinceFk SMALLINT(5), @@ -47372,7 +47880,7 @@ BEGIN DECLARE vIsTaxDataChecked TINYINT(1) DEFAULT 1; DECLARE vHasCoreVnl BOOLEAN DEFAULT TRUE; DECLARE vMandateTypeFk INT DEFAULT 2; - + INSERT INTO `client` ( id, name, @@ -47400,21 +47908,21 @@ BEGIN vProvinceFk, vCity, vPostcode, - CONCAT(vSurnames, ' ', vFirstname), + CONCAT(vSurnames, ' ', vFirstname), vPayMethodFk, vDueDay, vDefaultCredit, vIsTaxDataChecked, vHasCoreVnl, FALSE - ) ON duplicate key update + ) ON duplicate key update payMethodFk = vPayMethodFk, dueDay = vDueDay, credit = vDefaultCredit, isTaxDataChecked = vIsTaxDataChecked, hasCoreVnl = vHasCoreVnl, isActive = TRUE; - + IF (SELECT COUNT(*) FROM mandate WHERE clientFk = vUserFk AND companyFk = vCompanyFk AND mandateTypeFk = vMandateTypeFk) = 0 THEN INSERT INTO mandate (clientFk, companyFk, mandateTypeFk) VALUES (vUserFk, vCompanyFk, vMandateTypeFk); @@ -47425,8 +47933,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `clientDebtSpray` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -47434,6 +47940,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `clientDebtSpray`(vClientFk INT) BEGIN @@ -47444,21 +47952,21 @@ BEGIN */ DECLARE vClientDebt DOUBLE; - + SELECT vn.clientGetDebt(vClientFk, util.VN_CURDATE()) INTO vClientDebt; - + INSERT INTO vn.greuge(clientFk, description, amount, shipped, greugeTypeFk) 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), util.VN_CURDATE(), 5 FROM vn.greuge WHERE clientFk = vClientFk; - - UPDATE vn.client - SET salesPersonFk = NULL + + UPDATE vn.client + SET salesPersonFk = NULL WHERE id = vClientFk; END ;; @@ -47467,8 +47975,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `clientFreeze` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -47476,28 +47982,30 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `clientFreeze`() BEGIN /** -* Congela diariamente aquellos clientes que son morosos sin recobro, -* pero que no sean trabajadores, +* Congela diariamente aquellos clientes que son morosos sin recobro, +* pero que no sean trabajadores, * y que el riesgo no sea menor que cero * hasta que no se gire la remesa no se congelan a los clientes de giro */ DECLARE vIsRemittanced BOOLEAN; - SELECT id into vIsRemittanced - FROM receipt - WHERE invoiceFk LIKE 'REMESA%' + SELECT id into vIsRemittanced + FROM receipt + WHERE invoiceFk LIKE 'REMESA%' 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 + FROM bs.defaulter WHERE created = util.VN_CURDATE() AND amount; @@ -47507,11 +48015,11 @@ BEGIN JOIN bi.defaulters d ON d.client = c.id AND d.date = util.VN_CURDATE() JOIN config ON TRUE LEFT JOIN recovery r ON r.clientFk = c.id AND r.finished IS NULL - LEFT JOIN payMethod pm ON pm.id = c.payMethodFk + LEFT JOIN payMethod pm ON pm.id = c.payMethodFk LEFT JOIN tmp.risk rk ON rk.clientFk = c.id - SET c.isFreezed = TRUE, + SET c.isFreezed = TRUE, d.frozened = util.VN_CURDATE() - WHERE (d.amount > config.defaultersMaxAmount + WHERE (d.amount > config.defaultersMaxAmount AND rk.risk > 0) AND c.typeFk = 'normal' AND r.id IS NULL @@ -47524,8 +48032,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `clientGetDebt` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -47533,6 +48039,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `clientGetDebt`(vDate DATE) BEGIN @@ -47550,8 +48058,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `clientGetDebtDiary` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -47559,6 +48065,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `clientGetDebtDiary`(vClientFK INT, vCompanyFk INT) BEGIN @@ -47575,33 +48083,33 @@ BEGIN DECLARE vIssued DATETIME; DECLARE vBalance DOUBLE DEFAULT 0.00; DECLARE cur CURSOR FOR - SELECT - created, - issued, + SELECT + created, + issued, ROUND(amount, 2) AS balance FROM invoiceOut - WHERE clientFk = vClientFk AND companyFk = vCompanyFk - UNION ALL - SELECT - created, - payed, + WHERE clientFk = vClientFk AND companyFk = vCompanyFk + UNION ALL + SELECT + created, + payed, ROUND(-1 * amountPaid, 2) AS balance - FROM receipt + FROM receipt WHERE clientFk = vClientFk AND companyFk = vCompanyFk ORDER BY issued, created; DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE; - + OPEN cur; - + proc: LOOP SET vDone = FALSE; - + FETCH cur INTO vCreated, vIssued, vBalance; IF vDate IS NULL THEN SET vDate=vIssued; END IF; - + IF vDone THEN LEAVE proc; END IF; @@ -47613,66 +48121,66 @@ BEGIN SET vDone = TRUE; END IF; END LOOP; - + CLOSE cur; - - SELECT - issued, - CAST(debtOut AS DECIMAL(10,2)) debtOut, + + SELECT + issued, + CAST(debtOut AS DECIMAL(10,2)) debtOut, CAST(debtIn AS DECIMAL(10,2)) debtIn, - ref, - companyFk, + ref, + companyFk, priority FROM - (SELECT - NULL AS issued, - SUM(amountUnpaid) AS debtOut, - NULL AS debtIn, - 'Saldo Anterior' AS ref, + (SELECT + NULL AS issued, + SUM(amountUnpaid) AS debtOut, + NULL AS debtIn, + 'Saldo Anterior' AS ref, companyFk, - 0 as priority - FROM - (SELECT SUM(amount) AS amountUnpaid, companyFk, 0 + 0 as priority + FROM + (SELECT SUM(amount) AS amountUnpaid, companyFk, 0 FROM invoiceOut - WHERE clientFk = vClientFK - AND issued < vDate - GROUP BY companyFk - - UNION ALL - - SELECT SUM(-1 * amountPaid), companyFk, 0 - FROM receipt - WHERE clientFk = vClientFK - AND payed < vDate - GROUP BY companyFk) AS transactions - GROUP BY companyFk - - UNION ALL - - SELECT - issued, - amount as debtOut, - NULL AS debtIn, + WHERE clientFk = vClientFK + AND issued < vDate + GROUP BY companyFk + + UNION ALL + + SELECT SUM(-1 * amountPaid), companyFk, 0 + FROM receipt + WHERE clientFk = vClientFK + AND payed < vDate + GROUP BY companyFk) AS transactions + GROUP BY companyFk + + UNION ALL + + SELECT + issued, + amount as debtOut, + NULL AS debtIn, ref, companyFk, - 1 - FROM invoiceOut - WHERE clientFk = vClientFK + 1 + FROM invoiceOut + WHERE clientFk = vClientFK AND issued >= vDate - UNION ALL - - SELECT - r.payed, - NULL as debtOut, - r.amountPaid, - r.invoiceFk, + UNION ALL + + SELECT + r.payed, + NULL as debtOut, + r.amountPaid, + r.invoiceFk, r.companyFk, - 0 + 0 FROM receipt r - WHERE r.clientFk = vClientFK - AND r.payed >= vDate) t - INNER JOIN `client` c ON c.id = vClientFK - HAVING debtOut <> 0 OR debtIn <> 0 + WHERE r.clientFk = vClientFK + AND r.payed >= vDate) t + INNER JOIN `client` c ON c.id = vClientFK + HAVING debtOut <> 0 OR debtIn <> 0 ORDER BY issued, priority DESC, debtIn; END ;; DELIMITER ; @@ -47680,8 +48188,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `clientGreugeSpray` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -47689,6 +48195,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `clientGreugeSpray`(IN vClientFk INT, IN onlyForHisOwner BOOL, IN vWorkerCode VARCHAR(3), IN vWithMana BOOLEAN) BEGIN @@ -47730,13 +48238,13 @@ BEGIN WHERE id = vClientFk; ELSE - + SELECT id INTO vOwner FROM vn.worker WHERE code = vWorkerCode COLLATE utf8_general_ci; END IF; - + DROP TEMPORARY TABLE IF EXISTS tmp.clientList; CREATE TEMPORARY TABLE tmp.clientList SELECT DISTINCT t.clientFk, floor(cr.yearSale / 12) monthSale @@ -47748,7 +48256,7 @@ BEGIN AND t.shipped >= TIMESTAMPADD(MONTH,-1,util.VN_CURDATE()) AND c.id != vClientFk HAVING monthSale > 100; - + SELECT SUM(monthSale) INTO vTotalSale FROM tmp.clientList; @@ -47759,15 +48267,13 @@ BEGIN SELECT vClientFk, 'Reparto greuge', -vGreuge, util.VN_CURDATE(), vGreugeTypeFk; END IF; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `clientPackagingOverstock` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -47775,17 +48281,19 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `clientPackagingOverstock`(vClientFk INT, vGraceDays INT ) BEGIN DROP TEMPORARY TABLE IF EXISTS tmp.clientPackagingOverstock; CREATE TEMPORARY TABLE tmp.clientPackagingOverstock - ENGINE = MEMORY - SELECT itemFk, - sum(GotfromClient) - sum(SenttoClient) as devueltos, + ENGINE = MEMORY + SELECT itemFk, + sum(GotfromClient) - sum(SenttoClient) as devueltos, sum(InvoicedtoClient) - sum(InvoicedfromClient) as facturados, - LEAST( - sum(GotfromClient) - sum(SenttoClient), + LEAST( + sum(GotfromClient) - sum(SenttoClient), sum(InvoicedtoClient) - sum(InvoicedfromClient) ) as abonables FROM @@ -47793,14 +48301,14 @@ BEGIN SELECT t.*, IF(@month = month, 0, 1) monthEnd, @month := month - FROM + FROM ( - SELECT x.id as ticketFk, - date(x.shipped) as shipped, - x.itemFk, - IFNULL(cast(sum(x.InvoicedtoClient) as DECIMAL(10,0)),0) InvoicedtoClient, - IFNULL(cast(sum(x.InvoicedfromClient) as DECIMAL(10,0)),0) InvoicedfromClient, - IFNULL(cast(sum(x.SenttoClient) as DECIMAL(10,0)),0) SenttoClient, + SELECT x.id as ticketFk, + date(x.shipped) as shipped, + x.itemFk, + IFNULL(cast(sum(x.InvoicedtoClient) as DECIMAL(10,0)),0) InvoicedtoClient, + IFNULL(cast(sum(x.InvoicedfromClient) as DECIMAL(10,0)),0) InvoicedfromClient, + IFNULL(cast(sum(x.SenttoClient) as DECIMAL(10,0)),0) SenttoClient, IFNULL(cast(sum(x.GotfromClient) as DECIMAL(10,0)),0) GotfromClient, i.name as concept, x.refFk as invoice, @@ -47819,11 +48327,11 @@ BEGIN @month := 0 month, t.companyFk FROM sale s - JOIN ticket t on t.id = s.ticketFk - JOIN packaging p ON p.itemFk = s.itemFk + JOIN ticket t on t.id = s.ticketFk + JOIN packaging p ON p.itemFk = s.itemFk LEFT JOIN packageEquivalentItem pe ON pe.itemFk = s.itemFk WHERE t.clientFk = vClientFk - AND t.shipped > '2017-11-30' + AND t.shipped > '2017-11-30' AND p.isPackageReturnable UNION ALL SELECT NULL, @@ -47836,7 +48344,7 @@ BEGIN 'Histórico', NULL, NULL - + FROM ticketPackagingStartingStock tps LEFT JOIN packageEquivalentItem pe ON pe.itemFk = tps.itemFk WHERE tps.clientFk = vClientFk @@ -47852,8 +48360,8 @@ BEGIN NULL AS refFk, NULL, t.companyFk - FROM ticketPackaging tp - JOIN ticket t on t.id = tp.ticketFk + FROM ticketPackaging tp + JOIN ticket t on t.id = tp.ticketFk JOIN packaging p ON p.id = tp.packagingFk LEFT JOIN packageEquivalentItem pe ON pe.itemFk = p.itemFk WHERE t.clientFk = vClientFk @@ -47872,8 +48380,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `clientPackagingOverstockReturn` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -47881,6 +48387,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `clientPackagingOverstockReturn`(vClientFk INT, vGraceDays INT ) BEGIN @@ -47890,11 +48398,11 @@ BEGIN -- SET vGraceDays = GREATEST(vGraceDays, 90); CALL vn.clientPackagingOverstock(vClientFk,vGraceDays); - + SELECT id INTO vWarehouseFk FROM vn.warehouse WHERE hasConfectionTeam; - + CALL vn.ticket_add( vClientFk ,util.VN_CURDATE() @@ -47907,30 +48415,28 @@ BEGIN ,account.myUser_getId() ,TRUE ,vNewTicket); - + INSERT INTO vn.sale(ticketFk, itemFk, quantity, concept, price) SELECT vNewTicket, cpo.itemFk, - cpo.abonables, i.longName, p.price FROM tmp.clientPackagingOverstock cpo JOIN vn.item i ON i.id = cpo.itemFk JOIN vn.packaging p ON p.itemFk = cpo.itemFk WHERE cpo.abonables > 0; - + INSERT INTO vn.ticketPackaging(ticketFk, packagingFk, quantity) SELECT vNewTicket, p.id, cpo.abonables FROM tmp.clientPackagingOverstock cpo JOIN vn.packaging p ON p.itemFk = cpo.itemFk WHERE cpo.abonables > 0; - + SELECT vNewTicket; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `clientRemoveWorker` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -47938,6 +48444,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `clientRemoveWorker`() BEGIN @@ -47960,9 +48468,9 @@ BEGIN JOIN vn.client c ON c.id = cd.id JOIN vn.province p ON p.id = c.provinceFk JOIN vn.country co ON co.id = p.countryFk - WHERE cd.Aviso = 'TERCER AVISO' AND - cp.clientFk IS NULL AND - co.country NOT IN ('Portugal','Francia','España exento') AND + WHERE cd.Aviso = 'TERCER AVISO' AND + cp.clientFk IS NULL AND + co.country NOT IN ('Portugal','Francia','España exento') AND c.salesPersonFk IS NOT NULL; OPEN rs; @@ -47982,8 +48490,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `clientRisk_update` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -47991,6 +48497,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `clientRisk_update`(vClientId INT, vCompanyId INT, vAmount DECIMAL(10,2)) BEGIN @@ -48010,8 +48518,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `client_checkBalance` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -48019,6 +48525,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `client_checkBalance`(IN vDateTo DATETIME, IN vIsConciliated BOOL) BEGIN @@ -48032,9 +48540,9 @@ BEGIN */ DECLARE vDateFrom DATE; DECLARE vMaxTolerance DECIMAL(10,2); - SET vDateTo = TIMESTAMP(vDateTo,'23:59:59'); - SELECT util.firstDayOfYear(vDateTo) INTO vDateFrom; - SELECT maxTolerance INTO vMaxTolerance + + SELECT util.firstDayOfYear(vDateTo), util.dayEnd(vDateTo), maxTolerance + INTO vDateFrom, vDateTo, vMaxTolerance FROM vn.ledgerConfig; SELECT s.nickname, @@ -48074,12 +48582,15 @@ BEGIN JOIN client c ON c.accountingAccount = lc.account WHERE lc.`date` BETWEEN vDateFrom AND vDateTo )sub - GROUP BY companyFk, clientFk + GROUP BY companyFk, clientFk ) sub1 ON sub1.clientFk = c.id JOIN supplier s ON s.id = sub1.companyFk JOIN company co ON co.id = sub1.companyFk + LEFT JOIN clientUnpaid cu ON cu.clientFk = c.id + AND cu.dated BETWEEN vDateFrom AND vDateTo WHERE pm.outstandingDebt AND co.code <> 'BLK' + AND cu.clientFk IS NULL HAVING ABS(difference) > vMaxTolerance ORDER BY c.name; END ;; @@ -48088,8 +48599,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `client_getDebt` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -48097,6 +48606,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `client_getDebt`(vDate DATE) BEGIN @@ -48115,13 +48626,13 @@ BEGIN SET vEnded = TIMESTAMP(IFNULL(vDate, util.VN_CURDATE()), '23:59:59'); DROP TEMPORARY TABLE IF EXISTS tClientRisk; - CREATE TEMPORARY TABLE tClientRisk + CREATE TEMPORARY TABLE tClientRisk ENGINE = MEMORY SELECT cr.clientFk, SUM(cr.amount) amount FROM clientRisk cr JOIN tmp.clientGetDebt c ON c.clientFk = cr.clientFk GROUP BY cr.clientFk; - + INSERT INTO tClientRisk SELECT c.clientFk, SUM(r.amountPaid) FROM receipt r @@ -48136,7 +48647,7 @@ BEGIN WHERE t.receiptFk IS NULL AND t.status = 'ok' GROUP BY t.clientFk; - + INSERT INTO tClientRisk SELECT t.clientFk, totalWithVat FROM ticket t @@ -48152,7 +48663,7 @@ BEGIN FROM client c JOIN tClientRisk cr ON cr.clientFk = c.id GROUP BY c.id; - + DROP TEMPORARY TABLE tClientRisk; END ;; DELIMITER ; @@ -48160,8 +48671,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `client_RandomList` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -48169,6 +48678,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `client_RandomList`(vNumber INT) BEGIN @@ -48176,9 +48687,9 @@ BEGIN DECLARE i INT DEFAULT 0; DECLARE c INT DEFAULT 0; DECLARE maxClientFk INT; - + DROP TEMPORARY TABLE IF EXISTS tmp.client; - + CREATE TEMPORARY TABLE tmp.`client` (id INT AUTO_INCREMENT, clientFk INT, @@ -48186,40 +48697,40 @@ BEGIN PRIMARY KEY(id), UNIQUE KEY clientFk (clientFk)) ENGINE = MEMORY; - + INSERT INTO tmp.client(clientFk) SELECT DISTINCT clientFk FROM vn.invoiceOut WHERE issued > TIMESTAMPADD(MONTH, -2, util.VN_CURDATE()); - + SELECT max(id) INTO maxClientFk FROM tmp.client; - - + + WHILE i < vNumber DO - + SET i = i + 1; - + WHILE c = 0 DO - + SELECT id INTO c FROM tmp.client WHERE id = floor(RAND() * maxClientFk) + 1 AND isSelected = FALSE LIMIT 1; - + END WHILE; - + -- SELECT i, maxClientFk, c; - - UPDATE tmp.client - SET isSelected = TRUE + + UPDATE tmp.client + SET isSelected = TRUE WHERE id = c; - + SET c = 0; - + END WHILE; - + SELECT c.id, c.name FROM tmp.client tc JOIN vn.client c ON c.id = tc.clientFk WHERE isSelected @@ -48232,8 +48743,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `cmrPallet_add` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -48241,6 +48750,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `cmrPallet_add`(vExpeditionPalletFk INT, vCmrFk INT) BEGIN @@ -48282,8 +48793,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `cmr_getByTicket` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -48291,40 +48800,42 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `cmr_getByTicket`(vTicketFk INT) BEGIN DECLARE vLanded DATE; - + SELECT DATE_ADD(util.VN_CURDATE(), INTERVAL landingDays DAY) INTO vLanded FROM vn.cmrConfig; IF vTicketFk THEN - + IF (SELECT count(ticketFk) FROM vn.cmr WHERE ticketFk = vTicketFk) THEN - + SELECT id FROM vn.cmr WHERE ticketFk = vTicketFk; - + ELSE - + INSERT INTO vn.cmr(ticketFk, companyFk, addressFromFk, addressToFk, ead) SELECT vTicketFk, t.companyFk, a.id, t.addressFk, vLanded FROM vn.ticket t - JOIN vn.warehouse w ON w.id = t.warehouseFk - JOIN vn.address a ON a.id = w.addressFk + JOIN vn.warehouse w ON w.id = t.warehouseFk + JOIN vn.address a ON a.id = w.addressFk WHERE t.id = vTicketFk; - + SELECT LAST_INSERT_ID(); - + END IF; - + ELSE - + INSERT INTO vn.cmr(ead) VALUES(vLanded); - + SELECT LAST_INSERT_ID(); - + END IF; END ;; DELIMITER ; @@ -48332,8 +48843,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `cmr_sendOverview` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -48341,13 +48850,15 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `cmr_sendOverview`() BEGIN /** * Insert the monthly CMR summary in vn.mail on the 5th of each month. */ - + SET SESSION group_concat_max_len = 1000000; -- IF (DAY(util.VN_CURDATE()) = 5) THEN INSERT INTO @@ -48375,7 +48886,7 @@ BEGIN CMR Ticket ' - , GROUP_CONCAT(' ', c.id, ' ', c.ticketFk, ' ' ORDER BY c.id SEPARATOR '' ), + , GROUP_CONCAT(' ', c.id, ' ', c.ticketFk, ' ' ORDER BY c.id SEPARATOR '' ), '

@@ -48393,7 +48904,7 @@ BEGIN -- Actualizamos el estado a 'Enviado' UPDATE vn.cmr c SET c.state = 'Sent' - WHERE c.state = 'Pending' + WHERE c.state = 'Pending' AND MONTH(c.created) = MONTH(util.VN_CURDATE() - INTERVAL 1 MONTH) AND YEAR(c.created) = YEAR(util.VN_CURDATE() - INTERVAL 1 MONTH); -- END IF; @@ -48403,8 +48914,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `collectionPlacement_get` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -48412,11 +48921,13 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `collectionPlacement_get`(vParamFk INT(11), vIsPicker bool) BEGIN /** Devuelve el listado de ubicaciones a las que hay que ir para preparar una colección o ticket - * + * * @param vParamFk Identificador de vn.collection o Identificador de vn.ticket * @param vIsPicker Booleano para distinguer el sacador del revisador */ @@ -48433,7 +48944,7 @@ BEGIN FROM vn.ticketCollection tc JOIN vn.sale s ON s.ticketFk = tc.ticketFk WHERE tc.collectionFk = vParamFk - UNION ALL + UNION ALL SELECT s.ticketFk, s.id, s.itemFk, s.quantity FROM vn.sale s WHERE s.ticketFk = vParamFk; @@ -48458,8 +48969,8 @@ BEGIN (INDEX(itemFk)) ENGINE = MEMORY SELECT b.itemFk, - CASE b.groupingMode - WHEN 0 THEN 1 + CASE b.groupingMode + WHEN 0 THEN 1 WHEN 2 THEN b.packing ELSE b.`grouping` END AS `grouping` @@ -48499,10 +49010,10 @@ BEGIN , st.saleFk as salePreviousPrepared , iss.userFk , ts.quantity - FROM tmp.sale ts - LEFT JOIN (SELECT DISTINCT saleFk + FROM tmp.sale ts + LEFT JOIN (SELECT DISTINCT saleFk FROM vn.saleTracking st - JOIN vn.state s ON s.id = st.stateFk + JOIN vn.state s ON s.id = st.stateFk WHERE st.isChecked AND s.semaphore = 1) st ON st.saleFk = ts.saleFk JOIN vn.itemShelving ish ON ish.itemFk = ts.itemFk @@ -48523,13 +49034,13 @@ BEGIN SELECT saleFk, priority as olderPriority FROM (SELECT saleFk, priority FROM tmp.salePlacementList - ORDER BY isPreviousPrepared DESC, + ORDER BY isPreviousPrepared DESC, itemShelvingSaleFk IS NULL DESC, - visible >= quantity DESC, + visible >= quantity DESC, visible > 0 DESC, IFNULL(shelvingPriority,0) DESC, priority - LIMIT 10000000000000000000 + LIMIT 10000000000000000000 ) sub GROUP BY saleFk; @@ -48538,7 +49049,7 @@ BEGIN ENGINE MEMORY SELECT s1.saleFk, `order`as saleOrder FROM tmp.salePlacementList s1 - JOIN tmp.salePlacementList_2 s2 ON s2.saleFk = s1.saleFk AND s2.olderPriority = s1.priority; + JOIN tmp.salePlacementList_2 s2 ON s2.saleFk = s1.saleFk AND s2.olderPriority = s1.priority; UPDATE tmp.salePlacementList s1 JOIN tmp.salePlacementList_3 s3 ON s3.saleFk = s1.saleFk @@ -48552,10 +49063,10 @@ BEGIN FROM tmp.salePlacementList spl JOIN vn.sale s ON s.id = spl.saleFk ORDER BY saleOrder, - isPreviousPrepared DESC, + isPreviousPrepared DESC, itemShelvingSaleFk DESC, IF(vIsPicker, visible = 0, TRUE), - s.quantity <= spl.visible DESC, + s.quantity <= spl.visible DESC, shelvingPriority DESC, -- PAK 05/11/2021 priority; @@ -48573,8 +49084,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `collection_addItem` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -48582,41 +49091,41 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `collection_addItem`(vItemFk INT, vQuantity INT, vTicketFk INT) BEGIN DECLARE vConcept VARCHAR(50); DECLARE itemFk INT; DECLARE vSaleFk INT default 0; - + DECLARE vDescription VARCHAR(50); DECLARE vItemName VARCHAR(50); - + SELECT barcodeToItem(vItemFk) INTO itemFk; - + SELECT CONCAT(vn.getUser()," ",DATE_FORMAT(util.VN_NOW( ), "%H:%i" )," ",i.name) INTO vConcept FROM vn.item i WHERE i.id = itemFk; - + SELECT name INTO vItemName FROM vn.item WHERE id = vItemFk; SELECT CONCAT("Añadido articulo ", vItemName, " cantidad:", vQuantity) INTO vDescription; - - INSERT INTO vn.ticketLog (originFk, userFk, action , description) + + INSERT INTO vn.ticketLog (originFk, userFk, action , description) VALUES(vTicketFk, vn.getUser(), 'update', vDescription); - + INSERT INTO vn.sale (itemFk,ticketFk,concept,quantity,isAdded) VALUES (itemFk,vTicketFk,vConcept,vQuantity,1); SELECT last_insert_id() INTO vSaleFk; - + CALL vn.sale_calculateComponent(vSaleFk, null); - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `collection_assign` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -48624,9 +49133,11 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `collection_assign`(vUserFk INT, OUT vCollectionFk INT) -proc:BEGIN +proc:BEGIN /* Comprueba si existen colecciones libres que se ajustan al perfil del usuario * y le asigna la más antigua. * Añade un registro al semillero de colecciones @@ -48654,19 +49165,19 @@ proc:BEGIN END IF; -- Se eliminan las colecciones sin asignar que estan obsoletas - INSERT INTO vncontrol.inter(state_id, Id_Ticket) + INSERT INTO ticketTracking(stateFk, ticketFk) SELECT s.id, tc.ticketFk FROM vn.collection c JOIN vn.ticketCollection tc ON tc.collectionFk = c.id JOIN vn.state s ON s.code = 'PRINTED_AUTO' - JOIN vn.productionConfig pc - WHERE c.workerFk IS NULL + JOIN vn.productionConfig pc + WHERE c.workerFk IS NULL AND TIMEDIFF(util.VN_NOW(), c.created) > pc.maxNotAssignedCollectionLifeTime; DELETE c.* FROM vn.collection c - JOIN vn.productionConfig pc - WHERE c.workerFk IS NULL + JOIN vn.productionConfig pc + WHERE c.workerFk IS NULL AND TIMEDIFF(util.VN_NOW(), c.created) > pc.maxNotAssignedCollectionLifeTime; -- Se a�ade registro al semillero @@ -48676,8 +49187,8 @@ proc:BEGIN -- Comprueba si hay colecciones disponibles que se ajustan a su configuracion SELECT MIN(c.id) INTO vCollectionFk - FROM vn.collection c - JOIN vn.operator o + FROM vn.collection c + JOIN vn.operator o ON (o.itemPackingTypeFk = c.itemPackingTypeFk OR c.itemPackingTypeFk IS NULL) AND o.numberOfWagons = c.wagons AND o.trainFk = c.trainFk @@ -48700,8 +49211,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `collection_get` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -48709,14 +49218,16 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `collection_get`(vWorkerFk INT) BEGIN - + /* Obtiene colección del sacador si tiene líneas pendientes - * + * * @param vWorkerFk id del worker - * + * * @table Devuelve tabla temporal con las colecciones pendientes. */ DROP TEMPORARY TABLE IF EXISTS tCollection; @@ -48724,18 +49235,18 @@ BEGIN CREATE TEMPORARY TABLE tCollection SELECT c.id collectionFk, date(c.created) created - FROM collection c - JOIN ticketCollection tc ON tc.collectionFk = c.id - JOIN sale s ON s.ticketFk = tc.ticketFk + FROM collection c + JOIN ticketCollection tc ON tc.collectionFk = c.id + JOIN sale s ON s.ticketFk = tc.ticketFk JOIN ticketState ts ON ts.ticketFk = tc.ticketFk JOIN state s2 ON s2.id = ts.stateFk JOIN productionConfig pc JOIN vn.state ss on ss.code = 'PREPARED' LEFT JOIN vn.saleTracking st on st.saleFk = s.id AND st.stateFk = ss.id - WHERE c.workerFk = vWorkerFk + WHERE c.workerFk = vWorkerFk AND TIMESTAMPDIFF(HOUR, c.created , util.VN_NOW()) < pc.pendingCollectionsAge AND s.quantity != 0 - AND s2.order < pc.pendingCollectionsOrder + AND s2.order < pc.pendingCollectionsOrder GROUP BY c.id HAVING COUNT(*) > COUNT(DISTINCT st.id); @@ -48746,8 +49257,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `collection_getTickets` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -48755,6 +49264,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `collection_getTickets`(vParamFk INT) BEGIN @@ -48762,15 +49273,15 @@ BEGIN * Selecciona los tickets de una colección/ticket * @param vParamFk ticketFk/collectionFk * @return Retorna ticketFk, level, agencyName, warehouseFk, salesPersonFk, observaciones - */ + */ DECLARE vItemPackingTypeFk VARCHAR(1); -- Si los sacadores son los de pruebas, pinta los colores SELECT itemPackingTypeFk INTO vItemPackingTypeFk - FROM vn.collection + FROM vn.collection WHERE id = vParamFk; - SELECT t.id ticketFk, + SELECT t.id ticketFk, IF (!(vItemPackingTypeFk <=> 'V'), cc.code,CONCAT(SUBSTRING('ABCDEFGH',tc.wagon, 1),'-',tc.`level` )) `level`, am.name agencyName, t.warehouseFk, @@ -48780,20 +49291,20 @@ BEGIN FROM vn.ticket t LEFT JOIN vn.ticketCollection tc ON t.id = tc.ticketFk LEFT JOIN vn.collection c2 ON c2.id = tc.collectionFk -- PAK 23/12/21 - LEFT JOIN vn.collectionColors cc - ON cc.wagon = tc.wagon - AND cc.shelve = tc.`level` + LEFT JOIN vn.collectionColors cc + ON cc.wagon = tc.wagon + AND cc.shelve = tc.`level` AND cc.trainFk = c2.trainFk -- PAK 23/12/21 - LEFT JOIN vn.zone z ON z.id = t.zoneFk + LEFT JOIN vn.zone z ON z.id = t.zoneFk LEFT JOIN vn.agencyMode am ON am.id = z.agencyModeFk LEFT JOIN vn.client c ON c.id = t.clientFk LEFT JOIN vn.worker w ON w.id = c.salesPersonFk - LEFT JOIN vn.ticketObservation tob ON tob.ticketFk = t.id + LEFT JOIN vn.ticketObservation tob ON tob.ticketFk = t.id AND tob.observationTypeFk = 1 - WHERE t.id = vParamFk + WHERE t.id = vParamFk AND t.shipped >= util.yesterday() UNION ALL - SELECT t.id ticketFk, + SELECT t.id ticketFk, IF(!(vItemPackingTypeFk <=> 'V'), cc.code, CONCAT(SUBSTRING('ABCDEFGH', tc.wagon, 1), '-', tc.`level`)) `level`, am.name agencyName, t.warehouseFk, @@ -48803,15 +49314,15 @@ BEGIN FROM vn.ticket t JOIN vn.ticketCollection tc ON t.id = tc.ticketFk LEFT JOIN vn.collection c2 ON c2.id = tc.collectionFk -- PAK 23/12/21 - LEFT JOIN vn.collectionColors cc - ON cc.wagon = tc.wagon - AND cc.shelve = tc.`level` + LEFT JOIN vn.collectionColors cc + ON cc.wagon = tc.wagon + AND cc.shelve = tc.`level` AND cc.trainFk = c2.trainFk -- PAK 23/12/21 - LEFT JOIN vn.zone z ON z.id = t.zoneFk + LEFT JOIN vn.zone z ON z.id = t.zoneFk LEFT JOIN vn.agencyMode am ON am.id = z.agencyModeFk LEFT JOIN vn.client c ON c.id = t.clientFk LEFT JOIN vn.worker w ON w.id = c.salesPersonFk - LEFT JOIN vn.ticketObservation tob ON tob.ticketFk = t.id + LEFT JOIN vn.ticketObservation tob ON tob.ticketFk = t.id AND tob.observationTypeFk = 1 WHERE tc.collectionFk = vParamFk; @@ -48821,8 +49332,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `collection_kill` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -48830,31 +49339,31 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `collection_kill`(vSelf INT) BEGIN - + /* Elimina una coleccion y coloca sus tickets en OK - * + * */ - - INSERT INTO vncontrol.inter(state_id, Id_Ticket) + + INSERT INTO ticketTracking(stateFk, ticketFk) SELECT s.id, ticketFk FROM vn.ticketCollection tc JOIN vn.state s ON s.code = 'OK' WHERE tc.collectionFk = vSelf; - - DELETE FROM vn.collection + + DELETE FROM vn.collection WHERE id = vSelf; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `collection_make` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -48862,6 +49371,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `collection_make`() proc:BEGIN @@ -48934,135 +49445,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; -/*!50003 DROP PROCEDURE IF EXISTS `collection_missingTrash` */; -/*!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 = utf8mb4 */ ; -/*!50003 SET character_set_results = utf8mb4 */ ; -/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; -DELIMITER ;; -CREATE DEFINER=`root`@`localhost` PROCEDURE `collection_missingTrash`( - vSaleFk BIGINT, - vQuantity INT, - vIsTrash BOOLEAN, - vWarehouseFk INT, - vNewQuantity INT) -BEGIN -/** -* Modifica la cantidad de una sale tirándola a faltas o basura -* -* @param vSaleFk el id de la sale -* @param vQuantity cantidad que se va a tirar a faltas o basura -* @param vWarehouseFk id warehouse -* @param vNewQuantity cantidad que se queda en el ticket original -*/ - DECLARE vTicketFk INT; - DECLARE vClientFk INT DEFAULT 400; - DECLARE vClientName VARCHAR(50); - DECLARE vConsignatario INT; - DECLARE vOriginalQuantity INT; - DECLARE vDescription VARCHAR(100); - DECLARE vCompanyVnlFk INT; - DECLARE vOrigin INT; - - IF vIsTrash THEN - SELECT id INTO vClientFk - FROM client c - WHERE c.name='BASURA'; - END IF; - - SELECT CONCAT("Cambio cantidad del artículo ",itemFk, ", ",concept,", de ", quantity," a ", vNewQuantity), ticketFk - INTO vDescription,vOrigin - FROM sale - WHERE id = vSaleFk; - - CALL logAdd(vOrigin, 'update', 'ticket', vDescription); - - SELECT t.id INTO vTicketFk - FROM ticket t - WHERE t.created > DATE_SUB(util.VN_NOW(), INTERVAL 1 DAY) - AND t.clientFk = vClientFk - AND t.warehouseFk = vWarehouseFk - LIMIT 1; - - IF vTicketFk IS NULL THEN - SELECT c.name , co.id INTO vClientName,vConsignatario - FROM client c - JOIN address co ON c.id = co.clientFk - WHERE c.id = vClientFk - LIMIT 1; - - SELECT id INTO vCompanyVnlFk - FROM company - WHERE code = 'VNL'; - - CALL ticket_add(vClientFk, - util.VN_NOW(), vWarehouseFk, - vCompanyVnlFk, - vConsignatario, - NULL, - NULL, - NULL, - account.myUser_getId(), - TRUE, - vTicketFk); - - SELECT t.id INTO vTicketFk - FROM ticket t - WHERE t.created > DATE_SUB(util.VN_NOW(), INTERVAL 1 DAY) - AND t.clientFk = vClientFk - AND t.warehouseFk = vWarehouseFk - LIMIT 1; - END IF; - - INSERT INTO sale (itemFk, - ticketFk, - concept, - quantity, - originalQuantity, - price, - discount, - priceFixed, - reserved, - isPicked, - isPriceFixed, - created, - isAdded) - SELECT itemFk, - vTicketFk, - CONCAT(concept," ",getWorkerCode(), " ", LEFT(CAST(util.VN_NOW() AS TIME),5)), - vQuantity, - originalQuantity, - price, - discount, - priceFixed, - reserved, - isPicked, - isPriceFixed, - created, - isAdded - FROM sale s - WHERE s.id = vSaleFk; - - SELECT quantity INTO vOriginalQuantity - FROM sale - WHERE id = vSaleFk; - - UPDATE sale - SET originalQuantity = vOriginalQuantity, - quantity = vNewQuantity - WHERE id = vSaleFk; -END ;; -DELIMITER ; -/*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `collection_new` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -49070,6 +49452,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `collection_new`(vUserFk INT, OUT vCollectionFk INT) proc:BEGIN @@ -49304,8 +49688,8 @@ proc:BEGIN -- Se anulan el resto de carros libres para que sólo uno lleve un pedido excesivo DELETE tt.* FROM tTrain tt - LEFT JOIN (SELECT DISTINCT wagon - FROM tTrain + LEFT JOIN (SELECT DISTINCT wagon + FROM tTrain WHERE ticketFk IS NOT NULL ) nn ON nn.wagon = tt.wagon WHERE nn.wagon IS NULL; @@ -49335,7 +49719,7 @@ proc:BEGIN ORDER BY tt.wagon, tt.shelve; -- Actualiza el estado de los tickets - INSERT INTO vncontrol.inter(state_id, Id_Ticket, Id_Trabajador) + INSERT INTO ticketTracking(stateFk, ticketFk, workerFk) SELECT vStateFk, ticketFk, vUserFk FROM vn.ticketCollection tc WHERE tc.collectionFk = vCollectionFk; @@ -49379,8 +49763,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `collection_newSmartTag` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -49388,6 +49770,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `collection_newSmartTag`(vSectorFk INT) proc:BEGIN @@ -49400,7 +49784,7 @@ proc:BEGIN WHERE w.id = vn.getUser(); SELECT COUNT(ws.id) INTO vWagons - FROM workerShelving ws + FROM workerShelving ws WHERE ws.workerFk = vWorkerFk AND ws.collectionFk IS NULL; @@ -49430,7 +49814,7 @@ proc:BEGIN ORDER BY wagon ASC, level ASC; UPDATE vn.ticketCollection tc - JOIN tmp.smartTags ts ON tc.wagon = ts.wagon AND tc.level = ts.level + JOIN tmp.smartTags ts ON tc.wagon = ts.wagon AND tc.level = ts.level SET tc.smartTagFk = ts.code WHERE tc.collectionFk = vCollectionFk; @@ -49441,8 +49825,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `collection_newWithWagon` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -49450,6 +49832,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `collection_newWithWagon`(vSectorFk INT, vWagons INT) proc:BEGIN @@ -49477,14 +49861,14 @@ proc:BEGIN DECLARE vTrainFk INT DEFAULT 1; DECLARE vUserFk INT; DECLARE vHourMatters BOOL DEFAULT TRUE; - + SELECT pc.ticketPrintedMax * vWagons, pc.ticketTrolleyMax * vWagons, pc.maxNotReadyCollections INTO vMaxTicketPrinted, vMaxTickets, vMaxNotReadyCollections FROM vn.productionConfig pc; /*IF NOT vn.deviceProductionUser_Exists(vUserFk) THEN - + LEAVE proc; - + END IF;*/ SELECT w.code, w.id INTO vWorkerCode, vUserFk @@ -49496,44 +49880,44 @@ proc:BEGIN INTO vIsPreviousPrepared, vWarehouseFk, vItemPackingTypeFk FROM vn.sector WHERE id = vSectorFk; -- Hola - + -- Si está habilitado el modo cazador para las motos, y el usuario no esta registrado, se sale. - - IF (SELECT isTractorHuntingMode FROM vn.deviceProductionConfig dpc) AND vItemPackingTypeFk = 'H' THEN - IF (SELECT COUNT(*) FROM vn.workerWithoutTractor wwt WHERE wwt.workerFk = vUserFk) THEN + + IF (SELECT isTractorHuntingMode FROM vn.deviceProductionConfig dpc) AND vItemPackingTypeFk = 'H' THEN + IF (SELECT COUNT(*) FROM vn.workerWithoutTractor wwt WHERE wwt.workerFk = vUserFk) THEN CALL util.throw('Usuario no registrado con moto'); LEAVE proc; END IF; END IF; - - + + -- Si hay colecciones sin terminar, sale del proceso SELECT count(*) INTO vNotReadyCollections FROM ( SELECT count(DISTINCT s.id) totalRow, count(DISTINCT st.id) pickedRow - FROM vn.collection c - JOIN vn.ticketCollection tc ON tc.collectionFk = c.id - JOIN vn.sale s ON s.ticketFk = tc.ticketFk + FROM vn.collection c + JOIN vn.ticketCollection tc ON tc.collectionFk = c.id + JOIN vn.sale s ON s.ticketFk = tc.ticketFk JOIN vn.state ss ON ss.code = 'PREPARED' LEFT JOIN vn.saleTracking st ON st.saleFk = s.id AND st.stateFk = ss.id - WHERE c.workerFk = vUserFk + WHERE c.workerFk = vUserFk AND c.created >= TIMESTAMPADD(HOUR , -6,util.VN_NOW()) AND s.quantity != 0 GROUP BY c.id - HAVING totalRow > pickedRow) sub; + HAVING totalRow > pickedRow) sub; IF vMaxNotReadyCollections < vNotReadyCollections THEN - + CALL util.throw('Hay colecciones pendientes'); LEAVE proc; - + END IF; IF vIsPreviousPrepared THEN CALL util.throw('Es de preparación previa'); LEAVE proc; -- Hasta que tengamos el altillo, vamos a cancelar esta opcion - + SELECT id INTO vStateFk FROM vn.state WHERE `code` = 'PREVIOUS_PREPARATION'; @@ -49545,37 +49929,37 @@ proc:BEGIN END IF; - CALL vn.productionControl(vWarehouseFk, 0); + CALL vn.productionControl(vWarehouseFk, 0); -- Esto hay que corregirlo añadiendo un nuevo parámetro al proc. PAK 23/12/21 IF vSectorFk = 65 THEN -- Pedidos pequeños - + SET vTrainFk = 2; - + SET vHourMatters = FALSE; - - DELETE pb.* + + DELETE pb.* FROM tmp.productionBuffer pb - JOIN vn.volumeConfig vc + JOIN vn.volumeConfig vc WHERE pb.m3 * 1000 > vc.minTicketVolume; - + END IF; - -- Se obtiene nº de colección y el buffer con los pedidos preparables + -- Se obtiene nº de colección y el buffer con los pedidos preparables INSERT INTO vn.collection SET workerFk = vUserFk, itemPackingTypeFk = vItemPackingTypeFk, trainFk = vTrainFk; - + SELECT LAST_INSERT_ID() INTO vCollectionFk; - + -- 05/08/2021 PAK Jose Frau pide que los tickets de recogida en Algemesí sólo se saquen si están asignados. DELETE pb.* FROM tmp.productionBuffer pb JOIN vn.state s ON s.id = pb.state WHERE pb.agency = 'REC_ALGEMESI' AND s.code != 'PICKER_DESIGNED'; - + -- 2/3/2022 PAK Se acuerda con Pepe que los pedidos con riesgo no se sacan aunque se asignen. DELETE pb.* FROM tmp.productionBuffer pb @@ -49588,13 +49972,13 @@ proc:BEGIN JOIN vn.state s ON s.id = pb.state WHERE s.code = 'PICKER_DESIGNED' AND pb.workerCode = vWorkerCode; - + IF hasAssignedTickets THEN - - UPDATE vn.collection - SET itemPackingTypeFk = NULL + + UPDATE vn.collection + SET itemPackingTypeFk = NULL WHERE id = vCollectionFk; - + DROP TEMPORARY TABLE IF EXISTS tmp.ticketToSplit; CREATE TEMPORARY TABLE tmp.ticketToSplit SELECT pb.ticketFk @@ -49602,42 +49986,42 @@ proc:BEGIN JOIN vn.state s ON s.id = pb.state WHERE s.code = 'PICKER_DESIGNED' AND pb.workerCode = vWorkerCode - ORDER BY HH, - mm, - s.`order` DESC, + ORDER BY HH, + mm, + s.`order` DESC, pb.m3 DESC; - - WHILE (SELECT COUNT(*) FROM tmp.ticketToSplit) DO - + + WHILE (SELECT COUNT(*) FROM tmp.ticketToSplit) DO + SELECT MIN(ticketFk) INTO vTicketToSplit FROM tmp.ticketToSplit; - + CALL vn.ticket_splitItemPackingType(vTicketToSplit,IFNULL(vItemPackingTypeFk, 'H')); - + INSERT INTO vn.ticketCollection(ticketFk, collectionFk) SELECT ticketFk, vCollectionFk FROM tmp.ticketIPT - WHERE (itemPackingTypeFk = vItemPackingTypeFk) ; - + WHERE (itemPackingTypeFk = vItemPackingTypeFk) ; + DELETE FROM tmp.ticketToSplit WHERE ticketFk = vTicketToSplit; - + DROP TEMPORARY TABLE tmp.ticketIPT; - + END WHILE; - + CALL vn.productionControl(vWarehouseFk, 0); - + ELSE - + SELECT COUNT(*) INTO vPrintedTickets FROM tmp.productionBuffer pb JOIN vn.state s ON s.id = pb.state JOIN vn.agencyMode am ON am.id = pb.agencyModeFk JOIN vn.agency a ON a.id = am.agencyFk - JOIN vn.productionConfig pc + JOIN vn.productionConfig pc WHERE pb.shipped = util.VN_CURDATE() - AND (pb.ubicacion IS NOT NULL + AND (pb.ubicacion IS NOT NULL OR a.isOwn = FALSE ) AND s.isPreparable AND ( @@ -49645,27 +50029,27 @@ proc:BEGIN OR (pb.V > 0 AND vItemPackingTypeFk = 'V' AND ISNULL(pb.collectionV)) OR (pb.H = 0 AND pb.V = 0 AND pb.N > 0 AND ISNULL(pb.collectionH) AND ISNULL(pb.collectionV)) ) - AND (pc.isPreviousPreparationRequired = FALSE + AND (pc.isPreviousPreparationRequired = FALSE OR pb.previousWithoutParking = FALSE); SET vMaxTicketPrinted = vMaxTicketPrinted - vPrintedTickets; -- AutoPRINT - INSERT INTO vncontrol.inter(state_id, Id_Ticket, Id_Trabajador) + INSERT INTO ticketTracking(stateFk, ticketFk, workerFk) SELECT s2.id, pb.ticketFk, vUserFk FROM tmp.productionBuffer pb JOIN vn.agencyMode am ON am.id = pb.agencyModeFk - JOIN vn.agency a ON a.id = am.agencyFk + JOIN vn.agency a ON a.id = am.agencyFk JOIN vn.state s ON s.id = pb.state JOIN vn.state s2 ON s2.code = 'PRINTED_AUTO' JOIN vn.ticket t ON t.id = pb.ticketFk JOIN vn.ticketConfig tc JOIN vn.productionConfig pc WHERE pb.shipped = util.VN_CURDATE() - AND (LENGTH(pb.problem) = 0 + AND (LENGTH(pb.problem) = 0 OR (pb.problem = 'PEQUEÑO' AND vTrainFk = 2)) - AND (pb.ubicacion IS NOT NULL + AND (pb.ubicacion IS NOT NULL OR a.isOwn = FALSE ) AND s.isPrintable AND s.isOK @@ -49675,23 +50059,23 @@ proc:BEGIN OR (pb.H = 0 AND pb.V = 0 AND pb.N > 0 AND ISNULL(pb.collectionH) AND ISNULL(pb.collectionV)) ) AND t.created < TIMESTAMPADD(MINUTE, - tc.pickingDelay , util.VN_NOW()) - AND (pc.isPreviousPreparationRequired = FALSE + AND (pc.isPreviousPreparationRequired = FALSE OR pb.previousWithoutParking = FALSE) - ORDER BY HH, + ORDER BY HH, mm, s.`order` DESC, pb.m3 DESC LIMIT vMaxTicketPrinted; - + -- Se seleccionan los primeros tickets, asignando colección para dejarlos bloqueados a otros sacadores. -- Se splitan los tickets preparables, para que solo tengan un tipo de empaquetado - + DROP TEMPORARY TABLE IF EXISTS tmp.ticketToSplit; CREATE TEMPORARY TABLE tmp.ticketToSplit SELECT pb.ticketFk, (pb.H + pb.V = 0) isNeutral FROM tmp.productionBuffer pb JOIN vn.agencyMode am ON am.id = pb.agencyModeFk - JOIN vn.agency a ON a.id = am.agencyFk + JOIN vn.agency a ON a.id = am.agencyFk JOIN vn.ticketStateToday tst ON tst.ticket = pb.ticketFk JOIN vn.state s ON s.id = tst.state JOIN vn.productionConfig pc @@ -49700,46 +50084,46 @@ proc:BEGIN OR (pb.V > 0 AND vItemPackingTypeFk = 'V' AND ISNULL(pb.collectionV)) OR (pb.H = 0 AND pb.V = 0 AND pb.N > 0 AND ISNULL(pb.collectionH) AND ISNULL(pb.collectionV)) ) - AND (pb.ubicacion IS NOT NULL + AND (pb.ubicacion IS NOT NULL OR a.isOwn = FALSE ) AND LENGTH(pb.problem) = 0 AND s.isPreparable - AND (pc.isPreviousPreparationRequired = FALSE + AND (pc.isPreviousPreparationRequired = FALSE OR pb.previousWithoutParking = FALSE) ORDER BY pb.HH, pb.mm, s.`order` DESC LIMIT vMaxTickets; - - WHILE (SELECT COUNT(*) FROM tmp.ticketToSplit) DO - + + WHILE (SELECT COUNT(*) FROM tmp.ticketToSplit) DO + SELECT MIN(ticketFk) INTO vTicketToSplit FROM tmp.ticketToSplit; - - - IF (SELECT isNeutral - FROM tmp.ticketToSplit + + + IF (SELECT isNeutral + FROM tmp.ticketToSplit WHERE ticketFk = vTicketToSplit) THEN - + INSERT INTO vn.ticketCollection(ticketFk, collectionFk) VALUES(vTicketToSplit, vCollectionFk); - + ELSE - + CALL vn.ticket_splitItemPackingType(vTicketToSplit, vItemPackingTypeFk); - + INSERT INTO vn.ticketCollection(ticketFk, collectionFk) SELECT ticketFk, vCollectionFk FROM tmp.ticketIPT WHERE itemPackingTypeFk = vItemPackingTypeFk; - + DROP TEMPORARY TABLE tmp.ticketIPT; - + END IF; - + DELETE FROM tmp.ticketToSplit WHERE ticketFk = vTicketToSplit; - + END WHILE; - + END IF; -- Creamos una tabla temporal con los datos que necesitamos para depurar la colección @@ -49766,20 +50150,20 @@ proc:BEGIN SELECT t.ticketFk, SUM(s.quantity * vc.shelveVolume / i.packingShelve) shelveLiters FROM tmp.ticket t JOIN vn.sale s ON s.ticketFk = t.ticketFk - JOIN vn.item i ON i.id = s.itemFk + JOIN vn.item i ON i.id = s.itemFk JOIN vn.volumeConfig vc - WHERE i.packingShelve + WHERE i.packingShelve GROUP BY t.ticketFk; - UPDATE tmp.ticket t + UPDATE tmp.ticket t JOIN tmp.ticketShelveLiters tsl ON tsl.ticketFk = t.ticketFk SET t.shelveLiters = tsl.shelveLiters; -- Es importante que el primer ticket se coja en todos los casos - + SET vFirstTicketFk = 0; - SELECT ticketFk, HH, mm + SELECT ticketFk, HH, mm INTO vFirstTicketFk, vHour, vMinute FROM tmp.ticket ORDER BY productionOrder DESC, HH, mm @@ -49787,47 +50171,47 @@ proc:BEGIN -- Hay que excluir aquellos que no tengan la misma hora de preparación IF vHourMatters THEN - - DELETE + + DELETE FROM tmp.ticket - WHERE HH != vHour + WHERE HH != vHour OR mm != vMinute; - + END IF; - + -- En el caso de pedidos de más volumen de un carro, la colección será monoticket. Pero si el primer pedido -- no es monoticket, excluimos a los de más de un carro IF (SELECT (t.shelveLiters > vc.trolleyM3 * 1000) FROM tmp.ticket t - JOIN vn.volumeConfig vc + JOIN vn.volumeConfig vc WHERE t.ticketFk = vFirstTicketFk) THEN - DELETE - FROM tmp.ticket + DELETE + FROM tmp.ticket WHERE ticketFk != vFirstTicketFk; - + ELSE - + DELETE t.* - FROM tmp.ticket t - JOIN vn.volumeConfig vc + FROM tmp.ticket t + JOIN vn.volumeConfig vc WHERE t.shelveLiters > vc.trolleyM3 * 1000; - + END IF; -- Elimina los tickets bloqueados que no se van a preparar - DELETE tc.* + DELETE tc.* FROM vn.ticketCollection tc LEFT JOIN tmp.ticket t ON t.ticketFk = tc.ticketFk WHERE tc.collectionFk = vCollectionFk AND t.ticketFk IS NULL; - + -- Construccion del tren - + -- Establece altura máxima por pedido, porque las plantas no se pueden recostar. UPDATE tmp.ticket t JOIN - ( SELECT MAX(i.size) maxHeigth, + ( SELECT MAX(i.size) maxHeigth, tc.ticketFk FROM vn.ticketCollection tc JOIN vn.sale s ON s.ticketFk = tc.ticketFk @@ -49836,11 +50220,11 @@ proc:BEGIN AND tc.collectionFk = vCollectionFk GROUP BY tc.ticketFk) sub ON sub.ticketFk = t.ticketFk SET t.height = IFNULL(sub.maxHeigth,0); - + -- Vamos a generar una tabla con todas las posibilidades de asignacion de pedido DROP TEMPORARY TABLE IF EXISTS tmp.wagonsVolumetry; CREATE TEMPORARY TABLE tmp.wagonsVolumetry - SELECT cv.`level` as shelve, + SELECT cv.`level` as shelve, 1 as wagon, cv.`lines`, cv.liters, @@ -49856,7 +50240,7 @@ proc:BEGIN SET vWagonCounter = vWagonCounter + 1; INSERT INTO tmp.wagonsVolumetry(shelve, wagon, `lines`, liters, height) - SELECT cv.`level` as shelve, + SELECT cv.`level` as shelve, vWagonCounter as wagon, cv.`lines`, cv.liters, @@ -49872,11 +50256,11 @@ proc:BEGIN SELECT ticketFk, shelve, wagon, linesDif, LitersDif, heightDif FROM ( SELECT t.ticketFk, - wv.shelve, + wv.shelve, wv.wagon, t.productionOrder, - CAST(wv.`lines` AS SIGNED) - t.`lines` as linesDif, - CAST(wv.liters AS SIGNED) - t.shelveLiters as litersDif, + CAST(wv.`lines` AS SIGNED) - t.`lines` as linesDif, + CAST(wv.liters AS SIGNED) - t.shelveLiters as litersDif, CAST(wv.height AS SIGNED) - t.height as heightDif FROM tmp.wagonsVolumetry wv JOIN tmp.ticket t @@ -49885,14 +50269,14 @@ proc:BEGIN AND litersDif >= 0 AND heightDif >= 0 ORDER BY productionOrder DESC, linesDif, LitersDif, heightDif ; - + -- Insertamos una opcion virtual para carro completo. Todo ticket tiene que poder entrar en un carro completo.... INSERT INTO tmp.ticketShelve(ticketFk, shelve, wagon, linesDif, LitersDif, heightDif) SELECT t.ticketFk, 0, wv.wagon, 999, 999,999 FROM tmp.ticket t JOIN tmp.wagonsVolumetry wv GROUP BY t.ticketFk, wv.wagon; - + SET vWagonCounter = 0; WHILE vWagonCounter < vWagons DO @@ -49908,57 +50292,57 @@ proc:BEGIN AND wagon = vWagonCounter ORDER BY heightDif, litersDif, linesDif LIMIT 1; - + ELSE SELECT shelve, ticketFk INTO vShelve, vFirstTicketFk FROM tmp.ticketShelve WHERE wagon = vWagonCounter - ORDER BY heightDif, litersDif, linesDif + ORDER BY heightDif, litersDif, linesDif LIMIT 1; END IF; IF vShelve > 0 THEN - - UPDATE tmp.ticket + + UPDATE tmp.ticket SET shelve = vShelve, wagon = vWagonCounter WHERE ticketFk = vFirstTicketFk; - + DELETE FROM tmp.ticketShelve WHERE ticketFk = vFirstTicketFk OR (shelve = vShelve AND wagon = vWagonCounter); - + WHILE (SELECT COUNT(*) FROM tmp.ticketShelve WHERE wagon = vWagonCounter) DO - + SELECT ticketFk, shelve INTO vTicket, vShelve FROM tmp.ticketShelve WHERE wagon = vWagonCounter LIMIT 1; - - UPDATE tmp.ticket + + UPDATE tmp.ticket SET shelve = vShelve, wagon = vWagonCounter WHERE ticketFk = vTicket; - + DELETE FROM tmp.ticketShelve WHERE ticketFk = vTicket OR (shelve = vShelve AND wagon = vWagonCounter); - + END WHILE; ELSE - - UPDATE tmp.ticket + + UPDATE tmp.ticket SET shelve = 1, wagon = vWagonCounter WHERE ticketFk = vFirstTicketFk; DELETE FROM tmp.ticketShelve WHERE ticketFk = vFirstTicketFk AND wagon != vWagonCounter; - + END IF; END WHILE; @@ -49967,68 +50351,68 @@ proc:BEGIN DELETE FROM tmp.ticket WHERE shelve = 0; -- Elimina los tickets bloqueados que no se van a preparar - DELETE tc.* + DELETE tc.* FROM vn.ticketCollection tc LEFT JOIN tmp.ticket t ON t.ticketFk = tc.ticketFk WHERE tc.collectionFk = vCollectionFk AND t.ticketFk IS NULL; -- Elimina los tickets que ya estan en otra coleccion - DELETE tc.* + DELETE tc.* FROM vn.ticketCollection tc - JOIN vn.ticketCollection tc2 ON tc2.ticketFk = tc.ticketFk + JOIN vn.ticketCollection tc2 ON tc2.ticketFk = tc.ticketFk WHERE tc.collectionFk = vCollectionFk AND tc2.collectionFk != vCollectionFk; - + -- Actualiza el estado de la colección UPDATE vn.collection c JOIN vn.state st ON st.code = 'ON_PREPARATION' SET c.stateFk = st.id - WHERE c.id = vCollectionFk; + WHERE c.id = vCollectionFk; -- Asigna las bandejas UPDATE vn.ticketCollection tc JOIN tmp.ticket t ON t.ticketFk = tc.ticketFk - SET tc.level = t.shelve, + SET tc.level = t.shelve, tc.wagon = t.wagon, tc.itemCount = t.`lines`, tc.liters = t.shelveLiters; -- Actualiza el estado de los tickets - INSERT INTO vncontrol.inter(state_id, Id_Ticket, Id_Trabajador) + INSERT INTO ticketTracking(stateFk, ticketFk, workerFk) SELECT vStateFk, ticketFk, vUserFk - FROM vn.ticketCollection tc + FROM vn.ticketCollection tc WHERE tc.collectionFk = vCollectionFk; - + -- Aviso para la preparacion previa INSERT INTO vn.ticketDown(ticketFk, collectionFk) SELECT tc.ticketFk, tc.collectionFk FROM vn.ticketCollection tc WHERE tc.collectionFk = vCollectionFk; - IF (SELECT count(*) FROM vn.ticketCollection WHERE collectionFk = vCollectionFk) THEN + IF (SELECT count(*) FROM vn.ticketCollection WHERE collectionFk = vCollectionFk) THEN CALL vn.sales_mergeByCollection(vCollectionFk); UPDATE vn.collection c - JOIN (SELECT count(*) saleTotalCount , + JOIN (SELECT count(*) saleTotalCount , sum(s.isPicked != 0) salePickedCount FROM vn.ticketCollection tc JOIN vn.sale s ON s.ticketFk = tc.ticketFk WHERE tc.collectionFk = vCollectionFk AND s.quantity > 0 - ) sub - SET c.saleTotalCount = sub.saleTotalCount, + ) sub + SET c.saleTotalCount = sub.saleTotalCount, c.salePickedCount = sub.salePickedCount WHERE c.id = vCollectionFk; - - SELECT vCollectionFk; + + SELECT vCollectionFk; ELSE CALL util.throw('No ha sido posible obtener colección'); DELETE FROM vn.collection WHERE id = vCollectionFk; - + END IF; DROP TEMPORARY TABLE @@ -50038,16 +50422,14 @@ proc:BEGIN tmp.wagonsVolumetry, tmp.ticketShelve, tmp.productionBuffer; - - + + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `collection_printSticker` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -50055,39 +50437,45 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; -CREATE DEFINER=`root`@`localhost` PROCEDURE `collection_printSticker`(vSelf INT) +CREATE DEFINER=`root`@`localhost` PROCEDURE `collection_printSticker`( + vSelf INT, + vLabelCount INT +) BEGIN /** - * Prints a yellow label from a collection or a ticket + * Prints a yellow label from a collection or a ticket * * @param vSelf collection or ticket + * @param vLabelCount number of times the collection has been printed */ - DECLARE vPrinterFk INT; + DECLARE vPrintArgs JSON DEFAULT JSON_OBJECT('collectionOrTicketFk', vSelf); - SELECT w.labelerFk INTO vPrinterFk FROM worker w WHERE w.id = account.myUser_getId(); + IF vLabelCount IS NULL THEN + INSERT INTO ticketTrolley + SELECT ticketFk, 1 + FROM ticketCollection + WHERE collectionFk = vSelf + ON DUPLICATE KEY UPDATE labelCount = labelCount + 1; + ELSE + SET vPrintArgs = JSON_MERGE_PATCH(vPrintArgs, JSON_OBJECT('labelCount', vLabelCount)); + END IF; CALL report_print( - 'LabelCollection', - vPrinterFk, - account.myUser_getId(), - JSON_OBJECT('collectionFk', vSelf), - 'high' - ); - - INSERT INTO ticketTrolley(ticket, labelCount) - SELECT ticketFk, 1 - FROM ticketCollection - WHERE collectionFk = vSelf - ON DUPLICATE KEY UPDATE labelCount = labelCount + 1; + 'LabelCollection', + (SELECT w.labelerFk FROM worker w WHERE w.id = account.myUser_getId()), + account.myUser_getId(), + vPrintArgs, + 'high' + ); END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `collection_setParking` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -50095,6 +50483,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `collection_setParking`(IN `vCollectionFk` VARCHAR(8), IN `vParkingFk` INT) proc: BEGIN @@ -50114,8 +50504,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `collection_updateSale` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -50123,41 +50511,43 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `collection_updateSale`( vSaleFk INT, - vOriginalQuantity INT, - vWorkerFk INT, - vStateFk INT, - vTicketFk INT) + vOriginalQuantity INT, + vWorkerFk INT, + vStateFk INT, + vTicketFk INT) BEGIN - DECLARE vNumPrepared INT; + DECLARE vNumPrepared INT; DECLARE vNumTotal INT; - REPLACE INTO vn.saleTracking(saleFk,isChecked, originalQuantity, workerFk, actionFk,stateFk) - VALUES(vSaleFk,1,vOriginalQuantity,vWorkerFk,vStateFk,vStateFk); + REPLACE INTO vn.saleTracking(saleFk, isChecked, originalQuantity, workerFk, stateFk) + VALUES(vSaleFk,1,vOriginalQuantity,vWorkerFk,vStateFk); - UPDATE vn.sale SET isPicked = 1 - WHERE id = vSaleFk; + UPDATE vn.sale SET isPicked = 1 + WHERE id = vSaleFk; SELECT COUNT(s.id) INTO vNumPrepared - FROM vn.sale s - WHERE s.ticketFk = vTicketFk AND s.isPicked = 1; + FROM vn.sale s + WHERE s.ticketFk = vTicketFk AND s.isPicked = 1; - SELECT COUNT(s.id) INTO vNumTotal - FROM vn.sale s - WHERE s.ticketFk = vTicketFk; + SELECT COUNT(s.id) INTO vNumTotal + FROM vn.sale s + WHERE s.ticketFk = vTicketFk; - IF vNumPrepared = vNumTotal THEN + IF vNumPrepared = vNumTotal THEN - INSERT INTO vncontrol.inter - SET state_id = vStateFk, Id_Ticket = vTicketFk, Id_Trabajador = vWorkerFk; + INSERT INTO ticketTracking + SET stateFk = vStateFk, ticketFk = vTicketFk, workerFk = vWorkerFk; - CALL vn.collection_update(vTicketFk); + CALL vn.collection_update(vTicketFk); END IF; - + END ;; DELIMITER ; @@ -50165,8 +50555,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `company_getFiscaldata` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -50174,28 +50562,30 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `company_getFiscaldata`(workerFk INT) BEGIN - + DECLARE vCompanyFk INT; - - SELECT IFNULL(uc.companyFk, rc.defaultCompanyFk) + + SELECT IFNULL(uc.companyFk, rc.defaultCompanyFk) INTO vCompanyFk FROM vn.routeConfig rc LEFT JOIN userConfig uc ON uc.userFk = workerFk; - - + + SELECT s.name AS name , s.NIF AS nif , s.street AS street , s.city AS city , - s.postCode AS postCode - - FROM vn.company c + s.postCode AS postCode + + FROM vn.company c JOIN vn.worker w ON w.id = c.workerManagerFk - JOIN vn.supplier s ON s.id = c.id + JOIN vn.supplier s ON s.id = c.id WHERE c.id = vCompanyFk; END ;; DELIMITER ; @@ -50203,8 +50593,215 @@ 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 PROCEDURE IF EXISTS `company_getSuppliersDebt` */; +/*!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 = utf8mb4 */ ; +/*!50003 SET character_set_results = utf8mb4 */ ; +/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; +DELIMITER ;; +CREATE DEFINER=`root`@`localhost` PROCEDURE `company_getSuppliersDebt`(vSelf INT, vMonthsAgo INT) +BEGIN +/** + * Generates a temporary table containing outstanding payments to suppliers. + * + * @param vSelf company id + * @param vMonthAgo time interval to be consulted + */ + DECLARE vStartingDate DATETIME DEFAULT TIMESTAMPADD (MONTH,- vMonthsAgo,util.VN_CURDATE()); + DECLARE vCurrencyEuroFk INT; + DECLARE vStartDate DATE; + DECLARE vInvalidBalances DOUBLE; + + SELECT dated, invalidBalances INTO vStartDate, vInvalidBalances FROM supplierDebtConfig; + SELECT id INTO vCurrencyEuroFk FROM currency WHERE code = 'EUR'; + + DROP TEMPORARY TABLE IF EXISTS tOpeningBalances; + CREATE TEMPORARY TABLE tOpeningBalances ( + supplierFk INT NOT NULL, + companyFk INT NOT NULL, + openingBalances DOUBLE NOT NULL, + closingBalances DOUBLE NOT NULL, + currencyFk INT NOT NULL, + PRIMARY KEY (supplierFk, companyFk, currencyFk) + ) ENGINE = MEMORY; + + -- Calculates the opening and closing balance for each supplier + INSERT INTO tOpeningBalances + SELECT supplierFk, + companyFk, + SUM(amount * isBeforeStarting) AS openingBalances, + SUM(amount) closingBalances, + currencyFk + FROM ( + SELECT p.supplierFk, + p.companyFk, + IF (p.currencyFk = vCurrencyEuroFk, p.amount, p.divisa) AS amount, + p.dueDated < vStartingDate isBeforeStarting, + p.currencyFk + FROM payment p + WHERE p.received > vStartDate + AND p.companyFk = vSelf + UNION ALL + SELECT r.supplierFk, + r.companyFk, + - IF (r.currencyFk = vCurrencyEuroFk, rv.amount, rv.foreignValue) AS Total, + rv.dueDated < vStartingDate isBeforeStarting, + r.currencyFk + FROM invoiceIn r + INNER JOIN invoiceInDueDay rv ON r.id = rv.invoiceInFk + WHERE r.issued > vStartDate + AND r.isBooked + AND r.companyFk = vSelf + ) sub GROUP BY companyFk, supplierFk, currencyFk; + + DROP TEMPORARY TABLE IF EXISTS tPendingDuedates; + CREATE TEMPORARY TABLE tPendingDuedates ( + id INT auto_increment, + expirationId INT, + dated DATE, + supplierFk INT NOT NULL, + companyFk INT NOT NULL, + amount DECIMAL(10, 2) NOT NULL, + currencyFk INT NOT NULL, + pending DECIMAL(10, 2) DEFAULT 0, + balance DECIMAL(10, 2) DEFAULT 0, + endingBalance DECIMAL(10, 2) DEFAULT 0, + isPayment BOOLEAN, + isReconciled BOOLEAN, + PRIMARY KEY (id), + INDEX (supplierFk, companyFk, currencyFk) + ) ENGINE = MEMORY; + + INSERT INTO tPendingDuedates ( + expirationId, + dated, + supplierFk, + companyFk, + amount, + currencyFk, + isPayment, + isReconciled + )SELECT p.id, + p.dueDated, + p.supplierFk, + p.companyFk, + IF (p.currencyFk = vCurrencyEuroFk, p.amount, p.divisa), + p.currencyFk, + TRUE isPayment, + p.isConciliated + FROM payment p + WHERE p.dueDated >= vStartingDate + AND p.companyFk = vSelf + UNION ALL + SELECT r.id, + rv.dueDated, + r.supplierFk, + r.companyFk, + -IF (r.currencyFk = vCurrencyEuroFk, rv.amount, rv.foreignValue), + r.currencyFk, + FALSE isPayment, + TRUE + FROM invoiceIn r + LEFT JOIN tOpeningBalances si ON r.companyFk = si.companyFk + AND r.supplierFk = si.supplierFk + AND r.currencyFk = si.currencyFk + JOIN invoiceInDueDay rv ON r.id = rv.invoiceInFk + WHERE rv.dueDated >= vStartingDate + AND (si.closingBalances IS NULL OR si.closingBalances <> 0) + AND r.isBooked + AND r.companyFk = vSelf + ORDER BY supplierFk, companyFk, companyFk, dueDated, isPayment DESC, id; + -- util.VN_NOW, we calculate the outstanding amount for each receipt in descending order + SET @risk := 0.0; + SET @supplier := 0.0; + SET @company := 0.0; + SET @moneda := 0.0; + SET @pending := 0.0; + SET @day := util.VN_CURDATE(); + + UPDATE tPendingDuedates vp + LEFT JOIN tOpeningBalances si ON vp.companyFk = si.companyFk + AND vp.supplierFk = si.supplierFk + AND vp.currencyFk = si.currencyFk + SET vp.balance = @risk := ( + IF ( + @company <> vp.companyFk + OR @supplier <> vp.supplierFk + OR @moneda <> vp.currencyFk, + IFNULL(si.openingBalances, 0), + @risk + ) + + vp.amount + ), + -- if there is a change of company or supplier or currency, the balance is reset + vp.pending = @pending := IF ( + @company <> vp.companyFk + OR @supplier <> vp.supplierFk + OR @moneda <> vp.currencyFk + OR @day <> vp.dated, + vp.amount * (NOT vp.isPayment), + @pending + vp.amount + ), + vp.companyFk = @company := vp.companyFk, + vp.supplierFk = @supplier := vp.supplierFk, + vp.currencyFk = @moneda := vp.currencyFk, + vp.dated = @day := vp.dated, + vp.balance = @risk, + vp.pending = @pending; + + CREATE OR REPLACE TEMPORARY TABLE tRowsToDelete ENGINE = MEMORY + SELECT expirationId, + dated, + supplierFk, + companyFk, + currencyFk, + balance + FROM tPendingDuedates + WHERE balance < vInvalidBalances + AND balance > - vInvalidBalances; + + DELETE vp.* + FROM tPendingDuedates vp + JOIN tRowsToDelete rd ON ( + vp.dated < rd.dated + OR (vp.dated = rd.dated AND vp.expirationId <= rd.expirationId) + ) + AND vp.supplierFk = rd.supplierFk + AND vp.companyFk = rd.companyFk + AND vp.currencyFk = rd.currencyFk + WHERE vp.isPayment = FALSE; + + SELECT vp.expirationId, + vp.dated, + vp.supplierFk, + vp.companyFk, + vp.currencyFk, + vp.amount, + vp.pending, + vp.balance, + s.payMethodFk, + vp.isPayment, + vp.isReconciled, + vp.endingBalance, + cr.amount clientRiskAmount + FROM tPendingDuedates vp + LEFT JOIN supplier s ON s.id = vp.supplierFk + LEFT JOIN vn.client c ON c.fi = s.nif + LEFT JOIN vn.clientRisk cr ON cr.clientFk = c.id; + + DROP TEMPORARY TABLE tOpeningBalances; + DROP TEMPORARY TABLE tPendingDuedates; + DROP TEMPORARY TABLE tRowsToDelete; +END ;; +DELIMITER ; +/*!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 PROCEDURE IF EXISTS `conveyorExpedition_Add` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -50212,11 +50809,13 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `conveyorExpedition_Add`(vStarted DATETIME, vEnded DATETIME) BEGIN - + DECLARE startingMinute INT; TRUNCATE vn.conveyorExpedition; @@ -50233,23 +50832,23 @@ BEGIN conveyorBuildingClassFk) SELECT e.id, e.created, - 10 * p.depth as depth, + 10 * p.depth as depth, 10 * p.width as width, 10 * p.height as height, IFNULL(t.routeFk,am.agencyFk) routeFk, hour(e.created) * 60 + minute(e.created), IFNULL(et.description , a.name), IFNULL(t.routeFk,am.agencyFk) criterion, - IFNULL(p.conveyorBuildingClassFk , pc.defaultConveyorBuildingClass) + IFNULL(p.conveyorBuildingClassFk , pc.defaultConveyorBuildingClass) FROM vn.expedition e JOIN vn.ticket t ON t.id = e.ticketFk JOIN vn.packaging p ON p.id = e.packagingFk LEFT JOIN vn.zone z ON z.id = t.zoneFk LEFT JOIN vn.agencyMode am ON am.id = z.agencyModeFk - LEFT JOIN vn.agency a ON a.id = am.agencyFk - LEFT JOIN vn.routesMonitor rm ON rm.routeFk = t.routeFk - LEFT JOIN vn.expeditionTruck et ON et.id = rm.expeditionTruckFk - JOIN vn.packagingConfig pc + LEFT JOIN vn.agency a ON a.id = am.agencyFk + LEFT JOIN vn.routesMonitor rm ON rm.routeFk = t.routeFk + LEFT JOIN vn.expeditionTruck et ON et.id = rm.expeditionTruckFk + JOIN vn.packagingConfig pc WHERE t.warehouseFk IN (60,1,44) AND e.created BETWEEN vStarted AND vEnded AND p.height < 140 @@ -50258,8 +50857,8 @@ BEGIN SELECT MIN(productionMinute) INTO startingMinute FROM vn.conveyorExpedition ce ; - - UPDATE vn.conveyorExpedition + + UPDATE vn.conveyorExpedition SET productionMinute = productionMinute - startingMinute; END ;; @@ -50268,8 +50867,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `copyComponentsFromSaleList` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -50277,6 +50874,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `copyComponentsFromSaleList`(vTargetTicketFk INT) BEGIN @@ -50315,8 +50914,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `createPedidoInterno` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -50324,11 +50921,13 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `createPedidoInterno`(vItemFk INT,vQuantity INT) BEGIN - + UPDATE vn.item SET upToDown = vQuantity WHERE id = vItemFk; END ;; @@ -50337,8 +50936,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `crypt` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -50346,57 +50943,59 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `crypt`(vText VARCHAR(255), vKey VARCHAR(255), OUT vResult VARCHAR(255) ) BEGIN DECLARE vEncryptedText VARCHAR(255) DEFAULT ''; - + DECLARE vKeyLength INT; DECLARE vKeyPosition INT DEFAULT 1; DECLARE vKeyChar VARCHAR(1); - + DECLARE vTextLength INT; DECLARE vTextPosition INT DEFAULT 1; DECLARE vTextChar VARCHAR(1); - + DECLARE vEncryptedChar VARCHAR(1); DECLARE vEncryptedCharPosition INT; - + DECLARE vChain VARCHAR(255) DEFAULT '#$.-_0123456789abcdefghijklmnopqrstuvwxyz'; DECLARE vChainTextPosition INT; DECLARE vChainKeyPosition INT; DECLARE vChainLength INT; - + DECLARE vInvalidadChars VARCHAR(255) DEFAULT ''; - - SET vTextLength = LENGTH(vText); + + SET vTextLength = LENGTH(vText); SET vKeyLength = LENGTH(vKey); SET vChainLength = LENGTH(vChain); - + WHILE vTextPosition <= vTextLength DO - + SET vTextChar = MID(vText,vTextPosition,1); SET vKeyChar = MID(vKey,vKeyPosition,1); - + SET vChainTextPosition = LOCATE(vTextChar, vChain); SET vInvalidadChars = IF(vChainTextPosition, vInvalidadChars, CONCAT(vInvalidadChars,vTextChar)); SET vChainKeyPosition = LOCATE(vKeyChar, vChain); SET vEncryptedCharPosition = vChainTextPosition + vChainKeyPosition; - + IF vEncryptedCharPosition > vChainLength THEN - + SET vEncryptedCharPosition = vEncryptedCharPosition - vChainLength; - + END IF; - + SET vEncryptedChar = MID(vChain, vEncryptedCharPosition,1); - + SET vEncryptedText = CONCAT(vEncryptedText, vEncryptedChar); - + SET vKeyPosition = IF(vKeyPosition = vKeyLength, 1,vKeyPosition + 1); SET vTextPosition = vTextPosition + 1; - + END WHILE; SET vResult = IF(LENGTH(vInvalidadChars), CONCAT('Caracteres no válidos: ',vInvalidadChars),vEncryptedText); @@ -50407,8 +51006,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `cryptOff` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -50416,54 +51013,56 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `cryptOff`(vText VARCHAR(255), vKey VARCHAR(255), OUT vResult VARCHAR(255)) BEGIN DECLARE vUncryptedText VARCHAR(255) DEFAULT ''; - + DECLARE vKeyLength INT; DECLARE vKeyPosition INT DEFAULT 1; DECLARE vKeyChar VARCHAR(1); - + DECLARE vTextLength INT; DECLARE vTextPosition INT DEFAULT 1; DECLARE vTextChar VARCHAR(1); - + DECLARE vUncryptedChar VARCHAR(1); DECLARE vUncryptedCharPosition INT; - + DECLARE vChain VARCHAR(255) DEFAULT '#$.-_0123456789abcdefghijklmnopqrstuvwxyz'; DECLARE vChainTextPosition INT; DECLARE vChainKeyPosition INT; DECLARE vChainLength INT; - - SET vTextLength = LENGTH(vText); + + SET vTextLength = LENGTH(vText); SET vKeyLength = LENGTH(vKey); SET vChainLength = LENGTH(vChain); - + WHILE vTextPosition <= vTextLength DO - + SET vTextChar = MID(vText,vTextPosition,1); SET vKeyChar = MID(vKey,vKeyPosition,1); - + SET vChainTextPosition = LOCATE(vTextChar, vChain); SET vChainKeyPosition = LOCATE(vKeyChar, vChain); SET vUncryptedCharPosition = vChainTextPosition - vChainKeyPosition; - + IF vUncryptedCharPosition < 1 THEN - + SET vUncryptedCharPosition = vUncryptedCharPosition + vChainLength; - + END IF; - + SET vUncryptedChar = MID(vChain, vUncryptedCharPosition,1); - + SET vUncryptedText = CONCAT(vUncryptedText, vUncryptedChar); - + SET vKeyPosition = IF(vKeyPosition = vKeyLength, 1,vKeyPosition + 1); SET vTextPosition = vTextPosition + 1; - + END WHILE; SET vResult = vUncryptedText; @@ -50474,8 +51073,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `department_calcTree` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -50483,6 +51080,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `department_calcTree`() BEGIN @@ -50518,8 +51117,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `department_calcTreeRec` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -50527,6 +51124,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `department_calcTreeRec`( vSelf INT, @@ -50559,7 +51158,7 @@ BEGIN OR (vSelf IS NOT NULL AND parentFk = vSelf); DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE; - + SET vSons = 0; OPEN vChildren; @@ -50570,11 +51169,11 @@ BEGIN IF vDone THEN LEAVE myLoop; END IF; - + SET vIndex = vIndex + 1; SET vLft = vIndex; SET vSons = vSons + 1; - + CALL department_calcTreeRec( vChildFk, CONCAT(vPath, vChildFk, '/'), @@ -50600,8 +51199,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `department_doCalc` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -50609,6 +51206,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `department_doCalc`() proc: BEGIN @@ -50629,7 +51228,7 @@ proc: BEGIN SELECT isChanged INTO vIsChanged FROM department_recalc; - + IF vIsChanged THEN UPDATE department_recalc SET isChanged = FALSE; CALL vn.department_calcTree; @@ -50642,8 +51241,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `department_getHasMistake` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -50651,28 +51248,28 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `department_getHasMistake`() BEGIN - + /** * Obtiene los sectores a los cuales les ponemos errores * */ - + SELECT id, name FROM department WHERE hasToMistake <> FALSE; - - + + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `department_getLeaves` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -50680,6 +51277,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `department_getLeaves`( vParentFk INT, @@ -50723,19 +51322,19 @@ BEGIN FROM department g JOIN tChilds c ON c.id = g.id WHERE g.parentFk IS NOT NULL; - + INSERT IGNORE INTO tNodes SELECT id FROM tParents; - + IF ROW_COUNT() = 0 THEN LEAVE myLoop; END IF; - + DELETE FROM tChilds; INSERT INTO tChilds SELECT id FROM tParents; END LOOP; - + DROP TEMPORARY TABLE tChilds, tParents; @@ -50762,8 +51361,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `deviceLog_add` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -50771,16 +51368,18 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `deviceLog_add`(vWorkerFk INT, vAppName VARCHAR(45), vAppVersion VARCHAR(45), vAndroid_id VARCHAR(100)) BEGIN /* * Inserta registro en tabla devicelog el log del usuario conectado * @param vAppName es el nombre de la app - * @param vAppVersion es la versión de la app - * @param vAndroid_id es el android_id del dispositivo que se ha logueado + * @param vAppVersion es la versión de la app + * @param vAndroid_id es el android_id del dispositivo que se ha logueado */ - + INSERT INTO deviceLog (userFK, nameApp, versionApp, android_id) VALUES(vWorkerFk, vAppName, vAppVersion, vAndroid_id); @@ -50791,8 +51390,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `deviceProductionUser_exists` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -50800,23 +51397,23 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `deviceProductionUser_exists`(vUserFk INT) BEGIN - + /* SELECT COUNT(*) AS UserExists - FROM vn.deviceProductionUser dpu + FROM vn.deviceProductionUser dpu WHERE dpu.userFk = vUserFk;*/ SELECT TRUE; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `deviceProductionUser_getWorker` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -50824,6 +51421,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `deviceProductionUser_getWorker`(vAndroid_id VARCHAR(50)) BEGIN @@ -50843,8 +51442,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `deviceProduction_getnameDevice` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -50852,19 +51449,21 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `deviceProduction_getnameDevice`(vAndroid_id VARCHAR(50)) BEGIN /** * Selecciona el id del dispositivo que corresponde al vAndroid_id - * - * @param vAndroid_id el número android_id del dispositivo - * + * + * @param vAndroid_id el número android_id del dispositivo + * */ - SELECT dp.id + SELECT dp.id FROM deviceProduction dp - WHERE dp.android_id = vAndroid_id; + WHERE dp.android_id = vAndroid_id; END ;; DELIMITER ; @@ -50872,8 +51471,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `device_checkLogin` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -50881,13 +51478,15 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `device_checkLogin`(vUserFk INT, vAndroidID VARCHAR(50)) BEGIN - + /* * Comprueba si está registrado el dispositivo mediante su androidId - * + * * @param vUSerFk el id del user * @param vAndroidID es el identificador android_id del dispositivo */ @@ -50899,20 +51498,20 @@ BEGIN SELECT dpc.isAllUsersallowed INTO vIsAllUsersAllowed FROM vn.deviceProductionConfig dpc; - IF NOT vIsAllUsersAllowed THEN - + IF NOT vIsAllUsersAllowed THEN + SELECT COUNT(*) INTO vIsDepartment - FROM vn.workerDepartment dp + FROM vn.workerDepartment dp JOIN department d ON d.id = dp.departmentFk WHERE dp.workerFk = vUserFk AND d.hasToCheckLogin; - + IF vIsDepartment THEN SELECT COUNT(*) INTO vIsAuthorized - FROM vn.deviceProductionUser dpu + FROM vn.deviceProductionUser dpu JOIN vn.deviceProduction dp ON dp.id = dpu.deviceProductionFk WHERE dpu.userFk = vUserFk AND dp.android_id = vAndroidID; - + IF NOT vIsAuthorized THEN SET vMessage = 'Usuario no autorizado'; END IF; @@ -50928,8 +51527,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `duaEntryValueUpdate` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -50937,20 +51534,22 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `duaEntryValueUpdate`(vDuaFk INT) BEGIN UPDATE duaEntry de - JOIN + JOIN ( SELECT b.entryFk, sum(b.quantity * b.buyingValue) as total FROM buy b JOIN duaEntry de ON de.entryFk = b.entryFk WHERE duaFk = vDuaFk GROUP BY b.entryFk ) sub ON sub.entryFk = de.entryFk - - LEFT JOIN + + LEFT JOIN (SELECT e.id, sum(iit.taxableBase) as euros FROM entry e JOIN invoiceInTax iit ON iit.invoiceInFk = e.invoiceInFk @@ -50958,19 +51557,17 @@ BEGIN WHERE de.duaFk = vDuaFk GROUP BY e.id ) sub2 ON sub2.id = de.entryFk - + SET de.value = sub.total, de.euroValue = sub2.euros WHERE duaFk = vDuaFk; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `duaInvoiceInBooking` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -50978,6 +51575,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `duaInvoiceInBooking`(vDuaFk INT) BEGIN @@ -50986,7 +51585,7 @@ BEGIN DECLARE vInvoiceFk INT; DECLARE vASIEN BIGINT DEFAULT 0; DECLARE vCounter INT DEFAULT 0; - + DECLARE rs CURSOR FOR SELECT e.invoiceInFk FROM entry e @@ -50999,7 +51598,7 @@ BEGIN DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE; OPEN rs; - + UPDATE invoiceIn ii JOIN entry e ON e.invoiceInFk = ii.id JOIN duaEntry de ON de.entryFk = e.id @@ -51011,49 +51610,47 @@ BEGIN ii.bookEntried = IFNULL(ii.bookEntried,d.bookEntried), e.isConfirmed = TRUE WHERE d.id = vDuaFk; - + SELECT IFNULL(ASIEN,0) INTO vASIEN FROM dua WHERE id = vDuaFk; - + FETCH rs INTO vInvoiceFk; - + WHILE NOT done DO CALL invoiceInBookingMain(vInvoiceFk); - + IF vCounter > 0 OR vASIEN > 0 THEN - + UPDATE vn2008.XDiario x JOIN vn.ledgerConfig lc ON lc.lastBookEntry = x.ASIEN SET x.ASIEN = vASIEN; - + ELSE - + SELECT lastBookEntry INTO vASIEN FROM vn.ledgerConfig; - + END IF; - + SET vCounter = vCounter + 1; - + FETCH rs INTO vInvoiceFk; END WHILE; - + CLOSE rs; - - UPDATE dua + + UPDATE dua SET ASIEN = vASIEN WHERE id = vDuaFk; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `duaParcialMake` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -51061,6 +51658,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `duaParcialMake`(vDuaFk INT) BEGIN @@ -51071,9 +51670,9 @@ BEGIN SELECT awbFk,companyFk FROM dua WHERE id = vDuaFk; - + SELECT LAST_INSERT_ID() INTO vNewDuaFk; - + INSERT INTO duaEntry(duaFk, entryFk, value, customsValue) SELECT vNewDuaFk, entryFk, value, value - customsValue FROM duaEntry @@ -51086,8 +51685,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `duaTaxBooking` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -51095,6 +51692,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `duaTaxBooking`(vDuaFk INT) BEGIN @@ -51102,29 +51701,29 @@ BEGIN DECLARE vBookDated DATE; DECLARE vDiff DECIMAL(10,2); DECLARE vApunte BIGINT; - + SELECT ASIEN, IFNULL(bookEntried, util.VN_CURDATE()) INTO vBookNumber, vBookDated - FROM dua + FROM dua WHERE id = vDuaFk; - + IF vBookNumber IS NULL OR NOT vBookNumber THEN CALL ledger_next(vBookNumber); END IF; - + -- Apunte de la aduana INSERT INTO XDiario( ASIEN, FECHA, SUBCTA, - CONCEPTO, + CONCEPTO, EUROHABER, SERIE, empresa_id, CLAVE, FACTURA) - SELECT + SELECT vBookNumber, d.bookEntried, '4700000999', @@ -51137,20 +51736,20 @@ BEGIN FROM duaTax dt JOIN dua d ON d.id = dt.duaFk WHERE dt.duaFk = vDuaFk; - + -- Apuntes por tipo de IVA y proveedor - + INSERT INTO XDiario( ASIEN, FECHA, SUBCTA, - CONTRA, + CONTRA, EURODEBE, BASEEURO, - CONCEPTO, - FACTURA, + CONCEPTO, + FACTURA, IVA, - AUXILIAR, + AUXILIAR, SERIE, FECHA_EX, FECHA_OP, @@ -51170,17 +51769,17 @@ BEGIN FECREGCON ) - SELECT + SELECT vBookNumber ASIEN, vBookDated FECHA, tr.account SUBCTA, '4330002067' CONTRA, sum(dt.tax) EURODEBE, - sum(dt.base) BASEEURO, + sum(dt.base) BASEEURO, CONCAT('DUA nº',d.code) CONCEPTO, d.id FACTURA, dt.rate IVA, - '*' AUXILIAR, + '*' AUXILIAR, 'D' SERIE, d.issued FECHA_EX, d.operated FECHA_OP, @@ -51207,10 +51806,10 @@ BEGIN WHERE ta.effectived <= vBookDated AND taxAreaFk = 'WORLD' ORDER BY ta.effectived DESC - LIMIT 10000000000000000000 + LIMIT 10000000000000000000 ) tba GROUP BY rate - ) tr ON tr.rate = dt.rate + ) tr ON tr.rate = dt.rate JOIN supplier s ON s.id = d.companyFk WHERE d.id = vDuaFk GROUP BY dt.rate; @@ -51218,24 +51817,22 @@ BEGIN SELECT SUM(EURODEBE) -SUM(EUROHABER), MAX(id) INTO vDiff, vApunte FROM XDiario WHERE ASIEN = vBookNumber; - + UPDATE XDiario SET BASEEURO = 100 * (EURODEBE - vDiff) / IVA, - EURODEBE = EURODEBE - vDiff + EURODEBE = EURODEBE - vDiff WHERE id = vApunte; - + UPDATE dua SET ASIEN = vBookNumber WHERE id = vDuaFk; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `duaTax_doRecalc` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -51243,26 +51840,28 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `duaTax_doRecalc`(vDuaFk INT) BEGIN /** * Borra los valores de duaTax y los vuelve a crear en base a la tabla duaEntry - * + * * @param vDuaFk Id del dua a recalcular **/ DELETE FROM duaTax WHERE duaFk = vDuaFk; - - INSERT INTO duaTax(duaFk, supplierFk, taxClassFk, base) + + INSERT INTO duaTax(duaFk, supplierFk, taxClassFk, base) SELECT vDuaFk, supplierFk, taxClassFk, sum(sub.Base) as Base FROM intrastat ist JOIN (SELECT - e.supplierFk, + e.supplierFk, i.intrastatFk, CAST(sum(b.quantity * b.buyingValue * de.customsValue / de.value) * di.amount/ tei.Base AS DECIMAL(10,2)) as Base - FROM buy b + FROM buy b JOIN item i ON i.id = b.itemFk JOIN entry e ON e.id = b.entryFk JOIN duaEntry de ON de.entryFk = e.id @@ -51270,15 +51869,15 @@ BEGIN ( SELECT i.intrastatFk, CAST(sum(b.quantity * b.buyingValue * de.customsValue / de.value) AS DECIMAL(10,2)) as Base - FROM buy b + FROM buy b JOIN item i ON i.id = b.itemFk JOIN entry e ON e.id = b.entryFk JOIN duaEntry de ON de.entryFk = e.id WHERE de.duaFk = vDuaFk GROUP BY i.intrastatFk - + ) tei ON tei.intrastatFk = i.intrastatFk - JOIN + JOIN ( SELECT intrastatFk, sum(amount) as amount FROM duaIntrastat @@ -51287,7 +51886,7 @@ BEGIN ) di ON di.intrastatFk = i.intrastatFk WHERE de.duaFk = vDuaFk GROUP BY e.supplierFk, i.intrastatFk - HAVING Base + HAVING Base ) sub ON ist.id = sub.intrastatFk GROUP BY ist.taxClassFk, sub.supplierFk; END ;; @@ -51296,8 +51895,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `ediTables_Update` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -51305,16 +51902,18 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `ediTables_Update`() BEGIN - - INSERT IGNORE INTO vn.genus(name) + + INSERT IGNORE INTO vn.genus(name) SELECT latin_genus_name FROM edi.genus ; - INSERT IGNORE INTO vn.specie(name) - SELECT LCASE(latin_species_name) + INSERT IGNORE INTO vn.specie(name) + SELECT LCASE(latin_species_name) FROM edi.specie ; END ;; DELIMITER ; @@ -51322,8 +51921,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `ektEntryAssign_setEntry` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -51331,6 +51928,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `ektEntryAssign_setEntry`() BEGIN @@ -51354,71 +51953,71 @@ DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE; OPEN cur1; read_loop: LOOP - + SET done = FALSE; SET vEntryFk = 0; - + FETCH cur1 INTO vId; - + IF done THEN LEAVE read_loop; END IF; - + SELECT IFNULL(e.id,0) INTO vEntryFk FROM vn.entry e JOIN vn.travel tr ON tr.id = e.travelFk - JOIN vn.ektEntryAssign ea ON ea.warehouseOutFk = tr.warehouseOutFk + JOIN vn.ektEntryAssign ea ON ea.warehouseOutFk = tr.warehouseOutFk AND ea.warehouseInFk = tr.warehouseInFk AND ea.agencyModeFk = tr.agencyModeFk AND ea.supplierFk = e.supplierFk WHERE ea.id = vId AND tr.landed = vLanded LIMIT 1; - + IF NOT vEntryFk THEN - + SELECT IFNULL(e.id,0) INTO vEntryFk FROM vn.entry e JOIN vn.travel tr ON tr.id = e.travelFk - JOIN vn.ektEntryAssign ea ON ea.warehouseOutFk = tr.warehouseOutFk + JOIN vn.ektEntryAssign ea ON ea.warehouseOutFk = tr.warehouseOutFk AND ea.warehouseInFk = tr.warehouseInFk AND ea.agencyModeFk = tr.agencyModeFk WHERE ea.id = vId AND tr.landed = vLanded AND ea.supplierFk IS NULL LIMIT 1; - + END IF; - + IF NOT vEntryFk THEN - + SET vTravelFk = 0; - - SELECT IFNULL(MAX(tr.id),0) INTO vTravelFk + + SELECT IFNULL(MAX(tr.id),0) INTO vTravelFk FROM vn.travel tr - JOIN vn.ektEntryAssign ea ON ea.warehouseOutFk = tr.warehouseOutFk + JOIN vn.ektEntryAssign ea ON ea.warehouseOutFk = tr.warehouseOutFk AND ea.warehouseInFk = tr.warehouseInFk AND ea.agencyModeFk = tr.agencyModeFk WHERE ea.id = vId AND tr.landed = vLanded; - + IF NOT vTravelFk THEN - + INSERT INTO vn.travel(landed, shipped, warehouseInFk, warehouseOutFk, agencyModeFk) SELECT vLanded, vLanded, warehouseInFk, warehouseOutFk, agencyModeFk - FROM vn.ektEntryAssign + FROM vn.ektEntryAssign WHERE id = vId; - - SELECT MAX(tr.id) INTO vTravelFk + + SELECT MAX(tr.id) INTO vTravelFk FROM vn.travel tr - JOIN vn.ektEntryAssign ea ON ea.warehouseOutFk = tr.warehouseOutFk + JOIN vn.ektEntryAssign ea ON ea.warehouseOutFk = tr.warehouseOutFk AND ea.warehouseInFk = tr.warehouseInFk AND ea.agencyModeFk = tr.agencyFk WHERE ea.id = vId AND tr.landed = vLanded; - + END IF; - + INSERT INTO vn.entry(travelFk, supplierFk, companyFk, currencyFk) SELECT vTravelFk, IFNULL(ea.supplierFk,s.id), c.id, cu.id FROM vn.supplier s @@ -51426,13 +52025,13 @@ OPEN cur1; JOIN vn.currency cu ON cu.code = 'EUR' JOIN vn.ektEntryAssign ea ON ea.id = vId WHERE s.name = 'KONINKLIJE COOPERATIEVE BLOEMENVEILING FLORAHOLLAN'; - - SELECT MAX(id) INTO vEntryFk + + SELECT MAX(id) INTO vEntryFk FROM vn.entry WHERE travelFk = vTravelFk; - + END IF; - + UPDATE vn.ektEntryAssign SET entryFk = vEntryFk WHERE id = vId; @@ -51440,15 +52039,13 @@ OPEN cur1; END LOOP; CLOSE cur1; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `energyMeter_record` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -51456,22 +52053,24 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `energyMeter_record`(vInput INT, vActiveTime INT) BEGIN DECLARE vConsumption INT; - + SELECT consumption INTO vConsumption FROM energyInput WHERE input = vInput; - INSERT INTO vn.energyMeter - SET - `input` = vInput, - `period` = DATE_FORMAT(util.VN_NOW(), '%Y-%m-%d %H:00:00'), + INSERT INTO vn.energyMeter + SET + `input` = vInput, + `period` = DATE_FORMAT(util.VN_NOW(), '%Y-%m-%d %H:00:00'), `activeTime` = vActiveTime, `consumption` = CAST(IFNULL((vConsumption / 3600) * vActiveTime, 0) AS DECIMAL(10,2)) - ON DUPLICATE KEY UPDATE + ON DUPLICATE KEY UPDATE `activeTime` = `activeTime` + vActiveTime, `consumption` = `consumption` + CAST(VALUES(`consumption`) AS DECIMAL(10,2)); END ;; @@ -51480,8 +52079,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `entryDelivered` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -51489,33 +52086,35 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `entryDelivered`(vDated DATE, vEntryFk INT) BEGIN DECLARE vTravelFk INT; - + SELECT travelFk INTO vTravelFk - FROM vn.entry + FROM vn.entry WHERE id = vEntryFk; - + IF (SELECT COUNT(*) FROM vn.entry WHERE travelFk = vTravelFk) = 1 THEN - + UPDATE vn.travel SET shipped = LEAST(shipped, vDated), landed = vDated WHERE id = vTravelFk; - + ELSE - + INSERT INTO vn.travel(shipped, landed, warehouseInFk, warehouseOutFk, agencyModeFk, ref, isDelivered, isReceived) SELECT LEAST(shipped, vDated), vDated, warehouseInFk, warehouseOutFk, agencyModeFk, CONCAT(account.myUser_getName(),' ', vEntryFk), TRUE, TRUE FROM vn.travel WHERE id = vTravelFk; - + SELECT LAST_INSERT_ID() INTO vTravelFk; - - UPDATE vn.entry - SET travelFk = vTravelFk + + UPDATE vn.entry + SET travelFk = vTravelFk WHERE id = vEntryFk; - + END IF; END ;; @@ -51524,8 +52123,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `entryToTicket` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -51533,6 +52130,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `entryToTicket`(vEntryFk INT, vTicketFk INT) BEGIN @@ -51544,15 +52143,13 @@ BEGIN WHERE b.entryFk = vEntryFk; CALL vn.ticket_recalcComponents(vTicketFk); - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `entryWithItem` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -51560,6 +52157,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `entryWithItem`(vShipmentWarehouse INT, vLandingWarehouse INT,vSale INT, vVolume INT, netCost DECIMAL(10,2), vInOutDate DATE) BEGIN @@ -51568,29 +52167,29 @@ BEGIN DECLARE vEntry INT; DECLARE vBucket VARCHAR(10); DECLARE vSupplierFk INT; - + SET vSupplierFk = IF (vLandingWarehouse = 1, 850, 963); -- seleccionamos travel SELECT t.id, e.id INTO vTravel, vEntry FROM travel t LEFT JOIN entry e ON t.id = e.travelFk - WHERE t.landed = vInOutDate AND t.shipped = vInOutDate AND t.warehouseOutFk = vShipmentWarehouse + WHERE t.landed = vInOutDate AND t.shipped = vInOutDate AND t.warehouseOutFk = vShipmentWarehouse AND t.warehouseInFk = vLandingWarehouse AND t.agencyModeFk IS NULL AND e.supplierFk = vSupplierFk - LIMIT 1; - + LIMIT 1; + -- creamos el travel si es necesario IF IFNULL(vTravel, FALSE) = FALSE THEN INSERT INTO travel (shipped, landed, warehouseInFk, warehouseOutFk) VALUES (vInOutDate, vInOutDate, vLandingWarehouse, vShipmentWarehouse); SELECT LAST_INSERT_ID() INTO vTravel; END IF; - + -- creamos la Entrada si es necesario IF IFNULL(vEntry, FALSE) = FALSE THEN INSERT INTO entry (supplierFk, travelFk) VALUES (vSupplierFk, vTravel); -- proveedor 'CONFECCION ARTIFICIAL' SELECT LAST_INSERT_ID() INTO vEntry; END IF; - + -- creamos el cubo si es necesario SELECT id INTO vBucket FROM packaging WHERE volume = vVolume LIMIT 1; IF vBucket IS NULL THEN @@ -51600,7 +52199,7 @@ BEGIN SELECT id INTO vBucket FROM packaging WHERE volume = vVolume LIMIT 1; END IF; - INSERT INTO buy(itemFk,quantity, entryFk, packageFk, packing, stickers, buyingValue, price2, price3) + INSERT INTO buy(itemFk,quantity, entryFk, packageFk, packing, stickers, buyingValue, price2, price3) SELECT itemFk, quantity, vEntry, @@ -51618,8 +52217,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `entry_clone` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -51627,19 +52224,140 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `entry_clone`(vSelf INT) BEGIN /** - * Clona una entrada. + * clones an entry. * - * @param vSelf Identificador de vn.entry + * @param vSelf The entry id */ DECLARE vNewEntryFk INT; - CALL vn.entry_cloneWithoutBuy(vSelf, vNewEntryFk); + START TRANSACTION; - INSERT INTO vn.buy( + CALL entry_cloneHeader(vSelf, vNewEntryFk, NULL); + CALL entry_copyBuys(vSelf, vNewEntryFk); + + COMMIT; + + SELECT vNewEntryFk; +END ;; +DELIMITER ; +/*!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 PROCEDURE IF EXISTS `entry_cloneHeader` */; +/*!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 = utf8mb4 */ ; +/*!50003 SET character_set_results = utf8mb4 */ ; +/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; +DELIMITER ;; +CREATE DEFINER=`root`@`localhost` PROCEDURE `entry_cloneHeader`( + vSelf INT, + OUT vNewEntryFk INT, + vTravelFk INT +) +BEGIN +/** + * Clones an entry header. + * + * @param vSelf The entry id + * @param vTravelFk Travel for the new entry or %NULL to use the source entry travel + * @param vNewEntryFk The new entry id + */ + INSERT INTO entry( + travelFk, + supplierFk, + dated, + isExcludedFromAvailable, + notes, + isRaid, + commission, + currencyFk, + companyFk + ) + SELECT IFNULL(vTravelFk, travelFk), + supplierFk, + dated, + isExcludedFromAvailable, + notes, + isRaid, + commission, + currencyFk, + companyFk + FROM entry + WHERE id = vSelf; + + SET vNewEntryFk = LAST_INSERT_ID(); + + CALL logAdd(vNewEntryFk, 'insert', 'entry', CONCAT('clona entrada ', vSelf)); +END ;; +DELIMITER ; +/*!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 PROCEDURE IF EXISTS `entry_cloneWithoutBuy` */; +/*!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 = utf8mb4 */ ; +/*!50003 SET character_set_results = utf8mb4 */ ; +/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; +DELIMITER ;; +CREATE DEFINER=`root`@`localhost` PROCEDURE `entry_cloneWithoutBuy`(vSelf INT, OUT vNewEntryFk INT) +BEGIN +/** + * Clona una entrada sin compras + * + * @param vSelf Identificador de vn.entry + * @param vNewEntryFk Identificador de la nueva entrada + */ + START TRANSACTION; + + CALL entry_cloneHeader(vSelf, vNewEntryFk, NULL); + + UPDATE entry d JOIN entry s ON s.id = vSelf + SET d.`reference` = s.`reference`, + d.loadPriority = s.loadPriority + WHERE d.id = vNewEntryFk; + + COMMIT; +END ;; +DELIMITER ; +/*!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 PROCEDURE IF EXISTS `entry_copyBuys` */; +/*!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 = utf8mb4 */ ; +/*!50003 SET character_set_results = utf8mb4 */ ; +/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; +DELIMITER ;; +CREATE DEFINER=`root`@`localhost` PROCEDURE `entry_copyBuys`(vSelf INT, vCopyTo INT) +BEGIN +/** + * Copies an entry buys to another buy. + * + * @param vSelf The entry id + * @param vCopyTo The destination entry id + */ + INSERT INTO buy( entryFk, itemFk, quantity, @@ -51658,10 +52376,12 @@ BEGIN price2, price3, minPrice, - workerFk, + isChecked, + location, weight, - itemOriginalFk) - SELECT vNewEntryFk, + itemOriginalFk + ) + SELECT vCopyTo, itemFk, quantity, buyingValue, @@ -51679,77 +52399,18 @@ BEGIN price2, price3, minPrice, - workerFk, + isChecked, + location, weight, itemOriginalFk - FROM vn.buy b - WHERE b.entryFk = vSelf; - - SELECT vNewEntryFk; + FROM buy + WHERE entryFk = vSelf; END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; -/*!50003 DROP PROCEDURE IF EXISTS `entry_cloneWithoutBuy` */; -/*!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 = utf8mb4 */ ; -/*!50003 SET character_set_results = utf8mb4 */ ; -/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; -DELIMITER ;; -CREATE DEFINER=`root`@`localhost` PROCEDURE `entry_cloneWithoutBuy`(vSelf INT, OUT vNewEntryFk INT) -BEGIN -/** - * Clona una entrada sin compras - * - * @param vSelf Identificador de vn.entry - * @param vNewEntryFk Identificador de la nueva entrada - */ - START TRANSACTION; - - INSERT INTO vn.entry( - supplierFk, - dated, - isExcludedFromAvailable, - notes, - isRaid, - commission, - travelFk, - currencyFk, - companyFk, - loadPriority, - `ref` - ) - SELECT supplierFk, - dated, - isExcludedFromAvailable, - notes, - isRaid, - commission, - travelFk, - currencyFk, - companyFk, - loadPriority, - `ref` - FROM vn.entry e - WHERE e.id = vSelf; - - SET vNewEntryFk = LAST_INSERT_ID(); - - COMMIT; -END ;; -DELIMITER ; -/*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `entry_fixMisfit` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -51757,6 +52418,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `entry_fixMisfit`(vSelf INT) BEGIN @@ -51791,7 +52454,8 @@ BEGIN price1, price2, price3, - minPrice) + minPrice, + weight) SELECT vSelf, itemFk, (printedStickers - stickers) * packing quantity, @@ -51810,7 +52474,8 @@ BEGIN price1, price2, price3, - minPrice + minPrice, + weight FROM vn.buy b WHERE b.entryFk = vSelf AND b.printedStickers != b.stickers; @@ -51820,8 +52485,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `entry_getRate` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -51829,6 +52492,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `entry_getRate`(vEntry INT) BEGIN @@ -51837,7 +52502,7 @@ BEGIN -- Obtiene fecha de llegada y almacén entrante - SELECT landed, warehouseInFk INTO vLanded, vWarehouseFk + SELECT landed, warehouseInFk INTO vLanded, vWarehouseFk FROM vn.travel t JOIN vn.entry e ON t.id = e.travelFk WHERE e.id = vEntry; @@ -51850,13 +52515,13 @@ BEGIN SELECT * FROM ( SELECT * FROM - ( + ( SELECT rate0, rate1, rate2, rate3 FROM vn.rate WHERE dated <= vLanded AND warehouseFk = vWarehouseFk ORDER BY dated DESC - + ) sub UNION ALL SELECT rate0, rate1, rate2, rate3 @@ -51870,8 +52535,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `entry_moveNotPrinted` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -51879,6 +52542,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `entry_moveNotPrinted`(vSelf INT, vDays INT, @@ -51910,14 +52575,14 @@ BEGIN SET e.travelFk = vNewTravelFk, e.evaNotes = CONCAT('No impresas de: ', vSelf, ' ', IFNULL(e.evaNotes,'')) WHERE e.id = vNewEntryFk; - + IF vChangeEntry THEN UPDATE buy b SET b.entryFk = vNewEntryFk WHERE b.printedStickers = 0 AND b.entryFk = vSelf; END IF; - + INSERT INTO buy(entryFk, itemFk, quantity, @@ -51963,7 +52628,7 @@ BEGIN FROM buy b WHERE b.entryFk = vSelf AND b.printedStickers != b.stickers; - + IF vChangeEntry THEN UPDATE buy SET stickers = printedStickers, @@ -51975,7 +52640,7 @@ BEGIN FROM item i WHERE i.description = 'MISFIT' LIMIT 1; - + INSERT INTO buy(entryFk, itemFk, quantity, @@ -52025,7 +52690,7 @@ BEGIN UPDATE entry e JOIN buy b ON b.entryFk = e.id - SET e.ref = CONCAT(e.ref,'(1)'), + SET e.reference = CONCAT(e.reference,'(1)'), e.invoiceAmount = vInvoiceAmountOldEntryFk WHERE e.id = vSelf; @@ -52035,7 +52700,7 @@ BEGIN UPDATE entry e JOIN buy b ON b.entryFk = e.id - SET e.`ref` = CONCAT(e.`ref`,'(2)'), + SET e.reference = CONCAT(e.reference,'(2)'), e.invoiceAmount = vInvoiceAmountNewEntry WHERE e.id = vNewEntryFk; @@ -52050,11 +52715,11 @@ BEGIN description = CONCAT('Se ha creado la entrada ', vNewEntryFk,' transferida desde la ', vSelf), userFk = account.myUser_getId(), originFk = vNewEntryFk; - + UPDATE entry SET gestDocFk = (SELECT gestDocFk FROM entry WHERE id = vSelf LIMIT 1) WHERE id = vNewEntryFk; - + INSERT INTO duaEntry (duaFk, entryFk) SELECT duaFk, vNewEntryFk FROM duaEntry WHERE entryFk = vSelf LIMIT 1; END ;; @@ -52063,8 +52728,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `entry_notifyChanged` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -52072,6 +52735,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `entry_notifyChanged`(vSelf INT, vBuyFk INT, vOldValues VARCHAR(512), vNewValues VARCHAR(512)) BEGIN @@ -52108,8 +52773,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `entry_recalc` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -52117,6 +52780,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `entry_recalc`() BEGIN @@ -52128,12 +52793,12 @@ BEGIN */ DECLARE v_done BOOL DEFAULT FALSE; DECLARE vEntryFk INTEGER; - + DECLARE vCur CURSOR FOR SELECT id FROM tmp.recalcEntryCommision; DECLARE CONTINUE HANDLER FOR NOT FOUND - SET v_done = TRUE; + SET v_done = TRUE; OPEN vCur; @@ -52144,7 +52809,7 @@ BEGIN IF v_done THEN LEAVE l; END IF; - + CALL vn2008.buy_tarifas_entry(vEntryFk); END LOOP; @@ -52155,8 +52820,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `entry_splitByShelving` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -52164,12 +52827,14 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `entry_splitByShelving`(vShelvingFk VARCHAR(3), vFromEntryFk INT, vToEntryFk INT) BEGIN /** * Divide las compras entre dos entradas de acuerdo con lo ubicado en una matr�cula - * + * * @param vShelvingFk Identificador de vn.shelving * @param vFromEntryFk Entrada origen * @param vToEntryFk Entrada destino @@ -52179,49 +52844,49 @@ BEGIN DECLARE buyStickers INT; DECLARE vDone BOOLEAN DEFAULT FALSE; - DECLARE cur CURSOR FOR + DECLARE cur CURSOR FOR SELECT bb.id buyFk, FLOOR(ish.visible / ish.packing) AS ishStickers, bb.stickers buyStickers FROM vn.itemShelving ish - JOIN (SELECT b.id, b.itemFk, b.stickers - FROM vn.buy b + JOIN (SELECT b.id, b.itemFk, b.stickers + FROM vn.buy b WHERE b.entryFk = vFromEntryFk ORDER BY b.stickers DESC - LIMIT 10000000000000000000) bb ON bb.itemFk = ish.itemFk + LIMIT 10000000000000000000) bb ON bb.itemFk = ish.itemFk AND bb.stickers >= FLOOR(ish.visible / ish.packing) WHERE shelvingFk = vShelvingFk COLLATE utf8_general_ci GROUP BY ish.id; - + DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE; - - -- Cantidades de la matrícula que exceden la de las entradas - SELECT ish.itemFk, - i.longName, + + -- Cantidades de la matrícula que exceden la de las entradas + SELECT ish.itemFk, + i.longName, FLOOR(ish.visible / ish.packing) AS etiEnMatricula, bb.stickers etiEnEntrada FROM vn.itemShelving ish - JOIN vn.item i ON i.id = ish.itemFk - LEFT JOIN (SELECT b.id, b.itemFk, b.stickers - FROM vn.buy b + JOIN vn.item i ON i.id = ish.itemFk + LEFT JOIN (SELECT b.id, b.itemFk, b.stickers + FROM vn.buy b WHERE b.entryFk = vFromEntryFk ORDER BY b.stickers DESC LIMIT 10000000000000000000) bb ON bb.itemFk = ish.itemFk WHERE shelvingFk = vShelvingFk COLLATE utf8_general_ci AND IFNULL(bb.stickers,0) < FLOOR(ish.visible / ish.packing) GROUP BY ish.id; - + OPEN cur; read_loop: LOOP SET vDone = FALSE; - + FETCH cur INTO vBuyFk, ishStickers, buyStickers; - + IF vDone THEN LEAVE read_loop; END IF; - + IF ishStickers = buyStickers THEN UPDATE vn.buy SET entryFk = vToEntryFk @@ -52229,9 +52894,9 @@ BEGIN ELSE UPDATE vn.buy SET stickers = stickers - ishStickers, - quantity = stickers * packing + quantity = stickers * packing WHERE id = vBuyFk; - + INSERT INTO vn.buy(entryFk, itemFk, quantity, @@ -52289,7 +52954,7 @@ BEGIN itemOriginalFk FROM vn.buy WHERE id = vBuyFk; - + END IF; END LOOP; @@ -52300,8 +52965,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `entry_splitMisfit` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -52309,19 +52972,21 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `entry_splitMisfit`(vSelf INT) BEGIN - + /* Divide una entrada, pasando los registros que ha insertado vn.entry_fixMisfit de la entrada original * a la nueva */ - + DECLARE vNewEntryFk INT; DECLARE vBuyFk INT; SELECT MAX(b.id) INTO vBuyFk - FROM vn.buy b + FROM vn.buy b JOIN vn.item i ON i.id = b.itemFk WHERE b.entryFk = vSelf AND i.description = 'MISFIT'; @@ -52330,25 +52995,61 @@ BEGIN SELECT supplierFk, dated, CONCAT('E:',vSelf), travelFk, currencyFk, companyFk FROM vn.entry e WHERE e.id = vSelf; + + SET vNewEntryFk = LAST_INSERT_ID(); - SET vNewEntryFk = LAST_INSERT_ID(); - - UPDATE vn.buy b + UPDATE vn.buy b SET b.entryFk = vNewEntryFk WHERE b.entryFk = vSelf AND b.id > vBuyFk; - + SELECT vNewEntryFk; - - + + END ;; DELIMITER ; /*!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 PROCEDURE IF EXISTS `entry_updateComission` */; +/*!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 = utf8mb4 */ ; +/*!50003 SET character_set_results = utf8mb4 */ ; +/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; +DELIMITER ;; +CREATE DEFINER=`root`@`localhost` PROCEDURE `entry_updateComission`(vCurrency INT) +BEGIN +/** + * Actualiza la comision de las entradas de hoy a futuro y las recalcula + * + * @param vCurrency id del tipo de moneda(SAR,EUR,USD,GBP,JPY) + */ + CREATE OR REPLACE TEMPORARY TABLE tmp.recalcEntryCommision + SELECT e.id + FROM vn.entry e + JOIN vn.travel t ON t.id = e.travelFk + JOIN vn.warehouse w ON w.id = t.warehouseInFk + WHERE t.shipped >= util.VN_CURDATE() + AND e.currencyFk = vCurrency; + + UPDATE vn.entry e + JOIN tmp.recalcEntryCommision tmp ON tmp.id = e.id + SET e.commission = currency_getCommission(vCurrency); + + CALL entry_recalc(); + + DROP TEMPORARY TABLE tmp.recalcEntryCommision; +END ;; +DELIMITER ; +/*!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 PROCEDURE IF EXISTS `errorProduction_add` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -52356,6 +53057,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `errorProduction_add`( vAction VARCHAR(25), @@ -52398,11 +53101,11 @@ BEGIN COUNT(DISTINCT t.id) ticketCount, COUNT(s.id) lineCount FROM saleTracking st - JOIN vncontrol.accion a ON a.accion_id = st.actionFk + JOIN `state` s2 ON s2.id = st.stateFk JOIN sale s ON s.id = st.saleFk JOIN ticket t ON s.ticketFk = t.id WHERE (t.shipped BETWEEN vDatedFrom AND vDatedTo) - AND a.accion = vAction + AND s2.code IN ('OK','PREVIOUS_PREPARATION','PREPARED','CHECKED') GROUP BY st.workerFk; END IF; @@ -52419,7 +53122,7 @@ BEGIN WHERE t.shipped BETWEEN vDatedFrom AND vDatedTo AND cr.description = vDepartment GROUP BY cd.workerFk; - + CREATE OR REPLACE TEMPORARY TABLE volume ENGINE = MEMORY SELECT SUM(w.volume) volume, @@ -52430,17 +53133,17 @@ BEGIN CREATE OR REPLACE TEMPORARY TABLE errorsByChecker ENGINE = MEMORY - SELECT sub1.workerFk, COUNT(id) errors + SELECT sub1.workerFk, COUNT(id) errors FROM ( SELECT st.workerFk, t.id FROM saleMistake sm JOIN saleTracking st ON sm.saleFk = st.saleFk - JOIN vncontrol.accion a ON a.accion_id = st.actionFk - JOIN sale s ON s.id = sm.saleFk - JOIN ticket t on t.id = s.ticketFk + JOIN `state` s2 ON s2.id = st.stateFk + JOIN sale s ON s.id = sm.saleFk + JOIN ticket t on t.id = s.ticketFk WHERE (t.shipped BETWEEN vDatedFrom AND vDatedTo) - AND a.accion = vAction + AND s2.code IN ('OK','PREVIOUS_PREPARATION','PREPARED','CHECKED') GROUP BY s.ticketFk ) sub1 GROUP BY sub1.workerFk; @@ -52450,13 +53153,13 @@ BEGIN SELECT COUNT(t.id) errors, e.workerFk FROM vn.expeditionMistake pm - JOIN vn.expedition e ON e.id = pm.expeditionFk + JOIN vn.expedition e ON e.id = pm.expeditionFk JOIN vn.ticket t ON t.id = e.ticketFk WHERE t.shipped BETWEEN vDatedFrom AND vDatedTo GROUP BY e.workerFk; IF (vDepartment = 'Sacadores') THEN - + INSERT INTO errorProduction(userFk, firstname, lastname, @@ -52489,12 +53192,12 @@ BEGIN LEFT JOIN errorsByChecker ec2 ON ec2.workerFk = t.workerFk JOIN (SELECT DISTINCT w.id -- Verificamos que son sacadores FROM vn.collection c - JOIN vn.state s ON s.id = c.stateFk + JOIN vn.state s ON s.id = c.stateFk JOIN vn.train tn ON tn.id = c.trainFk - JOIN vn.worker w ON w.id = c.workerFk + JOIN vn.worker w ON w.id = c.workerFk WHERE c.created BETWEEN vDatedFrom AND vDatedTo) sub ON sub.id = w.id GROUP BY w.id; - + CREATE OR REPLACE TEMPORARY TABLE itemPickerErrors -- Errores de los sacadores, derivadores de los revisadores ENGINE = MEMORY SELECT COUNT(c.ticketFk) errors, @@ -52504,7 +53207,7 @@ BEGIN JOIN ticket t ON c.ticketFk = t.id JOIN claimResponsible cr ON cd.claimResponsibleFk = cr.id JOIN ticketTracking tt ON tt.ticketFk = t.id - JOIN state s ON s.id = tt.stateFk + JOIN `state` s ON s.id = tt.stateFk WHERE t.shipped BETWEEN vDatedFrom AND vDatedTo AND cr.description = 'Revisadores' AND s.code = 'ON_PREPARATION' @@ -52514,7 +53217,7 @@ BEGIN JOIN itemPickerErrors ipe ON ipe.workerFk = ep.userFk SET ep.error = ep.error + ipe.errors WHERE vDatedFrom = ep.dated AND ep.rol = 'Sacadores'; - + DROP TEMPORARY TABLE itemPickerErrors; ELSE INSERT INTO errorProduction(userFk, @@ -52550,7 +53253,7 @@ BEGIN LEFT JOIN expeditionErrors pe ON pe.workerFk = t.workerFk GROUP BY w.id; END IF; - + DROP TEMPORARY TABLE total, errorsByClaim, volume, @@ -52562,8 +53265,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `errorProduction_addLauncher` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -52571,12 +53272,14 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `errorProduction_addLauncher`() BEGIN DECLARE vDatedFrom DATETIME; DECLARE vDatedTo DATETIME; - + SELECT DATE_SUB(util.VN_CURDATE(),INTERVAL 1 DAY), CONCAT(DATE_SUB(util.VN_CURDATE(),INTERVAL 1 DAY),' 23:59:59') INTO vDatedFrom, vDatedTo; CALL vn.errorProduction_add('SACAR', vDatedFrom, vDatedTo); @@ -52588,8 +53291,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `expeditionGetFromRoute` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -52597,6 +53298,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `expeditionGetFromRoute`( vExpeditionFk INT) @@ -52607,7 +53310,7 @@ BEGIN DECLARE vRouteFk INT DEFAULT 0; SELECT t.routeFk INTO vRouteFk - FROM vn.expedition exp + FROM vn.expedition exp INNER JOIN ticket t on t.id = exp.ticketFk WHERE exp.id = vExpeditionFk; @@ -52633,8 +53336,119 @@ 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 PROCEDURE IF EXISTS `expeditionPallet_build` */; +/*!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 = utf8mb4 */ ; +/*!50003 SET character_set_results = utf8mb4 */ ; +/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; +DELIMITER ;; +CREATE DEFINER=`root`@`localhost` PROCEDURE `expeditionPallet_build`(IN vExpeditions JSON, IN vArcId INT, IN vWorkerFk INT, OUT vPalletFk INT) +BEGIN +/** Construye un pallet de expediciones. + * + * Primero comprueba si esas expediciones ya pertenecen a otro pallet, + * en cuyo caso actualiza ese pallet. + * + * @param vExpeditions JSON_ARRAY con esta estructura [exp1, exp2, exp3, ...] + * @param vArcId INT Identificador de vn.arcRead + * @param vWorkerFk INT Identificador de vn.worker + * @param out vPalletFk Identificador de vn.expeditionPallet + */ + DECLARE vCounter INT; + DECLARE vExpeditionFk INT; + DECLARE vTruckFk INT; + DECLARE vPrinterFk INT; + + DROP TEMPORARY TABLE IF EXISTS tExpedition; + CREATE TEMPORARY TABLE tExpedition + SELECT + e.id expeditionFk, + r.id routeFk, + ep.id palletFk + FROM + vn.expedition e, + vn.route r, + vn.expeditionPallet ep + LIMIT 0; + + ALTER TABLE tExpedition ADD PRIMARY KEY (expeditionFk); + + SET vCounter = JSON_LENGTH(vExpeditions); + + WHILE vCounter DO + SET vCounter = vCounter - 1; + + SET vExpeditionFk = JSON_EXTRACT(vExpeditions,CONCAT("$[", vCounter, "]")); + + INSERT IGNORE INTO tExpedition(expeditionFk, routeFk, palletFk) + SELECT vExpeditionFk, t.routeFk, es.palletFk + FROM vn.expedition e + LEFT JOIN vn.ticket t ON t.id = e.ticketFk + LEFT JOIN vn.expeditionScan es ON es.expeditionFk = e.id + WHERE e.id = vExpeditionFk; + END WHILE; + + SELECT palletFk INTO vPalletFk + FROM ( + SELECT palletFk, count(*) n + FROM tExpedition + WHERE palletFk > 0 + GROUP BY palletFk + ORDER BY n DESC + LIMIT 100 ) sub + LIMIT 1; + + IF vPalletFk IS NULL THEN + SELECT expeditionTruckFk + INTO vTruckFk + FROM ( + SELECT rm.expeditionTruckFk, count(*) n + FROM vn.routesMonitor rm + JOIN tExpedition e ON e.routeFk = rm.routeFk + GROUP BY expeditionTruckFk + ORDER BY n DESC + LIMIT 1) sub; + + IF vTruckFk IS NULL THEN + CALL util.throw ('TRUCK_NOT_AVAILABLE'); + END IF; + + INSERT INTO vn.expeditionPallet(truckFk) + VALUES(vTruckFk); + + SET vPalletFk = LAST_INSERT_ID(); + END IF; + + INSERT INTO vn.expeditionScan(expeditionFk, palletFk, workerFk) + SELECT expeditionFk, vPalletFk, vWorkerFk + FROM tExpedition + ON DUPLICATE KEY UPDATE palletFk = vPalletFk, workerFk = vWorkerFk; + + SELECT printerFk INTO vPrinterFk + FROM vn.arcRead + WHERE id = vArcId; + + CALL vn.report_print( + 'LabelPalletExpedition', + vPrinterFk, + account.myUser_getId(), + JSON_OBJECT('palletFk', vPalletFk, 'userFk', account.myUser_getId()), + 'high' + ); + + UPDATE vn.expeditionPallet SET isPrint = TRUE WHERE id = vPalletFk; + + DROP TEMPORARY TABLE tExpedition; +END ;; +DELIMITER ; +/*!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 PROCEDURE IF EXISTS `expeditionPallet_Del` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -52642,6 +53456,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `expeditionPallet_Del`(vPalletFk INT) BEGIN @@ -52655,8 +53471,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `expeditionPallet_List` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -52664,6 +53478,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `expeditionPallet_List`(vTruckFk INT) BEGIN @@ -52684,8 +53500,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `expeditionPallet_printLabel` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -52693,36 +53507,41 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `expeditionPallet_printLabel`(vSelf INT) BEGIN /** - * Calls the report_print procedure and passes it + * Calls the report_print procedure and passes it * the necessary parameters for printing. * * @param vSelf expeditioPallet id. */ DECLARE vPrinterFk INT; - - SELECT w.labelerFk INTO vPrinterFk FROM worker w WHERE w.id = account.myUser_getId(); + DECLARE vUserFk INT DEFAULT account.myUser_getId(); + + SELECT w.labelerFk INTO vPrinterFk + FROM worker w + WHERE w.id = vUserFk; CALL vn.report_print( 'LabelPalletExpedition', vPrinterFk, account.myUser_getId(), - JSON_OBJECT('palletFk',vSelf), + JSON_OBJECT('palletFk', vSelf, 'userFk', vUserFk), 'high' ); - UPDATE vn.expeditionPallet SET isPrint = TRUE WHERE id = vSelf; + UPDATE vn.expeditionPallet + SET isPrint = TRUE + WHERE id = vSelf; END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `expeditionPallet_View` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -52730,6 +53549,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb3 */ ; /*!50003 SET character_set_results = utf8mb3 */ ; /*!50003 SET collation_connection = utf8mb3_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `expeditionPallet_View`(vPalletFk INT) BEGIN @@ -52750,8 +53571,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `expeditionScan_Add` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -52759,6 +53578,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `expeditionScan_Add`(vPalletFk INT, vTruckFk INT) BEGIN @@ -52766,22 +53587,22 @@ BEGIN DECLARE vTotal INT DEFAULT 0; IF vPalletFk = 0 THEN -- Nuevo pallet - - INSERT INTO vn.expeditionPallet(truckFk) + + INSERT INTO vn.expeditionPallet(truckFk) VALUES(vTruckFk); - + SELECT LAST_INSERT_ID() INTO vPalletFk; - + END IF; - + SELECT COUNT(expeditionFk) INTO vTotal FROM vn.expeditionScan WHERE palletFk = vPalletFk; - + IF vTotal <> 0 THEN - SELECT expeditionFk, + SELECT expeditionFk, palletFk - FROM vn.expeditionScan + FROM vn.expeditionScan WHERE palletFk = vPalletFk; - ELSE + ELSE SELECT 0 expeditionFk,vPalletFk palletFk; END IF; END ;; @@ -52790,8 +53611,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `expeditionScan_Del` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -52799,6 +53618,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `expeditionScan_Del`(vScanFk INT) BEGIN @@ -52812,8 +53633,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `expeditionScan_List` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -52821,6 +53640,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `expeditionScan_List`(vPalletFk INT) BEGIN @@ -52842,8 +53663,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `expeditionScan_Put` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -52851,23 +53670,23 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `expeditionScan_Put`(vPalletFk INT, vExpeditionFk INT) BEGIN - - REPLACE vn.expeditionScan(expeditionFk, palletFk) + + REPLACE vn.expeditionScan(expeditionFk, palletFk) VALUES(vExpeditionFk, vPalletFk); - + SELECT LAST_INSERT_ID() INTO vPalletFk; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `expeditionState_add` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -52875,43 +53694,43 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb3 */ ; /*!50003 SET character_set_results = utf8mb3 */ ; /*!50003 SET collation_connection = utf8mb3_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `expeditionState_add`(vParam INT, vStateCode VARCHAR(100)) BEGIN - + /** * Inserta nuevos registros en la tabla vn.expeditionState, segun el parámetro - * + * * @param vParam Identificador de vn.expedition o de vn.route * @param vStateCode Corresponde a vn.expeditionStateType.code */ - + IF (SELECT COUNT(*) FROM vn.route r WHERE r.id = vParam) THEN - + INSERT INTO vn.expeditionState(expeditionFk, typeFk) SELECT e.id, est.id FROM vn.expedition e JOIN vn.ticket t ON t.id = e.ticketFk JOIN vn.expeditionStateType est ON est.code = vStateCode WHERE t.routeFk = vParam; - + ELSE - + INSERT INTO vn.expeditionState(expeditionFk, typeFk) SELECT vParam, est.id FROM vn.expeditionStateType est WHERE est.code = vStateCode; - + END IF; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `expeditionState_addByAdress` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -52919,6 +53738,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `expeditionState_addByAdress`(vAdressFk INT, vRouteFk INT, vStateCode VARCHAR(100)) BEGIN @@ -52935,7 +53756,7 @@ BEGIN SELECT e.id, est.id FROM vn.expedition e JOIN vn.expeditionStateType est ON est.code = vStateCode - JOIN vn.ticket t ON t.id = e.ticketFk + JOIN vn.ticket t ON t.id = e.ticketFk WHERE t.addressFk = vAdressFk AND t.routeFk = vRouteFk; END ;; @@ -52944,8 +53765,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `expeditionState_addByExpedition` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -52953,17 +53772,19 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb3 */ ; /*!50003 SET character_set_results = utf8mb3 */ ; /*!50003 SET collation_connection = utf8mb3_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `expeditionState_addByExpedition`(vExpeditionFk INT, vStateCode VARCHAR(100)) BEGIN - + /** * Inserta nuevos registros en la tabla vn.expeditionState - * + * * @param vExpeditionFk Identificador de vn.expedition * @param vStateCode Corresponde a vn.expeditionStateType.code */ - + INSERT INTO vn.expeditionState(expeditionFk, typeFk) SELECT vExpeditionFk, est.id FROM vn.expeditionStateType est @@ -52975,8 +53796,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `expeditionState_addByPallet` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -52984,12 +53803,14 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `expeditionState_addByPallet`(vPalletFk INT, vStateCode VARCHAR(100)) BEGIN /** * Inserta nuevos registros en la tabla vn.expeditionState - * + * * @param vPalletFk Identificador de vn.expedition * @param vStateCode Corresponde a vn.expeditionStateType.code */ @@ -53006,7 +53827,7 @@ BEGIN IF NOT hasExpeditions THEN DROP TEMPORARY TABLE tExpeditionScan; - CALL util.throw('palletDoesNotExist'); + CALL util.throw('palletDoesNotExist'); END IF; INSERT INTO vn.expeditionState(expeditionFk, typeFk) @@ -53019,8 +53840,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `expeditionState_addByRoute` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -53028,32 +53847,32 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb3 */ ; /*!50003 SET character_set_results = utf8mb3 */ ; /*!50003 SET collation_connection = utf8mb3_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `expeditionState_addByRoute`(vRouteFk INT, vStateCode VARCHAR(100)) BEGIN - + /** * Inserta nuevos registros en la tabla vn.expeditionState, por rutas - * + * * @param vRouteFk Identificador de vn.route * @param vStateCode Corresponde a vn.expeditionStateType.code */ - + INSERT INTO vn.expeditionState(expeditionFk, typeFk) SELECT e.id, est.id FROM vn.expedition e JOIN vn.ticket t ON t.id = e.ticketFk JOIN vn.expeditionStateType est ON est.code = vStateCode WHERE t.routeFk = vRouteFk; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `expeditionTruck_Add` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -53061,6 +53880,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `expeditionTruck_Add`(vHour VARCHAR(5), vDescription VARCHAR(45)) BEGIN @@ -53074,8 +53895,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `expeditionTruck_List` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -53083,12 +53902,14 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `expeditionTruck_List`() BEGIN - SELECT id truckFk, - ETD, + SELECT id truckFk, + ETD, description Destino FROM vn.expeditionTruck WHERE ETD BETWEEN util.VN_CURDATE() AND util.dayend(util.VN_CURDATE()) @@ -53099,8 +53920,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `expedition_getFromRoute` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -53108,6 +53927,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `expedition_getFromRoute`(vRouteFk INT) BEGIN @@ -53132,7 +53953,7 @@ BEGIN JOIN address a ON t.addressFk = a.id JOIN route r ON r.id = t.routeFk LEFT JOIN warehouse w ON t.warehouseFk = w.id - LEFT JOIN (SELECT sub.ticketFk, + LEFT JOIN (SELECT sub.ticketFk, CONCAT('(', GROUP_CONCAT(DISTINCT sub.itemPackingTypeFk ORDER BY sub.items DESC SEPARATOR ','), ') ') itemPackingTypeConcat FROM (SELECT s.ticketFk , i.itemPackingTypeFk, COUNT(*) items FROM ticket t @@ -53151,8 +53972,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `expedition_getState` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -53160,10 +53979,12 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `expedition_getState`(vExpeditionFk INT) BEGIN - + DECLARE vTicketsPendientes INT; DECLARE vEtiquetasTotales INT; DECLARE vEtiquetasEscaneadas INT; @@ -53173,24 +53994,24 @@ BEGIN FROM vn.ticket t JOIN vn.expedition e ON e.ticketFk = t.id WHERE e.id = vExpeditionFk; - + SELECT COUNT(*) INTO vTicketsPendientes FROM vn.ticket t LEFT JOIN vn.expedition e ON e.ticketFk = t.id WHERE t.routeFk = vRouteFk AND ISNULL(e.id); - + SELECT COUNT(*) INTO vEtiquetasTotales - FROM vn.expedition e + FROM vn.expedition e JOIN vn.ticket t ON t.id = e.ticketFk WHERE t.routeFk = vRouteFk; - + SELECT COUNT(*) INTO vEtiquetasEscaneadas - FROM vn.expeditionScan es + FROM vn.expeditionScan es JOIN vn.expedition e ON e.id = es.expeditionFk - JOIN vn.ticket t ON t.id = e.ticketFk + JOIN vn.ticket t ON t.id = e.ticketFk WHERE t.routeFk = vRouteFk; - + SELECT e.ticketFk ticket, t.nickname cliente, a.city ciudad, @@ -53204,25 +54025,23 @@ BEGIN vTicketsPendientes AS ticketsPendientes, vEtiquetasTotales AS etiquetasTotales, vEtiquetasEscaneadas AS etiquetasEscaneadas - FROM vn.expedition e - JOIN vn.ticket t ON t.id = e.ticketFk - JOIN vn.address a ON a.id = t.addressFk - JOIN vn.province p ON p.id = a.provinceFk - JOIN vn.`zone`z ON z.id = t.zoneFk - LEFT JOIN vn.route r ON r.id = t.routeFk - LEFT JOIN vn.agencyMode am ON am.id = r.agencyModeFk - LEFT JOIN vn.routesMonitor rm ON rm.routeFk = r.id - LEFT JOIN vn.expeditionTruck et ON et.id = rm.expeditionTruckFk + FROM vn.expedition e + JOIN vn.ticket t ON t.id = e.ticketFk + JOIN vn.address a ON a.id = t.addressFk + JOIN vn.province p ON p.id = a.provinceFk + JOIN vn.`zone`z ON z.id = t.zoneFk + LEFT JOIN vn.route r ON r.id = t.routeFk + LEFT JOIN vn.agencyMode am ON am.id = r.agencyModeFk + LEFT JOIN vn.routesMonitor rm ON rm.routeFk = r.id + LEFT JOIN vn.expeditionTruck et ON et.id = rm.expeditionTruckFk WHERE e.id = vExpeditionFk; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `expedition_StateGet` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -53230,15 +54049,17 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `expedition_StateGet`(vExpeditionFk INT) BEGIN - + /* Devuelve una "ficha" con todos los datos relativos a la expedición - * - * param vExpeditionFk + * + * param vExpeditionFk */ - + DECLARE vTicketsPendientes INT; DECLARE vEtiquetasTotales INT; DECLARE vEtiquetasEscaneadas INT; @@ -53249,34 +54070,34 @@ BEGIN FROM vn.ticket t JOIN vn.expedition e ON e.ticketFk = t.id WHERE e.id = vExpeditionFk; - + SELECT COUNT(*) INTO vTicketsPendientes FROM vn.ticket t LEFT JOIN vn.expedition e ON e.ticketFk = t.id WHERE t.routeFk = vRouteFk AND ISNULL(e.id); - + SELECT COUNT(*) INTO vEtiquetasTotales - FROM vn.expedition e + FROM vn.expedition e JOIN vn.ticket t ON t.id = e.ticketFk WHERE t.routeFk = vRouteFk; - + SELECT COUNT(*) INTO vEtiquetasEscaneadas - FROM vn.expeditionScan es + FROM vn.expeditionScan es JOIN vn.expedition e ON e.id = es.expeditionFk - JOIN vn.ticket t ON t.id = e.ticketFk + JOIN vn.ticket t ON t.id = e.ticketFk WHERE t.routeFk = vRouteFk; - + SELECT COUNT(*) INTO vEtiquetasLeidasSorter - FROM srt.expedition e + FROM srt.expedition e JOIN vn.expedition ve ON ve.id = e.id LEFT JOIN vn.expeditionScan es ON es.expeditionFk = e.id - JOIN vn.ticket t ON t.id = ve.ticketFk + JOIN vn.ticket t ON t.id = ve.ticketFk WHERE t.routeFk = vRouteFk AND e.created != e.updated - AND ISNULL(es.expeditionFk); - - + AND ISNULL(es.expeditionFk); + + SELECT e.ticketFk ticket, t.nickname cliente, a.city ciudad, @@ -53291,25 +54112,23 @@ BEGIN vEtiquetasTotales AS etiquetasTotales, vEtiquetasEscaneadas AS etiquetasEscaneadas, vEtiquetasLeidasSorter AS etiquetasSorter - FROM vn.expedition e - JOIN vn.ticket t ON t.id = e.ticketFk - JOIN vn.address a ON a.id = t.addressFk - JOIN vn.province p ON p.id = a.provinceFk - JOIN vn.`zone`z ON z.id = t.zoneFk - LEFT JOIN vn.route r ON r.id = t.routeFk - LEFT JOIN vn.agencyMode am ON am.id = r.agencyModeFk - LEFT JOIN vn.routesMonitor rm ON rm.routeFk = r.id - LEFT JOIN vn.expeditionTruck et ON et.id = rm.expeditionTruckFk + FROM vn.expedition e + JOIN vn.ticket t ON t.id = e.ticketFk + JOIN vn.address a ON a.id = t.addressFk + JOIN vn.province p ON p.id = a.provinceFk + JOIN vn.`zone`z ON z.id = t.zoneFk + LEFT JOIN vn.route r ON r.id = t.routeFk + LEFT JOIN vn.agencyMode am ON am.id = r.agencyModeFk + LEFT JOIN vn.routesMonitor rm ON rm.routeFk = r.id + LEFT JOIN vn.expeditionTruck et ON et.id = rm.expeditionTruckFk WHERE e.id = vExpeditionFk; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `faultsReview` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -53317,19 +54136,21 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `faultsReview`(vWarehouseFk INT) BEGIN DECLARE vCalcVisibleFk INT; - + CALL cache.visible_refresh(vCalcVisibleFk, TRUE, vWarehouseFk); - + DROP TEMPORARY TABLE IF EXISTS tmp.itemShelvingRadar; - + CREATE TEMPORARY TABLE tmp.itemShelvingRadar (PRIMARY KEY (itemFk)) - ENGINE = MEMORY + ENGINE = MEMORY SELECT iss.itemFk, i.size, i.subName producer, @@ -53342,7 +54163,7 @@ BEGIN LEFT JOIN cache.visible v ON v.item_id = iss.itemFk AND v.calc_id = vCalcVisibleFk WHERE iss.warehouseFk = vWarehouseFk GROUP BY iss.itemFk; - + SELECT ishr.*, sub.longName, CAST(visible - upstairs - downstairs AS DECIMAL(10,0)) AS nicho, CAST(sub.fault AS DECIMAL(10,0)) as faltas @@ -53357,7 +54178,7 @@ BEGIN AND t.warehouseFk = vWarehouseFk ) sub ON sub.itemFk = ishr.itemFk ; - + END ;; DELIMITER ; @@ -53365,8 +54186,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `faultsReview_isChecked` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -53374,6 +54193,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `faultsReview_isChecked`(vItemFk INT, vWarehouseFk INT) BEGIN @@ -53393,8 +54214,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `freelance_getInfo` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -53402,6 +54221,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `freelance_getInfo`(workerFk INT) BEGIN @@ -53420,8 +54241,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `fustControl` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -53429,10 +54248,12 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `fustControl`(vFromDated DATE, vToDated DATE) BEGIN - + DECLARE vSijsnerClientFk INT DEFAULT 19752; DECLARE vDateStart DATETIME; @@ -53441,68 +54262,68 @@ BEGIN SET vDateStart = vFromDated; SET vDateEnd = util.Dayend(vToDated); - SELECT p.id FustCode, - CAST(sent.stucks AS DECIMAL(10,0)) FH, - CAST(tp.stucks AS DECIMAL(10,0)) Tickets, - CAST(-sj.stucks AS DECIMAL(10,0)) Sijsner, + SELECT p.id FustCode, + CAST(sent.stucks AS DECIMAL(10,0)) FH, + CAST(tp.stucks AS DECIMAL(10,0)) Tickets, + CAST(-sj.stucks AS DECIMAL(10,0)) Sijsner, CAST(IFNULL(sent.stucks,0) - IFNULL(tp.stucks,0) + IFNULL(sj.stucks,0) AS DECIMAL(10,0)) saldo FROM vn.packaging p LEFT JOIN ( SELECT FustCode, sum(fustQuantity) stucks FROM ( SELECT IFNULL(pe.equivalentFk ,b.packageFk) FustCode, s.quantity / b.packing AS fustQuantity - FROM vn.sale s - JOIN vn.ticket t ON t.id = s.ticketFk - JOIN vn.warehouse w ON w.id = t.warehouseFk - JOIN vn.warehouseAlias wa ON wa.id = w.aliasFk - JOIN cache.last_buy lb ON lb.item_id = s.itemFk AND lb.warehouse_id = t.warehouseFk - JOIN vn.buy b ON b.id = lb.buy_id - JOIN vn.packaging p ON p.id = b.packageFk + FROM vn.sale s + JOIN vn.ticket t ON t.id = s.ticketFk + JOIN vn.warehouse w ON w.id = t.warehouseFk + JOIN vn.warehouseAlias wa ON wa.id = w.aliasFk + JOIN cache.last_buy lb ON lb.item_id = s.itemFk AND lb.warehouse_id = t.warehouseFk + JOIN vn.buy b ON b.id = lb.buy_id + JOIN vn.packaging p ON p.id = b.packageFk LEFT JOIN vn.packageEquivalent pe ON pe.packagingFk = p.id - JOIN vn.address a ON a.id = t.addressFk - JOIN vn.province p2 ON p2.id = a.provinceFk - JOIN vn.country c ON c.id = p2.countryFk + JOIN vn.address a ON a.id = t.addressFk + JOIN vn.province p2 ON p2.id = a.provinceFk + JOIN vn.country c ON c.id = p2.countryFk WHERE t.shipped BETWEEN vDateStart AND vDateEnd AND wa.name = 'VNH' - AND p.isPackageReturnable - AND c.country = 'FRANCIA') sub + AND p.isPackageReturnable + AND c.country = 'FRANCIA') sub GROUP BY FustCode) sent ON sent.FustCode = p.id LEFT JOIN ( SELECT FustCode, sum(quantity) stucks FROM ( SELECT IFNULL(pe.equivalentFk ,tp.packagingFk) FustCode, tp.quantity - FROM vn.ticketPackaging tp - JOIN vn.ticket t ON t.id = tp.ticketFk - JOIN vn.warehouse w ON w.id = t.warehouseFk - JOIN vn.warehouseAlias wa ON wa.id = w.aliasFk - JOIN vn.packaging p ON p.id = tp.packagingFk + FROM vn.ticketPackaging tp + JOIN vn.ticket t ON t.id = tp.ticketFk + JOIN vn.warehouse w ON w.id = t.warehouseFk + JOIN vn.warehouseAlias wa ON wa.id = w.aliasFk + JOIN vn.packaging p ON p.id = tp.packagingFk LEFT JOIN vn.packageEquivalent pe ON pe.packagingFk = p.id - JOIN vn.address a ON a.id = t.addressFk - JOIN vn.province p2 ON p2.id = a.provinceFk - JOIN vn.country c ON c.id = p2.countryFk + JOIN vn.address a ON a.id = t.addressFk + JOIN vn.province p2 ON p2.id = a.provinceFk + JOIN vn.country c ON c.id = p2.countryFk WHERE t.shipped BETWEEN vDateStart AND vDateEnd AND wa.name = 'VNH' - AND p.isPackageReturnable + AND p.isPackageReturnable AND c.country = 'FRANCIA' AND t.clientFk != vSijsnerClientFk - AND tp.quantity > 0) sub + AND tp.quantity > 0) sub GROUP BY FustCode) tp ON tp.FustCode = p.id LEFT JOIN ( SELECT FustCode, sum(quantity) stucks FROM ( SELECT IFNULL(pe.equivalentFk ,tp.packagingFk) FustCode, tp.quantity - FROM vn.ticketPackaging tp - JOIN vn.ticket t ON t.id = tp.ticketFk - JOIN vn.warehouse w ON w.id = t.warehouseFk - JOIN vn.warehouseAlias wa ON wa.id = w.aliasFk - JOIN vn.packaging p ON p.id = tp.packagingFk + FROM vn.ticketPackaging tp + JOIN vn.ticket t ON t.id = tp.ticketFk + JOIN vn.warehouse w ON w.id = t.warehouseFk + JOIN vn.warehouseAlias wa ON wa.id = w.aliasFk + JOIN vn.packaging p ON p.id = tp.packagingFk LEFT JOIN vn.packageEquivalent pe ON pe.packagingFk = p.id WHERE t.shipped BETWEEN TIMESTAMPADD(DAY, 1, vDateStart ) AND TIMESTAMPADD(DAY, 1, vDateEnd ) AND wa.name = 'VNH' - AND p.isPackageReturnable - AND t.clientFk = vSijsnerClientFk) sub + AND p.isPackageReturnable + AND t.clientFk = vSijsnerClientFk) sub GROUP BY FustCode) sj ON sj.FustCode = p.id - WHERE sent.stucks + WHERE sent.stucks OR tp.stucks OR sj.stucks; @@ -53512,8 +54333,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `fustControlDetail` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -53521,10 +54340,12 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `fustControlDetail`(vFromDated DATE, vToDated DATE) BEGIN - + DECLARE vSijsnerClientFk INT DEFAULT 19752; DECLARE vDateStart DATETIME; @@ -53532,37 +54353,35 @@ BEGIN SET vDateStart = vFromDated; SET vDateEnd = util.Dayend(vToDated); - + SELECT a.nickname shopName, - a.city , - IFNULL(pe.equivalentFk ,tp.packagingFk) FustCode, + a.city , + IFNULL(pe.equivalentFk ,tp.packagingFk) FustCode, tp.quantity, tp.ticketFk, CONCAT('From ', vFromDated,' to ', vToDated) AS dateRange - FROM vn.ticketPackaging tp - JOIN vn.ticket t ON t.id = tp.ticketFk - JOIN vn.warehouse w ON w.id = t.warehouseFk - JOIN vn.warehouseAlias wa ON wa.id = w.aliasFk - JOIN vn.packaging p ON p.id = tp.packagingFk + FROM vn.ticketPackaging tp + JOIN vn.ticket t ON t.id = tp.ticketFk + JOIN vn.warehouse w ON w.id = t.warehouseFk + JOIN vn.warehouseAlias wa ON wa.id = w.aliasFk + JOIN vn.packaging p ON p.id = tp.packagingFk LEFT JOIN vn.packageEquivalent pe ON pe.packagingFk = p.id - JOIN vn.address a ON a.id = t.addressFk - JOIN vn.province p2 ON p2.id = a.provinceFk - JOIN vn.country c ON c.id = p2.countryFk + JOIN vn.address a ON a.id = t.addressFk + JOIN vn.province p2 ON p2.id = a.provinceFk + JOIN vn.country c ON c.id = p2.countryFk WHERE t.shipped BETWEEN vFromDated AND util.dayend(vToDated) AND wa.name = 'VNH' - AND p.isPackageReturnable + AND p.isPackageReturnable AND c.country = 'FRANCIA' AND t.clientFk != vSijsnerClientFk AND tp.quantity > 0; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `fv_pca` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -53570,6 +54389,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `fv_pca`() BEGIN @@ -53580,8 +54401,8 @@ DECLARE vTicketFk INT; DECLARE vSaleFk INT; DECLARE vClonTicket INT DEFAULT 0; -DECLARE cur1 CURSOR FOR -SELECT s.ticketFk, s.id +DECLARE cur1 CURSOR FOR +SELECT s.ticketFk, s.id FROM vn.sale s JOIN vn.ticket t ON t.id = s.ticketFk JOIN vn.item i ON i.id = s.itemFk @@ -53597,17 +54418,17 @@ OPEN cur1; FETCH cur1 INTO vTicketFk, vSaleFk; WHILE done = 0 DO - + SELECT t.id INTO vClonTicket FROM vn.ticket t JOIN (SELECT addressFk, shipped FROM vn.ticket WHERE id = vTicketFk) sub USING(addressFk, shipped) WHERE t.warehouseFk = 44 LIMIT 1; - + SELECT vTicketFk, vClonTicket; - + IF vClonTicket = 0 THEN - + INSERT INTO ticket ( clientFk, shipped, @@ -53635,12 +54456,12 @@ FETCH cur1 INTO vTicketFk, vSaleFk; zonePrice, zoneBonus, routeFk - + FROM ticket WHERE id = vTicketFk; SET vClonTicket = LAST_INSERT_ID(); - + SELECT 'lstID', vClonTicket; /* INSERT INTO ticketObservation(ticketFk, observationTypeFk, description) @@ -53650,20 +54471,20 @@ FETCH cur1 INTO vTicketFk, vSaleFk; WHERE t.id = vClonTicket; */ INSERT INTO ticketLog - SET originFk = vTicketFk, userFk = account.myUser_getId(), `action` = 'insert', + SET originFk = vTicketFk, userFk = account.myUser_getId(), `action` = 'insert', description = CONCAT('Ha creado el ticket:', ' ', vClonTicket, ' clonando el ', vTicketFk); - + END IF; - + UPDATE vn.sale SET ticketFk = vClonTicket WHERE id = vSaleFk; SET vClonTicket = 0; - + SET done = 0; FETCH cur1 INTO vTicketFk, vSaleFk; - + END WHILE; CLOSE cur1; @@ -53675,8 +54496,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `getDayExpeditions` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -53684,12 +54503,14 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `getDayExpeditions`() BEGIN - SELECT - e.expeditions_id as expeditionFk, + SELECT + e.expeditions_id as expeditionFk, date_format(e.odbc_date,'%Y-%m-%d') as expeditionDate, e.ticket_id as ticketFk, t.routeFk as routeFk @@ -53703,8 +54524,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `getInfoDelivery` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -53712,6 +54531,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `getInfoDelivery`(vRouteFk INT) BEGIN @@ -53726,8 +54547,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `getItemUbication` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -53735,15 +54554,17 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `getItemUbication`(vItemFk VARCHAR(22)) BEGIN - + /* * @deprecated Utilizar itemShelving_getInfo - * + * */ - + CALL itemshelving_getInfo(vItemFk); END ;; @@ -53752,8 +54573,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `getPedidosInternos` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -53761,6 +54580,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `getPedidosInternos`() BEGIN @@ -53773,8 +54594,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `greuge_add` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -53782,6 +54601,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `greuge_add`() BEGIN @@ -53792,7 +54613,7 @@ BEGIN SELECT DATE_SUB(util.VN_CURDATE(), INTERVAL yearsToDelete YEAR) INTO vDated FROM vn.greugeConfig; - + INSERT INTO vn.greuge(clientFk, description, amount, shipped, created, greugeTypeFk) SELECT clientFk, 'Suma agrupada', SUM(amount), MAX(shipped), MAX(created), greugeTypeFk FROM vn.greuge @@ -53808,8 +54629,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `inventoryFailureAdd` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -53817,6 +54636,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `inventoryFailureAdd`() BEGIN @@ -53825,8 +54646,8 @@ DECLARE done BOOL DEFAULT FALSE; DECLARE vTicketFk INT; DECLARE rs CURSOR FOR - SELECT id FROM vn.ticket - WHERE shipped = util.yesterday() + SELECT id FROM vn.ticket + WHERE shipped = util.yesterday() AND clientFk = 400 AND warehouseFk IN (1,44); @@ -53837,13 +54658,13 @@ OPEN rs; FETCH rs INTO vTicketFk; WHILE NOT done DO - + INSERT INTO vn.inventoryFailure(dated, itemFk, quantity, value, warehouseFk, throwerFk) - SELECT t.shipped, - s.itemFk, - s.quantity, + SELECT t.shipped, + s.itemFk, + s.quantity, b.buyingValue + b.freightValue + b.packageValue + b.comissionValue, - t.warehouseFk, + t.warehouseFk, w.id FROM vn.ticket t JOIN vn.sale s ON s.ticketFk = t.id @@ -53854,7 +54675,7 @@ WHILE NOT done DO AND s.quantity > 0; FETCH rs INTO vTicketFk; - + END WHILE; @@ -53869,8 +54690,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `inventoryMake` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -53878,6 +54697,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `inventoryMake`(vDate DATE, vWh INT) proc: BEGIN @@ -54012,7 +54833,7 @@ proc: BEGIN JOIN entry e ON e.id = b.entryFk JOIN travel tr ON tr.id = e.travelFk WHERE tr.warehouseInFk = vWh - AND tr.landed BETWEEN vDateLastInventory + AND tr.landed BETWEEN vDateLastInventory AND vDateYesterday AND NOT isRaid GROUP BY b.itemFk; @@ -54067,7 +54888,7 @@ proc: BEGIN inv.price3 = b.price3, inv.minPrice = b.minPrice, inv.producer = p.name; - + INSERT INTO buy( itemFk, quantity, buyingValue, @@ -54101,15 +54922,15 @@ proc: BEGIN FROM tmp.inventory; SELECT vWh, count(*), util.VN_NOW() FROM tmp.inventory; - + -- Actualizamos el campo lastUsed de vn.item UPDATE vn.item i JOIN tmp.inventory i2 ON i2.itemFk = i.id SET i.lastUsed = util.VN_NOW() WHERE i2.quantity; - + -- DROP TEMPORARY TABLE tmp.inventory; - + END LOOP; CLOSE cWarehouses; @@ -54123,11 +54944,11 @@ proc: BEGIN SELECT e.id as entryId, t.id as travelId FROM vn.travel t - JOIN vn.entry e ON e.travelFk = t.id + JOIN vn.entry e ON e.travelFk = t.id WHERE e.supplierFk = 4 AND t.shipped <= TIMESTAMPADD(DAY, -2, TIMESTAMPADD(DAY, -10, util.VN_CURDATE())) AND (DAY(t.shipped) <> 1 OR shipped < TIMESTAMPADD(MONTH, -12, util.VN_CURDATE())); - + DELETE e FROM vn.entry e JOIN tmp.entryToDelete tmp ON tmp.entryId = e.id; @@ -54141,8 +54962,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `inventoryMakeLauncher` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -54150,6 +54969,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `inventoryMakeLauncher`() BEGIN @@ -54165,8 +54986,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `inventory_repair` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -54174,6 +54993,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `inventory_repair`() BEGIN @@ -54189,7 +55010,7 @@ BEGIN b.id AS buyFk, b.entryFk, b.isIgnored, - b.price2, + b.price2, b.price3, b.stickers, b.packing, @@ -54203,20 +55024,20 @@ BEGIN s.id AS supplierFk, s.name AS supplier FROM itemType it - RIGHT JOIN (entry e + RIGHT JOIN (entry e LEFT JOIN supplier s ON s.id = e.supplierFk RIGHT JOIN buy b ON b.entryFk = e.id LEFT JOIN item i ON i.id = b.itemFk - LEFT JOIN ink ON ink.id = i.inkFk + LEFT JOIN ink ON ink.id = i.inkFk LEFT JOIN travel tr ON tr.id = e.travelFk LEFT JOIN warehouse w ON w.id = tr.warehouseInFk LEFT JOIN origin o ON o.id = i.originFk ) ON it.id = i.typeFk LEFT JOIN edi.ekt ek ON b.ektFk = ek.id WHERE (b.packageFk = "--" OR b.price2 = 0 OR b.packing = 0 OR b.buyingValue = 0) AND tr.landed > util.firstDayOfMonth(TIMESTAMPADD(MONTH,-1,util.VN_CURDATE())) AND s.name = 'INVENTARIO'; - + DROP TEMPORARY TABLE IF EXISTS tmp.lastEntryOk; - CREATE TEMPORARY TABLE tmp.lastEntryOk + CREATE TEMPORARY TABLE tmp.lastEntryOk (PRIMARY KEY (buyFk)) SELECT i.id AS itemFk, @@ -54226,7 +55047,7 @@ BEGIN b.id AS buyFk, b.entryFk, b.isIgnored, - b.price2, + b.price2, b.price3, b.stickers, b.packing, @@ -54240,11 +55061,11 @@ BEGIN s.id AS supplierFk, s.name AS supplier FROM itemType it - RIGHT JOIN (entry e + RIGHT JOIN (entry e LEFT JOIN supplier s ON s.id = e.supplierFk RIGHT JOIN buy b ON b.entryFk = e.id LEFT JOIN item i ON i.id = b.itemFk - LEFT JOIN ink ON ink.id = i.inkFk + LEFT JOIN ink ON ink.id = i.inkFk LEFT JOIN travel tr ON tr.id = e.travelFk LEFT JOIN warehouse w ON w.id = tr.warehouseInFk LEFT JOIN origin o ON o.id = i.originFk @@ -54252,34 +55073,34 @@ BEGIN LEFT JOIN edi.ekt ek ON b.ektFk = ek.id WHERE b.packageFk != "--" AND b.price2 != 0 AND b.packing != 0 AND b.buyingValue > 0 AND tr.landed > util.firstDayOfMonth(TIMESTAMPADD(MONTH,-2,util.VN_CURDATE())) ORDER BY tr.landed DESC; - + DROP TEMPORARY TABLE IF EXISTS tmp.lastEntryOkGroup; - CREATE TEMPORARY TABLE tmp.lastEntryOkGroup + CREATE TEMPORARY TABLE tmp.lastEntryOkGroup (INDEX (warehouseFk,itemFk)) SELECT * FROM tmp.lastEntryOk tmp GROUP BY tmp.itemFk,tmp.warehouseFk; - + UPDATE buy b JOIN tmp.lastEntry lt ON lt.buyFk = b.id JOIN tmp.lastEntryOkGroup eo ON eo.itemFk = lt.itemFk AND eo.warehouseFk = lt.warehouseFk SET b.packageFk = eo.packageFk WHERE b.packageFk = "--"; - + UPDATE buy b JOIN tmp.lastEntry lt ON lt.buyFk = b.id JOIN tmp.lastEntryOkGroup eo ON eo.itemFk = lt.itemFk AND eo.warehouseFk = lt.warehouseFk SET b.price2 = eo.price2 WHERE b.price2 = 0 ; - + UPDATE buy b JOIN tmp.lastEntry lt ON lt.buyFk = b.id JOIN tmp.lastEntryOkGroup eo ON eo.itemFk = lt.itemFk AND eo.warehouseFk = lt.warehouseFk SET b.packing = eo.packing WHERE b.packing = 0; - + UPDATE buy b JOIN tmp.lastEntry lt ON lt.buyFk = b.id JOIN tmp.lastEntryOkGroup eo ON eo.itemFk = lt.itemFk AND eo.warehouseFk = lt.warehouseFk SET b.buyingValue = eo.buyingValue WHERE b.buyingValue = 0; - + DROP TEMPORARY TABLE tmp.lastEntry; DROP TEMPORARY TABLE tmp.lastEntryOk; DROP TEMPORARY TABLE tmp.lastEntryOkGroup; @@ -54289,8 +55110,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `invoiceExpenceMake` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -54298,6 +55117,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `invoiceExpenceMake`(IN vInvoice INT) BEGIN @@ -54317,7 +55138,7 @@ BEGIN JOIN item i ON i.id = s.itemFk GROUP BY i.expenceFk HAVING amount != 0; - + INSERT INTO invoiceOutExpence(invoiceOutFk, expenceFk, amount) SELECT vInvoice, tst.expenceFk, @@ -54325,15 +55146,13 @@ BEGIN FROM ticketToInvoice t JOIN ticketService ts ON ts.ticketFk = t.id JOIN ticketServiceType tst ON tst.id = ts.ticketServiceTypeFk - HAVING amount != 0; + HAVING amount != 0; END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `invoiceFromAddress` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -54341,21 +55160,23 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `invoiceFromAddress`(vMaxTicketDate DATETIME,vAddress INT,vCompany INT) -BEGIN +BEGIN DECLARE vMinDateTicket DATE DEFAULT TIMESTAMPADD(MONTH, -3, util.VN_CURDATE()); - + SET vMaxTicketDate = vn2008.DAYEND(vMaxTicketDate); - + DROP TEMPORARY TABLE IF EXISTS `ticketToInvoice`; - + CREATE TEMPORARY TABLE `ticketToInvoice` (PRIMARY KEY (`id`)) ENGINE = MEMORY SELECT Id_Ticket id FROM vn2008.Tickets WHERE (Fecha BETWEEN vMinDateTicket - AND vMaxTicketDate) AND Id_Consigna = vAddress + AND vMaxTicketDate) AND Id_Consigna = vAddress AND Factura IS NULL AND empresa_id = vCompany; END ;; @@ -54364,8 +55185,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `invoiceFromClient` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -54373,14 +55192,16 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `invoiceFromClient`( - IN vMaxTicketDate datetime, - IN vClientFk INT, + IN vMaxTicketDate datetime, + IN vClientFk INT, IN vCompanyFk INT) BEGIN DECLARE vMinTicketDate DATE; - + SET vMinTicketDate = util.firstDayOfYear(vMaxTicketDate - INTERVAL 1 YEAR); SET vMaxTicketDate = util.dayend(vMaxTicketDate); @@ -54399,8 +55220,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `invoiceFromTicket` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -54408,12 +55227,14 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `invoiceFromTicket`(IN vTicket INT) -BEGIN +BEGIN DROP TEMPORARY TABLE IF EXISTS `ticketToInvoice`; - + CREATE TEMPORARY TABLE `ticketToInvoice` (PRIMARY KEY (`id`)) ENGINE = MEMORY @@ -54426,8 +55247,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `invoiceInBookingCommon` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -54435,6 +55254,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `invoiceInBookingCommon`(vInvoiceInId INT, OUT vSerialNumber INT) BEGIN @@ -54442,10 +55263,10 @@ BEGIN DROP TEMPORARY TABLE IF EXISTS newInvoiceIn; CREATE TEMPORARY TABLE newInvoiceIn - SELECT + SELECT i.*, YEAR(i.booked) datedYear, - CONCAT('s/fra',RIGHT(i.supplierRef,8),':',LEFT(s.name, 10)) conceptWithSupplier, + CONCAT('s/fra',RIGHT(i.supplierRef,8),':',LEFT(s.name, 10)) conceptWithSupplier, (cc.id = c.id) isSameCountry, cit.id invoicesCount FROM invoiceIn i @@ -54458,7 +55279,7 @@ BEGIN DROP TEMPORARY TABLE IF EXISTS newSupplier; CREATE TEMPORARY TABLE newSupplier - SELECT + SELECT s.*, REPLACE(s.account,' ','') supplierAccount, IF(c.CEE < 2, TRUE, FALSE) isUeeMember @@ -54471,11 +55292,11 @@ BEGIN CALL util.throw('INACTIVE_PROVIDER'); END IF; - SELECT IFNULL(MAX(i.serialNumber) + 1,1) + SELECT IFNULL(MAX(i.serialNumber) + 1,1) INTO vSerialNumber FROM invoiceIn i JOIN newInvoiceIn n - WHERE i.serial LIKE n.serial + WHERE i.serial LIKE n.serial AND YEAR(i.booked) = n.datedYear AND i.companyFk = n.companyFk GROUP BY i.companyFk; @@ -54486,8 +55307,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `invoiceInBookingMain` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -54495,6 +55314,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `invoiceInBookingMain`(vInvoiceInId INT) BEGIN @@ -54504,7 +55325,7 @@ BEGIN CALL invoiceInBookingCommon(vInvoiceInId,vSerialNumber); - SELECT SUM(iit.taxableBase * IF( i.serial= 'R' AND ti.Iva <> 'HP DEVENGADO 21 ISP', 1 +(ti.PorcentajeIva/100),1)), + SELECT SUM(iit.taxableBase * IF( i.serial= 'R' AND ti.Iva <> 'HP DEVENGADO 21 ISP', 1 +(ti.PorcentajeIva/100),1)), SUM(iit.foreignValue * IF( i.serial= 'R', 1 + (ti.PorcentajeIva/100),1)), iit.taxableBase/iit.foreignValue INTO vTotalAmount, vTotalAmountDivisa, vRate @@ -54527,7 +55348,7 @@ BEGIN CLAVE, empresa_id ) - SELECT + SELECT vBookNumber, n.bookEntried, s.supplierAccount, @@ -54538,7 +55359,7 @@ BEGIN n.invoicesCount, vInvoiceInId, n.companyFk - FROM newInvoiceIn n + FROM newInvoiceIn n JOIN newSupplier s; -- Línea de Gastos @@ -54548,7 +55369,7 @@ BEGIN CONTRA, EURODEBE, EUROHABER, - CONCEPTO, + CONCEPTO, CAMBIO, DEBEME, HABERME, @@ -54568,7 +55389,7 @@ BEGIN n.invoicesCount NFACTICK, n.companyFk empresa_id FROM newInvoiceIn n - JOIN newSupplier s + JOIN newSupplier s JOIN invoiceInTax iit ON iit.invoiceInFk = n.id JOIN (SELECT * FROM expence e GROUP BY e.id)e ON e.id = iit.expenceFk WHERE e.name != 'Suplidos Transitarios nacionales' @@ -54579,13 +55400,13 @@ BEGIN INSERT INTO XDiario( ASIEN, FECHA, SUBCTA, - CONTRA, + CONTRA, EURODEBE, BASEEURO, - CONCEPTO, - FACTURA, + CONCEPTO, + FACTURA, IVA, - AUXILIAR, + AUXILIAR, SERIE, TIPOOPE, FECHA_EX, @@ -54634,34 +55455,34 @@ BEGIN n.booked FECREGCON, n.companyFk FROM newInvoiceIn n - JOIN newSupplier s + JOIN newSupplier s JOIN invoiceInTax it ON n.id = it.invoiceInFk JOIN sage.TiposIva ti ON ti.CodigoIva = it.taxTypeSageFk JOIN sage.TiposTransacciones ttr ON ttr.CodigoTransaccion = it.transactionTypeSageFk JOIN invoiceInSerial iis ON iis.code = n.serial JOIN (SELECT * FROM expence e GROUP BY e.id)e ON e.id = it.expenceFk LEFT JOIN ( - SELECT eWithheld.id - FROM invoiceInTax hold - JOIN expence eWithheld ON eWithheld.id = hold.expenceFk AND eWithheld.isWithheld + SELECT eWithheld.id + FROM invoiceInTax hold + JOIN expence eWithheld ON eWithheld.id = hold.expenceFk AND eWithheld.isWithheld WHERE hold.invoiceInFk = vInvoiceInId LIMIT 1 - ) eWithheld ON TRUE - WHERE it.taxTypeSageFk IS NOT NULL + ) eWithheld ON TRUE + WHERE it.taxTypeSageFk IS NOT NULL AND it.taxTypeSageFk NOT IN (22, 90) GROUP BY ti.PorcentajeIva, e.id; -- Línea iva inversor sujeto pasivo - + INSERT INTO XDiario( ASIEN, FECHA, SUBCTA, - CONTRA, + CONTRA, EUROHABER, BASEEURO, - CONCEPTO, - FACTURA, + CONCEPTO, + FACTURA, IVA, - AUXILIAR, + AUXILIAR, SERIE, TIPOOPE, FECHA_EX, @@ -54707,45 +55528,43 @@ BEGIN s.nif AS TERNIF, s.name AS TERNOM, n.companyFk - FROM newInvoiceIn n - JOIN newSupplier s + FROM newInvoiceIn n + JOIN newSupplier s JOIN invoiceInTax it ON n.id = it.invoiceInFk JOIN sage.TiposIva ti ON ti.CodigoIva = it.taxTypeSageFk JOIN sage.TiposTransacciones ttr ON ttr.CodigoTransaccion = it.transactionTypeSageFk - JOIN invoiceInSerial iis ON iis.code = n.serial + JOIN invoiceInSerial iis ON iis.code = n.serial JOIN (SELECT * FROM expence e GROUP BY e.id)e ON e.id = it.expenceFk WHERE ti.Iva = 'HP DEVENGADO 21 ISP' OR MID(s.account, 4, 1) = '1' GROUP BY ti.PorcentajeIva, e.id; - - -- Actualización del registro original + + -- Actualización del registro original UPDATE invoiceIn ii JOIN newInvoiceIn ni ON ii.id = ni.id SET ii.serialNumber = vSerialNumber, ii.isBooked = TRUE; - + -- Problemas derivados de la precisión en los decimales al calcular los impuestos - UPDATE XDiario - SET EURODEBE = EURODEBE - + UPDATE XDiario + SET EURODEBE = EURODEBE - (SELECT IF(ABS(sub.difference) = 0.01, sub.difference, 0) FROM( - SELECT SUM(IFNULL(ROUND(EURODEBE, 2),0)) - SUM(IFNULL(ROUND(EUROHABER, 2), 0)) difference + SELECT SUM(IFNULL(ROUND(EURODEBE, 2),0)) - SUM(IFNULL(ROUND(EUROHABER, 2), 0)) difference FROM XDiario WHERE ASIEN = vBookNumber )sub ) - WHERE ASIEN = vBookNumber + WHERE ASIEN = vBookNumber AND EURODEBE <> 0 ORDER BY id DESC LIMIT 1; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `invoiceInDueDay_calculate` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -54753,44 +55572,46 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `invoiceInDueDay_calculate`(vInvoiceInFk INT) BEGIN IF !(SELECT COUNT(*) - FROM invoiceInDueDay iid + FROM invoiceInDueDay iid WHERE iid.invoiceInFk = vInvoiceInFk) THEN - INSERT INTO invoiceInDueDay (invoiceInFk, - dueDated, - amount, - foreignValue) + INSERT INTO invoiceInDueDay (invoiceInFk, + dueDated, + amount, + foreignValue) SELECT vInvoiceInFk, - IF(payDay, + IF(payDay, IF(vn.getNextDueDate(issued, detail, payDay) < DATE_ADD(created, INTERVAL 2 DAY), DATE_ADD(created, INTERVAL 2 DAY), - vn.getNextDueDate(issued, detail, payDay)), + vn.getNextDueDate(issued, detail, payDay)), GREATEST(TIMESTAMPADD(DAY, 2, created), TIMESTAMPADD(DAY, detail, issued))), - IF((@cont:=@cont + 1) < cont, TRUNCATE(venc / cont, 2),venc-(TRUNCATE(venc / cont, 2) * (cont - 1))), - IF(@cont < cont, TRUNCATE(foreignValue / cont, 2), foreignValue - (TRUNCATE(foreignValue / cont, 2) * (cont - 1))) - FROM ( SELECT SUM((1 + (IFNULL(ti.PorcentajeIva, 0) / 100)*(s.countryFk = s2.countryFk)) * iit.taxableBase)/COUNT(DISTINCT(pdd.detail)) venc, + IF((@cont:=@cont + 1) < cont, TRUNCATE(venc / cont, 2),venc-(TRUNCATE(venc / cont, 2) * (cont - 1))), + IF(@cont < cont, TRUNCATE(foreignValue / cont, 2), foreignValue - (TRUNCATE(foreignValue / cont, 2) * (cont - 1))) + FROM ( SELECT SUM((1 + (IFNULL(ti.PorcentajeIva, 0) / 100)*(s.countryFk = s2.countryFk)) * iit.taxableBase)/COUNT(DISTINCT(pdd.detail)) venc, SUM(iit.foreignValue)/COUNT(DISTINCT(pdd.detail)) foreignValue, - s.payDemFk, + s.payDemFk, ii.companyFk, COUNT(DISTINCT(pdd.detail)) cont, s.payDay, ii.issued, DATE(ii.created) created - FROM invoiceIn ii - JOIN invoiceInTax iit ON iit.invoiceInFk = ii.id - LEFT JOIN sage.TiposIva AS ti ON ti.CodigoIva= iit.taxTypeSageFk - JOIN supplier s ON s.id = ii.supplierFk - JOIN supplier s2 ON s2.id = ii.companyFk - JOIN vn.payDemDetail pdd ON pdd.id = s.payDemFk - WHERE ii.id = vInvoiceInFk + FROM invoiceIn ii + JOIN invoiceInTax iit ON iit.invoiceInFk = ii.id + LEFT JOIN sage.TiposIva AS ti ON ti.CodigoIva= iit.taxTypeSageFk + JOIN supplier s ON s.id = ii.supplierFk + JOIN supplier s2 ON s2.id = ii.companyFk + JOIN vn.payDemDetail pdd ON pdd.id = s.payDemFk + WHERE ii.id = vInvoiceInFk GROUP BY ii.id ) sub - JOIN (SELECT @cont:=0) sub2 + JOIN (SELECT @cont:=0) sub2 JOIN vn.payDemDetail pdd ON pdd.id = sub.payDemFk GROUP BY detail; END IF; @@ -54801,8 +55622,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `invoiceInDueDay_recalc` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -54810,23 +55629,23 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `invoiceInDueDay_recalc`(vInvoiceInFk INT) BEGIN DELETE FROM invoiceInDueDay WHERE invoiceInFk = vInvoiceInFk; - + CALL invoiceInDueDay_calculate(vInvoiceInFk); - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `invoiceInTaxMakeByDua` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -54834,6 +55653,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `invoiceInTaxMakeByDua`(vDuaFk INT) BEGIN @@ -54857,7 +55678,7 @@ BEGIN CALL vn2008.recibidaIvaInsert(vInvoiceInFk); CALL vn2008.recibidaVencimientoReplace(vInvoiceInFk); - + FETCH rs INTO vInvoiceInFk; END WHILE; @@ -54870,8 +55691,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `invoiceInTax_getFromDua` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -54879,6 +55698,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `invoiceInTax_getFromDua`(vDuaFk INT) BEGIN @@ -54902,7 +55723,7 @@ BEGIN CALL invoiceInTax_getFromEntries(vInvoiceInFk); CALL invoiceInDueDay_calculate(vInvoiceInFk); - + FETCH rs INTO vInvoiceInFk; END WHILE; @@ -54915,8 +55736,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `invoiceInTax_getFromEntries` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -54924,6 +55743,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `invoiceInTax_getFromEntries`(IN vId INT) BEGIN @@ -54934,7 +55755,7 @@ BEGIN SELECT MAX(rr.dated) INTO vDated FROM referenceRate rr JOIN invoiceIn ii ON ii.id = vId - WHERE rr.dated <= ii.issued + WHERE rr.dated <= ii.issued AND rr.currencyFk = ii.currencyFk ; IF vDated THEN @@ -54943,13 +55764,13 @@ BEGIN WHERE dated = vDated; END IF; - SELECT id INTO vExpenceFk - FROM vn.expence - WHERE `name` = 'Adquisición mercancia Extracomunitaria' - GROUP BY id + SELECT id INTO vExpenceFk + FROM vn.expence + WHERE `name` = 'Adquisición mercancia Extracomunitaria' + GROUP BY id LIMIT 1; - - DELETE FROM invoiceInTax + + DELETE FROM invoiceInTax WHERE invoiceInFk = vId; INSERT INTO invoiceInTax(invoiceInFk, taxableBase, expenceFk, foreignValue, taxTypeSageFk, transactionTypeSageFk) @@ -54963,9 +55784,9 @@ BEGIN JOIN entry e ON e.invoiceInFk = ii.id JOIN supplier s ON s.id = e.supplierFk JOIN buy b ON b.entryFk = e.id - LEFT JOIN referenceRate rr ON rr.currencyFk = ii.currencyFk + LEFT JOIN referenceRate rr ON rr.currencyFk = ii.currencyFk AND rr.dated = ii.issued - WHERE ii.id = vId + WHERE ii.id = vId HAVING taxableBase IS NOT NULL; END ;; DELIMITER ; @@ -54973,8 +55794,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `invoiceOutAgain` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -54982,6 +55801,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `invoiceOutAgain`(IN vInvoiceRef VARCHAR(15), vTaxArea VARCHAR(25)) BEGIN @@ -54996,15 +55817,15 @@ BEGIN DECLARE vCountry INT; DECLARE vTaxArea VARCHAR(15); DECLARE vSpainCountryCode INT DEFAULT 1; - + SELECT id INTO vInvoiceFk - FROM invoiceOut + FROM invoiceOut WHERE ref = vInvoiceRef; - - UPDATE invoiceOut + + UPDATE invoiceOut SET hasPdf = 0 WHERE id = vInvoiceFk; - + SELECT s.countryFk INTO vCountry FROM supplier s JOIN invoiceOut io ON io.companyFk = s.id @@ -55013,38 +55834,36 @@ BEGIN DROP TEMPORARY TABLE IF EXISTS ticketToInvoice; CREATE TEMPORARY TABLE ticketToInvoice - SELECT id - FROM ticket + SELECT id + FROM ticket WHERE refFk = vInvoiceRef; CALL invoiceExpenceMake(vInvoiceFk); - + CALL invoiceTaxMake(vInvoiceFk,vTaxArea); - + UPDATE invoiceOut io JOIN ( SELECT SUM(amount) AS total - FROM invoiceOutExpence + FROM invoiceOutExpence WHERE invoiceOutFk = vInvoiceFk ) base JOIN ( SELECT SUM(vat) AS total - FROM invoiceOutTax + FROM invoiceOutTax WHERE invoiceOutFk = vInvoiceFk ) vat SET io.amount = base.total + vat.total WHERE io.id = vInvoiceFk; - + CALL vn.invoiceOutBooking(vInvoiceFk); - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `invoiceOutBooking` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -55052,6 +55871,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `invoiceOutBooking`(IN vInvoice INT) BEGIN @@ -55081,7 +55902,7 @@ BEGIN DROP TEMPORARY TABLE IF EXISTS rs; CREATE TEMPORARY TABLE rs - SELECT + SELECT c.accountingAccount AS clientBookingAccount, io.amount as totalAmount, CONCAT('n/fra ', io.ref) as simpleConcept, @@ -55115,19 +55936,19 @@ BEGIN WHERE io.id = vInvoice; CALL vn.ledger_next(vBookNumber); - + -- Linea del cliente INSERT INTO XDiario( ASIEN, FECHA, - SUBCTA, + SUBCTA, EURODEBE, - CONCEPTO, + CONCEPTO, FECHA_EX, FECHA_OP, empresa_id ) - SELECT + SELECT vBookNumber AS ASIEN, rs.FECHA, rs.clientBookingAccount AS SUBCTA, @@ -55143,14 +55964,14 @@ BEGIN ASIEN, FECHA, SUBCTA, - CONTRA, + CONTRA, EUROHABER, - CONCEPTO, + CONCEPTO, FECHA_EX, FECHA_OP, empresa_id ) - SELECT + SELECT vBookNumber AS ASIEN, rs.FECHA, ioe.expenceFk AS SUBCTA, @@ -55164,8 +55985,8 @@ BEGIN JOIN invoiceOutExpence ioe WHERE ioe.invoiceOutFk = vInvoice; - SELECT GROUP_CONCAT(`name` SEPARATOR ',') - INTO vExpenceConcept + SELECT GROUP_CONCAT(`name` SEPARATOR ',') + INTO vExpenceConcept FROM expence e JOIN invoiceOutExpence ioe ON ioe.expenceFk = e.id WHERE ioe.invoiceOutFk = vInvoice; @@ -55175,7 +55996,7 @@ BEGIN ASIEN, FECHA, SUBCTA, - CONTRA, + CONTRA, EUROHABER, BASEEURO, CONCEPTO, @@ -55203,7 +56024,7 @@ BEGIN TIPORECTIF, empresa_id ) - SELECT + SELECT vBookNumber AS ASIEN, rs.FECHA, iot.pgcFk AS SUBCTA, @@ -55223,11 +56044,11 @@ BEGIN rs.FECHA_OP, rs.FECHA_EX, rs.TIPOOPE, - rs.NFACTICK, + rs.NFACTICK, rs.TERIDNIF, rs.TERNIF, rs.TERNOM, - pgc.mod340 AS L340, + pgc.mod340 AS L340, pgc.cplusTrascendency477Fk AS TIPOCLAVE, pgc.cplusTaxBreakFk as TIPOEXENCI, rs.TIPONOSUJE, @@ -55235,13 +56056,13 @@ BEGIN rs.TIPORECTIF, rs.companyFk AS empresa_id FROM rs - JOIN invoiceOutTax iot + JOIN invoiceOutTax iot JOIN pgc ON pgc.code = iot.pgcFk LEFT JOIN pgcEqu pe ON pe.vatFk = iot.pgcFk -- --------------- Comprueba si la linea es de iva con rec.equiv. asociado - LEFT JOIN pgc pgce ON pgce.code = pe.equFk + LEFT JOIN pgc pgce ON pgce.code = pe.equFk LEFT JOIN pgcEqu pe2 ON pe2.equFk = iot.pgcFk -- --------------- Comprueba si la linea es de rec.equiv. WHERE iot.invoiceOutFk = vInvoice; - + UPDATE invoiceOut SET booked = util.VN_CURDATE() WHERE id = vInvoice; @@ -55251,8 +56072,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `invoiceOutBookingRange` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -55260,6 +56079,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `invoiceOutBookingRange`() BEGIN @@ -55273,7 +56094,7 @@ BEGIN DECLARE done BOOL DEFAULT FALSE; - DECLARE rs CURSOR FOR + DECLARE rs CURSOR FOR SELECT io.id FROM invoiceOut io WHERE RIGHT(ref,7) BETWEEN 1724215 AND 1724224 @@ -55288,15 +56109,15 @@ BEGIN WHILE NOT done DO CALL invoiceOutBooking(vInvoice); - + FETCH rs INTO vInvoice ; - + SET vContador = vContador + 1; - + IF vContador MOD 50 = 0 THEN - + SELECT CONCAT(vContador, ' de momento') AS FACTURAS_ASENTADAS; - + END IF; END WHILE; @@ -55311,8 +56132,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `invoiceOutDelete` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -55320,20 +56139,22 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `invoiceOutDelete`(vRef VARCHAR(15)) BEGIN DECLARE vAsien INTEGER; DECLARE vSendMail BOOL; DECLARE vBody TEXT; - + SELECT ASIEN INTO vAsien - FROM XDiario + FROM XDiario WHERE SERIE = SUBSTRING(vRef, 1, 1) AND FACTURA = SUBSTRING(vRef, 2, LENGTH(vRef)-1) LIMIT 1; - SELECT IF(enlazado OR enlazadoSage, TRUE, FALSE), + SELECT IF(enlazado OR enlazadoSage, TRUE, FALSE), CONCAT( ' @@ -55342,7 +56163,7 @@ BEGIN - ', + ', GROUP_CONCAT( CONCAT(' @@ -55355,14 +56176,14 @@ BEGIN ) SEPARATOR ' ' ), '
FECHACONCEPTO EURODEBE EUROHABER
', IFNULL(FECHA,''), '
' - ) + ) INTO vSendMail, vBody - FROM XDiario + FROM XDiario WHERE ASIEN = vAsien; - DELETE FROM XDiario + DELETE FROM XDiario WHERE ASIEN = vAsien; - + IF vSendMail THEN CALL mail_insert( 'administracion@verdnatura.es', @@ -55380,7 +56201,7 @@ BEGIN SET refFk = NULL WHERE refFk = vRef; - DELETE + DELETE FROM invoiceOut WHERE ref = vRef; @@ -55390,8 +56211,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `invoiceOutListByCompany` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -55399,11 +56218,13 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `invoiceOutListByCompany`(vCompany INT, vStarted DATE, vEnded DATE) BEGIN -SELECT +SELECT c.socialName as RazonSocial, c.fi as NIF, io.ref as Factura, @@ -55415,7 +56236,7 @@ SELECT pgc.rate as Tipo, iot.vat as Cuota, pgc.name as Concepto - + FROM vn.invoiceOut io JOIN vn.invoiceOutTax iot ON iot.invoiceOutFk = io.id JOIN vn.client c ON c.id = io.clientFk @@ -55430,8 +56251,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `invoiceOutTaxAndExpence` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -55439,6 +56258,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `invoiceOutTaxAndExpence`() BEGIN @@ -55456,10 +56277,10 @@ BEGIN DECLARE done BOOL DEFAULT FALSE; - DECLARE rs CURSOR FOR + DECLARE rs CURSOR FOR SELECT id,ref FROM invoiceOut io - + WHERE issued >= '2017-07-01' AND companyFk = 1381 AND io.amount IS NULL @@ -55474,37 +56295,37 @@ BEGIN WHILE NOT done DO - SELECT s.countryFk + SELECT s.countryFk INTO vCountry FROM supplier s JOIN invoiceOut io ON io.companyFk = s.id WHERE io.id = vInvoice; - + SELECT IF(c.isEqualizated AND i.taxAreaFk = 'NATIONAL','EQU',i.taxAreaFk) INTO vTaxArea FROM invoiceOutSerial i - JOIN invoiceOut io ON io.serial = i.code + JOIN invoiceOut io ON io.serial = i.code JOIN client c ON c.id = io.clientFk WHERE io.id = vInvoice; - + DROP TEMPORARY TABLE IF EXISTS ticketToInvoice; CREATE TEMPORARY TABLE ticketToInvoice - SELECT id - FROM ticket + SELECT id + FROM ticket WHERE refFk = vInvoiceRef; CALL invoiceExpenceMake(vInvoice); CALL invoiceTaxMake(vInvoice,vCountry,vTaxArea); - + FETCH rs INTO vInvoice ,vInvoiceRef; - + SET vContador = vContador + 1; - + IF vContador MOD 50 = 0 THEN - + SELECT CONCAT(vContador, ' de momento') AS FACTURAS_ASENTADAS; - + END IF; END WHILE; @@ -55519,8 +56340,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `invoiceOut_exportationFromClient` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -55528,44 +56347,44 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `invoiceOut_exportationFromClient`( - vMaxTicketDate DATETIME, - vClientFk INT, - vCompanyFk INT) + vMaxTicketDate DATETIME, + vClientFk INT, + vCompanyFk INT) BEGIN /** * Genera tabla temporal ticketToInvoice necesaría para el proceso de facturación - * Los abonos quedan excluidos en las exportaciones - * - * @param vMaxTicketDate Fecha hasta la cual cogera tickets para facturar + * Los abonos quedan excluidos en las exportaciones + * + * @param vMaxTicketDate Fecha hasta la cual cogerá tickets para facturar * @param vClientFk Id del cliente a facturar * @param vCompanyFk Id de la empresa desde la que se factura */ - DECLARE vMinTicketDate DATE; - SET vMinTicketDate = util.firstDayOfYear(vMaxTicketDate - INTERVAL 1 YEAR); - SET vMaxTicketDate = util.dayend(vMaxTicketDate); + DECLARE vMinTicketDate DATE; + SET vMinTicketDate = util.firstDayOfYear(vMaxTicketDate - INTERVAL 1 YEAR); + SET vMaxTicketDate = util.dayend(vMaxTicketDate); - DROP TEMPORARY TABLE IF EXISTS `ticketToInvoice`; - CREATE TEMPORARY TABLE `ticketToInvoice` - (PRIMARY KEY (`id`)) - ENGINE = MEMORY - SELECT t.id - FROM ticket t - JOIN agencyMode am ON am.id = t.agencyModeFk - WHERE t.clientFk = vClientFk - AND t.refFk IS NULL - AND t.companyFk = vCompanyFk - AND (t.shipped BETWEEN vMinTicketDate AND vMaxTicketDate) - AND am.`code` <> 'refund'; + DROP TEMPORARY TABLE IF EXISTS `ticketToInvoice`; + CREATE TEMPORARY TABLE `ticketToInvoice` + (PRIMARY KEY (`id`)) + ENGINE = MEMORY + SELECT t.id + FROM ticket t + JOIN agencyMode am ON am.id = t.agencyModeFk + WHERE t.clientFk = vClientFk + AND t.refFk IS NULL + AND t.companyFk = vCompanyFk + AND t.shipped BETWEEN vMinTicketDate AND vMaxTicketDate + AND (am.`code` IS NULL OR am.`code` <> 'refund'); END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `invoiceOut_new` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -55573,6 +56392,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `invoiceOut_new`( vSerial VARCHAR(255), @@ -55589,27 +56410,27 @@ BEGIN * @param vTaxArea tipo de iva en relacion a la empresa y al cliente * @param vNewInvoiceId id de la factura que se acaba de generar * @return vNewInvoiceId - */ - DECLARE vSpainCountryCode INT DEFAULT 1; + */ DECLARE vIsAnySaleToInvoice BOOL; DECLARE vIsAnyServiceToInvoice BOOL; DECLARE vNewRef VARCHAR(255); DECLARE vWorker INT DEFAULT account.myUser_getId(); - DECLARE vCompany INT; - DECLARE vSupplier INT; - DECLARE vClient INT; + DECLARE vCompanyFk INT; + DECLARE vInterCompanyFk INT; + DECLARE vClientFk INT; DECLARE vCplusStandardInvoiceTypeFk INT DEFAULT 1; DECLARE vCplusCorrectingInvoiceTypeFk INT DEFAULT 6; DECLARE vCplusSimplifiedInvoiceTypeFk INT DEFAULT 2; DECLARE vCorrectingSerial VARCHAR(1) DEFAULT 'R'; DECLARE vSimplifiedSerial VARCHAR(1) DEFAULT 'S'; - DECLARE vNewInvoiceInId INT; - DECLARE vIsInterCompany BOOL; + DECLARE vNewInvoiceInFk INT; + DECLARE vIsInterCompany BOOL DEFAULT FALSE; + DECLARE vIsCEESerial BOOL DEFAULT FALSE; SET vInvoiceDate = IFNULL(vInvoiceDate,util.VN_CURDATE()); SELECT t.clientFk, t.companyFk - INTO vClient, vCompany + INTO vClientFk, vCompanyFk FROM ticketToInvoice tt JOIN ticket t ON t.id = tt.id LIMIT 1; @@ -55640,8 +56461,7 @@ BEGIN THEN -- el trigger añade el siguiente Id_Factura correspondiente a la vSerial - INSERT INTO invoiceOut - ( + INSERT INTO invoiceOut( ref, serial, issued, @@ -55650,21 +56470,20 @@ BEGIN companyFk, cplusInvoiceType477Fk ) - SELECT - 1, - vSerial, - vInvoiceDate, - vClient, - getDueDate(vInvoiceDate, dueDay), - vCompany, - IF(vSerial = vCorrectingSerial, - vCplusCorrectingInvoiceTypeFk, - IF(vSerial = vSimplifiedSerial, - vCplusSimplifiedInvoiceTypeFk, - vCplusStandardInvoiceTypeFk)) - FROM client - WHERE id = vClient; - + SELECT + 1, + vSerial, + vInvoiceDate, + vClientFk, + getDueDate(vInvoiceDate, dueDay), + vCompanyFk, + IF(vSerial = vCorrectingSerial, + vCplusCorrectingInvoiceTypeFk, + IF(vSerial = vSimplifiedSerial, + vCplusSimplifiedInvoiceTypeFk, + vCplusStandardInvoiceTypeFk)) + FROM client + WHERE id = vClientFk; SET vNewInvoiceId = LAST_INSERT_ID(); @@ -55685,7 +56504,7 @@ BEGIN JOIN state s WHERE IFNULL(ts.alertLevel,0) < 3 and s.`code` = getAlert3State(ti.id); - INSERT INTO vncontrol.inter(state_id,Id_Ticket,Id_Trabajador) + INSERT INTO ticketTracking(stateFk,ticketFk,workerFk) SELECT * FROM tmp.updateInter; INSERT INTO ticketLog (action, userFk, originFk, description) @@ -55697,12 +56516,12 @@ BEGIN UPDATE invoiceOut io JOIN ( - SELECT SUM(amount) AS total + SELECT SUM(amount) total FROM invoiceOutExpence WHERE invoiceOutFk = vNewInvoiceId ) base JOIN ( - SELECT SUM(vat) AS total + SELECT SUM(vat) total FROM invoiceOutTax WHERE invoiceOutFk = vNewInvoiceId ) vat @@ -55710,23 +56529,18 @@ BEGIN WHERE io.id = vNewInvoiceId; DROP TEMPORARY TABLE tmp.updateInter; - - SELECT ios.isCEE INTO vIsInterCompany - FROM vn.ticket t - JOIN vn.company c ON c.clientFk = t.clientFk - JOIN vn.invoiceOut io ON io.`ref` = t.refFk - JOIN vn.invoiceOutSerial ios ON ios.code = io.serial - WHERE t.refFk = vNewRef; - + + SELECT COUNT(*), id + INTO vIsInterCompany, vInterCompanyFk + FROM company + WHERE clientFk = vClientFk; + IF (vIsInterCompany) THEN - SELECT vCompany INTO vSupplier; - SELECT id INTO vCompany FROM company WHERE clientFk = vClient; - INSERT INTO invoiceIn(supplierFk, supplierRef, issued, companyFk) - SELECT vSupplier, vNewRef, vInvoiceDate, vCompany; + SELECT vCompanyFk, vNewRef, vInvoiceDate, vInterCompanyFk; - SET vNewInvoiceInId = LAST_INSERT_ID(); + SET vNewInvoiceInFk = LAST_INSERT_ID(); DROP TEMPORARY TABLE IF EXISTS tmp.ticket; CREATE TEMPORARY TABLE tmp.ticket @@ -55740,59 +56554,77 @@ BEGIN SET @vTaxableBaseServices := 0.00; SET @vTaxCodeGeneral := NULL; - INSERT INTO vn.invoiceInTax(invoiceInFk, taxableBase, expenceFk, taxTypeSageFk, transactionTypeSageFk) - SELECT vNewInvoiceInId, @vTaxableBaseServices, sub.expenceFk, sub.taxTypeSageFk , sub.transactionTypeSageFk + INSERT INTO invoiceInTax(invoiceInFk, taxableBase, expenceFk, taxTypeSageFk, transactionTypeSageFk) + SELECT vNewInvoiceInFk, + @vTaxableBaseServices, + sub.expenceFk, + sub.taxTypeSageFk, + sub.transactionTypeSageFk FROM ( - SELECT @vTaxableBaseServices := SUM(tst.taxableBase) taxableBase, i.expenceFk, i.taxTypeSageFk , i.transactionTypeSageFk, @vTaxCodeGeneral := i.taxClassCodeFk + SELECT @vTaxableBaseServices := SUM(tst.taxableBase) taxableBase, + i.expenceFk, + i.taxTypeSageFk, + i.transactionTypeSageFk, + @vTaxCodeGeneral := i.taxClassCodeFk FROM tmp.ticketServiceTax tst - JOIN vn.invoiceOutTaxConfig i ON i.taxClassCodeFk = tst.code + JOIN invoiceOutTaxConfig i ON i.taxClassCodeFk = tst.code WHERE i.isService HAVING taxableBase ) sub; - INSERT INTO vn.invoiceInTax(invoiceInFk, taxableBase, expenceFk, taxTypeSageFk, transactionTypeSageFk) - SELECT vNewInvoiceInId, SUM(tt.taxableBase) - IF(tt.code = @vTaxCodeGeneral, @vTaxableBaseServices, 0) taxableBase, i.expenceFk, i.taxTypeSageFk , i.transactionTypeSageFk + INSERT INTO invoiceInTax(invoiceInFk, taxableBase, expenceFk, taxTypeSageFk, transactionTypeSageFk) + SELECT vNewInvoiceInFk, + SUM(tt.taxableBase) - IF(tt.code = @vTaxCodeGeneral, + @vTaxableBaseServices, 0) taxableBase, + i.expenceFk, + i.taxTypeSageFk , + i.transactionTypeSageFk FROM tmp.ticketTax tt - JOIN vn.invoiceOutTaxConfig i ON i.taxClassCodeFk = tt.code + JOIN invoiceOutTaxConfig i ON i.taxClassCodeFk = tt.code WHERE !i.isService GROUP BY tt.pgcFk HAVING taxableBase ORDER BY tt.priority; - CALL invoiceInDueDay_calculate(vNewInvoiceInId); + CALL invoiceInDueDay_calculate(vNewInvoiceInFk); + + SELECT COUNT(*) INTO vIsCEESerial + FROM invoiceOutSerial + WHERE code = vSerial; - INSERT INTO invoiceInIntrastat ( - invoiceInFk, - intrastatFk, - amount, - stems, - countryFk, - net) - SELECT - vNewInvoiceInId, + IF vIsCEESerial THEN + + INSERT INTO invoiceInIntrastat ( + invoiceInFk, + intrastatFk, + amount, + stems, + countryFk, + net) + SELECT + vNewInvoiceInFk, i.intrastatFk, - CAST(sv.eurosValue AS DECIMAL (10, 2)), - CAST(SUM(IFNULL(i.stems, 1) * s.quantity) AS DECIMAL (10, 2)), + SUM(CAST((s.quantity * s.price * (100 - s.discount) / 100 ) AS DECIMAL(10, 2))), + SUM(CAST(IFNULL(i.stems, 1) * s.quantity AS DECIMAL(10, 2))), su.countryFk, - CAST(SUM(IFNULL(sv.physicalWeight, sv.weight)) AS DECIMAL(10, 2)) + CAST(SUM(IFNULL(i.stems, 1) + * s.quantity + * IF(ic.grams, ic.grams, IFNULL(i.weightByPiece, 0)) / 1000) AS DECIMAL(10, 2)) FROM sale s - LEFT JOIN vn.saleVolume sv ON sv.saleFk = s.id - LEFT JOIN ticket t ON s.ticketFk = t.id - LEFT JOIN supplier su ON su.id = t.companyFk - LEFT JOIN item i ON i.id = s.itemFk - JOIN invoiceOut iOut ON iOut.ref = t.refFk - WHERE iOut.`ref` = vNewRef + JOIN ticket t ON s.ticketFk = t.id + JOIN supplier su ON su.id = t.companyFk + JOIN item i ON i.id = s.itemFk + LEFT JOIN itemCost ic ON ic.itemFk = i.id AND ic.warehouseFk = t.warehouseFk + WHERE t.refFk = vNewRef GROUP BY i.intrastatFk; + END IF; DROP TEMPORARY TABLE tmp.ticket; DROP TEMPORARY TABLE tmp.ticketAmount; DROP TEMPORARY TABLE tmp.ticketTax; DROP TEMPORARY TABLE tmp.ticketServiceTax; - END IF; - END IF; - DROP TEMPORARY TABLE `ticketToInvoice`; END ;; DELIMITER ; @@ -55800,8 +56632,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `invoiceOut_newFromClient` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -55809,19 +56639,21 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `invoiceOut_newFromClient`( - IN vClientFk INT, - IN vSerial CHAR(2), + IN vClientFk INT, + IN vSerial CHAR(2), IN vMaxShipped DATE, - IN vCompanyFk INT, + IN vCompanyFk INT, IN vTaxArea VARCHAR(25), - IN vRef VARCHAR(25), + IN vRef VARCHAR(25), OUT vInvoiceId INT) BEGIN /** * Factura los tickets de un cliente hasta una fecha dada - * @param vClientFk Id del cliente a facturar + * @param vClientFk Id del cliente a facturar * @param vSerial Serie de factura * @param vMaxShipped Fecha hasta la cual cogera tickets para facturar * @param vCompanyFk Id de la empresa desde la que se factura @@ -55840,11 +56672,11 @@ BEGIN IF NOT vIsRefEditable THEN CALL util.throw('serial non editable'); END IF; - END IF; + END IF; SELECT COUNT(*) INTO vIsExportation FROM vn.invoiceOutSerial - WHERE taxAreaFk = 'WORLD' + WHERE taxAreaFk = 'WORLD' AND `code` = vSerial; IF vIsExportation THEN @@ -55857,7 +56689,7 @@ BEGIN UPDATE invoiceOut SET `ref` = vRef - WHERE id = vInvoiceId + WHERE id = vInvoiceId AND vRef IS NOT NULL; IF vSerial <> 'R' AND NOT ISNULL(vInvoiceId) AND vInvoiceId <> 0 THEN @@ -55869,8 +56701,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `invoiceOut_newFromTicket` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -55878,6 +56708,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `invoiceOut_newFromTicket`(IN vTicketFk int, IN vSerial char(2), IN vTaxArea varchar(25), IN vRef varchar(25), OUT vInvoiceId int) @@ -55886,7 +56718,7 @@ BEGIN * Factura un ticket * @param vTicketFk Id del ticket * @param vSerial Serie de factura - * @param vTaxArea Area de la factura en caso de querer forzarlo, + * @param vTaxArea Area de la factura en caso de querer forzarlo, * en la mayoria de los casos poner NULL * @return vInvoiceId */ @@ -55901,11 +56733,11 @@ BEGIN IF NOT vIsRefEditable THEN CALL util.throw('serial non editable'); END IF; - - UPDATE invoiceOut + + UPDATE invoiceOut SET `ref` = vRef WHERE id = vInvoiceId; - END IF; + END IF; IF vSerial <> 'R' AND NOT ISNULL(vInvoiceId) AND vInvoiceId <> 0 THEN CALL invoiceOutBooking(vInvoiceId); @@ -55916,8 +56748,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `invoiceTaxMake` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -55925,6 +56755,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `invoiceTaxMake`(vInvoice INT, vTaxArea VARCHAR(25)) BEGIN @@ -55938,14 +56770,14 @@ BEGIN */ DELETE FROM invoiceOutTax WHERE invoiceOutFk = vInvoice; - + DROP TEMPORARY TABLE IF EXISTS tmp.ticket; CREATE TEMPORARY TABLE tmp.ticket (KEY (ticketFk)) ENGINE = MEMORY SELECT id ticketFk FROM ticketToInvoice; - + CALL ticket_getTax(vTaxArea); INSERT INTO invoiceOutTax( @@ -55962,7 +56794,7 @@ BEGIN GROUP BY pgcFk HAVING BASE ORDER BY priority; - + DROP TEMPORARY TABLE tmp.ticket; DROP TEMPORARY TABLE tmp.ticketTax; DROP TEMPORARY TABLE tmp.ticketAmount; @@ -55973,8 +56805,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `itemBarcode_update` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -55982,12 +56812,14 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `itemBarcode_update`(vItemFk INT,vCode VARCHAR(22), vDelete BOOL) BEGIN IF vDelete THEN DELETE FROM vn.itemBarcode WHERE itemFk = vItemFk AND code = vCode; -ELSE +ELSE INSERT INTO vn.itemBarcode(itemFk,code) VALUES (vItemFk,vCode); END IF; @@ -55997,8 +56829,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `itemFreight_Show` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -56006,11 +56836,13 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `itemFreight_Show`(vItemFk INT, vWarehouseFk INT) BEGIN - - SELECT cm3 Volumen_Entrada, + + SELECT cm3 Volumen_Entrada, cm3delivery Volumen_Salida, p.volume Volumen_del_embalaje, p.width Ancho_del_embalaje, @@ -56023,11 +56855,11 @@ BEGIN b.id buyFk, b.entryFk, w.name warehouseFk - FROM vn.itemCost ic - JOIN vn.item i ON i.id = ic.itemFk - LEFT JOIN cache.last_buy lb ON lb.item_id = ic.itemFk AND lb.warehouse_id = ic.warehouseFk - LEFT JOIN vn.buy b ON b.id = lb.buy_id - LEFT JOIN vn.packaging p ON p.id = b.packageFk + FROM vn.itemCost ic + JOIN vn.item i ON i.id = ic.itemFk + LEFT JOIN cache.last_buy lb ON lb.item_id = ic.itemFk AND lb.warehouse_id = ic.warehouseFk + LEFT JOIN vn.buy b ON b.id = lb.buy_id + LEFT JOIN vn.packaging p ON p.id = b.packageFk LEFT JOIN vn.warehouse w ON w.id = ic.warehouseFk WHERE ic.itemFk = vItemFk AND ic.warehouseFk = vWarehouseFk; @@ -56037,8 +56869,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `itemFuentesBalance` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -56046,38 +56876,40 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `itemFuentesBalance`(vDaysInFuture INT) BEGIN /* Se utiliza para calcular la necesidad de mover mercancia entre el almacén de fuentes y el nuestro - * + * * @param vDaysInFuture Rango de dias para calcular entradas y salidas - * + * */ - + DECLARE vWarehouseFk INT; SELECT s.warehouseFk INTO vWarehouseFk - FROM vn.sector s + FROM vn.sector s WHERE s.code = 'FUENTES_PICASSE'; - + CALL cache.stock_refresh(FALSE); - SELECT i.id itemFk, + SELECT i.id itemFk, i.longName, i.size, i.subName, - v.amount - IFNULL(fue.Fuentes,0) - IFNULL(alb.albenfruit,0) as visible, - fue.Fuentes, + v.amount - IFNULL(fue.Fuentes,0) - IFNULL(alb.albenfruit,0) as visible, + fue.Fuentes, alb.Albenfruit, - sale.venta, - IFNULL(buy.compra,0) + IFNULL(mov.traslado,0) as compra, - IFNULL(v.amount,0) + IFNULL(sale.venta,0) + IFNULL(buy.compra,0) + IFNULL(mov.traslado,0) + sale.venta, + IFNULL(buy.compra,0) + IFNULL(mov.traslado,0) as compra, + IFNULL(v.amount,0) + IFNULL(sale.venta,0) + IFNULL(buy.compra,0) + IFNULL(mov.traslado,0) - IFNULL(fue.Fuentes,0) - IFNULL(alb.albenfruit,0) as saldo - FROM vn.item i - JOIN vn.itemType it ON it.id = i.typeFk - JOIN vn.itemCategory ic ON ic.id = it.categoryFk + FROM vn.item i + JOIN vn.itemType it ON it.id = i.typeFk + JOIN vn.itemCategory ic ON ic.id = it.categoryFk LEFT JOIN ( SELECT ish.itemFk, CAST(SUM(ish.visible) AS DECIMAL(10,0)) AS Fuentes FROM vn.itemShelving ish @@ -56085,7 +56917,7 @@ BEGIN JOIN vn.parking p ON p.id = sh.parkingFk JOIN vn.sector s ON s.id = p.sectorFk WHERE s.code = 'FUENTES_PICASSE' - GROUP BY ish.itemFk + GROUP BY ish.itemFk ) fue ON fue.itemFk = i.id LEFT JOIN ( SELECT ish.itemFk, CAST(SUM(ish.visible) AS DECIMAL(10,0)) AS Albenfruit @@ -56094,7 +56926,7 @@ BEGIN JOIN vn.parking p ON p.id = sh.parkingFk JOIN vn.sector s ON s.id = p.sectorFk WHERE s.code = 'ALBENFRUIT' - GROUP BY ish.itemFk + GROUP BY ish.itemFk ) alb ON alb.itemFk = i.id LEFT JOIN cache.stock v ON i.id = v.item_id AND v.warehouse_id = vWarehouseFk LEFT JOIN ( @@ -56119,9 +56951,9 @@ BEGIN AND warehouse_id = vWarehouseFk GROUP BY item_id ) mov ON mov.item_id = i.id - WHERE (v.amount OR fue.Fuentes OR alb.Albenfruit) + WHERE (v.amount OR fue.Fuentes OR alb.Albenfruit) AND i.itemPackingTypeFk = 'H' - AND ic.shortLife + AND ic.shortLife ; END ;; @@ -56130,8 +56962,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `itemPlacementFromTicket` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -56139,11 +56969,13 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `itemPlacementFromTicket`(vTicket INT) BEGIN /** - * Llama a itemPlacementUpdateVisible + * Llama a itemPlacementUpdateVisible * de los articulos de la tabla temporal tmp.itemPlacement(itemFk) * @treturn tmp.itemPlacement * @param vTicket Id del Ticket @@ -56157,9 +56989,9 @@ BEGIN FROM ticket t JOIN sale s ON s.ticketFk = t.id WHERE t.id = vTicket; - + CALL itemPlacementUpdateVisible(); - + DROP TEMPORARY TABLE tmp.itemPlacement; END ;; DELIMITER ; @@ -56167,8 +56999,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `itemPlacementSupplyAiming` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -56176,6 +57006,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `itemPlacementSupplyAiming`(vShelvingFk VARCHAR(10), quantity INT, vItemFk INT) BEGIN @@ -56192,7 +57024,7 @@ BEGIN CAST(FLOOR(LEAST(ish.stock,quantity) / ish.packing) AS DECIMAL(10,0)), ' x ', ish.packing, - IF ( + IF ( LEAST(ish.stock,quantity) MOD ish.packing, CONCAT(' + ',CAST(LEAST(ish.stock,quantity) MOD ish.packing AS DECIMAL(10,0))), '' @@ -56210,8 +57042,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `itemPlacementSupplyCloseOrder` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -56219,11 +57049,13 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `itemPlacementSupplyCloseOrder`(vId INT, vQuantity INT) BEGIN - UPDATE vn.itemPlacementSupply + UPDATE vn.itemPlacementSupply SET priority = 10 WHERE id = vId; @@ -56233,8 +57065,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `itemPlacementSupplyGetOrder` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -56242,6 +57072,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `itemPlacementSupplyGetOrder`(vSector INT ) BEGIN @@ -56249,7 +57081,7 @@ BEGIN DECLARE vId INT; DECLARE vLastParkingFk INT; DECLARE vNextParkingFk INT; - + SELECT sh.parkingFk INTO vLastParkingFk FROM vn.itemShelvingPlacementSupply isps JOIN vn.itemShelving ish ON ish.id = isps.itemShelvingFk @@ -56257,9 +57089,9 @@ BEGIN WHERE isps.userFk = getUser() ORDER BY isps.created DESC LIMIT 1; - + SET vNextParkingFk = vn.itemShelvingPlacementSupply_ClosestGet(vLastParkingFk); - + SELECT ipsl.id INTO vId FROM vn.itemPlacementSupplyList ipsl JOIN vn.itemShelvingPlacementSupplyStock ispss ON ispss.itemFk = ipsl.itemFk @@ -56268,13 +57100,13 @@ BEGIN AND ipsl.sectorFk = vSector ORDER BY ipsl.repoUserFk DESC, ipsl.priority DESC, (ispss.parkingFk = vNextParkingFk) DESC, ispss.parking DESC, ipsl.created LIMIT 1; - + UPDATE vn.itemPlacementSupply SET repoUserFk = getUser() WHERE id = vId; - - SELECT * FROM vn.itemPlacementSupplyList - WHERE id = vId + + SELECT * FROM vn.itemPlacementSupplyList + WHERE id = vId AND sectorFk = vSector; END ;; @@ -56283,8 +57115,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `itemPlacementSupplyStockGetTargetList` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -56292,6 +57122,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `itemPlacementSupplyStockGetTargetList`(vItemFk INT,vSectorFk INT) BEGIN @@ -56330,8 +57162,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `itemProposal` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -56339,6 +57169,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `itemProposal`(vItemFk INT, vTicketFk INT,vShowType BOOL) BEGIN @@ -56349,20 +57181,20 @@ BEGIN * @param vItemFk item id * @param vTicketFk ticket id * @param vShowType mostrar tipos - */ + */ DECLARE vWarehouseFk INT; DECLARE vShipped DATE; DECLARE vCalcFk INT; DECLARE vTypeFk INT; - - + + DECLARE vTag1 VARCHAR(25); DECLARE vTag5 VARCHAR(25); DECLARE vTag6 VARCHAR(25); DECLARE vTag7 VARCHAR(25); DECLARE vTag8 VARCHAR(25); - + DECLARE vValue1 VARCHAR(50); DECLARE vValue5 VARCHAR(50); DECLARE vValue6 VARCHAR(50); @@ -56372,16 +57204,16 @@ BEGIN SELECT warehouseFk, shipped INTO vWarehouseFk, vShipped FROM vn.ticket WHERE id = vTicketFk; - + SELECT typeFk, tag5, value5, tag6, value6, tag7, value7, tag8, value8, t1.name, it1.value INTO vTypeFk, vTag5, vValue5, vTag6, vValue6, vTag7, vValue7, vTag8, vValue8, vTag1, vValue1 FROM vn.item i LEFT JOIN vn.itemTag it1 ON it1.itemFk = i.id AND it1.priority = 1 LEFT JOIN vn.tag t1 ON t1.id = it1.tagFk WHERE i.id = vItemFk; - + CALL cache.available_refresh(vCalcFk, FALSE, vWarehouseFk, vShipped); - + SELECT i.id itemFk, i.longName, i.subName, @@ -56414,7 +57246,7 @@ BEGIN ORDER BY counter DESC, (t1.name = vTag1 COLLATE utf8_general_ci) DESC, (it1.value = vValue1 COLLATE utf8_general_ci) DESC, - (i.tag6 = vTag6 COLLATE utf8_general_ci) DESC, + (i.tag6 = vTag6 COLLATE utf8_general_ci) DESC, (i.value6 = vValue6 COLLATE utf8_general_ci) DESC, (i.tag5 = vTag5 COLLATE utf8_general_ci) DESC, (i.value5 = vValue5 COLLATE utf8_general_ci) DESC, @@ -56422,7 +57254,7 @@ BEGIN (i.value7 = vValue7 COLLATE utf8_general_ci) DESC, (i.tag8 = vTag8 COLLATE utf8_general_ci) DESC, (i.value8 = vValue8 COLLATE utf8_general_ci) DESC; - + END ;; DELIMITER ; @@ -56430,8 +57262,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `itemProposal_Add` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -56439,6 +57269,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `itemProposal_Add`(vSaleFk INT, vMateFk INT, vQuantity INT) BEGIN @@ -56448,7 +57280,7 @@ BEGIN * @param vSaleFk id de la tabla sale * @param vMateFk articulo sustituto * @ param vQuantity cantidad que se va a sustituir - */ + */ DECLARE vTicketFk INT; DECLARE vItemFk INT; DECLARE vWarehouseFk SMALLINT; @@ -56457,41 +57289,41 @@ BEGIN DECLARE vBox INT; DECLARE vPacking INT; DECLARE vRoundQuantity INT DEFAULT 1; - + SELECT s.ticketFk, LEAST(s.quantity, vQuantity), s.itemFk,t.shipped,t.warehouseFk INTO vTicketFk, vQuantity, vItemFk,vDate,vWarehouseFk FROM vn.sale s JOIN vn.ticket t ON t.id = s.ticketFk WHERE s.id = vSaleFk; - + UPDATE vn.sale SET quantity = quantity - vQuantity WHERE id = vSaleFk; - + CALL vn.buyUltimate(vWarehouseFk, vDate); - + SELECT `grouping`, groupingMode, packing INTO vGrouping,vBox,vPacking FROM buy b JOIN tmp.buyUltimate tmp ON b.id = tmp.buyFk WHERE tmp.itemFk = vMateFk AND tmp.WarehouseFk = vWarehouseFk; - + IF vBox = 2 AND vPacking > 0 THEN SET vRoundQuantity = vPacking; END IF; IF vBox = 1 AND vGrouping > 0 THEN SET vRoundQuantity = vGrouping; END IF; - + INSERT INTO vn.sale(ticketFk, itemFk, quantity, concept) SELECT vTicketFk, vMateFk, CEIL(vQuantity / vRoundQuantity) * vRoundQuantity, CONCAT('+ ',i.longName) FROM vn.item i WHERE id = vMateFk; - + SELECT LAST_INSERT_ID() INTO vSaleFk; - + CALL vn.sale_calculateComponent(vSaleFk, NULL); - + INSERT INTO vn.itemProposal(itemFk, mateFk, counter) VALUES(vItemFk, vMateFk, 1) ON DUPLICATE KEY UPDATE counter = counter + 1; @@ -56502,8 +57334,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `itemProposal_beta` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -56511,6 +57341,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `itemProposal_beta`(vItemFk INT, vTicketFk INT) BEGIN @@ -56520,13 +57352,13 @@ BEGIN DECLARE vCalcFk INT; DECLARE vTypeFk INT; DECLARE vResultsMax INT DEFAULT 10; - + DECLARE vTag1 VARCHAR(25); DECLARE vTag5 VARCHAR(25); DECLARE vTag6 VARCHAR(25); DECLARE vTag7 VARCHAR(25); DECLARE vTag8 VARCHAR(25); - + DECLARE vValue1 VARCHAR(50); DECLARE vValue5 VARCHAR(50); DECLARE vValue6 VARCHAR(50); @@ -56536,16 +57368,16 @@ BEGIN SELECT warehouseFk, shipped INTO vWarehouseFk, vShipped FROM vn.ticket WHERE id = vTicketFk; - + SELECT typeFk, tag5, value5, tag6, value6, tag7, value7, tag8, value8, t1.name, it1.value INTO vTypeFk, vTag5, vValue5, vTag6, vValue6, vTag7, vValue7, vTag8, vValue8, vTag1, vValue1 - FROM vn.item i + FROM vn.item i LEFT JOIN vn.itemTag it1 ON it1.itemFk = i.id AND it1.priority = 1 LEFT JOIN vn.tag t1 ON t1.id = it1.tagFk WHERE i.id = vItemFk; - + CALL cache.available_refresh(vCalcFk, FALSE, vWarehouseFk, vShipped); - + SELECT i.id itemFk, i.longName, i.subName, @@ -56563,7 +57395,7 @@ BEGIN (i.value8 <=> vValue8 COLLATE utf8_general_ci) match8, a.available, IFNULL(ip.counter,0) counter - FROM vn.item i + FROM vn.item i JOIN cache.available a ON a.item_id = i.id LEFT JOIN vn.itemProposal ip ON ip.mateFk = i.id AND ip.itemFk = vItemFk LEFT JOIN vn.itemTag it1 ON it1.itemFk = i.id AND it1.priority = 1 @@ -56577,7 +57409,7 @@ BEGIN (it1.value = vValue1 COLLATE utf8_general_ci) DESC, (i.tag5 = vTag5 COLLATE utf8_general_ci) DESC, (i.value5 = vValue5 COLLATE utf8_general_ci) DESC, - (i.tag6 = vTag6 COLLATE utf8_general_ci) DESC, + (i.tag6 = vTag6 COLLATE utf8_general_ci) DESC, (i.value6 = vValue6 COLLATE utf8_general_ci) DESC, (i.tag7 = vTag7 COLLATE utf8_general_ci) DESC, (i.value7 = vValue7 COLLATE utf8_general_ci) DESC, @@ -56591,8 +57423,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `itemRefreshTags` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -56600,6 +57430,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `itemRefreshTags`(IN vItem INT) BEGIN @@ -56613,7 +57445,7 @@ BEGIN CREATE TEMPORARY TABLE tmp.item SELECT vItem id; - + CALL item_refreshTags(); DROP TEMPORARY TABLE tmp.item; @@ -56624,8 +57456,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `itemSale_byWeek` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -56633,27 +57463,29 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `itemSale_byWeek`(vWeek INT, IN vYear INT, vItemFk INT, vWarehouseFk INT) BEGIN - + DECLARE vStarted DATE; DECLARE vEnded DATETIME; SELECT MIN(dated), util.dayEnd(MAX(dated)) INTO vStarted, vEnded - FROM `time` t + FROM `time` t WHERE CONCAT(vYear, LPAD(vWeek, 2, 0)) = t.period; SELECT t.shipped, w.name warehouse, - s.ticketFk, + s.ticketFk, c.quality, t.nickname client, - am.name agencyName, + am.name agencyName, wk.code salesPerson, s.itemFk, - IFNULL(CONCAT(ig.longName,' ',ig.`size`,' ',ig.subName), s.concept) AS concept, - s.quantity, + IFNULL(CONCAT(ig.longName,' ',ig.`size`,' ',ig.subName), s.concept) AS concept, + s.quantity, s.price, s.priceFixed, s.discount, @@ -56663,15 +57495,15 @@ BEGIN wk.id salesPersonFk FROM sale s JOIN ticket t ON t.id = s.ticketFk - JOIN warehouse w ON w.id = t.warehouseFk + JOIN warehouse w ON w.id = t.warehouseFk JOIN address a ON a.id = t.addressFk LEFT JOIN agencyMode am ON am.id = t.agencyModeFk JOIN `client` c ON c.id = a.clientFk - LEFT JOIN worker wk ON wk.id = c.salesPersonFk + LEFT JOIN worker wk ON wk.id = c.salesPersonFk LEFT JOIN ticketLastState tls ON tls.ticketFk = t.id - LEFT JOIN saleBuy sb ON sb.saleFk = s.id - LEFT JOIN buy b ON b.id = sb.buyFk - LEFT JOIN item ig ON ig.id = b.itemOriginalFk + LEFT JOIN saleBuy sb ON sb.saleFk = s.id + LEFT JOIN buy b ON b.id = sb.buyFk + LEFT JOIN item ig ON ig.id = b.itemOriginalFk WHERE s.itemFk = vItemFk AND t.shipped BETWEEN vStarted AND vEnded AND IF(vWarehouseFk = 0, w.hasComission , t.warehouseFk = vWarehouseFk) @@ -56683,8 +57515,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `itemSaveMin` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -56692,15 +57522,17 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `itemSaveMin`(min INT,vBarcode VARCHAR(22)) BEGIN DECLARE vItemFk INT; SELECT vn.barcodeToItem(vBarcode) INTO vItemFk; - + UPDATE vn.item SET minimum = min WHERE id = vItemFk; - + END ;; @@ -56709,8 +57541,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `itemSearchShelving` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -56718,12 +57548,14 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `itemSearchShelving`(`vShelvingFk` VARCHAR(3)) BEGIN SELECT p.`column` AS col , p.`row` - FROM vn.shelving s - JOIN parking p ON s.parkingFk = p.id + FROM vn.shelving s + JOIN parking p ON s.parkingFk = p.id WHERE s.`code` = vShelvingFk COLLATE utf8_general_ci; END ;; DELIMITER ; @@ -56731,8 +57563,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `itemShelvingDelete` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -56740,6 +57570,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `itemShelvingDelete`(vId INT) BEGIN @@ -56752,8 +57584,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `itemShelvingLog_get` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -56761,47 +57591,47 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `itemShelvingLog_get`(vShelvingFk VARCHAR(10) ) BEGIN - + /** * Devuelve el log de los item en cada carro * - * @param vShelvingFk Matrícula del carro - * + * @param vShelvingFk Matrícula del carro + * */ - - SELECT isl.itemShelvingFk, - isl.created, - isl.accion, - isl.itemFk, - isl.shelvingFk, - isl.quantity, + + SELECT isl.itemShelvingFk, + isl.created, + isl.accion, + isl.itemFk, + isl.shelvingFk, + isl.quantity, isl.visible, - isl.available, - isl.grouping, - isl.packing, - isl.stars, - item.longName, - item.size, - item.subName, - worker.code, + isl.available, + isl.grouping, + isl.packing, + isl.stars, + item.longName, + item.size, + item.subName, + worker.code, isl.accion - FROM item - JOIN itemShelvingLog isl ON item.id = isl.itemFk + FROM item + JOIN itemShelvingLog isl ON item.id = isl.itemFk JOIN worker ON isl.workerFk = worker.id WHERE shelvingFk = vShelvingFk OR isl.itemFk = vShelvingFk ORDER BY isl.created DESC; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `itemShelvingMakeFromDate` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -56809,10 +57639,12 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `itemShelvingMakeFromDate`(IN `vShelvingFk` VARCHAR(8), IN `vBarcode` VARCHAR(22), IN `vQuantity` INT, IN `vPackagingFk` VARCHAR(10), IN `vGrouping` INT, IN `vPacking` INT, IN `vWarehouseFk` INT, `vCreated` VARCHAR(22)) BEGIN - + DECLARE vItemFk INT; SELECT vn.barcodeToItem(vBarcode) INTO vItemFk; @@ -56831,9 +57663,9 @@ BEGIN END IF; - IF (SELECT COUNT(*) FROM vn.itemShelving - WHERE shelvingFk COLLATE utf8_unicode_ci = vShelvingFk - AND itemFk = vItemFk + IF (SELECT COUNT(*) FROM vn.itemShelving + WHERE shelvingFk COLLATE utf8_unicode_ci = vShelvingFk + AND itemFk = vItemFk AND packing = vPacking) = 1 THEN UPDATE vn.itemShelving @@ -56863,16 +57695,14 @@ BEGIN LEFT JOIN cache.last_buy lb ON i.id = lb.item_id AND lb.warehouse_id = vWarehouseFk LEFT JOIN vn.buy b ON b.id = lb.buy_id WHERE i.id = vItemFk; - END IF; - + END IF; + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `itemShelvingMatch` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -56880,14 +57710,16 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `itemShelvingMatch`(vEntryFk INT, vAllTravel BOOLEAN, vFromTimed DATETIME, vToTimed DATETIME) BEGIN DECLARE vTravelFk INT; - - SELECT travelFk INTO vTravelFk - FROM entry + + SELECT travelFk INTO vTravelFk + FROM entry WHERE id = vEntryFk; SELECT i.id, i.longName, i.size, i.subName, b.stickers, ish.etiquetas, b.printed @@ -56900,7 +57732,7 @@ BEGIN GROUP BY itemFk ) b ON b.itemFk = i.id LEFT JOIN ( - SELECT itemFk, sum(cast(visible / packing AS DECIMAL(10,0))) AS etiquetas + SELECT itemFk, sum(cast(visible / packing AS DECIMAL(10,0))) AS etiquetas FROM itemShelving ish JOIN shelving sh ON sh.code = ish.shelvingFk LEFT JOIN parking pk ON pk.id = sh.parkingFk @@ -56915,8 +57747,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `itemShelvingPlacementSupplyAdd` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -56924,6 +57754,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `itemShelvingPlacementSupplyAdd`(vItemShelvingFk INT, vItemPlacementSupplyFk INT, vQuantity INT) BEGIN @@ -56940,7 +57772,7 @@ BEGIN UPDATE vn.itemShelving SET visible = visible - vQuantity WHERE id = vItemShelvingFk; - + END ;; DELIMITER ; @@ -56948,8 +57780,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `itemShelvingProblem` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -56957,61 +57787,61 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `itemShelvingProblem`(vSectorFk INT) BEGIN DECLARE vVisibleCache INT; DECLARE vWarehouseFk INT; - + SELECT warehouseFk INTO vWarehouseFk FROM vn.sector WHERE id = vSectorFk; CALL cache.visible_refresh (vVisibleCache, FALSE, vWarehouseFk); - - SELECT t.id as ticketFk, - CAST(s.quantity AS DECIMAL(10,0)) as Cantidad, - s.itemFk, - s.concept, - v.visible - GREATEST(0,iss.visible) + IFNULL(sub3.transit,0) as Nicho, + + SELECT t.id as ticketFk, + CAST(s.quantity AS DECIMAL(10,0)) as Cantidad, + s.itemFk, + s.concept, + v.visible - GREATEST(0,iss.visible) + IFNULL(sub3.transit,0) as Nicho, i.subName, - GREATEST(0,iss.visible - IFNULL(sub3.transit,0)) as Altillo, + GREATEST(0,iss.visible - IFNULL(sub3.transit,0)) as Altillo, s.id as saleFk, IFNULL(sub3.transit,0) transit, v.visible, s.isPicked, s.reserved, t.shipped, tst.productionOrder, mm.Id_Movimiento - FROM vn.ticket t + FROM vn.ticket t JOIN vn.ticketState tst ON tst.ticketFk = t.id JOIN vn.sale s ON s.ticketFk = t.id JOIN vn.item i ON i.id = s.itemFk JOIN cache.visible v ON s.itemFk = v.item_id AND v.calc_id = vVisibleCache LEFT JOIN vn2008.Movimientos_mark mm ON mm.Id_Movimiento = s.id AND mm.stateFk = 26 - JOIN vn.itemShelvingStock iss ON iss.itemFk = v.item_id + JOIN vn.itemShelvingStock iss ON iss.itemFk = v.item_id LEFT JOIN - (SELECT itemFk, sum(saldo) as transit - FROM vn.itemPlacementSupplyList - WHERE saldo > 0 + (SELECT itemFk, sum(saldo) as transit + FROM vn.itemPlacementSupplyList + WHERE saldo > 0 AND sectorFk = vSectorFk GROUP BY itemFk) sub3 ON sub3.itemFk = i.id - WHERE v.visible + IFNULL(sub3.transit,0) - GREATEST(0,iss.visible) < s.quantity + WHERE v.visible + IFNULL(sub3.transit,0) - GREATEST(0,iss.visible) < s.quantity AND IFNULL(sub3.transit,0) < s.quantity - AND s.isPicked = FALSE + AND s.isPicked = FALSE AND s.reserved = FALSE - AND t.shipped BETWEEN util.VN_CURDATE() AND MIDNIGHT(util.VN_CURDATE()) + AND t.shipped BETWEEN util.VN_CURDATE() AND MIDNIGHT(util.VN_CURDATE()) AND tst.isPreviousPreparable = TRUE AND t.warehouseFk = vWarehouseFk AND iss.sectorFk = vSectorFk AND mm.Id_Movimiento IS NULL ORDER BY itemFk; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `itemShelvingRadar` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -57019,10 +57849,12 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `itemShelvingRadar`(vSectorFk INT) proc:BEGIN - + DECLARE vCalcVisibleFk INT; DECLARE vCalcAvailableFk INT; DECLARE hasFatherSector BOOLEAN; @@ -57030,25 +57862,25 @@ proc:BEGIN DECLARE vWarehouseFk INT DEFAULT 0; DECLARE vSonSectorFk INT; DECLARE vWorkerFk INT; - - SELECT s.workerFk - INTO vWorkerFk + + SELECT s.workerFk + INTO vWorkerFk FROM vn.sector s WHERE s.id = vSectorFk; - + IF IFNULL(vWorkerFk,0) THEN - + CALL vn.itemShelvingRadar_Urgent(vWorkerFk); LEAVE proc; - + end if; - - + + SELECT w.id, s.warehouseFk INTO vBuyerFk, vWarehouseFk - FROM vn.worker w + FROM vn.worker w JOIN vn.sector s ON s.code = w.code WHERE s.id = vSectorFk; - + SELECT s.id INTO vSectorFk FROM vn.sector s WHERE s.warehouseFk = vWarehouseFk @@ -57058,21 +57890,21 @@ proc:BEGIN SELECT COUNT(*) INTO hasFatherSector FROM vn.sector WHERE sonFk = vSectorFk; - + SELECT warehouseFk, sonFk INTO vWarehouseFk, vSonSectorFk FROM vn.sector WHERE id = vSectorFk; - + CALL cache.visible_refresh(vCalcVisibleFk, TRUE, vWarehouseFk); CALL cache.available_refresh(vCalcAvailableFk, FALSE, vWarehouseFk, util.VN_CURDATE()); - + DROP TEMPORARY TABLE IF EXISTS tmp.itemShelvingRadar; - + IF hasFatherSector THEN - + CREATE TEMPORARY TABLE tmp.itemShelvingRadar (PRIMARY KEY (itemFk)) - ENGINE = MEMORY + ENGINE = MEMORY SELECT * FROM ( SELECT iss.itemFk, i.longName, @@ -57083,7 +57915,7 @@ proc:BEGIN SUM(IF(iss.sectorFk = vSectorFk, IFNULL(iss.visible,0), 0)) downstairs, IF(it.isPackaging, null, IFNULL(v.visible,0)) as visible, vSectorFk as sectorFk - + FROM vn.itemShelvingStock iss JOIN vn.sector s ON s.id = iss.sectorFk JOIN vn.item i on i.id = iss.itemFk @@ -57092,11 +57924,11 @@ proc:BEGIN LEFT JOIN cache.visible v ON v.item_id = iss.itemFk AND v.calc_id = vCalcVisibleFk WHERE vSectorFk IN (iss.sectorFk, s.sonFk) AND it.workerFk != 3366 - + GROUP BY iss.itemFk - + UNION ALL - + SELECT v.item_id, i.longName, i.size, @@ -57106,7 +57938,7 @@ proc:BEGIN 0 downstairs, IF(it.isPackaging, NULL, v.visible) visible, vSectorFk as sectorFk - FROM cache.visible v + FROM cache.visible v JOIN vn.item i on i.id = v.item_id JOIN vn.itemType it ON it.id = i.typeFk AND vBuyerFk IN (0,it.workerFk) LEFT JOIN vn.itemShelvingStock iss ON iss.itemFk = v.item_id AND iss.warehouseFk = vWarehouseFk @@ -57115,8 +57947,8 @@ proc:BEGIN AND iss.itemFk IS NULL AND it.isInventory ) sub GROUP BY itemFk; - - SELECT ishr.*, + + SELECT ishr.*, CAST(visible - upstairs - downstairs AS DECIMAL(10,0)) AS nicho, CAST(downstairs - IFNULL(notPickedYed,0) AS DECIMAL(10,0)) as pendiente FROM tmp.itemShelvingRadar ishr @@ -57131,13 +57963,13 @@ proc:BEGIN ) sub ON sub.itemFk = ishr.itemFk ORDER BY i.typeFk, i.longName ; - - + + ELSE - + CREATE TEMPORARY TABLE tmp.itemShelvingRadar (PRIMARY KEY (itemFk)) - ENGINE = MEMORY + ENGINE = MEMORY SELECT iss.itemFk, 0 `hour`, 0 `minute`, @@ -57149,7 +57981,7 @@ proc:BEGIN IFNULL(a.available,0) available, IFNULL(v.visible - iss.visible,0) dayEndVisible, IFNULL(v.visible - iss.visible,0) firstNegative, - IFNULL(v.visible - iss.visible,0) itemPlacementVisible, + IFNULL(v.visible - iss.visible,0) itemPlacementVisible, IFNULL(i.minimum * b.packing,0) itemPlacementSize, ips.onTheWay, iss.visible itemShelvingStock, @@ -57163,13 +57995,13 @@ proc:BEGIN LEFT JOIN cache.available a ON a.item_id = iss.itemFk AND a.calc_id = vCalcAvailableFk LEFT JOIN cache.visible v ON v.item_id = iss.itemFk AND v.calc_id = vCalcVisibleFk LEFT JOIN (SELECT itemFk, sum(saldo) as onTheWay - FROM vn.itemPlacementSupplyList - WHERE saldo > 0 + FROM vn.itemPlacementSupplyList + WHERE saldo > 0 GROUP BY itemFk ) ips ON ips.itemFk = i.id - WHERE IFNULL(iss.sectorFk,0) IN (0, vSectorFk) - OR iss.sectorFk = vSectorFk; - /* + WHERE IFNULL(iss.sectorFk,0) IN (0, vSectorFk) + OR iss.sectorFk = vSectorFk; + /* UPDATE tmp.itemShelvingRadar isr JOIN vn.itemShelvingStock iss ON iss.itemFk = isr.itemFk SET isr.dayEndVisible = isr.dayEndVisible + iss.visible, @@ -57180,10 +58012,10 @@ proc:BEGIN DROP TEMPORARY TABLE IF EXISTS tmp.itemOutTime; CREATE TEMPORARY TABLE tmp.itemOutTime SELECT *,SUM(amount) quantity - FROM + FROM (SELECT item_id itemFk, - amount, - IF(HOUR(t.shipped), HOUR(t.shipped), HOUR(z.`hour`)) as hours, + amount, + IF(HOUR(t.shipped), HOUR(t.shipped), HOUR(z.`hour`)) as hours, IF(MINUTE(t.shipped), MINUTE(t.shipped), MINUTE(z.`hour`)) as minutes FROM vn2008.item_out io JOIN tmp.itemShelvingRadar isr ON isr.itemFk = io.item_id @@ -57191,23 +58023,23 @@ proc:BEGIN JOIN vn.ticketState ts on ts.ticketFk = io.ticketFk JOIN vn.state s ON s.id = ts.stateFk LEFT JOIN vn.zone z ON z.id = t.zoneFk - LEFT JOIN (SELECT DISTINCT saleFk - FROM vn.saleTracking st - WHERE st.created > util.VN_CURDATE() + LEFT JOIN (SELECT DISTINCT saleFk + FROM vn.saleTracking st + WHERE st.created > util.VN_CURDATE() AND st.isChecked ) stPrevious ON `stPrevious`.`saleFk` = io.saleFk WHERE t.warehouseFk = vWarehouseFk - AND s.isPicked = 0 - AND NOT io.Reservado + AND s.isPicked = 0 + AND NOT io.Reservado AND stPrevious.saleFk IS NULL - AND io.dat >= util.VN_CURDATE() + AND io.dat >= util.VN_CURDATE() AND io.dat < util.VN_CURDATE()+1 ) sub GROUP BY itemFk, hours, minutes; - + INSERT INTO tmp.itemShelvingRadar (itemFk) SELECT itemFk FROM tmp.itemOutTime - ON DUPLICATE KEY UPDATE dayEndVisible = dayEndVisible + quantity, + ON DUPLICATE KEY UPDATE dayEndVisible = dayEndVisible + quantity, firstNegative = if (firstNegative < 0, firstNegative, firstNegative + quantity), `hour` = ifnull(if (firstNegative > 0 , `hour`, hours),0), `minute` = ifnull(if (firstNegative > 0, `minute`, minutes),0); @@ -57217,21 +58049,19 @@ proc:BEGIN dayEndVisible = 0, firstNegative = 0 WHERE itemPlacementVisible = - itemShelvingStock; - */ + */ SELECT * FROM tmp.itemShelvingRadar; END IF; DROP TEMPORARY TABLE tmp.itemShelvingRadar; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `itemShelvingRadar_Entry` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -57239,6 +58069,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `itemShelvingRadar_Entry`(vEntryFk INT) BEGIN @@ -57247,24 +58079,24 @@ BEGIN DECLARE vCalcVisibleFk INT; DECLARE vCalcAvailableFk INT; DECLARE vTodayDayEnd DATETIME DEFAULT util.dayEnd(util.VN_CURDATE()); - + CALL cache.visible_refresh(vCalcVisibleFk, FALSE, 1); CALL cache.available_refresh(vCalcAvailableFk, FALSE, vWarehouseFk, util.VN_CURDATE()); - + DROP TEMPORARY TABLE IF EXISTS tmp.item; CREATE TEMPORARY TABLE tmp.item ENGINE = MEMORY SELECT DISTINCT itemFk - FROM vn.buy + FROM vn.buy WHERE entryFk = vEntryFk; - + DROP TEMPORARY TABLE IF EXISTS tmp.item2; CREATE TEMPORARY TABLE tmp.item2 ENGINE = MEMORY SELECT * FROM tmp.item; - - SELECT i.id as itemFk, + + SELECT i.id as itemFk, i.minimum, CAST(IFNULL(v.visible,0) - IFNULL(iss.visible,0) AS DECIMAL(10,0)) as enNicho, CAST(IFNULL(a.available,0) AS DECIMAL(10,0)) as disponible, @@ -57284,19 +58116,17 @@ BEGIN AND IFNULL(tst.productionOrder,0) < 5 GROUP BY s.itemFK ) ts ON ts.itemFk = i.id; - - + + DROP TEMPORARY TABLE tmp.item; DROP TEMPORARY TABLE tmp.item2; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `itemShelvingRadar_Entry_State_beta` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -57304,6 +58134,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `itemShelvingRadar_Entry_State_beta`(vEntryFk INT) BEGIN @@ -57312,42 +58144,40 @@ BEGIN DECLARE vCalcVisibleFk INT; DECLARE vCalcAvailableFk INT; DECLARE vTodayDayEnd DATETIME DEFAULT util.dayEnd(util.VN_CURDATE()); - + CALL cache.visible_refresh(vCalcVisibleFk, FALSE, 1); CALL cache.available_refresh(vCalcAvailableFk, FALSE, vWarehouseFk, util.VN_CURDATE()); - + DROP TEMPORARY TABLE IF EXISTS tmp.item; CREATE TEMPORARY TABLE tmp.item ENGINE = MEMORY SELECT DISTINCT itemFk - FROM vn.buy + FROM vn.buy WHERE entryFk = vEntryFk; - + DROP TEMPORARY TABLE IF EXISTS tmp.item2; CREATE TEMPORARY TABLE tmp.item2 ENGINE = MEMORY SELECT * FROM tmp.item; - - SELECT i.id as itemFk, + + SELECT i.id as itemFk, CAST(IFNULL(iss.visible,0) - IFNULL(v.visible,0) AS DECIMAL(10,0)) as outShelving FROM vn.item i JOIN tmp.item ti ON ti.itemFk = i.id LEFT JOIN cache.visible v ON v.calc_id = vCalcVisibleFk AND v.item_id = i.id LEFT JOIN vn.itemShelvingStock iss ON iss.itemFk = i.id; - - + + DROP TEMPORARY TABLE tmp.item; DROP TEMPORARY TABLE tmp.item2; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `itemShelvingRadar_Urgent` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -57355,6 +58185,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `itemShelvingRadar_Urgent`() BEGIN @@ -57366,7 +58198,7 @@ BEGIN CALL cache.visible_refresh(vCalcVisibleFk, TRUE, vWarehouseFk); - SELECT * FROM + SELECT * FROM (SELECT sub.itemFk, sub.longName, CONCAT(DATE_FORMAT(sub2.etd,'%H:%i'), ' salen ', CAST(sub2.pendiente AS DECIMAL(10,0)), ' unidades.') `size`, @@ -57384,14 +58216,14 @@ BEGIN 0 upstairs, SUM(IFNULL(iss.visible,0)) downstairs, IF(it.isPackaging, null, IFNULL(v.visible,0)) visible, - IFNULL(iss.sectorFk,0) sectorFk + IFNULL(iss.sectorFk,0) sectorFk FROM itemShelvingStock iss JOIN sector s ON s.id = iss.sectorFk JOIN item i on i.id = iss.itemFk JOIN itemType it ON it.id = i.typeFk LEFT JOIN cache.visible v ON v.item_id = iss.itemFk AND v.calc_id = @vCalcVisibleFk WHERE s.warehouseFk = vWarehouseFk - GROUP BY itemFk + GROUP BY itemFk ) sub LEFT JOIN (SELECT s.itemFk, SUM(s.quantity) pendiente, MIN(zc.`hour`) etd FROM sale s LEFT JOIN saleTracking st ON st.saleFk = s.id @@ -57403,8 +58235,8 @@ BEGIN AND ISNULL(st.saleFk) AND ct.code IN ('normal', 'trust') GROUP BY s.itemFk - ) sub2 ON sub2.itemFk = sub.itemFk - UNION ALL + ) sub2 ON sub2.itemFk = sub.itemFk + UNION ALL SELECT v.item_id , i.longName, CONCAT(DATE_FORMAT(sub5.etd,'%H:%i'), ' salen ', CAST(sub5.pendiente AS DECIMAL(10,0)), ' unidades.') `size`, @@ -57418,7 +58250,7 @@ BEGIN FROM cache.visible v JOIN item i ON i.id = v.item_id JOIN itemType it ON it.id = i.typeFk - LEFT JOIN itemShelvingStock iss ON iss.itemFk = v.item_id + LEFT JOIN itemShelvingStock iss ON iss.itemFk = v.item_id LEFT JOIN (SELECT s.itemFk , SUM(s.quantity) pendiente, MIN(zc.`hour`) etd FROM sale s LEFT JOIN saleTracking st ON st.saleFk = s.id @@ -57432,7 +58264,7 @@ BEGIN GROUP BY s.itemFk ) sub5 ON sub5.itemFk = v.item_id WHERE v.calc_id = @vCalcVisibleFk - AND ISNULL(iss.itemFk) + AND ISNULL(iss.itemFk) ) sub3 WHERE nicho ORDER BY LEFT(producer,3), etd, producer; @@ -57442,8 +58274,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `itemShelvingSale_Add` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -57451,15 +58281,17 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `itemShelvingSale_Add`(vItemShelvingFk INT, vSaleFk INT, vQuantity INT) BEGIN /** * Añade línea a itemShelvingSale y regulariza el carro - * + * * @param vItemShelvingFk Id itemShelving * @param vSaleFk Id de sale - * @param vQuantity cantidad a regularizar + * @param vQuantity cantidad a regularizar */ INSERT INTO itemShelvingSale(itemShelvingFk, saleFk, @@ -57484,8 +58316,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `itemShelvingTransfer` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -57493,6 +58323,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `itemShelvingTransfer`(vItemShelvingFk INT, vShelvingFk VARCHAR(3)) BEGIN @@ -57542,8 +58374,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `itemShelving_add` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -57551,10 +58381,12 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `itemShelving_add`(IN vShelvingFk VARCHAR(8), IN vBarcode VARCHAR(22), IN vQuantity INT, IN vPackagingFk VARCHAR(10), IN vGrouping INT, IN vPacking INT, IN vWarehouseFk INT) BEGIN - + /** * Añade registro o lo actualiza si ya existe. @@ -57566,7 +58398,7 @@ BEGIN * @param vGrouping el grouping del producto en itemShelving, NULL para coger el de la ultima compra * @param vPacking el packing del producto, NULL para coger el de la ultima compra * @param vWarehouseFk indica el sector - * + * **/ DECLARE vItemFk INT; @@ -57576,21 +58408,21 @@ BEGIN IF (SELECT COUNT(*) FROM shelving WHERE code = vShelvingFk COLLATE utf8_unicode_ci) = 0 THEN INSERT IGNORE INTO parking(code) VALUES(vShelvingFk); - INSERT INTO shelving(code, parkingFk) + INSERT INTO shelving(code, parkingFk) SELECT vShelvingFk, id - FROM parking + FROM parking WHERE `code` = vShelvingFk COLLATE utf8_unicode_ci; END IF; - IF (SELECT COUNT(*) FROM itemShelving - WHERE shelvingFk COLLATE utf8_unicode_ci = vShelvingFk - AND itemFk = vItemFk + IF (SELECT COUNT(*) FROM itemShelving + WHERE shelvingFk COLLATE utf8_unicode_ci = vShelvingFk + AND itemFk = vItemFk AND packing = vPacking) = 1 THEN UPDATE itemShelving SET visible = visible+vQuantity - WHERE shelvingFk COLLATE utf8_unicode_ci = vShelvingFk AND itemFk = vItemFk AND packing = vPacking; + WHERE shelvingFk COLLATE utf8_unicode_ci = vShelvingFk AND itemFk = vItemFk AND packing = vPacking; ELSE CALL cache.last_buy_refresh(FALSE); @@ -57618,8 +58450,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `itemShelving_addByClaim` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -57627,6 +58457,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `itemShelving_addByClaim`(vClaimFk INT, vShelvingFk VARCHAR(3)) BEGIN @@ -57661,8 +58493,66 @@ 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 PROCEDURE IF EXISTS `itemShelving_addList` */; +/*!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 = utf8mb4 */ ; +/*!50003 SET character_set_results = utf8mb4 */ ; +/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; +DELIMITER ;; +CREATE DEFINER=`root`@`localhost` PROCEDURE `itemShelving_addList`(vShelvingFk VARCHAR(3), vList TEXT, vIsChecking BOOL, vWarehouseFk INT) +BEGIN +/* Recorre cada elemento en la colección vList. + * Si el parámetro isChecking = FALSE, llama a itemShelving_add. + * + * Cuando es TRUE sólo inserta los elementos de la colección que no están ya en + * ese shelving, actualizando los valores del campo vn.itemShelving.isChecked + * + * param vShelvingFk Identificador de vn.shelving + * param vList JSON array con esta estructura: '[value1, value2, ...]' + * param vIsChecking Define si hay que añadir o comprobar los items + * param vWarehouseFk Identificador de vn.warehouse + */ + DECLARE vListLength INT DEFAULT JSON_LENGTH(vList); + DECLARE vCounter INT DEFAULT 0; + DECLARE vBarcode VARCHAR(22); + DECLARE vPath VARCHAR(6); + DECLARE vItemFk INT; + DECLARE vIsChecked BOOL; + + WHILE vCounter < vListLength DO + SET vPath = CONCAT('$[',vCounter,']'); + SET vBarcode = JSON_EXTRACT(vList,vPath); + SET vIsChecked = NULL; + IF vIsChecking THEN + SELECT barcodeToItem(vBarcode) INTO vItemFk; + + SELECT COUNT(*) INTO vIsChecked + FROM vn.itemShelving + WHERE shelvingFk COLLATE utf8_unicode_ci = vShelvingFk + AND itemFk = vItemFk; + END IF; + + IF NOT (vIsChecking AND vIsChecked) THEN + CALL vn.itemShelving_add(vShelvingFk, vBarcode, 1, NULL, NULL, NULL, vWarehouseFk); + END IF; + + UPDATE vn.itemShelving + SET isChecked = vIsChecked + WHERE shelvingFk COLLATE utf8_unicode_ci = vShelvingFk + AND itemFk = vItemFk; + + SET vCounter = vCounter + 1; + END WHILE; +END ;; +DELIMITER ; +/*!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 PROCEDURE IF EXISTS `itemShelving_BuyerGet` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -57670,20 +58560,20 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `itemShelving_BuyerGet`( ) BEGIN SELECT * FROM vn.buyer; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `itemShelving_filterBuyer` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -57691,6 +58581,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `itemShelving_filterBuyer`(vBuyerFk INT, vWarehouseFk INT) proc:BEGIN @@ -57702,15 +58594,15 @@ proc:BEGIN * @return Lista de articulos */ DECLARE vCalcVisibleFk INT; - + IF vBuyerFk = 103 THEN -- hay que arreglarlo despues de la campaña PAK 23/04/2022 - CALL vn.itemShelvingRadar_Urgent(); + CALL vn.itemShelvingRadar_Urgent(); LEAVE proc; END IF; CALL cache.visible_refresh(vCalcVisibleFk, TRUE, vWarehouseFk); - SELECT * FROM + SELECT * FROM (SELECT sub.itemFk, sub.longName, CONCAT('Hoy saldrán ', CAST(sub2.pendiente AS DECIMAL(10,0)), ' unidades.') `size`, @@ -57727,7 +58619,7 @@ proc:BEGIN 0 upstairs, SUM(IFNULL(iss.visible,0)) downstairs, IF(it.isPackaging, null, IFNULL(v.visible,0)) visible, - IFNULL(iss.sectorFk,0) sectorFk + IFNULL(iss.sectorFk,0) sectorFk FROM itemShelvingStock iss JOIN sector s ON s.id = iss.sectorFk JOIN item i on i.id = iss.itemFk @@ -57735,19 +58627,19 @@ proc:BEGIN LEFT JOIN cache.visible v ON v.item_id = iss.itemFk AND v.calc_id = vCalcVisibleFk WHERE s.warehouseFk = vWarehouseFk AND it.workerFk = vBuyerFk - GROUP BY itemFk + GROUP BY itemFk ) sub LEFT JOIN (SELECT s.itemFk, SUM(s.quantity) pendiente FROM sale s LEFT JOIN saleTracking st ON st.saleFk = s.id - JOIN ticket t ON t.id = s.ticketFk + JOIN ticket t ON t.id = s.ticketFk JOIN client c on c.id = t.clientFk JOIN clientType ct ON ct.id = c.clientTypeFk WHERE t.shipped BETWEEN util.VN_CURDATE() AND util.dayend(util.VN_CURDATE()) AND ISNULL(st.saleFk) AND ct.code IN ('normal', 'trust') GROUP BY s.itemFk - ) sub2 ON sub2.itemFk = sub.itemFk - UNION ALL + ) sub2 ON sub2.itemFk = sub.itemFk + UNION ALL SELECT v.item_id , i.longName, CONCAT('Hoy saldrán ', CAST(sub5.pendiente AS DECIMAL(10,0)), ' unidades.') `size`, @@ -57760,11 +58652,11 @@ proc:BEGIN FROM cache.visible v JOIN item i ON i.id = v.item_id JOIN itemType it ON it.id = i.typeFk - LEFT JOIN itemShelvingStock iss ON iss.itemFk = v.item_id + LEFT JOIN itemShelvingStock iss ON iss.itemFk = v.item_id LEFT JOIN (SELECT s.itemFk , SUM(s.quantity) pendiente FROM sale s LEFT JOIN saleTracking st ON st.saleFk = s.id - JOIN ticket t ON t.id = s.ticketFk + JOIN ticket t ON t.id = s.ticketFk JOIN client c on c.id = t.clientFk JOIN clientType ct ON ct.id = c.clientTypeFk WHERE t.shipped BETWEEN util.VN_CURDATE() AND util.dayend(util.VN_CURDATE()) @@ -57773,7 +58665,7 @@ proc:BEGIN GROUP BY s.itemFk ) sub5 ON sub5.itemFk = v.item_id WHERE v.calc_id = vCalcVisibleFk - AND ISNULL(iss.itemFk) + AND ISNULL(iss.itemFk) AND it.workerFk = vBuyerFk ) sub3 WHERE nicho @@ -57784,8 +58676,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `itemShelving_get` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -57793,41 +58683,39 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; -CREATE DEFINER=`root`@`localhost` PROCEDURE `itemShelving_get`(IN vShelvingFk VARCHAR(8)) +CREATE DEFINER=`root`@`localhost` PROCEDURE `itemShelving_get`(IN vSelf VARCHAR(8)) BEGIN /** - * Lista artículos de itemshelving - * - * @param vShelvingFk matrícula del carro - * - **/ - - SELECT ish.itemFk as item, - IFNULL(i.longName, CONCAT(i.name, ' ', i.size)) as description, - ish.visible as visible, - ceil(ish.visible/ish.packing) as stickers, - ish.packing as packing, - ish.grouping, - IF (p.column IS NULL, "", p.column) as col, - IF (p.row IS NULL, "", p.row) as row, - IF (p.code IS NULL, "", p.code) as code, - ish.id, - s.priority +* Lista artículos de itemshelving +* +* @param vSelf matrícula del carro +**/ + SELECT ish.itemFk item, + IFNULL(i.longName, CONCAT(i.name, ' ', i.size)) description, + ish.visible, + CEIL(ish.visible/ish.packing) stickers, + ish.packing, + ish.grouping, + IF (p.column IS NULL, '', p.column) col, + IF (p.row IS NULL, '', p.row) row, + IF (p.code IS NULL, '', p.code) code, + ish.id, + s.priority, + ish.isChecked FROM itemShelving ish JOIN item i ON i.id = ish.itemFk - INNER JOIN shelving s ON vShelvingFk = s.code COLLATE utf8_unicode_ci - LEFT JOIN parking p ON s.parkingFk = p.id - WHERE ish.shelvingFk COLLATE utf8_unicode_ci = vShelvingFk; - + JOIN shelving s ON vSelf = s.code COLLATE utf8_unicode_ci + LEFT JOIN parking p ON s.parkingFk = p.id + WHERE ish.shelvingFk COLLATE utf8_unicode_ci = vSelf; END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `itemShelving_getAlternatives` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -57835,6 +58723,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `itemShelving_getAlternatives`(vShelvingFk VARCHAR(10)) BEGIN @@ -57844,7 +58734,7 @@ BEGIN * * @param vShelvingFk matricula del carro */ - SELECT is2.id,is2.shelvingFk , p.code, is2.itemFk , is2.visible, p.pickingOrder + SELECT is2.id,is2.shelvingFk , p.code, is2.itemFk , is2.visible, p.pickingOrder FROM itemShelving is2 JOIN shelving sh ON sh.code = is2.shelvingFk JOIN parking p ON p.id = sh.parkingFk @@ -57861,8 +58751,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `itemShelving_getInfo` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -57870,6 +58758,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `itemShelving_getInfo`(vItemFk VARCHAR(22)) BEGIN @@ -57898,8 +58788,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `itemShelving_getSaleDate` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -57907,38 +58795,40 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `itemShelving_getSaleDate`(vShelvingFk VARCHAR(3)) BEGIN - + /* Devuelve la minima fecha en que se necesita cada producto en esa matricula. - * + * * @param vShelvingFk Matrícula del carro o pallet */ - + DECLARE vWarehouseFk INT; SELECT warehouseFk INTO vWarehouseFk FROM shelving s - JOIN parking p ON s.parkingFk = p.id + JOIN parking p ON s.parkingFk = p.id JOIN sector st ON st.id = p.sectorFk WHERE s.code = vShelvingFk COLLATE utf8_unicode_ci; - + DROP TEMPORARY TABLE IF EXISTS tmp.itemShelvingDistinct; CREATE TEMPORARY TABLE tmp.itemShelvingDistinct (PRIMARY KEY (itemFk)) ENGINE = MEMORY SELECT itemFk, SUM(visible) visible - FROM vn.itemShelving + FROM vn.itemShelving WHERE shelvingFk = vShelvingFk COLLATE utf8_unicode_ci - GROUP BY itemFk; - + GROUP BY itemFk; + DROP TEMPORARY TABLE IF EXISTS tmp.item; CREATE TEMPORARY TABLE tmp.item (PRIMARY KEY (itemFk)) ENGINE = MEMORY SELECT * FROM tmp.itemShelvingDistinct; - + DROP TEMPORARY TABLE IF EXISTS tmp.stockByDay; CREATE TEMPORARY TABLE tmp.stockByDay (index (itemFk, dated)) @@ -57949,16 +58839,16 @@ BEGIN FROM ( SELECT * FROM ( SELECT t2.* FROM ( - SELECT item_id itemFk, amount, util.VN_CURDATE() dated - FROM cache.stock + SELECT item_id itemFk, amount, util.VN_CURDATE() dated + FROM cache.stock WHERE warehouse_id = vWarehouseFk UNION ALL SELECT ish.itemFk, - sum(visible), util.VN_CURDATE() - FROM vn.itemShelving ish - JOIN shelving sh ON sh.code = ish.shelvingFk - JOIN parking p ON sh.parkingFk = p.id + FROM vn.itemShelving ish + JOIN shelving sh ON sh.code = ish.shelvingFk + JOIN parking p ON sh.parkingFk = p.id JOIN sector s ON s.id = p.sectorFk - WHERE s.isReserve + WHERE s.isReserve GROUP BY ish.itemFk UNION ALL SELECT item_id, sum(iei.amount), dat @@ -57967,9 +58857,9 @@ BEGIN AND warehouse_id = vWarehouseFk AND isVirtualStock = FALSE GROUP BY item_id, dat - UNION ALL + UNION ALL SELECT item_id, sum(ieo.amount), dat - FROM vn2008.item_entry_out ieo + FROM vn2008.item_entry_out ieo WHERE dat >= util.VN_CURDATE() AND warehouse_id = vWarehouseFk GROUP BY item_id, dat @@ -57980,11 +58870,11 @@ BEGIN WHERE io.dat >= util.VN_CURDATE() AND io.warehouse_id = vWarehouseFk GROUP BY io.item_id, io.dat - ) t2 + ) t2 JOIN tmp.itemShelvingDistinct ish ON ish.itemFk = t2.itemFk) t order by t.itemFk, DATE(t.dated), t.amount DESC) t3; - - SELECT sbd.itemFk, i.longName, DATE(dated) dated, ish.visible amount, sbd.stock + + SELECT sbd.itemFk, i.longName, DATE(dated) dated, ish.visible amount, sbd.stock FROM tmp.stockByDay sbd JOIN vn.item i ON i.id = sbd.itemFk JOIN tmp.itemShelvingDistinct ish ON ish.itemFk = sbd.itemFk @@ -58001,8 +58891,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `itemShelving_inventory` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -58010,17 +58898,19 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `itemShelving_inventory`(vParkingFromFk INT, vParkingToFk INT) BEGIN - + /** * Devuelve un listado de ubicaciones a revisar - * + * * @param vParkingFromFk Parking de partida, identificador de vn.parking * @param vParkingToFk Parking de llegada, identificador de vn.parking */ - + DECLARE vSectorFk INT; DECLARE vPickingOrderFrom INT; DECLARE vPickingOrderTo INT; @@ -58028,38 +58918,36 @@ BEGIN SELECT p.sectorFk, p.pickingOrder INTO vSectorFk, vPickingOrderFrom FROM vn.parking p WHERE p.id = vParkingFromFk; - + SELECT p.pickingOrder INTO vPickingOrderTo FROM vn.parking p WHERE p.id = vParkingToFk; - + CALL vn.visible_getMisfit(vSectorFk); - SELECT p.code parking , - ish.shelvingFk , - ish.itemFk, + SELECT p.code parking , + ish.shelvingFk , + ish.itemFk, i.longName, - ish.visible , + ish.visible , ish.visible / ish.packing packs, - ish.packing, + ish.packing, sm.visible - sm.parked faltan - FROM vn.itemShelving ish - JOIN vn.item i ON i.id = ish.itemFk - JOIN tmp.stockMisfit sm ON sm.itemFk = ish.itemFk - JOIN vn.shelving sh ON sh.code = ish.shelvingFk - JOIN vn.parking p ON p.id = sh.parkingFk + FROM vn.itemShelving ish + JOIN vn.item i ON i.id = ish.itemFk + JOIN tmp.stockMisfit sm ON sm.itemFk = ish.itemFk + JOIN vn.shelving sh ON sh.code = ish.shelvingFk + JOIN vn.parking p ON p.id = sh.parkingFk WHERE p.pickingOrder BETWEEN vPickingOrderFrom AND vPickingOrderTo AND p.sectorFk = vSectorFk ORDER BY p.pickingOrder ; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `itemShelving_update` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -58067,6 +58955,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `itemShelving_update`(vVisible INT, vPacking INT, vShelf INT ,vGrouping INT ) BEGIN @@ -58079,9 +58969,9 @@ BEGIN * @param vGrouping el grouping del producto en itemShelving */ UPDATE itemShelving - SET visible = vVisible, - packing = vPacking, - grouping = vGrouping + SET visible = vVisible, + packing = vPacking, + grouping = vGrouping WHERE id = vShelf; END ;; @@ -58090,8 +58980,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `itemStock` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -58099,6 +58987,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `itemStock`(vWarehouseFk SMALLINT, vDated DATETIME, vItemFk INT) BEGIN @@ -58108,34 +58998,34 @@ BEGIN * @param vDated max date to filter * @param vItemFk item id **/ - + DECLARE vIsLogifloraDay BOOLEAN; SET vDated = TIMESTAMP(DATE(vDated), '00:00:00'); SELECT vn.isLogifloraDay(vDated, vWarehouseFk) INTO vIsLogifloraDay ; - + DROP TEMPORARY TABLE IF EXISTS tmp.itemList; CREATE TEMPORARY TABLE tmp.itemList (UNIQUE INDEX i USING HASH (itemFk)) ENGINE = MEMORY SELECT itemFk, SUM(quantity) stock, SUM(quantity) visible, SUM(quantity) available FROM ( - SELECT itemFk, quantity + SELECT itemFk, quantity FROM itemTicketOut WHERE shipped >= util.VN_CURDATE() AND shipped < vDated AND warehouseFk = vWarehouseFk AND (vItemFk IS NULL OR itemFk = vItemFk) UNION ALL - SELECT itemFk, quantity + SELECT itemFk, quantity FROM itemEntryIn i - LEFT JOIN edi.warehouseFloramondo wf ON wf.entryFk = i.entryFk + LEFT JOIN edi.warehouseFloramondo wf ON wf.entryFk = i.entryFk WHERE i.landed >= util.VN_CURDATE() AND i.landed < vDated AND i.warehouseInFk = vWarehouseFk AND (vItemFk IS NULL OR i.itemFk = vItemFk) AND (ISNULL(wf.entryFk) OR vIsLogifloraDay) UNION ALL - SELECT itemFk, quantity + SELECT itemFk, quantity FROM itemEntryOut WHERE shipped >= util.VN_CURDATE() AND shipped < vDated AND warehouseOutFk = vWarehouseFk @@ -58146,7 +59036,7 @@ BEGIN CALL `cache`.stock_refresh (FALSE); INSERT INTO tmp.itemList (itemFk,stock,visible,available) - SELECT item_id,amount,amount,amount + SELECT item_id,amount,amount,amount FROM `cache`.stock WHERE warehouse_id = vWarehouseFk AND (vItemFk IS NULL OR vItemFk = item_id) ON DUPLICATE KEY UPDATE @@ -58159,8 +59049,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `itemTagMake` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -58168,11 +59056,13 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `itemTagMake`(vItemFk INT) BEGIN -/* * Crea los tags usando la tabla plantilla itemTag +/* * Crea los tags usando la tabla plantilla itemTag * y si no existe a partir de la ficha del artículo. * @param vItemFk El item al que se le añaden los tags */ @@ -58182,33 +59072,33 @@ BEGIN DECLARE vProducer VARCHAR(50); DECLARE vOrigin VARCHAR(20); DECLARE vTypeFk INTEGER; - - DELETE FROM itemTag + + DELETE FROM itemTag WHERE itemFk = vItemFk; - - SELECT typeFk INTO vTypeFk + + SELECT typeFk INTO vTypeFk FROM item WHERE id = vItemFk; - + INSERT INTO itemTag(itemFk, tagFk, value, priority) SELECT vItemFk, itt.tagFk, NULL, itt.priority FROM itemTag it LEFT JOIN itemTypeTag itt ON itt.itemTypeFk = vTypeFk WHERE it.itemFk = vItemFk; - + IF (SELECT COUNT(*) FROM itemTag WHERE itemFk = vItemFk LIMIT 1) = 0 THEN - SELECT ik.name, i.size, i.category, p.name, o.name + SELECT ik.name, i.size, i.category, p.name, o.name INTO vInk, vSize, vCategory, vProducer, vOrigin FROM item i LEFT JOIN ink ik ON ik.id = i.inkFk LEFT JOIN producer p ON p.id = i.producerFk AND p.isVisible LEFT JOIN origin o ON o.id = i.originFk WHERE i.id = vItemFk; - + INSERT IGNORE INTO itemTag(itemFk, tagFk, value, priority) VALUES(vItemFk, 1, vInk, 1); - + INSERT IGNORE INTO itemTag(itemFk, tagFk, value, priority) VALUES (vItemFk, 8, vSize, 2); @@ -58217,19 +59107,17 @@ BEGIN INSERT IGNORE INTO itemTag(itemFk, tagFk, value, priority) VALUES(vItemFk, 37, vProducer, 4); - + INSERT IGNORE INTO itemTag(itemFk, tagFk, value, priority) VALUES(vItemFk, 35, vOrigin, 5); END IF; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `itemTagReorder` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -58237,17 +59125,19 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb3 */ ; /*!50003 SET character_set_results = utf8mb3 */ ; /*!50003 SET collation_connection = utf8mb3_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `itemTagReorder`(itemTypeFk INT) BEGIN SET @isTriggerDisabled = TRUE; - + -- No se puede usar temporary porque da error Error Code: 1137. No puedo reabrir tabla: 'i DROP TABLE IF EXISTS tmp.item; CREATE TABLE tmp.item SELECT DISTINCT i.id - FROM vn.item i + FROM vn.item i WHERE i.typeFk = itemTypeFk; UPDATE itemTag it @@ -58256,8 +59146,8 @@ BEGIN JOIN itemTypeTag itt ON itt.itemTypeFk = item.typeFk AND itt.tagFk = it.tagFk SET it.priority = itt.priority WHERE itt.itemTypeFk = itemTypeFk; - - CALL item_refreshTags(); + + CALL item_refreshTags(); SET @isTriggerDisabled = FALSE; @@ -58268,8 +59158,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `itemTagReorderByName` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -58277,17 +59165,19 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `itemTagReorderByName`(vName VARCHAR(255)) BEGIN SET @isTriggerDisabled = TRUE; - + -- No se puede usar temporary porque da error Error Code: 1137. No puedo reabrir tabla: 'i DROP TABLE IF EXISTS tmp.item; CREATE TABLE tmp.item SELECT DISTINCT i.id - FROM vn.item i + FROM vn.item i WHERE i.`name` LIKE CONCAT(vName,'%'); UPDATE itemTag it @@ -58296,8 +59186,8 @@ BEGIN JOIN itemTypeTag itt ON itt.itemTypeFk = item.typeFk AND itt.tagFk = it.tagFk SET it.priority = itt.priority WHERE itt.itemTypeFk = itemTypeFk; - - CALL item_refreshTags(); + + CALL item_refreshTags(); SET @isTriggerDisabled = FALSE; @@ -58308,8 +59198,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `itemTag_replace` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -58317,47 +59205,47 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `itemTag_replace`(vItemFromFk INT, vItemToFk INT, vPicture VARCHAR(100)) BEGIN - + /* Reemplaza los tags de un artículo por los de otro, así como su imagen - * + * * @param vItemFromFk id de vn.item con el artículo del que se toman los tags * @param vItemToFk id de vn.item con el artículo del que se toman los tags * @param vPicture imagen del artículo. Opcional. Si no se especifica, hereada la del vItemFromFk */ - DELETE FROM vn.itemTag + DELETE FROM vn.itemTag WHERE itemFk = vItemToFk; - + INSERT INTO vn.itemTag(itemFk, tagFk, value, priority) SELECT vItemToFk, tagFk, value, priority - FROM vn.itemTag + FROM vn.itemTag WHERE itemFk = vItemFromFk; - + IF ISNULL(vPicture) THEN - - SELECT image INTO vPicture - FROM vn.item + + SELECT image INTO vPicture + FROM vn.item WHERE id = vItemFromFk; - + END IF; - UPDATE vn.item i + UPDATE vn.item i SET i.image = vPicture WHERE i.id = vItemToFk; - + CALL vn.itemRefreshTags(vItemToFk); - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `itemTopSeller` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -58365,6 +59253,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `itemTopSeller`() BEGIN @@ -58374,9 +59264,9 @@ BEGIN SELECT DISTINCT id FROM vn.itemCategory WHERE merchandise <> FALSE; - + DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE; - DECLARE EXIT HANDLER FOR SQLEXCEPTION BEGIN + DECLARE EXIT HANDLER FOR SQLEXCEPTION BEGIN RESIGNAL; END; @@ -58387,53 +59277,51 @@ BEGIN INNER JOIN bs.ventas v ON v.Id_Movimiento = s.id WHERE v.fecha BETWEEN TIMESTAMPADD(DAY, - 7, util.VN_CURDATE()) AND util.VN_CURDATE() GROUP BY s.itemFk; - + DROP TABLE IF EXISTS tmp.topSeller; - CREATE TEMPORARY TABLE tmp.topSeller - ( + CREATE TEMPORARY TABLE tmp.topSeller + ( `id` int(11) NOT NULL DEFAULT '0', `typeFk` smallint(5) unsigned NOT NULL, `itemCategoryFk` int(10) unsigned NOT NULL, `total` bigint(21) NOT NULL DEFAULT '0' ) ENGINE=MEMORY DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; - + OPEN rs; read_loop: LOOP FETCH rs INTO vCategoryFk; - + IF vDone THEN LEAVE read_loop; END IF; - + INSERT INTO tmp.topSeller SELECT tsm.itemFk, tsm.typeFk, it.categoryFk, tsm.total FROM tmp.topSellerMin tsm INNER JOIN vn.itemType it ON it.id = tsm.typeFk WHERE it.categoryFk = vCategoryFk ORDER BY tsm.itemFk ,tsm.total DESC - LIMIT 5; + LIMIT 5; END LOOP; CLOSE rs; - + SELECT i.name ,i.id, i.image, i.typeFk, it.categoryFk AS itemCategoryFk, ic.name AS itemCategoryName, it.name AS itemTypeName, ts.total FROM tmp.topSeller ts INNER JOIN vn.item i ON i.id = ts.id INNER JOIN vn.itemType it ON it.id = ts.typeFk INNER JOIN vn.itemCategory ic ON ic.id = it.categoryFk; - + DROP TABLE IF EXISTS topSellerMin; DROP TABLE IF EXISTS tmp.topSeller; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `itemTrash` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -58441,11 +59329,13 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `itemTrash`( - vItemFk INT, - vWarehouseFk INT, - vQuantity INT, + vItemFk INT, + vWarehouseFk INT, + vQuantity INT, vIsTrash BOOLEAN) BEGIN @@ -58453,59 +59343,57 @@ BEGIN DECLARE vClientFk INT; DECLARE vCompanyVnlFk INT DEFAULT 442; DECLARE vCalc INT; - - SELECT barcodeToItem(vItemFk) INTO vItemFk; - + + SELECT barcodeToItem(vItemFk) INTO vItemFk; + SELECT IF(vIsTrash, 200, 400) INTO vClientFk; - + SELECT t.id INTO vTicketFk FROM ticket t - JOIN address a ON a.id=t.addressFk + JOIN address a ON a.id=t.addressFk WHERE t.warehouseFk = vWarehouseFk AND t.clientFk = vClientFk AND DATE(t.shipped) = util.VN_CURDATE() AND a.isDefaultAddress - LIMIT 1; - + LIMIT 1; + CALL cache.visible_refresh(vCalc, TRUE, vWarehouseFk); - - IF vTicketFk IS NULL THEN - + + IF vTicketFk IS NULL THEN + CALL ticket_add( - vClientFk, + vClientFk, util.VN_CURDATE(), - vWarehouseFk, - vCompanyVnlFk, - NULL, - NULL, - NULL, - util.VN_CURDATE(), + vWarehouseFk, + vCompanyVnlFk, + NULL, + NULL, + NULL, + util.VN_CURDATE(), account.myUser_getId(), FALSE, vTicketFk); END IF; - + INSERT INTO sale(ticketFk, itemFk, concept, quantity) - SELECT vTicketFk, + SELECT vTicketFk, vItemFk, - CONCAT(longName,' ',getWorkerCode(), ' ', LEFT(CAST(util.VN_NOW() AS TIME),5)), + CONCAT(longName,' ',getWorkerCode(), ' ', LEFT(CAST(util.VN_NOW() AS TIME),5)), vQuantity - FROM item + FROM item WHERE id = vItemFk; - - UPDATE cache.visible + + UPDATE cache.visible SET visible = visible - vQuantity - WHERE calc_id = vCalc + WHERE calc_id = vCalc AND item_id = vItemFk; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `itemUpdateTag` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -58513,6 +59401,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `itemUpdateTag`(IN vItem BIGINT) BEGIN @@ -58538,7 +59428,7 @@ SET tag6 = t.name, value6 = it.value WHERE it.priority = 2 AND (vItem IS NULL OR vItem = it.itemFk); -UPDATE item i +UPDATE item i JOIN itemTag it ON it.itemFk = i.id JOIN tag t ON t.id = it.tagFk SET tag7 = t.name, value7 = it.value @@ -58558,8 +59448,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `item_clean` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -58567,6 +59455,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `item_clean`() BEGIN @@ -58574,14 +59464,9 @@ BEGIN * Elimina todos los items repetidos y los * sustituye por el que tiene menor id */ - DECLARE vItemFrom INT; - DECLARE vItemEnd INT; DECLARE vItemOld INT; DECLARE vItemNew INT; - DECLARE vCurrentItem INT; - DECLARE vQuantity INT; DECLARE vCounter INT DEFAULT 0; - DECLARE vIsStop BOOL DEFAULT FALSE; DECLARE vDone BOOL DEFAULT FALSE; DECLARE curItemClean CURSOR FOR SELECT i.id idOld, @@ -58638,23 +59523,7 @@ BEGIN ORDER BY i.id; DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET vDone = TRUE; - - SELECT itemFrom INTO vItemFrom - FROM vn.itemCleanLog - ORDER BY created DESC - LIMIT 1; - - IF vItemFrom IS NULL THEN - SELECT MIN(id) INTO vItemFrom - FROM vn.item i - WHERE isFloramondo; - END IF; - - SELECT quantity - INTO vQuantity - FROM vn.itemCleanConfig; - - SET vItemEnd = vItemFrom + vQuantity; + DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE; SET @isModeInventory:= TRUE; @@ -58662,7 +59531,7 @@ BEGIN curItemClean: LOOP FETCH curItemClean INTO vItemOld, vItemNew; - + START TRANSACTION; # Deletes @@ -58690,7 +59559,7 @@ BEGIN DELETE FROM vn.itemProposal WHERE itemFk = vItemOld; - + SET @isTriggerDisabled := TRUE; DELETE FROM vn.itemTag WHERE itemFk = vItemOld; @@ -58757,20 +59626,17 @@ BEGIN COMMIT; - SELECT isStop INTO vIsStop - FROM vn.itemCleanConfig; - - IF vIsStop OR vItemOld > vItemEnd OR vDone THEN + IF vDone THEN LEAVE curItemClean; END IF; - + SET vCounter = vCounter + 1; END LOOP; CLOSE curItemClean; - - INSERT INTO itemCleanLog (itemFrom, itemDeleted) - VALUES (vItemOld, vCounter); + + INSERT INTO itemCleanLog (itemDeleted) + VALUES (vCounter); SET @isModeInventory:= FALSE; END ;; @@ -58779,8 +59645,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `item_deactivateUnused` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -58788,6 +59652,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `item_deactivateUnused`() BEGIN @@ -58823,8 +59689,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `item_getAtp` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -58832,6 +59696,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `item_getAtp`(vDated DATE) BEGIN @@ -58885,8 +59751,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `item_getBalance` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -58894,6 +59758,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `item_getBalance`(IN vItemId int, IN vWarehouse int) BEGIN @@ -58916,7 +59782,7 @@ BEGIN `in` AS invalue, `out`, @a := @a + IFNULL(`in`,0) - IFNULL(`out`,0) as balance, - @currentLineFk := IF (@shipped < util.VN_CURDATE() + @currentLineFk := IF (@shipped < util.VN_CURDATE() OR (@shipped = util.VN_CURDATE() AND (isPicked OR alertLevel >= 2)), lineFk,@currentLineFk) lastPreparedLineFk, isTicket, @@ -58944,7 +59810,7 @@ BEGIN JOIN entry e ON e.id = b.entryFk JOIN travel tr ON tr.id = e.travelFk JOIN supplier s ON s.id = e.supplierFk - JOIN alertLevel al ON al.id = + JOIN alertLevel al ON al.id = CASE WHEN tr.landed < util.VN_CURDATE() THEN 3 WHEN tr.landed = util.VN_CURDATE() AND tr.isReceived = TRUE THEN 3 @@ -58952,7 +59818,7 @@ BEGIN END JOIN state st ON st.code = al.code WHERE tr.landed >= vDateInventory - AND vWarehouse = tr.warehouseInFk + AND vWarehouse = tr.warehouseInFk AND b.itemFk = vItemId AND e.isExcludedFromAvailable = FALSE AND e.isRaid = FALSE @@ -58978,7 +59844,7 @@ BEGIN JOIN travel tr ON tr.id = e.travelFk JOIN warehouse w ON w.id = tr.warehouseOutFk JOIN supplier s ON s.id = e.supplierFk - JOIN alertLevel al ON al.id = + JOIN alertLevel al ON al.id = CASE WHEN tr.shipped < util.VN_CURDATE() THEN 3 WHEN tr.shipped = util.VN_CURDATE() AND tr.isReceived = TRUE THEN 3 @@ -59015,7 +59881,7 @@ BEGIN LEFT JOIN state st ON st.code = ts.code JOIN client c ON c.id = t.clientFk JOIN clientType ct ON ct.id = c.clientTypeFk - JOIN alertLevel al ON al.id = + JOIN alertLevel al ON al.id = CASE WHEN t.shipped < util.VN_CURDATE() THEN 3 WHEN t.shipped > util.dayEnd(util.VN_CURDATE()) THEN 0 @@ -59023,7 +59889,7 @@ BEGIN END LEFT JOIN state stPrep ON stPrep.`code` = 'PREPARED' LEFT JOIN saleTracking stk ON stk.saleFk = s.id AND stk.stateFk = stPrep.id - LEFT JOIN claimBeginning cb ON s.id = cb.saleFk + LEFT JOIN claimBeginning cb ON s.id = cb.saleFk WHERE t.shipped >= vDateInventory AND s.itemFk = vItemId AND vWarehouse =t.warehouseFk @@ -59036,8 +59902,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `item_getInfo` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -59045,6 +59909,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `item_getInfo`(IN `vBarcode` VARCHAR(22), IN `vWarehouseFk` INT) BEGIN @@ -59121,8 +59987,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `item_getLack` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -59130,12 +59994,14 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `item_getLack`(IN vForce BOOLEAN, IN vDays INT) BEGIN /** * Calcula una tabla con el máximo negativo visible para cada producto y almacen - * + * * @param vForce Fuerza el recalculo del stock * @param vDays Numero de dias a considerar **/ @@ -59144,31 +60010,31 @@ BEGIN CALL item_getMinacum(NULL, util.VN_CURDATE(), vDays, NULL); CALL item_getMinETD(); - SELECT i.id itemFk, + SELECT i.id itemFk, i.longName, w.id warehouseFk, - p.`name` producer, + p.`name` producer, i.`size`, i.category, - w.name warehouse, + w.name warehouse, SUM(IFNULL(sub.amount,0)) lack, i.inkFk, - IFNULL(im.timed, util.midnight()) timed - FROM (SELECT item_id, - warehouse_id, + IFNULL(im.timed, util.midnight()) timed + FROM (SELECT item_id, + warehouse_id, amount FROM cache.stock WHERE amount > 0 UNION ALL - SELECT itemFk, - warehouseFk, + SELECT itemFk, + warehouseFk, amount FROM tmp.itemMinacum ) sub JOIN warehouse w ON w.id = sub.warehouse_id JOIN item i ON i.id = sub.item_id - LEFT JOIN producer p ON p.id = i.producerFk - JOIN itemType it ON it.id = i.typeFk + LEFT JOIN producer p ON p.id = i.producerFk + JOIN itemType it ON it.id = i.typeFk JOIN itemCategory ic ON ic.id = it.categoryFk LEFT JOIN tmp.itemMinETD im ON im.itemFk = i.id WHERE w.isForTicket @@ -59185,8 +60051,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `item_getMinacum` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -59194,6 +60058,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `item_getMinacum`(IN vWarehouseFk TINYINT, IN vDatedFrom DATETIME, IN vRange INT, IN vItemFk INT) BEGIN @@ -59277,8 +60143,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `item_getMinETD` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -59286,15 +60150,17 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `item_getMinETD`() BEGIN - + /* Devuelve una tabla temporal con la primera ETD, para todos los artículos con salida hoy. - * + * * @return tmp.itemMinETD(itemFk, timed) */ - + DECLARE vMidnight DATETIME DEFAULT util.midnight(); DROP TEMPORARY TABLE IF EXISTS tmp.itemMinETD; @@ -59305,7 +60171,7 @@ BEGIN SELECT s.itemFk, MIN(TIME(IFNULL(z.`hour`,vMidnight))) timed FROM ticket t JOIN sale s ON s.ticketFk = t.id - LEFT JOIN `zone` z ON z.id = t.zoneFk + LEFT JOIN `zone` z ON z.id = t.zoneFk WHERE t.shipped BETWEEN util.VN_CURDATE() AND vMidnight GROUP BY s.itemFk; END ;; @@ -59314,8 +60180,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `item_getSimilar` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -59323,6 +60187,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `item_getSimilar`(vItemFk INT, vWarehouseFk INT, vDate DATE, vIsShowedByType BOOL) BEGIN @@ -59335,33 +60201,33 @@ BEGIN * @param vWarehouseFk warehouse id * @param vDate fecha para revisar disponible * @param vIsShowedByType para mostrar solo artículos de ese tipo - */ + */ DECLARE vCalcFk INT; DECLARE vTypeFk INT; - + DECLARE vTag1 VARCHAR(25) CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci'; DECLARE vTag5 VARCHAR(25) CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci'; DECLARE vTag6 VARCHAR(25) CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci'; DECLARE vTag7 VARCHAR(25) CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci'; DECLARE vTag8 VARCHAR(25) CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci'; - + DECLARE vValue1 VARCHAR(50) CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci'; DECLARE vValue5 VARCHAR(50) CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci'; DECLARE vValue6 VARCHAR(50) CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci'; DECLARE vValue7 VARCHAR(50) CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci'; DECLARE vValue8 VARCHAR(50) CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci'; - + SELECT typeFk, tag5, value5, tag6, value6, tag7, value7, tag8, value8, t1.name, it1.value INTO vTypeFk, vTag5, vValue5, vTag6, vValue6, vTag7, vValue7, vTag8, vValue8, vTag1, vValue1 FROM vn.item i LEFT JOIN vn.itemTag it1 ON it1.itemFk = i.id AND it1.priority = 1 LEFT JOIN vn.tag t1 ON t1.id = it1.tagFk WHERE i.id = vItemFk; - + CALL cache.available_refresh(vCalcFk, FALSE, vWarehouseFk, vDate); - + SELECT i.id itemFk, i.longName, i.subName, @@ -59394,7 +60260,7 @@ BEGIN ORDER BY counter DESC, (t1.name = vTag1) DESC, (it1.value = vValue1) DESC, - (i.tag6 = vTag6) DESC, + (i.tag6 = vTag6) DESC, (i.value6 = vValue6) DESC, (i.tag5 = vTag5) DESC, (i.value5 = vValue5) DESC, @@ -59403,7 +60269,7 @@ BEGIN (i.tag8 = vTag8) DESC, (i.value8 = vValue8) DESC LIMIT 30; - + END ;; DELIMITER ; @@ -59411,8 +60277,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `item_GetVisible` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -59420,22 +60284,24 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `item_GetVisible`(vWarehouse SMALLINT, vItem INT) BEGIN DECLARE vTomorrow DATETIME DEFAULT TIMESTAMPADD(DAY, 1, util.VN_CURDATE()); - + INSERT INTO vn2008.tmp_item (item_id, visible) SELECT item_id, SUM(amount) amount FROM ( - SELECT i.itemFk AS item_id, quantity AS amount + SELECT i.itemFk AS item_id, quantity AS amount FROM itemTicketOut i - LEFT JOIN ticketState ts ON ts.ticketFk = i.ticketFk + LEFT JOIN ticketState ts ON ts.ticketFk = i.ticketFk JOIN state s ON s.id = ts.stateFk - LEFT JOIN (SELECT DISTINCT saleFk - FROM saleTracking st + LEFT JOIN (SELECT DISTINCT saleFk + FROM saleTracking st JOIN state s ON s.id = st.stateFk - WHERE st.created > util.VN_CURDATE() + WHERE st.created > util.VN_CURDATE() AND (s.isPicked OR st.isChecked) ) stPrevious ON `stPrevious`.`saleFk` = i.saleFk WHERE i.warehouseFk = vWarehouse @@ -59443,7 +60309,7 @@ BEGIN AND (s.isPicked OR i.reserved OR stPrevious.saleFk ) AND i.shipped >= util.VN_CURDATE() AND i.shipped < vTomorrow UNION ALL - SELECT iei.itemFk, quantity + SELECT iei.itemFk, quantity FROM itemEntryIn iei WHERE (iei.isReceived != FALSE /*OR ip.modificationDate > util.VN_CURDATE()*/) AND iei.landed >= util.VN_CURDATE() AND iei.landed < vTomorrow @@ -59451,7 +60317,7 @@ BEGIN AND (vItem IS NULL OR iei.itemFk = vItem) AND iei.isVirtualStock is FALSE UNION ALL - SELECT itemFk, quantity + SELECT itemFk, quantity FROM itemEntryOut WHERE isDelivered != FALSE AND shipped >= util.VN_CURDATE() AND shipped < vTomorrow @@ -59467,8 +60333,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `item_refreshTags` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -59476,6 +60340,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `item_refreshTags`() BEGIN @@ -59484,7 +60350,7 @@ BEGIN * * @param temporary table tmp.item(id) del articulo **/ - + DECLARE done INT DEFAULT FALSE; DECLARE vItemFk INT; DECLARE cur1 CURSOR FOR SELECT id FROM tmp.item; @@ -59494,13 +60360,13 @@ BEGIN OPEN cur1; read_loop: LOOP - + FETCH cur1 INTO vItemFk; - + IF done THEN LEAVE read_loop; END IF; - + UPDATE item i LEFT JOIN itemTag it1 ON it1.priority = 1 AND it1.itemFk = i.id LEFT JOIN itemTag it2 ON it2.priority = 2 AND it2.itemFk = i.id @@ -59515,54 +60381,54 @@ BEGIN LEFT JOIN tagAbbreviation ta2 ON ta2.`value` = it2.`value` AND ta2.tagFk IS NULL LEFT JOIN itemTag it3 ON it3.priority = 3 AND it3.itemFk = i.id LEFT JOIN tagAbbreviation ta3 ON ta3.`value` = it3.`value` - SET i.`name` = CONCAT_WS(' ', - IFNULL(ta1.abbreviation,it1.`value`), - IFNULL(ta2.abbreviation,it2.`value`), + SET i.`name` = CONCAT_WS(' ', + IFNULL(ta1.abbreviation,it1.`value`), + IFNULL(ta2.abbreviation,it2.`value`), IF(i.isFloramondo,'',IFNULL(ta3.abbreviation,it3.`value`))) WHERE i.id = vItemFk; - + UPDATE item i LEFT JOIN itemTag it ON it.itemFk = i.id AND it.priority = 4 SET i.subName = it.`value` WHERE i.id = vItemFk; - + UPDATE item i LEFT JOIN itemTag it ON it.itemFk = i.id AND it.priority = 5 LEFT JOIN tag t ON t.id = it.tagFk SET tag5 = t.name, value5 = it.`value` WHERE i.id = vItemFk; - + UPDATE item i LEFT JOIN itemTag it ON it.itemFk = i.id AND it.priority = 6 LEFT JOIN tag t ON t.id = it.tagFk SET tag6 = t.name, value6 = it.`value` WHERE i.id = vItemFk; - + UPDATE item i LEFT JOIN itemTag it ON it.itemFk = i.id AND it.priority = 7 - LEFT JOIN tag t ON t.id = it.tagFk + LEFT JOIN tag t ON t.id = it.tagFk SET i.tag7 = t.name, i.value7 = it.`value` WHERE i.id = vItemFk; - + UPDATE item i LEFT JOIN itemTag it ON it.itemFk = i.id AND it.priority = 8 LEFT JOIN tag t ON t.id = it.tagFk SET tag8 = t.name, value8 = it.`value` WHERE i.id = vItemFk; - + UPDATE item i LEFT JOIN itemTag it ON it.itemFk = i.id AND it.priority = 9 LEFT JOIN tag t ON t.id = it.tagFk SET tag9 = t.name, value9 = it.`value` WHERE i.id = vItemFk; - + UPDATE item i LEFT JOIN itemTag it ON it.itemFk = i.id AND it.priority = 10 LEFT JOIN tag t ON t.id = it.tagFk SET tag10 = t.name, value10 = it.`value` WHERE i.id = vItemFk; - -- Al insertar el tag color se modifica también el antiguo campo color + -- Al insertar el tag color se modifica también el antiguo campo color UPDATE item i JOIN tag t ON t.overwrite = 'inkFk' JOIN itemTag it ON it.itemFk = i.id AND it.tagFk = t.id @@ -59577,7 +60443,7 @@ BEGIN JOIN origin o ON o.`name` = it.`value` SET i.originFk = o.id WHERE i.id = vItemFk; - + -- Al insertar el tag medida se modifica también en la tabla item UPDATE item i JOIN tag t ON t.overwrite = 'size' @@ -59592,36 +60458,34 @@ BEGIN JOIN producer p ON p.`name` = it.`value` SET i.producerFk = p.id WHERE i.id = vItemFk; - + -- Al insertar el tag tallos se modifica también en la tabla item UPDATE item i JOIN tag t ON t.overwrite = 'stems' JOIN itemTag it ON it.itemFk = i.id AND it.tagFk = t.id SET i.stems = it.`value` WHERE i.id = vItemFk; - + -- Al insertar el tag categoria se modifica también en la tabla item UPDATE item i JOIN tag t ON t.overwrite = 'category' JOIN itemTag it ON it.itemFk = i.id AND it.tagFk = t.id SET i.category = it.`value` WHERE i.id = vItemFk; - + -- Comprueba si existe un genérico y lo asigna CALL vn.item_setGeneric(vItemFk); - + END LOOP; CLOSE cur1; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `item_refreshTags_beta` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -59629,6 +60493,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `item_refreshTags_beta`() BEGIN @@ -59637,7 +60503,7 @@ BEGIN * * @param temporary table tmp.item(id) del articulo **/ - + DECLARE done INT DEFAULT FALSE; DECLARE vItemFk INT; DECLARE cur1 CURSOR FOR SELECT id FROM tmp.item; @@ -59647,13 +60513,13 @@ BEGIN OPEN cur1; read_loop: LOOP - + FETCH cur1 INTO vItemFk; - + IF done THEN LEAVE read_loop; END IF; - + UPDATE item i LEFT JOIN itemTag it1 ON it1.priority = 1 AND it1.itemFk = i.id LEFT JOIN itemTag it2 ON it2.priority = 2 AND it2.itemFk = i.id @@ -59668,54 +60534,54 @@ BEGIN LEFT JOIN tagAbbreviation ta2 ON ta2.`value` = it2.`value` LEFT JOIN itemTag it3 ON it3.priority = 3 AND it3.itemFk = i.id LEFT JOIN tagAbbreviation ta3 ON ta3.`value` = it3.`value` - SET i.`name` = CONCAT_WS(' ', - IFNULL(ta1.abbreviation,it1.`value`), - IFNULL(ta2.abbreviation,it2.`value`), + SET i.`name` = CONCAT_WS(' ', + IFNULL(ta1.abbreviation,it1.`value`), + IFNULL(ta2.abbreviation,it2.`value`), IF(i.isFloramondo,'',IFNULL(ta3.abbreviation,it3.`value`))) WHERE i.id = vItemFk; - + UPDATE item i JOIN tmp.itemToRefresh tmpI ON tmpI.id = i.id LEFT JOIN itemTag it ON it.itemFk = i.id AND it.priority = 4 SET i.subName = it.`value`; - + UPDATE item i LEFT JOIN itemTag it ON it.itemFk = i.id AND it.priority = 5 LEFT JOIN tag t ON t.id = it.tagFk SET tag5 = t.name, value5 = it.`value` WHERE i.id = vItemFk; - + UPDATE item i LEFT JOIN itemTag it ON it.itemFk = i.id AND it.priority = 6 LEFT JOIN tag t ON t.id = it.tagFk SET tag6 = t.name, value6 = it.`value` WHERE i.id = vItemFk; - + UPDATE item i LEFT JOIN itemTag it ON it.itemFk = i.id AND it.priority = 7 - LEFT JOIN tag t ON t.id = it.tagFk + LEFT JOIN tag t ON t.id = it.tagFk SET i.tag7 = t.name, i.value7 = it.`value` WHERE i.id = vItemFk; - + UPDATE item i LEFT JOIN itemTag it ON it.itemFk = i.id AND it.priority = 8 LEFT JOIN tag t ON t.id = it.tagFk SET tag8 = t.name, value8 = it.`value` WHERE i.id = vItemFk; - + UPDATE item i LEFT JOIN itemTag it ON it.itemFk = i.id AND it.priority = 9 LEFT JOIN tag t ON t.id = it.tagFk SET tag9 = t.name, value9 = it.`value` WHERE i.id = vItemFk; - + UPDATE item i LEFT JOIN itemTag it ON it.itemFk = i.id AND it.priority = 10 LEFT JOIN tag t ON t.id = it.tagFk SET tag10 = t.name, value10 = it.`value` WHERE i.id = vItemFk; - -- Al insertar el tag color se modifica también el antiguo campo color + -- Al insertar el tag color se modifica también el antiguo campo color UPDATE item i JOIN tag t ON t.overwrite = 'inkFk' JOIN itemTag it ON it.itemFk = i.id AND it.tagFk = t.id @@ -59730,7 +60596,7 @@ BEGIN JOIN origin o ON o.`name` = it.`value` SET i.originFk = o.id WHERE i.id = vItemFk; - + -- Al insertar el tag medida se modifica también en la tabla item UPDATE item i JOIN tag t ON t.overwrite = 'size' @@ -59745,26 +60611,24 @@ BEGIN JOIN producer p ON p.`name` = it.`value` SET i.producerFk = p.id WHERE i.id = vItemFk; - + -- Al insertar el tag tallos se modifica también en la tabla item UPDATE item i JOIN tag t ON t.overwrite = 'stems' JOIN itemTag it ON it.itemFk = i.id AND it.tagFk = t.id SET i.stems = it.`value` WHERE i.id = vItemFk; - + END LOOP; CLOSE cur1; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `item_saveReference` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -59772,6 +60636,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `item_saveReference`(vBarcode VARCHAR(22), vReference VARCHAR(150)) BEGIN @@ -59782,11 +60648,11 @@ BEGIN * @param vBarcode del item * @param vReference referencia a actualizar */ - + DECLARE vItemFk INT; SELECT barcodeToItem(vBarcode) INTO vItemFk; - + UPDATE item SET comment = vReference WHERE id = vItemFk; END ;; @@ -59795,8 +60661,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `item_setGeneric` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -59804,12 +60668,14 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `item_setGeneric`(vSelf INT) BEGIN /** * Asigna el código genérico a un item, salvo que sea un código de item genérico. - * + * * @param vSelf identificador de vn.item */ DECLARE vGenericFk INT; @@ -59818,14 +60684,14 @@ BEGIN FROM ( SELECT itemFk, (sum(matches) = maxMatches) `match` FROM ( - SELECT ga.id gaid, - ga.itemFk, - (it.value <=> ga.origin) - + (it.value <=> ga.color) - + (it.value <=> ga.quality) - + (it.value <=> ga.numFlores) - + (it.value <=> ga.category) - + (it.value <=> ga.productor) matches, + SELECT ga.id gaid, + ga.itemFk, + (it.value <=> ga.origin) + + (it.value <=> ga.color) + + (it.value <=> ga.quality) + + (it.value <=> ga.numFlores) + + (it.value <=> ga.category) + + (it.value <=> ga.productor) matches, !ISNULL(ga.origin) +!ISNULL(ga.color) +!ISNULL(ga.quality) @@ -59833,19 +60699,19 @@ BEGIN +!ISNULL(ga.category) +!ISNULL(ga.productor) maxMatches FROM vn.item i - JOIN vn.itemTag it ON it.itemFk = i.id + JOIN vn.itemTag it ON it.itemFk = i.id JOIN vn.genericAllocation ga ON (i.typeFk = ga.typeFk OR ga.typeFk IS NULL) AND (i.longName = ga.longName OR ga.longName IS NULL) AND (i.`size` = ga.`size` OR ga.`size` IS NULL) AND i.id != ga.itemFk WHERE i.id = vSelf - AND NOT i.isFloramondo) sub + AND NOT i.isFloramondo) sub GROUP BY gaid HAVING `match`) sub2; - UPDATE vn.item - SET genericFk = vGenericFk + UPDATE vn.item + SET genericFk = vGenericFk WHERE id = vSelf; END ;; DELIMITER ; @@ -59853,8 +60719,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `item_updatePackingShelve` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -59862,29 +60726,29 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb3 */ ; /*!50003 SET character_set_results = utf8mb3 */ ; /*!50003 SET collation_connection = utf8mb3_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `item_updatePackingShelve`(vSelf INT, vPacking INT) BEGIN - + /** * Actualiza el valor de item.packingShelve - * + * * @param vSelf Identificador de vn.item * @param vPacking Cantidad de unidades de venta que caben en una bandeja */ - - UPDATE vn.item i + + UPDATE vn.item i SET i.packingShelve = vPacking WHERE i.id = vSelf; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `item_updatePackingType` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -59892,6 +60756,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `item_updatePackingType`(vItem INT, vItemPackingTypeFk VARCHAR(1)) BEGIN @@ -59909,8 +60775,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `item_ValuateInventory` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -59918,6 +60782,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `item_ValuateInventory`(IN vDated DATE, IN vIsDetailed BOOLEAN) BEGIN @@ -59926,9 +60792,9 @@ BEGIN DECLARE vHasNotInventory BOOLEAN DEFAULT FALSE; DECLARE vInventoried2 DATE; DECLARE vDateDayEnd DATETIME; - + SET vDateDayEnd = util.dayEnd(vDated); - + SELECT landed INTO vInventoried FROM travel tr JOIN entry E ON E.travelFk = tr.id @@ -59938,7 +60804,7 @@ BEGIN LIMIT 1; SET vHasNotInventory = IF (vInventoried is null, TRUE, FALSE); - + IF vHasNotInventory THEN SELECT landed INTO vInventoried2 @@ -59959,13 +60825,13 @@ BEGIN CREATE TEMPORARY TABLE inv (warehouseFk SMALLINT, Id_Article BIGINT, - cantidad INT, + cantidad INT, coste DOUBLE DEFAULT 0, total DOUBLE DEFAULT 0, Almacen VARCHAR(20), PRIMARY KEY (Almacen, Id_Article) USING HASH) ENGINE = MEMORY; - + IF vHasNotInventory = TRUE THEN INSERT INTO inv(warehouseFk, Id_Article, cantidad, Almacen) @@ -60042,7 +60908,7 @@ BEGIN AND it.isInventory ON DUPLICATE KEY UPDATE inv.cantidad = inv.cantidad + s.quantity * IF(vHasNotInventory,0,1); - END IF; + END IF; -- Mercancia en transito INSERT INTO inv(warehouseFk, Id_Article, cantidad, Almacen) @@ -60060,7 +60926,7 @@ BEGIN AND t.isInventory AND e.isConfirmed ON DUPLICATE KEY UPDATE inv.cantidad = inv.cantidad + (b.quantity); - + CALL vn.buyUltimate(NULL,vDateDayEnd); UPDATE inv i @@ -60075,20 +60941,20 @@ BEGIN IF vIsDetailed THEN SELECT inv.warehouseFk, - i.id itemFk, - i.longName , - i.size, - inv.Cantidad, + i.id itemFk, + i.longName , + i.size, + inv.Cantidad, tp.name Tipo, - ic.name Reino, - inv.coste, + ic.name Reino, + inv.coste, cast(inv.total as decimal(10,2)) total, almacen FROM inv JOIN warehouse w on w.id = warehouseFk JOIN item i ON i.id = inv.Id_Article JOIN itemType tp ON tp.id = i.typeFk - JOIN itemCategory ic ON ic.id = tp.categoryFk + JOIN itemCategory ic ON ic.id = tp.categoryFk WHERE w.valuatedInventory and inv.total > 0 order by inv.total desc; @@ -60114,8 +60980,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `ledger_doCompensation` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -60123,6 +60987,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `ledger_doCompensation`(vDated DATE, vCompensationAccount VARCHAR(10) , vBankFk VARCHAR(10), vConcept VARCHAR(255), vAmount DECIMAL(10,2), vCompanyFk INT, vOriginalAccount VARCHAR(10)) BEGIN @@ -60135,37 +61001,37 @@ BEGIN * @param vConcept descripcion * @param vAmount cantidad que se compensa * @param vCompany empresa - * @param vOriginalAccount cuenta contable desde la cual se compensa - * - */ + * @param vOriginalAccount cuenta contable desde la cual se compensa + * + */ DECLARE vNewBookEntry INT; DECLARE vIsClientCompensation INT; DECLARE vClientFk INT; DECLARE vSupplierFk INT; DECLARE vIsOriginalAClient BOOL; DECLARE vPayMethodCompensation INT; - + CALL ledger_next(vNewBookEntry); SELECT COUNT(id) INTO vIsOriginalAClient FROM client WHERE accountingAccount LIKE vOriginalAccount COLLATE utf8_general_ci; - SELECT id, COUNT(id) INTO vClientFk, vIsClientCompensation - FROM client + SELECT id, COUNT(id) INTO vClientFk, vIsClientCompensation + FROM client WHERE accountingAccount LIKE vCompensationAccount COLLATE utf8_general_ci; - + SET @vAmount1:= 0.0; SET @vAmount2:= 0.0; - INSERT INTO XDiario (ASIEN, FECHA, SUBCTA, CONTRA, CONCEPTO, EURODEBE, EUROHABER, empresa_id) - VALUES ( vNewBookEntry, - vDated, - vOriginalAccount, - vCompensationAccount, - vConcept, + INSERT INTO XDiario (ASIEN, FECHA, SUBCTA, CONTRA, CONCEPTO, EURODEBE, EUROHABER, empresa_id) + VALUES ( vNewBookEntry, + vDated, + vOriginalAccount, + vCompensationAccount, + vConcept, @vAmount1:= IF( - (vIsOriginalAClient AND vAmount > 0) OR - (NOT vIsOriginalAClient AND vAmount < 0), - 0, + (vIsOriginalAClient AND vAmount > 0) OR + (NOT vIsOriginalAClient AND vAmount < 0), + 0, ABS(vAmount) ), @vAmount2:= IF(@vAmount1, @@ -60174,20 +61040,20 @@ BEGIN ), vCompanyFk ), - ( vNewBookEntry, - vDated, - vCompensationAccount, - vOriginalAccount, - vConcept, + ( vNewBookEntry, + vDated, + vCompensationAccount, + vOriginalAccount, + vConcept, @vAmount2, @vAmount1, vCompanyFk); - + IF vIsClientCompensation THEN IF vIsOriginalAClient THEN SET vAmount = -vAmount; END IF; - INSERT INTO receipt(invoiceFk, amountPaid, payed, bankFk, companyFk, clientFk, isConciliate) + INSERT INTO receipt(invoiceFk, amountPaid, payed, bankFk, companyFk, clientFk, isConciliate) VALUES (vConcept, vAmount, vDated, vBankFk, vCompanyFk, vClientFk, TRUE); ELSE IF NOT vIsOriginalAClient THEN @@ -60195,7 +61061,7 @@ BEGIN END IF; SELECT id INTO vSupplierFk FROM supplier WHERE `account` LIKE vCompensationAccount COLLATE utf8_general_ci; SELECT id INTO vPayMethodCompensation FROM payMethod WHERE `code` = 'compensation'; - + INSERT INTO payment (received, dueDated, supplierFk, amount, bankFk, payMethodFk, concept, companyFk, isConciliated) VALUES(vDated, vDated, vSupplierFk, vAmount, vBankFk, vPayMethodCompensation, vConcept, vCompanyFk, TRUE); END IF; @@ -60205,8 +61071,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `ledger_next` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -60214,21 +61078,21 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `ledger_next`(OUT vNewBookEntry INT) BEGIN - + UPDATE vn.ledgerConfig SET lastBookEntry = LAST_INSERT_ID(lastBookEntry + 1); SET vNewBookEntry = LAST_INSERT_ID(); - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `logAdd` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -60236,6 +61100,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `logAdd`(vOriginFk INT, vActionCode VARCHAR(45), vEntity VARCHAR(45), vDescription TEXT) BEGIN @@ -60247,7 +61113,7 @@ BEGIN * @param vEntity Nombre que hace referencia a la tabla. * @param descripcion Descripción de la acción realizada por el usuario */ - + CALL logAddWithUser(vOriginFk, account.myUser_getId(), vActionCode, vEntity, vDescription); END ;; DELIMITER ; @@ -60255,8 +61121,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `logAddWithUser` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -60264,6 +61128,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `logAddWithUser`(vOriginFk INT, vUserId INT, vActionCode VARCHAR(45), vEntity VARCHAR(45), vDescription TEXT) BEGIN @@ -60296,8 +61162,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `logShow` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -60305,6 +61169,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `logShow`(vOriginFk INT, vEntity VARCHAR(45)) BEGIN @@ -60315,15 +61181,15 @@ BEGIN * @param vEntity Nombre que hace referencia a la tabla. */ DECLARE vTableName VARCHAR(45); - + SET vTableName = CONCAT(vEntity, 'Log'); - + SET @qryLog := CONCAT( 'SELECT ot.id, ot.originFk, ot.userFk, u.name, ot.action, ot.creationDate, ot.description FROM ', vTableName, ' AS ot', ' INNER JOIN account.user u ON u.id = ot.userFk', ' WHERE ot.originFk = ', vOriginFk, ' ORDER BY ot.creationDate DESC' ); - + PREPARE stmt FROM @qryLog; EXECUTE stmt; END ;; @@ -60332,8 +61198,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `lungSize_generator` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -60341,6 +61205,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `lungSize_generator`(vDate DATE) BEGIN @@ -60348,9 +61214,9 @@ BEGIN SET @buildingOrder := 0; SET @route := 0; set @cajas := 0; - + UPDATE tmp.sorter - SET buildingOrder = @buildingOrder := IF(@route = @route := routeFk, @buildingOrder, 0) + 1 + SET buildingOrder = @buildingOrder := IF(@route = @route := routeFk, @buildingOrder, 0) + 1 where date(created) = vDate order by routeFk, created, weight DESC; @@ -60368,23 +61234,23 @@ set @cajas := 0; UPDATE tmp.sorter SET lungGrow = IF(palletOrder = 0, -13, lungGrow); - + DELETE FROM tmp.lungSize WHERE dia = vDate; - + INSERT INTO tmp.lungSize(dia, hora,size) select vDate,hora, @cajas := @cajas + cajas as size from ( select IF(lungGrow BETWEEN -12 AND -1, ETD,time_format(created,"%H:%i")) as hora, sum(if(lungGrow <= 0, lungGrow, 1)) as cajas, @cajas := 0 - from tmp.sorter + from tmp.sorter where date(created) = vDate group by hora ) sub; - + SELECT * FROM tmp.lungSize WHERE dia = vDate; - - + + END ;; @@ -60393,8 +61259,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `machineWorker_add` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -60402,34 +61266,34 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `machineWorker_add`(vPlate VARCHAR(10), vWorkerFk INT) BEGIN - + /** * Inserta registro si el vWorkerFk no ha registrado nada en las últimas 12 horas * @param vPlate número de matrícula - * @param vWorkerFk id del worker - * -*/ - UPDATE vn.machineWorker mw - JOIN vn.machine m ON m.id = mw.machineFk + * @param vWorkerFk id del worker + * +*/ + UPDATE vn.machineWorker mw + JOIN vn.machine m ON m.id = mw.machineFk SET mw.outTimed = util.VN_NOW() WHERE (mw.workerFk = vWorkerFk OR m.plate = vPlate) AND ISNULL(mw.outTimed); - + INSERT INTO machineWorker (machineFk, workerFk) SELECT m.id, vWorkerFk FROM machine m - WHERE m.plate= vPlate; + WHERE m.plate= vPlate; END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `machineWorker_getHistorical` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -60437,33 +61301,33 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `machineWorker_getHistorical`(vPlate VARCHAR(20), vWorkerFk INT) BEGIN /** - * Obtiene historial de la matrícula vPlate que el trabajador vWorkerFk escanea, + * Obtiene historial de la matrícula vPlate que el trabajador vWorkerFk escanea, * si es jefe de producción muestra el historial completo. - * + * * @param vPlate número de matrícula - * @param vWorkerFk id del trabajador - * + * @param vWorkerFk id del trabajador + * */ DECLARE vWorkerName VARCHAR(255) DEFAULT account.user_getNameFromId(vWorkerFk); - SELECT mw.inTimed,account.user_getNameFromId(mw.workerFk) as workerName, mw.outTimed + SELECT mw.inTimed,account.user_getNameFromId(mw.workerFk) as workerName, mw.outTimed FROM machineWorker mw JOIN machine m ON m.plate = vPlate WHERE mw.machineFk = m.id AND mw.workerFk = IF(account.user_hasRole(vWorkerName, 'coolerAssist'), mw.workerFk, vWorkerFk) - ORDER BY mw.inTimed DESC; + ORDER BY mw.inTimed DESC; END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `machineWorker_update` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -60471,16 +61335,18 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `machineWorker_update`(vPlate VARCHAR(10), vWorkerFk INT) BEGIN - + /** - * Actualiza el registro correspondiente si el vWorkerFk se ha registrado en las últimas horas (campo maxHours de machineWorkerConfig) con vPlate, - * + * Actualiza el registro correspondiente si el vWorkerFk se ha registrado en las últimas horas (campo maxHours de machineWorkerConfig) con vPlate, + * * @param vPlate número de matrícula - * @param vWorkerFk id del trabajador - * + * @param vWorkerFk id del trabajador + * */ DECLARE vMachineFk INT(10); @@ -60489,32 +61355,30 @@ BEGIN SELECT m.id INTO vMachineFk FROM machine m WHERE m.plate = vPlate; - + SELECT maxHours INTO vMaxHours FROM machineWorkerConfig; - IF (SELECT COUNT(*) + IF (SELECT COUNT(*) FROM machineWorker m WHERE m.workerFk = vWorkerFk - AND m.inTimed >= TIMESTAMPADD(HOUR , -vMaxHours, util.VN_NOW()) AND ISNULL(m.outTimed)) THEN - + AND m.inTimed >= TIMESTAMPADD(HOUR , -vMaxHours, util.VN_NOW()) AND ISNULL(m.outTimed)) THEN + UPDATE machineWorker m SET m.outTimed = CURRENT_TIMESTAMP() - WHERE m.workerFk = vWorkerFk - AND m.inTimed >= TIMESTAMPADD(HOUR , -vMaxHours, util.VN_NOW()) + WHERE m.workerFk = vWorkerFk + AND m.inTimed >= TIMESTAMPADD(HOUR , -vMaxHours, util.VN_NOW()) AND ISNULL(m.outTimed) AND m.machineFk = vMachineFk; - + END IF; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `machine_getWorkerPlate` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -60522,22 +61386,24 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `machine_getWorkerPlate`(vWorkerFk INT) BEGIN /** - * Selecciona la matrícula del vehículo del workerfk - * + * Selecciona la matrícula del vehículo del workerfk + * * @param vWorkerFk el id del trabajador - * - * + * + * **/ - + SELECT m.plate - FROM machine m - JOIN machineWorker mw ON mw.machineFk = m.id - WHERE mw.inTimed >= TIMESTAMPADD(HOUR , -12,util.VN_NOW()) - AND ISNULL(mw.outTimed) + FROM machine m + JOIN machineWorker mw ON mw.machineFk = m.id + WHERE mw.inTimed >= TIMESTAMPADD(HOUR , -12,util.VN_NOW()) + AND ISNULL(mw.outTimed) AND mw.workerFk = vWorkerFk; END ;; @@ -60546,15 +61412,15 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `mail_insert` */; /*!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 = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; -/*!50003 SET collation_connection = utf8mb4_general_ci */ ; +/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `mail_insert`( vReceiver VARCHAR(255), @@ -60565,12 +61431,12 @@ BEGIN /** * Inserta en la tabla vn.mail * - * @param vReceiver Receptor del correo + * @param vReceiver Receptor del correo * @param vReplyTo A quién contestar el correo * @param vSubject Título del correo * @param vBody Cuerpo del correo */ - + DECLARE vIsRepeated BOOLEAN; SELECT COUNT(*) INTO vIsRepeated @@ -60587,7 +61453,7 @@ BEGIN `receiver` = vReceiver, `replyTo` = vReplyTo, `subject` = vSubject, - `body` = vBody; + `body` = IFNULL(vBody,vSubject); END IF; @@ -60597,8 +61463,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `makeNewItem` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -60606,17 +61470,19 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `makeNewItem`() BEGIN DECLARE newItemFk INT; - + SELECT getNewItemId() INTO newItemFk; - + INSERT INTO item(id,name,typeFk,originFk) SELECT newItemFk, 'Nuevo artículo', 78,39; - + SELECT newItemFk; @@ -60626,8 +61492,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `makePCSGraf` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -60635,6 +61499,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `makePCSGraf`(vDated DATE) BEGIN @@ -60644,42 +61510,40 @@ BEGIN DECLARE vMinute INT DEFAULT 0; DECLARE vBoxes INT; - + DROP TEMPORARY TABLE IF EXISTS vn.pcsDay; CREATE TEMPORARY TABLE vn.pcsDay SELECT 0 as hh, 0 as mm, 0 as boxes; - + -- Creamos una tabla soporte para acumular las cajas a lo largo del dia WHILE vHour < 24 DO - + WHILE vMinute < 59 DO - + SET vMinute = vMinute + 1; - + INSERT INTO vn.pcsDay(hh,mm) VALUES(vHour, vMinute); - + END WHILE; - + SET vMinute = -1; SET vHour = vHour + 1; - + END WHILE; - + -- Acumulamos UPDATE vn.pcsDay pd LEFT JOIN (SELECT * FROM vn.pcs_graf WHERE dia = vDated) pg USING(hh,mm) SET pd.boxes = pd.boxes + pg.box; - + SELECT * FROM vn.pcsDay; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `manaSpellersRequery` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -60687,6 +61551,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `manaSpellersRequery`(vWorkerFk INTEGER) BEGIN @@ -60694,7 +61560,7 @@ BEGIN * Recalcula el mana consumido por un trabajador * * @param vWorkerFk Id Trabajador - */ + */ DECLARE vWorkerIsExcluded BOOLEAN; DECLARE vFromDated DATE; DECLARE vToDated DATE DEFAULT TIMESTAMPADD(DAY,1,util.VN_CURDATE()); @@ -60703,32 +61569,32 @@ BEGIN DECLARE vClaimMana INT; DECLARE vManaBank INT; DECLARE vManaGreugeType INT; - + SELECT COUNT(*) INTO vWorkerIsExcluded FROM workerManaExcluded WHERE workerFk = vWorkerFk; - + IF NOT vWorkerIsExcluded THEN - SELECT id INTO vMana + SELECT id INTO vMana FROM `component` WHERE code = 'mana'; - - SELECT id INTO vAutoMana + + SELECT id INTO vAutoMana FROM `component` WHERE code = 'autoMana'; - - SELECT id INTO vClaimMana + + SELECT id INTO vClaimMana FROM `component` WHERE code = 'manaClaim'; - - SELECT id INTO vManaBank + + SELECT id INTO vManaBank FROM `bank` WHERE code = 'mana'; - - SELECT id INTO vManaGreugeType + + SELECT id INTO vManaGreugeType FROM `greugeType` WHERE code = 'mana'; - SELECT max(dated) INTO vFromDated + SELECT max(dated) INTO vFromDated FROM clientManaCache; - + REPLACE workerMana (workerFk, amount) - SELECT vWorkerFk, sum(mana) FROM + SELECT vWorkerFk, sum(mana) FROM ( SELECT s.quantity * sc.value as mana FROM ticket t @@ -60749,8 +61615,8 @@ BEGIN FROM greuge g JOIN client c ON c.id = g.clientFk WHERE c.salesPersonFk = vWorkerFk AND g.greugeTypeFk = vManaGreugeType - AND g.shipped > vFromDated and g.shipped < util.VN_CURDATE() - UNION ALL + AND g.shipped > vFromDated and g.shipped < util.VN_CURDATE() + UNION ALL SELECT cc.mana FROM clientManaCache cc JOIN client c ON c.id = cc.clientFk @@ -60763,8 +61629,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `mysqlConnectionsSorter_kill` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -60772,25 +61636,27 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `mysqlConnectionsSorter_kill`() BEGIN /** - * Elimina conexiones del usuario sorter con tiempo >= 30seg. Asociado al evento con el mismo nombre - */ - + * Elimina conexiones del usuario sorter con tiempo >= 30seg. Asociado al evento con el mismo nombre + */ + DECLARE vDone INT DEFAULT 0; DECLARE vProcesId INT; DECLARE vCursor CURSOR FOR - SELECT p.id + SELECT p.id FROM information_schema.processlist p - WHERE USER = 'sorter' + WHERE USER = 'sorter' AND TIME >= 30; DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE; - + OPEN vCursor; l: LOOP @@ -60813,8 +61679,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `mysqlPreparedCount_check` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -60822,12 +61686,14 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `mysqlPreparedCount_check`() BEGIN DECLARE vPreparedCount INTEGER; - SELECT VARIABLE_VALUE INTO vPreparedCount + SELECT VARIABLE_VALUE INTO vPreparedCount FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE '%prepared_stmt_count%'; @@ -60835,7 +61701,7 @@ BEGIN CALL `vn`.`mail_insert`('cau@verdnatura.es', NULL, 'Problemas BBDD prepared_stmt_count', - CONCAT('Existen problemas con el servicio de Logiflora, prepared_stmt_count con valor: ', + CONCAT('Existen problemas con el servicio de Logiflora, prepared_stmt_count con valor: ', vPreparedCount, ', está próximo a exceder su límite. \r\n Hay que reiniciar el servicio LF.VMP.Service del servidor a3.') ); @@ -60847,8 +61713,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `nextShelvingCodeMake` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -60856,43 +61720,45 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `nextShelvingCodeMake`() BEGIN DECLARE newShelving VARCHAR(3); DECLARE vCode VARCHAR(3); - + SELECT MAX(code) INTO vCode FROM vn.shelving WHERE isPrinted = FALSE; - + SET @a1 := ASCII(MID(vCode,1,1)); SET @a2 := ASCII(MID(vCode,2,1)); SET @a3 := ASCII(MID(vCode,3,1)) + 1; - + IF @a3 > 90 THEN - + SET @a3 = 65; SET @a2 = @a2 + 1; - + IF @a2 > 90 THEN - + SET @a2 = 65; SET @a1 = @a1 + 1; - + IF @a1 > 90 THEN - + SET @a1 = 65; - + END IF; - + END IF; - + END IF; SET newShelving = CHAR(@a1,@a2,@a3 USING utf8); - + INSERT INTO vn.shelving(code) VALUES(newShelving); END ;; @@ -60901,8 +61767,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `observationAdd` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -60910,6 +61774,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `observationAdd`(vOriginFk INT, vTableCode VARCHAR(45), vDescription TEXT) BEGIN @@ -60921,18 +61787,18 @@ BEGIN * @param descripcion Texto de la observacion */ DECLARE vTableName VARCHAR(45); - + SET vTableName = CONCAT(vTableCode,'Observation'); - + IF ISNULL(vTableName) THEN CALL util.throw('CODE_NOT_FOUND'); END IF; - + SET @qryLog := CONCAT( 'INSERT INTO ', vTableName, ' (originFk, userFk, description)', ' VALUES (', vOriginFk, ', ', account.myUser_getId(), ', "', vDescription, '")' ); - + PREPARE stmt FROM @qryLog; EXECUTE stmt; DEALLOCATE PREPARE stmt; @@ -60942,8 +61808,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `orderCreate` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -60951,6 +61815,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `orderCreate`( vLanded DATE, @@ -60962,15 +61828,15 @@ BEGIN DECLARE vDeliveryMethod INT; DECLARE vClient INT; - + SELECT deliveryMethodFk INTO vDeliveryMethod - FROM vn.agencyMode + FROM vn.agencyMode WHERE id = vAgencyMode; - + SELECT clientFk INTO vClient FROM vn.address WHERE id = vAddress; - + INSERT INTO hedera.order(date_send,customer_id,delivery_method_id,agency_id,address_id,source_app) VALUES( vLanded,vClient ,vDeliveryMethod,vAgencyMode ,vAddress ,vSourceApp); @@ -60982,8 +61848,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `orderDelete` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -60991,20 +61855,20 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `orderDelete`(IN vId INT) BEGIN DELETE FROM hedera.`order` where id = vId; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `orderListCreate` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -61012,6 +61876,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `orderListCreate`( vLanded DATE, @@ -61023,15 +61889,13 @@ BEGIN DECLARE vOrderId INT; CALL vn.orderCreate(vLanded,vAgencyMode,vAddress,vSourceApp,vOrderId); SELECT vOrderId; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `orderListVolume` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -61039,11 +61903,13 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `orderListVolume`(IN vOrderId INT) BEGIN - SELECT + SELECT o.id, o.itemFk, i.description, @@ -61059,8 +61925,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `packageInvoicing` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -61068,8 +61932,10 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; -CREATE DEFINER=`root`@`localhost` PROCEDURE `packageInvoicing`( +CREATE DEFINER=`root`@`localhost` PROCEDURE `packageInvoicing`( IN vClient INT, IN vDate DATE, IN vCompany INT, @@ -61088,20 +61954,20 @@ BEGIN SET vGraceDays = IF(vIsAllInvoiceable ,0, 30); SET vGraceDate = TIMESTAMPADD(DAY, - vGraceDays, vDate); - - /* Clientes especiales: + + /* Clientes especiales: 3240 MADEFLOR 992 JAVIER FELIU 4 TONI VENDRELL */ - + IF vClient IN (992, 3240, 4) THEN - + SET vGraceDays = 365; - + END IF; /* Fin clientes especiales */ - + SET vDateEnd = DATE_ADD(vDate, INTERVAL 1 DAY); DROP TEMPORARY TABLE IF EXISTS tmp.packageToInvoice; @@ -61125,22 +61991,22 @@ BEGIN FROM tmp.packageToInvoice GROUP BY itemFk HAVING totalQuantity > 0; - + SELECT COUNT(*) INTO vIsInvoiceable FROM tmp.packageToInvoicePositives; IF vIsInvoiceable THEN - CALL ticket_add(vClient, + CALL ticket_add(vClient, vDateEnd, - vWarehouse, - vCompany, - NULL, - NULL, - NULL, - vDateEnd, - account.myUser_getId(), + vWarehouse, + vCompany, + NULL, + NULL, + NULL, + vDateEnd, + account.myUser_getId(), TRUE, vNewTicket); @@ -61149,52 +62015,50 @@ BEGIN packagingFk, quantity, pvp) - SELECT vNewTicket, - pti.packagingFk, - - SUM(pti.quantity) AS totalQuantity, + SELECT vNewTicket, + pti.packagingFk, + - SUM(pti.quantity) AS totalQuantity, pti.price FROM tmp.packageToInvoice pti - LEFT JOIN tmp.packageToInvoicePositives ptip ON pti.itemFk = ptip.itemFk - WHERE ptip.itemFK IS NOT NULL + LEFT JOIN tmp.packageToInvoicePositives ptip ON pti.itemFk = ptip.itemFk + WHERE ptip.itemFK IS NOT NULL OR vIsAllInvoiceable GROUP BY packagingFk HAVING totalQuantity; INSERT INTO sale( ticketFk, - itemFk, - concept, - quantity, + itemFk, + concept, + quantity, price ) - SELECT vNewTicket, - pti.itemFk, - i.name as concept, - sum(pti.quantity) as totalQuantity, + SELECT vNewTicket, + pti.itemFk, + i.name as concept, + sum(pti.quantity) as totalQuantity, pti.price FROM tmp.packageToInvoice pti JOIN item i ON i.id = pti.itemFk LEFT JOIN tmp.packageToInvoicePositives ptip ON pti.itemFk = ptip.itemFk - WHERE ptip.itemFK IS NOT NULL + WHERE ptip.itemFK IS NOT NULL OR vIsAllInvoiceable GROUP BY pti.itemFk HAVING totalQuantity; - + INSERT INTO saleComponent(saleFk, componentFk, value) SELECT id, vComponentCost, price FROM sale WHERE ticketFk = vNewTicket; - + END IF; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `packingListPrinted` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -61202,6 +62066,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `packingListPrinted`(ticketFk INT) BEGIN @@ -61212,15 +62078,13 @@ BEGIN WHERE mm.valor = 1 -- Listo para imprimir AND mm.stateFk = 9 -- Encajando AND m.Id_Ticket = ticketFk; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `packingListSwitch` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -61228,21 +62092,23 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `packingListSwitch`(saleFk INT) BEGIN DECLARE valueFk INT; DECLARE encajando INT DEFAULT 9; - - SELECT valor INTO valueFk - FROM vn2008.Movimientos_mark - WHERE Id_Movimiento = saleFk + + SELECT valor INTO valueFk + FROM vn2008.Movimientos_mark + WHERE Id_Movimiento = saleFk AND stateFk = encajando; - + SET valueFk = (IFNULL(valueFk,0) + 1) MOD 3; - - REPLACE vn2008.Movimientos_mark(Id_Movimiento, valor, Id_Trabajador, stateFk) + + REPLACE vn2008.Movimientos_mark(Id_Movimiento, valor, Id_Trabajador, stateFk) VALUES(saleFk,valueFk,account.myUser_getId(),encajando); @@ -61252,8 +62118,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `packingSite_startCollection` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -61261,6 +62125,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `packingSite_startCollection`(vSelf INT, vTicketFk INT) BEGIN @@ -61298,8 +62164,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `parking_add` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -61307,6 +62171,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `parking_add`(vFromColumn INT, vToColumn INT, vFromRow INT, vToRow INT, vSectorFk INT, vIsLetterMode BOOLEAN) BEGIN @@ -61316,34 +62182,34 @@ BEGIN DECLARE vLetters VARCHAR(26) DEFAULT 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; DECLARE vMaxId INT; DECLARE vCode VARCHAR(8); - + SET vColumn = vFromColumn; SET vRow = vFromRow; SET vCode = CONCAT(LPAD(vColumn,3,'0'),'-',IF(vIsLetterMode, MID(vLetters, vRow, 1), LPAD(vRow, 2,'0'))); - + SELECT MAX(id) INTO vMaxId FROM vn.parking; WHILE vColumn <= vToColumn DO - + WHILE vRow <= vToRow DO - + INSERT IGNORE INTO vn.parking(`column`, `row`, sectorFk, `code`, pickingOrder) VALUES (vColumn, vRow, vSectorFk, vCode, vColumn * 100 + vRow ) ON DUPLICATE KEY UPDATE `code` = vCode; - + SET vRow = vRow + 1; SET vCode = CONCAT(LPAD(vColumn,3,'0'),'-',IF(vIsLetterMode, MID(vLetters, vRow, 1), LPAD(vRow, 2,'0'))); - + END WHILE; - + SET vRow = vFromRow; SET vColumn = vColumn + 1; - + SET vCode = CONCAT(LPAD(vColumn,3,'0'),'-',IF(vIsLetterMode, MID(vLetters, vRow, 1), LPAD(vRow, 2,'0'))); - + END WHILE; - + SELECT * FROM vn.parking WHERE `column` BETWEEN vFromColumn AND vToColumn; END ;; @@ -61352,8 +62218,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `parking_algemesi` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -61361,6 +62225,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `parking_algemesi`(vFromRow INT, vToRow INT, vSectorFk INT, vLetter VARCHAR(1), vPickingOrder INT, vTrolleysByLine INT) BEGIN @@ -61368,67 +62234,65 @@ BEGIN DECLARE vRow INT; DECLARE vCode VARCHAR(8); DECLARE i INT; - + IF vToRow < vFromRow THEN - + SET vRow = vFromRow; - + WHILE vRow >= vToRow DO - + SET i = 1; - + WHILE i <= vTrolleysByLine DO - + SET vCode = CONCAT(vLetter,'-', LPAD(vRow,2,'0'),'-', i); - + INSERT IGNORE INTO vn.parking( sectorFk, `code`, pickingOrder) VALUES (vSectorFk, vCode, vPickingOrder + (i * 10)) ON DUPLICATE KEY UPDATE `code` = vCode; - + SET i = i + 1; - + END WHILE; - + SET vRow = vRow - 1; - + END WHILE; ELSE - + SET vRow = vFromRow; - + WHILE vRow <= vToRow DO - + SET i = 1; - + WHILE i <= vTrolleysByLine DO - + SET vCode = CONCAT(vLetter,'-', LPAD(vRow,2,'0'),'-', i); - + INSERT IGNORE INTO vn.parking( sectorFk, `code`, pickingOrder) VALUES (vSectorFk, vCode, vPickingOrder + (i * 10) ) ON DUPLICATE KEY UPDATE `code` = vCode; - + SET i = i + 1; - + END WHILE; - + SET vRow = vRow + 1; - + END WHILE; - - + + END IF; - - + + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `parking_new` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -61436,6 +62300,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `parking_new`(vStart INT, vEnd INT, vSectorFk INT) BEGIN @@ -61444,36 +62310,34 @@ BEGIN DECLARE vColumn INT; DECLARE vLetters VARCHAR(200); DECLARE vLettersLength INT; - + SET vColumn = vStart; SET vRow = 1; SET vLetters = 'ABCDEF'; SET vLettersLength = LENGTH(vLetters); - + WHILE vColumn <= vEnd DO - + REPLACE vn.parking(`column`, `row`, `code`, sectorFk) VALUES(vColumn, vRow, CONCAT(vColumn,MID(vLetters,vRow,1)), vSectorFk); - + SET vRow = vRow + 1; - + IF vRow > vLettersLength THEN - + SET vRow = 1; SET vColumn = vColumn + 1; - + END IF; - + END WHILE; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `parking_setOrder` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -61481,14 +62345,16 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `parking_setOrder`(vWarehouseFk INT) BEGIN - + /* * Ordena el orden de preparacion de los parking de acuerdo con la tabla vn.corridor */ - + UPDATE vn.parking p JOIN ( SELECT code, @@ -61497,23 +62363,21 @@ BEGIN SELECT c.prepOrder, p.code, @orden := 0, - IF(c.isAscendent, 1,-1) * CAST(SUBSTRING(p.code,3,2) AS DECIMAL(2,0)) subCorridor , - CAST(IF(LENGTH(p.code) > 5, SUBSTRING(p.code,6,2), 0) AS DECIMAL(2,0)) ubication + IF(c.isAscendent, 1,-1) * CAST(SUBSTRING(p.code,3,2) AS DECIMAL(2,0)) subCorridor , + CAST(IF(LENGTH(p.code) > 5, SUBSTRING(p.code,6,2), 0) AS DECIMAL(2,0)) ubication FROM vn.parking p - JOIN vn.sector s ON s.id = p.sectorFk + JOIN vn.sector s ON s.id = p.sectorFk JOIN vn.corridor c ON c.code = LEFT(p.code,1) COLLATE utf8_general_ci - WHERE s.warehouseFk = vWarehouseFk) sub - ORDER BY sub.prepOrder, subCorridor, ubication) sub2 ON sub2.code = p.code + WHERE s.warehouseFk = vWarehouseFk) sub + ORDER BY sub.prepOrder, subCorridor, ubication) sub2 ON sub2.code = p.code SET p.pickingOrder = sub2.po; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `prepareClientList` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -61521,28 +62385,28 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `prepareClientList`() BEGIN - + /* * Require la tabla tmp.ticket(id,clientFk) */ - + DROP TEMPORARY TABLE IF EXISTS tmp.client; CREATE TEMPORARY TABLE tmp.client (PRIMARY KEY (id)) ENGINE = MEMORY SELECT DISTINCT clientFk id - FROM tmp.ticket; + FROM tmp.ticket; END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `prepareTicketList` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -61550,11 +62414,13 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `prepareTicketList`(vStartingDate DATETIME, vEndingDate DATETIME) BEGIN - - DROP TEMPORARY TABLE IF EXISTS tmp.productionTicket; + + DROP TEMPORARY TABLE IF EXISTS tmp.productionTicket; CREATE TEMPORARY TABLE tmp.productionTicket (PRIMARY KEY (ticketFk)) ENGINE = MEMORY @@ -61577,8 +62443,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `previousSticker_get` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -61586,6 +62450,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `previousSticker_get`(vSaleGroupFk INT) BEGIN @@ -61648,8 +62514,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `printer_checkSector` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -61657,20 +62521,22 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `printer_checkSector`(vLabelerFk tinyint(3) unsigned, vSector INT(11)) BEGIN /** * Comprueba si la impresora pertenece al sector * - * @param vLabelerFk id de la impresora + * @param vLabelerFk id de la impresora * @param vSector sector a comprobar */ DECLARE isPrinterInNewSector BOOL; IF vLabelerFk IS NOT NULL THEN SELECT COUNT(sectorFK) INTO isPrinterInNewSector - FROM vn.printer p + FROM vn.printer p WHERE id = vLabelerFk AND sectorFk = vSector; IF !isPrinterInNewSector THEN @@ -61683,8 +62549,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `productionControl` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -61692,6 +62556,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `productionControl`(vWarehouseFk INT, vScopeDays INT) proc: BEGIN @@ -61919,8 +62785,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `productionSectorList` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -61928,6 +62792,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `productionSectorList`(vSectorFk INT) BEGIN @@ -62040,8 +62906,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `rangeDateInfo` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -62049,6 +62913,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `rangeDateInfo`(vStarted DATE, vEnded DATE) BEGIN @@ -62071,7 +62937,7 @@ BEGIN `yearMonth` INT ) ENGINE = MEMORY; - + WHILE vDated <= vEnded DO INSERT INTO tmp.rangeDate SET `dated` = vDated, @@ -62081,7 +62947,7 @@ BEGIN `day` = DAY(vDated), `week` = WEEK(vDated, 1), `yearMonth` = YEAR(vDated) * 100 + MONTH(vDated); - + SET vDated = DATE_ADD(vDated, INTERVAL 1 DAY); END WHILE; END ;; @@ -62090,89 +62956,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; -/*!50003 DROP PROCEDURE IF EXISTS `rankingTeamByQuarter` */; -/*!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 = utf8mb4 */ ; -/*!50003 SET character_set_results = utf8mb4 */ ; -/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; -DELIMITER ;; -CREATE DEFINER=`root`@`localhost` PROCEDURE `rankingTeamByQuarter`(vYear INT, vQuarter INT) -BEGIN - - DECLARE vMinimumSalesByQuarter INT; - - SELECT minimumSalesByQuarter INTO vMinimumSalesByQuarter - FROM commissionConfig; - - DROP TEMPORARY TABLE IF EXISTS tmp.rankingTeam; - CREATE TEMPORARY TABLE tmp.rankingTeam - (PRIMARY KEY(departmentFk)) ENGINE = MEMORY - SELECT - (sub1.importe - sub2.importe) / IF ((sub1.importe - sub2.importe) > 0,sub3.countPeople,1) AS diferencia, - CONCAT(sub1.name, - '(', - sub1.peopleMinSale, - '/', - sub3.countPeople, - ')') AS teamPeople, - sub1.departmentFk AS departmentFk - FROM - (((SELECT - SUM(sub.importe) AS importe, - sub.name AS name, - sub.año AS año, - sub.departmentFk AS departmentFk, - COUNT(*) peopleMinSale - FROM - (SELECT - SUM(v.portfolioWeight) AS importe, - d.`name`, - v.año, - wd.departmentFk - FROM (((bs.vendedores v - JOIN `account`.`user` u ON (u.id = v.Id_Trabajador)) - JOIN vn.workerDepartment wd ON (wd.workerFk = u.id)) - JOIN vn.department d ON (d.id = wd.departmentFk)) - WHERE v.año = vYear - AND d.name LIKE 'EQUIPO%' - AND CEIL(v.mes / 3) = vQuarter - GROUP BY v.Id_Trabajador - HAVING importe >= vMinimumSalesByQuarter) sub - GROUP BY sub.departmentFk) sub1 - JOIN (SELECT - SUM(v.portfolioWeight) AS importe, - d.name, - wd.departmentFk - FROM (((bs.vendedores v - JOIN account.user u ON (u.id = v.Id_Trabajador)) - JOIN vn.workerDepartment wd ON (wd.workerFk = u.id)) - JOIN vn.department d ON (d.id = wd.departmentFk)) - WHERE v.año = vYear - 1 - AND d.name LIKE 'EQUIPO%' - AND CEIL(v.mes / 3) = vQuarter - GROUP BY wd.departmentFk - ORDER BY SUM(v.importe) DESC LIMIT 10000000000000000000) sub2 ON (sub1.name = sub2.name)) - JOIN (SELECT COUNT(0) AS countPeople, - wd.departmentFk AS departmentFk - FROM - (vn.salesPersonSince sps - JOIN vn.workerDepartment wd ON (sps.workerFk = wd.workerFk)) - WHERE - CONCAT(YEAR(sps.started), QUARTER(sps.started)) <= CONCAT(vYear - 1, vQuarter) - GROUP BY wd.departmentFk) sub3 ON (sub3.departmentFk = sub1.departmentFk)) - ORDER BY (sub1.importe - sub2.importe) / sub3.countPeople DESC; -END ;; -DELIMITER ; -/*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `rate_getPrices` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -62180,6 +62963,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `rate_getPrices`(vDated DATE, vWarehouseFk INT) BEGIN @@ -62189,7 +62974,7 @@ BEGIN * @param vDated fecha para la cual calcula la tarifa * @param vWarehouseFk warehouse para el cual calcula la tafia * @return tmp.rate(rate0, rate1, rate2, rate3) - */ + */ DROP TEMPORARY TABLE IF EXISTS tRate; CREATE TEMPORARY TABLE tRate SELECT rate0, rate1, rate2, rate3 @@ -62197,13 +62982,13 @@ BEGIN WHERE dated <= vDated AND warehouseFk = vWarehouseFk ORDER BY dated DESC; - + DROP TEMPORARY TABLE IF EXISTS tmp.rate; CREATE TEMPORARY TABLE tmp.rate ENGINE = MEMORY SELECT * FROM ( - SELECT * FROM tRate + SELECT * FROM tRate UNION ALL SELECT rate0, rate1, rate2, rate3 FROM rateConfig ) sub2 @@ -62215,8 +63000,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `rate_getPrices2` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -62224,6 +63007,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `rate_getPrices2`(vLanded DATE, vWarehouseFk INT) BEGIN @@ -62236,13 +63021,13 @@ BEGIN WHERE dated <= vLanded AND warehouseFk = vWarehouseFk ORDER BY dated DESC; - + DROP TEMPORARY TABLE IF EXISTS tmp.rate; CREATE TEMPORARY TABLE tmp.rate ENGINE = MEMORY SELECT * FROM ( - SELECT * FROM tRate + SELECT * FROM tRate UNION ALL SELECT rate0, rate1, rate2, rate3 FROM rateConfig ) sub2 @@ -62254,8 +63039,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `recipe_Cook` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -62263,6 +63046,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `recipe_Cook`(vItemFk INT, vBunchesQuantity INT, vDate DATE) BEGIN @@ -62276,7 +63061,7 @@ BEGIN CALL cache.available_refresh(vCalc, FALSE, vWarehouseFk, vDate); DROP TEMPORARY TABLE IF EXISTS tmp.recipeCook; - + CREATE TEMPORARY TABLE tmp.recipeCook SELECT *, @counter := IF(@element = element COLLATE utf8_general_ci , @counter + 1, 1) as counter, @@ -62294,22 +63079,22 @@ BEGIN IFNULL((i.inkFk = r.inkFk ) ,0) + IFNULL((i.size = r.size) ,0) + IFNULL((i.name LIKE CONCAT('%',r.name,'%')) ,0) - + IFNULL((i.longName LIKE CONCAT('%',r.longName,'%')),0) + + IFNULL((i.longName LIKE CONCAT('%',r.longName,'%')),0) + IFNULL((i.typeFk = r.typeFk),0) as matches, i.typeFk, rl.previousSelected - FROM vn.recipe r + FROM vn.recipe r JOIN vn.item i ON (IFNULL(i.name LIKE CONCAT('%',r.name,'%'), 0) OR IFNULL(i.longName LIKE CONCAT('%',r.longName,'%'),0)) OR i.typeFk <=> r.typeFk JOIN cache.available a ON a.item_id = i.id AND a.calc_id = vCalc LEFT JOIN (SELECT recipe_ItemFk, element as log_element, selected_ItemFk, count(*) as previousSelected FROM vn.recipe_log - GROUP BY recipe_ItemFk, element, selected_ItemFk) rl ON rl.recipe_ItemFk = r.itemFk + GROUP BY recipe_ItemFk, element, selected_ItemFk) rl ON rl.recipe_ItemFk = r.itemFk AND rl.log_element = r.element AND rl.selected_ItemFk = i.id WHERE r.itemFk = vItemFk - AND a.available > vBunchesQuantity * r.quantity + AND a.available > vBunchesQuantity * r.quantity UNION ALL SELECT 100 itemFk, CONCAT('? ',r.element,' ',IFNULL(r.size,''),' ',IFNULL(r.inkFk,'')) as longName, @@ -62326,23 +63111,21 @@ BEGIN WHERE r.itemFk = vItemFk GROUP BY r.element ) sub - + ORDER BY element, matches DESC, previousSelected DESC; - - SELECT * + + SELECT * FROM tmp.recipeCook WHERE counter < 6 - OR itemFk = 100 + OR itemFk = 100 ; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `recipe_Plaster` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -62350,6 +63133,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `recipe_Plaster`(vItemFk INT, vTicketFk INT, vQuantity INT) BEGIN @@ -62359,71 +63144,71 @@ BEGIN DECLARE vShipped DATE; DECLARE vEntryFk INT; DECLARE vTravelFk INT; - + CALL cache.last_buy_refresh(FALSE); - - SELECT warehouseFk, shipped + + SELECT warehouseFk, shipped INTO vWarehouseFk, vShipped - FROM vn.ticket + FROM vn.ticket WHERE id = vTicketFk; UPDATE vn.ticket t JOIN vn.item i ON i.id = vItemFk SET t.nickname = CONCAT(vQuantity,' ',i.longName) WHERE t.id = vTicketFk; - + SELECT b.buyingValue INTO vLastCost FROM vn.buy b JOIN cache.last_buy lb ON lb.buy_id = b.id WHERE lb.item_id = vItemFk ORDER BY (lb.warehouse_id = vWarehouseFk) DESC LIMIT 1; - + INSERT INTO vn.sale(ticketFk, itemFk, quantity, concept, price) SELECT vTicketFk, 98, - vQuantity, i.longName, vLastCost FROM vn.item i WHERE i.id = vItemFk; - /* + /* SELECT tr.id INTO vTravelFk FROM vn.travel tr JOIN vn.warehouse w ON w.id = tr.warehouseOutFk WHERE tr.warehouseInFk = vWarehouseFk AND tr.landed = vShipped AND w.name = 'Confeccion'; - + IF IFNULL(vTravelFk,0) = 0 THEN - + INSERT INTO vn.travel(shipped, landed, warehouseInFk, warehouseOutFk, agencyFk) SELECT vShipped, vShipped, vWarehouseFk, w.id, am.id - FROM vn.warehouse w - JOIN vn.agencyMode am + FROM vn.warehouse w + JOIN vn.agencyMode am WHERE w.name = 'Confeccion' AND am.name = 'DIRECTO PROVEEDOR'; - + SET vTravelFk = LAST_INSERT_ID(); - - END IF; - + + END IF; + SELECT e.id INTO vEntryFk FROM vn.entry e JOIN vn.supplier s ON s.id = supplierFk WHERE e.travelFk = vTravelFk AND s.name = 'Confeccion Natural' AND e.isRaid = FALSE; - + IF IFNULL(vEntryFk,0) = 0 THEN - + INSERT INTO vn.entry(supplierFk, evaNotes, travelFk, companyFk) SELECT s.id, t.nickname, vTravelFk, c.id FROM vn.supplier s JOIN vn.ticket t ON t.id = vTicketFk - JOIN vn.company c ON c.code = 'VNL' + JOIN vn.company c ON c.code = 'VNL' WHERE s.name = 'Confeccion Natural'; - + SET vEntryFk = LAST_INSERT_ID(); - + END IF; - + INSERT INTO vn.buy(entryFk, itemFk, quantity, buyingValue, packageFk, packing, grouping) SELECT vEntryFk, b.itemFk, vQuantity, b.buyingValue, b.packageFk, b.packing, b.grouping FROM cache.last_buy lb @@ -62438,8 +63223,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `refund` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -62447,10 +63230,12 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb3 */ ; /*!50003 SET character_set_results = utf8mb3 */ ; /*!50003 SET collation_connection = utf8mb3_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `refund`(IN vOriginTicket INT, OUT vNewTicket INT) BEGIN - + DECLARE vDone BIT DEFAULT 0; DECLARE vCustomer MEDIUMINT; DECLARE vWarehouse TINYINT; @@ -62465,26 +63250,26 @@ BEGIN DECLARE vSaleNew INT; DECLARE vSaleMain INT; DECLARE vZoneFk INT; - + DECLARE vRsMainTicket CURSOR FOR SELECT id, itemFk, - quantity, concept, price, discount - FROM vn.sale + FROM vn.sale WHERE ticketFk = vOriginTicket; - + DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = 1; - + SELECT id INTO vRefundAgencyMode FROM agencyMode WHERE `name` = 'ABONO'; - SELECT clientFk, warehouseFk, companyFk, addressFk + SELECT clientFk, warehouseFk, companyFk, addressFk INTO vCustomer, vWarehouse, vCompany, vAddress - FROM ticket + FROM ticket WHERE id = vOriginTicket; - - SELECT id INTO vZoneFk + + SELECT id INTO vZoneFk FROM zone WHERE agencyModeFk = vRefundAgencyMode LIMIT 1; - + INSERT INTO vn2008.Tickets ( Id_Cliente, Fecha, @@ -62511,26 +63296,26 @@ BEGIN SET vNewTicket = LAST_INSERT_ID(); - SET vDone := 0; + SET vDone := 0; OPEN vRsMainTicket ; FETCH vRsMainTicket INTO vSaleMain, vItemFk, vQuantity, vConcept, vPrice, vDiscount; WHILE NOT vDone DO - + INSERT INTO vn.sale(ticketFk, itemFk, quantity, concept, price, discount) VALUES( vNewTicket, vItemFk, vQuantity, vConcept, vPrice, vDiscount ); - + SET vSaleNew = LAST_INSERT_ID(); - - INSERT INTO vn.saleComponent(saleFk,componentFk,`value`) - SELECT vSaleNew,componentFk,`value` - FROM vn.saleComponent + + INSERT INTO vn.saleComponent(saleFk,componentFk,`value`) + SELECT vSaleNew,componentFk,`value` + FROM vn.saleComponent WHERE saleFk = vSaleMain; - + FETCH vRsMainTicket INTO vSaleMain, vItemFk, vQuantity, vConcept, vPrice, vDiscount; - + END WHILE; - CLOSE vRsMainTicket; + CLOSE vRsMainTicket; END ;; DELIMITER ; @@ -62538,8 +63323,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `replaceMovimientosMark` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -62547,6 +63330,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `replaceMovimientosMark`( idMovimiento INT, @@ -62565,20 +63350,18 @@ BEGIN * usar vn.saleTracking_Replace * */ - - REPLACE INTO vn2008.Movimientos_mark(Id_Movimiento, valor, original_quantity, Id_Trabajador, stateFk) + + REPLACE INTO vn2008.Movimientos_mark(Id_Movimiento, valor, original_quantity, Id_Trabajador, stateFk) VALUES(idMovimiento,detalle,originalQuantity,idTrabajador,stateFk); - /*INSERT INTO vn.ticketLog (originFk, userFk, action , description) + /*INSERT INTO vn.ticketLog (originFk, userFk, action , description) VALUES(originFk, userFk, actionString, description);*/ - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `reportLabelCollection_get` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -62586,13 +63369,19 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; -CREATE DEFINER=`root`@`localhost` PROCEDURE `reportLabelCollection_get`(vParam INT) +CREATE DEFINER=`root`@`localhost` PROCEDURE `reportLabelCollection_get`( + vParam INT, + vLabelCount INT +) BEGIN /** - * Obtiene los datos de etiquetas a partir de de un ticket o colección. + * Obtains tag data from a ticket or collection. * - * @param vParam Ticket/Colección del que sacar los datos + * @param vParam Ticket/Collection from which data is to be taken. + * @param vLabelCount number of times the collection has been printed. */ DECLARE vIsCollection BOOL; @@ -62602,23 +63391,23 @@ BEGIN SELECT c.itemPackingTypeFk, CONCAT(tc.collectionFk, ' ', LEFT(cc.code, 4)) color, - CONCAT(tc.collectionFk, ' ', SUBSTRING('ABCDEFGH',tc.wagon, 1), '-', tc.`level`) levelV, + CONCAT(tc.collectionFk, ' ', SUBSTRING('ABCDEFGH',tc.wagon, 1), '-', tc.level) levelV, tc.ticketFk, LEFT(COALESCE(et.description, zo.name, am.name),12) agencyDescription, am.name, t.clientFk, CONCAT(CAST(SUM(sv.volume) AS DECIMAL(5, 2)), 'm³') m3 , - CAST(IF(ic.code = 'plant', CONCAT(MAX(i.`size`),' cm'), COUNT(*)) AS CHAR) size, + CAST(IF(ic.code = 'plant', CONCAT(MAX(i.size), ' cm'), COUNT(*)) AS CHAR) size, w.code workerCode, - tt.labelCount, - IF(HOUR(t.shipped), TIME(t.shipped), TIME(zo.`hour`)) agencyHour, + IF(vLabelCount IS NULL, tt.labelCount, vLabelCount) labelCount, + IF(HOUR(t.shipped), TIME(t.shipped), TIME(zo.hour)) agencyHour, t.shipped, COUNT(*) lineCount, t.nickName FROM ticket t JOIN ticketCollection tc ON tc.ticketFk = t.id JOIN collection c ON c.id = tc.collectionFk - LEFT JOIN collectionColors cc ON cc.shelve = tc.`level` + LEFT JOIN collectionColors cc ON cc.shelve = tc.level AND cc.wagon = tc.wagon AND cc.trainFk = c.trainFk JOIN sale s ON s.ticketFk = t.id @@ -62629,20 +63418,18 @@ BEGIN JOIN worker w ON w.id = c.workerFk JOIN agencyMode am ON am.id = t.agencyModeFk LEFT JOIN ticketTrolley tt ON tt.ticket = t.id - LEFT JOIN `zone` zo ON t.zoneFk = zo.id + LEFT JOIN zone zo ON t.zoneFk = zo.id LEFT JOIN routesMonitor rm ON rm.routeFk = t.routeFk LEFT JOIN expeditionTruck et ON et.id = rm.expeditionTruckFk WHERE IF(vIsCollection, tc.collectionFk = vParam, tc.ticketFk = vParam) GROUP BY t.id - ORDER BY cc.`code`; + ORDER BY cc.code; END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `report_print` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -62650,6 +63437,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `report_print`( vReportName VARCHAR(100), @@ -62660,13 +63449,13 @@ CREATE DEFINER=`root`@`localhost` PROCEDURE `report_print`( ) BEGIN /** - * Inserts in the print queue the report to be printed and the necessary parameters for this + * Inserts in the print queue the report to be printed and the necessary parameters for this * one taking into account the paper size of both the printer and the report. * * @param vReportName the report to be printed. * @param vPrinterFk the printer selected. * @param vUserFk user id. - * @param vParams Json with report parameters. + * @param vParams JSON with report parameters. * @param vPriorityName the printing priority. */ DECLARE vI INT DEFAULT 0; @@ -62675,33 +63464,48 @@ BEGIN DECLARE vKey VARCHAR(255); DECLARE vVal VARCHAR(255); DECLARE vPrintQueueFk INT; - DECLARE vIsTheReportReal INT; DECLARE vReportSize VARCHAR(255); DECLARE vIsThePrinterReal INT; DECLARE vPrinteSize VARCHAR(255); + DECLARE vPriorityFk INT; + DECLARE vReportFk INT; + DECLARE EXIT HANDLER FOR SQLEXCEPTION + BEGIN + ROLLBACK; + RESIGNAL; + END; - SELECT id, paperSizeFk INTO vIsTheReportReal, vReportSize FROM report WHERE name = vReportName; - SELECT id, paperSizeFk INTO vIsThePrinterReal, vPrinteSize FROM printer WHERE id = vPrinterFk; + SELECT id, paperSizeFk INTO vReportFk, vReportSize + FROM report + WHERE name = vReportName; + + SELECT id, paperSizeFk INTO vIsThePrinterReal, vPrinteSize + FROM printer + WHERE id = vPrinterFk; + + SELECT id INTO vPriorityFk + FROM queuePriority + WHERE code = vPriorityName; IF vIsThePrinterReal IS NULL THEN CALL util.throw('printerNotExists'); END IF; - IF vIsTheReportReal IS NULL THEN - CALL util.throw('reportNotExists'); + IF vReportFk IS NULL THEN + CALL util.throw('reportNotExists'); END IF; IF vReportSize <> vPrinteSize THEN - CALL util.throw('incorrectSize'); + CALL util.throw('incorrectSize'); END IF; START TRANSACTION; INSERT INTO printQueue SET printerFk = vPrinterFk, - priorityFk = (SELECT qp.id FROM queuePriority qp WHERE qp.code = vPriorityName), - reportFk = (SELECT r.id FROM report r WHERE r.name = vReportName), + priorityFk = vPriorityFk, + reportFk = vReportFk, workerFk = vUserFk; - + SET vPrintQueueFk = LAST_INSERT_ID(); WHILE vI < vLength DO @@ -62722,8 +63526,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `riskAllClients` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -62731,19 +63533,21 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `riskAllClients`(maxRiskDate DATE) BEGIN - + DROP TEMPORARY TABLE IF EXISTS tmp.client_list; CREATE TEMPORARY TABLE tmp.client_list (PRIMARY KEY (Id_Cliente)) ENGINE = MEMORY SELECT id Id_Cliente, null grade FROM vn.client; - + CALL vn2008.risk_vs_client_list(maxRiskDate); - - SELECT + + SELECT c.RazonSocial, c.Id_Cliente, c.Credito, @@ -62755,7 +63559,7 @@ BEGIN JOIN tmp.risk r ON r.Id_Cliente = c.Id_Cliente JOIN tmp.client_list ci ON c.Id_Cliente = ci.Id_Cliente GROUP BY c.Id_cliente; - + DROP TEMPORARY TABLE IF EXISTS tmp.risk; DROP TEMPORARY TABLE IF EXISTS tmp.client_list; END ;; @@ -62764,8 +63568,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `routeGuessPriority` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -62773,6 +63575,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `routeGuessPriority`(IN vRuta INT) BEGIN @@ -62797,8 +63601,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `routeInfo` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -62806,6 +63608,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `routeInfo`(vRouteFk INT) BEGIN @@ -62814,25 +63618,25 @@ BEGIN DECLARE vM3 INT; DECLARE vKg INT; DECLARE vMatricula varchar(50); - + SELECT sum(packages) as bultos INTO vPackages - FROM vn.ticket t + FROM vn.ticket t WHERE routeFk = vRouteFk; - + SELECT SUM(sv.physicalVolume), SUM(sv.physicalWeight) INTO vM3, vKg FROM vn.saleVolume sv WHERE sv.routeFk = vRouteFk; - + SELECT v.numberPlate as matricula INTO vMatricula - FROM vn.route r + FROM vn.route r JOIN vn.vehicle v ON r.vehicleFk = v.id WHERE r.id = vRouteFk; - + SELECT vRouteFk as Ruta, - vPackages as Bultos, + vPackages as Bultos, vM3 as m3, vKg as Kg, vMatricula as Matricula; @@ -62843,8 +63647,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `routeMonitor_calculate` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -62852,6 +63654,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `routeMonitor_calculate`(vDate DATE) BEGIN @@ -62862,12 +63666,12 @@ BEGIN SET vDate = TIMESTAMPADD(DAY,-1,vDate); DROP TEMPORARY TABLE IF EXISTS tmp.routesMonitor; - + CREATE TEMPORARY TABLE tmp.routesMonitor (INDEX (routeFk)) ENGINE = MEMORY SELECT DISTINCT(t.routeFk) routeFk - FROM vn.ticket t + FROM vn.ticket t WHERE t.shipped BETWEEN vDate AND vDateEND AND t.routeFk IS NOT NULL; @@ -62878,7 +63682,7 @@ BEGIN UPDATE routesMonitor rm JOIN route r ON r.id = rm.routeFk JOIN agencyMode a ON a.id = r.agencyModeFk - SET rm.`name` = a.name, + SET rm.`name` = a.name, rm.ticketFree = 0, rm.ticketProduction = 0, rm.ticketPacked = 0, @@ -62895,7 +63699,7 @@ BEGIN ) sub ON sub.routeFk = rm.routeFk SET rm.ticketFree = sub.ticketFree; - UPDATE routesMonitor rm + UPDATE routesMonitor rm JOIN(SELECT t.routeFk, COUNT(*) AS ticketPacked FROM vn.ticket t JOIN tmp.routesMonitor rm ON rm.routeFk = t.routeFk @@ -62903,7 +63707,7 @@ BEGIN JOIN ticketTracking tt ON tt.id = ts.ticketTrackingFk JOIN state s ON s.id = tt.stateFk AND s.alertLevel = 2 GROUP BY t.routeFk - ) sub ON sub.routeFk = rm.routeFk + ) sub ON sub.routeFk = rm.routeFk SET rm.ticketPacked = sub.ticketPacked; UPDATE routesMonitor rm @@ -62930,7 +63734,7 @@ BEGIN JOIN( SELECT t.routeFk, SUM(sv.volume) AS m3 FROM vn.ticket t JOIN tmp.routesMonitor rm ON rm.routeFk = t.routeFk - JOIN vn.saleVolume sv ON sv.ticketFk = t.id + JOIN vn.saleVolume sv ON sv.ticketFk = t.id GROUP BY t.routeFk ) sub ON sub.routeFk = rm.routeFk SET rm.m3 = sub.m3; @@ -62940,15 +63744,15 @@ BEGIN FROM vn.ticket t JOIN tmp.routesMonitor rm ON rm.routeFk = t.routeFk JOIN vn.expedition e ON e.ticketFk = t.id - JOIN vn.packaging pk ON pk.id = e.packagingFk + JOIN vn.packaging pk ON pk.id = e.packagingFk GROUP BY t.routeFk - ) sub ON sub.routeFk = rm.routeFk - SET rm.m3boxes = sub.m3boxes; + ) sub ON sub.routeFk = rm.routeFk + SET rm.m3boxes = sub.m3boxes; UPDATE routesMonitor rm - JOIN vn.expeditionTruck et ON et.id = rm.expeditionTruckFk + JOIN vn.expeditionTruck et ON et.id = rm.expeditionTruckFk SET rm.etd = et.ETD; - + DROP TEMPORARY TABLE tmp.routesMonitor; END ;; DELIMITER ; @@ -62956,8 +63760,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `routeSetOk` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -62965,23 +63767,23 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `routeSetOk`( vRouteFk INT) BEGIN - + UPDATE vn.route r SET r.isOk = 1 WHERE r.id = vRouteFk; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `routeUpdateM3` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -62989,6 +63791,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `routeUpdateM3`(vRoute INT) BEGIN @@ -63002,8 +63806,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `route_calcCommission` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -63011,6 +63813,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `route_calcCommission`(vSelf INT) proc: BEGIN @@ -63038,17 +63842,17 @@ proc: BEGIN IF vIsFreelance THEN INSERT INTO routeCommission ( - routeFk, - workCenterFk, - freelanceYearlyM3, - cat4m3, + routeFk, + workCenterFk, + freelanceYearlyM3, + cat4m3, cat5m3 ) SELECT vSelf, r.commissionWorkCenterFk, rc.freelanceM3 * IF( - IFNULL(r.m3, 0) >= rc.freelanceMinM3, - IFNULL(r.m3, 0), + IFNULL(r.m3, 0) >= rc.freelanceMinM3, + IFNULL(r.m3, 0), 0), rc.distributionCat4M3 * IFNULL(r.m3, 0), rc.distributionCat5M3 * IFNULL(r.m3, 0) @@ -63060,20 +63864,20 @@ proc: BEGIN AND r.commissionWorkCenterFk; ELSE INSERT INTO routeCommission ( - routeFk, - workCenterFk, - km, - m3, - yearlyKm, - yearlyM3, - cat4m3, + routeFk, + workCenterFk, + km, + m3, + yearlyKm, + yearlyM3, + cat4m3, cat5m3 ) SELECT vSelf, r.commissionWorkCenterFk, - (r.kmEnd - r.kmStart) * + (r.kmEnd - r.kmStart) * IF(v.isKmTruckRate, rc.kmHeavy, rc.kmLight), - IFNULL(r.m3, 0) * + IFNULL(r.m3, 0) * IF(v.isKmTruckRate, rc.deliveryM3Cat5, rc.deliveryM3Cat4), (r.kmEnd - r.kmStart) * rc.kmYearly, IFNULL(r.m3, 0) * rc.m3Yearly, @@ -63095,8 +63899,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `route_doRecalc` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -63104,13 +63906,15 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `route_doRecalc`() proc: BEGIN /** * Recalculates modified route. */ - + DECLARE vDone BOOL; DECLARE vRouteFk INT; @@ -63119,7 +63923,7 @@ proc: BEGIN DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE; - + DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN DO RELEASE_LOCK('vn.route_doRecalc'); @@ -63156,8 +63960,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `route_getTickets` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -63165,6 +63967,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `route_getTickets`(vRouteFk INT) BEGIN @@ -63177,40 +63981,40 @@ BEGIN * @select Información de los tickets */ - SELECT - t.id AS Id, - t.clientFk AS Client, - a.id AS Address, - a.nickname AS ClientName, - t.packages AS Packages, - a.street AS AddressName, - a.postalCode AS PostalCode, - a.city AS City, - sub2.itemPackingTypeFk AS PackingType, - c.phone AS ClientPhone, - c.mobile AS ClientMobile, - a.phone AS AddressPhone, - a.mobile AS AddressMobile, - tl.longitude AS Longitude, - tl.latitude AS Latitude, - wm.mediaValue AS SalePersonPhone, - tob.Note AS Note, - t.isSigned AS Signed + SELECT + t.id Id, + t.clientFk Client, + a.id Address, + a.nickname ClientName, + t.packages Packages, + a.street AddressName, + a.postalCode PostalCode, + a.city City, + sub2.itemPackingTypeFk PackingType, + c.phone ClientPhone, + c.mobile ClientMobile, + a.phone AddressPhone, + a.mobile AddressMobile, + d.longitude Longitude, + d.latitude Latitude, + wm.mediaValue SalePersonPhone, + tob.Note Note, + t.isSigned Signed FROM ticket t JOIN client c ON t.clientFk = c.id JOIN address a ON t.addressFk = a.id - LEFT JOIN ticketLocation tl ON tl.ticketFk = t.id + LEFT JOIN delivery d ON d.addressFk = a.id LEFT JOIN workerMedia wm ON wm.workerFk = c.salesPersonFk - LEFT JOIN - (SELECT tob.description AS Note, t.id + LEFT JOIN + (SELECT tob.description Note, t.id FROM ticketObservation tob JOIN ticket t ON tob.ticketFk = t.id JOIN observationType ot ON ot.id = tob.observationTypeFk WHERE t.routeFk = vRouteFk AND ot.code = 'delivery' )tob ON tob.id = t.id - LEFT JOIN - (SELECT sub.ticketFk, + LEFT JOIN + (SELECT sub.ticketFk, CONCAT('(', GROUP_CONCAT(DISTINCT sub.itemPackingTypeFk ORDER BY sub.items DESC SEPARATOR ','), ') ') itemPackingTypeFk FROM (SELECT s.ticketFk , i.itemPackingTypeFk, COUNT(*) items FROM ticket t @@ -63229,8 +64033,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `route_updateM3` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -63238,6 +64040,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `route_updateM3`(vRoute INT) BEGIN @@ -63256,8 +64060,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `rutasAnalyze` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -63265,6 +64067,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `rutasAnalyze`(vYear INT, vMonth INT) BEGIN @@ -63362,7 +64166,7 @@ BEGIN AND rm.año = vYear AND rm.mes = vMonth; - -- Coste PRACTICO de cada bulto, de acuerdo con los componentes de tipo AGENCIA en cada linea de venta + -- Coste PRACTICO de cada bulto, de acuerdo con los componentes de tipo AGENCIA en cada linea de venta UPDATE bi.rutasBoard r JOIN ( SELECT t.routeFk, sum(s.quantity * sc.value) practicoTotal @@ -63374,7 +64178,7 @@ BEGIN JOIN component c ON c.id = sc.componentFk JOIN componentType ct ON ct.id = c.typeFk WHERE ct.type = 'agencia' - AND tm.year = vYear + AND tm.year = vYear AND tm.month = vMonth GROUP BY r.id ) sub ON sub.routeFk = r.Id_Ruta @@ -63383,7 +64187,7 @@ BEGIN -- Coste TEORICO de una caja "virtual" para cada ruta, teniendo en cuenta que hay carros, pallets, etc UPDATE bi.rutasBoard r JOIN ( - SELECT t.routeFk, + SELECT t.routeFk, SUM(t.zonePrice/ ebv.ratio)/ count(*) AS BultoTeoricoMedio FROM ticket t JOIN route r ON r.id = t.routeFk @@ -63393,7 +64197,7 @@ BEGIN JOIN address ad ON ad.id = t.addressFk JOIN client c ON c.id = ad.clientFk LEFT JOIN zone z ON z.id = t.zoneFk - WHERE tm.year = vYear + WHERE tm.year = vYear AND tm.month = vMonth AND z.isVolumetric = FALSE GROUP BY t.routeFk) sub ON r.Id_Ruta = sub.routeFk @@ -63402,7 +64206,7 @@ BEGIN -- Coste VOLUMETRICO TEORICO de una caja "virtual" para cada ruta UPDATE bi.rutasBoard r JOIN ( - SELECT t.routeFk, + SELECT t.routeFk, SUM(freight) AS BultoTeoricoMedio FROM ticket t JOIN route r ON r.id = t.routeFk @@ -63410,7 +64214,7 @@ BEGIN JOIN saleVolume sf ON sf.ticketFk = t.id JOIN client c ON c.id = t.clientFk JOIN zone z ON z.id = t.zoneFk - WHERE tm.year = vYear + WHERE tm.year = vYear AND tm.month = vMonth AND z.isVolumetric != FALSE GROUP BY t.routeFk) sub ON r.Id_Ruta = sub.routeFk @@ -63419,14 +64223,14 @@ BEGIN -- La diferencia entre el teorico y el practico se deberia de cobrar en greuges, cada noche UPDATE bi.rutasBoard r JOIN ( - SELECT t.routeFk, + SELECT t.routeFk, Sum(g.amount) AS greuge FROM ticket t JOIN route r ON r.id = t.routeFk JOIN time tm ON tm.dated = r.created JOIN greuge g ON g.ticketFk = t.id JOIN greugeType gt ON gt.id = g.greugeTypeFk - WHERE tm.year = vYear + WHERE tm.year = vYear AND tm.month = vMonth AND gt.name = 'Diferencia portes' GROUP BY t.routeFk) sub ON r.Id_Ruta = sub.routeFk @@ -63437,8 +64241,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `saleBuy_Add` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -63446,38 +64248,38 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `saleBuy_Add`(vSaleFk INT, vBuyFk INT) BEGIN - + /* Añade un registro a la tabla saleBuy en el caso de que sea posible mantener la trazabilidad - * + * * @param vSaleFk clave primaria de vn.sale * @param vBuyFk clave primaria de vn.buy */ - /*IF (SELECT COUNT(*) + /*IF (SELECT COUNT(*) FROM vn.sale s JOIN vn.item i ON i.id = s.itemFk - JOIN vn.itemType it ON it.id = i.typeFk - JOIN vn.itemCategory ic ON ic.id = it.categoryFk + JOIN vn.itemType it ON it.id = i.typeFk + JOIN vn.itemCategory ic ON ic.id = it.categoryFk WHERE s.id = vSaleFk AND ic.code = 'fruit') THEN */ - - IF (SELECT COUNT(*) FROM vn.buy WHERE id = vBuyFk AND itemOriginalFk) THEN - + + IF (SELECT COUNT(*) FROM vn.buy WHERE id = vBuyFk AND itemOriginalFk) THEN + INSERT INTO vn.saleBuy (saleFk, buyFk) VALUES(vSaleFk, vBuyFk); - + END IF; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `saleGroup_add` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -63485,6 +64287,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `saleGroup_add`(vSectorFk INT) BEGIN @@ -63493,7 +64297,7 @@ BEGIN * * @param vSectorFk Identificador de vn.sector */ - INSERT INTO vn.saleGroup(userFk, sectorFk) + INSERT INTO vn.saleGroup(userFk, sectorFk) VALUES (account.myUser_getId(), vSectorFk); SELECT LAST_INSERT_ID(); @@ -63503,8 +64307,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `saleGroup_setParking` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -63512,6 +64314,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `saleGroup_setParking`(IN `vSaleGroupFk` VARCHAR(8), IN `vParkingFk` INT) proc: BEGIN @@ -63533,8 +64337,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `saleMistake_Add` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -63542,6 +64344,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `saleMistake_Add`(vSaleFk INT, vUserFk INT, vTypeFk INT) BEGIN @@ -63555,8 +64359,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `saleMove` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -63564,6 +64366,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `saleMove`(IN vSaleFk BIGINT, IN vQuantity BIGINT) BEGIN @@ -63592,19 +64396,19 @@ BEGIN IF vClientTypeFk <> 'handMaking' THEN SELECT t.id INTO vNewTicket - FROM ticket t + FROM ticket t JOIN ticketState ts ON ts.ticketFk = t.id WHERE t.addressFk = vAddressFk - AND t.warehouseFk = vWarehouseFk + AND t.warehouseFk = vWarehouseFk AND t.agencyModeFk = vAgencyModeFk AND t.landed <=> vLanded - AND t.shipped BETWEEN vShipped AND vShippedDayEnd + AND t.shipped BETWEEN vShipped AND vShippedDayEnd AND t.refFk IS NULL AND t.id <> vTicketOriginalFk AND IFNULL(ts.alertLevel,0) = 0 - LIMIT 1; + LIMIT 1; END IF; - + IF vNewTicket IS NULL THEN CALL vn.ticket_Clone(vTicketOriginalFk, vNewTicket); END IF; @@ -63613,41 +64417,39 @@ BEGIN SELECT vNewTicket, account.myUser_getId(), s.id FROM state s WHERE s.code = 'FIXING'; - + SELECT COUNT(id) INTO hasAlreadyItem FROM sale s WHERE s.ticketFk = vNewTicket AND s.itemFk = vItemFk; - + IF hasAlreadyItem = FALSE THEN - - INSERT INTO sale(ticketFk, itemFk, concept, quantity, price, discount) + + INSERT INTO sale(ticketFk, itemFk, concept, quantity, price, discount) SELECT vNewTicket, itemFk, concept, vQuantity, price, discount FROM sale s WHERE s.id = vSaleFk; - + SELECT LAST_INSERT_ID() INTO vNewSale; - + INSERT INTO saleComponent(saleFk, componentFk, `value`) SELECT vNewSale, componentFk, `value` - FROM saleComponent + FROM saleComponent WHERE saleFk = vSaleFk; - + ELSE - UPDATE sale + UPDATE sale SET quantity = quantity + vQuantity WHERE ticketFk = vNewTicket AND itemFk = vItemFk; END IF; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `salePreparingList` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -63655,6 +64457,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `salePreparingList`(IN vTicketFk BIGINT) BEGIN @@ -63705,8 +64509,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `saleSplit` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -63714,45 +64516,47 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `saleSplit`(vSaleFk INT, vQuantity INT) BEGIN - + DECLARE vNewSaleFk INT; - - INSERT INTO vn.sale(itemFk, - concept, - price, - discount, - quantity, - ticketFk, + + INSERT INTO vn.sale(itemFk, + concept, + price, + discount, + quantity, + ticketFk, isPriceFixed) - SELECT s.itemFk, - i.longName, - s.price, - s.discount, + SELECT s.itemFk, + i.longName, + s.price, + s.discount, vQuantity, - s.ticketFk, - s.isPriceFixed + s.ticketFk, + s.isPriceFixed FROM vn.sale s JOIN vn.item i ON i.id = s.itemFk WHERE s.id = vSaleFk; - + UPDATE vn.sale s JOIN vn.item i ON i.id = s.itemFk SET s.quantity = s.quantity - vQuantity, s.concept = i.longName WHERE s.id = vSaleFk; - + SELECT LAST_INSERT_ID() INTO vNewSaleFk; - - INSERT INTO vn.saleComponent( saleFk, - componentFk, + + INSERT INTO vn.saleComponent( saleFk, + componentFk, value) - SELECT vNewSaleFk, - componentFk, + SELECT vNewSaleFk, + componentFk, value - FROM vn.saleComponent + FROM vn.saleComponent WHERE saleFk = vSaleFk; END ;; @@ -63761,8 +64565,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `sales_merge` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -63770,6 +64572,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `sales_merge`(vTicketFk INT) BEGIN @@ -63781,9 +64585,9 @@ BEGIN JOIN itemType it ON it.id = i.typeFk WHERE s.ticketFk = vTicketFk AND it.isMergeable - GROUP BY s.itemFk, s.price, s.discount; + GROUP BY s.itemFk, s.price, s.discount; - UPDATE vn.sale s + UPDATE vn.sale s JOIN salesToPreserve stp ON stp.id = s.id SET quantity = newQuantity WHERE s.ticketFk = vTicketFk; @@ -63804,8 +64608,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `sales_mergeByCollection` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -63813,6 +64615,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `sales_mergeByCollection`(vCollectionFk INT) BEGIN @@ -63832,17 +64636,17 @@ BEGIN OPEN cCur; myLoop: LOOP - + SET vDone = FALSE; - + FETCH cCur INTO vTicketFk; IF vDone THEN LEAVE myLoop; END IF; - + CALL vn.sales_merge(vTicketFk); - + END LOOP; CLOSE cCur; @@ -63853,121 +64657,107 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `saleTracking_add` */; /*!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 = utf8mb3 */ ; -/*!50003 SET character_set_results = utf8mb3 */ ; -/*!50003 SET collation_connection = utf8mb3_general_ci */ ; +/*!50003 SET character_set_client = utf8mb4 */ ; +/*!50003 SET character_set_results = utf8mb4 */ ; +/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `saleTracking_add`(vSaleGroupFk INT) BEGIN - - /* Inserta en vn.saleTracking las lineas de una previa - * - * @param vSaleGroupFk Identificador de vn.saleGroup - */ - - REPLACE vn.saleTracking(saleFk, - isChecked, - workerFk, - actionFk, - stateFk) - SELECT sgd.saleFk , +/** Inserta en vn.saleTracking las lineas de una previa + * + * @param vSaleGroupFk Identificador de vn.saleGroup + */ + REPLACE vn.saleTracking( + saleFk, + isChecked, + workerFk, + stateFk + ) + SELECT sgd.saleFk , TRUE, account.myUser_getId(), - a.accion_id, s.id FROM vn.saleGroupDetail sgd - JOIN vncontrol.accion a ON a.accion = 'SACAR' JOIN vn.state s ON s.code = 'ON_PREPARATION' WHERE sgd.saleGroupFk = vSaleGroupFk; - END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `saleTracking_addPreparedSaleGroup` */; /*!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 = utf8mb3 */ ; -/*!50003 SET character_set_results = utf8mb3 */ ; -/*!50003 SET collation_connection = utf8mb3_general_ci */ ; +/*!50003 SET character_set_client = utf8mb4 */ ; +/*!50003 SET character_set_results = utf8mb4 */ ; +/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `saleTracking_addPreparedSaleGroup`(vSaleGroupFk INT) BEGIN - - /** - * Inserta lineas de vn.saleTracking para un saleGroup (previa) que escanea un sacador - * - * @param vSaleGroupFk Identificador de vn.saleGroup - */ - - REPLACE vn.saleTracking(saleFk, isChecked, workerFk, actionFk, stateFk) - SELECT sgd.saleFk, TRUE, account.myUser_getId(), a.accion_id id, s.id +/** + * Inserta lineas de vn.saleTracking para un saleGroup (previa) que escanea un sacador + * + * @param vSaleGroupFk Identificador de vn.saleGroup + */ + REPLACE vn.saleTracking(saleFk, isChecked, workerFk, stateFk) + SELECT sgd.saleFk, TRUE, account.myUser_getId(), s.id FROM vn.saleGroupDetail sgd - JOIN vncontrol.accion a ON a.accion = 'SACAR' JOIN vn.state s ON s.code = 'PREPARED' WHERE sgd.saleGroupFk = vSaleGroupFk; - END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `saleTracking_addPrevOK` */; /*!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 = utf8mb3 */ ; -/*!50003 SET character_set_results = utf8mb3 */ ; -/*!50003 SET collation_connection = utf8mb3_general_ci */ ; +/*!50003 SET character_set_client = utf8mb4 */ ; +/*!50003 SET character_set_results = utf8mb4 */ ; +/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `saleTracking_addPrevOK`(vSectorCollectionFk INT) BEGIN - - /** - * Inserta los registros de la colección de sector con el estado PREVIA OK - * - * @param vSectorCollectionFk Identificador de vn.sectorCollection - */ - - REPLACE vn.saleTracking(saleFk, - isChecked, - workerFk, - actionFk, - stateFk) - SELECT sgd.saleFk, +/** + * Inserta los registros de la colección de sector con el estado PREVIA OK + * + * @param vSectorCollectionFk Identificador de vn.sectorCollection + */ + REPLACE vn.saleTracking( + saleFk, + isChecked, + workerFk, + stateFk + ) + SELECT sgd.saleFk, TRUE, sc.userFk, - a.accion_id, s.id FROM vn.sectorCollection sc JOIN vn.sectorCollectionSaleGroup scsg ON scsg.sectorCollectionFk = sc.id JOIN vn.saleGroupDetail sgd ON sgd.saleGroupFk = scsg.saleGroupFk JOIN vn.state s ON s.code = 'OK PREVIOUS' - JOIN vncontrol.accion a ON a.accion = 'PRESACAR' WHERE sc.id = vSectorCollectionFk; - END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `saleTracking_del` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -63975,6 +64765,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `saleTracking_del`(vSaleFk INT, vState VARCHAR(50)) BEGIN @@ -63985,17 +64777,15 @@ BEGIN DELETE st.* FROM vn.saleTracking st JOIN vn.state s ON s.id = st.stateFk - WHERE st.saleFk = vSaleFk + WHERE st.saleFk = vSaleFk AND s.code = vState COLLATE utf8_unicode_ci; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `saleTracking_new` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -64003,31 +64793,38 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; -CREATE DEFINER=`root`@`localhost` PROCEDURE `saleTracking_new`( vSaleFK INT, - vIsChecked BOOLEAN, - vOriginalQuantity INT, - vWorkerFk INT, - vAction VARCHAR(50), +CREATE DEFINER=`root`@`localhost` PROCEDURE `saleTracking_new`( vSaleFK INT, + vIsChecked BOOLEAN, + vOriginalQuantity INT, + vWorkerFk INT, + vAction VARCHAR(50), vState VARCHAR(50)) BEGIN +/** + * Modifica registro de saleTracking - REPLACE vn.saleTracking(saleFk, - isChecked, - originalQuantity, - workerFk, - actionFk, - stateFk) + * @param vSaleFK Identificador del registro a modificar + * @param vIsChecked Indica si la línea ha sido pulsada + * @param vOriginalQuantity Cantidad original + * @param vWorkerFk Identificador del trabajador + * @param vAction Identificador de la acción realizada + * @param vState Identificador del estado a modificar + */ + REPLACE vn.saleTracking(saleFk, + isChecked, + originalQuantity, + workerFk, + stateFk) SELECT vSaleFk, vIsChecked, vOriginalQuantity, IFNULL(vWorkerFk, vn.getUser()), - a.accion_id, s.id - FROM vncontrol.accion a - JOIN vn.state s - WHERE s.code = vState COLLATE utf8_unicode_ci - AND a.accion = vAction COLLATE utf8_unicode_ci; + FROM vn.state s + WHERE s.code = vState COLLATE utf8_unicode_ci; END ;; DELIMITER ; @@ -64035,8 +64832,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `saleTracking_Replace` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -64044,10 +64839,12 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `saleTracking_Replace`(vSaleFk INT, vIsChecked INT, vOriginalQuantity INT, vStateFk INT) BEGIN - REPLACE vn.saleTracking(saleFk, isChecked, originalQuantity, stateFk) + REPLACE vn.saleTracking(saleFk, isChecked, originalQuantity, stateFk) VALUES(vSaleFk, vIsChecked, vOriginalQuantity, vStateFk); END ;; DELIMITER ; @@ -64055,8 +64852,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `saleTracking_updateIsChecked` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -64064,29 +64859,31 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `saleTracking_updateIsChecked`(vSaleFk INT, vIsChecked BOOL) BEGIN - + /** * Actualiza el estado del campo vn.saleTracking.isChecked y elimina las lineas de vn.itemShelving * si procede, en el caso de las preparaciones previas, por usuario - * + * * @param vSaleFk Identificador de vn.sale * @param vIsChecked Estado del registro */ - + UPDATE vn.saleTracking st JOIN vn.state s ON s.id = st.stateFk AND s.code = 'PREVIOUS_PREPARATION' SET st.isChecked = vIsChecked WHERE st.saleFk = vSaleFk AND st.workerFk = account.myUser_getId(); - + IF vIsChecked = FALSE THEN - - DELETE FROM vn.itemShelvingSale + + DELETE FROM vn.itemShelvingSale WHERE saleFk = vSaleFk; - + END IF; END ;; @@ -64095,8 +64892,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `sale_calculateComponent` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -64104,6 +64899,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `sale_calculateComponent`(vSale INT, vOption INT) proc: BEGIN @@ -64112,15 +64909,15 @@ proc: BEGIN * * @param vSale Id de la venta * @param vOption indica en que componente pone el descuadre, NULL en casos habituales - */ + */ DROP TEMPORARY TABLE IF EXISTS tmp.recalculateSales; CREATE TEMPORARY TABLE tmp.recalculateSales SELECT s.id FROM sale s WHERE s.id = vSale; - + CALL vn.sale_recalcComponent(vOption); - + DROP TEMPORARY TABLE tmp.recalculateSales; END ;; DELIMITER ; @@ -64128,8 +64925,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `sale_checkNoComponents` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -64137,6 +64932,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `sale_checkNoComponents`(vCreatedFrom DATETIME, vCreatedTo DATETIME) BEGIN @@ -64167,7 +64964,7 @@ BEGIN GROUP BY s.id; DECLARE CONTINUE HANDLER FOR NOT FOUND - SET v_done = TRUE; + SET v_done = TRUE; DROP TEMPORARY TABLE IF EXISTS tmp.coste; @@ -64175,7 +64972,7 @@ BEGIN CREATE TEMPORARY TABLE tmp.coste (PRIMARY KEY (id)) ENGINE = MEMORY SELECT s.id - FROM sale s + FROM sale s JOIN item i ON i.id = s.itemFk JOIN itemType tp ON tp.id = i.typeFk JOIN itemCategory ic ON ic.id = tp.categoryFk @@ -64194,25 +64991,23 @@ BEGIN IF v_done THEN LEAVE l; END IF; - + SELECT ticketFk, concept INTO vTicketFk, vConcept FROM sale WHERE id = vSaleFk; - + CALL sale_calculateComponent(vSaleFk, 1); END LOOP; CLOSE vCur; - DROP TEMPORARY TABLE tmp.coste; + DROP TEMPORARY TABLE tmp.coste; END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `sale_getFromTicketOrCollection` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -64220,6 +65015,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `sale_getFromTicketOrCollection`(vParam INT) BEGIN @@ -64290,7 +65087,7 @@ BEGIN TRIM(CONCAT(LPAD(s.concept,30,' '), ' ', RPAD(IFNULL(i.size,''),5,' '))) line1, '' cel1, - TRIM(CONCAT(LPAD(IFNULL(ip.productor,''),30,' '), ' ',LPAD(IFNULL(o.code,''),4,' '))) line2, + TRIM(CONCAT(LPAD(IFNULL(ip.productor,''),30,' '), ' ',LPAD(IFNULL(o.code,''),4,' '))) line2, IF(s.quantity MOD IFNULL(b.packing,s.quantity + 1), CONCAT(CAST(s.quantity/IFNULL(b.`grouping`,1) AS DECIMAL(10,0)),' x ',IFNULL(b.`grouping`,1)), CONCAT(CAST(s.quantity / IFNULL(b.packing,1) AS DECIMAL(10,0)),' pack de ',IFNULL(b.packing,1))) cel2, @@ -64301,17 +65098,17 @@ BEGIN IFNULL(c.workerFk,getUser()) as workerFk, IFNULL(SUM(iss.quantity),0) as pickedQuantity, i.packingShelve, - MIN(iss.created) picked + MIN(iss.created) picked FROM tmp.ticket t JOIN sale s ON s.ticketFk = t.id JOIN ticket tt ON tt.id = t.id LEFT JOIN cache.last_buy lb ON lb.item_id = s.itemFk AND lb.warehouse_id = tt.warehouseFk - LEFT JOIN buy b ON b.id = lb.buy_id + LEFT JOIN buy b ON b.id = lb.buy_id JOIN item i ON i.id = s.itemFk LEFT JOIN ticketCollection tc ON tc.ticketFk = t.id LEFT JOIN collection c ON c.id = tc.collectionFk - LEFT JOIN (SELECT sub.saleFk, sub.isChecked, sub.stateFk, sub.originalQuantity - FROM (SELECT DISTINCT st.id, st.saleFk, st.isChecked, st.stateFk, st.originalQuantity + LEFT JOIN (SELECT sub.saleFk, sub.isChecked, sub.stateFk, sub.originalQuantity + FROM (SELECT DISTINCT st.id, st.saleFk, st.isChecked, st.stateFk, st.originalQuantity FROM tmp.ticket2 t JOIN sale s ON s.ticketFk = t.id JOIN saleTracking st ON st.saleFk = s.id @@ -64323,9 +65120,9 @@ BEGIN LEFT JOIN itemColor ic ON ic.itemFk = s.itemFk LEFT JOIN itemProductor ip ON ip.itemFk = s.itemFk LEFT JOIN origin o ON o.id = i.originFk - LEFT JOIN saleGroupDetail sgd ON sgd.saleFk = s.id + LEFT JOIN saleGroupDetail sgd ON sgd.saleFk = s.id LEFT JOIN saleGroup sg ON sg.id = sgd.saleGroupFk - LEFT JOIN parking p ON p.id = sg.parkingFk + LEFT JOIN parking p ON p.id = sg.parkingFk GROUP BY s.id; DROP TEMPORARY TABLE @@ -64337,8 +65134,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `sale_getProblems` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -64346,6 +65141,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `sale_getProblems`(IN vIsTodayRelative tinyint(1)) BEGIN @@ -64374,10 +65171,10 @@ BEGIN DELETE tt.* FROM tmp.sale_getProblems tt JOIN vn.ticketObservation tto ON tto.ticketFk = tt.ticketFk - JOIN vn.observationType ot ON ot.id = tto.observationTypeFk - WHERE ot.code = 'administrative' + JOIN vn.observationType ot ON ot.id = tto.observationTypeFk + WHERE ot.code = 'administrative' AND tto.description = 'Miriam'; - + DROP TEMPORARY TABLE IF EXISTS tmp.sale_problems; CREATE TEMPORARY TABLE tmp.sale_problems ( ticketFk INT(11), @@ -64408,7 +65205,7 @@ BEGIN -- Too Little INSERT INTO tmp.sale_problems(ticketFk, isTooLittle) - SELECT tp.ticketFk, TRUE + SELECT tp.ticketFk, TRUE FROM tmp.sale_getProblems tp JOIN vn.ticket t ON t.id = tp.ticketFk JOIN (SELECT t.addressFk, SUM(sv.litros) litros, t.totalWithoutVat @@ -64491,25 +65288,25 @@ BEGIN -- Disponible: no va a haber suficiente producto para preparar todos los pedidos CALL cache.available_refresh(vAvailableCache, FALSE, vWarehouseFk, vDate); - - -- Faltas: visible, disponible y ubicado son menores que la cantidad vendida + + -- Faltas: visible, disponible y ubicado son menores que la cantidad vendida CALL cache.visible_refresh(vVisibleCache, FALSE, vWarehouseFk); INSERT INTO tmp.sale_problems(ticketFk, itemShortage, saleFk) SELECT ticketFk, problem, saleFk FROM ( - SELECT tl.ticketFk, - LEFT(CONCAT('F: ',GROUP_CONCAT(i.id, ' ', i.longName, ' ')),250) problem, + SELECT tl.ticketFk, + LEFT(CONCAT('F: ',GROUP_CONCAT(i.id, ' ', i.longName, ' ')),250) problem, s.id AS saleFk FROM tmp.ticket_list tl JOIN vn.ticket t ON t.id = tl.ticketFk JOIN vn.sale s ON s.ticketFk = t.id JOIN vn.item i ON i.id = s.itemFk JOIN vn.itemType it on it.id = i.typeFk - JOIN vn.itemCategory ic ON ic.id = it.categoryFk + JOIN vn.itemCategory ic ON ic.id = it.categoryFk LEFT JOIN cache.visible v ON v.item_id = i.id AND v.calc_id = vVisibleCache LEFT JOIN cache.available av ON av.item_id = i.id AND av.calc_id = vAvailableCache - LEFT JOIN vn.itemShelvingStock_byWarehouse issw ON issw.itemFk = i.id AND issw.warehouseFk = t.warehouseFk + LEFT JOIN vn.itemShelvingStock_byWarehouse issw ON issw.itemFk = i.id AND issw.warehouseFk = t.warehouseFk WHERE IFNULL(v.visible,0) < s.quantity AND IFNULL(av.available ,0) < s.quantity AND IFNULL(issw.visible, 0) < s.quantity @@ -64522,7 +65319,7 @@ BEGIN AND t.warehouseFk = vWarehouseFk GROUP BY tl.ticketFk) sub ON DUPLICATE KEY UPDATE itemShortage = sub.problem, saleFk = sub.saleFk; - + -- Inventario: Visible suficiente, pero ubicado menor a la cantidad vendida INSERT INTO tmp.sale_problems(ticketFk, itemLost, saleFk) SELECT ticketFk, problem, saleFk @@ -64535,7 +65332,7 @@ BEGIN JOIN vn.itemType it on it.id = i.typeFk JOIN vn.itemCategory ic ON ic.id = it.categoryFk LEFT JOIN cache.visible v ON v.item_id = s.itemFk AND v.calc_id = vVisibleCache - LEFT JOIN vn.itemShelvingStock_byWarehouse issw ON issw.itemFk = i.id AND issw.warehouseFk = t.warehouseFk + LEFT JOIN vn.itemShelvingStock_byWarehouse issw ON issw.itemFk = i.id AND issw.warehouseFk = t.warehouseFk WHERE IFNULL(v.visible,0) >= s.quantity AND IFNULL(issw.visible, 0) < s.quantity AND s.quantity > 0 @@ -64548,7 +65345,7 @@ BEGIN AND t.warehouseFk = vWarehouseFk GROUP BY tl.ticketFk) sub ON DUPLICATE KEY UPDATE itemDelay = sub.problem, saleFk = sub.saleFk; - + -- Retraso: Disponible suficiente, pero no visible ni ubicado INSERT INTO tmp.sale_problems(ticketFk, itemDelay, saleFk) SELECT ticketFk, problem, saleFk @@ -64562,7 +65359,7 @@ BEGIN JOIN vn.itemCategory ic ON ic.id = it.categoryFk LEFT JOIN cache.visible v ON v.item_id = s.itemFk AND v.calc_id = vVisibleCache LEFT JOIN cache.available av ON av.item_id = i.id AND av.calc_id = vAvailableCache - LEFT JOIN vn.itemShelvingStock_byWarehouse issw ON issw.itemFk = i.id AND issw.warehouseFk = t.warehouseFk + LEFT JOIN vn.itemShelvingStock_byWarehouse issw ON issw.itemFk = i.id AND issw.warehouseFk = t.warehouseFk WHERE IFNULL(v.visible,0) < s.quantity AND IFNULL(av.available ,0) >= s.quantity AND IFNULL(issw.visible, 0) < s.quantity @@ -64579,7 +65376,7 @@ BEGIN END WHILE; CLOSE vCursor; - + INSERT INTO tmp.sale_problems(ticketFk, isTaxDataChecked) SELECT DISTINCT tl.ticketFk, FALSE FROM tmp.ticket_list tl @@ -64596,8 +65393,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `sale_getProblemsByTicket` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -64605,20 +65400,22 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `sale_getProblemsByTicket`(IN vTicketFk INT, IN vIsTodayRelative TINYINT(1)) BEGIN /** - * Calcula los problemas de cada venta + * Calcula los problemas de cada venta * para un conjunto de tickets. * * @return Problems result */ DROP TEMPORARY TABLE IF EXISTS tmp.sale_getProblems; - CREATE TEMPORARY TABLE tmp.sale_getProblems + CREATE TEMPORARY TABLE tmp.sale_getProblems (INDEX (ticketFk)) ENGINE = MEMORY - SELECT t.id ticketFk, t.clientFk, t.warehouseFk, t.shipped + SELECT t.id ticketFk, t.clientFk, t.warehouseFk, t.shipped FROM ticket t WHERE t.id = vTicketFk; @@ -64635,8 +65432,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `sale_PriceFix` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -64644,10 +65439,12 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `sale_PriceFix`(vTicketFk INT) BEGIN - + DELETE sc.* FROM vn.saleComponent sc JOIN vn.sale s ON s.id = sc.saleFk @@ -64670,8 +65467,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `sale_recalcComponent` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -64679,59 +65474,61 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `sale_recalcComponent`(vOption INT) proc: BEGIN -/** +/** * Actualiza los componentes * * @table tmp.recalculateSales - */ - DECLARE vShipped DATE; + */ + DECLARE vShipped DATE; DECLARE vWarehouseFk SMALLINT; DECLARE vAgencyModeFk INT; DECLARE vAddressFk INT; DECLARE vTicketFk BIGINT; DECLARE vItemFk BIGINT; - DECLARE vLanded DATE; + DECLARE vLanded DATE; DECLARE vIsEditable BOOLEAN; DECLARE vZoneFk INTEGER; - + DECLARE vSale INTEGER; DECLARE vDone BOOL DEFAULT FALSE; - + DECLARE vCur CURSOR FOR SELECT id from tmp.recalculateSales; - - DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE; - + + DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE; + OPEN vCur; l: LOOP SET vDone = FALSE; - FETCH vCur INTO vSale; - + FETCH vCur INTO vSale; + IF vDone THEN LEAVE l; END IF; - - SELECT t.refFk IS NULL, - s.ticketFk, - s.itemFk , - t.zoneFk, - t.warehouseFk, - t.shipped, - t.addressFk, - t.agencyModeFk, + + SELECT t.refFk IS NULL, + s.ticketFk, + s.itemFk , + t.zoneFk, + t.warehouseFk, + t.shipped, + t.addressFk, + t.agencyModeFk, t.landed - INTO vIsEditable, - vTicketFk, - vItemFk, - vZoneFk, - vWarehouseFk, - vShipped, - vAddressFk, - vAgencyModeFk, + INTO vIsEditable, + vTicketFk, + vItemFk, + vZoneFk, + vWarehouseFk, + vShipped, + vAddressFk, + vAgencyModeFk, vLanded FROM ticket t JOIN sale s ON s.ticketFk = t.id @@ -64739,59 +65536,59 @@ proc: BEGIN WHERE s.id = vSale; CALL zone_getLanded(vShipped, vAddressFk, vAgencyModeFk, vWarehouseFk, TRUE); - + IF (SELECT COUNT(*) FROM tmp.zoneGetLanded LIMIT 1) = 0 THEN CALL util.throw('There is no zone for these parameters'); END IF; - + IF vLanded IS NULL OR vZoneFk IS NULL THEN - + UPDATE ticket t - SET t.landed = (SELECT landed FROM tmp.zoneGetLanded LIMIT 1) + SET t.landed = (SELECT landed FROM tmp.zoneGetLanded LIMIT 1) WHERE t.id = vTicketFk AND t.landed IS NULL; - + IF vZoneFk IS NULL THEN SELECT zoneFk INTO vZoneFk FROM tmp.zoneGetLanded LIMIT 1; UPDATE ticket t SET t.zoneFk = vZoneFk WHERE t.id = vTicketFk AND t.zoneFk IS NULL; END IF; - + END IF; - + DROP TEMPORARY TABLE tmp.zoneGetLanded; - - -- rellena la tabla buyUltimate con la ultima compra - CALL buyUltimate (vWarehouseFk, vShipped); - + + -- rellena la tabla buyUltimate con la ultima compra + CALL buyUltimate (vWarehouseFk, vShipped); + DELETE FROM tmp.buyUltimate WHERE itemFk != vItemFk; - + DROP TEMPORARY TABLE IF EXISTS tmp.ticketLot; - CREATE TEMPORARY TABLE tmp.ticketLot + CREATE TEMPORARY TABLE tmp.ticketLot SELECT vWarehouseFk warehouseFk, NULL available, vItemFk itemFk, buyFk, vZoneFk zoneFk FROM tmp.buyUltimate WHERE itemFk = vItemFk; - - CALL catalog_componentPrepare(); + + CALL catalog_componentPrepare(); CALL catalog_componentCalculate(vZoneFk, vAddressFk, vShipped, vWarehouseFk); - + DROP TEMPORARY TABLE IF EXISTS tmp.sale; CREATE TEMPORARY TABLE tmp.sale (PRIMARY KEY (saleFk)) ENGINE = MEMORY SELECT vSale saleFk,vWarehouseFk warehouseFk; - + IF vOption IS NULL THEN SET vOption = IF(vIsEditable, 1, 6); END IF; - - CALL ticketComponentUpdateSale(vOption); + + CALL ticketComponentUpdateSale(vOption); CALL catalog_componentPurge(); - + DROP TEMPORARY TABLE tmp.buyUltimate; DROP TEMPORARY TABLE tmp.sale; - + END LOOP; - CLOSE vCur; + CLOSE vCur; END ;; DELIMITER ; @@ -64799,8 +65596,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `sale_setQuantity` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -64808,41 +65603,41 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `sale_setQuantity`(vSaleFk INT, vQuantity INT) BEGIN /* * Actualiza la cantidad de la línea de venta - * + * * @vSaleFk id de la línea de venta * @vQuantity cantidad a modificar - * + * */ - + DECLARE vDescription VARCHAR(100); DECLARE vOrigin INT; - + SELECT CONCAT("Cambio cantidad ",concept," de ", quantity," a ", vQuantity) INTO vDescription - FROM sale + FROM sale WHERE id = vSaleFk; SELECT ticketFk INTO vOrigin FROM sale WHERE id = vSaleFk; CALL logAdd(vOrigin, 'update', 'ticket', vDescription); - - UPDATE sale + + UPDATE sale SET originalQuantity = quantity, quantity = vQuantity WHERE id = vSaleFk; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `sale_updateOriginalQuantity` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -64850,6 +65645,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `sale_updateOriginalQuantity`(vSale INT, vQuantity INT) proc: BEGIN @@ -64865,67 +65662,62 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `sectorCollectionSaleGroup_add` */; /*!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 = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; -/*!50003 SET collation_connection = utf8mb4_general_ci */ ; +/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `sectorCollectionSaleGroup_add`(vSaleGroupFk INT, vSectorCollectionFk INT) BEGIN - - /** - * Inserta un nuevo registro en vn.sectorCollectionSaleGroup - * Actualiza el usuario en vn.saleGroup y reemplaza los registros de vn.saleTracking - * - * @param vSaleGroupFk Identificador de vn.saleGroup - * @param vSectorCollectionFk Identificador de vn.sectorCollection - */ - + +/** + * Inserta un nuevo registro en vn.sectorCollectionSaleGroup + * Actualiza el usuario en vn.saleGroup y reemplaza los registros de vn.saleTracking + * + * @param vSaleGroupFk Identificador de vn.saleGroup + * @param vSectorCollectionFk Identificador de vn.sectorCollection + */ + REPLACE vn.sectorCollectionSaleGroup(sectorCollectionFk, saleGroupFk) VALUES(vSectorCollectionFk, vSaleGroupFk); - + UPDATE vn.saleGroup sg JOIN vn.sectorCollectionSaleGroup scsg ON scsg.saleGroupFk = sg.id JOIN vn.sectorCollection sc ON sc.id = scsg.sectorCollectionFk - SET sg.userFk = sc.userFk + SET sg.userFk = sc.userFk WHERE sg.id = vSaleGroupFk; - - + + INSERT IGNORE vn.saleTracking(saleFk, isChecked, workerFk, - actionFk, stateFk) SELECT sgd.saleFk , FALSE, sc.userFk, - a.accion_id, s.id FROM vn.saleGroupDetail sgd - JOIN vn.sectorCollectionSaleGroup scsg ON scsg.saleGroupFk = sgd.saleGroupFk + JOIN vn.sectorCollectionSaleGroup scsg ON scsg.saleGroupFk = sgd.saleGroupFk JOIN vn.sectorCollection sc ON sc.id = scsg.sectorCollectionFk - JOIN vncontrol.accion a ON a.accion = 'SACAR' JOIN vn.state s ON s.code = 'PREVIOUS_PREPARATION' WHERE sgd.saleGroupFk = vSaleGroupFk; - + UPDATE vn.saleTracking st - JOIN vn.saleGroupDetail sgd ON sgd.saleFk = st.saleFk + JOIN vn.saleGroupDetail sgd ON sgd.saleFk = st.saleFk SET st.isChecked = TRUE WHERE sgd.saleGroupFk = vSaleGroupFk AND st.workerFk = 20; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `sectorCollection_get` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -64933,18 +65725,20 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `sectorCollection_get`(vSectorFk INT) BEGIN - + /** * Devuelve las colecciones del sector que corresponden al usuario conectado, y que estan incompletas - * + * * @param vSectorFk Identificador de vn.sector */ - + SELECT DISTINCT sc.id collectionFk, sc.created - FROM vn.sectorCollection sc + FROM vn.sectorCollection sc JOIN vn.state s ON s.code = 'PREVIOUS_PREPARATION' LEFT JOIN vn.sectorCollectionSaleGroup scsg ON scsg.sectorCollectionFk = sc.id LEFT JOIN vn.saleGroupDetail sgd ON sgd.saleGroupFk = scsg.saleGroupFk @@ -64952,18 +65746,16 @@ BEGIN LEFT JOIN vn.sale sl ON sl.id = st.saleFk WHERE sc.userFk = account.myUser_getId() AND (ISNULL(scsg.sectorCollectionFk) - OR + OR (NOT st.isChecked AND sl.quantity > 0)) AND sc.created > util.VN_CURDATE(); - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `sectorCollection_getSale` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -64971,6 +65763,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `sectorCollection_getSale`(vSelf INT) BEGIN @@ -65006,8 +65800,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `sectorCollection_new` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -65015,13 +65807,15 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `sectorCollection_new`(vSectorFk INT) BEGIN /** * Inserta una nueva colección, si el usuario no tiene ninguna vacia. * Esto se hace para evitar que por error se generen colecciones sin sentido. - * + * * @param vSectorFk Identificador de #vn.sector */ DECLARE hasEmptyCollections BOOL; @@ -65030,8 +65824,8 @@ BEGIN SET vUserFk = account.myUser_getId(); SELECT (COUNT(sc.id) > 0) INTO hasEmptyCollections - FROM vn.sectorCollection sc - LEFT JOIN vn.sectorCollectionSaleGroup scsg ON scsg.sectorCollectionFk = sc.id + FROM vn.sectorCollection sc + LEFT JOIN vn.sectorCollectionSaleGroup scsg ON scsg.sectorCollectionFk = sc.id WHERE ISNULL(scsg.id) AND sc.userFk = vUserFk AND sc.sectorFk = vSectorFk @@ -65047,8 +65841,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `sectorProductivity_add` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -65056,6 +65848,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `sectorProductivity_add`() BEGIN @@ -65090,7 +65884,7 @@ BEGIN JOIN ticket t ON c.ticketFk = t.id JOIN claimResponsible cr ON cd.claimResponsibleFk = cr.id JOIN ticketTracking tt ON tt.ticketFk = t.id - JOIN state s ON s.id = tt.stateFk + JOIN `state` s ON s.id = tt.stateFk WHERE t.shipped BETWEEN vDatedFrom AND vDatedTo AND cr.description = 'Revisadores' AND s.code = 'OK PREVIOUS' GROUP BY workerFk; @@ -65118,7 +65912,7 @@ BEGIN LEFT JOIN vn.sale s ON s.id = sgd.saleFk LEFT JOIN tmp.timeControlCalculate tc ON tc.userFk = w.id LEFT JOIN bs.workerProductivity wp ON wp.workerFk = w.id - LEFT JOIN vncontrol.accion a ON a.accion_id = wp.actionFk AND a.accion = 'PRESACAR' + LEFT JOIN `state` s2 ON s2.id = wp.stateFk AND s2.code = 'OK PREVIOUS' LEFT JOIN tmp.errorsByChecker ec2 ON ec2.workerFk = w.id LEFT JOIN tmp.previousErrors pe ON pe.workerFk = w.id WHERE DATE(sc.created) = vDatedFrom @@ -65134,8 +65928,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `sector_get` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -65143,6 +65935,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `sector_get`() BEGIN @@ -65160,8 +65954,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `sector_getWarehouse` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -65169,6 +65961,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `sector_getWarehouse`(vSectorFk INT) BEGIN @@ -65176,15 +65970,13 @@ BEGIN SELECT s.warehouseFk FROM vn.sector s WHERE s.id = vSectorFk; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `setParking` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -65192,6 +65984,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `setParking`(IN `vParam` VARCHAR(8), IN `vParkingCode` VARCHAR(8)) proc: BEGIN @@ -65257,8 +66051,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `shelvingChange` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -65266,23 +66058,23 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `shelvingChange`(IN `vShelvingO` VARCHAR(8), IN `vShelvingD` VARCHAR(8)) BEGIN UPDATE vn.itemShelving - SET shelvingFk = vShelvingD COLLATE utf8_unicode_ci - WHERE shelvingFk = vShelvingO COLLATE utf8_unicode_ci; - - + SET shelvingFk = vShelvingD COLLATE utf8_unicode_ci + WHERE shelvingFk = vShelvingO COLLATE utf8_unicode_ci; + + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `shelvingLog_get` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -65290,19 +66082,21 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `shelvingLog_get`(shelvingFk VARCHAR(10)) BEGIN - + /* Lista el log de un carro - * + * * @param shelvingFk matrícula del carro - * + * */ - + SELECT originFk, name, creationDate, description FROM shelvingLog sl - JOIN account.user u ON u.id = sl.userFk + JOIN account.user u ON u.id = sl.userFk WHERE sl.originFk = shelvingFk COLLATE utf8_general_ci ORDER BY creationDate DESC; @@ -65312,8 +66106,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `shelvingParking_get` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -65321,26 +66113,28 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `shelvingParking_get`(vShelvingFk VARCHAR(10), vWarehouseFk INT, vDayRange INT) BEGIN - -SELECT s.itemFk, + +SELECT s.itemFk, s.concept, - CAST(SUM(s.quantity) AS DECIMAL(10,0)) as sinServir, - CAST(IFNULL(ist.visible,0) AS DECIMAL(10,0)) as aparcado + CAST(SUM(s.quantity) AS DECIMAL(10,0)) as sinServir, + CAST(IFNULL(ist.visible,0) AS DECIMAL(10,0)) as aparcado FROM vn.sale s LEFT JOIN vn.itemShelvingSale iss ON iss.saleFk = s.id JOIN vn.ticket t ON t.id = s.ticketFk LEFT JOIN vn.itemShelvingStock ist ON ist.itemFk = s.itemFk AND ist.warehouseFk = vWarehouseFk JOIN vn.itemShelving ish ON ish.itemFk = s.itemFk AND ish.shelvingFk = vShelvingFk COLLATE utf8_general_ci - WHERE t.shipped BETWEEN util.VN_CURDATE() AND util.dayend(TIMESTAMPADD(DAY, GREATEST(0,vDayRange), util.VN_CURDATE())) + WHERE t.shipped BETWEEN util.VN_CURDATE() AND util.dayend(TIMESTAMPADD(DAY, GREATEST(0,vDayRange), util.VN_CURDATE())) AND iss.saleFk IS NULL AND t.warehouseFk = vWarehouseFk GROUP BY s.itemFk HAVING sinServir > aparcado; - + END ;; DELIMITER ; @@ -65348,8 +66142,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `shelvingPriority_update` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -65357,6 +66149,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `shelvingPriority_update`(priority INT,vShelvingFk VARCHAR(10)) BEGIN @@ -65369,8 +66163,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `shelving_clean` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -65378,6 +66170,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb3 */ ; /*!50003 SET character_set_results = utf8mb3 */ ; /*!50003 SET collation_connection = utf8mb3_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `shelving_clean`() BEGIN @@ -65385,12 +66179,12 @@ BEGIN DELETE FROM vn.shelving WHERE length(code) > 3 AND parked < TIMESTAMPADD(WEEK,-1,util.VN_CURDATE()); - + DELETE FROM vn.itemShelving WHERE visible <= 0 AND created < TIMESTAMPADD(MONTH,-1,util.VN_CURDATE()); - DELETE ish.* + DELETE ish.* FROM vn.itemShelving ish JOIN vn.shelving sh ON sh.code = ish.shelvingFk WHERE sh.parkingFk IS NULL @@ -65398,12 +66192,12 @@ BEGIN UPDATE vn.shelving sh LEFT JOIN vn.itemShelving its ON its.shelvingFk = sh.`code` - SET isPrinted = 0, + SET isPrinted = 0, parkingFk = NULL WHERE its.id IS NULL - AND sh.isRecyclable - AND ( sh.parked IS NULL - OR + AND sh.isRecyclable + AND ( sh.parked IS NULL + OR sh.parked < TIMESTAMPADD(MONTH,-1,util.VN_CURDATE()) ); @@ -65413,8 +66207,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `shelving_getSpam` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -65422,31 +66214,33 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `shelving_getSpam`(vDated DATE, vWarehouseFk INT) BEGIN - + /** * Devuelve las matrículas con productos que no son necesarios para la venta hasta la fecha señalada - * + * * @param vDated Fecha hasta la que se puede pasar sin esos productos. * @param vWarehouse Identificador único de vn.warehouse */ - + DROP TEMPORARY TABLE IF EXISTS tmp.stock; CALL cache.stock_refresh(FALSE); CREATE TEMPORARY TABLE tmp.stock - SELECT i.id itemFk, - v.amount - IFNULL(fue.reserva,0) as visible, - fue.reserva, - sale.venta, - IFNULL(buy.compra,0) + IFNULL(mov.traslado,0) as compra, + SELECT i.id itemFk, + v.amount - IFNULL(fue.reserva,0) as visible, + fue.reserva, + sale.venta, + IFNULL(buy.compra,0) + IFNULL(mov.traslado,0) as compra, IFNULL(v.amount,0) + IFNULL(sale.venta,0) + IFNULL(buy.compra,0) + IFNULL(mov.traslado,0) - IFNULL(fue.reserva,0) as saldo - FROM vn.item i - JOIN vn.itemType it ON it.id = i.typeFk - JOIN vn.itemCategory ic ON ic.id = it.categoryFk + FROM vn.item i + JOIN vn.itemType it ON it.id = i.typeFk + JOIN vn.itemCategory ic ON ic.id = it.categoryFk LEFT JOIN ( SELECT ish.itemFk, CAST(SUM(ish.visible) AS DECIMAL(10,0)) AS reserva FROM vn.itemShelving ish @@ -65455,7 +66249,7 @@ BEGIN JOIN vn.sector s ON s.id = p.sectorFk WHERE s.code = 'FUENTES_PICASSE' OR sh.isSpam - GROUP BY ish.itemFk + GROUP BY ish.itemFk ) fue ON fue.itemFk = i.id LEFT JOIN cache.stock v ON i.id = v.item_id AND v.warehouse_id = vWarehouseFk LEFT JOIN ( @@ -65481,27 +66275,27 @@ BEGIN GROUP BY item_id ) mov ON mov.item_id = i.id WHERE v.amount; - - SELECT ish.shelvingFk matricula, + + SELECT ish.shelvingFk matricula, i.longName articulo, ish.visible, - count(*) lineas, - sum(ish.visible <= s.saldo) spam, + count(*) lineas, + sum(ish.visible <= s.saldo) spam, p.code parking, - s.description sector , + s.description sector , w.name AS almacen, sh.isSpam - FROM vn.itemShelving ish + FROM vn.itemShelving ish JOIN vn.item i ON i.id = ish.itemFk - JOIN vn.shelving sh ON sh.code = ish.shelvingFk - JOIN vn.parking p ON p.id = sh.parkingFk - JOIN vn.sector s ON s.id = p.sectorFk - JOIN vn.warehouse w ON w.id = s.warehouseFk - LEFT JOIN tmp.stock s ON s.itemFk = ish.itemFk - WHERE (w.name = 'Algemesi' + JOIN vn.shelving sh ON sh.code = ish.shelvingFk + JOIN vn.parking p ON p.id = sh.parkingFk + JOIN vn.sector s ON s.id = p.sectorFk + JOIN vn.warehouse w ON w.id = s.warehouseFk + LEFT JOIN tmp.stock s ON s.itemFk = ish.itemFk + WHERE (w.name = 'Algemesi' OR (w.name = 'NuncaJamas' AND ish.created < util.VN_CURDATE())) - AND ish.visible - GROUP BY ish.shelvingFk + AND ish.visible + GROUP BY ish.shelvingFk HAVING lineas = spam OR isSpam; DROP TEMPORARY TABLE tmp.stock; @@ -65512,8 +66306,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `shelving_setParking` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -65521,6 +66313,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `shelving_setParking`(IN `vShelvingCode` VARCHAR(8), IN `vParkingFk` INT) proc: BEGIN @@ -65546,8 +66340,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `sleep_X_min` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -65555,6 +66347,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `sleep_X_min`() BEGIN @@ -65568,8 +66362,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `solunionRiskRequest` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -65577,23 +66369,25 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `solunionRiskRequest`() BEGIN - + DROP TEMPORARY TABLE IF EXISTS tmp.client_list; CREATE TEMPORARY TABLE tmp.client_list (PRIMARY KEY (Id_Cliente)) ENGINE = MEMORY - SELECT * FROM (SELECT cc.client Id_Cliente, ci.grade FROM vn.creditClassification cc + SELECT * FROM (SELECT cc.client Id_Cliente, ci.grade FROM vn.creditClassification cc JOIN vn.creditInsurance ci ON cc.id = ci.creditClassification WHERE dateEnd IS NULL ORDER BY ci.creationDate DESC LIMIT 10000000000000000000) t1 GROUP BY Id_Cliente; - + CALL vn2008.risk_vs_client_list(util.VN_CURDATE()); - - SELECT + + SELECT c.Id_Cliente, c.Cliente, c.Credito credito_vn, c.creditInsurance solunion, cast(r.risk as DECIMAL(10,0)) riesgo_vivo, cast(c.creditInsurance - r.risk as decimal(10,0)) margen_vivo, f.Consumo consumo_anual, c.Vencimiento, ci.grade @@ -65603,7 +66397,7 @@ BEGIN JOIN tmp.client_list ci ON c.Id_Cliente = ci.Id_Cliente JOIN bi.facturacion_media_anual f ON c.Id_Cliente = f.Id_Cliente GROUP BY Id_cliente; - + DROP TEMPORARY TABLE IF EXISTS tmp.risk; DROP TEMPORARY TABLE IF EXISTS tmp.client_list; END ;; @@ -65612,8 +66406,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `stockBuyedByWorker` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -65621,22 +66413,31 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `stockBuyedByWorker`(vDate DATE, vWorker INT) BEGIN +/** + * Calculates the space reserved by buyers of the same container + * + * @param vdate date of container delivery + * @param vWorker buyer reserving space in the container + */ DECLARE vVolume DECIMAL(10,2); - DECLARE vWarehouse INT DEFAULT 7; + DECLARE vWarehouseFk INT; + DECLARE vCompressionRatio DECIMAL(1,1); CALL stockTraslation(vDate); - SELECT volume INTO vVolume FROM vn.packaging WHERE id = 'cc' LIMIT 1; + SELECT warehosueFk, conversionCoefficient INTO vWarehouseFk, vCompressionRatio FROM auctionConfig; + SELECT volume INTO vVolume FROM vn.packaging WHERE id = 'cc'; - SELECT - b.entryFk Id_Entrada, + SELECT b.entryFk Id_Entrada, i.id Id_Article, i.name Article, ti.amount Cantidad, - (0.6 * ( ti.amount / b.packing ) * vn.buy_getVolume(b.id))/vVolume buyed, + (vCompressionRatio * (ti.amount / b.packing) * vn.buy_getVolume(b.id))/vVolume buyed, b.packageFk id_cubo, b.packing FROM tmp_item ti @@ -65644,9 +66445,9 @@ BEGIN JOIN itemType it ON i.typeFk = it.id JOIN itemCategory ic ON ic.id = it.categoryFk JOIN worker w ON w.id = it.workerFk - JOIN tmp.buyUltimate bu ON bu.itemFk = i.id AND bu.warehouseFk = vWarehouse + JOIN tmp.buyUltimate bu ON bu.itemFk = i.id AND bu.warehouseFk = vWarehouseFk JOIN buy b ON b.id = bu.buyFk - WHERE ic.display <> 0 AND w.id = vWorker; + WHERE ic.display AND w.id = vWorker; DROP TEMPORARY TABLE tmp.buyUltimate, @@ -65657,8 +66458,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `stockBuyed_add` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -65666,6 +66465,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `stockBuyed_add`(vDated DATE) BEGIN @@ -65676,15 +66477,15 @@ BEGIN */ CALL vn.stockTraslation(vDated); - DELETE - FROM vn.stockBuyed + DELETE + FROM vn.stockBuyed WHERE `date` = vDated; INSERT INTO vn.stockBuyed(`user`, buyed, `date`, description) - SELECT it.workerFk, - SUM(( ti.amount / b.packing ) * vn.buy_getVolume(b.id)) / vc.palletM3 / 1000000 buyed, + SELECT it.workerFk, + SUM(( ti.amount / b.packing ) * vn.buy_getVolume(b.id)) / vc.palletM3 / 1000000 buyed, vDated, - u.name + u.name FROM tmp_item ti JOIN vn.item i ON i.id = ti.item_id JOIN vn.itemType it ON it.id = i.typeFk @@ -65696,18 +66497,18 @@ BEGIN JOIN account.`user` u ON u.id = it.workerFk WHERE ic.display != 0 GROUP BY it.workerFk; - + INSERT INTO stockBuyed(buyed, `date`, description) SELECT SUM(ic.cm3 * ito.quantity / vc.palletM3 / 1000000), vDated, IF(c.country = 'España',p.name,c.country) destiny FROM vn.itemTicketOut ito - JOIN vn.ticket t ON t.id = ito.ticketFk - JOIN vn.address a ON a.id = t.addressFk - JOIN vn.province p ON p.id = a.provinceFk + JOIN vn.ticket t ON t.id = ito.ticketFk + JOIN vn.address a ON a.id = t.addressFk + JOIN vn.province p ON p.id = a.provinceFk JOIN vn.country c ON c.id = p.countryFk JOIN vn.warehouse wh ON wh.id = t.warehouseFk JOIN vn.itemCost ic ON ic.itemFk = ito.itemFk AND ic.warehouseFk = t.warehouseFk JOIN vn.volumeConfig vc - WHERE ito.shipped BETWEEN vDated AND util.dayend(vDated) + WHERE ito.shipped BETWEEN vDated AND util.dayend(vDated) AND wh.code = 'VNH' GROUP BY destiny; @@ -65720,23 +66521,23 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `stockTraslation` */; /*!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 = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; -/*!50003 SET collation_connection = utf8mb4_general_ci */ ; +/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `stockTraslation`(vDate DATE) BEGIN - /** - * Calcula el stock del vWarehouse desde FechaInventario hasta v_date - sin tener en cuenta las salidas del mismo dia vDate - para ver el transporte a reservar - **/ +/** + * Calcula el stock del vWarehouse desde FechaInventario hasta v_date + * sin tener en cuenta las salidas del mismo dia vDate + * para ver el transporte a reservar + */ DECLARE vWarehouse INT DEFAULT 7; @@ -65746,21 +66547,21 @@ BEGIN CREATE TEMPORARY TABLE tmp_item (UNIQUE INDEX i USING HASH (item_id)) ENGINE = MEMORY - SELECT item_id, SUM(amount) amount + SELECT item_id, SUM(amount) amount FROM vn2008.item_entry_in - WHERE dat = vDate - AND vDate >= util.VN_CURDATE() + WHERE dat = vDate + AND vDate >= util.VN_CURDATE() AND warehouse_id = vWarehouse AND isVirtualStock is FALSE - GROUP BY item_id + GROUP BY item_id HAVING amount != 0; CALL `cache`.stock_refresh (FALSE); INSERT INTO tmp_item (item_id,amount) - SELECT item_id,s.amount + SELECT item_id,s.amount FROM `cache`.stock s - WHERE warehouse_id = vWarehouse + WHERE warehouse_id = vWarehouse ON DUPLICATE KEY UPDATE amount = tmp_item.amount + VALUES(amount); CALL buyUltimate(vWarehouse,vDate); @@ -65771,8 +66572,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `subordinateGetList` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -65780,6 +66579,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `subordinateGetList`(vBossFk INT) BEGIN @@ -65788,10 +66589,10 @@ BEGIN DECLARE vBossId INT; DECLARE vDone BOOL; DECLARE workerCur CURSOR FOR - SELECT workerFk - FROM tmp.subordinate + SELECT workerFk + FROM tmp.subordinate WHERE NOT isChecked; - + DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE; DECLARE EXIT HANDLER FOR 1062 BEGIN @@ -65799,29 +66600,29 @@ BEGIN END; DROP TEMPORARY TABLE IF EXISTS tmp.subordinate; - + CREATE TEMPORARY TABLE tmp.subordinate (PRIMARY KEY (workerFk)) ENGINE = MEMORY SELECT vBossFk AS workerFk, 0 AS isChecked; - + WHILE (SELECT COUNT(*) FROM tmp.subordinate WHERE NOT isChecked) > 0 DO OPEN workerCur; workerLoop: LOOP SET vDone = FALSE; FETCH workerCur INTO vBossId; - + IF vDone THEN LEAVE workerLoop; END IF; - - INSERT INTO tmp.subordinate - SELECT id, 0 - FROM worker + + INSERT INTO tmp.subordinate + SELECT id, 0 + FROM worker WHERE bossFk = vBossId; - - UPDATE tmp.subordinate + + UPDATE tmp.subordinate SET isChecked = 1 WHERE workerFk = vBossId; END LOOP; @@ -65834,8 +66635,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `supplierExpenses` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -65843,6 +66642,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `supplierExpenses`(vEnded DATE) BEGIN @@ -65861,13 +66662,13 @@ BEGIN -- Calcula el balance inicial y final de cada proveedor INSERT INTO openingBalance SELECT MAX(dueDated), - supplierFk, - companyFk, + supplierFk, + companyFk, sum(amount) eurAmount, sum(divisa) foreignAmount FROM ( SELECT p.dueDated, - p.supplierFk, + p.supplierFk, p.companyFk, p.amount, p.divisa @@ -65883,7 +66684,7 @@ BEGIN SELECT iidd.dueDated, ii.supplierFk, ii.companyFk, - - iidd.amount, + - iidd.amount, - iidd.foreignValue FROM invoiceIn ii JOIN invoiceInDueDay iidd ON ii.id = iidd.invoiceInFk @@ -65891,14 +66692,14 @@ BEGIN JOIN company co ON co.id = ii.companyFk WHERE iidd.dueDated > '2014-12-31' AND iidd.dueDated <= vEnded - AND ii.isBooked AND co.`code` = 'VNL' + AND ii.isBooked AND co.`code` = 'VNL' AND c.`code` <> 'EUR' UNION ALL SELECT se.dueDated, se.supplierFk, se.companyFk, - - se.amount, + - se.amount, 0 FROM supplierExpense se JOIN currency c ON c.id = se.currencyFk @@ -65908,7 +66709,7 @@ BEGIN AND co.`code` = 'VNL' AND c.`code` <> 'EUR' ) sub GROUP BY companyFk, supplierFk; - + SELECT ob.dueDated , ob.supplierFk , ob.companyFk @@ -65926,8 +66727,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `supplierPackaging_ReportSource` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -65935,6 +66734,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `supplierPackaging_ReportSource`(vFromDated DATE, vSupplierFk INT) BEGIN @@ -65995,7 +66796,7 @@ BEGIN SELECT MAX(`row`) INTO vMaxRow FROM tmp.supplierPackagingList; - + DROP TEMPORARY TABLE IF EXISTS tmp.supplierPackaging; CREATE TEMPORARY TABLE tmp.supplierPackaging( supplierFk INT, @@ -66009,7 +66810,7 @@ BEGIN warehouse INT, buyingValue INT, balance INT); - + l1: LOOP IF vCounter = vMaxRow THEN @@ -66018,12 +66819,12 @@ BEGIN SET vCounter = vCounter + 1; SET @vBalance = 0; END IF; - + SELECT itemFk INTO vItemFk FROM tmp.supplierPackagingList WHERE `row` = vCounter; - + INSERT INTO tmp.supplierPackaging SELECT supplierFk, itemFk, @@ -66051,9 +66852,9 @@ BEGIN WHERE supplierFk = vSupplierFk AND landed >= vFromDated AND itemFk = vItemFk - + UNION ALL - + SELECT vSupplierFk, itemFk, longName, @@ -66088,8 +66889,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `supplier_checkBalance` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -66097,6 +66896,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `supplier_checkBalance`(IN vDateTo DATETIME, IN vIsConciliated BOOL) BEGIN @@ -66133,7 +66934,7 @@ BEGIN - SUM(iid.amount) mysql, 0 sage FROM invoiceInDueDay iid - JOIN invoiceIn ii ON ii.id = iid.invoiceInFk + JOIN invoiceIn ii ON ii.id = iid.invoiceInFk WHERE IFNULL(ii.bookEntried, ii.issued) BETWEEN vDateFrom AND vDateTo AND ii.isBooked GROUP BY ii.id @@ -66175,8 +66976,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `supplier_checkIsActive` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -66184,6 +66983,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `supplier_checkIsActive`(vSelf INT) BEGIN @@ -66205,8 +67006,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `supplier_disablePayMethodChecked` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -66214,6 +67013,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `supplier_disablePayMethodChecked`() BEGIN @@ -66241,8 +67042,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `test` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -66250,6 +67049,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `test`() BEGIN @@ -66260,8 +67061,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `ticketBoxesView` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -66269,18 +67068,20 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `ticketBoxesView`(IN vTicketFk INT) BEGIN - - SELECT s.id, - s.itemFk, - s.concept, - floor(s.quantity / b.packing) as Cajas, - b.packing, - s.isPicked, + + SELECT s.id, + s.itemFk, + s.concept, + floor(s.quantity / b.packing) as Cajas, + b.packing, + s.isPicked, i.size - FROM ticket t + FROM ticket t JOIN sale s ON s.ticketFk = t.id JOIN item i ON i.id = s.itemFk JOIN cache.last_buy lb on lb.warehouse_id = t.warehouseFk AND lb.item_id = s.itemFk @@ -66291,15 +67092,13 @@ BEGIN AND p.isBox GROUP BY s.itemFk; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `ticketBuiltTime` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -66307,13 +67106,15 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `ticketBuiltTime`(vDate DATE) BEGIN DECLARE vDateStart DATETIME DEFAULT DATE(vDate); DECLARE vDateEnd DATETIME DEFAULT util.dayEnd(vDate); - + DROP TEMPORARY TABLE IF EXISTS tmp.ticketBuiltTime; CREATE TEMPORARY TABLE tmp.ticketBuiltTime @@ -66326,21 +67127,21 @@ BEGIN SELECT ticketFk, builtTime FROM ( - SELECT - Id_Ticket as ticketFk, - odbc_date as builtTime + SELECT + ticketFk, + created as builtTime FROM - vncontrol.inter - WHERE odbc_date BETWEEN vDateStart AND vDateEnd - ORDER BY Id_Ticket, odbc_date DESC + ticketTracking + WHERE created BETWEEN vDateStart AND vDateEnd + ORDER BY ticketFk, created DESC LIMIT 10000000000000000000 - ) sub + ) sub GROUP BY ticketFk ) sub2 ON sub2.ticketFk = t.id WHERE t.shipped BETWEEN vDate AND util.dayEnd(vDate) AND t.clientFk NOT IN (50,400,200) AND t.companyFk = 442 - + ; END ;; @@ -66349,8 +67150,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `ticketCalculateClon` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -66358,6 +67157,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `ticketCalculateClon`(IN vTicketNew INT, vTicketOld INT) BEGIN @@ -66377,10 +67178,10 @@ BEGIN DECLARE vZoneFk INT; REPLACE INTO orderTicket(orderFk,ticketFk) - SELECT orderFk, vTicketNew - FROM orderTicket + SELECT orderFk, vTicketNew + FROM orderTicket WHERE ticketFk = vTicketOld; - + SELECT t.clientFk, t.warehouseFk, date(t.shipped), t.addressFk, t.agencyModeFk, t.landed, a.agencyFk, t.zoneFk INTO vClient, vWarehouse, vShipped, vAddress, vAgencyMode, vLanded, vAgency, vZoneFk FROM agencyMode a @@ -66390,47 +67191,47 @@ BEGIN IF vLanded IS NULL THEN CALL zone_getLanded(vShipped, vAddress, vAgency, vWarehouse, TRUE); UPDATE ticket t - JOIN tmp.zoneGetLanded zgl ON t.warehouseFk = zgl.warehouseFk + JOIN tmp.zoneGetLanded zgl ON t.warehouseFk = zgl.warehouseFk SET t.landed = zgl.landed, t.zoneFk = zgl.zoneFk WHERE t.id = vTicketNew; - + SELECT zoneFk INTO vZoneFk FROM tmp.zoneGetLanded LIMIT 1; DROP TEMPORARY TABLE IF EXISTS tmp.zoneGetLanded; END IF; -- rellena la tabla tmp.buyUltimate con la ultima compra - CALL buyUltimate(vWarehouse, vShipped); + CALL buyUltimate(vWarehouse, vShipped); DROP TEMPORARY TABLE IF EXISTS tmp.ticketLot; - CREATE TEMPORARY TABLE tmp.ticketLot + CREATE TEMPORARY TABLE tmp.ticketLot SELECT vWarehouse warehouseFk, NULL available, s.itemFk, bu.buyFk, vZoneFk zoneFk FROM sale s LEFT JOIN tmp.buyUltimate bu ON bu.itemFk = s.itemFk WHERE s.ticketFk = vTicketOld GROUP BY s.itemFk; - - CALL catalog_componentPrepare(); + + CALL catalog_componentPrepare(); CALL catalog_componentCalculate(vZoneFk, vAddress, vShipped, vWarehouse); -- Bionizamos lineas con Preu = 0 DROP TEMPORARY TABLE IF EXISTS tmp.sale; CREATE TEMPORARY TABLE tmp.sale (PRIMARY KEY (saleFk)) ENGINE = MEMORY - SELECT s.id saleFk, vWarehouse warehouseFk + SELECT s.id saleFk, vWarehouse warehouseFk FROM sale s JOIN ticket t on t.id = s.ticketFk WHERE s.ticketFk = vTicketNew AND s.price = 0; - + CALL ticketComponentUpdateSale(1); -- Bionizamos lineas con Preu > 0 DROP TEMPORARY TABLE IF EXISTS tmp.sale; CREATE TEMPORARY TABLE tmp.sale (PRIMARY KEY (saleFk)) ENGINE = MEMORY - SELECT s.id saleFk, vWarehouse warehouseFk - FROM sale s + SELECT s.id saleFk, vWarehouse warehouseFk + FROM sale s JOIN ticket t on t.id = s.ticketFk WHERE s.ticketFk = vTicketNew AND s.price > 0; - + CALL ticketComponentUpdateSale(6); -- Log @@ -66438,19 +67239,17 @@ BEGIN -- Limpieza CALL catalog_componentPurge(); - DROP TEMPORARY TABLE IF EXISTS - tmp.buyUltimate, - tmp.sale, + DROP TEMPORARY TABLE IF EXISTS + tmp.buyUltimate, + tmp.sale, tmp.zoneGetLanded; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `ticketCalculateFromType` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -66458,6 +67257,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `ticketCalculateFromType`( vLanded DATE, vAddressFk INT, @@ -66465,12 +67266,12 @@ CREATE DEFINER=`root`@`localhost` PROCEDURE `ticketCalculateFromType`( vLanded D vTypeFk INT) BEGIN DROP TEMPORARY TABLE IF EXISTS tmp.item; - CREATE TEMPORARY TABLE tmp.item - (INDEX (itemFk)) - ENGINE = MEMORY + CREATE TEMPORARY TABLE tmp.item + (INDEX (itemFk)) + ENGINE = MEMORY SELECT id itemFk FROM vn.item WHERE typeFk = vTypeFk; - + CALL catalog_calculate(vLanded, vAddressFk, vAgencyModeFk); DROP TEMPORARY TABLE tmp.item; DROP TEMPORARY TABLE tmp.ticketLot; @@ -66480,8 +67281,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `ticketCalculatePurge` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -66489,10 +67288,12 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `ticketCalculatePurge`() BEGIN - DROP TEMPORARY TABLE + DROP TEMPORARY TABLE tmp.ticketCalculateItem, tmp.ticketComponentPrice, tmp.ticketComponent, @@ -66504,8 +67305,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `ticketClon` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -66513,67 +67312,67 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `ticketClon`(vTicketFk INT, vNewShipped DATE) BEGIN - + DECLARE done INT DEFAULT FALSE; - DECLARE vNewTicketFk INT; + DECLARE vNewTicketFk INT; DECLARE vOldSaleFk INT; DECLARE vNewSaleFk INT; - + DECLARE cur1 CURSOR FOR SELECT id FROM vn.sale WHERE ticketFk = vTicketFk; - + DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE; - + SET vNewShipped = IFNULL(vNewShipped, util.VN_CURDATE()); - + CALL vn.ticket_Clone(vTicketFk, vNewTicketFk); - - UPDATE vn.ticket + + UPDATE vn.ticket SET landed = TIMESTAMPADD(DAY, DATEDIFF(vNewShipped, shipped), landed), shipped = vNewShipped WHERE id = vNewTicketFk; - + OPEN cur1; - + read_loop: LOOP - + FETCH cur1 INTO vOldSaleFk; - + IF done THEN LEAVE read_loop; END IF; - + INSERT INTO vn.sale(ticketFk, itemFk, quantity, concept, price, discount, priceFixed, isPriceFixed) SELECT vNewTicketFk, itemFk, quantity, concept, price, discount, priceFixed, isPriceFixed FROM vn.sale WHERE id = vOldSaleFk; - + SELECT max(id) INTO vNewSaleFk FROM vn.sale WHERE ticketFk = vNewTicketFk; - + INSERT INTO vn.saleComponent(saleFk, componentFk, value, isGreuge) SELECT vNewSaleFk, componentFk, value, isGreuge FROM vn.saleComponent WHERE saleFk = vOldSaleFk; - + END LOOP; CLOSE cur1; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `ticketClon_OneYear` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -66581,24 +67380,26 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `ticketClon_OneYear`(vTicketFk INT) BEGIN DECLARE vShipped DATE; DECLARE vMaxDated DATE; - - SELECT shipped, TIMESTAMPADD(YEAR,1,shipped) + + SELECT shipped, TIMESTAMPADD(YEAR,1,shipped) INTO vShipped, vMaxDated FROM vn.ticket WHERE id = vTicketFk; - + WHILE vShipped <= vMaxDated DO - + SET vShipped = TIMESTAMPADD(WEEK, 1, vShipped); - + CALL vn.ticketClon(vTicketFk, vShipped); - + END WHILE; END ;; @@ -66607,8 +67408,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `ticketCollection_get` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -66616,22 +67415,22 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `ticketCollection_get`(vTicketFk INT) BEGIN - SELECT tc.collectionFk + SELECT tc.collectionFk FROM vn.ticketCollection tc WHERE ticketFk = vTicketFk; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `ticketCollection_setUsedShelves` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -66639,29 +67438,29 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `ticketCollection_setUsedShelves`(vTicketFk INT, vUsedShelves INT) BEGIN - + /* * Inserta número de baldas que ocupa un ticket - * + * * @param vTicketFk Identificador de ticket * @param vUsedShelves Número de baldas */ - + UPDATE ticketCollection tc SET tc.usedShelves = vUsedShelves WHERE tc.ticketFk = vTicketFk; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `ticketComponentUpdate` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -66669,6 +67468,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `ticketComponentUpdate`( vTicketFk INT, @@ -66691,18 +67492,18 @@ BEGIN END; START TRANSACTION; - + IF (SELECT addressFk FROM ticket WHERE id = vTicketFk) <> vAddressFk THEN - - UPDATE ticket t + + UPDATE ticket t JOIN address a ON a.id = vAddressFk SET t.nickname = a.nickname WHERE t.id = vTicketFk; - + END IF; - + UPDATE ticket t - SET + SET t.clientFk = vClientFk, t.agencyModeFk = vAgencyModeFk, t.addressFk = vAddressFk, @@ -66713,12 +67514,12 @@ BEGIN t.isDeleted = vIsDeleted WHERE t.id = vTicketFk; - + IF vHasToBeUnrouted THEN UPDATE ticket t SET t.routeFk = NULL WHERE t.id = vTicketFk; END IF; - + IF vOption <> 8 THEN DROP TEMPORARY TABLE IF EXISTS tmp.sale; CREATE TEMPORARY TABLE tmp.sale @@ -66738,8 +67539,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `ticketComponentUpdateSale` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -66747,6 +67546,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `ticketComponentUpdateSale`(vOption INT) BEGIN @@ -66760,104 +67561,104 @@ BEGIN DECLARE vComponentFk INT; DECLARE vRenewComponents BOOLEAN; DECLARE vKeepPrices BOOLEAN; - + CASE vOption - WHEN 1 THEN + WHEN 1 THEN SET vRenewComponents = TRUE; SET vKeepPrices = FALSE; WHEN 2 THEN - SELECT id INTO vComponentFk FROM component WHERE `code` = 'debtCollection'; + SELECT id INTO vComponentFk FROM component WHERE `code` = 'debtCollection'; SET vRenewComponents = TRUE; SET vKeepPrices = TRUE; - WHEN 3 THEN - SELECT id INTO vComponentFk FROM component WHERE `code` = 'mana'; + WHEN 3 THEN + SELECT id INTO vComponentFk FROM component WHERE `code` = 'mana'; + SET vRenewComponents = TRUE; + SET vKeepPrices = TRUE; + WHEN 4 THEN + SELECT id INTO vComponentFk FROM component WHERE `code` = 'buyerDiscount'; SET vRenewComponents = TRUE; SET vKeepPrices = TRUE; - WHEN 4 THEN - SELECT id INTO vComponentFk FROM component WHERE `code` = 'buyerDiscount'; - SET vRenewComponents = TRUE; - SET vKeepPrices = TRUE; - /* WHEN 5 THEN + /* WHEN 5 THEN SET vComponentFk = 35; SET vRenewComponents = TRUE; SET vKeepPrices = TRUE;*/ - WHEN 6 THEN + WHEN 6 THEN SELECT id INTO vComponentFk FROM component WHERE `code` = 'imbalance'; SET vRenewComponents = TRUE; SET vKeepPrices = TRUE; WHEN 7 THEN REPLACE INTO saleComponent(saleFk, componentFk, value) - SELECT s.id, 28, ROUND(((s.price * (100 - s.discount) / 100) - SUM(IFNULL(sc.value, 0))) * 0.8, 3) + SELECT s.id, 28, ROUND(((s.price * (100 - s.discount) / 100) - SUM(IFNULL(sc.value, 0))) * 0.8, 3) FROM sale s JOIN tmp.sale tmps ON tmps.saleFk = s.id - LEFT JOIN saleComponent sc ON sc.saleFk = s.id + LEFT JOIN saleComponent sc ON sc.saleFk = s.id AND sc.componentFk NOT IN (28, 29) GROUP BY s.id; - + REPLACE INTO saleComponent(saleFk, componentFk, value) - SELECT s.id, 29, ROUND(((s.price * (100 - s.discount) / 100) - SUM(IFNULL(sc.value, 0))) * 0.2, 3) + SELECT s.id, 29, ROUND(((s.price * (100 - s.discount) / 100) - SUM(IFNULL(sc.value, 0))) * 0.2, 3) FROM sale s JOIN tmp.sale tmps ON tmps.saleFk = s.id - LEFT JOIN saleComponent sc ON sc.saleFk = s.id + LEFT JOIN saleComponent sc ON sc.saleFk = s.id AND sc.componentFk NOT IN (28, 29) GROUP BY s.id; - + SET vRenewComponents = FALSE; SET vKeepPrices = FALSE; WHEN 8 THEN - DELETE sc.* + DELETE sc.* FROM tmp.sale tmps JOIN saleComponent sc ON sc.saleFk = tmps.saleFk; - + REPLACE INTO saleComponent(saleFk, componentFk, value) - SELECT s.id, 28, ROUND(((s.price * (100 - s.discount) / 100)), 3) + SELECT s.id, 28, ROUND(((s.price * (100 - s.discount) / 100)), 3) FROM sale s JOIN tmp.sale tmps ON tmps.saleFk = s.id; - + SET vRenewComponents = FALSE; SET vKeepPrices = FALSE; - WHEN 9 THEN + WHEN 9 THEN SET vRenewComponents = TRUE; SET vKeepPrices = TRUE; END CASE; IF vRenewComponents THEN - DELETE sc.* - FROM tmp.sale tmps + DELETE sc.* + FROM tmp.sale tmps JOIN saleComponent sc ON sc.saleFk = tmps.saleFk JOIN `component` c ON c.id = sc.componentFk WHERE c.isRenewable; - + REPLACE INTO saleComponent(saleFk, componentFk, value) SELECT s.id, tc.componentFk, tc.cost - FROM sale s + FROM sale s JOIN tmp.sale tmps ON tmps.saleFk = s.id JOIN tmp.ticketComponent tc ON tc.itemFk = s.itemFk AND tc.warehouseFk = tmps.warehouseFk - LEFT JOIN saleComponent sc ON sc.saleFk = s.id - AND sc.componentFk = tc.componentFk - LEFT JOIN `component` c ON c.id = tc.componentFk + LEFT JOIN saleComponent sc ON sc.saleFk = s.id + AND sc.componentFk = tc.componentFk + LEFT JOIN `component` c ON c.id = tc.componentFk WHERE IF(sc.componentFk IS NULL AND NOT c.isRenewable, FALSE, TRUE); - - -- Añadir componente venta por paquete + + -- Añadir componente venta por paquete DROP TEMPORARY TABLE IF EXISTS tmp.sale2; CREATE TEMPORARY TABLE tmp.sale2 (PRIMARY KEY (saleFk)) - ENGINE = MEMORY + ENGINE = MEMORY SELECT * FROM tmp.sale; - + DROP TEMPORARY TABLE IF EXISTS tmp.ticketComponent2; CREATE TEMPORARY TABLE tmp.ticketComponent2 - SELECT * FROM tmp.ticketComponent; - - REPLACE INTO saleComponent(saleFk, componentFk, value) + SELECT * FROM tmp.ticketComponent; + + REPLACE INTO saleComponent(saleFk, componentFk, value) SELECT t.id, t.componentFk, t.cost FROM ( SELECT s.id, tc.componentFk, tc.cost, MOD(s.quantity, b.packing) as resto FROM vn.sale s JOIN tmp.sale tmps ON tmps.saleFk = s.id - JOIN cache.last_buy lb ON lb.item_id = s.itemFk AND tmps.warehouseFk = lb.warehouse_id + JOIN cache.last_buy lb ON lb.item_id = s.itemFk AND tmps.warehouseFk = lb.warehouse_id JOIN vn.buy b ON b.id = buy_id JOIN tmp.ticketComponent tc ON tc.itemFk = s.itemFk AND tc.warehouseFk = tmps.warehouseFk - JOIN `component` c ON c.id = tc.componentFk AND c.code = 'salePerPackage' + JOIN `component` c ON c.id = tc.componentFk AND c.code = 'salePerPackage' LEFT JOIN ( SELECT s.id FROM vn.sale s @@ -66868,8 +67669,8 @@ BEGIN ) tp ON tp.id = s.id WHERE tp.id IS NULL HAVING resto <> 0) t; - - DROP TEMPORARY TABLE IF EXISTS + + DROP TEMPORARY TABLE IF EXISTS tmp.sale2, tmp.ticketComponent2; END IF; @@ -66887,26 +67688,26 @@ BEGIN UPDATE sale s JOIN item i on i.id = s.itemFk JOIN itemType it on it.id = i.typeFk - JOIN (SELECT SUM(sc.value) sumValue, sc.saleFk + JOIN (SELECT SUM(sc.value) sumValue, sc.saleFk FROM saleComponent sc JOIN tmp.sale tmps ON tmps.saleFk = sc.saleFk GROUP BY sc.saleFk) sc ON sc.saleFk = s.id SET s.price = sumValue / ((100 - s.discount) / 100) - WHERE it.code != 'PRT' ; - + WHERE it.code != 'PRT' ; + REPLACE INTO saleComponent(saleFk, componentFk, value) SELECT s.id, 21, ROUND((s.price * (100 - s.discount) / 100) - SUM(value), 3) saleValue FROM sale s JOIN tmp.sale tmps ON tmps.saleFk = s.id LEFT JOIN saleComponent sc ON sc.saleFk = s.id WHERE sc.componentFk != 21 - GROUP BY s.id + GROUP BY s.id HAVING ROUND(saleValue, 4) <> 0; END IF; - + UPDATE sale s JOIN ( - SELECT SUM(sc.value) sumValue, sc.saleFk + SELECT SUM(sc.value) sumValue, sc.saleFk FROM saleComponent sc JOIN tmp.sale tmps ON tmps.saleFk = sc.saleFk JOIN `component` c ON c.id = sc.componentFk @@ -66920,10 +67721,10 @@ BEGIN JOIN sale s on s.id = sc.saleFk JOIN item i ON i.id = s.itemFk JOIN itemType it ON it.id = i.typeFk - WHERE it.code = 'PRT'; - + WHERE it.code = 'PRT'; + INSERT INTO saleComponent(saleFk, componentFk, value) - SELECT s.id, 15, s.price + SELECT s.id, 15, s.price FROM sale s JOIN tmp.sale tmps ON tmps.saleFk = s.id JOIN item i ON i.id = s.itemFK @@ -66935,8 +67736,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `ticketCreate` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -66944,6 +67743,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `ticketCreate`( vClientId INT @@ -66963,8 +67764,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `ticketCreateWithUser` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -66972,6 +67771,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `ticketCreateWithUser`( vClientId INT @@ -67004,8 +67805,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `ticketDown_PrintableSelection` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -67013,6 +67812,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `ticketDown_PrintableSelection`(vSectorFk INT) BEGIN @@ -67039,8 +67840,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `ticketGetTaxAdd` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -67048,6 +67847,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `ticketGetTaxAdd`(vTicketFk INT) BEGIN @@ -67059,32 +67860,30 @@ BEGIN CREATE TEMPORARY TABLE tmp.ticket ENGINE = MEMORY SELECT vTicketFk ticketFk; - + CALL vn.ticket_getTax(NULL); - SELECT + SELECT tt.ticketFk, CAST(tt.taxableBase AS DECIMAL(10, 2)) AS taxableBase, CAST(tt.rate * tt.taxableBase / 100 AS DECIMAL(10, 2)) AS tax, - pgc.*, + pgc.*, CAST(IF(pe.equFk IS NULL, taxableBase, 0) AS DECIMAL(10, 2)) AS Base, pgc.rate / 100 as vatPercent FROM tmp.ticketTax tt JOIN vn.pgc ON pgc.code = tt.pgcFk LEFT JOIN vn.pgcEqu pe ON pe.equFk = pgc.code; - + DROP TEMPORARY TABLE tmp.ticket; DROP TEMPORARY TABLE tmp.ticketTax; DROP TEMPORARY TABLE tmp.ticketAmount; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `ticketGetTax_new` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -67092,6 +67891,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `ticketGetTax_new`() READS SQL DATA @@ -67114,29 +67915,29 @@ BEGIN JOIN ticket t ON t.id = tmpTicket.ticketFk; CALL addressTaxArea (); - + DROP TEMPORARY TABLE IF EXISTS tmp.ticketTax; CREATE TEMPORARY TABLE tmp.ticketTax (INDEX (ticketFk)) ENGINE = MEMORY SELECT tmpTicket.ticketFk, bp.pgcFk, - SUM(ROUND(s.quantity * s.price * (100 - s.discount)/100,2) + SUM(ROUND(s.quantity * s.price * (100 - s.discount)/100,2) ) AS taxableBase, SUM(ROUND(s.quantity * s.price * (100 - s.discount)/100,2) ) * pgc.rate / 100 AS tax, tc.code - + FROM tmp.ticket tmpTicket JOIN sale s ON s.ticketFk = tmpTicket.ticketFk JOIN item i ON i.id = s.itemFk JOIN ticket t ON t.id = tmpTicket.ticketFk JOIN supplier su ON su.id = t.companyFk - JOIN tmp.addressTaxArea ata + JOIN tmp.addressTaxArea ata ON ata.addressFk = t.addressFk AND ata.companyFk = t.companyFk - JOIN itemTaxCountry itc + JOIN itemTaxCountry itc ON itc.itemFk = i.id AND itc.countryFk = su.countryFk - JOIN bookingPlanner bp + JOIN bookingPlanner bp ON bp.countryFk = su.countryFk AND bp.taxAreaFk = ata.areaFk AND bp.taxClassFk = itc.taxClassFk @@ -67144,7 +67945,7 @@ BEGIN JOIN taxClass tc ON tc.id = bp.taxClassFk GROUP BY tmpTicket.ticketFk, pgc.code HAVING taxableBase != 0; - + DROP TEMPORARY TABLE IF EXISTS tmp.ticketAmount; CREATE TEMPORARY TABLE tmp.ticketAmount (INDEX (ticketFk)) @@ -67155,15 +67956,13 @@ BEGIN DROP TEMPORARY TABLE IF EXISTS tmp.addressCompany; DROP TEMPORARY TABLE IF EXISTS tmp.addressTaxArea; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `ticketGetTotal` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -67171,6 +67970,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `ticketGetTotal`() BEGIN @@ -67192,7 +67993,7 @@ BEGIN FROM tmp.ticket t LEFT JOIN tmp.ticketAmount ta ON t.ticketFk = ta.ticketFk GROUP BY ticketFk; - + DROP TEMPORARY TABLE IF EXISTS tmp.ticketAmount; DROP TEMPORARY TABLE IF EXISTS tmp.ticketTax; END ;; @@ -67201,8 +68002,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `ticketGetVisibleAvailable` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -67210,6 +68009,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `ticketGetVisibleAvailable`( vTicket INT) @@ -67247,8 +68048,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `ticketManaToPromo` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -67256,24 +68055,26 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `ticketManaToPromo`(vTicketFk INT) BEGIN - + DECLARE vManaComponent INT; - + DECLARE vPromoComponent INT; SELECT id INTO vManaComponent - FROM vn.component c + FROM vn.component c WHERE c.code = 'mana'; - + SELECT id INTO vPromoComponent - FROM vn.component c + FROM vn.component c WHERE c.code = 'floramondoPromo'; - + UPDATE vn.saleComponent sc - JOIN vn.sale s ON s.id = sc.saleFk + JOIN vn.sale s ON s.id = sc.saleFk SET componentFk = vPromoComponent WHERE componentFk = vManaComponent AND s.ticketFk = vTicketFk; @@ -67283,8 +68084,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `ticketMissed_List` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -67292,6 +68091,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `ticketMissed_List`(vTicketFk INT) BEGIN @@ -67300,18 +68101,18 @@ BEGIN DECLARE vParked DATETIME; DECLARE vLevel INT; DECLARE vCollectionFk INT; - - SELECT IFNULL(`level`,0), IFNULL(collectionFk,0) + + SELECT IFNULL(`level`,0), IFNULL(collectionFk,0) INTO vLevel, vCollectionFk FROM vn.ticketCollection WHERE ticketFk = vTicketFk LIMIT 1; - - SELECT created, parkingFk + + SELECT created, parkingFk INTO vParked, vParkingFk FROM vn.ticketParking WHERE ticketFk = vTicketFk; - + SELECT tp.ticketFk, CONCAT(tc.collectionFk, ' - ', tc.level) coleccion, tp.created, p.code, am.name as Agencia FROM vn.ticketParking tp JOIN vn.parking p ON p.id = tp.parkingFk @@ -67338,15 +68139,13 @@ BEGIN AND sc.isPackagingArea AND tp.created < vParked AND t.packages <=> 0); - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `ticketNotInvoicedByClient` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -67354,12 +68153,14 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `ticketNotInvoicedByClient`(vClientFk INT) BEGIN DROP TEMPORARY TABLE IF EXISTS tmp.ticket; - + CREATE TEMPORARY TABLE tmp.ticket SELECT id ticketFk FROM ticket @@ -67369,7 +68170,7 @@ BEGIN CALL vn.ticketGetTotal; - SELECT c.id, + SELECT c.id, c.name as Cliente, t.shipped as Fecha, t.id as Id_Ticket, @@ -67380,7 +68181,7 @@ BEGIN DROP TEMPORARY TABLE tmp.ticket, - tmp.ticketTotal; + tmp.ticketTotal; END ;; DELIMITER ; @@ -67388,8 +68189,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `ticketObservation_addNewBorn` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -67397,32 +68196,180 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `ticketObservation_addNewBorn`(vTicketFk INT) BEGIN - + /** * Inserta observaciones para los tickets con clientes nuevos o recuperados - * + * * @param vTicketFk Identificador de vn.ticket */ - + DECLARE vDescription VARCHAR(20) DEFAULT '¡Cliente NUEVO! '; INSERT INTO vn.ticketObservation(ticketFk, observationTypeFk, description) SELECT vTicketFk, ot.id, vDescription FROM vn.observationType ot WHERE ot.hasNewBornMessage - ON DUPLICATE KEY UPDATE description = CONCAT(vDescription, ticketObservation.description); - + ON DUPLICATE KEY UPDATE description = CONCAT(vDescription, ticketObservation.description); + END ;; DELIMITER ; /*!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 PROCEDURE IF EXISTS `ticketPackaging_add` */; +/*!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 = utf8mb4 */ ; +/*!50003 SET character_set_results = utf8mb4 */ ; +/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; +DELIMITER ;; +CREATE DEFINER=`root`@`localhost` PROCEDURE `ticketPackaging_add`( + vDated DATE, + vCompanyFk INT, + vWithoutPeriodGrace BOOLEAN) +BEGIN +/** + * Genera nuevos tickets de embalajes para los clientes no han los han retornado + * y actualiza los valores para la tabla ticketPackaging + * + * @param vDated Fecha hasta la cual se revisan los embalajes + * @param vCompanyFk Empresa de la cual se comprobaran sus clientes + * @param vWithoutPeriodGrace si no se aplica el periodo de gracia de un mes + */ + DECLARE vNewTicket INT; + DECLARE vDateStart DATE; + DECLARE vDateEnd DATE; + DECLARE vGraceDate DATE DEFAULT vDated; + DECLARE vWarehouseInventory INT; + DECLARE vComponentCost INT; + DECLARE vDone INT DEFAULT FALSE; + DECLARE vClientFk INT; + + DECLARE vCursor CURSOR FOR + SELECT DISTINCT clientFk + FROM ( + SELECT clientFk, SUM(quantity) totalQuantity + FROM tmp.packagingToInvoice + GROUP BY itemFk, clientFk + HAVING totalQuantity > 0)sub; + + DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE; + + DECLARE EXIT HANDLER FOR SQLEXCEPTION + BEGIN + ROLLBACK; + RESIGNAL; + END; + + SELECT id INTO vWarehouseInventory + FROM warehouse + WHERE `code`= 'inv'; + + SELECT id INTO vComponentCost + FROM component + WHERE `code`= 'purchaseValue'; + + SELECT packagingInvoicingDated INTO vDateStart + FROM ticketConfig; + + IF vWarehouseInventory IS NULL THEN + CALL util.throw('Warehouse inventory not seted'); + END IF; + + IF vComponentCost IS NULL THEN + CALL util.throw('Component cost not seted'); + END IF; + + SET vDateEnd = vDated + INTERVAL 1 DAY; + + IF NOT vWithoutPeriodGrace THEN + SET vGraceDate = vGraceDate -INTERVAL 1 MONTH; + END IF; + + DROP TEMPORARY TABLE IF EXISTS tmp.packagingToInvoice; + CREATE TEMPORARY TABLE tmp.packagingToInvoice + (INDEX (clientFk)) + ENGINE = MEMORY + SELECT p.itemFk, + tp.packagingFk, + tp.quantity, + tp.ticketFk, + p.price, + t.clientFk + FROM ticketPackaging tp + JOIN packaging p ON p.id = tp.packagingFk + JOIN ticket t ON t.id = tp.ticketFk + JOIN client c ON c.id = t.clientFk + WHERE c.isActive + AND t.shipped BETWEEN vDateStart AND vDateEnd + AND (tp.quantity < 0 OR (tp.quantity > 0 AND t.shipped < vGraceDate)) + AND tp.quantity + AND p.itemFk; + + OPEN vCursor; + l: LOOP + + FETCH vCursor INTO vClientFk; + + IF vDone THEN + LEAVE l; + END IF; + + START TRANSACTION; + + CALL ticket_add( + vClientFk, + vDateEnd, + vWarehouseInventory, + vCompanyFk, + NULL, + NULL, + NULL, + vDateEnd, + account.myUser_getId(), + TRUE, + vNewTicket); + + INSERT INTO ticketPackaging(ticketFk, packagingFk, quantity, pvp) + SELECT vNewTicket, packagingFk, - SUM(quantity) totalQuantity, price + FROM tmp.packagingToInvoice + WHERE clientFk = vClientFk + GROUP BY packagingFk + HAVING IF(vWithoutPeriodGrace, totalQuantity <> 0, totalQuantity < 0); + + INSERT INTO sale(ticketFk, itemFk, concept, quantity, price) + SELECT vNewTicket, pti.itemFk, i.name, SUM(pti.quantity) totalQuantity, pti.price + FROM tmp.packagingToInvoice pti + JOIN item i ON i.id = pti.itemFk + WHERE pti.clientFk = vClientFk + GROUP BY pti.itemFk + HAVING IF(vWithoutPeriodGrace, totalQuantity <> 0, totalQuantity > 0); + + INSERT INTO saleComponent(saleFk, componentFk, value) + SELECT id, vComponentCost, price + FROM sale + WHERE ticketFk = vNewTicket; + + COMMIT; + END LOOP; + CLOSE vCursor; + + DROP TEMPORARY TABLE tmp.packagingToInvoice; +END ;; +DELIMITER ; +/*!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 PROCEDURE IF EXISTS `ticketParking_findSkipped` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -67430,40 +68377,42 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `ticketParking_findSkipped`(vTicketFk INT, vItemPackingTypeFk VARCHAR(1)) BEGIN - + /** * Averigua los tickets que se han saltado por un error en el proceso encajado * @param vTicketFk Ticket * @param vItemPackingTypeFk Modo de encajado * @return un select con los tickets afectados - */ + */ DECLARE vParkingFk INT; DECLARE vParked DATETIME; DECLARE vLevel INT; DECLARE vWagon INT; DECLARE vCollectionFk INT; - - SELECT IFNULL(`level`,0), IFNULL(`wagon`,0),IFNULL(collectionFk,0) + + SELECT IFNULL(`level`,0), IFNULL(`wagon`,0),IFNULL(collectionFk,0) INTO vLevel, vWagon, vCollectionFk FROM vn.ticketCollection tc JOIN vn.collection c ON c.id = tc.collectionFk AND c.itemPackingTypeFk = vItemPackingTypeFk WHERE ticketFk = vTicketFk ORDER BY c.id DESC LIMIT 1; - - SELECT created, parkingFk + + SELECT created, parkingFk INTO vParked, vParkingFk FROM vn.ticketParking tp - JOIN vn.parking p ON p.id = tp.parkingFk - JOIN vn.sector s ON s.id = p.sectorFk + JOIN vn.parking p ON p.id = tp.parkingFk + JOIN vn.sector s ON s.id = p.sectorFk WHERE ticketFk = vTicketFk AND s.itemPackingTypeFk = vItemPackingTypeFk AND s.isPackagingArea ; - + SELECT tp.ticketFk, CONCAT(tc.collectionFk, ' ', tc.wagon, ' - ', tc.level) coleccion, tp.created, p.code, am.name as Agencia FROM vn.ticketParking tp JOIN vn.parking p ON p.id = tp.parkingFk @@ -67480,9 +68429,9 @@ BEGIN AND ( ( IFNULL(tc.collectionFk,-1) != IFNULL(@vCollectionFk,0) AND tp.created < vParked ) OR - ( tc.collectionFk = vCollectionFk + ( tc.collectionFk = vCollectionFk AND (LEFT(tc.wagon,1) < LEFT(vWagon,1) - OR (LEFT(tc.wagon,1) = LEFT(vWagon,1) AND LEFT(tc.level,1) < LEFT(vLevel,1))) + OR (LEFT(tc.wagon,1) = LEFT(vWagon,1) AND LEFT(tc.level,1) < LEFT(vLevel,1))) ) ) ) -- Etiquetas que no se han escaneado y ya estamos con una posterior @@ -67490,7 +68439,7 @@ BEGIN (s.alertLevel > 1 AND tp.parkingFk = vParkingFk AND sc.isPackagingArea - AND tp.created < vParked + AND tp.created < vParked AND t.packages <=> 0); END ;; DELIMITER ; @@ -67498,8 +68447,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `ticketRefund_beforeUpsert` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -67507,6 +68454,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `ticketRefund_beforeUpsert`(vRefundTicketFk INT, vOriginalTicketFk INT) BEGIN @@ -67529,8 +68478,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `ticketRequest_Add` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -67538,15 +68485,17 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `ticketRequest_Add`(vDescription VARCHAR(255), vQuantity INT, vPrice DOUBLE, vTicketFk INT, vBuyerCode VARCHAR(3)) BEGIN - INSERT INTO vn.ticketRequest(description, - quantity, - price, - ticketFk, - buyerCode, + INSERT INTO vn.ticketRequest(description, + quantity, + price, + ticketFk, + buyerCode, requesterFk) VALUES(vDescription, vQuantity, @@ -67554,15 +68503,13 @@ BEGIN vTicketFk, vBuyerCode, vn.getUser()); - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `ticketStateToday_setState` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -67570,28 +68517,69 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `ticketStateToday_setState`(vTicketFk INT, vStateCode VARCHAR(45)) BEGIN - + /* Modifica el estado de un ticket de hoy - * + * * @param vTicketFk el id del ticket * @param vStateCode estado a modificar del ticket - * + * */ - + DECLARE vAlertLevel INT; - - SELECT s.alertLevel INTO vAlertLevel - FROM state s - JOIN ticketStateToday tst ON tst.state = s.id + + SELECT s.alertLevel INTO vAlertLevel + FROM state s + JOIN ticketStateToday tst ON tst.state = s.id WHERE tst.ticket = vTicketFk LIMIT 1; - + IF vAlertLevel < 2 THEN - + CALL vn.ticket_setState(vTicketFk, vStateCode); + + END IF; + +END ;; +DELIMITER ; +/*!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 PROCEDURE IF EXISTS `ticketStateUpdate` */; +/*!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 = utf8mb4 */ ; +/*!50003 SET character_set_results = utf8mb4 */ ; +/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; +DELIMITER ;; +CREATE DEFINER=`root`@`localhost` PROCEDURE `ticketStateUpdate`(vTicketFk INT, vStateCode VARCHAR(45)) +BEGIN + + /* + * @deprecated:utilizar ticket_setState + */ + + DECLARE vAlertLevel INT; + + SELECT s.alertLevel INTO vAlertLevel + FROM vn.state s + JOIN vn.ticketState ts ON ts.stateFk = s.id + WHERE ts.ticketFk = vTicketFk; + + IF !(vStateCode = 'ON_CHECKING' AND vAlertLevel > 1) THEN + + INSERT INTO ticketTracking(stateFk, ticketFk, workerFk) + SELECT id, vTicketFk, account.myUser_getId() + FROM vn.state + WHERE `code` = vStateCode collate utf8_unicode_ci; END IF; @@ -67601,47 +68589,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; -/*!50003 DROP PROCEDURE IF EXISTS `ticketStateUpdate` */; -/*!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 = utf8mb4 */ ; -/*!50003 SET character_set_results = utf8mb4 */ ; -/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; -DELIMITER ;; -CREATE DEFINER=`root`@`localhost` PROCEDURE `ticketStateUpdate`(vTicketFk INT, vStateCode VARCHAR(45)) -BEGIN - - /* - * @deprecated:utilizar ticket_setState - */ - - DECLARE vAlertLevel INT; - - SELECT s.alertLevel INTO vAlertLevel - FROM vn.state s - JOIN vn.ticketState ts ON ts.stateFk = s.id - WHERE ts.ticketFk = vTicketFk; - - IF !(vStateCode = 'ON_CHECKING' AND vAlertLevel > 1) THEN - - INSERT INTO vncontrol.inter(state_id, Id_Ticket, Id_Trabajador) - SELECT id, vTicketFk, account.myUser_getId() - FROM vn.state - WHERE `code` = vStateCode collate utf8_unicode_ci; - - END IF; - -END ;; -DELIMITER ; -/*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `ticketToInvoiceByAddress` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -67649,6 +68596,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `ticketToInvoiceByAddress`( vStarted DATE, @@ -67676,8 +68625,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `ticketToInvoiceByDate` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -67685,6 +68632,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `ticketToInvoiceByDate`( vStarted DATE, @@ -67712,8 +68661,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `ticketToInvoiceByRef` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -67721,6 +68668,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `ticketToInvoiceByRef`(IN vInvoiceRef VARCHAR(15)) BEGIN @@ -67734,36 +68683,36 @@ BEGIN DECLARE vCountry INT; DECLARE vTaxArea VARCHAR(15); DECLARE vSpainCountryCode INT DEFAULT 1; - - SELECT id - INTO vInvoice - FROM vn.invoiceOut + + SELECT id + INTO vInvoice + FROM vn.invoiceOut WHERE ref = vInvoiceRef; - - SELECT s.countryFk + + SELECT s.countryFk INTO vCountry FROM vn.supplier s JOIN vn.invoiceOut io ON io.companyFk = s.id WHERE io.id = vInvoice; - + SELECT IF( - c.isEqualizated - AND c.countryFk = vSpainCountryCode + c.isEqualizated + AND c.countryFk = vSpainCountryCode AND i.taxAreaFk = 'NATIONAL', 'EQU', i.taxAreaFk ) INTO vTaxArea FROM vn.invoiceOutSerial i - JOIN vn.invoiceOut io ON io.serial = i.code + JOIN vn.invoiceOut io ON io.serial = i.code JOIN vn.client c ON c.id = io.clientFk WHERE io.id = vInvoice; - + DROP TEMPORARY TABLE IF EXISTS vn.ticketToInvoice; CREATE TEMPORARY TABLE vn.ticketToInvoice - SELECT id - FROM vn.ticket + SELECT id + FROM vn.ticket WHERE refFk = vInvoiceRef; END ;; @@ -67772,8 +68721,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `ticketTrackingAdd` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -67781,6 +68728,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `ticketTrackingAdd`(vTicketFk INT, vState VARCHAR(25) CHARSET UTF8, vWorkerFk INT) BEGIN @@ -67798,8 +68747,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `ticket_add` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -67807,6 +68754,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `ticket_add`( vClientId INT @@ -67825,6 +68774,8 @@ BEGIN DECLARE vPrice DECIMAL(10,2); DECLARE vBonus DECIMAL(10,2); DECLARE vIsActive BOOL; + DECLARE vNickname VARCHAR(100); + DECLARE vNewInstance JSON; IF vClientId IS NULL THEN CALL util.throw ('CLIENT_NOT_ESPECIFIED'); @@ -67890,8 +68841,29 @@ BEGIN JOIN agencyMode am ON am.id = a.agencyModeFk WHERE a.id = vAddressFk; + SELECT a.nickname INTO vNickname + FROM address a + WHERE a.id = vAddressFk; + SET vNewTicket = LAST_INSERT_ID(); + SET vNewInstance = JSON_OBJECT( + 'clientFk', vClientId, + 'shipped', vShipped, + 'addressFk', vAddressFk, + 'agencyModeFk', vAgencyModeFk, + 'nickname', vNickname, + 'warehouseFk', vWarehouseFk, + 'routeFk', vRouteFk, + 'companyFk', vCompanyFk, + 'landed', vlanded, + 'zoneFk', vZoneFk, + 'zonePrice', vPrice, + 'zoneBonus', vBonus + ); + CALL util.log_addWithUser('vn', 'ticket', + 'Ticket', vNewTicket, vNewTicket, 'insert', NULL, vNewInstance, vUserId); + INSERT INTO ticketObservation(ticketFk, observationTypeFk, description) SELECT vNewTicket, ao.observationTypeFk, ao.description FROM addressObservation ao @@ -67906,11 +68878,8 @@ BEGIN CALL vn.ticketObservation_addNewBorn(vNewTicket); END IF; - INSERT INTO vn.ticketLog - SET originFk = vNewTicket, userFk = vUserId, `action` = 'insert', description = CONCAT('Ha creado el ticket:', ' ', vNewTicket); - IF (SELECT ct.isCreatedAsServed FROM vn.clientType ct JOIN vn.client c ON c.typeFk = ct.code WHERE c.id = vClientId ) <> FALSE THEN - INSERT INTO vncontrol.inter(state_id, Id_Ticket, Id_Trabajador) + INSERT INTO ticketTracking(stateFk, ticketFk, workerFk) SELECT id, vNewTicket, account.myUser_getId() FROM state WHERE `code` = 'DELIVERED'; @@ -67921,8 +68890,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `ticket_administrativeCopy` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -67930,53 +68897,54 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `ticket_administrativeCopy`(vOriginalTicket INT, OUT vNewTicket INT) BEGIN - + INSERT INTO vn.ticket(clientFk, addressFk, shipped, warehouseFk, companyFk, landed) - SELECT t.clientFk , t.addressFk , t.shipped ,w.id, t.companyFk , t.landed + SELECT t.clientFk , t.addressFk , t.shipped ,w.id, t.companyFk , t.landed FROM vn.ticket t JOIN vn.warehouse w ON w.name = 'INVENTARIO' WHERE t.id = vOriginalTicket; - + SELECT LAST_INSERT_ID() INTO vNewTicket; INSERT INTO vn.sale(ticketFk, itemFk, concept, quantity, price, discount) - SELECT vNewTicket, s.itemFk , s.concept , s.quantity , s.price , s.discount + SELECT vNewTicket, s.itemFk , s.concept , s.quantity , s.price , s.discount FROM vn.sale s WHERE s.ticketFk = vOriginalTicket; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `ticket_canAdvance` */; /*!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 = utf8mb4 */ ; -/*!50003 SET character_set_results = utf8mb4 */ ; -/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET character_set_client = utf8mb3 */ ; +/*!50003 SET character_set_results = utf8mb3 */ ; +/*!50003 SET collation_connection = utf8mb3_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; -CREATE DEFINER=`root`@`localhost` PROCEDURE `ticket_canAdvance`(vDated DATE, vWarehouseFk INT) +CREATE DEFINER=`root`@`localhost` PROCEDURE `ticket_canAdvance`(vDateFuture DATE, vDateToAdvance DATE, vWarehouseFk INT) BEGIN /** * Devuelve los tickets y la cantidad de lineas de venta que se pueden adelantar. * - * @param vDated Fecha de los tickets que se quieren adelantar. + * @param vDateFuture Fecha de los tickets que se quieren adelantar. + * @param vDateToAdvance Fecha a cuando se quiere adelantar. * @param vWarehouseFk Almacén */ + DECLARE vDateInventory DATE; - DECLARE vDateToAdvance DATE; - SELECT inventoried INTO vDateInventory FROM vn.config; - - SET vDateToAdvance = TIMESTAMPADD(DAY,-1,vDated); + SELECT inventoried INTO vDateInventory FROM config; DROP TEMPORARY TABLE IF EXISTS tmp.stock; CREATE TEMPORARY TABLE tmp.stock @@ -67988,56 +68956,101 @@ BEGIN SELECT itemFk, SUM(quantity) amount FROM ( SELECT itemFk, quantity - FROM vn.itemTicketOut + FROM itemTicketOut WHERE shipped >= vDateInventory - AND shipped < vDated + AND shipped < vDateFuture AND warehouseFk = vWarehouseFk UNION ALL SELECT itemFk, quantity - FROM vn.itemEntryIn + FROM itemEntryIn WHERE landed >= vDateInventory - AND landed < vDated + AND landed < vDateFuture AND isVirtualStock = FALSE AND warehouseInFk = vWarehouseFk UNION ALL SELECT itemFk, quantity - FROM vn.itemEntryOut + FROM itemEntryOut WHERE shipped >= vDateInventory - AND shipped < vDated + AND shipped < vDateFuture AND warehouseOutFk = vWarehouseFk ) t GROUP BY itemFk HAVING amount != 0; - SELECT s.ticketFk ticketFuture, - sum((s.quantity <= IFNULL(st.amount,0))) hasStock, - count(DISTINCT s.id) saleCount, - st.name tfState, - GROUP_CONCAT(DISTINCT i.itemPackingTypeFk ORDER BY i.itemPackingTypeFk) tfIpt, - t2.ticketFk, - t2.state, - t2.ipt - FROM vn.ticket t - JOIN vn.ticketState ts ON ts.ticketFk = t.id - JOIN vn.state st ON st.id = ts.stateFk - LEFT JOIN (SELECT - t2.id ticketFk, - t2.addressFk, - st.name state, - GROUP_CONCAT(DISTINCT i.itemPackingTypeFk ORDER BY i.itemPackingTypeFk) ipt - FROM vn.ticket t2 - JOIN vn.sale s ON s.ticketFk = t2.id - JOIN vn.item i ON i.id = s.itemFk - JOIN vn.ticketState ts ON ts.ticketFk = t2.id - JOIN vn.state st ON st.id = ts.stateFk - WHERE t2.shipped BETWEEN vDateToAdvance AND util.dayend(vDateToAdvance) - AND t2.warehouseFk = vWarehouseFk - GROUP BY t2.id) t2 ON t2.addressFk = t.addressFk - JOIN vn.sale s ON s.ticketFk = t.id - JOIN vn.item i ON i.id = s.itemFk - LEFT JOIN tmp.stock st ON st.itemFk = s.itemFk - WHERE t.shipped BETWEEN vDated AND util.dayend(vDated) - AND t.warehouseFk = vWarehouseFk - GROUP BY t.id; + DROP TEMPORARY TABLE IF EXISTS tmp.filter; + CREATE TEMPORARY TABLE tmp.filter + (INDEX (id)) + + SELECT + origin.ticketFk futureId, + dest.ticketFk id, + dest.state, + origin.futureState, + origin.futureIpt, + dest.ipt, + origin.workerFk, + origin.futureLiters, + origin.futureLines, + dest.shipped, + origin.shipped futureShipped, + dest.totalWithVat, + origin.totalWithVat futureTotalWithVat, + dest.agency, + origin.futureAgency, + dest.lines, + dest.liters, + origin.futureLines - origin.hasStock AS notMovableLines, + (origin.futureLines = origin.hasStock) AS isFullMovable + FROM ( + SELECT + s.ticketFk, + t.workerFk, + t.shipped, + t.totalWithVat, + st.name futureState, + t.addressFk, + am.name futureAgency, + count(s.id) futureLines, + GROUP_CONCAT(DISTINCT ipt.code ORDER BY ipt.code) futureIpt, + CAST(SUM(litros) AS DECIMAL(10,0)) futureLiters, + SUM((s.quantity <= IFNULL(st.amount,0))) hasStock + FROM ticket t + JOIN sale s ON s.ticketFk = t.id + JOIN saleVolume sv ON sv.saleFk = s.id + JOIN item i ON i.id = s.itemFk + JOIN ticketState ts ON ts.ticketFk = t.id + JOIN state st ON st.id = ts.stateFk + JOIN agencyMode am ON t.agencyModeFk = am.id + LEFT JOIN itemPackingType ipt ON ipt.code = i.itemPackingTypeFk + LEFT JOIN tmp.stock st ON st.itemFk = i.id + WHERE t.shipped BETWEEN vDateFuture AND util.dayend(vDateFuture) + AND t.warehouseFk = vWarehouseFk + GROUP BY t.id + ) origin + JOIN ( + SELECT + t.id ticketFk, + t.addressFk, + st.name state, + GROUP_CONCAT(DISTINCT ipt.code ORDER BY ipt.code) ipt, + t.shipped, + t.totalWithVat, + am.name agency, + CAST(SUM(litros) AS DECIMAL(10,0)) liters, + CAST(COUNT(*) AS DECIMAL(10,0)) `lines` + FROM ticket t + JOIN sale s ON s.ticketFk = t.id + JOIN saleVolume sv ON sv.saleFk = s.id + JOIN item i ON i.id = s.itemFk + JOIN ticketState ts ON ts.ticketFk = t.id + JOIN state st ON st.id = ts.stateFk + JOIN agencyMode am ON t.agencyModeFk = am.id + LEFT JOIN itemPackingType ipt ON ipt.code = i.itemPackingTypeFk + WHERE t.shipped BETWEEN vDateToAdvance AND util.dayend(vDateToAdvance) + AND t.warehouseFk = vWarehouseFk + AND st.order <= 5 + GROUP BY t.id + ) dest ON dest.addressFk = origin.addressFk + WHERE origin.hasStock != 0; DROP TEMPORARY TABLE tmp.stock; END ;; @@ -68046,21 +69059,104 @@ 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 PROCEDURE IF EXISTS `ticket_canbePostponed` */; +/*!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 = utf8mb3 */ ; +/*!50003 SET character_set_results = utf8mb3 */ ; +/*!50003 SET collation_connection = utf8mb3_general_ci */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; +/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; +DELIMITER ;; +CREATE DEFINER=`root`@`localhost` PROCEDURE `ticket_canbePostponed`(vOriginDated DATE, vFutureDated DATE, vWarehouseFk INT) +BEGIN +/** + * Devuelve un listado de tickets susceptibles de fusionarse con otros tickets en el futuro + * + * @param vOriginDated Fecha en cuestión + * @param vFutureDated Fecha en el futuro a sondear + * @param vWarehouseFk Identificador de vn.warehouse + */ + DROP TEMPORARY TABLE IF EXISTS tmp.filter; + CREATE TEMPORARY TABLE tmp.filter + (INDEX (id)) + SELECT sv.ticketFk id, + sub2.id futureId, + GROUP_CONCAT(DISTINCT i.itemPackingTypeFk ORDER BY i.itemPackingTypeFk) ipt, + CAST(sum(litros) AS DECIMAL(10,0)) liters, + CAST(count(*) AS DECIMAL(10,0)) `lines`, + st.name state, + sub2.iptd futureIpt, + sub2.state futureState, + t.clientFk, + t.warehouseFk, + ts.alertLevel, + t.shipped, + sub2.shipped futureShipped, + t.workerFk, + st.code stateCode, + sub2.code futureStateCode + FROM vn.saleVolume sv + JOIN vn.sale s ON s.id = sv.saleFk + JOIN vn.item i ON i.id = s.itemFk + JOIN vn.ticket t ON t.id = sv.ticketFk + JOIN vn.address a ON a.id = t.addressFk + JOIN vn.province p ON p.id = a.provinceFk + JOIN vn.country c ON c.id = p.countryFk + JOIN vn.ticketState ts ON ts.ticketFk = t.id + JOIN vn.state st ON st.id = ts.stateFk + JOIN vn.alertLevel al ON al.id = ts.alertLevel + LEFT JOIN vn.ticketParking tp ON tp.ticketFk = t.id + LEFT JOIN ( + SELECT * + FROM ( + SELECT + t.addressFk, + t.id, + t.shipped, + st.name state, + st.code code, + GROUP_CONCAT(DISTINCT i.itemPackingTypeFk ORDER BY i.itemPackingTypeFk) iptd + FROM vn.ticket t + JOIN vn.ticketState ts ON ts.ticketFk = t.id + JOIN vn.state st ON st.id = ts.stateFk + JOIN vn.sale s ON s.ticketFk = t.id + JOIN vn.item i ON i.id = s.itemFk + WHERE t.shipped BETWEEN vFutureDated + AND util.dayend(vFutureDated) + AND t.warehouseFk = vWarehouseFk + GROUP BY t.id + ) sub + GROUP BY sub.addressFk + ) sub2 ON sub2.addressFk = t.addressFk AND t.id != sub2.id + WHERE t.shipped BETWEEN vOriginDated AND util.dayend(vOriginDated) + AND t.warehouseFk = vWarehouseFk + AND al.code = 'FREE' + AND tp.ticketFk IS NULL + GROUP BY sv.ticketFk + HAVING futureId; +END ;; +DELIMITER ; +/*!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 PROCEDURE IF EXISTS `ticket_canMerge` */; /*!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 = utf8mb4 */ ; -/*!50003 SET character_set_results = utf8mb4 */ ; -/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET character_set_client = utf8mb3 */ ; +/*!50003 SET character_set_results = utf8mb3 */ ; +/*!50003 SET collation_connection = utf8mb3_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `ticket_canMerge`(vDated DATE, vScopeDays INT, vLitersMax INT, vLinesMax INT, vWarehouseFk INT) BEGIN /** * Devuelve un listado de tickets susceptibles de fusionarse con otros tickets en el futuro - * + * * @param vDated Fecha en cuestión * @param vScopeDays Dias en el futuro a sondear * @param vLitersMax Volumen máximo de los tickets a catapultar @@ -68124,8 +69220,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `ticket_changeClient` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -68133,6 +69227,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `ticket_changeClient`(vNewClient INT, vUserFk INT) BEGIN @@ -68161,8 +69257,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `ticket_checkFullyControlled` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -68170,16 +69264,18 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `ticket_checkFullyControlled`(vWorkerFk INT, vTicketFk INT ) BEGIN /** - * Comprueba que no hay ningún ticket pendiente de revisar de alguna colección que haya revisado el trabajador + * Comprueba que no hay ningún ticket pendiente de revisar de alguna colección que haya revisado el trabajador * @param vWorkerFk id del user * @param vTicketFk número de ticket escaneada - * + * */ - + SELECT t.id FROM ticket t JOIN sale s ON s.ticketFk = t.id @@ -68199,19 +69295,17 @@ BEGIN )sub ON sub.collectionFk = tc.collectionFk JOIN ticketState ts ON ts.ticketFk = t.id JOIN state s2 ON s2.id = ts.stateFk - WHERE s2.code IN ('ON_PREPARATION', 'PREPARED', 'PREVIOUS_PREPARATION', 'OK PREVIOUS') + WHERE s2.code IN ('ON_PREPARATION', 'PREPARED', 'PREVIOUS_PREPARATION', 'OK PREVIOUS') AND t.shipped >= util.VN_CURDATE() AND s.quantity <>0 LIMIT 1; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `ticket_checkNoComponents` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -68219,6 +69313,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `ticket_checkNoComponents`(vShippedFrom DATETIME, vShippedTo DATETIME) BEGIN @@ -68226,7 +69322,7 @@ BEGIN /** * Comprueba que los tickets entre un rango de fechas tienen componentes * - * @param vShippedFrom rango inicial de fecha + * @param vShippedFrom rango inicial de fecha * @param vShippedTo rango final de fecha */ DECLARE v_done BOOL DEFAULT FALSE; @@ -68245,9 +69341,9 @@ BEGIN AND clt.isActive != 0 AND ic.merchandise != 0 GROUP BY s.id; - + DECLARE CONTINUE HANDLER FOR NOT FOUND - SET v_done = TRUE; + SET v_done = TRUE; DROP TEMPORARY TABLE IF EXISTS tmp.coste; @@ -68266,7 +69362,7 @@ BEGIN JOIN componentType ct ON ct.id = c.typeFk AND ct.id = 1 WHERE t.shipped >= vShippedFrom AND ic.merchandise != 0; - + OPEN vCur; l: LOOP @@ -68280,16 +69376,14 @@ BEGIN CALL sale_calculateComponent(vSaleFk, 1); END LOOP; - CLOSE vCur; - DROP TEMPORARY TABLE tmp.coste; + CLOSE vCur; + DROP TEMPORARY TABLE tmp.coste; END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `ticket_Clone` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -68297,6 +69391,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `ticket_Clone`(vOriginalTicket INT, OUT vNewTicket INT) BEGIN @@ -68318,11 +69414,11 @@ BEGIN companyFk, landed, zoneFk, - zonePrice, - zoneBonus, - routeFk, - priority, - hasPriority + zonePrice, + zoneBonus, + routeFk, + priority, + hasPriority ) SELECT clientFk, @@ -68338,39 +69434,37 @@ BEGIN zoneBonus, routeFk, priority, - hasPriority + hasPriority FROM ticket WHERE id = vOriginalTicket; SET vNewTicket = LAST_INSERT_ID(); - + INSERT INTO ticketObservation(ticketFk, observationTypeFk, description) SELECT vNewTicket, ao.observationTypeFk, ao.description FROM addressObservation ao JOIN ticket t ON t.addressFk = ao.addressFk WHERE t.id = vNewTicket; - + INSERT INTO ticketLog - SET originFk = vNewTicket, userFk = account.myUser_getId(), `action` = 'insert', + SET originFk = vNewTicket, userFk = account.myUser_getId(), `action` = 'insert', description = CONCAT('Ha creado el ticket:', ' ', vNewTicket, ' clonando el ', vOriginalTicket); - + INSERT INTO ticketLog - SET originFk = vOriginalTicket, userFk = account.myUser_getId(), `action` = 'insert', + SET originFk = vOriginalTicket, userFk = account.myUser_getId(), `action` = 'insert', description = CONCAT('Ha creado el ticket:', ' ', vNewTicket, ' clonando el ', vOriginalTicket); - INSERT INTO vncontrol.inter(Id_Ticket, state_id, Id_Trabajador, odbc_date) - SELECT vNewTicket, state_id, Id_Trabajador , odbc_date - FROM vncontrol.inter - WHERE Id_Ticket = vOriginalTicket - ORDER BY odbc_date; + INSERT INTO ticketTracking(ticketFk, stateFk, workerFk, created) + SELECT vNewTicket, stateFk, workerFk , created + FROM ticketTracking + WHERE ticketFk = vOriginalTicket + ORDER BY created; END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `ticket_cloneWeekly` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -68378,6 +69472,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `ticket_cloneWeekly`(IN vWeek INT) BEGIN @@ -68393,16 +69489,16 @@ BEGIN DECLARE vAgencyModeFk INT; DECLARE vNewTicket INT; DECLARE vYear INT; - + DECLARE rsTicket CURSOR FOR SELECT tt.ticketFk, tt.weekDay, t.clientFk, t.warehouseFk, t.companyFk, t.addressFk, tt.agencyModeFk - FROM vn.ticketWeekly tt + FROM vn.ticketWeekly tt JOIN vn.ticket t ON tt.ticketFk = t.id; DECLARE CONTINUE HANDLER FOR NOT FOUND SET vIsDone = TRUE; SET vYear = YEAR(util.VN_CURDATE()) + IF(vWeek < WEEK(util.VN_CURDATE()),1, 0); - + OPEN rsTicket; myLoop: LOOP BEGIN @@ -68418,7 +69514,7 @@ BEGIN LEAVE myLoop; END IF; - SELECT dated INTO vShipment + SELECT dated INTO vShipment FROM `time` WHERE `year` = vYear AND `week` = vWeek AND WEEKDAY(dated) = vWeekDay; @@ -68429,52 +69525,52 @@ BEGIN JOIN vn.saleCloned sc ON sc.saleOriginalFk = saleOrig.id JOIN vn.sale saleClon ON saleClon.id = sc.saleClonedFk JOIN vn.ticket tClon ON tClon.id = saleClon.ticketFk - WHERE tOrig.id = vTicketFk AND tClon.isDeleted = FALSE AND DATE(tClon.shipped) = vShipment) > 0 + WHERE tOrig.id = vTicketFk AND tClon.isDeleted = FALSE AND DATE(tClon.shipped) = vShipment) > 0 THEN ITERATE myLoop; END IF; - + IF vAgencyModeFk IS NULL THEN - SELECT agencyModeFk INTO vAgencyModeFk + SELECT agencyModeFk INTO vAgencyModeFk FROM address WHERE clientFk = vClientFk AND isDefaultAddress; END IF; - + CALL vn.zone_getLanded(vShipment, vAddressFk, vAgencyModeFk, vWarehouseFk,FALSE); SET vLanding = NULL; SELECT landed INTO vLanding from tmp.zoneGetLanded LIMIT 1; - + CALL ticket_add( - vClientFk, - vShipment, - vWarehouseFk, - vCompanyFk, - vAddressFk, - vAgencyModeFk, - NULL, - vLanding, - account.myUser_getId(), - FALSE, + vClientFk, + vShipment, + vWarehouseFk, + vCompanyFk, + vAddressFk, + vAgencyModeFk, + NULL, + vLanding, + account.myUser_getId(), + FALSE, vNewTicket); IF (vLanding IS NULL) THEN - + SELECT e.email INTO vSalesPersonEmail FROM vn.client c JOIN vn.worker sp ON sp.id = c.salesPersonFk JOIN account.emailUser e ON e.userFk = sp.userFk WHERE c.id = vClientFk; - + SET vSubject = CONCAT('Turnos - No se ha podido clonar correctamente el ticket ', vTicketFk, ' para el dia: ', vShipment); - SET vMessage = CONCAT('No se ha podido clonar el ticket ', vTicketFk, - ' para el dia: ', vShipment, - ' porque no hay una zona de envío disponible. Se ha creado el ticket: ', vNewTicket, + SET vMessage = CONCAT('No se ha podido clonar el ticket ', vTicketFk, + ' para el dia: ', vShipment, + ' porque no hay una zona de envío disponible. Se ha creado el ticket: ', vNewTicket, ' pero ha que revisar las fechas y la agencia'); - + SELECT COUNT(*) INTO vMailSent - FROM vn.mail - WHERE receiver = vSalesPersonEmail + FROM vn.mail + WHERE receiver = vSalesPersonEmail AND subject = vSubject; IF NOT vMailSent THEN @@ -68482,45 +69578,43 @@ BEGIN END IF; CALL vn.ticketStateUpdate (vNewTicket, 'FIXING'); END IF; - + INSERT INTO vn.sale (ticketFk, itemFk, concept, quantity, price, discount, priceFixed, isPriceFixed) SELECT vNewTicket, saleOrig.itemFk , saleOrig.concept , saleOrig.quantity, saleOrig.price , saleOrig.discount, saleOrig.priceFixed, saleOrig.isPriceFixed - FROM vn.sale saleOrig - WHERE saleOrig.ticketFk = vTicketFk; - + FROM vn.sale saleOrig + WHERE saleOrig.ticketFk = vTicketFk; + INSERT IGNORE INTO vn.saleCloned(saleOriginalFk, saleClonedFk) - SELECT saleOriginal.id, saleClon.id + SELECT saleOriginal.id, saleClon.id FROM vn.sale saleOriginal JOIN vn.sale saleClon ON saleOriginal.itemFk = saleClon.itemFk AND saleOriginal.quantity = saleClon.quantity WHERE saleOriginal.ticketFk = vTicketFk AND saleClon.ticketFk = vNewTicket; - + INSERT INTO ticketRequest (description,ordered,shipped,quantity,price,itemFk,clientFk,response, - total,buyed,requesterFk,attenderFk,ticketFk) + total,buyed,requesterFk,attenderFk,ticketFk) SELECT description,ordered,shipped,quantity,price,itemFk,clientFk,response, - total,buyed,requesterFk,attenderFk,vNewTicket + total,buyed,requesterFk,attenderFk,vNewTicket FROM ticketRequest WHERE ticketFk =vTicketFk; - + INSERT INTO ticketObservation(ticketFk,observationTypeFk,description) VALUES(vNewTicket,4,CONCAT('turno desde ticket: ',vTicketFk)) - ON DUPLICATE KEY UPDATE description = CONCAT(ticketObservation.description,VALUES(description),' '); - + ON DUPLICATE KEY UPDATE description = CONCAT(ticketObservation.description,VALUES(description),' '); + INSERT INTO ticketObservation(ticketFk,observationTypeFk,description) VALUES(vNewTicket,1,'ATENCION: Contiene lineas de TURNO') - ON DUPLICATE KEY UPDATE description = CONCAT(ticketObservation.description,VALUES(description),' '); - + ON DUPLICATE KEY UPDATE description = CONCAT(ticketObservation.description,VALUES(description),' '); + CALL vn.ticketCalculateClon(vNewTicket, vTicketFk); END; END LOOP; CLOSE rsTicket; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `ticket_close` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -68528,11 +69622,13 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `ticket_close`() BEGIN /** - * Realiza el cierre de todos los + * Realiza el cierre de todos los * tickets de la tabla tmp.ticket_close. * * @table tmp.ticket_close(ticketFk) Identificadores de los tickets a cerrar @@ -68550,7 +69646,7 @@ BEGIN DECLARE cur CURSOR FOR SELECT ticketFk FROM tmp.ticket_close; - + DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE; DECLARE EXIT HANDLER FOR SQLEXCEPTION BEGIN RESIGNAL; @@ -68560,7 +69656,7 @@ BEGIN proc: LOOP SET vDone = FALSE; - + FETCH cur INTO vCurTicketFk; IF vDone THEN @@ -68578,12 +69674,12 @@ BEGIN c.hasToInvoice INTO vClientFk, vIsTaxDataChecked, - vCompanyFk, + vCompanyFk, vShipped, vHasDailyInvoice, vWithPackage, vHasToInvoice - FROM ticket t + FROM ticket t JOIN `client` c ON c.id = t.clientFk JOIN province p ON p.id = c.provinceFk JOIN country co ON co.id = p.countryFk @@ -68592,22 +69688,22 @@ BEGIN INSERT INTO ticketPackaging (ticketFk, packagingFk, quantity) (SELECT vCurTicketFk, p.id, COUNT(*) - FROM expedition e + FROM expedition e JOIN packaging p ON p.itemFk = e.freightItemFk WHERE e.ticketFk = vCurTicketFk AND p.isPackageReturnable AND vWithPackage GROUP BY p.itemFk); -- No retornables o no catalogados - INSERT INTO sale (itemFk, ticketFk, concept, quantity, price, isPriceFixed) + INSERT INTO sale (itemFk, ticketFk, concept, quantity, price, isPriceFixed) (SELECT e.freightItemFk, vCurTicketFk, i.name, COUNT(*) AS amount, getSpecialPrice(e.freightItemFk, vClientFk), 1 - FROM expedition e + FROM expedition e JOIN item i ON i.id = e.freightItemFk LEFT JOIN packaging p ON p.itemFk = i.id WHERE e.ticketFk = vCurTicketFk AND IFNULL(p.isPackageReturnable, 0) = 0 AND getSpecialPrice(e.freightItemFk, vClientFk) > 0 GROUP BY e.freightItemFk); - + IF(vHasDailyInvoice) AND vHasToInvoice THEN -- Facturacion rapida @@ -68615,10 +69711,10 @@ BEGIN -- Facturar si está contabilizado IF vIsTaxDataChecked THEN CALL invoiceOut_newFromClient( - vClientFk, - (SELECT invoiceSerial(vClientFk, vCompanyFk, 'M')), - vShipped, - vCompanyFk, + vClientFk, + (SELECT invoiceSerial(vClientFk, vCompanyFk, 'M')), + vShipped, + vCompanyFk, NULL, NULL, vNewInvoiceId); @@ -68635,8 +69731,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `ticket_closeByTicket` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -68644,6 +69738,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `ticket_closeByTicket`(IN vTicketFk int) BEGIN @@ -68675,8 +69771,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `ticket_componentMakeUpdate` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -68684,6 +69778,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `ticket_componentMakeUpdate`(IN vTicketFk INT, IN vClientFk INT, IN vNickname VARCHAR(50), IN vAgencyModeFk INT, @@ -68692,11 +69788,11 @@ CREATE DEFINER=`root`@`localhost` PROCEDURE `ticket_componentMakeUpdate`(IN vTic IN vLanded DATE, IN vIsDeleted TINYINT(1), IN vHasToBeUnrouted TINYINT(1), IN vOption INT) BEGIN - + /** * Modifica en el ticket los campos que se le pasan por parámetro * y cambia sus componentes - * + * * @param vTicketFk Id del ticket a modificar * @param vClientFk nuevo cliente * @param vNickname nuevo alias @@ -68711,29 +69807,29 @@ BEGIN * @param vHasToBeUnrouted si se le elimina la ruta al ticket * @param vOption opcion para el case del proc ticketComponentUpdateSale */ - + DECLARE vPrice DECIMAL(10,2); DECLARE vBonus DECIMAL(10,2); CALL ticket_componentPreview (vTicketFk, vLanded, vAddressFk, vZoneFk, vWarehouseFk); IF (SELECT addressFk FROM ticket WHERE id = vTicketFk) <> vAddressFk THEN - - UPDATE ticket t + + UPDATE ticket t JOIN address a ON a.id = vAddressFk SET t.nickname = a.nickname WHERE t.id = vTicketFk; - + END IF; CALL zone_getShipped(vLanded, vAddressFk, vAgencyModeFk, TRUE); - SELECT zoneFk, price, bonus INTO vZoneFk, vPrice, vBonus + SELECT zoneFk, price, bonus INTO vZoneFk, vPrice, vBonus FROM tmp.zoneGetShipped WHERE shipped BETWEEN DATE(vShipped) AND util.dayEnd(vShipped) AND warehouseFk = vWarehouseFk LIMIT 1; - + UPDATE ticket t - SET + SET t.clientFk = vClientFk, t.nickname = vNickname, t.agencyModeFk = vAgencyModeFk, @@ -68748,12 +69844,12 @@ BEGIN t.isDeleted = vIsDeleted WHERE t.id = vTicketFk; - + IF vHasToBeUnrouted THEN UPDATE ticket t SET t.routeFk = NULL WHERE t.id = vTicketFk; END IF; - + IF vOption <> 8 THEN DROP TEMPORARY TABLE IF EXISTS tmp.sale; CREATE TEMPORARY TABLE tmp.sale @@ -68779,8 +69875,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `ticket_componentPreview` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -68788,10 +69882,12 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `ticket_componentPreview`( vTicketFk INT, - vLanded DATE, + vLanded DATE, vAddressFk INT, vZoneFk INT, vWarehouseFk SMALLINT) @@ -68807,7 +69903,7 @@ BEGIN * * @return tmp.ticketComponentPreview (warehouseFk, itemFk, componentFk, cost) */ - DECLARE vHasDataChanged BOOL DEFAULT FALSE; + DECLARE vHasDataChanged BOOL DEFAULT FALSE; DECLARE vHasAddressChanged BOOL; DECLARE vHasZoneChanged BOOL DEFAULT FALSE; DECLARE vHasWarehouseChanged BOOL DEFAULT FALSE; @@ -68818,8 +69914,8 @@ BEGIN DECLARE vHasChangeAll BOOL DEFAULT FALSE; - SELECT DATE(landed) <> vLanded, - addressFk <> vAddressFk, + SELECT DATE(landed) <> vLanded, + addressFk <> vAddressFk, zoneFk <> vZoneFk, warehouseFk <> vWarehouseFk INTO @@ -68842,15 +69938,15 @@ BEGIN SET vAgencyModeTypeRateFk = 6; END IF; - SELECT TIMESTAMPADD(DAY, -travelingDays, vLanded) INTO vShipped + SELECT TIMESTAMPADD(DAY, -travelingDays, vLanded) INTO vShipped FROM zone WHERE id = vZoneFk; - + CALL buyUltimate(vWarehouseFk, vShipped); - + DROP TEMPORARY TABLE IF EXISTS tmp.ticketLot; - CREATE TEMPORARY TABLE tmp.ticketLot ENGINE = MEMORY ( - SELECT + CREATE TEMPORARY TABLE tmp.ticketLot ENGINE = MEMORY ( + SELECT vWarehouseFk AS warehouseFk, NULL AS available, s.itemFk, @@ -68870,9 +69966,9 @@ BEGIN JOIN sale s ON s.id = sc.saleFk JOIN ticket t ON t.id = s.ticketFk JOIN `component` c ON c.id = sc.componentFk - WHERE s.ticketFk = vTicketFk - AND (c.isRenewable = FALSE - OR + WHERE s.ticketFk = vTicketFk + AND (c.isRenewable = FALSE + OR (NOT vHasChangeAll AND (NOT (c.typeFk <=> vAddressTypeRateFk OR c.typeFk <=> vAgencyModeTypeRateFk)))); @@ -68893,8 +69989,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `ticket_DelayTruck` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -68902,10 +69996,12 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `ticket_DelayTruck`(vWarehouserFk INT, vHour INT, vMinute INT) BEGIN - + DECLARE done INT DEFAULT FALSE; DECLARE vTicketFk INT; DECLARE cur1 CURSOR FOR SELECT ticketFk FROM tmp.ticket; @@ -68926,27 +70022,25 @@ BEGIN OPEN cur1; read_loop: LOOP - + FETCH cur1 INTO vTicketFk; - + IF done THEN LEAVE read_loop; END IF; - + CALL vn.ticket_DelayTruckSplit(vTicketFk); - + END LOOP; CLOSE cur1; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `ticket_DelayTruckSplit` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -68954,55 +70048,57 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `ticket_DelayTruckSplit`(vTicketFk INT) BEGIN - + /* * Splita las lineas de ticket que no estan ubicadas - * + * */ - + DECLARE vNewTicketFk INT; DECLARE vTotalLines INT; DECLARE vLinesToSplit INT; DROP TEMPORARY TABLE IF EXISTS tmp.SalesToSplit; - + SELECT COUNT(*) INTO vTotalLines - FROM vn.sale + FROM vn.sale WHERE ticketFk = vTicketFk; - + CREATE TEMPORARY TABLE tmp.SalesToSplit SELECT s.id saleFk FROM vn.ticket t - JOIN vn.sale s ON t.id = s.ticketFk - LEFT JOIN vn.itemShelvingStock_byWarehouse issw ON issw.itemFk = s.itemFk AND issw.warehouseFk = t.warehouseFk + JOIN vn.sale s ON t.id = s.ticketFk + LEFT JOIN vn.itemShelvingStock_byWarehouse issw ON issw.itemFk = s.itemFk AND issw.warehouseFk = t.warehouseFk WHERE s.quantity > IFNULL(issw.visible, 0) AND s.quantity > 0 AND s.isPicked = FALSE AND s.reserved = FALSE AND t.id = vTicketFk; - + SELECT COUNT(*) INTO vLinesToSplit FROM tmp.SalesToSplit; - + IF vLinesToSplit = vTotalLines AND vLinesToSplit > 0 THEN - + SET vNewTicketFk = vTicketFk; - + ELSE - + CALL vn.ticket_Clone(vTicketFk, vNewTicketFk); - - UPDATE vn.sale s - JOIN tmp.SalesToSplit sts ON sts.saleFk = s.id + + UPDATE vn.sale s + JOIN tmp.SalesToSplit sts ON sts.saleFk = s.id SET s.ticketFk = vNewTicketFk; - + END IF; - + CALL vn.ticketStateUpdate(vNewTicketFk, 'FIXING'); - + DROP TEMPORARY TABLE tmp.SalesToSplit; END ;; @@ -69011,8 +70107,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `ticket_doRecalc` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -69020,6 +70114,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `ticket_doRecalc`() proc: BEGIN @@ -69080,8 +70176,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `ticket_doRefund` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -69089,6 +70183,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `ticket_doRefund`(OUT vNewTicket INT) BEGIN @@ -69214,8 +70310,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `ticket_getFromFloramondo` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -69223,6 +70317,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `ticket_getFromFloramondo`(vDateFrom DATE, vDateTo DATE) BEGIN @@ -69354,8 +70450,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `ticket_getMovable` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -69363,6 +70457,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `ticket_getMovable`(vTicketFk INT, vDatedNew DATETIME, vWarehouseFk INT) BEGIN @@ -69374,45 +70470,43 @@ BEGIN * @param vTicketFk -> Ticket * @param vDatedNew -> Nueva fecha * @return Sales con Movible -*/ +*/ DECLARE vDatedOld DATETIME; SET vDatedNew = DATE_ADD(vDatedNew, INTERVAL 1 DAY); SELECT t.shipped INTO vDatedOld - FROM ticket t + FROM ticket t WHERE t.id = vTicketFk; - CALL itemStock(vWarehouseFk, vDatedNew, NULL); + CALL itemStock(vWarehouseFk, vDatedNew, NULL); CALL item_getMinacum(vWarehouseFk, vDatedNew, DATEDIFF(DATE_SUB(vDatedOld, INTERVAL 1 DAY), vDatedNew), NULL); - - SELECT s.id, - s.itemFk, - s.quantity, - s.concept, - s.price, + + SELECT s.id, + s.itemFk, + s.quantity, + s.concept, + s.price, s.reserved, - s.discount, - i.image, - i.subName, + s.discount, + i.image, + i.subName, il.stock + IFNULL(im.amount, 0) AS movable FROM ticket t JOIN sale s ON s.ticketFk = t.id - JOIN item i ON i.id = s.itemFk + JOIN item i ON i.id = s.itemFk LEFT JOIN tmp.itemMinacum im ON im.itemFk = s.itemFk AND im.warehouseFk = vWarehouseFk LEFT JOIN tmp.itemList il ON il.itemFk = s.itemFk WHERE t.id = vTicketFk; DROP TEMPORARY TABLE IF EXISTS tmp.itemList; - DROP TEMPORARY TABLE IF EXISTS tmp.itemMinacum; - + DROP TEMPORARY TABLE IF EXISTS tmp.itemMinacum; + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `ticket_getProblems` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -69420,6 +70514,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `ticket_getProblems`(IN vIsTodayRelative tinyint(1)) BEGIN @@ -69433,10 +70529,10 @@ BEGIN CALL sale_getProblems(vIsTodayRelative); DROP TEMPORARY TABLE IF EXISTS tmp.ticket_problems; - CREATE TEMPORARY TABLE tmp.ticket_problems + CREATE TEMPORARY TABLE tmp.ticket_problems (PRIMARY KEY (ticketFk)) ENGINE = MEMORY - SELECT + SELECT ticketFk, MAX(p.isFreezed) AS isFreezed, MAX(p.risk) AS risk, @@ -69453,7 +70549,7 @@ BEGIN GROUP BY ticketFk; UPDATE tmp.ticket_problems tp - SET tp.totalProblems = + SET tp.totalProblems = ( (tp.isFreezed) + IF(tp.risk, TRUE, FALSE) + @@ -69474,8 +70570,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `ticket_getSplitList` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -69483,6 +70577,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `ticket_getSplitList`(vDated DATE, vHour TIME, vWarehouseFk INT) BEGIN @@ -69506,17 +70602,17 @@ BEGIN (saleFk INT PRIMARY KEY, ticketFk INT, problem VARCHAR(1)) ENGINE = MEMORY; - + INSERT INTO tmp.salesToSplit(saleFk, ticketFk, problem) SELECT s.id, s.ticketFk, 'F' FROM vn.ticket t JOIN vn.sale s ON s.ticketFk = t.id JOIN vn.item i ON i.id = s.itemFk JOIN vn.itemType it on it.id = i.typeFk - JOIN vn.itemCategory ic ON ic.id = it.categoryFk + JOIN vn.itemCategory ic ON ic.id = it.categoryFk LEFT JOIN cache.visible v ON v.item_id = i.id AND v.calc_id = vVisibleCache LEFT JOIN cache.available av ON av.item_id = i.id AND av.calc_id = vAvailableCache - LEFT JOIN vn.itemShelvingStock_byWarehouse issw ON issw.itemFk = i.id AND issw.warehouseFk = t.warehouseFk + LEFT JOIN vn.itemShelvingStock_byWarehouse issw ON issw.itemFk = i.id AND issw.warehouseFk = t.warehouseFk WHERE IFNULL(v.visible,0) < s.quantity AND IFNULL(av.available ,0) < s.quantity AND IFNULL(issw.visible, 0) < s.quantity @@ -69526,16 +70622,16 @@ BEGIN AND t.shipped BETWEEN util.VN_CURDATE() AND util.dayend(util.VN_CURDATE()) AND NOT i.generic AND t.warehouseFk = vWarehouseFk; - + INSERT IGNORE INTO tmp.salesToSplit(saleFk, ticketFk, problem) SELECT s.id, s.ticketFk, 'I' - FROM vn.ticket t + FROM vn.ticket t JOIN vn.sale s ON s.ticketFk = t.id JOIN vn.item i ON i.id = s.itemFk JOIN vn.itemType it on it.id = i.typeFk JOIN vn.itemCategory ic ON ic.id = it.categoryFk LEFT JOIN cache.visible v ON v.item_id = s.itemFk AND v.calc_id = vVisibleCache - LEFT JOIN vn.itemShelvingStock_byWarehouse issw ON issw.itemFk = i.id AND issw.warehouseFk = t.warehouseFk + LEFT JOIN vn.itemShelvingStock_byWarehouse issw ON issw.itemFk = i.id AND issw.warehouseFk = t.warehouseFk WHERE IFNULL(v.visible,0) >= s.quantity AND IFNULL(issw.visible, 0) < s.quantity AND s.quantity > 0 @@ -69545,7 +70641,7 @@ BEGIN AND t.shipped BETWEEN util.VN_CURDATE() AND util.dayend(util.VN_CURDATE()) AND NOT i.generic AND t.warehouseFk = vWarehouseFk; - + INSERT IGNORE INTO tmp.salesToSplit(saleFk, ticketFk, problem) SELECT s.id, s.ticketFk, 'R' FROM vn.ticket t @@ -69555,7 +70651,7 @@ BEGIN JOIN vn.itemCategory ic ON ic.id = it.categoryFk LEFT JOIN cache.visible v ON v.item_id = s.itemFk AND v.calc_id = vVisibleCache LEFT JOIN cache.available av ON av.item_id = i.id AND av.calc_id = vAvailableCache - LEFT JOIN vn.itemShelvingStock_byWarehouse issw ON issw.itemFk = i.id AND issw.warehouseFk = t.warehouseFk + LEFT JOIN vn.itemShelvingStock_byWarehouse issw ON issw.itemFk = i.id AND issw.warehouseFk = t.warehouseFk WHERE IFNULL(v.visible,0) < s.quantity AND IFNULL(av.available ,0) >= s.quantity AND IFNULL(issw.visible, 0) < s.quantity @@ -69566,7 +70662,7 @@ BEGIN AND t.shipped BETWEEN util.VN_CURDATE() AND util.dayend(util.VN_CURDATE()) AND NOT i.generic AND t.warehouseFk = vWarehouseFk; - + DROP TEMPORARY TABLE IF EXISTS tmp.ticketsToSplit; CREATE TEMPORARY TABLE tmp.ticketsToSplit @@ -69587,11 +70683,11 @@ BEGIN JOIN vn.ticket t ON t.id = ss.ticketFk JOIN vn.sale s ON s.id = ss.saleFk JOIN vn.item i ON i.id = s.itemFk - LEFT JOIN vn.zoneClosure zc ON zc.zoneFk = t.zoneFk + LEFT JOIN vn.zoneClosure zc ON zc.zoneFk = t.zoneFk GROUP BY ss.ticketFk; - - SELECT - ts.*, + + SELECT + ts.*, t.id ticketFuture, st.name state, zc.`hour` tfEtd, @@ -69600,23 +70696,23 @@ BEGIN FROM tmp.ticketsToSplit ts LEFT JOIN vn.ticketState ts2 ON ts2.ticketFk = ts.ticketFk LEFT JOIN vn.state st ON st.id = ts2.stateFk - LEFT JOIN vn.ticket t - ON t.id != ts.ticketFk + LEFT JOIN vn.ticket t + ON t.id != ts.ticketFk AND t.addressFk = ts.addressFk AND t.shipped BETWEEN vDated AND util.dayend(vDated) LEFT JOIN vn.zoneClosure zc ON zc.zoneFk = t.zoneFk AND zc.dated = vDated LEFT JOIN vn.sale s ON s.ticketFk = t.id LEFT JOIN vn.item i ON i.id = s.itemFk - LEFT JOIN vn.ticketState tst ON tst.ticketFk = t.id + LEFT JOIN vn.ticketState tst ON tst.ticketFk = t.id LEFT JOIN vn.state st2 ON st2.id = tst.stateFk - WHERE (t.id IS NULL + WHERE (t.id IS NULL OR (vDated > util.VN_CURDATE()) OR (vDated = util.VN_CURDATE() AND vHour >= zc.`hour`)) AND ts.etd <= vHour GROUP BY ts.ticketFk, t.id ORDER BY ts.etd, ts.ticketFk; - - DROP TEMPORARY TABLE + + DROP TEMPORARY TABLE tmp.ticketsToSplit; END ;; DELIMITER ; @@ -69624,8 +70720,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `ticket_getTax` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -69633,6 +70727,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `ticket_getTax`(IN vTaxArea VARCHAR(25)) BEGIN @@ -69653,7 +70749,7 @@ BEGIN JOIN ticket t ON t.id = tmpTicket.ticketFk; CALL addressTaxArea (); - + IF vTaxArea > '' THEN UPDATE tmp.addressTaxArea SET areaFk = vTaxArea; @@ -69725,8 +70821,8 @@ BEGIN CREATE TEMPORARY TABLE tmp.ticketAmount (INDEX (ticketFk)) ENGINE = MEMORY - SELECT ticketFk, - taxableBase, + SELECT ticketFk, + taxableBase, SUM(CAST(taxableBase * rate / 100 AS DECIMAL(10, 2))) tax, code FROM tmp.ticketTax @@ -69740,8 +70836,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `ticket_insertZone` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -69749,6 +70843,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `ticket_insertZone`() BEGIN @@ -69758,24 +70854,24 @@ BEGIN DECLARE vAddressFk INT; DECLARE vAgencyModeFk INT; DECLARE vWarehouseFk INT; - DECLARE vCursor CURSOR FOR + DECLARE vCursor CURSOR FOR SELECT id, landed, addressFk, agencyModeFk, warehouseFk FROM vn.ticket WHERE shipped > '2020-01-01' AND zoneFk is null; DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET vDone = 1; - + OPEN vCursor; REPEAT FETCH vCursor INTO vFechedTicket, vLanded, vAddressFk, vAgencyModeFk, vWarehouseFk; CALL vn.zone_getShipped (vlanded, vAddressFk, vAgencyModeFk, TRUE); - + UPDATE vn.ticket t JOIN tmp.zoneGetShipped zgs ON zgs.warehouseFk = vWarehouseFk SET t.zoneFk = zgs.zoneFk WHERE t.id = vFechedTicket; - + UNTIL vDone END REPEAT; DROP TEMPORARY TABLE tmp.zoneGetShipped; - + CLOSE vCursor; END ;; DELIMITER ; @@ -69783,8 +70879,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `ticket_merge` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -69792,34 +70886,34 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `ticket_merge`(vSelf INT, vTicketTargetFk INT) BEGIN - + /** * Fusiona el primer ticket al segundo - * + * * @param vSelf Número de ticket a fusionar * @param vTicketTargetFk Ticket destino - * + * */ - - UPDATE vn.sale s + + UPDATE vn.sale s SET s.ticketFk = vTicketTargetFk WHERE s.ticketFk = vSelf; - - UPDATE vn.ticket t + + UPDATE vn.ticket t SET t.shipped = TIMESTAMPADD(YEAR, - YEAR(util.VN_NOW()) MOD 2000, t.shipped ) WHERE t.id = vSelf; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `ticket_priceDifference` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -69827,17 +70921,19 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `ticket_priceDifference`( vTicketFk INT, - vLanded DATE, + vLanded DATE, vAddressFk INT, vZoneFk INT, vWarehouseFk INT) BEGIN /** * Devuelve las diferencias de precio de los movimientos de un ticket. - * + * * @param vTicketFk Id del ticket * @param vLanded Fecha de recepcion * @param vAddressFk Id del consignatario @@ -69846,26 +70942,26 @@ BEGIN */ CALL vn.ticket_componentPreview(vTicketFk, vLanded, vAddressFk, vZoneFk, vWarehouseFk); - SELECT s.itemFk, - i.name, - i.size, - i.category, - IFNULL(s.quantity, 0) AS quantity, - IFNULL(s.price, 0) AS price, + SELECT s.itemFk, + i.name, + i.size, + i.category, + IFNULL(s.quantity, 0) AS quantity, + IFNULL(s.price, 0) AS price, ROUND(SUM(tc.cost), 2) AS newPrice, s.quantity * (s.price - ROUND(SUM(tc.cost), 2)) difference, s.id AS saleFk FROM sale s - JOIN item i ON i.id = s.itemFk - JOIN ticket t ON t.id = s.ticketFk - LEFT JOIN tmp.ticketComponentPreview tc ON tc.itemFk = s.itemFk + JOIN item i ON i.id = s.itemFk + JOIN ticket t ON t.id = s.ticketFk + LEFT JOIN tmp.ticketComponentPreview tc ON tc.itemFk = s.itemFk AND tc.warehouseFk = vWarehouseFk - LEFT JOIN saleComponent sc ON sc.saleFk = s.id + LEFT JOIN saleComponent sc ON sc.saleFk = s.id AND sc.componentFk = tc.componentFk - LEFT JOIN `component` c ON c.id = tc.componentFk - WHERE t.id = vTicketFk - AND IF(sc.componentFk IS NULL - AND c.classRate IS NOT NULL, FALSE, TRUE) + LEFT JOIN `component` c ON c.id = tc.componentFk + WHERE t.id = vTicketFk + AND IF(sc.componentFk IS NULL + AND c.classRate IS NOT NULL, FALSE, TRUE) GROUP BY s.id ORDER BY s.id; DROP TEMPORARY TABLE tmp.ticketComponentPreview; @@ -69875,8 +70971,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `ticket_recalc` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -69884,6 +70978,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `ticket_recalc`(vTicketId INT) BEGIN @@ -69914,8 +71010,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `ticket_recalcComponents` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -69923,12 +71017,14 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `ticket_recalcComponents`(IN vTicketFk BIGINT, vIsTicketEditable BOOLEAN) proc: BEGIN /** - * Este procedimiento recalcula los componentes de un ticket, + * Este procedimiento recalcula los componentes de un ticket, * eliminando los componentes existentes e insertandolos de nuevo * * @param vTicketFk Id del ticket @@ -69940,7 +71036,7 @@ proc: BEGIN DECLARE vAddressFk INT; DECLARE vLanded DATE; DECLARE vZoneFk INTEGER; - + IF vIsTicketEditable IS NULL THEN SELECT IFNULL(ts.alertLevel,0) = 0 AND IFNULL(t.refFk,'') = '' INTO vIsTicketEditable @@ -69948,10 +71044,10 @@ proc: BEGIN WHERE id = vTicketFk; END IF; - SELECT t.warehouseFk, - t.shipped, - t.addressFk, - t.agencyModeFk, + SELECT t.warehouseFk, + t.shipped, + t.addressFk, + t.agencyModeFk, t.landed, t.zoneFk INTO vWarehouseFk, vShipped, vAddressFk, vAgencyModeFk, vLanded, vZoneFk @@ -69967,7 +71063,7 @@ proc: BEGIN IF vLanded IS NULL OR vZoneFk IS NULL THEN UPDATE ticket t - SET t.landed = (SELECT landed FROM tmp.zoneGetLanded LIMIT 1) + SET t.landed = (SELECT landed FROM tmp.zoneGetLanded LIMIT 1) WHERE t.id = vTicketFk AND t.landed IS NULL; IF vZoneFk IS NULL THEN @@ -69976,23 +71072,23 @@ proc: BEGIN SET t.zoneFk = vZoneFk WHERE t.id = vTicketFk AND t.zoneFk IS NULL; END IF; - + END IF; - + DROP TEMPORARY TABLE tmp.zoneGetLanded; - -- rellena la tabla buyUltimate con la ultima compra - CALL buyUltimate (vWarehouseFk, vShipped); - + -- rellena la tabla buyUltimate con la ultima compra + CALL buyUltimate (vWarehouseFk, vShipped); + DROP TEMPORARY TABLE IF EXISTS tmp.ticketLot; - CREATE TEMPORARY TABLE tmp.ticketLot + CREATE TEMPORARY TABLE tmp.ticketLot SELECT vWarehouseFk warehouseFk, NULL available, s.itemFk, bu.buyFk, vZoneFk zoneFk FROM sale s LEFT JOIN tmp.buyUltimate bu ON bu.itemFk = s.itemFk - WHERE s.ticketFk = vTicketFk + WHERE s.ticketFk = vTicketFk GROUP BY s.itemFk; - + CALL catalog_componentPrepare(); CALL catalog_componentCalculate(vZoneFk, vAddressFk, vShipped, vWarehouseFk); @@ -70001,14 +71097,14 @@ proc: BEGIN (PRIMARY KEY (saleFk)) ENGINE = MEMORY SELECT id saleFk, vWarehouseFk warehouseFk FROM sale s - WHERE s.ticketFk = vTicketFk; - - -- si el ticket esta facturado, respeta los precios - CALL ticketComponentUpdateSale(IF(vIsTicketEditable, 1, 6)); - + WHERE s.ticketFk = vTicketFk; + + -- si el ticket esta facturado, respeta los precios + CALL ticketComponentUpdateSale(IF(vIsTicketEditable, 1, 6)); + CALL catalog_componentPurge(); - DROP TEMPORARY TABLE - tmp.buyUltimate, + DROP TEMPORARY TABLE + tmp.buyUltimate, tmp.sale; END ;; DELIMITER ; @@ -70016,8 +71112,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `ticket_requestRecalc` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -70025,6 +71119,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `ticket_requestRecalc`(vSelf INT) proc: BEGIN @@ -70044,8 +71140,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `ticket_setNextState` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -70053,6 +71147,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `ticket_setNextState`(vSelf INT) BEGIN @@ -70072,7 +71168,7 @@ BEGIN FROM state WHERE id = vStateFk; - INSERT INTO vncontrol.inter(state_id, Id_Ticket, Id_Trabajador) + INSERT INTO ticketTracking(stateFk, ticketFk, workerFk) VALUES (vNewStateFk, vSelf, account.myUser_getId()); END ;; DELIMITER ; @@ -70080,8 +71176,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `ticket_setParking` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -70089,6 +71183,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `ticket_setParking`(IN `vTicketFk` VARCHAR(8), IN `vParkingFk` INT) proc: BEGIN @@ -70135,8 +71231,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `ticket_setPreviousState` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -70144,35 +71238,37 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `ticket_setPreviousState`(vTicketFk INT) BEGIN DECLARE vControlFk INT; - SELECT MAX(inter_id) INTO vControlFk - FROM vncontrol.inter - WHERE Id_Ticket = vTicketFk; + SELECT MAX(id) INTO vControlFk + FROM ticketTracking + WHERE ticketFk = vTicketFk; IF (SELECT s.code FROM vn.state s - JOIN vncontrol.inter i ON i.state_id = s.id - WHERE i.inter_id = vControlFk) + JOIN ticketTracking tt ON tt.stateFk = s.id + WHERE tt.id = vControlFk) = 'PREVIOUS_PREPARATION' THEN - SELECT inter_id + SELECT id INTO vControlFk - FROM vncontrol.inter i - JOIN vn.state s ON i.state_id = s.id - WHERE Id_Ticket = vTicketFk - AND inter_id < vControlFk + FROM ticketTracking tt + JOIN vn.state s ON tt.stateFk = s.id + WHERE ticketFk = vTicketFk + AND id < vControlFk AND s.code != 'PREVIOUS_PREPARATION' - ORDER BY inter_id DESC + ORDER BY id DESC LIMIT 1; - INSERT INTO vncontrol.inter(state_id, Id_Ticket, Id_Trabajador) - SELECT s.nextStateFk, i.Id_Ticket, account.myUser_getId() - FROM vncontrol.inter i - JOIN vn.state s ON i.state_id = s.id - WHERE inter_id = vControlFk; + INSERT INTO ticketTracking(stateFk, ticketFk, workerFk) + SELECT s.nextStateFk, tt.ticketFk, account.myUser_getId() + FROM ticketTracking tt + JOIN vn.state s ON tt.stateFk = s.id + WHERE id = vControlFk; END IF; END ;; DELIMITER ; @@ -70180,8 +71276,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `ticket_setState` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -70189,6 +71283,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `ticket_setState`(vSelf INT, vStateCode VARCHAR(255)) BEGIN @@ -70220,7 +71316,7 @@ BEGIN ); IF vCanChangeState THEN - INSERT INTO vncontrol.inter(state_id, Id_Ticket, Id_Trabajador) + INSERT INTO ticketTracking(stateFk, ticketFk, workerFk) SELECT id, vSelf, account.myUser_getId() FROM state WHERE `code` = vStateCode COLLATE utf8_unicode_ci; @@ -70231,8 +71327,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `ticket_split` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -70240,6 +71334,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `ticket_split`(vTicketFk INT, vTicketFutureFk INT, vDated DATE) proc:BEGIN @@ -70258,40 +71354,40 @@ proc:BEGIN SELECT COUNT(*) INTO vProblemLines FROM tmp.salesToSplit WHERE ticketFk = vTicketFk; - + SELECT count(*) INTO vTotalLines - FROM vn.sale s + FROM vn.sale s WHERE s.ticketFk = vTicketFk; - + SET vHasFullProblem = (vTotalLines = vProblemLines); -- Ticket completo IF vHasFullProblem THEN - + UPDATE vn.ticket - SET landed = vDated + 1, + SET landed = vDated + INTERVAL 1 DAY, shipped = vDated, nickname = CONCAT('(',DAY(util.VN_CURDATE()),') ', nickname ) WHERE id = vTicketFk; - + SELECT CONCAT("Se ha cambiado el ticket ", vTicketFk, " al dia ", vDated); LEAVE proc; - + END IF; -- Ticket a futuro existe IF vTicketFutureFk THEN - - UPDATE vn.sale s + + UPDATE vn.sale s JOIN tmp.salesToSplit ss ON s.id = ss.saleFk SET s.ticketFk = vTicketFutureFk, s.concept = CONCAT('(s) ', s.concept) WHERE ss.ticketFk = vTicketFk; - - SELECT CONCAT("Se han movido lineas del ticket ", vTicketFk, + + SELECT CONCAT("Se han movido lineas del ticket ", vTicketFk, " al ticket existente ", vTicketFutureFk,"(", vDated,")"); LEAVE proc; - + END IF; -- Ticket nuevo @@ -70299,21 +71395,22 @@ proc:BEGIN UPDATE vn.ticket t JOIN vn.productionConfig pc - SET t.landed = vDated + 1, + SET t.routeFk = IF(t.shipped = vDated , t.routeFk, NULL), + t.landed = vDated + INTERVAL 1 DAY, t.shipped = vDated, t.agencyModeFk = pc.defautlAgencyMode, - t.zoneFk = pc.defaultZone + t.zoneFk = pc.defaultZone WHERE t.id = vTicketFutureFk; - - UPDATE vn.sale s - JOIN tmp.salesToSplit sts ON sts.saleFk = s.id + + UPDATE vn.sale s + JOIN tmp.salesToSplit sts ON sts.saleFk = s.id SET s.ticketFk = vTicketFutureFk, s.concept = CONCAT('(s) ', s.concept) WHERE sts.ticketFk = vTicketFk; CALL vn.ticketStateUpdate(vTicketFutureFk, 'FIXING'); - SELECT CONCAT("Se han movido lineas del ticket ", vTicketFk, + SELECT CONCAT("Se han movido lineas del ticket ", vTicketFk, " al nuevo ticket ", vTicketFutureFk,"(", vDated,")"); END ;; DELIMITER ; @@ -70321,8 +71418,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `ticket_splitItemPackingType` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -70330,6 +71425,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `ticket_splitItemPackingType`(vTicketFk INT, vOriginalItemPackingTypeFk VARCHAR(1)) proc:BEGIN @@ -70440,8 +71537,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `ticket_splitPackingComplete` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -70449,54 +71544,54 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `ticket_splitPackingComplete`(vTicketFk INT, vSectorFk INT) BEGIN - + DECLARE vNeedToSplit BOOLEAN; DECLARE vNewTicketFk INT; - + DROP TEMPORARY TABLE IF EXISTS tmpSale; - + CREATE TEMPORARY TABLE tmpSale SELECT DISTINCT s.id - FROM vn.ticket t + FROM vn.ticket t JOIN vn.sale s ON s.ticketFk = t.id - JOIN vn.item i ON i.id = s.itemFk + JOIN vn.item i ON i.id = s.itemFk LEFT JOIN vn.itemShelvingStock iss ON iss.itemFk = s.itemFk AND iss.sectorFk = vSectorFk - JOIN vn.packagingConfig pc + JOIN vn.packagingConfig pc WHERE t.id = vTicketFk AND ( s.quantity MOD IFNULL(iss.packing,1) != 0 - OR + OR IFNULL(iss.packing,1) = 1 - OR + OR i.`size` <= pc.previousPreparationMinimumSize ); - - SELECT COUNT(*) + + SELECT COUNT(*) INTO vNeedToSplit - FROM tmpSale; - + FROM tmpSale; + IF vNeedToSplit THEN - + CALL vn.ticket_Clone(vTicketFk, vNewTicketFk); - + UPDATE vn.sale s - JOIN vn.tmpSale ts ON ts.id = s.id + JOIN vn.tmpSale ts ON ts.id = s.id SET s.ticketFk = vNewTicketFk; - + END IF; - + DROP TEMPORARY TABLE tmpSale; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `ticket_WeightDeclaration` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -70504,6 +71599,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `ticket_WeightDeclaration`(vClientFk INT, vDated DATE) BEGIN @@ -70519,7 +71616,7 @@ BEGIN WHERE ot.description = 'Peso Aduana' AND t.clientFk = vClientFk AND t.shipped BETWEEN vDated AND util.dayend(vDated); - + SELECT sum(IF(sv.physicalWeight = 0, sv.weight, sv.physicalWeight)) INTO vTheorycalWeight FROM vn.ticket t JOIN vn.sale s ON s.ticketFk = t.id @@ -70528,9 +71625,9 @@ BEGIN JOIN vn.itemCost ic ON ic.itemFk = i.id AND ic.warehouseFk = t.warehouseFk WHERE t.clientFk = vClientFk AND t.shipped BETWEEN vDated AND util.dayend(vDated); - + SET vRatio = vRealWeight / vTheorycalWeight; - + DROP TEMPORARY TABLE IF EXISTS tmp.ticketWeight; CREATE TEMPORARY TABLE tmp.ticketWeight @@ -70551,15 +71648,13 @@ BEGIN AND t.shipped BETWEEN vDated AND util.dayend(vDated) GROUP BY ib.ediBotanic, o.code; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `timeBusiness_calculate` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -70567,6 +71662,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `timeBusiness_calculate`(vDatedFrom DATETIME, vDatedTo DATETIME) BEGIN @@ -70578,8 +71675,8 @@ BEGIN * @return tmp.timeBusinessCalculate */ DROP TEMPORARY TABLE IF EXISTS tmp.timeBusinessCalculate; - CREATE TEMPORARY TABLE tmp.timeBusinessCalculate + (INDEX (departmentFk)) SELECT dated, businessFk, userFk, @@ -70656,8 +71753,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `timeBusiness_calculateAll` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -70665,6 +71760,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `timeBusiness_calculateAll`(vDatedFrom DATETIME, vDatedTo DATETIME) BEGIN @@ -70676,24 +71773,22 @@ BEGIN DROP TEMPORARY TABLE IF EXISTS tmp.`user`; - CREATE TEMPORARY TABLE IF NOT EXISTS tmp.`user` + CREATE TEMPORARY TABLE IF NOT EXISTS tmp.`user` SELECT userFk FROM vn.worker w JOIN account.`user` u ON u.id = w.userFk WHERE userFk IS NOT NULL; - + CALL vn.timeBusiness_calculate(vDatedFrom, vDatedTo); DROP TEMPORARY TABLE tmp.`user`; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `timeBusiness_calculateByDepartment` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -70701,25 +71796,27 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `timeBusiness_calculateByDepartment`(vDepartmentFk INT, vDatedFrom DATETIME, vDatedTo DATETIME) BEGIN /** - * @param vDepartmentFk + * @param vDepartmentFk * @param vDatedFrom workerTimeControl * @param vDatedTo workerTimeControl */ DROP TEMPORARY TABLE IF EXISTS tmp.`user`; - + CREATE TEMPORARY TABLE tmp.`user` SELECT DISTINCT b.workerFk userFk - FROM business AS b - WHERE (b.started BETWEEN vDatedFrom AND vDatedTo + FROM business AS b + WHERE (b.started BETWEEN vDatedFrom AND vDatedTo OR IFNULL(b.ended, vDatedTo) BETWEEN vDatedFrom AND vDatedTo OR (b.started <= vDatedFrom AND b.ended >= vDatedTo) ) AND b.departmentFk = vDepartmentFk ORDER BY b.ended DESC; - + CALL timeBusiness_calculate(vDatedFrom, vDatedTo); DROP TEMPORARY TABLE tmp.`user`; @@ -70730,8 +71827,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `timeBusiness_calculateByUser` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -70739,24 +71834,26 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `timeBusiness_calculateByUser`(vUserFk INT, vDatedFrom DATETIME, vDatedTo DATETIME) BEGIN /** - * @param vUserFk + * @param vUserFk * @param vDatedFrom workerTimeControl * @param vDatedTo workerTimeControl */ - + DROP TEMPORARY TABLE IF EXISTS tmp.`user`; - + CREATE TEMPORARY TABLE tmp.`user` SELECT id userFk - FROM account.user - WHERE id = vUserFk; + FROM account.user + WHERE id = vUserFk; CALL vn.timeBusiness_calculate(vDatedFrom, vDatedTo); - + DROP TEMPORARY TABLE tmp.`user`; END ;; @@ -70765,8 +71862,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `timeBusiness_calculateByWorker` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -70774,6 +71869,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `timeBusiness_calculateByWorker`(vWorkerFk INT, vDatedFrom DATETIME, vDatedTo DATETIME) BEGIN @@ -70783,17 +71880,17 @@ BEGIN * @param vDatedFrom workerTimeControl * @param vDatedTo workerTimeControl */ - + DROP TEMPORARY TABLE IF EXISTS tmp.`user`; - + CREATE TEMPORARY TABLE tmp.`user` SELECT u.id userFk FROM account.user u JOIN vn.worker w ON w.userFk = u.id WHERE w.id = vWorkerFk; - + CALL vn.timeBusiness_calculate(vDatedFrom, vDatedTo); - + DROP TEMPORARY TABLE tmp.`user`; END ;; @@ -70802,8 +71899,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `timeControl_calculate` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -70811,26 +71906,28 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `timeControl_calculate`(vDatedFrom DATETIME, vDatedTo DATETIME) BEGIN /* * @param vDatedFrom - * @param vDatedTo + * @param vDatedTo * Calculo de horas trabajadas por empleado y dia, sin tener encuenta los dias con fichadas incorrectas * segun la tabla tmp.timeControlError * @return tmp.timeControlCalculate (workerFk, dated, timeWorkSeconds, timeWorkSexagesimal, timeWorkDecimal, timed) */ DECLARE vHourToSeconds INTEGER; DECLARE vDatedFromYesterday DATETIME; - DECLARE vDatedToTomorrow DATETIME; + DECLARE vDatedToTomorrow DATETIME; DECLARE vTimeToBreakTime INT; DECLARE vBreakTime INT; - - SELECT DATE_SUB(vDatedFrom, INTERVAL 1 DAY), DATE_ADD(vDatedTo, INTERVAL 1 DAY) + + SELECT DATE_SUB(vDatedFrom, INTERVAL 1 DAY), DATE_ADD(vDatedTo, INTERVAL 1 DAY) INTO vDatedFromYesterday, vDatedToTomorrow; - - SELECT timeToBreakTime, breakTime INTO vTimeToBreakTime, vBreakTime + + SELECT timeToBreakTime, breakTime INTO vTimeToBreakTime, vBreakTime FROM workerTimeControlConfig LIMIT 1; CALL timeControl_getError(vDatedFrom, vDatedTo); @@ -70839,9 +71936,9 @@ BEGIN CREATE TEMPORARY TABLE tmp.workerTimeControl (INDEX (userFk), INDEX (timed)) ENGINE = MEMORY - SELECT DISTINCT(wtc.id), - wtc.userFk, - wtc.timed, + SELECT DISTINCT(wtc.id), + wtc.userFk, + wtc.timed, wtc.direction, TRUE isReal FROM workerTimeControl wtc @@ -70851,10 +71948,10 @@ BEGIN AND tce.id IS NULL ORDER BY wtc.userFk, wtc.timed ASC; - SELECT MAX(id) INTO @vCont + SELECT MAX(id) INTO @vCont FROM tmp.workerTimeControl; - DROP TEMPORARY TABLE IF EXISTS tmp.workerTimeControlAux; + DROP TEMPORARY TABLE IF EXISTS tmp.workerTimeControlAux; CREATE TEMPORARY TABLE tmp.workerTimeControlAux ( `id` int(11) , `userFk` int(10) unsigned , @@ -70943,7 +72040,7 @@ BEGIN IF(direction='in', @vDated := DATE(wtc.timed), @vDated) dated, wtc.userFk FROM tmp.workerTimeControl wtc - ORDER BY wtc.userFk, wtc.timed, wtc.id + ORDER BY wtc.userFk, wtc.timed, wtc.id LIMIT 10000000000000000000 )sub GROUP BY sub.userFk, sub.dated @@ -70954,9 +72051,9 @@ BEGIN SET @vLastTimed := 0; DROP TEMPORARY TABLE IF EXISTS tmp.workerTimeControlAux2; - CREATE TEMPORARY TABLE tmp.workerTimeControlAux2 + CREATE TEMPORARY TABLE tmp.workerTimeControlAux2 SELECT * - FROM tmp.workerTimeControl + FROM tmp.workerTimeControl WHERE timed BETWEEN vDatedFromYesterday AND vDatedTo ORDER BY userFk, timed, id; @@ -70995,8 +72092,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `timeControl_calculateAll` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -71004,6 +72099,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `timeControl_calculateAll`(vDatedFrom DATETIME, vDatedTo DATETIME) BEGIN @@ -71015,24 +72112,22 @@ BEGIN DROP TEMPORARY TABLE IF EXISTS tmp.`user`; - CREATE TEMPORARY TABLE IF NOT EXISTS tmp.`user` + CREATE TEMPORARY TABLE IF NOT EXISTS tmp.`user` SELECT userFk FROM vn.worker w JOIN account.`user` u ON u.id = w.userFk WHERE userFk IS NOT NULL; - + CALL vn.timeControl_calculate(vDatedFrom, vDatedTo); DROP TEMPORARY TABLE tmp.`user`; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `timeControl_calculateByDepartment` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -71040,25 +72135,27 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `timeControl_calculateByDepartment`(vDepartmentFk INT, vDatedFrom DATETIME, vDatedTo DATETIME) BEGIN /** - * @param vDepartmentFk + * @param vDepartmentFk * @param vDatedFrom workerTimeControl * @param vDatedTo workerTimeControl */ DROP TEMPORARY TABLE IF EXISTS tmp.`user`; - + CREATE TEMPORARY TABLE tmp.`user` SELECT DISTINCT b.workerFk userFk - FROM business AS b - WHERE (b.started BETWEEN vDatedFrom AND vDatedTo + FROM business AS b + WHERE (b.started BETWEEN vDatedFrom AND vDatedTo OR IFNULL(b.ended, vDatedTo) BETWEEN vDatedFrom AND vDatedTo OR (b.started <= vDatedFrom AND b.ended >= vDatedTo) ) AND b.departmentFk = vDepartmentFk ORDER BY b.ended DESC; - + CALL timeControl_calculate(vDatedFrom, vDatedTo); DROP TEMPORARY TABLE tmp.`user`; @@ -71069,8 +72166,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `timeControl_calculateByUser` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -71078,24 +72173,26 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `timeControl_calculateByUser`(vUserFk INT, vDatedFrom DATETIME, vDatedTo DATETIME) BEGIN /** - * @param vUserFk + * @param vUserFk * @param vDatedFrom workerTimeControl * @param vDatedTo workerTimeControl */ - + DROP TEMPORARY TABLE IF EXISTS tmp.`user`; - + CREATE TEMPORARY TABLE tmp.`user` SELECT id userFk - FROM account.user - WHERE id = vUserFk; + FROM account.user + WHERE id = vUserFk; CALL vn.timeControl_calculate(vDatedFrom, vDatedTo); - + DROP TEMPORARY TABLE tmp.`user`; END ;; @@ -71104,8 +72201,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `timeControl_calculateByWorker` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -71113,26 +72208,28 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `timeControl_calculateByWorker`(vWorkerFk INT, vDatedFrom DATETIME, vDatedTo DATETIME) BEGIN /** - * @param vWorkerFk + * @param vWorkerFk * @param vDatedFrom workerTimeControl * @param vDatedTo workerTimeControl */ - + DROP TEMPORARY TABLE IF EXISTS tmp.`user`; - + CREATE TEMPORARY TABLE tmp.`user` SELECT u.id userFk FROM account.user u JOIN vn.worker w ON w.userFk = u.id WHERE w.id = vWorkerFk; - + CALL vn.timeControl_calculate(vDatedFrom, vDatedTo); - + DROP TEMPORARY TABLE tmp.`user`; END ;; @@ -71141,8 +72238,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `timeControl_getError` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -71150,17 +72245,19 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `timeControl_getError`(vDatedFrom DATETIME, vDatedTo DATETIME) BEGIN /* * @param vDatedFrom - * @param vDatedTo + * @param vDatedTo * @table tmp.`user`(userFk) * Fichadas incorrectas de las cuales no se puede calcular horas trabajadas * @return tmp.timeControlError (id) */ - DECLARE vDayMaxTime INTEGER; + DECLARE vDayMaxTime INTEGER; SET @journeyCounter := 0; SET @lastUserFk := NULL; @@ -71168,16 +72265,16 @@ BEGIN SELECT dayMaxTime INTO vDayMaxTime FROM workerTimeControlConfig LIMIT 1; - DROP TEMPORARY TABLE IF EXISTS tmp.timeControl; - CREATE TEMPORARY TABLE tmp.timeControl + DROP TEMPORARY TABLE IF EXISTS tmp.timeControl; + CREATE TEMPORARY TABLE tmp.timeControl (INDEX(id), INDEX(journeyCounter)) ENGINE = MEMORY SELECT sub.id, - sub.direction, + sub.direction, sub.timed, IF(sub.direction = 'in' OR @hasOut OR sub.userFk <> @lastUserFk, @journeyCounter := @journeyCounter + 1, @journeyCounter) journeyCounter, - @lastUserFk := sub.userFk workerFk, - IF(sub.direction = 'out', @hasOut:= TRUE, @hasOut:= FALSE) + @lastUserFk := sub.userFk workerFk, + IF(sub.direction = 'out', @hasOut:= TRUE, @hasOut:= FALSE) FROM ( SELECT DISTINCT wtc.id, wtc.direction, @@ -71188,44 +72285,42 @@ BEGIN WHERE wtc.timed BETWEEN DATE_SUB(vDatedFrom, INTERVAL 1 DAY) AND DATE_ADD(vDatedTo, INTERVAL 1 DAY) ORDER BY wtc.userFk, wtc.timed ) sub; - - DROP TEMPORARY TABLE IF EXISTS tmp.timeControlAux; + + DROP TEMPORARY TABLE IF EXISTS tmp.timeControlAux; CREATE TEMPORARY TABLE tmp.timeControlAux (INDEX(id), INDEX(journeyCounter)) ENGINE = MEMORY SELECT * FROM tmp.timeControl; - DROP TEMPORARY TABLE IF EXISTS tmp.timeControlError; - CREATE TEMPORARY TABLE tmp.timeControlError + DROP TEMPORARY TABLE IF EXISTS tmp.timeControlError; + CREATE TEMPORARY TABLE tmp.timeControlError (INDEX(id)) ENGINE = MEMORY - SELECT id + SELECT id FROM tmp.timeControlAux tca JOIN ( - SELECT journeyCounter, + SELECT journeyCounter, UNIX_TIMESTAMP(MAX(timed)) - UNIX_TIMESTAMP(MIN(timed)) timeWork, - SUM(direction = 'in') totalIn, + SUM(direction = 'in') totalIn, SUM(direction = 'out') totalOut, timed FROM tmp.timeControl GROUP BY journeyCounter - HAVING COUNT(*) MOD 2 = 1 - OR totalIn <> 1 - OR totalOut <> 1 + HAVING COUNT(*) MOD 2 = 1 + OR totalIn <> 1 + OR totalOut <> 1 OR timeWork >= vDayMaxTime )sub ON sub.journeyCounter = tca.journeyCounter WHERE sub.timed BETWEEN vDatedFrom AND vDatedTo; - DROP TEMPORARY TABLE IF EXISTS tmp.timeControl; - DROP TEMPORARY TABLE IF EXISTS tmp.timeControlAux; + DROP TEMPORARY TABLE IF EXISTS tmp.timeControl; + DROP TEMPORARY TABLE IF EXISTS tmp.timeControlAux; END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `timeWorkerControl_check` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -71233,6 +72328,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `timeWorkerControl_check`(vUserFk INT, vDated DATE,vTabletFk VARCHAR(100)) proc: BEGIN @@ -71240,15 +72337,13 @@ proc: BEGIN * deprecated call workerTimeControl_check */ CALL vn.workerTimeControl_check(vUserFk,vDated,vTabletFk); - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `tpvTransaction_checkStatus` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -71256,11 +72351,13 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `tpvTransaction_checkStatus`() BEGIN /** - * + * * Envia mail con los cobros web no * trasladados a la ficha del cliente. * @@ -71285,8 +72382,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `travelVolume` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -71294,15 +72389,17 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `travelVolume`(vTravelFk INT) BEGIN - - SELECT w1.name AS ORI, - w2.name AS DES, + + SELECT w1.name AS ORI, + w2.name AS DES, tr.shipped shipment, tr.landed landing, - a.name Agencia, + a.name Agencia, s.name Proveedor, e.id Id_Entrada, e.invoiceNumber Referencia, @@ -71310,26 +72407,24 @@ BEGIN vn.item_getVolume(b.itemFk ,b.packageFk)) / vc.trolleyM3 / 1000000 ,1) AS DECIMAL(10,2)) AS CC, CAST(ROUND(SUM(GREATEST(b.stickers ,b.quantity /b.packing ) * vn.item_getVolume(b.itemFk ,b.packageFk)) / vc.palletM3 / 1000000,1) AS DECIMAL(10,2)) AS espais - FROM vn.buy b - JOIN vn.entry e ON e.id = b.entryFk - JOIN vn.supplier s ON s.id = e.supplierFk - JOIN vn.travel tr ON tr.id = e.travelFk + FROM vn.buy b + JOIN vn.entry e ON e.id = b.entryFk + JOIN vn.supplier s ON s.id = e.supplierFk + JOIN vn.travel tr ON tr.id = e.travelFk JOIN vn.agencyMode a ON a.id = tr.agencyModeFk - JOIN vn.warehouse w1 ON w1.id = tr.warehouseInFk - JOIN vn.warehouse w2 ON w2.id = tr.warehouseOutFk - JOIN vn.volumeConfig vc - JOIN vn.item i ON i.id = b.itemFk + JOIN vn.warehouse w1 ON w1.id = tr.warehouseInFk + JOIN vn.warehouse w2 ON w2.id = tr.warehouseOutFk + JOIN vn.volumeConfig vc + JOIN vn.item i ON i.id = b.itemFk JOIN vn.itemType it ON it.id = i.typeFk WHERE tr.id = vTravelFk; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `travelVolume_get` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -71337,6 +72432,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `travelVolume_get`(vFromDated DATE, vToDated DATE, vWarehouseFk INT) BEGIN @@ -71358,8 +72455,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `travel_checkDates` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -71367,6 +72462,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `travel_checkDates`(vShipped DATE, vLanded DATE) BEGIN @@ -71377,19 +72474,17 @@ BEGIN * @param vShipped The shipment date * @param vLanded The landing date */ - + IF vLanded < vShipped THEN SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'Landing cannot be lesser than shipment'; - END IF; + END IF; END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `travel_clone` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -71397,6 +72492,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `travel_clone`(vSelf INT, vDays INT, OUT vNewTravelFk INT) BEGIN @@ -71447,8 +72544,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `travel_cloneWithEntries` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -71456,15 +72551,17 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `travel_cloneWithEntries`( - IN vTravelFk INT, - IN vDateStart DATE, + IN vTravelFk INT, + IN vDateStart DATE, IN vDateEnd DATE, IN vWarehouseOutFk INT, - IN vWarehouseInFk INT, - IN vRef VARCHAR(255), - IN vAgencyModeFk INT, + IN vWarehouseInFk INT, + IN vRef VARCHAR(255), + IN vAgencyModeFk INT, OUT vNewTravelFk INT) BEGIN /** @@ -71479,123 +72576,62 @@ BEGIN * @param vAgencyModeFk del nuevo travel * @param vNewTravelFk id del nuevo travel */ - DECLARE vEntryNew INT; - DECLARE vDone BOOLEAN DEFAULT FALSE; + DECLARE vNewEntryFk INT; + DECLARE vEvaNotes VARCHAR(255); + DECLARE vDone BOOL; DECLARE vAuxEntryFk INT; DECLARE vRsEntry CURSOR FOR SELECT e.id FROM entry e - JOIN travel t - ON t.id = e.travelFk + JOIN travel t ON t.id = e.travelFk WHERE e.travelFk = vTravelFk; - + DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE; - DECLARE EXIT HANDLER FOR SQLEXCEPTION/*, 1062 Duplicate key*/ - BEGIN - ROLLBACK; - - END; - + DECLARE EXIT HANDLER FOR SQLEXCEPTION + BEGIN + ROLLBACK; + RESIGNAL; + END; + START TRANSACTION; - INSERT INTO travel (shipped, landed, warehouseInFk, warehouseOutFk, agencyModeFk, `ref`, isDelivered, isReceived, m3, kg) - SELECT vDateStart, vDateEnd, vWarehouseInFk, vWarehouseOutFk, vAgencyModeFk, vRef, isDelivered, isReceived, m3, kg + + INSERT INTO travel (shipped, landed, warehouseInFk, warehouseOutFk, agencyModeFk, `ref`, isDelivered, isReceived, m3, cargoSupplierFk, kg) + SELECT vDateStart, vDateEnd, vWarehouseInFk, vWarehouseOutFk, vAgencyModeFk, vRef, isDelivered, isReceived, m3,cargoSupplierFk, kg FROM travel WHERE id = vTravelFk; - + SET vNewTravelFk = LAST_INSERT_ID(); CALL logAdd(vNewTravelFk, 'insert', 'travel', CONCAT('clona travel ',vTravelFk)); + SET vDone = FALSE; SET @isModeInventory = TRUE; - OPEN vRsEntry ; - FETCH vRsEntry INTO vAuxEntryFk; - WHILE NOT vDone DO - INSERT INTO entry ( - supplierFk, - invoiceNumber, - isExcludedFromAvailable, - isConfirmed, - isOrdered, - isRaid, - commission, - created, - evaNotes, - travelFk, - currencyFk, - companyFk, - gestDocFk, - invoiceInFk) - SELECT supplierFk, - invoiceNumber, - isExcludedFromAvailable, - isConfirmed, - isOrdered, - isRaid, - commission, - created, - evaNotes, - vNewTravelFk, - currencyFk, - companyFk, - gestDocFk, - invoiceInFk + OPEN vRsEntry; + + l: LOOP + SET vDone = FALSE; + FETCH vRsEntry INTO vAuxEntryFk; + + IF vDone THEN + LEAVE l; + END IF; + + CALL entry_cloneHeader(vAuxEntryFk, vNewEntryFk, vNewTravelFk); + CALL entry_copyBuys(vAuxEntryFk, vNewEntryFk); + + SELECT evaNotes INTO vEvaNotes FROM entry WHERE id = vAuxEntryFk; - SET vEntryNew = LAST_INSERT_ID(); + UPDATE entry + SET evaNotes = vEvaNotes + WHERE id = vNewEntryFk; + END LOOP; - CALL logAdd(vEntryNew, 'insert', 'entry', CONCAT('clona entrada ',vAuxEntryFk)); - INSERT INTO buy ( - entryFk, - itemFk, - quantity, - buyingValue, - packageFk, - stickers, - freightValue, - packageValue, - comissionValue, - packing, - `grouping`, - groupingMode, - location, - price1, - price2, - price3, - minPrice, - printedStickers, - isChecked, - weight, - itemOriginalFk) - SELECT vEntryNew, - itemFk, - quantity, - buyingValue, - packageFk, - stickers, - freightValue, - packageValue, - comissionValue, - packing, - `grouping`, - groupingMode, - location, - price1, - price2, - price3, - minPrice, - printedStickers, - isChecked, - weight, - itemOriginalFk - FROM buy - WHERE entryFk = vAuxEntryFk; - - FETCH vRsEntry INTO vAuxEntryFk; - END WHILE; SET @isModeInventory = FALSE; CLOSE vRsEntry; + COMMIT; END ;; DELIMITER ; @@ -71603,8 +72639,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `travel_doRecalc` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -71612,6 +72646,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `travel_doRecalc`() BEGIN @@ -71641,11 +72677,11 @@ BEGIN SELECT COUNT(*) INTO vTotalEntries FROM entry WHERE travelFk = vTravelFk; - + UPDATE travel SET totalEntries = vTotalEntries WHERE id = vTravelFk; - + DELETE FROM travelRecalc WHERE travelFk = vTravelFk; END LOOP; @@ -71656,8 +72692,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `travel_moveRaids` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -71665,13 +72699,15 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `travel_moveRaids`() BEGIN /* * Desplaza al dia siguiente los travels que contengan redadas y avisa a los compradores - * + * */ DECLARE vDone BOOL DEFAULT FALSE; DECLARE vWorkerName VARCHAR(50); @@ -71683,7 +72719,7 @@ BEGIN SELECT GROUP_CONCAT( DISTINCT CONCAT('https://salix.verdnatura.es/#!/travel/', ttr.id, '/summary ') ORDER BY ttr.id SEPARATOR '\n\r'), u.name FROM tmp.travel ttr - JOIN entry e ON e.travelFk = ttr.id + JOIN entry e ON e.travelFk = ttr.id JOIN buy b ON b.entryFk = e.id JOIN item i ON i.id = b.itemFk JOIN itemType it ON it.id = i.typeFk @@ -71691,19 +72727,19 @@ BEGIN GROUP BY u.name; DECLARE CONTINUE HANDLER FOR NOT FOUND - SET vDone = TRUE; + SET vDone = TRUE; DECLARE EXIT HANDLER FOR SQLEXCEPTION BEGIN ROLLBACK; RESIGNAL; END; - + DROP TEMPORARY TABLE IF EXISTS tmp.travel; CREATE TEMPORARY TABLE tmp.travel SELECT tr.id,tr.landed FROM travel tr - JOIN entry e ON e.travelFk = tr.id + JOIN entry e ON e.travelFk = tr.id WHERE tr.landed = util.tomorrow() AND e.isRaid GROUP BY tr.id; @@ -71745,8 +72781,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `travel_requestRecalc` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -71754,6 +72788,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `travel_requestRecalc`(vSelf INT) proc: BEGIN @@ -71765,7 +72801,7 @@ proc: BEGIN IF vSelf IS NULL THEN LEAVE proc; END IF; - + INSERT IGNORE INTO travelRecalc SET travelFk = vSelf; END ;; DELIMITER ; @@ -71773,8 +72809,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `travel_weeklyClone` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -71782,16 +72816,17 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `travel_weeklyClone`(vSinceWeek INT, vToWeek INT) BEGIN /** - * Clona los travels plantilla para las semanas pasadas por parámetros + * Clona los traslados plantilla para las semanas pasadas por parámetros. * * @param vSinceWeek Número de semanas en el futuro para empezar a clonar * @param vToWeek Número de semenas en el futuro hasta donde clonar */ - DECLARE vCounter INT; DECLARE vCurrentTravelFk INT; DECLARE vShipped DATE; @@ -71800,10 +72835,11 @@ BEGIN DECLARE vWarehouseOutFk INT; DECLARE vAgencyModeFk INT; DECLARE vRef VARCHAR(255); - DECLARE vDone BOOLEAN DEFAULT FALSE; + DECLARE vNewTravelFk INT; + DECLARE vDone BOOL; DECLARE vRsTravel CURSOR FOR - SELECT travelFk, - @a := TIMESTAMPADD(DAY,vCounter * 7 - WEEKDAY(util.VN_CURDATE()) - 1 + weekDay,util.VN_CURDATE()), + SELECT travelFk, + @a := TIMESTAMPADD(DAY,vCounter * 7 - WEEKDAY(util.VN_CURDATE()) - 1 + weekDay, util.VN_CURDATE()), @a := TIMESTAMPADD(DAY,duration,@a), warehouseOutFk, warehouseInFk, @@ -71812,12 +72848,13 @@ BEGIN FROM travelClonedWeekly WHERE travelFk; - DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE; + DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE; SET vCounter = vSinceWeek; + vWeekLoop :LOOP INSERT IGNORE INTO travel (shipped, landed, warehouseOutFk, warehouseInFk, agencyModeFk, ref, cargoSupplierFk, kg) - SELECT @a := TIMESTAMPADD(DAY, vCounter * 7 - WEEKDAY(util.VN_CURDATE()) - 1 + weekDay,util.VN_CURDATE()), + SELECT @a := TIMESTAMPADD(DAY, vCounter * 7 - WEEKDAY(util.VN_CURDATE()) - 1 + weekDay, util.VN_CURDATE()), @a := TIMESTAMPADD(DAY, duration, @a), warehouseOutFk, warehouseInFk, @@ -71827,30 +72864,37 @@ BEGIN kg FROM travelClonedWeekly WHERE travelFk IS NULL; + OPEN vRsTravel; - FETCH vRsTravel INTO vCurrentTravelFk, vShipped, vLanded, vWarehouseOutFk, vWarehouseInFk, vRef, vAgencyModeFk; - SET vDone = FALSE; - WHILE NOT vDone DO - CALL travel_cloneWithEntries(vCurrentTravelFk, vShipped, vLanded, vWarehouseOutFk, vWarehouseInFk, vRef, vAgencyModeFk, @newTravel); + + l: LOOP + SET vDone = FALSE; FETCH vRsTravel INTO vCurrentTravelFk, vShipped, vLanded, vWarehouseOutFk, vWarehouseInFk, vRef, vAgencyModeFk; - END WHILE; + + IF vDone THEN + LEAVE l; + END IF; + + BEGIN + DECLARE CONTINUE HANDLER FOR SQLEXCEPTION RESIGNAL SQLSTATE '01000'; + CALL travel_cloneWithEntries(vCurrentTravelFk, vShipped, vLanded, vWarehouseOutFk, vWarehouseInFk, vRef, vAgencyModeFk, vNewTravelFk); + END; + END LOOP; + CLOSE vRsTravel; IF vCounter = vToWeek THEN LEAVE vWeekLoop; END IF; + SET vCounter = vCounter + 1; - END LOOP vWeekLoop; - END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `typeTagMake` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -71858,18 +72902,20 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `typeTagMake`(vTypeFk INT) BEGIN /* * Plantilla para modificar reemplazar todos los tags * por los valores que tienen los articulos - * + * * @param vTypeFk tipo a modificar - * + * */ - DELETE it.* - FROM itemTag it + DELETE it.* + FROM itemTag it JOIN item i ON i.id = it.itemFk WHERE i.typeFk = vTypeFk; @@ -71878,40 +72924,40 @@ BEGIN FROM item i JOIN tag t ON t.name = 'Longitud' COLLATE utf8_general_ci WHERE i.typeFk = vTypeFk; - + INSERT INTO itemTag(itemFk, tagFk, value, priority) SELECT i.id, t.id, i.category, 5 FROM item i JOIN tag t ON t.name = 'Categoria' COLLATE utf8_general_ci WHERE i.typeFk = vTypeFk; - + INSERT INTO itemTag(itemFk, tagFk, value, priority) SELECT i.id, t.id, ink.name, 2 FROM item i JOIN tag t ON t.name = 'Color' COLLATE utf8_general_ci JOIN ink ON ink.id = i.inkFk WHERE i.typeFk = vTypeFk; - + INSERT INTO itemTag(itemFk, tagFk, value, priority) SELECT i.id, t.id, p.name, 3 FROM item i JOIN tag t ON t.name = 'Productor' COLLATE utf8_general_ci JOIN producer p ON p.id = i.producerFk - WHERE i.typeFk = vTypeFk; - + WHERE i.typeFk = vTypeFk; + INSERT INTO itemTag(itemFk, tagFk, value, priority) SELECT i.id, t.id, o.name, 4 FROM item i JOIN tag t ON t.name = 'Origen' COLLATE utf8_general_ci JOIN origin o ON o.id = i.originFk WHERE i.typeFk = vTypeFk; - /* + /* INSERT INTO itemTag(itemFk, tagFk, value, priority) SELECT i.id, t.id, i.stems, 6 FROM item i JOIN tag t ON t.name = 'Tallos' COLLATE utf8_general_ci - WHERE i.typeFk = vTypeFk; - */ + WHERE i.typeFk = vTypeFk; + */ -- CALL itemTagArrangedUpdate(NULL); END ;; @@ -71920,8 +72966,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `updatePedidosInternos` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -71929,12 +72973,14 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `updatePedidosInternos`(vItemFk INT) BEGIN UPDATE vn.item SET upToDown = 0 WHERE item.id = vItemFk; - + END ;; DELIMITER ; @@ -71942,8 +72988,70 @@ 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 PROCEDURE IF EXISTS `vehicle_notifyEvents` */; +/*!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 = utf8mb4 */ ; +/*!50003 SET character_set_results = utf8mb4 */ ; +/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; +DELIMITER ;; +CREATE DEFINER=`root`@`localhost` PROCEDURE `vehicle_notifyEvents`() +proc:BEGIN +/** + * Query the vehicleEvent table to see if there are any events that need to be notified. + * + */ + DECLARE vEventEarlyDays INT; + DECLARE vHasEvents INT; + DECLARE EXIT HANDLER FOR SQLEXCEPTION + BEGIN + ROLLBACK; + RESIGNAL; + END; + + SELECT eventEarlyDays INTO vEventEarlyDays + FROM vehicleConfig; + + DROP TEMPORARY TABLE IF EXISTS tEvents; + CREATE TEMPORARY TABLE tEvents + SELECT e.id + FROM vehicleEvent e + JOIN vehicleState s ON e.vehicleStateFk = s.id + WHERE e.finished BETWEEN util.VN_CURDATE() AND TIMESTAMPADD(DAY, vEventEarlyDays, util.VN_CURDATE()) + AND e.notified IS NULL + AND s.hasToNotify; + + SELECT COUNT(id) INTO vHasEvents FROM tEvents; + + IF NOT vHasEvents THEN + LEAVE proc; + END IF; + + START TRANSACTION; + + SELECT util.notification_send('vehicle-event-expired', + JSON_OBJECT('eventIds', JSON_ARRAYAGG(id)), + account.myUser_getId() + ) + FROM tEvents; + + UPDATE vehicleEvent e + JOIN tEvents s ON e.id = s.id + SET e.notified = util.VN_NOW() + WHERE e.id = s.id; + COMMIT; + + DROP TEMPORARY TABLE IF EXISTS tEvents; + +END ;; +DELIMITER ; +/*!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 PROCEDURE IF EXISTS `visible_getMisfit` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -71951,24 +73059,26 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `visible_getMisfit`(vSectorFk INT) BEGIN - + /* Devuelve una tabla temporal con los descuadres entre el visible teórico y lo ubicado en la práctica - * + * * @param vSectorFk Identificador de vn.sector - * + * * @return tmp.stockMisfit(itemFk, visible, parked) */ - + DECLARE vCalcVisibleFk INT; DECLARE vWarehouseFk INT; SELECT warehouseFk INTO vWarehouseFk - FROM vn.sector s + FROM vn.sector s WHERE s.id = vSectorFk; - + CALL cache.visible_refresh(vCalcVisibleFk, FALSE, vWarehouseFk); DROP TEMPORARY TABLE IF EXISTS tmp.stockMisfit; @@ -71981,17 +73091,17 @@ BEGIN INSERT INTO tmp.stockMisfit(itemFk, parked) SELECT iss.itemFk , sum(iss.visible ) - FROM vn.itemShelvingStock iss - JOIN vn.sector s ON s.id = iss.sectorFk + FROM vn.itemShelvingStock iss + JOIN vn.sector s ON s.id = iss.sectorFk WHERE vSectorFk IN (s.id, s.sonFk) GROUP BY iss.itemFk; - + INSERT INTO tmp.stockMisfit(itemFk, visible) - SELECT v.item_id , v.visible - FROM cache.visible v - WHERE v.calc_id = vCalcVisibleFk + SELECT v.item_id , v.visible + FROM cache.visible v + WHERE v.calc_id = vCalcVisibleFk ON DUPLICATE KEY UPDATE visible = v.visible; - + DELETE FROM tmp.stockMisfit WHERE visible = parked; @@ -72001,8 +73111,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `warehouseFitting` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -72010,22 +73118,24 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `warehouseFitting`(IN vWhOrigin INT , IN vWhDestiny INT) BEGIN DECLARE vCacheVisibleOriginFk INT; DECLARE vCacheVisibleDestinyFk INT; - + CALL cache.visible_refresh(vCacheVisibleOriginFk, FALSE, vWhOrigin); CALL cache.visible_refresh(vCacheVisibleDestinyFk, FALSE, vWhDestiny); - + SELECT i.id itemFk, i.longName, i.size, i.subName, vOrigin.visible AS Origen, vDestiny.visible Destino - + FROM vn.item i JOIN vn.itemType it ON it.id = i.typeFk LEFT JOIN cache.visible vOrigin ON vOrigin.calc_id = vCacheVisibleOriginFk AND vOrigin.item_id = i.id @@ -72039,8 +73149,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `warehouseFitting_byTravel` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -72048,27 +73156,27 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `warehouseFitting_byTravel`(IN vTravelFk INT) BEGIN DECLARE vWhOrigin INT; DECLARE vWhDestiny INT; - + SELECT warehouseInFk, warehouseOutFk INTO vWhDestiny, vWhOrigin FROM vn.travel WHERE id = vTravelFk; - + CALL vn.warehouseFitting(vWhOrigin, vWhDestiny); - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `workerCalculateBoss` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -72076,6 +73184,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `workerCalculateBoss`(vWorker INT) BEGIN @@ -72108,8 +73218,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `workerCalendar_calculateBusiness` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -72117,6 +73225,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `workerCalendar_calculateBusiness`(vYear INT, vBusinessFk INT) BEGIN @@ -72124,7 +73234,7 @@ BEGIN * Calcula los días y horas de vacaciones en función de un contrato y año * * @param vYear - * @param vBusinessFk + * @param vBusinessFk * @return tmp.workerCalendarCalculateBusiness (days, hours, daysEnjoyed, hoursEnjoyed) */ DECLARE vStarted DATE; @@ -72136,17 +73246,17 @@ BEGIN DECLARE vPayedHolidays DECIMAL(5,2); DECLARE vDifDays INT; - SELECT IF(b.started < CONCAT(vYear,"-01-01"), CONCAT(vYear,"-01-01"),b.started), - IF(b.ended IS NULL OR YEAR(b.ended)>vYear , CONCAT(vYear,"-12-31"), b.ended), + SELECT IF(b.started < CONCAT(vYear,"-01-01"), CONCAT(vYear,"-01-01"),b.started), + IF(b.ended IS NULL OR YEAR(b.ended)>vYear , CONCAT(vYear,"-12-31"), b.ended), IF(wbt.hasHolidayEntitlement, w.days, 0), c.hours_week, IF(YEAR(b.ended) = vYear, b.payedHolidays, 0) payedHolidays - INTO vStarted, - vEnded, - vDaysHoliday, + INTO vStarted, + vEnded, + vDaysHoliday, vHoursWeek, vPayedHolidays - FROM business b + FROM business b JOIN workerBusinessType wbt ON wbt.id = b.workerBusinessTypeFk JOIN workCenterHoliday w ON w.workcenterFk = b.workcenterFk LEFT JOIN postgresql.calendar_labour_type c ON c.calendar_labour_type_id = b.calendarTypeFk @@ -72154,21 +73264,21 @@ BEGIN AND w.year = vYear; DROP TEMPORARY TABLE IF EXISTS tmp.workerCalendarCalculateBusiness; - + IF vStarted < vEnded THEN SET vDifDays = DAYOFYEAR(vEnded) - DAYOFYEAR(vStarted) + 1; - SELECT IFNULL(SUM(holidayEntitlementRate), 0), + SELECT IFNULL(SUM(holidayEntitlementRate), 0), SUM(-(discountRate - 1)) + vPayedHolidays - INTO vDaysToSubtract, - vDaysHolidayEnjoyed + INTO vDaysToSubtract, + vDaysHolidayEnjoyed FROM workerCalendar w JOIN absenceType a ON a.id = w.absenceTypeFk - WHERE w.businessFk = vBusinessFk + WHERE w.businessFk = vBusinessFk AND YEAR(dated) = vYear; END IF; - CREATE TEMPORARY TABLE tmp.workerCalendarCalculateBusiness + CREATE TEMPORARY TABLE tmp.workerCalendarCalculateBusiness ENGINE = MEMORY SELECT @days := IFNULL(ROUND((vDaysHoliday * (vDifDays - vDaysToSubtract) / IF(util.isLeapYear(vYear) , 366, 365)), 1), 0) days, @days * (vHoursWeek / 5) hours, @@ -72180,8 +73290,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `workerCalendar_calculateYear` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -72189,6 +73297,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `workerCalendar_calculateYear`(vYear INT, vWorkerFk INT) BEGIN @@ -72196,32 +73306,32 @@ BEGIN /** * Calcula los días y horas de vacaciones en función de un trabajador y año * - * @param vYear - * @param vWorkerFk + * @param vYear + * @param vWorkerFk * @return tmp.workerCalendarCalculateYear (days, hours, daysEnjoyed, hoursEnjoyed) - */ + */ DECLARE vDone BOOL; DECLARE vBusinessFk INT; DECLARE cur CURSOR FOR - SELECT b.id + SELECT b.id FROM business b - WHERE vYear BETWEEN YEAR(b.started) AND IFNULL(YEAR(b.ended), vYear) + WHERE vYear BETWEEN YEAR(b.started) AND IFNULL(YEAR(b.ended), vYear) AND b.workerFk = vWorkerFk; DECLARE CONTINUE HANDLER FOR NOT FOUND - SET vDone = TRUE; - + SET vDone = TRUE; + DROP TEMPORARY TABLE IF EXISTS tmp.workerCalendarCalculateYear; CREATE TEMPORARY TABLE tmp.workerCalendarCalculateYear - (days DEC(5,2), + (days DEC(5,2), hours DEC(5,2), - daysEnjoyed DEC(5,2), - hoursEnjoyed DEC(5,2)) + daysEnjoyed DEC(5,2), + hoursEnjoyed DEC(5,2)) ENGINE = MEMORY; INSERT INTO tmp.workerCalendarCalculateYear VALUES(0, 0, 0, 0); - + OPEN cur; l: LOOP @@ -72234,12 +73344,12 @@ BEGIN CALL workerCalendar_calculateBusiness(vYear, vBusinessFk); UPDATE tmp.workerCalendarCalculateYear w - JOIN tmp.workerCalendarCalculateBusiness wc + JOIN tmp.workerCalendarCalculateBusiness wc SET w.days = w.days + wc.days, w.hours = w.hours + wc.hours, w.daysEnjoyed = w.daysEnjoyed + wc.daysEnjoyed, w.hoursEnjoyed = w.hoursEnjoyed + wc.hoursEnjoyed; - + DROP TEMPORARY TABLE tmp.workerCalendarCalculateBusiness; END LOOP; @@ -72252,8 +73362,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `workerCreate` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -72261,10 +73369,12 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `workerCreate`( vFirstname VARCHAR(50), - vLastName VARCHAR(50), + vLastName VARCHAR(50), vCode CHAR(3), vBossFk INT, vUserFk INT, @@ -72276,7 +73386,7 @@ BEGIN * Create new worker * */ - INSERT INTO worker(id, code, firstName, lastName, userFk, bossFk, fi, birth) + INSERT INTO worker(id, code, firstName, lastName, userFk, bossFk, fi, birth) VALUES (vUserFk, vCode, vFirstname, vLastName, vUserFk, vBossFk, vFi, vBirth); END ;; DELIMITER ; @@ -72284,8 +73394,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `workerCreateExternal` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -72293,6 +73401,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `workerCreateExternal`( vFirstName VARCHAR(50), @@ -72327,8 +73437,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `workerDepartmentByDate` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -72336,6 +73444,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `workerDepartmentByDate`(vDate DATE) BEGIN @@ -72343,20 +73453,20 @@ BEGIN DROP TEMPORARY TABLE IF EXISTS tmp.workerDepartmentByDate; CREATE TEMPORARY TABLE tmp.workerDepartmentByDate ENGINE = MEMORY - SELECT w.userFk, - w.lastName name, - w.firstName firstname, - d.name department, + SELECT w.userFk, + w.lastName name, + w.firstName firstname, + d.name department, d.id departmentFk, - b.started, - d.isProduction, + b.started, + d.isProduction, CAST(12 * b.amount / clt.hours_week / 52 AS DECIMAL(10,2)) costeHora, w.fi nif FROM business b JOIN postgresql.calendar_labour_type clt ON clt.calendar_labour_type_id = b.calendarTypeFk JOIN department d ON d.id = b.departmentFk JOIN worker w ON w.id = b.workerFk - WHERE b.started <= vDate + WHERE b.started <= vDate AND (b.ended > vDate OR b.ended IS NULL); END ;; DELIMITER ; @@ -72364,8 +73474,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `workerDisable` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -72373,6 +73481,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb3 */ ; /*!50003 SET character_set_results = utf8mb3 */ ; /*!50003 SET collation_connection = utf8mb3_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `workerDisable`(vUserId int) mainLabel:BEGIN @@ -72383,18 +73493,18 @@ mainLabel:BEGIN DELETE FROM account.account WHERE id = vUserId; - UPDATE account.user + UPDATE account.user SET role = 2 - WHERE id = vUserId; + WHERE id = vUserId; - DELETE FROM pbx.sip - WHERE user_id = vUserId; + DELETE FROM pbx.sip + WHERE user_id = vUserId; UPDATE `client` c JOIN payMethod p ON p.name = 'CONTADO' SET c.credit = 0, c.payMethodFk = p.id, hasCoreVnl = FALSE WHERE c.id = vUserId; - + UPDATE `client` c SET c.salesPersonFk = null WHERE c.salesPersonFk = vUserId; @@ -72404,8 +73514,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `workerDisableAll` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -72413,6 +73521,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `workerDisableAll`() BEGIN @@ -72423,12 +73533,12 @@ BEGIN SELECT b.workerFk FROM business b JOIN vn.worker w ON w.id = b.workerFk - JOIN account.account a ON a.id = b.workerFk - LEFT JOIN (SELECT b.workerFk + JOIN account.account a ON a.id = b.workerFk + LEFT JOIN (SELECT b.workerFk FROM business b WHERE (ended IS NULL OR ended >=util.VN_CURDATE()) )sub ON sub.workerFk = a.id - LEFT JOIN vn.workerDisableExcluded wd ON wd.workerFk = b.workerFk + LEFT JOIN vn.workerDisableExcluded wd ON wd.workerFk = b.workerFk WHERE sub.workerFk IS NULL AND wd.workerFk IS NULL GROUP BY w.id; @@ -72446,15 +73556,13 @@ BEGIN END WHILE; CLOSE rs; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `workerForAllCalculateBoss` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -72462,6 +73570,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `workerForAllCalculateBoss`() BEGIN @@ -72499,8 +73609,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `workerJourney_replace` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -72508,21 +73616,23 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `workerJourney_replace`( - vDatedFrom DATE, - vDatedTo DATE, + vDatedFrom DATE, + vDatedTo DATE, vWorkerFk INT) BEGIN /** - * Actualiza la tabla workerJourney para que actue como caché permanente revisable + * Actualiza la tabla workerJourney para que actue como caché permanente revisable * de las jornadas laborales. * @param vDatedFrom workerTimeControl * @param vDatedTo workerTimeControl * @param vWorkerFk, en caso de pasar 0 ó NULL se aplica a todos - */ + */ DECLARE vDatedTimeTo DATETIME; - DECLARE vMaxTimePerDay INT; + DECLARE vMaxTimePerDay INT; DECLARE vMinHoursToBreak DECIMAL(10,2); DECLARE vBreakHours DECIMAL(10,2); DECLARE vMonthByYear INT; @@ -72530,57 +73640,57 @@ BEGIN DECLARE vMonthsByYear INT DEFAULT 12; DECLARE vDaysByWeek INT DEFAULT 5; DECLARE vDatedFromYesterday DATETIME; - DECLARE vDatedToTomorrow DATETIME; - - SELECT DATE_SUB(vDatedFrom, INTERVAL 1 DAY), DATE_ADD(vDatedTo, INTERVAL 1 DAY) + DECLARE vDatedToTomorrow DATETIME; + + SELECT DATE_SUB(vDatedFrom, INTERVAL 1 DAY), DATE_ADD(vDatedTo, INTERVAL 1 DAY) INTO vDatedFromYesterday, vDatedToTomorrow; SET vDatedTimeTo = util.dayEnd(vDatedTo); - - SELECT minHoursToBreak, breakHours, maxTimePerDay + + SELECT minHoursToBreak, breakHours, maxTimePerDay INTO vMinHoursToBreak, vBreakHours, vMaxTimePerDay FROM workerTimeControlConfig; DELETE FROM workerJourney - WHERE dated BETWEEN vDatedFrom AND vDatedTo + WHERE dated BETWEEN vDatedFrom AND vDatedTo AND NOT isPaid AND NOT isUpdated - AND (vWorkerFk IS NULL OR userFK = vWorkerFk); + AND (vWorkerFk IS NULL OR userFK = vWorkerFk); - -- Se inserta todos los días del periodo por worker y business en el rango de fechas. + -- Se inserta todos los días del periodo por worker y business en el rango de fechas. INSERT IGNORE INTO workerJourney(userFk, dated, businessFk) SELECT b.workerFk, t.dated, b.id - FROM business b + FROM business b JOIN time t ON t.dated BETWEEN b.started AND IFNULL(b.ended,util.VN_CURDATE()) WHERE t.dated BETWEEN vDatedFrom AND vDatedTo AND (vWorkerFk IS NULL OR b.workerFk = vWorkerFk) ORDER BY b.workerFk, t.dated, b.id; - + DROP TEMPORARY TABLE IF EXISTS tmp.`user`; IF vWorkerFk THEN CALL timeControl_calculateByUser(vWorkerFk, vDatedFrom , vDatedTimeTo); - CREATE TEMPORARY TABLE IF NOT EXISTS tmp.`user` - SELECT vWorkerFk userFk; + CREATE TEMPORARY TABLE IF NOT EXISTS tmp.`user` + SELECT vWorkerFk userFk; ELSE CALL timeControl_calculateAll(vDatedFrom, vDatedTimeTo); - CREATE TEMPORARY TABLE IF NOT EXISTS tmp.`user` + CREATE TEMPORARY TABLE IF NOT EXISTS tmp.`user` SELECT id userFk FROM worker w; - END IF; + END IF; UPDATE workerJourney wj JOIN tmp.timeControlCalculate t ON wj.dated = t.dated AND wj.userFk = t.userFk - SET wj.total = CAST(IF(t.timeWorkDecimal >= vMinHoursToBreak, - t.timeWorkDecimal - vBreakHours, + SET wj.total = CAST(IF(t.timeWorkDecimal >= vMinHoursToBreak, + t.timeWorkDecimal - vBreakHours, t.timeWorkDecimal) AS DECIMAL (10,2)), wj.lunch = IF(t.timeWorkDecimal >= vMinHoursToBreak , vBreakHours , 0) WHERE wj.dated BETWEEN vDatedFrom AND vDatedTo AND NOT wj.isPaid AND NOT wj.isUpdated AND (vWorkerFk IS NULL OR wj.userFk = vWorkerFk); - - -- NOCTURNIDAD + + -- NOCTURNIDAD CALL timeControl_getError(vDatedFrom, vDatedTimeTo); SET @vIsOdd := TRUE; @@ -72590,9 +73700,9 @@ BEGIN CREATE TEMPORARY TABLE tmp.workerTimeControl (INDEX (userFk), INDEX (timed)) ENGINE = MEMORY - SELECT DISTINCT(wtc.id), - wtc.userFk, - wtc.timed, + SELECT DISTINCT(wtc.id), + wtc.userFk, + wtc.timed, wtc.direction FROM workerTimeControl wtc JOIN tmp.`user` w ON w.userFk = wtc.userFk @@ -72602,10 +73712,10 @@ BEGIN AND (vWorkerFk IS NULL OR wtc.userFk = vWorkerFk) ORDER BY wtc.userFk, wtc.timed ASC; - SELECT MAX(id) INTO @vCont + SELECT MAX(id) INTO @vCont FROM tmp.workerTimeControl; - DROP TEMPORARY TABLE IF EXISTS tmp.workerTimeControlAux; + DROP TEMPORARY TABLE IF EXISTS tmp.workerTimeControlAux; CREATE TEMPORARY TABLE tmp.workerTimeControlAux ( `id` int(11) , `userFk` int(10) unsigned , @@ -72627,9 +73737,9 @@ BEGIN DATE(@lastTimed) dated, @lastUserFk lastUserFk, IF(direction ='middle', @vIsOdd := NOT @vIsOdd, FALSE) isOdd, - IF(@vIsOdd - AND @lastDirection = 'middle' - AND (DATE(@lastTimed) <> date(timed) + IF(@vIsOdd + AND @lastDirection = 'middle' + AND (DATE(@lastTimed) <> date(timed) OR @lastUserFk <> userFk), TRUE, FALSE) hasBreak, @lastTimed := wtc.timed, @lastUserFk := userFk, @@ -72643,16 +73753,16 @@ BEGIN SET @lastDirection := NULL; INSERT INTO tmp.workerTimeControlAux (id, userFk, timed, direction) - SELECT @vCont:= @vCont + 1, - lastUserFk, - DATE_ADD(sub.dated, INTERVAL 1 DAY), + SELECT @vCont:= @vCont + 1, + lastUserFk, + DATE_ADD(sub.dated, INTERVAL 1 DAY), 'middle' FROM (SELECT IF(@lastUserFk <> userFk, @vIsOdd := TRUE, NULL), DATE(@lastTimed) dated, @lastUserFk lastUserFk, IF(direction ='middle', @vIsOdd := NOT @vIsOdd, FALSE) isOdd, - IF(@vIsOdd - AND @lastDirection = 'middle' + IF(@vIsOdd + AND @lastDirection = 'middle' AND (DATE(@lastTimed)<>date(timed) OR @lastUserFk<>userFk), TRUE, FALSE) hasBreak, @lastTimed := wtc.timed, @@ -72665,7 +73775,7 @@ BEGIN -- Cambio de dia INSERT INTO tmp.workerTimeControlAux (id, userFk, timed, direction) SELECT @vCont:= @vCont + 1, - wtc.userFk, + wtc.userFk, util.dayEnd(date(wtc.timed)), 'out' FROM workerTimeControl wtc @@ -72676,8 +73786,8 @@ BEGIN GROUP BY wtc.userFk, DATE(wtc.timed); INSERT INTO tmp.workerTimeControlAux (id, userFk, timed, direction) - SELECT @vCont:= @vCont + 1, - wtc.userFk, + SELECT @vCont:= @vCont + 1, + wtc.userFk, DATE_ADD(date(wtc.timed), INTERVAL 1 DAY), 'in' FROM workerTimeControl wtc @@ -72703,8 +73813,8 @@ BEGIN IF(@vIsOdd, @vLastTimed:=UNIX_TIMESTAMP(timed),@vLastTimed), IF(direction='in', @vDated := DATE(wtc.timed), @vDated ) dated, wtc.userFk, - IF(UNIX_TIMESTAMP(timed)- @vLastTimed < vMaxTimePerDay, - workerNigthlyHours_calculate(FROM_UNIXTIME(@vLastTimed), wtc.timed), + IF(UNIX_TIMESTAMP(timed)- @vLastTimed < vMaxTimePerDay, + workerNigthlyHours_calculate(FROM_UNIXTIME(@vLastTimed), wtc.timed), 0) NigthlyHours, @lastUserFk := userFk FROM (SELECT DISTINCT(wtc.id), wtc.userFk, wtc.timed, wtc.direction @@ -72717,7 +73827,7 @@ BEGIN ) wtc ORDER BY wtc.userFk, wtc.timed )sub - WHERE sub.dated BETWEEN vDatedFrom AND vDatedTo + WHERE sub.dated BETWEEN vDatedFrom AND vDatedTo GROUP BY userFk, sub.dated )night ON night.userFk = wj.userFk AND night.dated = wj.dated SET wj.nocturn = night.NigthlyHours @@ -72728,10 +73838,10 @@ BEGIN -- Horas téoricas y precio de la hora ordinaria UPDATE workerJourney wj JOIN business b ON b.id = wj.businessFk - JOIN postgresql.calendar_labour_type cl + JOIN postgresql.calendar_labour_type cl ON cl.calendar_labour_type_id = b.calendarTypeFk - SET wj.priceOrdinaryHour = - (vMonthsByYear * b.amount) / + SET wj.priceOrdinaryHour = + (vMonthsByYear * b.amount) / (vWeeksByYear * cl.hours_week), wj.contractJourney = cl.hours_week / vDaysByWeek WHERE wj.dated BETWEEN vDatedFrom AND vDatedTo @@ -72739,7 +73849,7 @@ BEGIN AND NOT wj.isPaid AND NOT isUpdated; - -- Precio Extras, Vacaciones y Nocturnas + -- Precio Extras, Vacaciones y Nocturnas UPDATE workerJourney wj JOIN(SELECT MAX(w.dated), t.dated, w.holidayInc, w.nightInc, w.extraInc FROM time t @@ -72758,18 +73868,18 @@ BEGIN -- Elimina el precio de las horas extras para los contratos parciales. UPDATE workerJourney wj JOIN business b ON b.id = wj.businessFk - JOIN postgresql.calendar_labour_type cl + JOIN postgresql.calendar_labour_type cl ON cl.calendar_labour_type_id = b.calendarTypeFk SET wj.priceExtraHour = 0 WHERE cl.isPartial AND wj.dated BETWEEN vDatedFrom AND vDatedTo AND (vWorkerFk IS NULL OR wj.userFk = vWorkerFk) - AND NOT wj.isPaid + AND NOT wj.isPaid AND NOT wj.isUpdated; -- Ausencias UPDATE workerJourney wj - JOIN businessCalendar bc ON bc.businessFk = wj.businessFk + JOIN businessCalendar bc ON bc.businessFk = wj.businessFk AND bc.dated = wj.dated JOIN absenceType ab ON ab.id = bc.absenceTypeFk SET wj.permission = ab.permissionRate * wj.contractJourney, @@ -72784,7 +73894,7 @@ BEGIN UPDATE workerJourney SET holiday = IF(DAYNAME(dated)='sábado', 0, total), contractJourney = 0 - WHERE DAYNAME(dated) IN ('sábado', 'domingo') + WHERE DAYNAME(dated) IN ('sábado', 'domingo') AND dated BETWEEN vDatedFrom AND vDatedTo AND (vWorkerFk IS NULL OR userFk = vWorkerFk) AND NOT isPaid @@ -72793,8 +73903,8 @@ BEGIN -- Festivos por centro de trabajo UPDATE workerJourney wj JOIN calendarHolidays ch ON ch.dated = wj.dated - JOIN business b ON b.id = wj.businessFk - AND b.workcenterFk = ch.workcenterFk + JOIN business b ON b.id = wj.businessFk + AND b.workcenterFk = ch.workcenterFk SET wj.holiday = wj.total, wj.permission = wj.contractJourney, wj.contractJourney = 0 @@ -72804,7 +73914,7 @@ BEGIN AND NOT wj.isUpdated; -- Horas extras - UPDATE workerJourney + UPDATE workerJourney SET extra = lunch + total - contractJourney WHERE dated BETWEEN vDatedFrom AND vDatedTo AND (vWorkerFk IS NULL OR userFk = vWorkerFk) @@ -72822,8 +73932,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `workerMistakeType_get` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -72831,26 +73939,26 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `workerMistakeType_get`() BEGIN - + /** * Obtiene los tipos de error para los trabajadores */ - - SELECT code, description - FROM workerMistakeType + + SELECT code, description + FROM workerMistakeType ORDER BY description; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `workerMistake_add` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -72858,28 +73966,20 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; -CREATE DEFINER=`root`@`localhost` PROCEDURE `workerMistake_add`(vWorkerFk INT, vWorkerMistakeTypeFk VARCHAR(10), vUserFk INT ) +CREATE DEFINER=`root`@`localhost` PROCEDURE `workerMistake_add`(vWorkerFk INT, vWorkerMistakeTypeFk VARCHAR(10)) BEGIN - /** * Añade error al trabajador * * @param vWorkerFk id del trabajador al cual se le va a añadir error * @param vWorkerMistakeTypeFk code del tipo de error - * @param vUserFk id del usuario que pone el error * */ - DECLARE vWorkerName VARCHAR(255) DEFAULT account.user_getNameFromId(vUserFk); - - IF(account.user_hasRole(vWorkerName,'coolerBoss')) - THEN - INSERT INTO vn.workerMistake(userFk, workerMistakeTypeFk) - VALUES(vWorkerFk, vWorkerMistakeTypeFk); - ELSE - CALL util.throw('No tienes permisos para realizar la acción'); - - END IF; + INSERT INTO vn.workerMistake(userFk, workerMistakeTypeFk) + VALUES(vWorkerFk, vWorkerMistakeTypeFk); END ;; DELIMITER ; @@ -72887,8 +73987,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `workerShelving_Add` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -72896,6 +73994,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `workerShelving_Add`(vWorkerFk INT, vBarcode VARCHAR(12)) BEGIN @@ -72907,7 +74007,7 @@ BEGIN DECLARE vIsShelvingFk BOOL; SELECT COUNT(*) > 0 INTO vIsShelvingFk - FROM vn.shelving s + FROM vn.shelving s WHERE s.code = vBarcode COLLATE utf8_general_ci; IF NOT vIsShelvingFk THEN @@ -72915,7 +74015,7 @@ BEGIN SELECT st.shelvingFk INTO vBarcode FROM vn.smartTag st WHERE st.code = vBarcode COLLATE utf8_general_ci; - + END IF; INSERT INTO vn.workerShelving (workerFk, shelvingFk) @@ -72926,8 +74026,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `workerShelving_delete` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -72935,6 +74033,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `workerShelving_delete`(vWorkerFk INT, vBarcode VARCHAR(12)) BEGIN @@ -72947,20 +74047,20 @@ BEGIN SELECT COUNT(*) > 0 INTO vIsShelvingFk - FROM vn.shelving s + FROM vn.shelving s WHERE s.code = vBarcode COLLATE utf8_general_ci; - + IF NOT vIsShelvingFk THEN SELECT st.shelvingFk INTO vBarcode FROM vn.smartTag st WHERE st.code = vBarcode COLLATE utf8_general_ci; - + END IF; - - DELETE FROM vn.workerShelving - WHERE shelvingFk = vBarcode COLLATE utf8_general_ci + + DELETE FROM vn.workerShelving + WHERE shelvingFk = vBarcode COLLATE utf8_general_ci AND workerFk = vWorkerFk ; END ;; @@ -72969,8 +74069,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `workerTimeControlAdd` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -72978,17 +74076,19 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `workerTimeControlAdd`(IN vUserFk INT, IN vWarehouseFk INT, IN vDated DATETIME) BEGIN /*INSERT INTO workerTimeControl(userFk, timed, manual, warehouseFk) VALUES(vUserFk, vDated, FALSE, vWarehouseFk); - + CALL vn.workerTimeControlSOWP(vUserFk , vDated);*/ - + CALL vn.workerTimeControl_add(vUserFk,vWarehouseFk,util.VN_NOW(),FALSE); - + END ;; DELIMITER ; @@ -72996,8 +74096,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `workerTimeControlPinGenerate` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -73005,6 +74103,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `workerTimeControlPinGenerate`( vWorkerFk INT) @@ -73014,16 +74114,14 @@ BEGIN * */ - - + + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `workerTimeControlSetOrder` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -73031,6 +74129,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `workerTimeControlSetOrder`() BEGIN @@ -73051,8 +74151,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `workerTimeControlSetOrder_by_User_and_dateRange` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -73060,6 +74158,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `workerTimeControlSetOrder_by_User_and_dateRange`(vUserFk INT, vStarted DATE, vFinished DATE) BEGIN @@ -73079,8 +74179,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `workerTimeControlSOWP` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -73088,25 +74186,25 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `workerTimeControlSOWP`(IN vUserFk INT, IN vDated DATE) BEGIN SET @order := 0; - - UPDATE workerTimeControl - SET `order` = @order := @order + 1 - WHERE vUserFk =userFk + + UPDATE workerTimeControl + SET `order` = @order := @order + 1 + WHERE vUserFk =userFk AND vDated = DATE(timed) ORDER BY timed; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `workerTimeControl_add` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -73114,11 +74212,13 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `workerTimeControl_add`(IN vUserFk INT, IN vWarehouseFk INT, IN vTimed DATETIME, IN vIsManual BOOL) BEGIN - - + + SELECT workerTimeControl_add(vUserFk,vWarehouseFk,vTimed,vIsManual); END ;; DELIMITER ; @@ -73126,8 +74226,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `workerTimeControl_calculateOddDays` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -73135,6 +74233,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `workerTimeControl_calculateOddDays`() BEGIN @@ -73174,8 +74274,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `workerTimeControl_check` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -73183,6 +74281,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `workerTimeControl_check`(vUserFk INT, vDated DATE,vTabletFk VARCHAR(100)) proc: BEGIN @@ -73207,73 +74307,73 @@ proc: BEGIN DECLARE vTo VARCHAR(50) DEFAULT NULL; DECLARE vUserName VARCHAR(50) DEFAULT NULL; DECLARE vBody VARCHAR(255) DEFAULT NULL; - - SELECT dayBreak, weekBreak, weekScope, dayWorkMax, dayStayMax + + SELECT dayBreak, weekBreak, weekScope, dayWorkMax, dayStayMax INTO vDayBreak, vWeekBreak, vWeekScope, vDayWorkMax, vDayStayMax FROM workerTimeControlParams; SELECT MAX(timed) INTO vLastIn - FROM workerTimeControl - WHERE userFk = vUserFk + FROM workerTimeControl + WHERE userFk = vUserFk AND direction = 'in'; - + SELECT MAX(timed) INTO vLastOut - FROM workerTimeControl - WHERE userFk = vUserFk - AND direction = 'out'; + FROM workerTimeControl + WHERE userFk = vUserFk + AND direction = 'out'; SELECT CONCAT(u.name,'@verdnatura.es') INTO vTo FROM account.user u - WHERE u.id = (SELECT bossFk FROM worker WHERE id = vUserFk); - + WHERE u.id = (SELECT bossFk FROM worker WHERE id = vUserFk); + SELECT CONCAT(firstName,' ',lastName) INTO vUserName FROM worker w WHERE w.id = vUserFk; IF UNIX_TIMESTAMP(util.VN_NOW()) - UNIX_TIMESTAMP(vLastIn) > vDayStayMax THEN -- NUEVA JORNADA - - -- VERIFICAR DESCANSO DIARIO - IF UNIX_TIMESTAMP(util.VN_NOW()) - UNIX_TIMESTAMP(vLastOut) < vDayBreak THEN + + -- VERIFICAR DESCANSO DIARIO + IF UNIX_TIMESTAMP(util.VN_NOW()) - UNIX_TIMESTAMP(vLastOut) < vDayBreak THEN SELECT "Descansos 12 h" AS problem; -- ENVIAMOS CORREO AL BOSSFK SELECT CONCAT(vUserName,' No ha podido fichar por el siguiente problema: ',"Descansos 12 h") INTO vBody; CALL mail_insert(vTo,vTo,'error al fichar',vBody); LEAVE proc; - END IF; - + END IF; + -- VERIFICAR FICHADAS IMPARES DEL ÚLTIMO DÍA QUE SE FICHÓ - IF (SELECT MOD(COUNT(*),2) -- <>0 - FROM workerTimeControl + IF (SELECT MOD(COUNT(*),2) -- <>0 + FROM workerTimeControl WHERE userFk = vUserFk AND timed >= vLastIn - ) THEN + ) THEN SELECT "Dias con fichadas impares" AS problem; -- ENVIAMOS CORREO AL BOSSFK SELECT CONCAT(vUserName,' No ha podido fichar por el siguiente problema: ',"Dias con fichadas impares") INTO vBody; CALL mail_insert(vTo,vTo,'error al fichar',vBody); - LEAVE proc; + LEAVE proc; END IF; - + -- VERIFICAR VACACIONES SELECT at2.name INTO vCalendarStateType - FROM calendar c + FROM calendar c JOIN business b ON b.id = c.businessFk JOIN absenceType at2 ON at2.id = c.dayOffTypeFk WHERE c.dated = util.VN_CURDATE() AND at2.isAllowedToWork = FALSE AND b.workerFk = vUserFk LIMIT 1; - + IF(LENGTH(vCalendarStateType)) THEN SELECT vCalendarStateType AS problem; -- ENVIAMOS CORREO AL BOSSFK SELECT CONCAT(vUserName,' No ha podido fichar por el siguiente problema: ',"Vacaciones") INTO vBody; CALL mail_insert(vTo,vTo,'error al fichar',vBody); - LEAVE proc; - + LEAVE proc; + END IF; - + -- VERIFICAR CONTRATO EN VIGOR IF (SELECT COUNT(*) FROM business b @@ -73285,44 +74385,44 @@ proc: BEGIN -- ENVIAMOS CORREO AL BOSSFK SELECT CONCAT(vUserName,' No ha podido fichar por el siguiente problema: ',"No hay un contrato en vigor") INTO vBody; CALL mail_insert(vTo,vTo,'error al fichar',vBody); - LEAVE proc; - + LEAVE proc; + END IF; -- VERIFICAR DESCANSO SEMANAL SET @vHasBreakWeek:= FALSE; - SET @vLastTimed:= UNIX_TIMESTAMP((util.VN_NOW() - INTERVAL vWeekScope SECOND)); - + SET @vLastTimed:= UNIX_TIMESTAMP((util.VN_NOW() - INTERVAL vWeekScope SECOND)); + DROP TEMPORARY TABLE IF EXISTS tmp.trash; CREATE TEMPORARY TABLE tmp.trash SELECT IF(vWeekBreak-(UNIX_TIMESTAMP(timed)-@vLastTimed) <= 0, @vHasBreakWeek:=TRUE, TRUE) alias, @vLastTimed:= UNIX_TIMESTAMP(timed) - FROM workerTimeControl + FROM workerTimeControl WHERE timed>= (util.VN_NOW() - INTERVAL vWeekScope SECOND) AND userFk= vUserFk AND direction IN ('in','out') - ORDER BY timed ASC; - - IF UNIX_TIMESTAMP(util.VN_NOW()) - UNIX_TIMESTAMP(vLastOut) < vWeekBreak AND @vHasBreakWeek = FALSE THEN -- REVISA SI EL DESCANSO SE HA REALIZADO DESPUÉS DE LA ÚLTIMA FICHADA + ORDER BY timed ASC; + + IF UNIX_TIMESTAMP(util.VN_NOW()) - UNIX_TIMESTAMP(vLastOut) < vWeekBreak AND @vHasBreakWeek = FALSE THEN -- REVISA SI EL DESCANSO SE HA REALIZADO DESPUÉS DE LA ÚLTIMA FICHADA SELECT "Descansos 36 h" AS problem; -- ENVIAMOS CORREO AL BOSSFK SELECT CONCAT(vUserName,' No ha podido fichar por el siguiente problema: ',"Descansos 36 h") INTO vBody; CALL mail_insert(vTo,vTo,'error al fichar',vBody); LEAVE proc; END IF; + + DROP TEMPORARY TABLE tmp.trash; - DROP TEMPORARY TABLE tmp.trash; - - ELSE -- DIA ACTUAL - + ELSE -- DIA ACTUAL + -- VERIFICA QUE EL TIEMPO EFECTIVO NO SUPERE EL MÁXIMO - SELECT IFNULL(SUM(if( mod(wtc.order,2)=1, -UNIX_TIMESTAMP(timed), UNIX_TIMESTAMP(timed))),0) - IF( MOD(COUNT(*),2), UNIX_TIMESTAMP(util.VN_NOW()), 0) INTO vTimedWorked + SELECT IFNULL(SUM(if( mod(wtc.order,2)=1, -UNIX_TIMESTAMP(timed), UNIX_TIMESTAMP(timed))),0) - IF( MOD(COUNT(*),2), UNIX_TIMESTAMP(util.VN_NOW()), 0) INTO vTimedWorked FROM workerTimeControl wtc - WHERE userFk = vUserFk + WHERE userFk = vUserFk AND timed >= vLastIn ORDER BY timed; - IF vTimedWorked > vDayWorkMax THEN + IF vTimedWorked > vDayWorkMax THEN SELECT "Jornadas" AS problem; -- ENVIAMOS CORREO AL BOSSFK SELECT CONCAT(vUserName,' No ha podido fichar por el siguiente problema: ',"Jornadas") INTO vBody; @@ -73345,18 +74445,16 @@ proc: BEGIN -- ENVIAMOS CORREO AL BOSSFK SELECT CONCAT(vUserName,' No a podido fichar por el siguiente problema: ',"No perteneces a este departamento.") INTO vBody; CALL mail_insert(vTo,vTo,'error al fichar',vBody); - LEAVE proc; + LEAVE proc; END IF; END IF;*/ - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `workerTimeControl_checkBreak` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -73364,11 +74462,13 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `workerTimeControl_checkBreak`(vStarted DATE) BEGIN /** - * Retorna los trabajadores que no han respetado el descanso semanal de 36/72 horas + * Retorna los trabajadores que no han respetado el descanso semanal de 36/72 horas * El sistema verificará el descanso corto en la siguiente semana * o el largo en las 2 siguientes semanas a partir de la fecha dada * @param vStarted día inicio de la semana en el que se quiere verificar @@ -73379,27 +74479,27 @@ BEGIN DECLARE vShortWeekBreak INT; DECLARE vLongWeekBreak INT; - SELECT util.dayEnd(DATE_ADD(vStarted, INTERVAL shortWeekDays DAY)), + SELECT util.dayEnd(DATE_ADD(vStarted, INTERVAL shortWeekDays DAY)), util.dayEnd(DATE_ADD(vStarted, INTERVAL longWeekDays DAY)), - shortWeekBreak, + shortWeekBreak, longWeekBreak INTO vShortEnded, vLongEnded, vShortWeekBreak, vLongWeekBreak FROM workerTimeControlConfig; - + SET @previousTimed:= UNIX_TIMESTAMP(vStarted); SET @lastUserFk := NULL; - + -- Descanso corto en la semana - + DROP TEMPORARY TABLE IF EXISTS tmp.worker; CREATE TEMPORARY TABLE tmp.worker (PRIMARY KEY(workerFk)) ENGINE = MEMORY SELECT DISTINCT userFk workerFk - FROM workerTimeControl + FROM workerTimeControl WHERE timed BETWEEN vStarted AND vShortEnded AND direction IN ('in', 'out'); - + DROP TEMPORARY TABLE IF EXISTS tmp.worker2; CREATE TEMPORARY TABLE tmp.worker2 (PRIMARY KEY(workerFk)) @@ -73412,28 +74512,28 @@ BEGIN SELECT sub2.userFk workerFk FROM(SELECT sub.userFk, IF(sub.userFk <> @lastUserFk, - @previousTimed:= sub.timed, + @previousTimed:= sub.timed, FALSE), - IF(sub.timed - @previousTimed >= vShortWeekBreak, - TRUE, + IF(sub.timed - @previousTimed >= vShortWeekBreak, + TRUE, FALSE) hasShortWeekBreak, @previousTimed:= sub.timed, @lastUserFk:= sub.userFk FROM ( SELECT userFk, UNIX_TIMESTAMP(timed) timed - FROM workerTimeControl + FROM workerTimeControl WHERE timed BETWEEN vStarted AND vShortEnded AND direction IN ('in', 'out') - UNION + UNION SELECT w.workerFk, UNIX_TIMESTAMP(IFNULL( - MIN(wtc.timed), + MIN(wtc.timed), DATE_ADD(vShortEnded, INTERVAL vShortWeekBreak SECOND))) FROM tmp.worker w - LEFT JOIN workerTimeControl wtc - ON wtc.userFk = w.workerFk - AND wtc.timed BETWEEN vShortEnded - AND DATE_ADD(vShortEnded, INTERVAL vShortWeekBreak SECOND) + LEFT JOIN workerTimeControl wtc + ON wtc.userFk = w.workerFk + AND wtc.timed BETWEEN vShortEnded + AND DATE_ADD(vShortEnded, INTERVAL vShortWeekBreak SECOND) GROUP BY w.workerFk UNION SELECT w.workerFk, @@ -73441,10 +74541,10 @@ BEGIN MAX(wtc.timed), DATE_SUB(vStarted, INTERVAL vShortWeekBreak SECOND))) FROM tmp.worker2 w - LEFT JOIN workerTimeControl wtc - ON wtc.userFk = w.workerFk - AND wtc.timed BETWEEN - DATE_SUB(vStarted, INTERVAL vShortWeekBreak SECOND) + LEFT JOIN workerTimeControl wtc + ON wtc.userFk = w.workerFk + AND wtc.timed BETWEEN + DATE_SUB(vStarted, INTERVAL vShortWeekBreak SECOND) AND vStarted GROUP BY w.workerFk ORDER BY userFk, timed @@ -73454,7 +74554,7 @@ BEGIN GROUP BY sub2.userFk HAVING NOT SUM(hasShortWeekBreak); - -- Descanso largo en las 2 siguientes semanas + -- Descanso largo en las 2 siguientes semanas DROP TEMPORARY TABLE tmp.worker; CREATE TEMPORARY TABLE tmp.worker (PRIMARY KEY(workerFk)) @@ -73474,12 +74574,12 @@ BEGIN (PRIMARY KEY(workerFk)) ENGINE = MEMORY SELECT sub2.userFk workerFk - FROM(SELECT userFk, + FROM(SELECT userFk, IF(userFk <> @lastUserFk, - @previousTimed:= timed, + @previousTimed:= timed, TRUE), - IF(timed - @previousTimed >= vLongWeekBreak, - TRUE, + IF(timed - @previousTimed >= vLongWeekBreak, + TRUE, FALSE) hasLongWeekBreak, @previousTimed:= timed, @lastUserFk:= userFk @@ -73488,24 +74588,24 @@ BEGIN JOIN tmp.workerWithoutShortWeekBreak wws ON wws.workerFk = wtc.userFk WHERE timed BETWEEN vStarted AND vLongEnded AND direction IN ('in', 'out') - UNION + UNION SELECT w.workerFk, - UNIX_TIMESTAMP(IFNULL(MIN(wtc.timed), + UNIX_TIMESTAMP(IFNULL(MIN(wtc.timed), DATE_ADD(vLongEnded, INTERVAL vLongWeekBreak SECOND))) FROM tmp.worker w - LEFT JOIN workerTimeControl wtc - ON wtc.userFk = w.workerFk - AND timed BETWEEN vLongEnded - AND DATE_ADD(vLongEnded, INTERVAL vLongWeekBreak SECOND) + LEFT JOIN workerTimeControl wtc + ON wtc.userFk = w.workerFk + AND timed BETWEEN vLongEnded + AND DATE_ADD(vLongEnded, INTERVAL vLongWeekBreak SECOND) GROUP BY w.workerFk UNION - SELECT w.workerFk, - UNIX_TIMESTAMP(IFNULL(MAX(wtc.timed), + SELECT w.workerFk, + UNIX_TIMESTAMP(IFNULL(MAX(wtc.timed), DATE_SUB(vStarted, INTERVAL vLongWeekBreak SECOND))) FROM tmp.worker2 w - LEFT JOIN workerTimeControl wtc - ON wtc.userFk = w.workerFk - AND timed BETWEEN DATE_SUB(vStarted, INTERVAL vLongWeekBreak SECOND) + LEFT JOIN workerTimeControl wtc + ON wtc.userFk = w.workerFk + AND timed BETWEEN DATE_SUB(vStarted, INTERVAL vLongWeekBreak SECOND) AND vStarted GROUP BY w.workerFk ORDER BY userFk, timed @@ -73522,8 +74622,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `workerTimeControl_clockIn` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -73531,21 +74629,23 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `workerTimeControl_clockIn`( - vWorker INT, - vTimed DATETIME, + vWorker INT, + vTimed DATETIME, vDirection VARCHAR(10)) BEGIN /** * Verifica si el empleado puede fichar * @param vWorker Identificador del trabajador * @param vTimed valor de la fichada, IF vTimed IS NULL vTimed = util.VN_NOW() - * @param vDirection solo se pueden pasa los valores del campo - * workerTimeControl.direction ENUM('in', 'out', 'middle') - * @return Si todo es correcto, retorna el número de id la tabla workerTimeControl. + * @param vDirection solo se pueden pasa los valores del campo + * workerTimeControl.direction ENUM('in', 'out', 'middle') + * @return Si todo es correcto, retorna el número de id la tabla workerTimeControl. * Si hay algún problema, devuelve el mesaje a que se debe mostrar al usuario - * Solo retorna el primer problema, en caso de no ocurrir ningún error se añadirá + * Solo retorna el primer problema, en caso de no ocurrir ningún error se añadirá * fichada a la tabla vn.workerTimeControl */ DECLARE vLastIn DATETIME; @@ -73576,35 +74676,35 @@ BEGIN SELECT UNIX_TIMESTAMP(vTimed) timed UNION SELECT UNIX_TIMESTAMP(timed) - FROM workerTimeControl - WHERE timed BETWEEN (vTimed - INTERVAL vGap SECOND) AND vTimed - AND userFk = vWorker + FROM workerTimeControl + WHERE timed BETWEEN (vTimed - INTERVAL vGap SECOND) AND vTimed + AND userFk = vWorker AND direction IN ('in', 'out') ORDER BY timed ASC; - + DECLARE vCursor2 CURSOR FOR SELECT UNIX_TIMESTAMP(vTimed) timed UNION SELECT UNIX_TIMESTAMP(timed) - FROM workerTimeControl - WHERE timed BETWEEN vTimed AND (vTimed + INTERVAL vGap SECOND) - AND userFk = vWorker + FROM workerTimeControl + WHERE timed BETWEEN vTimed AND (vTimed + INTERVAL vGap SECOND) + AND userFk = vWorker AND direction IN ('in', 'out') ORDER BY timed ASC; - + DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE; - DECLARE EXIT HANDLER FOR SQLSTATE '45000' + DECLARE EXIT HANDLER FOR SQLSTATE '45000' BEGIN - SELECT CONCAT(u.name, '@verdnatura.es'), - CONCAT(w.firstName, ' ', w.lastName) + SELECT CONCAT(u.name, '@verdnatura.es'), + CONCAT(w.firstName, ' ', w.lastName) INTO vMailTo, vUserName FROM account.user u - JOIN worker w ON w.bossFk = u.id + JOIN worker w ON w.bossFk = u.id WHERE w.id = vWorker; - CASE vErrorCode + CASE vErrorCode WHEN 'IS_NOT_ALLOWED_FUTURE' THEN SELECT 'No se permite fichar a futuro' INTO vErrorMessage; WHEN 'INACTIVE_BUSINESS' THEN @@ -73614,182 +74714,182 @@ BEGIN WHEN 'ODD_WORKERTIMECONTROL' THEN SELECT 'Fichadas impares' INTO vErrorMessage; WHEN 'BREAK_DAY' THEN - SELECT CONCAT('Descanso diario ', FORMAT(vDayBreak/3600, 0), 'h.') + SELECT CONCAT('Descanso diario ', FORMAT(vDayBreak/3600, 0), 'h.') INTO vErrorMessage; WHEN 'BREAK_WEEK' THEN - SELECT CONCAT('Descanso semanal ', + SELECT CONCAT('Descanso semanal ', FORMAT(vShortWeekBreak / 3600,0) ,'h. / ', FORMAT(vLongWeekBreak / 3600, 0) ,'h.') INTO vErrorMessage; WHEN 'WRONG_DIRECTION' THEN SELECT 'Dirección incorrecta' INTO vErrorMessage; - ELSE + ELSE SELECT 'Error sin definir'INTO vErrorMessage; END CASE; - + SELECT vErrorMessage `error`; - SELECT CONCAT(vUserName, - ' no ha podido fichar por el siguiente problema: ', - vErrorMessage) + SELECT CONCAT(vUserName, + ' no ha podido fichar por el siguiente problema: ', + vErrorMessage) INTO vErrorMessage; CALL mail_insert( vMailTo, vMailTo, 'Error al fichar', vErrorMessage); - + END; - IF (vTimed IS NULL) THEN + IF (vTimed IS NULL) THEN SET vTimed = util.VN_NOW(); SET vManual = FALSE; END IF; - + SET vDated = DATE(vTimed); - - SELECT IF(pc.category_name = 'Conductor +3500kg', - wc.dayBreakDriver, - wc.dayBreak), + + SELECT IF(pc.category_name = 'Conductor +3500kg', + wc.dayBreakDriver, + wc.dayBreak), wc.shortWeekBreak, wc.longWeekBreak, wc.weekScope - INTO vDayBreak, + INTO vDayBreak, vShortWeekBreak, vLongWeekBreak, vWeekScope FROM business b - JOIN postgresql.professional_category pc + JOIN postgresql.professional_category pc ON pc.professional_category_id = b.workerBusinessProfessionalCategoryFk JOIN workerTimeControlConfig wc ON TRUE - WHERE b.workerFk = vWorker - AND vDated BETWEEN b.started AND IFNULL(b.ended, vDated); + WHERE b.workerFk = vWorker + AND vDated BETWEEN b.started AND IFNULL(b.ended, vDated); SELECT timed INTO vLastIn - FROM workerTimeControl + FROM workerTimeControl WHERE userFk = vWorker - AND direction = 'in' + AND direction = 'in' AND timed < vTimed ORDER BY timed DESC - LIMIT 1; + LIMIT 1; SELECT timed INTO vLastOut - FROM workerTimeControl + FROM workerTimeControl WHERE userFk = vWorker - AND direction = 'out' + AND direction = 'out' AND timed < vTimed ORDER BY timed DESC LIMIT 1; SELECT timed INTO vNextIn - FROM workerTimeControl + FROM workerTimeControl WHERE userFk = vWorker - AND direction = 'in' + AND direction = 'in' AND timed > vTimed ORDER BY timed ASC LIMIT 1; SELECT direction INTO vNextDirection - FROM workerTimeControl + FROM workerTimeControl WHERE userFk = vWorker AND timed > vTimed ORDER BY timed ASC LIMIT 1; - + SELECT direction INTO vLastDirection - FROM workerTimeControl + FROM workerTimeControl WHERE userFk = vWorker AND timed < vTimed ORDER BY timed DESC - LIMIT 1; + LIMIT 1; -- FICHADAS A FUTURO - IF vTimed > DATE_ADD(util.VN_NOW(), INTERVAL 60 SECOND) THEN + IF vTimed > DATE_ADD(util.VN_NOW(), INTERVAL 60 SECOND) THEN SET vErrorCode = 'IS_NOT_ALLOWED_FUTURE'; - CALL util.throw(vErrorCode); + CALL util.throw(vErrorCode); END IF; - + -- CONTRATO EN VIGOR IF vDayBreak IS NULL THEN SET vErrorCode = 'INACTIVE_BUSINESS'; - CALL util.throw(vErrorCode); + CALL util.throw(vErrorCode); END IF; -- VERIFICAR SI ESTÁ PERMITIDO TRABAJAR CALL timeBusiness_calculateByWorker(vWorker, vDated, vDated); - SELECT isAllowedToWork INTO vIsAllowedToWork + SELECT isAllowedToWork INTO vIsAllowedToWork FROM tmp.timeBusinessCalculate; DROP TEMPORARY TABLE tmp.timeBusinessCalculate; - + IF NOT vIsAllowedToWork THEN - SET vErrorCode = 'IS_NOT_ALLOWED_WORK'; + SET vErrorCode = 'IS_NOT_ALLOWED_WORK'; CALL util.throw(vErrorCode); END IF; - - -- DIRECCION CORRECTA + + -- DIRECCION CORRECTA CALL workerTimeControl_direction(vWorker, vTimed); - IF (SELECT + IF (SELECT IF(IF(option1 IN ('inMiddle', 'outMiddle'), - 'middle', + 'middle', option1) <> vDirection AND IF(option2 IN ('inMiddle', 'outMiddle'), - 'middle', - IFNULL(option2, '')) <> vDirection, - TRUE , - FALSE) + 'middle', + IFNULL(option2, '')) <> vDirection, + TRUE , + FALSE) FROM tmp.workerTimeControlDirection - ) THEN + ) THEN SET vIsError = TRUE; END IF; - + DROP TEMPORARY TABLE tmp.workerTimeControlDirection; IF vIsError = TRUE THEN - SET vErrorCode = 'WRONG_DIRECTION'; - CALL util.throw(vErrorCode); - END IF; - + SET vErrorCode = 'WRONG_DIRECTION'; + CALL util.throw(vErrorCode); + END IF; + -- FICHADAS IMPARES - IF (SELECT IF(vDirection = 'in', - MOD(COUNT(*), 2) , - IF (vDirection = 'out', NOT MOD(COUNT(*), 2), FALSE)) - FROM workerTimeControl + IF (SELECT IF(vDirection = 'in', + MOD(COUNT(*), 2) , + IF (vDirection = 'out', NOT MOD(COUNT(*), 2), FALSE)) + FROM workerTimeControl WHERE userFk = vWorker AND timed BETWEEN vLastIn AND vTimed - ) THEN - SET vErrorCode = 'ODD_WORKERTIMECONTROL'; - CALL util.throw(vErrorCode); + ) THEN + SET vErrorCode = 'ODD_WORKERTIMECONTROL'; + CALL util.throw(vErrorCode); END IF; - -- DESCANSO DIARIO + -- DESCANSO DIARIO CASE vDirection WHEN 'in' THEN - IF UNIX_TIMESTAMP(vTimed) - UNIX_TIMESTAMP(vLastOut) <= vDayBreak THEN + IF UNIX_TIMESTAMP(vTimed) - UNIX_TIMESTAMP(vLastOut) <= vDayBreak THEN SET vIsError = TRUE; END IF; WHEN 'out' THEN - IF UNIX_TIMESTAMP(vNextIn) - UNIX_TIMESTAMP(vTimed) <= vDayBreak THEN + IF UNIX_TIMESTAMP(vNextIn) - UNIX_TIMESTAMP(vTimed) <= vDayBreak THEN SET vIsError = TRUE; END IF; ELSE BEGIN END; END CASE; - + IF vIsError THEN - SET vErrorCode = 'BREAK_DAY'; - CALL util.throw(vErrorCode); + SET vErrorCode = 'BREAK_DAY'; + CALL util.throw(vErrorCode); END IF; -- VERIFICAR DESCANSO SEMANAL - IF (vDirection IN('in', 'out')) THEN - -- VERIFICA DESCANSO CORTO EN LA ÚLTIMA SEMANA + IF (vDirection IN('in', 'out')) THEN + -- VERIFICA DESCANSO CORTO EN LA ÚLTIMA SEMANA SET vGap = vWeekScope; SET vTimedLoopPrevious = UNIX_TIMESTAMP((vTimed - INTERVAL vGap SECOND)); SET vDone = FALSE; OPEN vCursor; l:LOOP FETCH vCursor INTO vTimedLoop; - IF vDone THEN + IF vDone THEN LEAVE l; END IF; - IF vShortWeekBreak - (vTimedLoop - vTimedLoopPrevious) <= 0 THEN + IF vShortWeekBreak - (vTimedLoop - vTimedLoopPrevious) <= 0 THEN SET vHasBreakWeek = TRUE; LEAVE l; END IF; SET vTimedLoopPrevious = vTimedLoop; - END LOOP l; + END LOOP l; CLOSE vCursor; -- VERIFICA DESCANSO LARGO EN LA ÚLTIMAS 2 SEMANAS IF NOT vHasBreakWeek THEN @@ -73799,27 +74899,27 @@ BEGIN OPEN vCursor; l:LOOP FETCH vCursor INTO vTimedLoop; - IF vDone THEN + IF vDone THEN LEAVE l; END IF; IF vLongWeekBreak - (vTimedLoop - vTimedLoopPrevious) <= 0 THEN - SET vHasBreakWeek = TRUE; + SET vHasBreakWeek = TRUE; LEAVE l; END IF; SET vTimedLoopPrevious = vTimedLoop; - END LOOP l; + END LOOP l; CLOSE vCursor; END IF; IF vManual THEN - -- VERIFICA DESCANSO CORTO EN LA PRÓXIMA SEMANA + -- VERIFICA DESCANSO CORTO EN LA PRÓXIMA SEMANA SET vGap = vWeekScope; SET vTimedLoopPrevious = vTimed; SET vDone = FALSE; OPEN vCursor2; l:LOOP FETCH vCursor2 INTO vTimedLoop; - IF vDone THEN + IF vDone THEN LEAVE l; END IF; IF vShortWeekBreak - (vTimedLoop - vTimedLoopPrevious) <= 0 THEN @@ -73827,7 +74927,7 @@ BEGIN LEAVE l; END IF; SET vTimedLoopPrevious = vTimedLoop; - END LOOP l; + END LOOP l; CLOSE vCursor2; -- VERIFICA DESCANSO LARGO EN LAS PRÓXIMAS 2 SEMANAS IF NOT vHasBreakWeek THEN @@ -73837,7 +74937,7 @@ BEGIN OPEN vCursor2; l:LOOP FETCH vCursor2 INTO vTimedLoop; - IF vDone THEN + IF vDone THEN LEAVE l; END IF; IF vShortWeekBreak - (vTimedLoop - vTimedLoopPrevious) <= 0 THEN @@ -73845,20 +74945,20 @@ BEGIN LEAVE l; END IF; SET vTimedLoopPrevious = vTimedLoop; - END LOOP l; + END LOOP l; CLOSE vCursor2; END IF; END IF; IF NOT vHasBreakWeek THEN - SET vErrorCode = 'BREAK_WEEK'; - CALL util.throw(vErrorCode); - END IF; + SET vErrorCode = 'BREAK_WEEK'; + CALL util.throw(vErrorCode); + END IF; END IF; -- SE PERMITE FICHAR INSERT INTO workerTimeControl(userFk, timed, direction, manual) VALUES(vWorker, vTimed, vDirection, vManual); - + SELECT LAST_INSERT_ID() id; END ;; DELIMITER ; @@ -73866,8 +74966,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `workerTimeControl_direction` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -73875,6 +74973,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `workerTimeControl_direction`(vWorkerFk VARCHAR(10), vTimed DATETIME) BEGIN @@ -73882,27 +74982,27 @@ BEGIN * Devuelve que direcciones de fichadas son lógicas a partir de la anterior fichada * @param vWorkerFk Identificador del trabajador * @return (option1, option2) - * Los valores posibles de retorno son ('in', 'inMiddle', 'outMiddle', 'out') + * Los valores posibles de retorno son ('in', 'inMiddle', 'outMiddle', 'out') */ DECLARE vLastIn DATETIME ; DECLARE vIsMiddleOdd BOOLEAN ; - IF (vTimed IS NULL) THEN + IF (vTimed IS NULL) THEN SET vTimed = util.VN_NOW(); END IF; - + SELECT timed INTO vLastIn - FROM workerTimeControl + FROM workerTimeControl WHERE userFk = vWorkerFk - AND direction = 'in' + AND direction = 'in' AND timed < vTimed ORDER BY timed DESC LIMIT 1; - + SELECT (COUNT(*)mod 2 = 1) INTO vIsMiddleOdd - FROM workerTimeControl + FROM workerTimeControl WHERE userFk = vWorkerFk - AND direction = 'middle' + AND direction = 'middle' AND timed BETWEEN vLastIn AND util.VN_NOW(); DROP TEMPORARY TABLE IF EXISTS tmp.workerTimeControlDirection; @@ -73940,8 +75040,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `workerTimeControl_getClockIn` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -73949,9 +75047,11 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `workerTimeControl_getClockIn`( - vUserFk INT, + vUserFk INT, vDated DATE) BEGIN /** @@ -73961,9 +75061,9 @@ BEGIN * @param vDated Fecha proporcionada */ CALL timeControl_calculateByWorker( - vUserFk, + vUserFk, DATE_SUB(vDated, INTERVAL 6 DAY), util.dayEnd(vDated)); - + SET @position := 0; SET @lastDated := NULL; @@ -73980,7 +75080,7 @@ BEGIN MAX(2daysAgoDirection) 2daysAgoDirection, MAX(1daysAgo) 1daysAgo, MAX(1daysAgoDirection) 1daysAgoDirection, - MAX(0daysAgo) 0daysAgo, + MAX(0daysAgo) 0daysAgo, MAX(0daysAgoDirection) 0daysAgoDirection FROM(SELECT IF(daysAgo = 6, timed, '') 6daysAgo, IF(daysAgo = 5, timed, '') 5daysAgo, @@ -74000,7 +75100,7 @@ BEGIN direction, position FROM(SELECT DATEDIFF(vDated, timed) daysAgo, - TIME_FORMAT(timed,'%H:%i') timed, + TIME_FORMAT(timed,'%H:%i') timed, IF(DATE(timed) <> @lastDated, @position := 0, NULL), @position := @position+1 position, @lastDated := DATE(timed), @@ -74012,18 +75112,18 @@ BEGIN LIMIT 10000000000000000000 )sub )sub2 - GROUP BY position) sub3 + GROUP BY position) sub3 JOIN (SELECT MAX(IF(daysAgo = 6, timeWorkSeconds, 0)) 6daysAgoTotal, MAX(IF(daysAgo = 5, timeWorkSeconds, 0)) 5daysAgoTotal, MAX(IF(daysAgo = 4, timeWorkSeconds, 0)) 4daysAgoTotal, MAX(IF(daysAgo = 3, timeWorkSeconds, 0)) 3daysAgoTotal, MAX(IF(daysAgo = 2, timeWorkSeconds, 0)) 2daysAgoTotal, MAX(IF(daysAgo = 1, timeWorkSeconds, 0)) 1daysAgoTotal, - MAX(IF(daysAgo = 0, timeWorkSeconds, 0)) 0daysAgoTotal + MAX(IF(daysAgo = 0, timeWorkSeconds, 0)) 0daysAgoTotal FROM (SELECT DATEDIFF(vDated, dated) daysAgo, timeWorkSeconds FROM tmp.timeControlCalculate) sub4)sub5 ON TRUE; - + DROP TEMPORARY TABLE tmp.timeControlCalculate; END ;; DELIMITER ; @@ -74031,8 +75131,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `workerTimeControl_login` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -74040,6 +75138,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `workerTimeControl_login`(vWorkerFk VARCHAR(10)) BEGIN @@ -74070,8 +75170,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `workerTimeControl_remove` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -74079,6 +75177,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `workerTimeControl_remove`(IN vUserFk INT, IN vTimed DATETIME) BEGIN @@ -74087,53 +75187,51 @@ BEGIN DECLARE vDirectionPrevious VARCHAR(6); DECLARE vTimedPrevious DATETIME; - SELECT direction INTO vDirectionRemove - FROM vn.workerTimeControl - WHERE userFk = vUserFk + SELECT direction INTO vDirectionRemove + FROM vn.workerTimeControl + WHERE userFk = vUserFk AND timed = vTimed ; IF vDirectionRemove = 'out' THEN - + SELECT timed, direction INTO vTimedPrevious, vDirectionPrevious - FROM vn.workerTimeControl - WHERE userFk = vUserFk + FROM vn.workerTimeControl + WHERE userFk = vUserFk AND timed < vTimed ORDER BY timed DESC - LIMIT 1; - + LIMIT 1; + IF vDirectionPrevious = "middle" THEN - UPDATE vn.workerTimeControl + UPDATE vn.workerTimeControl SET direction = "out" WHERE userFk = vUserFk AND timed = vTimedPrevious; END IF; - + ELSE IF vDirectionRemove = 'in' THEN - UPDATE vn.workerTimeControl + UPDATE vn.workerTimeControl SET direction = "in" WHERE userFk = vUserFk AND timed > vTimed ORDER BY timed ASC - LIMIT 1; + LIMIT 1; END IF; - + END IF; - + DELETE FROM vn.workerTimeControl - WHERE userFk = vUserFk + WHERE userFk = vUserFk AND timed = vTimed; - + CALL vn.workerTimeControlSOWP(vUserFk, vTimed); - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `workerTimeControl_repair` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -74141,6 +75239,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `workerTimeControl_repair`() proc: BEGIN @@ -74153,39 +75253,37 @@ proc: BEGIN UPDATE vn.workerTimeControl SET direction = 'middle'; /*2- poner los out*/ -UPDATE vn.workerTimeControl wtc - JOIN +UPDATE vn.workerTimeControl wtc + JOIN (SELECT userFk,MAX(timed) maxTimed FROM (SELECT id, userFk, timed, date(timed) dated - FROM vn.workerTimeControl - ) sub + FROM vn.workerTimeControl + ) sub GROUP BY userFk,dated )sub SET direction = "out" - WHERE wtc.userFk = sub.userFk + WHERE wtc.userFk = sub.userFk AND wtc.timed = sub.maxTimed; - - /*3- poner los in*/ -UPDATE vn.workerTimeControl wtc - JOIN + + /*3- poner los in*/ +UPDATE vn.workerTimeControl wtc + JOIN (SELECT userFk,MIN(timed) maxTimed FROM (SELECT id, userFk, timed, date(timed) dated - FROM vn.workerTimeControl - ) sub + FROM vn.workerTimeControl + ) sub GROUP BY userFk,dated )sub SET direction = "in" - WHERE wtc.userFk = sub.userFk - AND wtc.timed = sub.maxTimed ; - + WHERE wtc.userFk = sub.userFk + AND wtc.timed = sub.maxTimed ; + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `workerTimeControl_sendMail` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -74193,8 +75291,14 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; -CREATE DEFINER=`root`@`localhost` PROCEDURE `workerTimeControl_sendMail`(vWeek INT, vYear INT, vWorkerFk INT) +CREATE DEFINER=`root`@`localhost` PROCEDURE `workerTimeControl_sendMail`( + vWeek INT, + vYear INT, + vWorkerFk INT +) BEGIN /** * Inserta en la tabla vn.mail para notificar a los empleados que teletrabajan de las jornadas que se han registrado. @@ -74254,8 +75358,8 @@ BEGIN SUM(IF(tb.type IS NULL, IF(tc.timeWorkDecimal > 0, FALSE, IF(tb.timeWorkDecimal > 0, TRUE, FALSE)), TRUE))isTeleworkingWeek - FROM tmp.timeBusinessCalculate1 tb - LEFT JOIN tmp.timeControlCalculate1 tc ON tc.userFk = tb.userFk AND tc.dated = tb.dated + FROM tmp.timeBusinessCalculate tb + LEFT JOIN tmp.timeControlCalculate tc ON tc.userFk = tb.userFk AND tc.dated = tb.dated GROUP BY tb.userFk HAVING isTeleworkingWeek > 0 )sub ON sub.userFk = u.id @@ -74279,17 +75383,14 @@ BEGIN DROP TABLE IF EXISTS tmp.timeBusinessCalculate; DROP TEMPORARY TABLE IF EXISTS tmp.timeControlCalculate; DROP TEMPORARY TABLE IF EXISTS tmp.timeBusinessCalculate; - DROP TEMPORARY TABLE IF EXISTS tmp.timeControlCalculate1; - DROP TEMPORARY TABLE IF EXISTS tmp.timeBusinessCalculate1; DROP TEMPORARY TABLE IF EXISTS tmp.error; CREATE TEMPORARY TABLE tmp.error (workerFk INT); - SELECT CONCAT (MIN(dated), ' 00:00:00'), CONCAT (MAX(dated), ' 23:59:59') INTO vStarted, vEnded + SELECT MIN(dated), util.dayEnd(MAX(dated)) INTO vStarted, vEnded FROM time - WHERE year = vYear AND - week = vWeek; - + WHERE period = CONCAT(vYear, LPAD(vWeek, 2, '0')); + DELETE FROM workerTimeControl WHERE IFNULL(vWorkerFk, userFk) = userFk AND timed BETWEEN vStarted AND vEnded AND @@ -74309,11 +75410,6 @@ BEGIN CALL timeBusiness_calculateByUser(vWorkerFk,vStarted,vEnded); END IF; - CREATE TEMPORARY TABLE tmp.timeControlCalculate1 - SELECT * FROM tmp.timeControlCalculate; - CREATE TEMPORARY TABLE tmp.timeBusinessCalculate1 - SELECT * FROM tmp.timeBusinessCalculate; - SET vTimeWorkDecimalTotal = 0; SET vBody= ''; OPEN vCursor; @@ -74494,8 +75590,6 @@ proc: LOOP DROP TABLE tmp.timeControlCalculate; DROP TABLE tmp.timeBusinessCalculate; - DROP TABLE tmp.timeControlCalculate1; - DROP TABLE tmp.timeBusinessCalculate1; DROP TABLE tmp.error; END ;; DELIMITER ; @@ -74503,8 +75597,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `workerTimeControl_sendMailByDepartment` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -74512,6 +75604,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `workerTimeControl_sendMailByDepartment`(IN vDatedFrom DATETIME, IN vDatedTo DATETIME, IN vWorkerFk INT) BEGIN @@ -74569,7 +75663,7 @@ BEGIN AND w.businessFk GROUP BY tm.userFk,t.dated ORDER BY tm.userFk,t.dated; - + INSERT INTO vn.mail (receiver, replyTo, subject, body) SELECT eu.email, 'laboral@verdnatura.es', CONCAT('Registro de horas semana ', WEEK(vDatedFrom), ' año ', YEAR(vDatedFrom)) , CONCAT(' @@ -74645,8 +75739,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `workerTimeControl_sendMailByDepartmentLauncher` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -74654,6 +75746,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `workerTimeControl_sendMailByDepartmentLauncher`() BEGIN @@ -74661,7 +75755,7 @@ BEGIN IF (DAYNAME(util.VN_CURDATE()) = 'miércoles') THEN SELECT DATE_SUB(util.VN_CURDATE(), INTERVAL 9 DAY), CONCAT(DATE_SUB(util.VN_CURDATE(), INTERVAL 3 DAY), ' 23:59:59') INTO vDatedFrom, vDatedTo; - + CALL vn.workerTimeControl_sendMailByDepartment(vDatedFrom, vDatedTo, NULL); END IF; END ;; @@ -74670,8 +75764,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `workerTimeControl_setOrder` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -74679,6 +75771,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `workerTimeControl_setOrder`(vUserFk INT, vStarted DATE, vFinished DATE) BEGIN @@ -74698,8 +75792,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `workerTimeControl_weekCheckBreak` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -74707,13 +75799,15 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `workerTimeControl_weekCheckBreak`(vStarted DATE, vEnded DATE) BEGIN /** - * Retorna los trabajadores que no han respetado el descanso semanal de 36/72 horas - * El sistema verificará el descanso corto en la siguiente semana - * o el largo en las 2 siguientes semanas a partir de las fechas dadas + * Retorna los trabajadores que no han respetado el descanso semanal de 36/72 horas + * El sistema verificará el descanso corto en la siguiente semana + * o el largo en las 2 siguientes semanas a partir de las fechas dadas * @param vStarted día inicio para verificar * @param vEnded día final para verificar * @return tmp.workerWithoutWeekBreak (workerFk) @@ -74735,10 +75829,10 @@ BEGIN CALL workerTimeControl_checkBreak(vStarted); INSERT IGNORE INTO tmp.workerWithoutWeekBreakInWeek - SELECT workerFk + SELECT workerFk FROM tmp.workerWithoutWeekBreak; DROP TEMPORARY TABLE IF EXISTS tmp.workerWithoutWeekBreak; - SET vStarted = DATE_ADD(vStarted, INTERVAL 1 DAY); + SET vStarted = DATE_ADD(vStarted, INTERVAL 1 DAY); END WHILE; END ;; @@ -74747,8 +75841,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `workerWeekControl` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -74756,6 +75848,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `workerWeekControl`(vUserFk INT, vDated DATE, vTabletFk VARCHAR(100)) BEGIN @@ -74776,7 +75870,7 @@ BEGIN DECLARE vDepartmentFk INT; DECLARE isEnabled BOOLEAN DEFAULT TRUE; - SELECT COUNT(*) INTO vHasSignedToday + SELECT COUNT(*) INTO vHasSignedToday FROM workerTimeControl WHERE timed >= vDated AND userFk = vUserFk; SET @day := 0; @@ -74789,16 +75883,16 @@ BEGIN SELECT fichada_anterior, fichada_actual, interval_in_minutes, jornadas FROM ( - SELECT @lastTimed fichada_anterior, + SELECT @lastTimed fichada_anterior, timed, CAST(time_to_sec(timediff(timed,@lastTimed )) / 60 AS UNSIGNED) as interval_in_minutes, IF(day(timed) != @day, 1, 0) as jornadas, @day := day(timed) dia_del_mes, - @lastTimed := timed fichada_actual + @lastTimed := timed fichada_actual FROM ( SELECT day(timed) as dayNumber, dayname(timed) as dayName, timed - FROM + FROM (SELECT TIMESTAMPADD(DAY, -11, util.VN_NOW()) as timed, vUserFk as userFk -- Fichada virtual para los en los que no se ha trabajado la semana anterior UNION ALL SELECT timed, userFk @@ -74806,18 +75900,18 @@ BEGIN WHERE userFk = vUserFk AND timed >= TIMESTAMPADD(DAY, -10,vDated) UNION ALL - SELECT IF(vHasSignedToday, '2000-01-01 00:00', util.VN_NOW()) as timed, vUserFk + SELECT IF(vHasSignedToday, '2000-01-01 00:00', util.VN_NOW()) as timed, vUserFk ) sub4 ORDER BY timed ) sub - + ) sub2 WHERE fichada_actual >= TIMESTAMPADD(WEEK, -1, vDated) ) sub3 ; SELECT IFNULL(SUM(impar),0) into vImpares FROM ( - SELECT day(timed) as dayNumber, + SELECT day(timed) as dayNumber, count(*) mod 2 as impar FROM vn.workerTimeControl wtc WHERE userFk = vUserFk @@ -74834,29 +75928,29 @@ BEGIN AND at2.isAllowedToWork = FALSE AND b.workerFk = vUserFk LIMIT 1; - + -- Contrato en vigor SELECT IF(COUNT(*),vCantWork,'Sin contrato') INTO vCantWork FROM business b WHERE b.workerFk = vUserFk AND b.started <= vDated AND IFNULL(b.ended, vDated) >= vDated; - + -- Departamento si vTabletFk es 0 no hacemos comprobacion (Madrid y Vilassar) IF vTabletFk <> '0' THEN -- 1 Obtener el departamento del usuario SELECT wtcu.departmentFk INTO vDepartmentFk FROM workerTimeControlUserInfo wtcu WHERE wtcu.userFk = vUserFk; - -- 2 Comprobar si la tablet pertenece al departamento + -- 2 Comprobar si la tablet pertenece al departamento SELECT COUNT(td.tabletFk) INTO isEnabled FROM tabletDepartment td WHERE td.tabletFk = vTabletFk AND td.departmentFk = vDepartmentFk; - + END IF; - + IF vJornadas IS NOT NULL THEN - + SELECT 'Jornadas' as Item, vJornadas as Cantidad, 'Correcto' AS Análisis UNION ALL SELECT 'Descansos 12 h' as Item, vDescansos12h as Cantidad, IF(vDescansos12h >= vJornadas, 'Correcto','Error: 1 por jornada') as Análisis @@ -74865,9 +75959,9 @@ BEGIN UNION ALL SELECT 'Dias con fichadas impares' as Item, vImpares as Cantidad, IF(vImpares = 0, 'Correcto','Error') as Análisis UNION ALL - SELECT IF (LENGTH(vCantWork),CONCAT('Dia no laborable: ', vCantWork),'Dia laborable') as Item, - '' as Cantidad, - IF(LENGTH(vCantWork),'Error', 'Correcto') as Análisis + SELECT IF (LENGTH(vCantWork),CONCAT('Dia no laborable: ', vCantWork),'Dia laborable') as Item, + '' as Cantidad, + IF(LENGTH(vCantWork),'Error', 'Correcto') as Análisis UNION ALL SELECT 'El fichador no pertenece a tu departamento.' as Item, '' as Cantidad, IF(isEnabled, 'Correcto','Error') as Análisis; @@ -74881,7 +75975,7 @@ BEGIN UNION ALL SELECT 'Dias con fichadas impares' as Item, vImpares as Cantidad, 'Correcto' as Análisis UNION ALL - SELECT IF (LENGTH(vCantWork),CONCAT('Dia no laborable: ', vCantWork),'Dia laborable') as Item, + SELECT IF (LENGTH(vCantWork),CONCAT('Dia no laborable: ', vCantWork),'Dia laborable') as Item, '' as Cantidad, IF(LENGTH(vCantWork),'Error', 'Correcto') as Análisis UNION ALL SELECT 'El fichador no pertenece a tu departamento.' as Item, '' as Cantidad, IF(isEnabled, 'Correcto','Error') as Análisis; @@ -74893,8 +75987,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `workerWeekTiming` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -74902,6 +75994,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `workerWeekTiming`(vUserFk INT, vDated DATE) BEGIN @@ -74917,7 +76011,7 @@ CALL vn.workerTimeControlSetOrder_by_User_and_dateRange(vUserFk,TIMESTAMPADD(DAY DROP TEMPORARY TABLE IF EXISTS tmp.workerWeekTiming; CREATE TEMPORARY TABLE tmp.workerWeekTiming SELECT orden `orden`, - max(hace7dias) 7_dias_antes, + max(hace7dias) 7_dias_antes, max(hace6dias) 6_dias_antes, max(hace5dias) 5_dias_antes, max(hace4dias) 4_dias_antes, @@ -74947,16 +76041,16 @@ SELECT orden `orden`, )sub2 GROUP BY orden ; - + DROP TEMPORARY TABLE IF EXISTS tmp.workerWeekTiming_Aux; CREATE TEMPORARY TABLE tmp.workerWeekTiming_Aux SELECT * FROM tmp.workerWeekTiming; INSERT INTO tmp.workerWeekTiming( 7_dias_antes,6_dias_antes,5_dias_antes,4_dias_antes,3_dias_antes,2_dias_antes,1_dia_antes,mismo_dia) VALUES('total','','','','','','',''); - + INSERT INTO tmp.workerWeekTiming( orden, 7_dias_antes,6_dias_antes,5_dias_antes,4_dias_antes,3_dias_antes,2_dias_antes,1_dia_antes, mismo_dia) -SELECT 0, +SELECT 0, IFNULL(DATE_FORMAT(SEC_TO_TIME(SUM(IF(orden MOD 2, - TIME_TO_SEC(7_dias_antes), TIME_TO_SEC(7_dias_antes)))),'%H:%i'),''), IFNULL(DATE_FORMAT(SEC_TO_TIME(SUM(IF(orden MOD 2, - TIME_TO_SEC(6_dias_antes), TIME_TO_SEC(6_dias_antes)))),'%H:%i'),''), IFNULL(DATE_FORMAT(SEC_TO_TIME(SUM(IF(orden MOD 2, - TIME_TO_SEC(5_dias_antes), TIME_TO_SEC(5_dias_antes)))),'%H:%i'),''), @@ -74966,7 +76060,7 @@ SELECT 0, IFNULL(DATE_FORMAT(SEC_TO_TIME(SUM(IF(orden MOD 2, - TIME_TO_SEC(1_dia_antes), TIME_TO_SEC(1_dia_antes)))),'%H:%i'),''), '' FROM tmp.workerWeekTiming_Aux; - + INSERT INTO tmp.workerWeekTiming_Aux( orden, 1_dia_antes) SELECT 0, ROUND(( IFNULL(TIME_TO_SEC(7_dias_antes),0) + @@ -74978,14 +76072,14 @@ SELECT 0, ROUND(( IFNULL(TIME_TO_SEC(1_dia_antes),0) ) / 3600,1) FROM tmp.workerWeekTiming - WHERE orden = 0; + WHERE orden = 0; INSERT INTO tmp.workerWeekTiming( 7_dias_antes,6_dias_antes,5_dias_antes,4_dias_antes,3_dias_antes,2_dias_antes,1_dia_antes,mismo_dia) SELECT '','','','','','',1_dia_antes,'' FROM tmp.workerWeekTiming_Aux WHERE orden = 0; - + SELECT 7_dias_antes,6_dias_antes,5_dias_antes,4_dias_antes,3_dias_antes,2_dias_antes,1_dia_antes,mismo_dia FROM tmp.workerWeekTiming; DROP TEMPORARY TABLE tmp.workerWeekTiming; @@ -74997,147 +76091,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; -/*!50003 DROP PROCEDURE IF EXISTS `worker_calculateCommission` */; -/*!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 = utf8mb4 */ ; -/*!50003 SET character_set_results = utf8mb4 */ ; -/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; -DELIMITER ;; -CREATE DEFINER=`root`@`localhost` PROCEDURE `worker_calculateCommission`(vYear INT, vQuarter INT) -BEGIN - - DECLARE vPlusTeamAmount INT; - DECLARE vPlusNewBornAmount INT; - DECLARE vPlusSalesAmount INT; - DECLARE vMinimumSalesByQuarter INT; - DECLARE vPlusTeamRange INT; - DECLARE vPlusNewBornRange INT; - DECLARE vRankingSalesRange INT; - -/* - -- Jerarquia - DROP TEMPORARY TABLE IF EXISTS rankingHierarchy; - CREATE TEMPORARY TABLE rankingHierarchy - SELECT COUNT(*) - 1 teamMembers, wb.bossFk - FROM vn.worker ww - JOIN vn.worker wb ON ww.id = wb.bossFk - GROUP BY wb.bossFk; - */ - - SELECT plusTeamAmount, plusNewBornAmount, plusSalesAmount, minimumSalesByQuarter, plusTeamRange, plusNewBornRange, rankingSalesRange - INTO vPlusTeamAmount, vPlusNewBornAmount, vPlusSalesAmount, vMinimumSalesByQuarter, vPlusTeamRange, vPlusNewBornRange, vRankingSalesRange - FROM commissionConfig; - -- Ventas - DROP TEMPORARY TABLE IF EXISTS rankingSale; - CREATE TEMPORARY TABLE rankingSale - (PRIMARY KEY(workerFk)) ENGINE = MEMORY - SELECT IF(SUM(v.importe) > vMinimumSalesByQuarter, - SUM(IFNULL(v.comision,0)), - 0) as commission, - SUM(v.importe) sales, - v.Id_Trabajador workerFk - FROM bs.vendedores v - WHERE v.año = vYear AND CEIL(mes/3) = vQuarter - GROUP BY v.Id_Trabajador; - - -- Ranking ventas - SET @position:= 0; - DROP TEMPORARY TABLE IF EXISTS rankingSelling; - CREATE TEMPORARY TABLE rankingSelling - (PRIMARY KEY(userFk)) ENGINE = MEMORY - SELECT userFk, @position:= @position + 1 position - FROM ( - SELECT SUM(`v`.`importe`) AS `importe`, - `u`.`name` AS `name`, - `u`.`id` AS `userFk` - FROM - (`bs`.`vendedores` `v` - JOIN `account`.`user` `u` ON (`u`.`id` = `v`.`Id_Trabajador`)) - WHERE - `v`.`año` = vYear - AND CEIL(`v`.`mes` / 3) = vQuarter - AND `u`.`name` NOT IN ('ismaelalcolea' , 'ruben') - GROUP BY `v`.`Id_Trabajador` - ORDER BY SUM(`v`.`importe`) DESC - LIMIT vRankingSalesRange - ) t; - - CALL rankingTeamByQuarter(vYear, vQuarter); - - -- comerciales que computan / total integrantes - DROP TEMPORARY TABLE IF EXISTS teamNames; - CREATE TEMPORARY TABLE teamNames - (PRIMARY KEY(departmentFk)) ENGINE = MEMORY - SELECT DISTINCT departmentFk, teamPeople - FROM tmp.rankingTeam; - - -- Ranking por equipos - DROP TEMPORARY TABLE IF EXISTS rankingTeam; - CREATE TEMPORARY TABLE rankingTeam - (PRIMARY KEY(departmentFk)) ENGINE = MEMORY - SELECT DISTINCT departmentFk - FROM teamNames - LIMIT vPlusTeamRange; - - -- Ranking por nuevos clientes - SET @position:= 0; - DROP TEMPORARY TABLE IF EXISTS rankingNewBorn; - CREATE TEMPORARY TABLE rankingNewBorn - (PRIMARY KEY(userFk)) ENGINE = MEMORY - SELECT userFk, @position:= @position + 1 position - FROM ( - SELECT SUM(amount) AS total, - n.userFk - FROM newBornSales n - WHERE n.dated >= util.quarterFirstDay(vYear, vQuarter) - AND n.firstShipped >= util.quarterFirstDay(vYear -1, vQuarter) - GROUP BY userFk - ORDER BY SUM(amount) DESC - LIMIT vPlusNewBornRange - ) t; - - -- Sumatorio de ventas - SELECT uBoss.`name` as team, - u.`name`, - r.commission, - -- IF(rh.bossFk, 200 + (teamMembers * 30), 0) plusResponsibility, - @plusRankingSellers := ((vRankingSalesRange + 1) - rs.position) * 40 plusRankingSellers, - @plusRankingTeam := IF(rt.departmentFk, vPlusTeamAmount, 0) plusRankingTeam, - @plusRankingNewBorn := ((vPlusNewBornRange + 1) - rnb.position) * vPlusNewBornAmount plusRankingNewBorn, - IFNULL(r.commission,0) + IFNULL(@plusRankingSellers,0) + @plusRankingTeam + IFNULL(@plusRankingNewBorn, 0) total, - sales, rs.position, teamPeople, - vYear year, - vQuarter quarter - FROM rankingSale r - -- LEFT JOIN rankingHierarchy rh ON rh.bossFk = r.workerFk - JOIN account.user u ON u.id = r.workerFk - JOIN vn2008.jerarquia j ON j.worker_id = r.workerFk - LEFT JOIN `account`.`user` uBoss ON uBoss.id = j.boss_id - LEFT JOIN rankingSelling rs ON rs.userFk = r.workerFk - LEFT JOIN workerDepartment wd ON wd.workerFk = r.workerFk - LEFT JOIN rankingTeam rt ON rt.departmentFk = wd.departmentFk AND r.commission - LEFT JOIN teamNames tn ON tn.departmentFk = wd.departmentFk - LEFT JOIN vn.rankingNewBorn rnb ON rnb.userFk = r.workerFk; - - DROP TEMPORARY TABLE tmp.rankingTeam; - DROP TEMPORARY TABLE - rankingSelling, - rankingTeam, - teamNames, - rankingNewBorn, - rankingSale; -END ;; -DELIMITER ; -/*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `worker_getFromHasMistake` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -75145,6 +76098,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `worker_getFromHasMistake`(vDepartmentFk INT) BEGIN @@ -75154,11 +76109,11 @@ BEGIN * @param vDepartmentFk id del departamento * */ - - SELECT w.id,w.firstName, w.lastName,d.name - FROM worker w - JOIN workerDepartment wd ON wd.workerFk = w.id - JOIN department d ON d.id = wd.departmentFk + + SELECT w.id,w.firstName, w.lastName,d.name + FROM worker w + JOIN workerDepartment wd ON wd.workerFk = w.id + JOIN department d ON d.id = wd.departmentFk WHERE d.id = vDepartmentFk ORDER BY firstName; @@ -75168,8 +76123,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `worker_getHierarchy` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -75177,6 +76130,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `worker_getHierarchy`(vBoss INT) BEGIN @@ -75189,7 +76144,7 @@ BEGIN (PRIMARY KEY (workerFk)) ENGINE = MEMORY SELECT vBoss AS workerFk; - + DROP TEMPORARY TABLE IF EXISTS tmp.workerHierarchyList; CREATE TEMPORARY TABLE tmp.workerHierarchyList (PRIMARY KEY (workerFk)) @@ -75200,7 +76155,7 @@ BEGIN WHILE (SELECT COUNT(*) FROM tmp.workerHierarchyList WHERE NOT isChecked) > 0 DO INSERT INTO tmp.workerHierarchyList - SELECT w.id, 0 + SELECT w.id, 0 FROM worker w JOIN workerHierarchy wh ON wh.workerFk = w.bossFk; @@ -75211,12 +76166,12 @@ BEGIN TRUNCATE workerHierarchy; INSERT INTO workerHierarchy - SELECT workerFk + SELECT workerFk FROM tmp.workerHierarchyList WHERE NOT isChecked; END WHILE; - + DROP TEMPORARY TABLE IF EXISTS workerHierarchy; END ;; DELIMITER ; @@ -75224,8 +76179,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `worker_getSector` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -75233,6 +76186,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `worker_getSector`() BEGIN @@ -75243,7 +76198,7 @@ BEGIN SELECT s.id,s.description,s.warehouseFk FROM sector s - JOIN worker w ON w.sectorFk = s.id + JOIN worker w ON w.sectorFk = s.id WHERE w.id = account.myUser_getId(); END ;; @@ -75252,8 +76207,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `worker_updateBalance` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -75261,6 +76214,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `worker_updateBalance`(vSelfFk INT(11), vCredit DECIMAL(10,2), vDebit DECIMAL(10,2)) BEGIN @@ -75270,7 +76225,7 @@ BEGIN * @param selfFk, credit, debit */ UPDATE worker - SET balance = balance + (IFNULL(vCredit, 0) - IFNULL(vDebit, 0)) + SET balance = IFNULL(balance, 0) + IFNULL(vCredit, 0) - IFNULL(vDebit, 0) WHERE id = vSelfFk; END ;; DELIMITER ; @@ -75278,8 +76233,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `worker_updateBusiness` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -75287,6 +76240,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `worker_updateBusiness`(vSelf INT) BEGIN @@ -75306,8 +76261,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `worker_updateChangedBusiness` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -75315,6 +76268,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `worker_updateChangedBusiness`() BEGIN @@ -75328,8 +76283,8 @@ BEGIN DECLARE vDone BOOL; DECLARE vCursor CURSOR FOR - SELECT DISTINCT b.workerFk - FROM business b + SELECT DISTINCT b.workerFk + FROM business b WHERE b.started > vBusinessUpdated AND b.started <= vCurdate OR b.ended >= vBusinessUpdated AND b.ended < vCurdate; @@ -75359,8 +76314,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `worker_updateSector` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -75368,28 +76321,26 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `worker_updateSector`(vSectorFk INT) BEGIN - /** * Actualiza el sector del usuario conectado y borra la impresora asociada al usuario * * @param vSectorFk id del sector -*/ + */ UPDATE worker SET sectorFk = vSectorFk, labelerFk = NULL - WHERE id = account.myUser_getId(); - + WHERE id = account.myUser_getId(); END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `workingHours` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -75397,14 +76348,16 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `workingHours`(username varchar(255), logon boolean) BEGIN DECLARE userid int(11); - + SELECT vn.getUserId(username) INTO userid; SELECT username, userid; - IF userid IS NOT NULL THEN + IF userid IS NOT NULL THEN IF (logon) THEN CALL vn.workingHoursTimeIn(userid); ELSE @@ -75417,8 +76370,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `workingHoursTimeIn` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -75426,6 +76377,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `workingHoursTimeIn`(vUserId INT(11)) BEGIN @@ -75437,8 +76390,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `workingHoursTimeOut` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -75446,6 +76397,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `workingHoursTimeOut`(vUserId INT(11)) BEGIN @@ -75459,8 +76412,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `wrongEqualizatedClient` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -75468,22 +76419,24 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `wrongEqualizatedClient`() BEGIN SELECT clientFk, c.name, c.isActive, c.isTaxDataChecked, count(ie) as num FROM vn.client c - JOIN + JOIN ( - SELECT DISTINCT + SELECT DISTINCT `a`.`clientFk` , a.isEqualizated = 0 as ie - + FROM `vn`.`address` `a` ) sub ON sub.clientFk = c.id WHERE c.hasToInvoiceByAddress = FALSE - + GROUP BY clientFk HAVING num > 1 UNION ALL @@ -75499,8 +76452,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `XDiario_checkDate` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -75508,6 +76459,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `XDiario_checkDate`(vDate DATE) proc: BEGIN @@ -75536,8 +76489,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `zoneClosure_recalc` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -75545,6 +76496,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `zoneClosure_recalc`() proc: BEGIN @@ -75567,27 +76520,27 @@ proc: BEGIN SELECT scope INTO vScope FROM zoneConfig; - + DROP TEMPORARY TABLE IF EXISTS tmp.zone; CREATE TEMPORARY TABLE tmp.zone (INDEX (id)) ENGINE = MEMORY SELECT id FROM zone; - + TRUNCATE TABLE zoneClosure; - + WHILE vCounter <= vScope DO - + CALL zone_getOptionsForShipment(vShipped, TRUE); - + REPLACE zoneClosure(zoneFk, dated, `hour`) - SELECT zoneFk, vShipped, `hour` + SELECT zoneFk, vShipped, `hour` FROM tmp.zoneOption; - + SET vCounter = vCounter + 1; SET vShipped = TIMESTAMPADD(DAY, 1, vShipped); END WHILE; - + -- DROP TEMPORARY TABLE tmp.zone; DO RELEASE_LOCK('vn.zoneClosure_recalc'); END ;; @@ -75596,8 +76549,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `zoneGeo_calcTree` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -75605,6 +76556,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `zoneGeo_calcTree`() BEGIN @@ -75640,8 +76593,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `zoneGeo_calcTreeRec` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -75649,6 +76600,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `zoneGeo_calcTreeRec`( vSelf INT, @@ -75681,7 +76634,7 @@ BEGIN OR (vSelf IS NOT NULL AND parentFk = vSelf); DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE; - + SET vSons = 0; OPEN vChildren; @@ -75692,11 +76645,11 @@ BEGIN IF vDone THEN LEAVE myLoop; END IF; - + SET vIndex = vIndex + 1; SET vLft = vIndex; SET vSons = vSons + 1; - + CALL zoneGeo_calcTreeRec( vChildFk, CONCAT(vPath, vChildFk, '/'), @@ -75722,8 +76675,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `zoneGeo_checkName` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -75731,6 +76682,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `zoneGeo_checkName`(vName VARCHAR(255)) BEGIN @@ -75744,8 +76697,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `zoneGeo_delete` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -75753,6 +76704,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `zoneGeo_delete`(vSelf INT) BEGIN @@ -75770,8 +76723,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `zoneGeo_doCalc` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -75779,6 +76730,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `zoneGeo_doCalc`() proc: BEGIN @@ -75799,7 +76752,7 @@ proc: BEGIN SELECT isChanged INTO vIsChanged FROM zoneGeoRecalc; - + IF vIsChanged THEN UPDATE zoneGeoRecalc SET isChanged = FALSE; CALL vn.zoneGeo_calcTree; @@ -75812,8 +76765,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `zoneGeo_setParent` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -75821,6 +76772,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `zoneGeo_setParent`(vSelf INT, vParentFk INT) BEGIN @@ -75841,8 +76794,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `zoneGeo_throwNotEditable` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -75850,6 +76801,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `zoneGeo_throwNotEditable`() BEGIN @@ -75861,8 +76814,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `zone_excludeFromGeo` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -75870,6 +76821,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `zone_excludeFromGeo`(vZoneGeo INT) BEGIN @@ -75894,8 +76847,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `zone_getAgency` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -75903,6 +76854,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `zone_getAgency`(vAddress INT, vLanded DATE) BEGIN @@ -75943,8 +76896,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `zone_getAvailable` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -75952,6 +76903,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `zone_getAvailable`(vAddress INT, vLanded DATE) BEGIN @@ -75969,8 +76922,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `zone_getClosed` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -75978,6 +76929,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `zone_getClosed`() proc:BEGIN @@ -75987,7 +76940,7 @@ proc:BEGIN * @table tmp.closedZones(zoneFk, warehouseFk); */ DROP TEMPORARY TABLE IF EXISTS tmp.closedZones; - + CREATE TEMPORARY TABLE tmp.closedZones ( `zoneFk` int(11) NOT NULL, `warehouseFk` smallint(6) unsigned NOT NULL, @@ -76016,8 +76969,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `zone_getCollisions` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -76025,11 +76976,13 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `zone_getCollisions`() BEGIN /** - * Calcula si para un mismo codigo postal y dia + * Calcula si para un mismo codigo postal y dia * hay mas de una zona configurada y manda correo * */ @@ -76038,16 +76991,16 @@ BEGIN DECLARE vIsDone INT DEFAULT FALSE; DECLARE vTableCollisions TEXT; DECLARE cur1 CURSOR FOR SELECT zoneFk from tmp.zoneOption; - + DECLARE CONTINUE HANDLER FOR NOT FOUND SET vIsDone = TRUE; DROP TEMPORARY TABLE IF EXISTS tmp.zone; CREATE TEMPORARY TABLE tmp.zone - SELECT z.id + SELECT z.id FROM zone z JOIN agencyMode am ON am.id = z.agencyModeFk JOIN deliveryMethod dm ON dm.id = am.deliveryMethodFk - WHERE dm.code IN ('AGENCY','DELIVERY'); + WHERE dm.code IN ('AGENCY','DELIVERY'); CALL zone_getOptionsForShipment(util.VN_CURDATE(),FALSE); @@ -76062,7 +77015,7 @@ BEGIN PRIMARY KEY zoneFkk (zoneFk, geoFk), INDEX(geoFk)) ENGINE = MEMORY; - + OPEN cur1; cur1Loop: LOOP SET vIsDone = FALSE; @@ -76070,40 +77023,40 @@ BEGIN IF vIsDone THEN LEAVE cur1Loop; END IF; - + CALL zone_getLeaves2(vZoneFk, NULL, NULL); - myLoop: LOOP + myLoop: LOOP SET vGeoFk = NULL; - SELECT geoFk INTO vGeoFk + SELECT geoFk INTO vGeoFk FROM tmp.zoneNodes zn WHERE NOT isChecked LIMIT 1; - + IF vGeoFk IS NULL THEN LEAVE myLoop; END IF; - + CALL zone_getLeaves2(vZoneFk, vGeoFk, NULL); UPDATE tmp.zoneNodes - SET isChecked = TRUE + SET isChecked = TRUE WHERE geoFk = vGeoFk; END LOOP; END LOOP; CLOSE cur1; - DELETE FROM tmp.zoneNodes + DELETE FROM tmp.zoneNodes WHERE sons > 0; - + DROP TEMPORARY TABLE IF EXISTS geoCollision; CREATE TEMPORARY TABLE geoCollision SELECT z.agencyModeFk, zn.geoFk, zw.warehouseFk FROM tmp.zoneNodes zn JOIN zone z ON z.id = zn.zoneFk - JOIN zoneWarehouse zw ON z.id = zw.zoneFk + JOIN zoneWarehouse zw ON z.id = zw.zoneFk GROUP BY z.agencyModeFk, zn.geoFk, zw.warehouseFk HAVING count(*) > 1; - + SELECT ' @@ -76113,39 +77066,39 @@ BEGIN ' INTO vTableCollisions; - - INSERT INTO mail (receiver,replyTo,subject,body) + + INSERT INTO mail (receiver,replyTo,subject,body) SELECT 'pepe@verdnatura.es' receiver, 'noreply@verdnatura.es' replyTo, CONCAT('Colisiones en zonas ', util.VN_CURDATE()) subject, CONCAT(vTableCollisions, GROUP_CONCAT(sub.td SEPARATOR ''), '
C.PostalAlmacén Salix
') body - FROM(SELECT + FROM(SELECT CONCAT(' ', zn.name, ' ', zoneFk,' ', z.price,' ', z.name,' ', w.name, ' - ', CONCAT('' - 'https://salix.verdnatura.es/#!/zone/', + 'https://salix.verdnatura.es/#!/zone/', zoneFk, '/location?q=%7B%22search%22:%22', - zn.name, + zn.name, '%22%7D'),' ') td FROM tmp.zoneNodes zn JOIN zone z ON z.id = zn.zoneFk JOIN geoCollision gc ON gc.agencyModeFk = z.agencyModeFk AND zn.geoFk = gc.geoFk JOIN warehouse w ON w.id = gc.warehouseFk) sub; - - DROP TEMPORARY TABLE - geoCollision, + + DROP TEMPORARY TABLE + geoCollision, tmp.zone, tmp.zoneNodes; END ;; @@ -76154,8 +77107,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `zone_getEvents` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -76163,6 +77114,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `zone_getEvents`( vGeoFk INT, @@ -76175,17 +77128,17 @@ BEGIN * @param vAgencyModeFk The agency mode id */ DECLARE vDeliveryMethodFk VARCHAR(255); - + DROP TEMPORARY TABLE IF EXISTS tZone; CREATE TEMPORARY TABLE tZone (id INT PRIMARY KEY) ENGINE = MEMORY; - + SELECT dm.`code` INTO vDeliveryMethodFk FROM agencyMode am JOIN deliveryMethod dm ON dm.id = am.deliveryMethodFk WHERE am.id = vAgencyModeFk; - + IF vDeliveryMethodFk = 'PICKUP' THEN INSERT INTO tZone SELECT id @@ -76202,16 +77155,16 @@ BEGIN WHERE z.agencyModeFk = vAgencyModeFk; ELSE INSERT INTO tZone - SELECT t.id + SELECT t.id FROM tmp.zone t JOIN zone z ON z.id = t.id - JOIN agencyMode am ON am.id = z.agencyModeFk + JOIN agencyMode am ON am.id = z.agencyModeFk JOIN deliveryMethod dm ON dm.id = am.deliveryMethodFk WHERE dm.`code` IN ('AGENCY', 'DELIVERY'); END IF; DROP TEMPORARY TABLE tmp.zone; END IF; - + SELECT e.zoneFk, e.`type`, e.dated, e.`started`, e.`ended`, e.weekDays FROM tZone t JOIN zoneEvent e ON e.zoneFk = t.id; @@ -76223,7 +77176,7 @@ BEGIN JOIN zoneGeo zg1 ON zg1.id = eg.geoFk JOIN zoneGeo zg2 ON zg2.id = vGeoFk WHERE eg.zoneExclusionFk IS NULL OR zg2.`path` LIKE CONCAT(zg1.`path`,'%'); - + DROP TEMPORARY TABLE tZone; END ;; DELIMITER ; @@ -76231,8 +77184,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `zone_getFromGeo` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -76240,6 +77191,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `zone_getFromGeo`(vGeoFk INT) BEGIN @@ -76252,18 +77205,18 @@ BEGIN DECLARE vChildFk INT DEFAULT vGeoFk; DECLARE vParentFk INT; DECLARE vLevel INT DEFAULT 1; - + DROP TEMPORARY TABLE IF EXISTS tNodes; CREATE TEMPORARY TABLE tNodes (PRIMARY KEY (id)) ENGINE = MEMORY SELECT vGeoFk id, vLevel `level`; - + myLoop: LOOP SELECT parentFk INTO vParentFk FROM zoneGeo WHERE id = vChildFk; - + SET vChildFk = vParentFk; SET vLevel = vLevel + 1; @@ -76271,7 +77224,7 @@ BEGIN SELECT vChildFk, vLevel FROM DUAL WHERE vChildFk IS NOT NULL; - + IF ROW_COUNT() = 0 THEN LEAVE myLoop; END IF; @@ -76300,8 +77253,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `zone_getLanded` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -76309,6 +77260,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `zone_getLanded`(vShipped DATE, vAddressFk INT, vAgencyModeFk INT, vWarehouseFk INT, vShowExpiredZones BOOLEAN) BEGIN @@ -76360,8 +77313,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `zone_getLeaves` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -76369,9 +77320,11 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `zone_getLeaves`(vSelf INT, vParentFk INT, vSearch VARCHAR(255)) -BEGIN +BEGIN /** * Devuelve las ubicaciones incluidas en la ruta y que sean hijos de parentFk. * @param vSelf Id de la zona @@ -76385,23 +77338,23 @@ BEGIN CREATE TEMPORARY TABLE tNodes (UNIQUE (id)) ENGINE = MEMORY - SELECT id - FROM zoneGeo + SELECT id + FROM zoneGeo LIMIT 0; IF vIsSearch THEN SET vIsNumber = vSearch REGEXP '^[0-9]+$'; - + INSERT INTO tNodes - SELECT id + SELECT id FROM zoneGeo WHERE (vIsNumber AND `name` = vSearch) OR (!vIsNumber AND `name` LIKE CONCAT('%', vSearch, '%')) LIMIT 1000; - + ELSEIF vParentFk IS NULL THEN INSERT INTO tNodes - SELECT geoFk + SELECT geoFk FROM zoneIncluded WHERE zoneFk = vSelf; END IF; @@ -76410,14 +77363,14 @@ BEGIN DROP TEMPORARY TABLE IF EXISTS tChilds; CREATE TEMPORARY TABLE tChilds ENGINE = MEMORY - SELECT id + SELECT id FROM tNodes; DROP TEMPORARY TABLE IF EXISTS tParents; CREATE TEMPORARY TABLE tParents ENGINE = MEMORY - SELECT id - FROM zoneGeo + SELECT id + FROM zoneGeo LIMIT 0; myLoop: LOOP @@ -76427,27 +77380,27 @@ BEGIN FROM zoneGeo g JOIN tChilds c ON c.id = g.id WHERE g.parentFk IS NOT NULL; - + INSERT IGNORE INTO tNodes - SELECT id + SELECT id FROM tParents; - + IF ROW_COUNT() = 0 THEN LEAVE myLoop; END IF; - + DELETE FROM tChilds; INSERT INTO tChilds - SELECT id + SELECT id FROM tParents; END LOOP; - + DROP TEMPORARY TABLE tChilds, tParents; END IF; IF !vIsSearch THEN INSERT IGNORE INTO tNodes - SELECT id + SELECT id FROM zoneGeo WHERE parentFk <=> vParentFk; END IF; @@ -76469,8 +77422,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `zone_getLeaves2` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -76478,15 +77429,17 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `zone_getLeaves2`(vSelf INT, vParentFk INT, vSearch VARCHAR(255)) -BEGIN +BEGIN /** * Devuelve los geoFk incluidos en la ruta y que sean hijos de parentFk * @param vSelf Id de la zona * @param vParentFk Id del geo a calcular * @param vSearch cadena a buscar - * + * * @return tmp.zoneNodes(geoFk, name, parentFk, sons, isChecked, zoneFk) * */ @@ -76497,23 +77450,23 @@ BEGIN CREATE TEMPORARY TABLE tNodes (UNIQUE (id)) ENGINE = MEMORY - SELECT id - FROM zoneGeo + SELECT id + FROM zoneGeo LIMIT 0; IF vIsSearch THEN SET vIsNumber = vSearch REGEXP '^[0-9]+$'; INSERT INTO tNodes - SELECT id + SELECT id FROM zoneGeo WHERE (vIsNumber AND `name` = vSearch) OR (!vIsNumber AND `name` LIKE CONCAT('%', vSearch, '%')) LIMIT 1000; - + ELSEIF vParentFk IS NULL THEN INSERT INTO tNodes - SELECT geoFk + SELECT geoFk FROM zoneIncluded WHERE zoneFk = vSelf; END IF; @@ -76523,15 +77476,15 @@ BEGIN CREATE TEMPORARY TABLE tChilds (INDEX(id)) ENGINE = MEMORY - SELECT id + SELECT id FROM tNodes; DROP TEMPORARY TABLE IF EXISTS tParents; CREATE TEMPORARY TABLE tParents (INDEX(id)) ENGINE = MEMORY - SELECT id - FROM zoneGeo + SELECT id + FROM zoneGeo LIMIT 0; myLoop: LOOP @@ -76541,27 +77494,27 @@ BEGIN FROM zoneGeo g JOIN tChilds c ON c.id = g.id WHERE g.parentFk IS NOT NULL; - + INSERT IGNORE INTO tNodes - SELECT id + SELECT id FROM tParents; - + IF ROW_COUNT() = 0 THEN LEAVE myLoop; END IF; - + DELETE FROM tChilds; INSERT INTO tChilds - SELECT id + SELECT id FROM tParents; END LOOP; - + DROP TEMPORARY TABLE tChilds, tParents; END IF; IF !vIsSearch THEN INSERT IGNORE INTO tNodes - SELECT id + SELECT id FROM zoneGeo WHERE parentFk <=> vParentFk; END IF; @@ -76576,9 +77529,9 @@ BEGIN FROM zoneGeo g JOIN tNodes n ON n.id = g.id LEFT JOIN zoneIncluded i ON i.geoFk = g.id AND i.zoneFk = vSelf - WHERE i.isIncluded = TRUE + WHERE i.isIncluded = TRUE OR (i.isIncluded IS NULL AND vParentFk IS NOT NULL); - + DROP TEMPORARY TABLE tNodes; END ;; DELIMITER ; @@ -76586,8 +77539,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `zone_getOptionsForLanding` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -76595,6 +77546,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `zone_getOptionsForLanding`(vLanded DATE, vShowExpiredZones BOOLEAN) BEGIN @@ -76604,7 +77557,7 @@ BEGIN * @table tmp.zone(id) The zones ids * @param vLanded The delivery date * @return tmp.zoneOption The computed options - */ + */ DROP TEMPORARY TABLE IF EXISTS tmp.zoneOption; CREATE TEMPORARY TABLE tmp.zoneOption ENGINE = MEMORY @@ -76645,13 +77598,13 @@ BEGIN END LIMIT 10000000000000000000 ) t - GROUP BY zoneFk; - + GROUP BY zoneFk; + DELETE t FROM tmp.zoneOption t JOIN zoneExclusion e ON e.zoneFk = t.zoneFk AND e.`dated` = t.landed LEFT JOIN zoneExclusionGeo eg ON eg.zoneExclusionFk = e.id WHERE eg.zoneExclusionFk IS NULL; - + IF NOT vShowExpiredZones THEN DELETE FROM tmp.zoneOption WHERE shipped < util.VN_CURDATE() @@ -76663,8 +77616,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `zone_getOptionsForShipment` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -76672,6 +77623,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `zone_getOptionsForShipment`(vShipped DATE, vShowExpiredZones BOOLEAN) BEGIN @@ -76683,7 +77636,7 @@ BEGIN * @return tmp.zoneOption(zoneFk, hour, travelingDays, price, bonus, specificity) The computed options */ DECLARE vHour TIME DEFAULT TIME(util.VN_NOW()); - + DROP TEMPORARY TABLE IF EXISTS tLandings; CREATE TEMPORARY TABLE tLandings (INDEX (eventFk)) @@ -76751,72 +77704,70 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `zone_getPostalCode` */; /*!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 = utf8mb3 */ ; -/*!50003 SET character_set_results = utf8mb3 */ ; -/*!50003 SET collation_connection = utf8mb3_general_ci */ ; +/*!50003 SET character_set_client = utf8mb4 */ ; +/*!50003 SET character_set_results = utf8mb4 */ ; +/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `zone_getPostalCode`(vSelf INT) BEGIN /** * Devuelve los códigos postales incluidos en una zona */ - DECLARE vGeoFk INT DEFAULT NULL; + DECLARE vGeoFk INT DEFAULT NULL; - DROP TEMPORARY TABLE IF EXISTS tmp.zoneNodes; - CREATE TEMPORARY TABLE tmp.zoneNodes ( - geoFk INT, - name VARCHAR(100), - parentFk INT, - sons INT, - isChecked BOOL DEFAULT 0, - zoneFk INT, - PRIMARY KEY zoneNodesPk (zoneFk, geoFk), - INDEX(geoFk)) - ENGINE = MEMORY; + DROP TEMPORARY TABLE IF EXISTS tmp.zoneNodes; + CREATE TEMPORARY TABLE tmp.zoneNodes ( + geoFk INT, + name VARCHAR(100), + parentFk INT, + sons INT, + isChecked BOOL DEFAULT 0, + zoneFk INT, + PRIMARY KEY zoneNodesPk (zoneFk, geoFk), + INDEX(geoFk)) + ENGINE = MEMORY; - CALL zone_getLeaves2(vSelf, NULL , NULL); + CALL zone_getLeaves2(vSelf, NULL , NULL); - UPDATE tmp.zoneNodes zn - SET isChecked = 0 - WHERE parentFk IS NULL; + UPDATE tmp.zoneNodes zn + SET isChecked = 0 + WHERE parentFk IS NULL; - myLoop: LOOP - SET vGeoFk = NULL; - SELECT geoFk INTO vGeoFk - FROM tmp.zoneNodes zn - WHERE NOT isChecked - LIMIT 1; + myLoop: LOOP + SET vGeoFk = NULL; + SELECT geoFk INTO vGeoFk + FROM tmp.zoneNodes zn + WHERE NOT isChecked + LIMIT 1; - CALL zone_getLeaves2(vSelf, vGeoFk, NULL); - UPDATE tmp.zoneNodes - SET isChecked = TRUE - WHERE geoFk = vGeoFk; + CALL zone_getLeaves2(vSelf, vGeoFk, NULL); + UPDATE tmp.zoneNodes + SET isChecked = TRUE + WHERE geoFk = vGeoFk; - IF vGeoFk IS NULL THEN - LEAVE myLoop; - END IF; - END LOOP; + IF vGeoFk IS NULL THEN + LEAVE myLoop; + END IF; + END LOOP; - DELETE FROM tmp.zoneNodes - WHERE sons > 0; + DELETE FROM tmp.zoneNodes + WHERE sons > 0; - SELECT zn.geoFk, zn.name - FROM tmp.zoneNodes zn - JOIN zone z ON z.id = zn.zoneFk; + SELECT zn.geoFk, zn.name + FROM tmp.zoneNodes zn + JOIN zone z ON z.id = zn.zoneFk; END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `zone_getShipped` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -76824,6 +77775,8 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `zone_getShipped`(vLanded DATE, vAddressFk INT, vAgencyModeFk INT, vShowExpiredZones BOOLEAN) BEGIN @@ -76839,7 +77792,7 @@ BEGIN DECLARE vZoneGeo INT; SELECT address_getGeo(vAddressFk) INTO vZoneGeo; - + CALL vn.zone_getFromGeo(vZoneGeo); CALL vn.zone_getOptionsForLanding(vLanded, vShowExpiredZones); CALL vn.zone_excludeFromGeo(vZoneGeo); @@ -76859,7 +77812,7 @@ BEGIN FROM tmp.zoneOption zo JOIN vn.zoneWarehouse zw ON zw.zoneFk = zo.zoneFk JOIN vn.`zone` z ON z.id = zo.zoneFk - LEFT JOIN tmp.closedZones cz + LEFT JOIN tmp.closedZones cz ON cz.warehouseFk = zw.warehouseFk AND cz.zoneFk = zw.zoneFk AND zo.shipped = util.VN_CURDATE() @@ -76879,8 +77832,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `zone_getState` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -76888,14 +77839,16 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `zone_getState`(vDated DATE) BEGIN /** * Devuelve las zonas y el estado para la fecha solicitada - * + * * @param vDated Fecha en cuestión - */ + */ DROP TEMPORARY TABLE IF EXISTS tmp.zone; CREATE TEMPORARY TABLE tmp.zone ( @@ -76909,7 +77862,7 @@ BEGIN CALL vn.zone_getOptionsForShipment(vDated, TRUE); CALL vn.zone_getClosed(); - + SELECT zo.zoneFk, zo.`hour`etd, (zo.`hour` <= TIME(util.VN_NOW())) isLate, @@ -76919,11 +77872,11 @@ BEGIN FROM tmp.zoneOption zo JOIN vn.zone z ON z.id = zo.zoneFk JOIN vn.zoneWarehouse zw ON zw.zoneFk = z.id - LEFT JOIN tmp.closedZones cz - ON cz.warehouseFk = zw.warehouseFk + LEFT JOIN tmp.closedZones cz + ON cz.warehouseFk = zw.warehouseFk AND cz.zoneFk = zo.zoneFk; - - DROP TEMPORARY TABLE + + DROP TEMPORARY TABLE tmp.closedZones, tmp.zoneOption, tmp.zone; @@ -76934,8 +77887,6 @@ 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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `zone_getWarehouse` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -76943,27 +77894,29 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `zone_getWarehouse`(vAddress INT, vLanded DATE, vWarehouse INT) BEGIN /** * Devuelve el listado de agencias disponibles para la fecha, * dirección y almacén pasados. - * + * * @param vAddress * @param vWarehouse warehouse * @param vLanded Fecha de recogida * @select Listado de agencias disponibles */ - + CALL zone_getFromGeo(address_getGeo(vAddress)); CALL zone_getOptionsForLanding(vLanded, FALSE); - - SELECT am.id agencyModeFk, - am.name agencyMode, - am.description, + + SELECT am.id agencyModeFk, + am.name agencyMode, + am.description, am.deliveryMethodFk, - TIMESTAMPADD(DAY, -zo.travelingDays, vLanded) shipped, + TIMESTAMPADD(DAY, -zo.travelingDays, vLanded) shipped, zw.warehouseFk, z.id zoneFk FROM tmp.zoneOption zo @@ -76973,19 +77926,17 @@ BEGIN WHERE zw.warehouseFk = vWarehouse GROUP BY z.agencyModeFk ORDER BY agencyMode; - + DROP TEMPORARY TABLE tmp.zone, tmp.zoneOption; - + END ;; DELIMITER ; /*!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 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; /*!50003 DROP PROCEDURE IF EXISTS `zone_upcomingDeliveries` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -76993,12 +77944,14 @@ DELIMITER ; /*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `zone_upcomingDeliveries`() BEGIN DECLARE vForwardDays INT; - + SELECT forwardDays INTO vForwardDays FROM zoneConfig; CALL util.time_createTable(util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL vForwardDays DAY)); @@ -77014,7 +77967,7 @@ BEGIN JOIN zoneEvent e ON e.zoneFk = z.id JOIN tmp.time ti ON ti.dated BETWEEN util.VN_CURDATE() AND TIMESTAMPADD(DAY, vForwardDays, util.VN_CURDATE()); - DROP TEMPORARY TABLE IF EXISTS tmp.zoneOption; + DROP TEMPORARY TABLE IF EXISTS tmp.zoneOption; CREATE TEMPORARY TABLE tmp.zoneOption ENGINE = MEMORY SELECT * @@ -77055,7 +78008,7 @@ BEGIN JOIN zoneExclusion e ON e.zoneFk = t.zoneFk AND e.`dated` = t.landed LEFT JOIN zoneExclusionGeo eg ON eg.zoneExclusionFk = e.id WHERE eg.zoneExclusionFk IS NULL; - + SELECT MAX(zo.`hour`) `hour`, zg.`name`, zo.shipped, zo.zoneFk FROM tmp.zoneOption zo JOIN `zone` z ON z.id = zo.zoneFk @@ -77066,99 +78019,10 @@ BEGIN WHERE dm.code = 'DELIVERY' GROUP BY shipped, zg.`name` ORDER BY shipped, zg.`name`; - + DROP TEMPORARY TABLE tmp.time, tLandings; END ;; DELIMITER ; - - - -/*!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 */ ; - --- --- Current Database: `vncontrol` --- - -CREATE DATABASE /*!32312 IF NOT EXISTS*/ `vncontrol` /*!40100 DEFAULT CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci */; - -USE `vncontrol`; - --- --- Temporary table structure for view `accion` --- - -DROP TABLE IF EXISTS `accion`; -/*!50001 DROP VIEW IF EXISTS `accion`*/; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; -/*!50001 CREATE VIEW `accion` AS SELECT - 1 AS `accion_id`, - 1 AS `accion` */; -SET character_set_client = @saved_cs_client; - --- --- Table structure for table `fallo__` --- - -DROP TABLE IF EXISTS `fallo__`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `fallo__` ( - `queja_id` int(10) unsigned NOT NULL, - `accion_id` int(11) NOT NULL, - PRIMARY KEY (`queja_id`,`accion_id`), - KEY `accion` (`accion_id`,`queja_id`), - KEY `fallo` (`queja_id`), - CONSTRAINT `accion` FOREIGN KEY (`accion_id`) REFERENCES `vn`.`ticketTrackingState` (`id`) ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Temporary table structure for view `inter` --- - -DROP TABLE IF EXISTS `inter`; -/*!50001 DROP VIEW IF EXISTS `inter`*/; -SET @saved_cs_client = @@character_set_client; -SET character_set_client = utf8; -/*!50001 CREATE VIEW `inter` AS SELECT - 1 AS `inter_id`, - 1 AS `state_id`, - 1 AS `fallo_id`, - 1 AS `nota`, - 1 AS `odbc_date`, - 1 AS `Id_Ticket`, - 1 AS `Id_Trabajador`, - 1 AS `Id_Supervisor` */; -SET character_set_client = @saved_cs_client; - --- --- Dumping events for database 'vncontrol' --- - --- --- Dumping routines for database 'vncontrol' --- -/*!50003 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; -/*!50003 DROP PROCEDURE IF EXISTS `clean` */; -/*!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 = utf8mb4 */ ; -/*!50003 SET character_set_results = utf8mb4 */ ; -/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; -DELIMITER ;; -CREATE DEFINER=`root`@`localhost` PROCEDURE `clean`() -BEGIN - DECLARE vDate DATETIME DEFAULT TIMESTAMPADD(MONTH, -2, util.VN_CURDATE()); - DELETE i FROM inter i JOIN vn.ticket t ON i.Id_Ticket = t.id - WHERE t.shipped <= vDate; -END ;; -DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; /*!50003 SET character_set_client = @saved_cs_client */ ; /*!50003 SET character_set_results = @saved_cs_results */ ; @@ -77167,14 +78031,6 @@ DELIMITER ; -- -- Current Database: `account` -- --- Fix strucuture - -DROP TABLE IF EXISTS `vn`.`zipConfig`; -CREATE TABLE `vn`.`zipConfig` ( - `id` double(10,2) NOT NULL, - `maxSize` int(11) DEFAULT NULL COMMENT 'in MegaBytes', - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; USE `account`; @@ -77182,6 +78038,7 @@ USE `account`; -- Final view structure for view `accountDovecot` -- +/*!50001 DROP TABLE IF EXISTS `accountDovecot`*/; /*!50001 DROP VIEW IF EXISTS `accountDovecot`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -77200,6 +78057,7 @@ USE `account`; -- Final view structure for view `emailUser` -- +/*!50001 DROP TABLE IF EXISTS `emailUser`*/; /*!50001 DROP VIEW IF EXISTS `emailUser`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -77218,6 +78076,7 @@ USE `account`; -- Final view structure for view `myRole` -- +/*!50001 DROP TABLE IF EXISTS `myRole`*/; /*!50001 DROP VIEW IF EXISTS `myRole`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -77236,6 +78095,7 @@ USE `account`; -- Final view structure for view `myUser` -- +/*!50001 DROP TABLE IF EXISTS `myUser`*/; /*!50001 DROP VIEW IF EXISTS `myUser`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -77261,6 +78121,7 @@ USE `bs`; -- Final view structure for view `bajasLaborales` -- +/*!50001 DROP TABLE IF EXISTS `bajasLaborales`*/; /*!50001 DROP VIEW IF EXISTS `bajasLaborales`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -77279,6 +78140,7 @@ USE `bs`; -- Final view structure for view `lastIndicators` -- +/*!50001 DROP TABLE IF EXISTS `lastIndicators`*/; /*!50001 DROP VIEW IF EXISTS `lastIndicators`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -77297,6 +78159,7 @@ USE `bs`; -- Final view structure for view `packingSpeed` -- +/*!50001 DROP TABLE IF EXISTS `packingSpeed`*/; /*!50001 DROP VIEW IF EXISTS `packingSpeed`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -77315,6 +78178,7 @@ USE `bs`; -- Final view structure for view `s1_ticketDetail` -- +/*!50001 DROP TABLE IF EXISTS `s1_ticketDetail`*/; /*!50001 DROP VIEW IF EXISTS `s1_ticketDetail`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -77333,6 +78197,7 @@ USE `bs`; -- Final view structure for view `s21_saleDetail` -- +/*!50001 DROP TABLE IF EXISTS `s21_saleDetail`*/; /*!50001 DROP VIEW IF EXISTS `s21_saleDetail`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -77347,28 +78212,11 @@ USE `bs`; /*!50001 SET character_set_results = @saved_cs_results */; /*!50001 SET collation_connection = @saved_col_connection */; --- --- Final view structure for view `vendedores` --- - -/*!50001 DROP VIEW IF EXISTS `vendedores`*/; -/*!50001 SET @saved_cs_client = @@character_set_client */; -/*!50001 SET @saved_cs_results = @@character_set_results */; -/*!50001 SET @saved_col_connection = @@collation_connection */; -/*!50001 SET character_set_client = utf8mb4 */; -/*!50001 SET character_set_results = utf8mb4 */; -/*!50001 SET collation_connection = utf8mb4_general_ci */; -/*!50001 CREATE ALGORITHM=UNDEFINED */ -/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ -/*!50001 VIEW `vendedores` AS select `sp`.`workerFk` AS `Id_Trabajador`,`sp`.`year` AS `año`,`sp`.`month` AS `mes`,`sp`.`amount` AS `importe`,`sp`.`commission` AS `comision`,`sp`.`leasedCommission` AS `comisionArrendada`,`sp`.`cededCommission` AS `comisionCedida`,`sp`.`newCommission` AS `comisionNuevos`,`sp`.`leasedReplacement` AS `sustitucionArrendada`,`sp`.`itemTypeBorrowed` AS `itemTypeBorrowed`,`sp`.`portfolioWeight` AS `portfolioWeight`,`sp`.`updated` AS `updated` from `salesPerson` `sp` */; -/*!50001 SET character_set_client = @saved_cs_client */; -/*!50001 SET character_set_results = @saved_cs_results */; -/*!50001 SET collation_connection = @saved_col_connection */; - -- -- Final view structure for view `ventas` -- +/*!50001 DROP TABLE IF EXISTS `ventas`*/; /*!50001 DROP VIEW IF EXISTS `ventas`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -77399,6 +78247,7 @@ USE `edi`; -- Final view structure for view `ektRecent` -- +/*!50001 DROP TABLE IF EXISTS `ektRecent`*/; /*!50001 DROP VIEW IF EXISTS `ektRecent`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -77417,6 +78266,7 @@ USE `edi`; -- Final view structure for view `errorList` -- +/*!50001 DROP TABLE IF EXISTS `errorList`*/; /*!50001 DROP VIEW IF EXISTS `errorList`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -77435,6 +78285,7 @@ USE `edi`; -- Final view structure for view `supplyOffer` -- +/*!50001 DROP TABLE IF EXISTS `supplyOffer`*/; /*!50001 DROP VIEW IF EXISTS `supplyOffer`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -77459,6 +78310,7 @@ USE `hedera`; -- Final view structure for view `mainAccountBank` -- +/*!50001 DROP TABLE IF EXISTS `mainAccountBank`*/; /*!50001 DROP VIEW IF EXISTS `mainAccountBank`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -77477,6 +78329,7 @@ USE `hedera`; -- Final view structure for view `myAddress` -- +/*!50001 DROP TABLE IF EXISTS `myAddress`*/; /*!50001 DROP VIEW IF EXISTS `myAddress`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -77496,6 +78349,7 @@ USE `hedera`; -- Final view structure for view `myBasket` -- +/*!50001 DROP TABLE IF EXISTS `myBasket`*/; /*!50001 DROP VIEW IF EXISTS `myBasket`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -77515,6 +78369,7 @@ USE `hedera`; -- Final view structure for view `myBasketDefaults` -- +/*!50001 DROP TABLE IF EXISTS `myBasketDefaults`*/; /*!50001 DROP VIEW IF EXISTS `myBasketDefaults`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -77533,6 +78388,7 @@ USE `hedera`; -- Final view structure for view `myBasketItem` -- +/*!50001 DROP TABLE IF EXISTS `myBasketItem`*/; /*!50001 DROP VIEW IF EXISTS `myBasketItem`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -77552,6 +78408,7 @@ USE `hedera`; -- Final view structure for view `myClient` -- +/*!50001 DROP TABLE IF EXISTS `myClient`*/; /*!50001 DROP VIEW IF EXISTS `myClient`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -77571,6 +78428,7 @@ USE `hedera`; -- Final view structure for view `myInvoice` -- +/*!50001 DROP TABLE IF EXISTS `myInvoice`*/; /*!50001 DROP VIEW IF EXISTS `myInvoice`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -77589,6 +78447,7 @@ USE `hedera`; -- Final view structure for view `myMenu` -- +/*!50001 DROP TABLE IF EXISTS `myMenu`*/; /*!50001 DROP VIEW IF EXISTS `myMenu`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -77607,6 +78466,7 @@ USE `hedera`; -- Final view structure for view `myOrder` -- +/*!50001 DROP TABLE IF EXISTS `myOrder`*/; /*!50001 DROP VIEW IF EXISTS `myOrder`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -77625,6 +78485,7 @@ USE `hedera`; -- Final view structure for view `myOrderRow` -- +/*!50001 DROP TABLE IF EXISTS `myOrderRow`*/; /*!50001 DROP VIEW IF EXISTS `myOrderRow`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -77644,6 +78505,7 @@ USE `hedera`; -- Final view structure for view `myOrderTicket` -- +/*!50001 DROP TABLE IF EXISTS `myOrderTicket`*/; /*!50001 DROP VIEW IF EXISTS `myOrderTicket`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -77662,6 +78524,7 @@ USE `hedera`; -- Final view structure for view `myTicket` -- +/*!50001 DROP TABLE IF EXISTS `myTicket`*/; /*!50001 DROP VIEW IF EXISTS `myTicket`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -77680,6 +78543,7 @@ USE `hedera`; -- Final view structure for view `myTicketRow` -- +/*!50001 DROP TABLE IF EXISTS `myTicketRow`*/; /*!50001 DROP VIEW IF EXISTS `myTicketRow`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -77699,6 +78563,7 @@ USE `hedera`; -- Final view structure for view `myTicketService` -- +/*!50001 DROP TABLE IF EXISTS `myTicketService`*/; /*!50001 DROP VIEW IF EXISTS `myTicketService`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -77718,6 +78583,7 @@ USE `hedera`; -- Final view structure for view `myTicketState` -- +/*!50001 DROP TABLE IF EXISTS `myTicketState`*/; /*!50001 DROP VIEW IF EXISTS `myTicketState`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -77736,6 +78602,7 @@ USE `hedera`; -- Final view structure for view `myTpvTransaction` -- +/*!50001 DROP TABLE IF EXISTS `myTpvTransaction`*/; /*!50001 DROP VIEW IF EXISTS `myTpvTransaction`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -77750,11 +78617,11 @@ USE `hedera`; /*!50001 SET character_set_results = @saved_cs_results */; /*!50001 SET collation_connection = @saved_col_connection */; - -- -- Final view structure for view `orderTicket` -- +/*!50001 DROP TABLE IF EXISTS `orderTicket`*/; /*!50001 DROP VIEW IF EXISTS `orderTicket`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -77773,6 +78640,7 @@ USE `hedera`; -- Final view structure for view `order_component` -- +/*!50001 DROP TABLE IF EXISTS `order_component`*/; /*!50001 DROP VIEW IF EXISTS `order_component`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -77791,6 +78659,7 @@ USE `hedera`; -- Final view structure for view `order_row` -- +/*!50001 DROP TABLE IF EXISTS `order_row`*/; /*!50001 DROP VIEW IF EXISTS `order_row`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -77815,6 +78684,7 @@ USE `pbx`; -- Final view structure for view `cdrConf` -- +/*!50001 DROP TABLE IF EXISTS `cdrConf`*/; /*!50001 DROP VIEW IF EXISTS `cdrConf`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -77833,6 +78703,7 @@ USE `pbx`; -- Final view structure for view `followmeConf` -- +/*!50001 DROP TABLE IF EXISTS `followmeConf`*/; /*!50001 DROP VIEW IF EXISTS `followmeConf`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -77851,6 +78722,7 @@ USE `pbx`; -- Final view structure for view `followmeNumberConf` -- +/*!50001 DROP TABLE IF EXISTS `followmeNumberConf`*/; /*!50001 DROP VIEW IF EXISTS `followmeNumberConf`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -77869,6 +78741,7 @@ USE `pbx`; -- Final view structure for view `queueConf` -- +/*!50001 DROP TABLE IF EXISTS `queueConf`*/; /*!50001 DROP VIEW IF EXISTS `queueConf`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -77887,6 +78760,7 @@ USE `pbx`; -- Final view structure for view `queueMemberConf` -- +/*!50001 DROP TABLE IF EXISTS `queueMemberConf`*/; /*!50001 DROP VIEW IF EXISTS `queueMemberConf`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -77905,6 +78779,7 @@ USE `pbx`; -- Final view structure for view `sipConf` -- +/*!50001 DROP TABLE IF EXISTS `sipConf`*/; /*!50001 DROP VIEW IF EXISTS `sipConf`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -77929,6 +78804,7 @@ USE `postgresql`; -- Final view structure for view `calendar_employee` -- +/*!50001 DROP TABLE IF EXISTS `calendar_employee`*/; /*!50001 DROP VIEW IF EXISTS `calendar_employee`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -77953,6 +78829,7 @@ USE `sage`; -- Final view structure for view `clientLastTwoMonths` -- +/*!50001 DROP TABLE IF EXISTS `clientLastTwoMonths`*/; /*!50001 DROP VIEW IF EXISTS `clientLastTwoMonths`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -77971,6 +78848,7 @@ USE `sage`; -- Final view structure for view `invoiceInList` -- +/*!50001 DROP TABLE IF EXISTS `invoiceInList`*/; /*!50001 DROP VIEW IF EXISTS `invoiceInList`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -77989,6 +78867,7 @@ USE `sage`; -- Final view structure for view `supplierLastThreeMonths` -- +/*!50001 DROP TABLE IF EXISTS `supplierLastThreeMonths`*/; /*!50001 DROP VIEW IF EXISTS `supplierLastThreeMonths`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -78013,6 +78892,7 @@ USE `salix`; -- Final view structure for view `Account` -- +/*!50001 DROP TABLE IF EXISTS `Account`*/; /*!50001 DROP VIEW IF EXISTS `Account`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -78031,6 +78911,7 @@ USE `salix`; -- Final view structure for view `Role` -- +/*!50001 DROP TABLE IF EXISTS `Role`*/; /*!50001 DROP VIEW IF EXISTS `Role`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -78049,6 +78930,7 @@ USE `salix`; -- Final view structure for view `RoleMapping` -- +/*!50001 DROP TABLE IF EXISTS `RoleMapping`*/; /*!50001 DROP VIEW IF EXISTS `RoleMapping`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -78067,6 +78949,7 @@ USE `salix`; -- Final view structure for view `User` -- +/*!50001 DROP TABLE IF EXISTS `User`*/; /*!50001 DROP VIEW IF EXISTS `User`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -78097,6 +78980,7 @@ USE `util`; -- Final view structure for view `eventLogGrouped` -- +/*!50001 DROP TABLE IF EXISTS `eventLogGrouped`*/; /*!50001 DROP VIEW IF EXISTS `eventLogGrouped`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -78121,6 +79005,7 @@ USE `vn`; -- Final view structure for view `NewView` -- +/*!50001 DROP TABLE IF EXISTS `NewView`*/; /*!50001 DROP VIEW IF EXISTS `NewView`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -78139,6 +79024,7 @@ USE `vn`; -- Final view structure for view `__coolerPathDetail` -- +/*!50001 DROP TABLE IF EXISTS `__coolerPathDetail`*/; /*!50001 DROP VIEW IF EXISTS `__coolerPathDetail`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -78157,6 +79043,7 @@ USE `vn`; -- Final view structure for view `agencyTerm` -- +/*!50001 DROP TABLE IF EXISTS `agencyTerm`*/; /*!50001 DROP VIEW IF EXISTS `agencyTerm`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -78175,6 +79062,7 @@ USE `vn`; -- Final view structure for view `annualAverageInvoiced` -- +/*!50001 DROP TABLE IF EXISTS `annualAverageInvoiced`*/; /*!50001 DROP VIEW IF EXISTS `annualAverageInvoiced`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -78193,6 +79081,7 @@ USE `vn`; -- Final view structure for view `awbVolume` -- +/*!50001 DROP TABLE IF EXISTS `awbVolume`*/; /*!50001 DROP VIEW IF EXISTS `awbVolume`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -78211,6 +79100,7 @@ USE `vn`; -- Final view structure for view `bank` -- +/*!50001 DROP TABLE IF EXISTS `bank`*/; /*!50001 DROP VIEW IF EXISTS `bank`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -78229,6 +79119,7 @@ USE `vn`; -- Final view structure for view `bankPolicy` -- +/*!50001 DROP TABLE IF EXISTS `bankPolicy`*/; /*!50001 DROP VIEW IF EXISTS `bankPolicy`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -78247,6 +79138,7 @@ USE `vn`; -- Final view structure for view `businessCalendar` -- +/*!50001 DROP TABLE IF EXISTS `businessCalendar`*/; /*!50001 DROP VIEW IF EXISTS `businessCalendar`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -78265,6 +79157,7 @@ USE `vn`; -- Final view structure for view `buyer` -- +/*!50001 DROP TABLE IF EXISTS `buyer`*/; /*!50001 DROP VIEW IF EXISTS `buyer`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -78283,6 +79176,7 @@ USE `vn`; -- Final view structure for view `buyerSales` -- +/*!50001 DROP TABLE IF EXISTS `buyerSales`*/; /*!50001 DROP VIEW IF EXISTS `buyerSales`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -78301,6 +79195,7 @@ USE `vn`; -- Final view structure for view `clientLost` -- +/*!50001 DROP TABLE IF EXISTS `clientLost`*/; /*!50001 DROP VIEW IF EXISTS `clientLost`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -78319,6 +79214,7 @@ USE `vn`; -- Final view structure for view `clientPhoneBook` -- +/*!50001 DROP TABLE IF EXISTS `clientPhoneBook`*/; /*!50001 DROP VIEW IF EXISTS `clientPhoneBook`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -78337,6 +79233,7 @@ USE `vn`; -- Final view structure for view `cmr_list` -- +/*!50001 DROP TABLE IF EXISTS `cmr_list`*/; /*!50001 DROP VIEW IF EXISTS `cmr_list`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -78355,6 +79252,7 @@ USE `vn`; -- Final view structure for view `defaulter` -- +/*!50001 DROP TABLE IF EXISTS `defaulter`*/; /*!50001 DROP VIEW IF EXISTS `defaulter`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -78373,6 +79271,7 @@ USE `vn`; -- Final view structure for view `departmentTree` -- +/*!50001 DROP TABLE IF EXISTS `departmentTree`*/; /*!50001 DROP VIEW IF EXISTS `departmentTree`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -78391,6 +79290,7 @@ USE `vn`; -- Final view structure for view `ediGenus` -- +/*!50001 DROP TABLE IF EXISTS `ediGenus`*/; /*!50001 DROP VIEW IF EXISTS `ediGenus`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -78409,6 +79309,7 @@ USE `vn`; -- Final view structure for view `ediSpecie` -- +/*!50001 DROP TABLE IF EXISTS `ediSpecie`*/; /*!50001 DROP VIEW IF EXISTS `ediSpecie`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -78427,6 +79328,7 @@ USE `vn`; -- Final view structure for view `ektSubAddress` -- +/*!50001 DROP TABLE IF EXISTS `ektSubAddress`*/; /*!50001 DROP VIEW IF EXISTS `ektSubAddress`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -78445,6 +79347,7 @@ USE `vn`; -- Final view structure for view `exchangeInsuranceEntry` -- +/*!50001 DROP TABLE IF EXISTS `exchangeInsuranceEntry`*/; /*!50001 DROP VIEW IF EXISTS `exchangeInsuranceEntry`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -78463,6 +79366,7 @@ USE `vn`; -- Final view structure for view `exchangeInsuranceIn` -- +/*!50001 DROP TABLE IF EXISTS `exchangeInsuranceIn`*/; /*!50001 DROP VIEW IF EXISTS `exchangeInsuranceIn`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -78481,6 +79385,7 @@ USE `vn`; -- Final view structure for view `exchangeInsuranceOut` -- +/*!50001 DROP TABLE IF EXISTS `exchangeInsuranceOut`*/; /*!50001 DROP VIEW IF EXISTS `exchangeInsuranceOut`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -78499,6 +79404,7 @@ USE `vn`; -- Final view structure for view `exchangeReportSourcePrevious` -- +/*!50001 DROP TABLE IF EXISTS `exchangeReportSourcePrevious`*/; /*!50001 DROP VIEW IF EXISTS `exchangeReportSourcePrevious`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -78517,6 +79423,7 @@ USE `vn`; -- Final view structure for view `expeditionCommon` -- +/*!50001 DROP TABLE IF EXISTS `expeditionCommon`*/; /*!50001 DROP VIEW IF EXISTS `expeditionCommon`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -78535,6 +79442,7 @@ USE `vn`; -- Final view structure for view `expeditionPallet_Print` -- +/*!50001 DROP TABLE IF EXISTS `expeditionPallet_Print`*/; /*!50001 DROP VIEW IF EXISTS `expeditionPallet_Print`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -78553,6 +79461,7 @@ USE `vn`; -- Final view structure for view `expeditionRoute_Monitor` -- +/*!50001 DROP TABLE IF EXISTS `expeditionRoute_Monitor`*/; /*!50001 DROP VIEW IF EXISTS `expeditionRoute_Monitor`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -78571,6 +79480,7 @@ USE `vn`; -- Final view structure for view `expeditionRoute_freeTickets` -- +/*!50001 DROP TABLE IF EXISTS `expeditionRoute_freeTickets`*/; /*!50001 DROP VIEW IF EXISTS `expeditionRoute_freeTickets`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -78580,7 +79490,7 @@ USE `vn`; /*!50001 SET collation_connection = utf8mb4_unicode_ci */; /*!50001 CREATE ALGORITHM=UNDEFINED */ /*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ -/*!50001 VIEW `expeditionRoute_freeTickets` AS select `t`.`routeFk` AS `routeFk`,`tss`.`ticket` AS `ticket`,`s`.`name` AS `code`,`w`.`name` AS `almacen`,`tss`.`updated` AS `updated`,`p`.`code` AS `parkingCode` from (((((`vn`.`ticketState` `tss` join `vn`.`ticket` `t` on(`t`.`id` = `tss`.`ticket`)) join `vn`.`warehouse` `w` on(`w`.`id` = `t`.`warehouseFk`)) join `vn`.`state` `s` on(`s`.`id` = `tss`.`state`)) left join `vn`.`ticketParking` `tp` on(`tp`.`ticketFk` = `t`.`id`)) left join `vn`.`parking` `p` on(`p`.`id` = `tp`.`parkingFk`)) where ifnull(`t`.`packages`,0) = 0 */; +/*!50001 VIEW `expeditionRoute_freeTickets` AS select `t`.`routeFk` AS `routeFk`,`tss`.`ticket` AS `ticket`,`s`.`name` AS `code`,`w`.`name` AS `almacen`,`tss`.`updated` AS `updated`,`p`.`code` AS `parkingCode` from (((((`ticketState` `tss` join `ticket` `t` on(`t`.`id` = `tss`.`ticket`)) join `warehouse` `w` on(`w`.`id` = `t`.`warehouseFk`)) join `state` `s` on(`s`.`id` = `tss`.`state`)) left join `ticketParking` `tp` on(`tp`.`ticketFk` = `t`.`id`)) left join `parking` `p` on(`p`.`id` = `tp`.`parkingFk`)) where ifnull(`t`.`packages`,0) = 0 */; /*!50001 SET character_set_client = @saved_cs_client */; /*!50001 SET character_set_results = @saved_cs_results */; /*!50001 SET collation_connection = @saved_col_connection */; @@ -78589,6 +79499,7 @@ USE `vn`; -- Final view structure for view `expeditionScan_Monitor` -- +/*!50001 DROP TABLE IF EXISTS `expeditionScan_Monitor`*/; /*!50001 DROP VIEW IF EXISTS `expeditionScan_Monitor`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -78607,6 +79518,7 @@ USE `vn`; -- Final view structure for view `expeditionSticker` -- +/*!50001 DROP TABLE IF EXISTS `expeditionSticker`*/; /*!50001 DROP VIEW IF EXISTS `expeditionSticker`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -78625,6 +79537,7 @@ USE `vn`; -- Final view structure for view `expeditionTicket_NoBoxes` -- +/*!50001 DROP TABLE IF EXISTS `expeditionTicket_NoBoxes`*/; /*!50001 DROP VIEW IF EXISTS `expeditionTicket_NoBoxes`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -78643,6 +79556,7 @@ USE `vn`; -- Final view structure for view `expeditionTimeExpended` -- +/*!50001 DROP TABLE IF EXISTS `expeditionTimeExpended`*/; /*!50001 DROP VIEW IF EXISTS `expeditionTimeExpended`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -78661,6 +79575,7 @@ USE `vn`; -- Final view structure for view `expeditionTruck_Control` -- +/*!50001 DROP TABLE IF EXISTS `expeditionTruck_Control`*/; /*!50001 DROP VIEW IF EXISTS `expeditionTruck_Control`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -78679,6 +79594,7 @@ USE `vn`; -- Final view structure for view `expeditionTruck_Control_Detail` -- +/*!50001 DROP TABLE IF EXISTS `expeditionTruck_Control_Detail`*/; /*!50001 DROP VIEW IF EXISTS `expeditionTruck_Control_Detail`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -78697,6 +79613,7 @@ USE `vn`; -- Final view structure for view `expeditionTruck_Control_Detail_Pallet` -- +/*!50001 DROP TABLE IF EXISTS `expeditionTruck_Control_Detail_Pallet`*/; /*!50001 DROP VIEW IF EXISTS `expeditionTruck_Control_Detail_Pallet`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -78715,6 +79632,7 @@ USE `vn`; -- Final view structure for view `firstTicketShipped` -- +/*!50001 DROP TABLE IF EXISTS `firstTicketShipped`*/; /*!50001 DROP VIEW IF EXISTS `firstTicketShipped`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -78733,6 +79651,7 @@ USE `vn`; -- Final view structure for view `floraHollandBuyedItems` -- +/*!50001 DROP TABLE IF EXISTS `floraHollandBuyedItems`*/; /*!50001 DROP VIEW IF EXISTS `floraHollandBuyedItems`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -78751,6 +79670,7 @@ USE `vn`; -- Final view structure for view `inkL10n` -- +/*!50001 DROP TABLE IF EXISTS `inkL10n`*/; /*!50001 DROP VIEW IF EXISTS `inkL10n`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -78769,6 +79689,7 @@ USE `vn`; -- Final view structure for view `invoiceCorrectionDataSource` -- +/*!50001 DROP TABLE IF EXISTS `invoiceCorrectionDataSource`*/; /*!50001 DROP VIEW IF EXISTS `invoiceCorrectionDataSource`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -78787,6 +79708,7 @@ USE `vn`; -- Final view structure for view `itemBotanicalWithGenus` -- +/*!50001 DROP TABLE IF EXISTS `itemBotanicalWithGenus`*/; /*!50001 DROP VIEW IF EXISTS `itemBotanicalWithGenus`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -78805,6 +79727,7 @@ USE `vn`; -- Final view structure for view `itemCategoryL10n` -- +/*!50001 DROP TABLE IF EXISTS `itemCategoryL10n`*/; /*!50001 DROP VIEW IF EXISTS `itemCategoryL10n`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -78823,6 +79746,7 @@ USE `vn`; -- Final view structure for view `itemColor` -- +/*!50001 DROP TABLE IF EXISTS `itemColor`*/; /*!50001 DROP VIEW IF EXISTS `itemColor`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -78841,6 +79765,7 @@ USE `vn`; -- Final view structure for view `itemEntryIn` -- +/*!50001 DROP TABLE IF EXISTS `itemEntryIn`*/; /*!50001 DROP VIEW IF EXISTS `itemEntryIn`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -78859,6 +79784,7 @@ USE `vn`; -- Final view structure for view `itemEntryOut` -- +/*!50001 DROP TABLE IF EXISTS `itemEntryOut`*/; /*!50001 DROP VIEW IF EXISTS `itemEntryOut`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -78877,6 +79803,7 @@ USE `vn`; -- Final view structure for view `itemInk` -- +/*!50001 DROP TABLE IF EXISTS `itemInk`*/; /*!50001 DROP VIEW IF EXISTS `itemInk`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -78895,6 +79822,7 @@ USE `vn`; -- Final view structure for view `itemPlacementSupplyList` -- +/*!50001 DROP TABLE IF EXISTS `itemPlacementSupplyList`*/; /*!50001 DROP VIEW IF EXISTS `itemPlacementSupplyList`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -78913,6 +79841,7 @@ USE `vn`; -- Final view structure for view `itemProductor` -- +/*!50001 DROP TABLE IF EXISTS `itemProductor`*/; /*!50001 DROP VIEW IF EXISTS `itemProductor`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -78931,6 +79860,7 @@ USE `vn`; -- Final view structure for view `itemSearch` -- +/*!50001 DROP TABLE IF EXISTS `itemSearch`*/; /*!50001 DROP VIEW IF EXISTS `itemSearch`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -78949,6 +79879,7 @@ USE `vn`; -- Final view structure for view `itemShelvingAvailable` -- +/*!50001 DROP TABLE IF EXISTS `itemShelvingAvailable`*/; /*!50001 DROP VIEW IF EXISTS `itemShelvingAvailable`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -78958,7 +79889,7 @@ USE `vn`; /*!50001 SET collation_connection = utf8mb4_unicode_ci */; /*!50001 CREATE ALGORITHM=UNDEFINED */ /*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ -/*!50001 VIEW `itemShelvingAvailable` AS select `s`.`id` AS `saleFk`,`tst`.`updated` AS `Modificado`,`s`.`ticketFk` AS `ticketFk`,0 AS `isPicked`,`s`.`itemFk` AS `itemFk`,`s`.`quantity` AS `quantity`,`s`.`concept` AS `concept`,`i`.`size` AS `size`,`st`.`name` AS `Estado`,`st`.`sectorProdPriority` AS `sectorProdPriority`,`stock`.`visible` AS `available`,`stock`.`sectorFk` AS `sectorFk`,`stock`.`shelvingFk` AS `matricula`,`stock`.`parkingFk` AS `parking`,`stock`.`itemShelvingFk` AS `itemShelving`,`am`.`name` AS `Agency`,`t`.`shipped` AS `shipped`,`stock`.`grouping` AS `grouping`,`stock`.`packing` AS `packing`,`z`.`hour` AS `hour`,`st`.`isPreviousPreparable` AS `isPreviousPreparable`,`sv`.`physicalVolume` AS `physicalVolume`,`t`.`warehouseFk` AS `warehouseFk` from (((((((((`vn`.`sale` `s` join `vn`.`ticket` `t` on(`t`.`id` = `s`.`ticketFk`)) join `vn`.`agencyMode` `am` on(`am`.`id` = `t`.`agencyModeFk`)) join `vn`.`ticketStateToday` `tst` on(`tst`.`ticket` = `t`.`id`)) join `vn`.`state` `st` on(`st`.`id` = `tst`.`state`)) join `vn`.`item` `i` on(`i`.`id` = `s`.`itemFk`)) join `vn`.`itemShelvingStock` `stock` on(`stock`.`itemFk` = `i`.`id`)) left join `vn`.`saleTracking` `stk` on(`stk`.`saleFk` = `s`.`id`)) left join `vn`.`zone` `z` on(`z`.`id` = `t`.`zoneFk`)) left join `vn`.`saleVolume` `sv` on(`sv`.`saleFk` = `s`.`id`)) where `t`.`shipped` between `util`.`yesterday`() and `util`.`dayend`(util.VN_CURDATE()) and `stk`.`id` is null and `stock`.`visible` > 0 and `stk`.`saleFk` is null and `st`.`isPreviousPreparable` <> 0 */; +/*!50001 VIEW `itemShelvingAvailable` AS select `s`.`id` AS `saleFk`,`tst`.`updated` AS `Modificado`,`s`.`ticketFk` AS `ticketFk`,0 AS `isPicked`,`s`.`itemFk` AS `itemFk`,`s`.`quantity` AS `quantity`,`s`.`concept` AS `concept`,`i`.`size` AS `size`,`st`.`name` AS `Estado`,`st`.`sectorProdPriority` AS `sectorProdPriority`,`stock`.`visible` AS `available`,`stock`.`sectorFk` AS `sectorFk`,`stock`.`shelvingFk` AS `matricula`,`stock`.`parkingFk` AS `parking`,`stock`.`itemShelvingFk` AS `itemShelving`,`am`.`name` AS `Agency`,`t`.`shipped` AS `shipped`,`stock`.`grouping` AS `grouping`,`stock`.`packing` AS `packing`,`z`.`hour` AS `hour`,`st`.`isPreviousPreparable` AS `isPreviousPreparable`,`sv`.`physicalVolume` AS `physicalVolume`,`t`.`warehouseFk` AS `warehouseFk` from (((((((((`sale` `s` join `ticket` `t` on(`t`.`id` = `s`.`ticketFk`)) join `agencyMode` `am` on(`am`.`id` = `t`.`agencyModeFk`)) join `ticketStateToday` `tst` on(`tst`.`ticket` = `t`.`id`)) join `state` `st` on(`st`.`id` = `tst`.`state`)) join `item` `i` on(`i`.`id` = `s`.`itemFk`)) join `itemShelvingStock` `stock` on(`stock`.`itemFk` = `i`.`id`)) left join `saleTracking` `stk` on(`stk`.`saleFk` = `s`.`id`)) left join `zone` `z` on(`z`.`id` = `t`.`zoneFk`)) left join `saleVolume` `sv` on(`sv`.`saleFk` = `s`.`id`)) where `t`.`shipped` between `util`.`yesterday`() and `util`.`dayend`(util.VN_CURDATE()) and `stk`.`id` is null and `stock`.`visible` > 0 and `stk`.`saleFk` is null and `st`.`isPreviousPreparable` <> 0 */; /*!50001 SET character_set_client = @saved_cs_client */; /*!50001 SET character_set_results = @saved_cs_results */; /*!50001 SET collation_connection = @saved_col_connection */; @@ -78967,6 +79898,7 @@ USE `vn`; -- Final view structure for view `itemShelvingList` -- +/*!50001 DROP TABLE IF EXISTS `itemShelvingList`*/; /*!50001 DROP VIEW IF EXISTS `itemShelvingList`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -78985,6 +79917,7 @@ USE `vn`; -- Final view structure for view `itemShelvingPlacementSupplyStock` -- +/*!50001 DROP TABLE IF EXISTS `itemShelvingPlacementSupplyStock`*/; /*!50001 DROP VIEW IF EXISTS `itemShelvingPlacementSupplyStock`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -79003,6 +79936,7 @@ USE `vn`; -- Final view structure for view `itemShelvingSaleSum` -- +/*!50001 DROP TABLE IF EXISTS `itemShelvingSaleSum`*/; /*!50001 DROP VIEW IF EXISTS `itemShelvingSaleSum`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -79021,6 +79955,7 @@ USE `vn`; -- Final view structure for view `itemShelvingStock` -- +/*!50001 DROP TABLE IF EXISTS `itemShelvingStock`*/; /*!50001 DROP VIEW IF EXISTS `itemShelvingStock`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -79039,6 +79974,7 @@ USE `vn`; -- Final view structure for view `itemShelvingStockFull` -- +/*!50001 DROP TABLE IF EXISTS `itemShelvingStockFull`*/; /*!50001 DROP VIEW IF EXISTS `itemShelvingStockFull`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -79057,6 +79993,7 @@ USE `vn`; -- Final view structure for view `itemShelvingStockRemoved` -- +/*!50001 DROP TABLE IF EXISTS `itemShelvingStockRemoved`*/; /*!50001 DROP VIEW IF EXISTS `itemShelvingStockRemoved`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -79075,6 +80012,7 @@ USE `vn`; -- Final view structure for view `itemShelvingStock_byWarehouse` -- +/*!50001 DROP TABLE IF EXISTS `itemShelvingStock_byWarehouse`*/; /*!50001 DROP VIEW IF EXISTS `itemShelvingStock_byWarehouse`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -79093,6 +80031,7 @@ USE `vn`; -- Final view structure for view `itemTagged` -- +/*!50001 DROP TABLE IF EXISTS `itemTagged`*/; /*!50001 DROP VIEW IF EXISTS `itemTagged`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -79111,6 +80050,7 @@ USE `vn`; -- Final view structure for view `itemTicketOut` -- +/*!50001 DROP TABLE IF EXISTS `itemTicketOut`*/; /*!50001 DROP VIEW IF EXISTS `itemTicketOut`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -79129,6 +80069,7 @@ USE `vn`; -- Final view structure for view `itemTypeL10n` -- +/*!50001 DROP TABLE IF EXISTS `itemTypeL10n`*/; /*!50001 DROP VIEW IF EXISTS `itemTypeL10n`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -79147,6 +80088,7 @@ USE `vn`; -- Final view structure for view `item_Free_Id` -- +/*!50001 DROP TABLE IF EXISTS `item_Free_Id`*/; /*!50001 DROP VIEW IF EXISTS `item_Free_Id`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -79165,6 +80107,7 @@ USE `vn`; -- Final view structure for view `labelInfo` -- +/*!50001 DROP TABLE IF EXISTS `labelInfo`*/; /*!50001 DROP VIEW IF EXISTS `labelInfo`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -79183,6 +80126,7 @@ USE `vn`; -- Final view structure for view `lastHourProduction` -- +/*!50001 DROP TABLE IF EXISTS `lastHourProduction`*/; /*!50001 DROP VIEW IF EXISTS `lastHourProduction`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -79201,6 +80145,7 @@ USE `vn`; -- Final view structure for view `lastPurchases` -- +/*!50001 DROP TABLE IF EXISTS `lastPurchases`*/; /*!50001 DROP VIEW IF EXISTS `lastPurchases`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -79210,7 +80155,7 @@ USE `vn`; /*!50001 SET collation_connection = utf8mb4_unicode_ci */; /*!50001 CREATE ALGORITHM=UNDEFINED */ /*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ -/*!50001 VIEW `lastPurchases` AS select `tr`.`landed` AS `landed`,`w`.`id` AS `warehouseFk`,`w`.`name` AS `warehouse`,`i`.`longName` AS `longName`,`i`.`subName` AS `subName`,`e`.`id` AS `entryFk`,`b`.`stickers` AS `stickers`,`b`.`packing` AS `packing`,`e`.`ref` AS `ref`,`b`.`itemFk` AS `itemFk`,`ek`.`pro` AS `pro`,`ek`.`ref` AS `ektRef`,`ek`.`agj` AS `agj` from (((((`vn`.`buy` `b` join `vn`.`entry` `e` on(`e`.`id` = `b`.`entryFk`)) join `vn`.`item` `i` on(`i`.`id` = `b`.`itemFk`)) join `vn`.`travel` `tr` on(`tr`.`id` = `e`.`travelFk`)) join `vn`.`warehouse` `w` on(`w`.`id` = `tr`.`warehouseInFk`)) left join `edi`.`ekt` `ek` on(`ek`.`id` = `b`.`ektFk`)) where `tr`.`landed` between `util`.`yesterday`() and `util`.`tomorrow`() and `e`.`isRaid` = 0 and `b`.`stickers` > 0 */; +/*!50001 VIEW `lastPurchases` AS select `tr`.`landed` AS `landed`,`w`.`id` AS `warehouseFk`,`w`.`name` AS `warehouse`,`i`.`longName` AS `longName`,`i`.`subName` AS `subName`,`e`.`id` AS `entryFk`,`b`.`stickers` AS `stickers`,`b`.`packing` AS `packing`,`e`.`invoiceNumber` AS `ref`,`b`.`itemFk` AS `itemFk`,`ek`.`pro` AS `pro`,`ek`.`ref` AS `ektRef`,`ek`.`agj` AS `agj` from (((((`vn`.`buy` `b` join `vn`.`entry` `e` on(`e`.`id` = `b`.`entryFk`)) join `vn`.`item` `i` on(`i`.`id` = `b`.`itemFk`)) join `vn`.`travel` `tr` on(`tr`.`id` = `e`.`travelFk`)) join `vn`.`warehouse` `w` on(`w`.`id` = `tr`.`warehouseInFk`)) left join `edi`.`ekt` `ek` on(`ek`.`id` = `b`.`ektFk`)) where `tr`.`landed` between `util`.`yesterday`() and `util`.`tomorrow`() and `e`.`isRaid` = 0 and `b`.`stickers` > 0 */; /*!50001 SET character_set_client = @saved_cs_client */; /*!50001 SET character_set_results = @saved_cs_results */; /*!50001 SET collation_connection = @saved_col_connection */; @@ -79219,6 +80164,7 @@ USE `vn`; -- Final view structure for view `lastTopClaims` -- +/*!50001 DROP TABLE IF EXISTS `lastTopClaims`*/; /*!50001 DROP VIEW IF EXISTS `lastTopClaims`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -79237,6 +80183,7 @@ USE `vn`; -- Final view structure for view `mistake` -- +/*!50001 DROP TABLE IF EXISTS `mistake`*/; /*!50001 DROP VIEW IF EXISTS `mistake`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -79255,6 +80202,7 @@ USE `vn`; -- Final view structure for view `mistakeRatio` -- +/*!50001 DROP TABLE IF EXISTS `mistakeRatio`*/; /*!50001 DROP VIEW IF EXISTS `mistakeRatio`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -79273,6 +80221,7 @@ USE `vn`; -- Final view structure for view `newBornSales` -- +/*!50001 DROP TABLE IF EXISTS `newBornSales`*/; /*!50001 DROP VIEW IF EXISTS `newBornSales`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -79291,6 +80240,7 @@ USE `vn`; -- Final view structure for view `operatorWorkerCode` -- +/*!50001 DROP TABLE IF EXISTS `operatorWorkerCode`*/; /*!50001 DROP VIEW IF EXISTS `operatorWorkerCode`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -79309,6 +80259,7 @@ USE `vn`; -- Final view structure for view `originL10n` -- +/*!50001 DROP TABLE IF EXISTS `originL10n`*/; /*!50001 DROP VIEW IF EXISTS `originL10n`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -79327,6 +80278,7 @@ USE `vn`; -- Final view structure for view `packageEquivalentItem` -- +/*!50001 DROP TABLE IF EXISTS `packageEquivalentItem`*/; /*!50001 DROP VIEW IF EXISTS `packageEquivalentItem`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -79345,6 +80297,7 @@ USE `vn`; -- Final view structure for view `personMedia` -- +/*!50001 DROP TABLE IF EXISTS `personMedia`*/; /*!50001 DROP VIEW IF EXISTS `personMedia`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -79363,6 +80316,7 @@ USE `vn`; -- Final view structure for view `phoneBook` -- +/*!50001 DROP TABLE IF EXISTS `phoneBook`*/; /*!50001 DROP VIEW IF EXISTS `phoneBook`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -79381,6 +80335,7 @@ USE `vn`; -- Final view structure for view `productionVolume` -- +/*!50001 DROP TABLE IF EXISTS `productionVolume`*/; /*!50001 DROP VIEW IF EXISTS `productionVolume`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -79399,6 +80354,7 @@ USE `vn`; -- Final view structure for view `productionVolume_LastHour` -- +/*!50001 DROP TABLE IF EXISTS `productionVolume_LastHour`*/; /*!50001 DROP VIEW IF EXISTS `productionVolume_LastHour`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -79417,6 +80373,7 @@ USE `vn`; -- Final view structure for view `role` -- +/*!50001 DROP TABLE IF EXISTS `role`*/; /*!50001 DROP VIEW IF EXISTS `role`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -79435,6 +80392,7 @@ USE `vn`; -- Final view structure for view `routesReduced` -- +/*!50001 DROP TABLE IF EXISTS `routesReduced`*/; /*!50001 DROP VIEW IF EXISTS `routesReduced`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -79444,7 +80402,7 @@ USE `vn`; /*!50001 SET collation_connection = utf8mb4_unicode_ci */; /*!50001 CREATE ALGORITHM=UNDEFINED */ /*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ -/*!50001 VIEW `routesReduced` AS select `et`.`description` AS `description`,`rm`.`name` AS `name`,`t`.`routeFk` AS `routeFk`,`et`.`ETD` AS `ETD`,`rm`.`bufferFk` AS `bufferFk`,`rm`.`beachFk` AS `beachFk`,`i`.`itemPackingTypeFk` AS `itempackingTypeFk` from (((((((`vn`.`expeditionTruck` `et` join `vn`.`routesMonitor` `rm` on(`rm`.`expeditionTruckFk` = `et`.`id`)) join `vn`.`ticket` `t` on(`t`.`routeFk` = `rm`.`routeFk`)) join `vn`.`ticketState` `ts` on(`ts`.`ticketFk` = `t`.`id`)) join `vn`.`state` `st` on(`st`.`id` = `ts`.`stateFk`)) join `vn`.`sale` `s` on(`s`.`ticketFk` = `t`.`id`)) join `vn`.`item` `i` on(`i`.`id` = `s`.`itemFk`)) join `vn`.`config` `c`) where `et`.`ETD` > `util`.`yesterday`() group by `t`.`routeFk` order by `et`.`ETD`,`t`.`routeFk` */; +/*!50001 VIEW `routesReduced` AS select `et`.`description` AS `description`,`rm`.`name` AS `name`,`t`.`routeFk` AS `routeFk`,`et`.`ETD` AS `ETD`,`rm`.`bufferFk` AS `bufferFk`,`rm`.`beachFk` AS `beachFk`,`i`.`itemPackingTypeFk` AS `itempackingTypeFk` from (((((((`expeditionTruck` `et` join `routesMonitor` `rm` on(`rm`.`expeditionTruckFk` = `et`.`id`)) join `ticket` `t` on(`t`.`routeFk` = `rm`.`routeFk`)) join `ticketState` `ts` on(`ts`.`ticketFk` = `t`.`id`)) join `state` `st` on(`st`.`id` = `ts`.`stateFk`)) join `sale` `s` on(`s`.`ticketFk` = `t`.`id`)) join `item` `i` on(`i`.`id` = `s`.`itemFk`)) join `config` `c`) where `et`.`ETD` > `util`.`yesterday`() group by `t`.`routeFk` order by `et`.`ETD`,`t`.`routeFk` */; /*!50001 SET character_set_client = @saved_cs_client */; /*!50001 SET character_set_results = @saved_cs_results */; /*!50001 SET collation_connection = @saved_col_connection */; @@ -79453,6 +80411,7 @@ USE `vn`; -- Final view structure for view `saleCost` -- +/*!50001 DROP TABLE IF EXISTS `saleCost`*/; /*!50001 DROP VIEW IF EXISTS `saleCost`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -79471,6 +80430,7 @@ USE `vn`; -- Final view structure for view `saleLabel` -- +/*!50001 DROP TABLE IF EXISTS `saleLabel`*/; /*!50001 DROP VIEW IF EXISTS `saleLabel`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -79489,6 +80449,7 @@ USE `vn`; -- Final view structure for view `saleMistakeList` -- +/*!50001 DROP TABLE IF EXISTS `saleMistakeList`*/; /*!50001 DROP VIEW IF EXISTS `saleMistakeList`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -79498,7 +80459,7 @@ USE `vn`; /*!50001 SET collation_connection = utf8mb4_unicode_ci */; /*!50001 CREATE ALGORITHM=UNDEFINED */ /*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ -/*!50001 VIEW `saleMistakeList` AS select `st`.`saleFk` AS `saleFk`,`st`.`workerFk` AS `workerFk`,concat(`w2`.`firstName`,' ',`w2`.`lastName`) AS `sacador`,`st`.`created` AS `created`,concat(`w`.`firstName`,' ',`w`.`lastName`) AS `revisador`,`mt`.`description` AS `description`,`sm`.`created` AS `controlled` from (((((`vn`.`saleTracking` `st` join `vn`.`worker` `w2` on(`w2`.`id` = `st`.`workerFk`)) join `vncontrol`.`accion` `a` on(`a`.`accion_id` = `st`.`actionFk` and `a`.`accion` = 'SACAR')) left join `vn`.`saleMistake` `sm` on(`st`.`saleFk` = `sm`.`saleFk`)) left join `vn`.`mistakeType` `mt` on(`mt`.`id` = `sm`.`typeFk`)) left join `vn`.`worker` `w` on(`w`.`id` = `sm`.`userFk`)) */; +/*!50001 VIEW `saleMistakeList` AS select `st`.`saleFk` AS `saleFk`,`st`.`workerFk` AS `workerFk`,concat(`w2`.`firstName`,' ',`w2`.`lastName`) AS `sacador`,`st`.`created` AS `created`,concat(`w`.`firstName`,' ',`w`.`lastName`) AS `revisador`,`mt`.`description` AS `description`,`sm`.`created` AS `controlled` from (((((`saleTracking` `st` join `worker` `w2` on(`w2`.`id` = `st`.`workerFk`)) join `state` `s` on(`s`.`id` = `st`.`stateFk` and `s`.`code` in ('PREVIOUS_PREPARATION','PREPARED','OK'))) left join `saleMistake` `sm` on(`st`.`saleFk` = `sm`.`saleFk`)) left join `mistakeType` `mt` on(`mt`.`id` = `sm`.`typeFk`)) left join `worker` `w` on(`w`.`id` = `sm`.`userFk`)) */; /*!50001 SET character_set_client = @saved_cs_client */; /*!50001 SET character_set_results = @saved_cs_results */; /*!50001 SET collation_connection = @saved_col_connection */; @@ -79507,6 +80468,7 @@ USE `vn`; -- Final view structure for view `saleMistake_list__2` -- +/*!50001 DROP TABLE IF EXISTS `saleMistake_list__2`*/; /*!50001 DROP VIEW IF EXISTS `saleMistake_list__2`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -79516,7 +80478,7 @@ USE `vn`; /*!50001 SET collation_connection = utf8mb4_unicode_ci */; /*!50001 CREATE ALGORITHM=UNDEFINED */ /*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ -/*!50001 VIEW `saleMistake_list__2` AS select `st`.`saleFk` AS `saleFk`,`st`.`workerFk` AS `workerFk`,concat(`w2`.`firstName`,' ',`w2`.`lastName`) AS `sacador`,`st`.`created` AS `created`,concat(`w`.`firstName`,' ',`w`.`lastName`) AS `revisador`,`mt`.`description` AS `description`,`sm`.`created` AS `controlled` from (((((`vn`.`saleTracking` `st` join `vn`.`worker` `w2` on(`w2`.`id` = `st`.`workerFk`)) join `vncontrol`.`accion` `a` on(`a`.`accion_id` = `st`.`actionFk` and `a`.`accion` = 'SACAR')) left join `vn`.`saleMistake` `sm` on(`st`.`saleFk` = `sm`.`saleFk`)) left join `vn`.`mistakeType` `mt` on(`mt`.`id` = `sm`.`typeFk`)) left join `vn`.`worker` `w` on(`w`.`id` = `sm`.`userFk`)) */; +/*!50001 VIEW `saleMistake_list__2` AS select `st`.`saleFk` AS `saleFk`,`st`.`workerFk` AS `workerFk`,concat(`w2`.`firstName`,' ',`w2`.`lastName`) AS `sacador`,`st`.`created` AS `created`,concat(`w`.`firstName`,' ',`w`.`lastName`) AS `revisador`,`mt`.`description` AS `description`,`sm`.`created` AS `controlled` from (((((`saleTracking` `st` join `worker` `w2` on(`w2`.`id` = `st`.`workerFk`)) join `state` `s` on(`s`.`id` = `st`.`stateFk` and `s`.`code` in ('PREVIOUS_PREPARATION','PREPARED','OK'))) left join `saleMistake` `sm` on(`st`.`saleFk` = `sm`.`saleFk`)) left join `mistakeType` `mt` on(`mt`.`id` = `sm`.`typeFk`)) left join `worker` `w` on(`w`.`id` = `sm`.`userFk`)) */; /*!50001 SET character_set_client = @saved_cs_client */; /*!50001 SET character_set_results = @saved_cs_results */; /*!50001 SET collation_connection = @saved_col_connection */; @@ -79525,6 +80487,7 @@ USE `vn`; -- Final view structure for view `saleSaleTracking` -- +/*!50001 DROP TABLE IF EXISTS `saleSaleTracking`*/; /*!50001 DROP VIEW IF EXISTS `saleSaleTracking`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -79543,6 +80506,7 @@ USE `vn`; -- Final view structure for view `saleValue` -- +/*!50001 DROP TABLE IF EXISTS `saleValue`*/; /*!50001 DROP VIEW IF EXISTS `saleValue`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -79561,6 +80525,7 @@ USE `vn`; -- Final view structure for view `saleVolume` -- +/*!50001 DROP TABLE IF EXISTS `saleVolume`*/; /*!50001 DROP VIEW IF EXISTS `saleVolume`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -79579,6 +80544,7 @@ USE `vn`; -- Final view structure for view `saleVolume_Today_VNH` -- +/*!50001 DROP TABLE IF EXISTS `saleVolume_Today_VNH`*/; /*!50001 DROP VIEW IF EXISTS `saleVolume_Today_VNH`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -79597,6 +80563,7 @@ USE `vn`; -- Final view structure for view `sale_freightComponent` -- +/*!50001 DROP TABLE IF EXISTS `sale_freightComponent`*/; /*!50001 DROP VIEW IF EXISTS `sale_freightComponent`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -79615,6 +80582,7 @@ USE `vn`; -- Final view structure for view `salesPersonSince` -- +/*!50001 DROP TABLE IF EXISTS `salesPersonSince`*/; /*!50001 DROP VIEW IF EXISTS `salesPersonSince`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -79633,6 +80601,7 @@ USE `vn`; -- Final view structure for view `salesPreparedLastHour` -- +/*!50001 DROP TABLE IF EXISTS `salesPreparedLastHour`*/; /*!50001 DROP VIEW IF EXISTS `salesPreparedLastHour`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -79642,7 +80611,7 @@ USE `vn`; /*!50001 SET collation_connection = utf8mb4_unicode_ci */; /*!50001 CREATE ALGORITHM=UNDEFINED */ /*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ -/*!50001 VIEW `salesPreparedLastHour` AS select `t`.`warehouseFk` AS `warehouseFk`,`st`.`saleFk` AS `saleFk`,`st`.`isChecked` AS `isChecked`,`st`.`originalQuantity` AS `originalQuantity`,`a`.`accion` AS `accion`,`st`.`created` AS `created`,`e`.`code` AS `code`,`w`.`firstName` AS `firstname`,`w`.`lastName` AS `lastName`,`w`.`code` AS `workerCode`,`ic`.`cm3delivery` * `s`.`quantity` / 1000 AS `litros`,`s`.`concept` AS `concept`,`d`.`name` AS `departmentName` from (((((((((`vn`.`saleTracking` `st` left join `vn`.`salesPreviousPreparated` `prevPrepSales` on(`prevPrepSales`.`saleFk` = `st`.`saleFk`)) join `vn`.`sale` `s` on(`s`.`id` = `st`.`saleFk`)) join `vn`.`ticket` `t` on(`t`.`id` = `s`.`ticketFk`)) join `vn`.`itemCost` `ic` on(`ic`.`warehouseFk` = `t`.`warehouseFk` and `ic`.`itemFk` = `s`.`itemFk`)) join `vn`.`worker` `w` on(`w`.`id` = `st`.`workerFk`)) join `vn`.`state` `e` on(`e`.`id` = `st`.`stateFk`)) join `vncontrol`.`accion` `a` on(`a`.`accion_id` = `st`.`actionFk`)) join `vn`.`workerDepartment` `wd` on(`wd`.`workerFk` = `st`.`workerFk`)) join `vn`.`department` `d` on(`d`.`id` = `wd`.`departmentFk`)) where `st`.`created` > current_timestamp() + interval -1 hour and `prevPrepSales`.`saleFk` is null and `d`.`name` not like 'EQUIPO%' */; +/*!50001 VIEW `salesPreparedLastHour` AS select `t`.`warehouseFk` AS `warehouseFk`,`st`.`saleFk` AS `saleFk`,`st`.`isChecked` AS `isChecked`,`st`.`originalQuantity` AS `originalQuantity`,`st`.`created` AS `created`,`e`.`code` AS `code`,`w`.`firstName` AS `firstname`,`w`.`lastName` AS `lastName`,`w`.`code` AS `workerCode`,`ic`.`cm3delivery` * `s`.`quantity` / 1000 AS `litros`,`s`.`concept` AS `concept`,`d`.`name` AS `departmentName` from ((((((((`saleTracking` `st` left join `salesPreviousPreparated` `prevPrepSales` on(`prevPrepSales`.`saleFk` = `st`.`saleFk`)) join `sale` `s` on(`s`.`id` = `st`.`saleFk`)) join `ticket` `t` on(`t`.`id` = `s`.`ticketFk`)) join `itemCost` `ic` on(`ic`.`warehouseFk` = `t`.`warehouseFk` and `ic`.`itemFk` = `s`.`itemFk`)) join `worker` `w` on(`w`.`id` = `st`.`workerFk`)) join `state` `e` on(`e`.`id` = `st`.`stateFk`)) join `workerDepartment` `wd` on(`wd`.`workerFk` = `st`.`workerFk`)) join `department` `d` on(`d`.`id` = `wd`.`departmentFk`)) where `st`.`created` > current_timestamp() + interval -1 hour and `prevPrepSales`.`saleFk` is null and `d`.`name` not like 'EQUIPO%' */; /*!50001 SET character_set_client = @saved_cs_client */; /*!50001 SET character_set_results = @saved_cs_results */; /*!50001 SET collation_connection = @saved_col_connection */; @@ -79651,6 +80620,7 @@ USE `vn`; -- Final view structure for view `salesPreviousPreparated` -- +/*!50001 DROP TABLE IF EXISTS `salesPreviousPreparated`*/; /*!50001 DROP VIEW IF EXISTS `salesPreviousPreparated`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -79669,6 +80639,7 @@ USE `vn`; -- Final view structure for view `supplierPackaging` -- +/*!50001 DROP TABLE IF EXISTS `supplierPackaging`*/; /*!50001 DROP VIEW IF EXISTS `supplierPackaging`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -79687,6 +80658,7 @@ USE `vn`; -- Final view structure for view `tagL10n` -- +/*!50001 DROP TABLE IF EXISTS `tagL10n`*/; /*!50001 DROP VIEW IF EXISTS `tagL10n`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -79705,6 +80677,7 @@ USE `vn`; -- Final view structure for view `ticketLastUpdated` -- +/*!50001 DROP TABLE IF EXISTS `ticketLastUpdated`*/; /*!50001 DROP VIEW IF EXISTS `ticketLastUpdated`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -79714,7 +80687,7 @@ USE `vn`; /*!50001 SET collation_connection = utf8mb4_unicode_ci */; /*!50001 CREATE ALGORITHM=UNDEFINED */ /*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ -/*!50001 VIEW `ticketLastUpdated` AS select `ticketLastUpdatedList`.`ticketFk` AS `ticketFk`,max(`ticketLastUpdatedList`.`created`) AS `lastUpdated` from `vn`.`ticketLastUpdatedList` group by `ticketLastUpdatedList`.`ticketFk` */; +/*!50001 VIEW `ticketLastUpdated` AS select `ticketLastUpdatedList`.`ticketFk` AS `ticketFk`,max(`ticketLastUpdatedList`.`created`) AS `lastUpdated` from `ticketLastUpdatedList` group by `ticketLastUpdatedList`.`ticketFk` */; /*!50001 SET character_set_client = @saved_cs_client */; /*!50001 SET character_set_results = @saved_cs_results */; /*!50001 SET collation_connection = @saved_col_connection */; @@ -79723,6 +80696,7 @@ USE `vn`; -- Final view structure for view `ticketLastUpdatedList` -- +/*!50001 DROP TABLE IF EXISTS `ticketLastUpdatedList`*/; /*!50001 DROP VIEW IF EXISTS `ticketLastUpdatedList`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -79732,25 +80706,7 @@ USE `vn`; /*!50001 SET collation_connection = utf8mb4_unicode_ci */; /*!50001 CREATE ALGORITHM=UNDEFINED */ /*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ -/*!50001 VIEW `ticketLastUpdatedList` AS select `s`.`ticketFk` AS `ticketFk`,`st`.`created` AS `created` from (`vn`.`saleTracking` `st` join `vn`.`sale` `s` on(`s`.`id` = `st`.`saleFk`)) where `st`.`created` > util.VN_CURDATE() union all select `i`.`Id_Ticket` AS `Id_Ticket`,`i`.`odbc_date` AS `odbc_date` from `vncontrol`.`inter` `i` where `i`.`odbc_date` > util.VN_CURDATE() union all select `s`.`ticketFk` AS `ticketFk`,`iss`.`created` AS `created` from (`vn`.`itemShelvingSale` `iss` join `vn`.`sale` `s` on(`s`.`id` = `iss`.`saleFk`)) where `iss`.`created` > util.VN_CURDATE() */; -/*!50001 SET character_set_client = @saved_cs_client */; -/*!50001 SET character_set_results = @saved_cs_results */; -/*!50001 SET collation_connection = @saved_col_connection */; - --- --- Final view structure for view `ticketLocation` --- - -/*!50001 DROP VIEW IF EXISTS `ticketLocation`*/; -/*!50001 SET @saved_cs_client = @@character_set_client */; -/*!50001 SET @saved_cs_results = @@character_set_results */; -/*!50001 SET @saved_col_connection = @@collation_connection */; -/*!50001 SET character_set_client = utf8mb4 */; -/*!50001 SET character_set_results = utf8mb4 */; -/*!50001 SET collation_connection = utf8mb4_unicode_ci */; -/*!50001 CREATE ALGORITHM=UNDEFINED */ -/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ -/*!50001 VIEW `ticketLocation` AS select `tl`.`Id_Ticket` AS `ticketFk`,`tl`.`longitude` AS `longitude`,`tl`.`latitude` AS `latitude` from `vn2008`.`ticket_location` `tl` */; +/*!50001 VIEW `ticketLastUpdatedList` AS select `s`.`ticketFk` AS `ticketFk`,`st`.`created` AS `created` from (`saleTracking` `st` join `sale` `s` on(`s`.`id` = `st`.`saleFk`)) where `st`.`created` > util.VN_CURDATE() union all select `tt`.`ticketFk` AS `Id_Ticket`,`tt`.`created` AS `odbc_date` from `ticketTracking` `tt` where `tt`.`created` > util.VN_CURDATE() union all select `s`.`ticketFk` AS `ticketFk`,`iss`.`created` AS `created` from (`itemShelvingSale` `iss` join `sale` `s` on(`s`.`id` = `iss`.`saleFk`)) where `iss`.`created` > util.VN_CURDATE() */; /*!50001 SET character_set_client = @saved_cs_client */; /*!50001 SET character_set_results = @saved_cs_results */; /*!50001 SET collation_connection = @saved_col_connection */; @@ -79759,6 +80715,7 @@ USE `vn`; -- Final view structure for view `ticketMRW` -- +/*!50001 DROP TABLE IF EXISTS `ticketMRW`*/; /*!50001 DROP VIEW IF EXISTS `ticketMRW`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -79777,6 +80734,7 @@ USE `vn`; -- Final view structure for view `ticketNotInvoiced` -- +/*!50001 DROP TABLE IF EXISTS `ticketNotInvoiced`*/; /*!50001 DROP VIEW IF EXISTS `ticketNotInvoiced`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -79795,6 +80753,7 @@ USE `vn`; -- Final view structure for view `ticketPackingList` -- +/*!50001 DROP TABLE IF EXISTS `ticketPackingList`*/; /*!50001 DROP VIEW IF EXISTS `ticketPackingList`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -79813,6 +80772,7 @@ USE `vn`; -- Final view structure for view `ticketPreviousPreparingList` -- +/*!50001 DROP TABLE IF EXISTS `ticketPreviousPreparingList`*/; /*!50001 DROP VIEW IF EXISTS `ticketPreviousPreparingList`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -79822,7 +80782,7 @@ USE `vn`; /*!50001 SET collation_connection = utf8mb4_unicode_ci */; /*!50001 CREATE ALGORITHM=UNDEFINED */ /*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ -/*!50001 VIEW `ticketPreviousPreparingList` AS select `s`.`ticketFk` AS `ticketFk`,`w`.`code` AS `code`,count(`s`.`id`) AS `saleLines`,sum(`s`.`isPicked` <> 0) AS `alreadyMadeSaleLines`,sum(`s`.`isPicked` <> 0) / count(`s`.`id`) AS `madeRate`,`sg`.`created` AS `created`,`p`.`code` AS `parking`,`iss`.`sectorFk` AS `sectorFk`,`al`.`code` AS `alertCode` from (((((((`vn`.`saleGroup` `sg` join `vn`.`saleGroupDetail` `sgd` on(`sgd`.`saleGroupFk` = `sg`.`id`)) join `vn`.`sale` `s` on(`s`.`id` = `sgd`.`saleFk`)) join `vn`.`ticketState` `tls` on(`tls`.`ticketFk` = `s`.`ticketFk`)) join `vn`.`alertLevel` `al` on(`al`.`id` = `tls`.`alertLevel`)) join `vn`.`worker` `w` on(`w`.`id` = `sg`.`userFk`)) left join `vn`.`parking` `p` on(`p`.`id` = `sg`.`parkingFk`)) join `vn`.`itemShelvingStock` `iss` on(`iss`.`itemFk` = `s`.`itemFk`)) where `sg`.`created` >= util.VN_CURDATE() + interval 0.1 day group by `sg`.`id` */; +/*!50001 VIEW `ticketPreviousPreparingList` AS select `s`.`ticketFk` AS `ticketFk`,`w`.`code` AS `code`,count(`s`.`id`) AS `saleLines`,sum(`s`.`isPicked` <> 0) AS `alreadyMadeSaleLines`,sum(`s`.`isPicked` <> 0) / count(`s`.`id`) AS `madeRate`,`sg`.`created` AS `created`,`p`.`code` AS `parking`,`iss`.`sectorFk` AS `sectorFk`,`al`.`code` AS `alertCode` from (((((((`saleGroup` `sg` join `saleGroupDetail` `sgd` on(`sgd`.`saleGroupFk` = `sg`.`id`)) join `sale` `s` on(`s`.`id` = `sgd`.`saleFk`)) join `ticketState` `tls` on(`tls`.`ticketFk` = `s`.`ticketFk`)) join `alertLevel` `al` on(`al`.`id` = `tls`.`alertLevel`)) join `worker` `w` on(`w`.`id` = `sg`.`userFk`)) left join `parking` `p` on(`p`.`id` = `sg`.`parkingFk`)) join `itemShelvingStock` `iss` on(`iss`.`itemFk` = `s`.`itemFk`)) where `sg`.`created` >= util.VN_CURDATE() + interval 0.1 day group by `sg`.`id` */; /*!50001 SET character_set_client = @saved_cs_client */; /*!50001 SET character_set_results = @saved_cs_results */; /*!50001 SET collation_connection = @saved_col_connection */; @@ -79831,6 +80791,7 @@ USE `vn`; -- Final view structure for view `ticketState` -- +/*!50001 DROP TABLE IF EXISTS `ticketState`*/; /*!50001 DROP VIEW IF EXISTS `ticketState`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -79840,7 +80801,7 @@ USE `vn`; /*!50001 SET collation_connection = utf8mb4_unicode_ci */; /*!50001 CREATE ALGORITHM=UNDEFINED */ /*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ -/*!50001 VIEW `ticketState` AS select `i`.`odbc_date` AS `updated`,`i`.`state_id` AS `stateFk`,`i`.`Id_Trabajador` AS `workerFk`,`tls`.`ticketFk` AS `ticketFk`,`s`.`id` AS `state`,`s`.`order` AS `productionOrder`,`s`.`alertLevel` AS `alertLevel`,`s`.`code` AS `code`,`tls`.`ticketFk` AS `ticket`,`i`.`Id_Trabajador` AS `worker`,`s`.`isPreviousPreparable` AS `isPreviousPreparable`,`s`.`isPicked` AS `isPicked` from ((`vn`.`ticketLastState` `tls` join `vncontrol`.`inter` `i` on(`i`.`inter_id` = `tls`.`ticketTrackingFk`)) join `vn`.`state` `s` on(`s`.`id` = `i`.`state_id`)) */; +/*!50001 VIEW `ticketState` AS select `tt`.`created` AS `updated`,`tt`.`stateFk` AS `stateFk`,`tt`.`workerFk` AS `workerFk`,`tls`.`ticketFk` AS `ticketFk`,`s`.`id` AS `state`,`s`.`order` AS `productionOrder`,`s`.`alertLevel` AS `alertLevel`,`s`.`code` AS `code`,`tls`.`ticketFk` AS `ticket`,`tt`.`workerFk` AS `worker`,`s`.`isPreviousPreparable` AS `isPreviousPreparable`,`s`.`isPicked` AS `isPicked` from ((`ticketLastState` `tls` join `ticketTracking` `tt` on(`tt`.`id` = `tls`.`ticketTrackingFk`)) join `state` `s` on(`s`.`id` = `tt`.`stateFk`)) */; /*!50001 SET character_set_client = @saved_cs_client */; /*!50001 SET character_set_results = @saved_cs_results */; /*!50001 SET collation_connection = @saved_col_connection */; @@ -79849,6 +80810,7 @@ USE `vn`; -- Final view structure for view `ticketStateToday` -- +/*!50001 DROP TABLE IF EXISTS `ticketStateToday`*/; /*!50001 DROP VIEW IF EXISTS `ticketStateToday`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -79858,25 +80820,7 @@ USE `vn`; /*!50001 SET collation_connection = utf8mb4_unicode_ci */; /*!50001 CREATE ALGORITHM=UNDEFINED */ /*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ -/*!50001 VIEW `ticketStateToday` AS select `ts`.`ticket` AS `ticket`,`ts`.`state` AS `state`,`ts`.`productionOrder` AS `productionOrder`,`ts`.`alertLevel` AS `alertLevel`,`ts`.`worker` AS `worker`,`ts`.`code` AS `code`,`ts`.`updated` AS `updated`,`ts`.`isPicked` AS `isPicked` from (`vn`.`ticketState` `ts` join `vn`.`ticket` `t` on(`t`.`id` = `ts`.`ticket`)) where `t`.`shipped` between util.VN_CURDATE() and `MIDNIGHT`(util.VN_CURDATE()) */; -/*!50001 SET character_set_client = @saved_cs_client */; -/*!50001 SET character_set_results = @saved_cs_results */; -/*!50001 SET collation_connection = @saved_col_connection */; - --- --- Final view structure for view `ticketTracking__` --- - -/*!50001 DROP VIEW IF EXISTS `ticketTracking__`*/; -/*!50001 SET @saved_cs_client = @@character_set_client */; -/*!50001 SET @saved_cs_results = @@character_set_results */; -/*!50001 SET @saved_col_connection = @@collation_connection */; -/*!50001 SET character_set_client = utf8mb4 */; -/*!50001 SET character_set_results = utf8mb4 */; -/*!50001 SET collation_connection = utf8mb4_unicode_ci */; -/*!50001 CREATE ALGORITHM=UNDEFINED */ -/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ -/*!50001 VIEW `ticketTracking__` AS select `i`.`inter_id` AS `id`,`i`.`state_id` AS `stateFk`,`i`.`odbc_date` AS `created`,`i`.`Id_Ticket` AS `ticketFk`,`i`.`Id_Trabajador` AS `workerFk` from `vncontrol`.`inter` `i` */; +/*!50001 VIEW `ticketStateToday` AS select `ts`.`ticket` AS `ticket`,`ts`.`state` AS `state`,`ts`.`productionOrder` AS `productionOrder`,`ts`.`alertLevel` AS `alertLevel`,`ts`.`worker` AS `worker`,`ts`.`code` AS `code`,`ts`.`updated` AS `updated`,`ts`.`isPicked` AS `isPicked` from (`ticketState` `ts` join `ticket` `t` on(`t`.`id` = `ts`.`ticket`)) where `t`.`shipped` between util.VN_CURDATE() and `MIDNIGHT`(util.VN_CURDATE()) */; /*!50001 SET character_set_client = @saved_cs_client */; /*!50001 SET character_set_results = @saved_cs_results */; /*!50001 SET collation_connection = @saved_col_connection */; @@ -79885,6 +80829,7 @@ USE `vn`; -- Final view structure for view `tr2` -- +/*!50001 DROP TABLE IF EXISTS `tr2`*/; /*!50001 DROP VIEW IF EXISTS `tr2`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -79903,6 +80848,7 @@ USE `vn`; -- Final view structure for view `traceabilityBuy` -- +/*!50001 DROP TABLE IF EXISTS `traceabilityBuy`*/; /*!50001 DROP VIEW IF EXISTS `traceabilityBuy`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -79921,6 +80867,7 @@ USE `vn`; -- Final view structure for view `traceabilitySale` -- +/*!50001 DROP TABLE IF EXISTS `traceabilitySale`*/; /*!50001 DROP VIEW IF EXISTS `traceabilitySale`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -79939,6 +80886,7 @@ USE `vn`; -- Final view structure for view `workerBusinessDated` -- +/*!50001 DROP TABLE IF EXISTS `workerBusinessDated`*/; /*!50001 DROP VIEW IF EXISTS `workerBusinessDated`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -79957,6 +80905,7 @@ USE `vn`; -- Final view structure for view `workerCalendar` -- +/*!50001 DROP TABLE IF EXISTS `workerCalendar`*/; /*!50001 DROP VIEW IF EXISTS `workerCalendar`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -79975,6 +80924,7 @@ USE `vn`; -- Final view structure for view `workerDepartment` -- +/*!50001 DROP TABLE IF EXISTS `workerDepartment`*/; /*!50001 DROP VIEW IF EXISTS `workerDepartment`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -79993,6 +80943,7 @@ USE `vn`; -- Final view structure for view `workerLabour` -- +/*!50001 DROP TABLE IF EXISTS `workerLabour`*/; /*!50001 DROP VIEW IF EXISTS `workerLabour`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -80011,6 +80962,7 @@ USE `vn`; -- Final view structure for view `workerMedia` -- +/*!50001 DROP TABLE IF EXISTS `workerMedia`*/; /*!50001 DROP VIEW IF EXISTS `workerMedia`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -80029,6 +80981,7 @@ USE `vn`; -- Final view structure for view `workerSpeedExpedition` -- +/*!50001 DROP TABLE IF EXISTS `workerSpeedExpedition`*/; /*!50001 DROP VIEW IF EXISTS `workerSpeedExpedition`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -80047,6 +81000,7 @@ USE `vn`; -- Final view structure for view `workerSpeedSaleTracking` -- +/*!50001 DROP TABLE IF EXISTS `workerSpeedSaleTracking`*/; /*!50001 DROP VIEW IF EXISTS `workerSpeedSaleTracking`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -80056,7 +81010,7 @@ USE `vn`; /*!50001 SET collation_connection = utf8mb4_unicode_ci */; /*!50001 CREATE ALGORITHM=UNDEFINED */ /*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ -/*!50001 VIEW `workerSpeedSaleTracking` AS select `salesPreparedLastHour`.`warehouseFk` AS `warehouseFk`,`salesPreparedLastHour`.`accion` AS `accion`,`salesPreparedLastHour`.`workerCode` AS `workerCode`,sum(`salesPreparedLastHour`.`litros`) AS `sumaLitros`,min(`salesPreparedLastHour`.`created`) AS `started`,max(`salesPreparedLastHour`.`created`) AS `finished`,sum(if(`salesPreparedLastHour`.`created` >= current_timestamp() + interval -1 hour,`salesPreparedLastHour`.`litros`,0)) AS `sumaLitrosLastHour`,cast(60 * sum(`salesPreparedLastHour`.`litros`) / time_to_sec(timediff(max(`salesPreparedLastHour`.`created`),min(`salesPreparedLastHour`.`created`))) as decimal(10,1)) AS `litersByMinute`,`salesPreparedLastHour`.`departmentName` AS `departmentName` from `vn`.`salesPreparedLastHour` group by `salesPreparedLastHour`.`warehouseFk`,`salesPreparedLastHour`.`accion`,`salesPreparedLastHour`.`workerCode` */; +/*!50001 VIEW `workerSpeedSaleTracking` AS select `salesPreparedLastHour`.`warehouseFk` AS `warehouseFk`,`salesPreparedLastHour`.`code` AS `state`,`salesPreparedLastHour`.`workerCode` AS `workerCode`,sum(`salesPreparedLastHour`.`litros`) AS `sumaLitros`,min(`salesPreparedLastHour`.`created`) AS `started`,max(`salesPreparedLastHour`.`created`) AS `finished`,sum(if(`salesPreparedLastHour`.`created` >= current_timestamp() + interval -1 hour,`salesPreparedLastHour`.`litros`,0)) AS `sumaLitrosLastHour`,cast(60 * sum(`salesPreparedLastHour`.`litros`) / time_to_sec(timediff(max(`salesPreparedLastHour`.`created`),min(`salesPreparedLastHour`.`created`))) as decimal(10,1)) AS `litersByMinute`,`salesPreparedLastHour`.`departmentName` AS `departmentName` from `salesPreparedLastHour` group by `salesPreparedLastHour`.`warehouseFk`,`salesPreparedLastHour`.`code`,`salesPreparedLastHour`.`workerCode` */; /*!50001 SET character_set_client = @saved_cs_client */; /*!50001 SET character_set_results = @saved_cs_results */; /*!50001 SET collation_connection = @saved_col_connection */; @@ -80065,6 +81019,7 @@ USE `vn`; -- Final view structure for view `workerTeamCollegues` -- +/*!50001 DROP TABLE IF EXISTS `workerTeamCollegues`*/; /*!50001 DROP VIEW IF EXISTS `workerTeamCollegues`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -80083,6 +81038,7 @@ USE `vn`; -- Final view structure for view `workerTimeControlUserInfo` -- +/*!50001 DROP TABLE IF EXISTS `workerTimeControlUserInfo`*/; /*!50001 DROP VIEW IF EXISTS `workerTimeControlUserInfo`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -80101,6 +81057,7 @@ USE `vn`; -- Final view structure for view `workerTimeJourneyNG` -- +/*!50001 DROP TABLE IF EXISTS `workerTimeJourneyNG`*/; /*!50001 DROP VIEW IF EXISTS `workerTimeJourneyNG`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -80119,6 +81076,7 @@ USE `vn`; -- Final view structure for view `workerWithoutTractor` -- +/*!50001 DROP TABLE IF EXISTS `workerWithoutTractor`*/; /*!50001 DROP VIEW IF EXISTS `workerWithoutTractor`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -80137,6 +81095,7 @@ USE `vn`; -- Final view structure for view `zoneEstimatedDelivery` -- +/*!50001 DROP TABLE IF EXISTS `zoneEstimatedDelivery`*/; /*!50001 DROP VIEW IF EXISTS `zoneEstimatedDelivery`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -80150,48 +81109,6 @@ USE `vn`; /*!50001 SET character_set_client = @saved_cs_client */; /*!50001 SET character_set_results = @saved_cs_results */; /*!50001 SET collation_connection = @saved_col_connection */; - --- --- Current Database: `vncontrol` --- - -USE `vncontrol`; - --- --- Final view structure for view `accion` --- - -/*!50001 DROP VIEW IF EXISTS `accion`*/; -/*!50001 SET @saved_cs_client = @@character_set_client */; -/*!50001 SET @saved_cs_results = @@character_set_results */; -/*!50001 SET @saved_col_connection = @@collation_connection */; -/*!50001 SET character_set_client = utf8mb4 */; -/*!50001 SET character_set_results = utf8mb4 */; -/*!50001 SET collation_connection = utf8mb4_unicode_ci */; -/*!50001 CREATE ALGORITHM=UNDEFINED */ -/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ -/*!50001 VIEW `accion` AS select `tts`.`id` AS `accion_id`,`tts`.`action` AS `accion` from `vn`.`ticketTrackingState` `tts` */; -/*!50001 SET character_set_client = @saved_cs_client */; -/*!50001 SET character_set_results = @saved_cs_results */; -/*!50001 SET collation_connection = @saved_col_connection */; - --- --- Final view structure for view `inter` --- - -/*!50001 DROP VIEW IF EXISTS `inter`*/; -/*!50001 SET @saved_cs_client = @@character_set_client */; -/*!50001 SET @saved_cs_results = @@character_set_results */; -/*!50001 SET @saved_col_connection = @@collation_connection */; -/*!50001 SET character_set_client = utf8mb4 */; -/*!50001 SET character_set_results = utf8mb4 */; -/*!50001 SET collation_connection = utf8mb4_unicode_ci */; -/*!50001 CREATE ALGORITHM=UNDEFINED */ -/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ -/*!50001 VIEW `inter` AS select `tt`.`id` AS `inter_id`,`tt`.`stateFk` AS `state_id`,`tt`.`failFk` AS `fallo_id`,`tt`.`notes` AS `nota`,`tt`.`created` AS `odbc_date`,`tt`.`ticketFk` AS `Id_Ticket`,`tt`.`workerFk` AS `Id_Trabajador`,`tt`.`supervisorFk` AS `Id_Supervisor` from `vn`.`ticketTracking` `tt` */; -/*!50001 SET character_set_client = @saved_cs_client */; -/*!50001 SET character_set_results = @saved_cs_results */; -/*!50001 SET collation_connection = @saved_col_connection */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -80202,6 +81119,4 @@ USE `vncontrol`; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2022-11-21 7:57:28 - - +-- Dump completed on 2023-02-21 8:14:30 diff --git a/db/export-structure.sh b/db/export-structure.sh index a4fd4a8c6..80a2efc41 100755 --- a/db/export-structure.sh +++ b/db/export-structure.sh @@ -13,7 +13,6 @@ SCHEMAS=( stock util vn - vncontrol ) IGNORETABLES=( diff --git a/e2e/paths/05-ticket/01-sale/02_edit_sale.spec.js b/e2e/paths/05-ticket/01-sale/02_edit_sale.spec.js index 9d6fddbe6..9e4898be9 100644 --- a/e2e/paths/05-ticket/01-sale/02_edit_sale.spec.js +++ b/e2e/paths/05-ticket/01-sale/02_edit_sale.spec.js @@ -197,6 +197,7 @@ describe('Ticket Edit sale path', () => { }); it('should check in the history that logs has been added', async() => { + await page.reload({waitUntil: ['networkidle0', 'domcontentloaded']}); await page.waitToClick(selectors.ticketSales.firstSaleHistoryButton); await page.waitForSelector(selectors.ticketSales.firstSaleHistory); const result = await page.countElement(selectors.ticketSales.firstSaleHistory); diff --git a/e2e/paths/05-ticket/18_index_payout.spec.js b/e2e/paths/05-ticket/18_index_payout.spec.js index 89b5937a1..220dacf61 100644 --- a/e2e/paths/05-ticket/18_index_payout.spec.js +++ b/e2e/paths/05-ticket/18_index_payout.spec.js @@ -63,6 +63,6 @@ describe('Ticket index payout path', () => { const reference = await page.waitToGetProperty(selectors.clientBalance.firstLineReference, 'innerText'); expect(count).toEqual(4); - expect(reference).toContain('Cash,Albaran: 7, 8Payment'); + expect(reference).toContain('Cash, Albaran: 7, 8Payment'); }); }); diff --git a/e2e/paths/10-travel/03_descriptor.spec.js b/e2e/paths/10-travel/03_descriptor.spec.js index 77b26b676..79dcad514 100644 --- a/e2e/paths/10-travel/03_descriptor.spec.js +++ b/e2e/paths/10-travel/03_descriptor.spec.js @@ -113,15 +113,6 @@ describe('Travel descriptor path', () => { expect(message.text).toContain('Data saved!'); }); - it('should atempt to clone the travel and its entries using the descriptor menu but receive an error', async() => { - await page.waitToClick(selectors.travelDescriptor.dotMenu); - await page.waitToClick(selectors.travelDescriptor.dotMenuCloneWithEntries); - await page.waitToClick(selectors.travelDescriptor.acceptClonation); - const message = await page.waitForSnackbar(); - - expect(message.text).toContain('Unable to clone this travel'); - }); - it('should update the landed date to a future date to enable cloneWithEntries', async() => { const nextMonth = Date.vnNew(); nextMonth.setMonth(nextMonth.getMonth() + 1); diff --git a/front/core/styles/icons/salixfont.css b/front/core/styles/icons/salixfont.css index 2dee94c3b..6f9b1fe15 100644 --- a/front/core/styles/icons/salixfont.css +++ b/front/core/styles/icons/salixfont.css @@ -32,6 +32,9 @@ .icon-100:before { content: "\e95a"; } +.icon-clientUnpaid:before { + content: "\e95b"; +} .icon-history:before { content: "\e968"; } @@ -337,6 +340,9 @@ .icon-solunion:before { content: "\e94e"; } +.icon-stowaway:before { + content: "\e94f"; +} .icon-splitline:before { content: "\e93e"; } diff --git a/front/core/styles/icons/salixfont.eot b/front/core/styles/icons/salixfont.eot index 48cc86413..61a3be8b7 100644 Binary files a/front/core/styles/icons/salixfont.eot and b/front/core/styles/icons/salixfont.eot differ diff --git a/front/core/styles/icons/salixfont.svg b/front/core/styles/icons/salixfont.svg index 96a584734..d6bfd5d74 100644 --- a/front/core/styles/icons/salixfont.svg +++ b/front/core/styles/icons/salixfont.svg @@ -82,9 +82,11 @@ - + + + @@ -96,6 +98,7 @@ + @@ -128,4 +131,4 @@ - \ No newline at end of file + diff --git a/front/core/styles/icons/salixfont.ttf b/front/core/styles/icons/salixfont.ttf index 4b090731c..89d3bd57d 100644 Binary files a/front/core/styles/icons/salixfont.ttf and b/front/core/styles/icons/salixfont.ttf differ diff --git a/front/core/styles/icons/salixfont.woff b/front/core/styles/icons/salixfont.woff index 502fed118..bfc9e075d 100644 Binary files a/front/core/styles/icons/salixfont.woff and b/front/core/styles/icons/salixfont.woff differ diff --git a/front/salix/components/upload-photo/index.html b/front/salix/components/upload-photo/index.html index 9b64a380f..4422d8855 100644 --- a/front/salix/components/upload-photo/index.html +++ b/front/salix/components/upload-photo/index.html @@ -69,14 +69,6 @@ value-field="code"> - - - - diff --git a/front/salix/components/upload-photo/index.js b/front/salix/components/upload-photo/index.js index fb115992f..da1fda923 100644 --- a/front/salix/components/upload-photo/index.js +++ b/front/salix/components/upload-photo/index.js @@ -64,8 +64,7 @@ export default class UploadPhoto extends Component { this.editor = null; this.newPhoto = { id: id, - collection: collection, - fileName: id + collection: collection }; this.$.dialog.show(); } diff --git a/loopback/common/methods/application/post.js b/loopback/common/methods/application/post.js index 9ea9a7f71..739f1341a 100644 --- a/loopback/common/methods/application/post.js +++ b/loopback/common/methods/application/post.js @@ -12,6 +12,7 @@ module.exports = Self => { }); Self.post = async ctx => { + console.log(ctx.req.body); return ctx.req.body; }; }; diff --git a/modules/claim/back/models/claim.json b/modules/claim/back/models/claim.json index 14c4f3452..cd5b767e4 100644 --- a/modules/claim/back/models/claim.json +++ b/modules/claim/back/models/claim.json @@ -77,6 +77,11 @@ "type": "belongsTo", "model": "Ticket", "foreignKey": "ticketFk" - } + }, + "claimDms": { + "type": "hasMany", + "model": "ClaimDms", + "foreignKey": "claimFk" + } } } diff --git a/modules/client/back/methods/client/specs/createWithUser.spec.js b/modules/client/back/methods/client/specs/createWithUser.spec.js index 7d4261aee..4cc51c93c 100644 --- a/modules/client/back/methods/client/specs/createWithUser.spec.js +++ b/modules/client/back/methods/client/specs/createWithUser.spec.js @@ -10,7 +10,8 @@ describe('Client Create', () => { socialName: 'Deadpool Marvel', street: 'Wall Street', city: 'New York', - businessTypeFk: 'florist' + businessTypeFk: 'florist', + provinceFk: 1 }; beforeAll(async() => { diff --git a/modules/client/front/balance/create/index.js b/modules/client/front/balance/create/index.js index ef22c968a..cc9e1ab5a 100644 --- a/modules/client/front/balance/create/index.js +++ b/modules/client/front/balance/create/index.js @@ -68,7 +68,7 @@ class Controller extends Dialog { this.receipt.description.push(accountingType.receiptDescription); if (this.originalDescription) this.receipt.description.push(this.originalDescription); - this.receipt.description.join(', '); + this.receipt.description = this.receipt.description.join(', '); } this.maxAmount = accountingType && accountingType.maxAmount; diff --git a/modules/client/front/balance/create/index.spec.js b/modules/client/front/balance/create/index.spec.js index 408e6b66a..fa6b48ea4 100644 --- a/modules/client/front/balance/create/index.spec.js +++ b/modules/client/front/balance/create/index.spec.js @@ -38,7 +38,7 @@ describe('Client', () => { } }; - expect(controller.receipt.description.join(',')).toEqual('Cash,Albaran: 1, 2'); + expect(controller.receipt.description).toEqual('Cash, Albaran: 1, 2'); }); }); diff --git a/modules/client/front/sample/create/index.js b/modules/client/front/sample/create/index.js index 13ef875da..b25bf7919 100644 --- a/modules/client/front/sample/create/index.js +++ b/modules/client/front/sample/create/index.js @@ -5,10 +5,6 @@ import './style.scss'; class Controller extends Section { constructor($element, $, vnEmail) { super($element, $); - this.clientSample = { - clientFk: this.$params.id, - companyId: this.vnConfig.companyFk - }; this.vnEmail = vnEmail; } @@ -19,10 +15,8 @@ class Controller extends Section { set client(value) { this._client = value; - if (value) { - this.clientSample.recipient = value.email; - this.getWorkerEmail(); - } + if (value) + this.setClientSample(value); } get companyId() { @@ -119,12 +113,17 @@ class Controller extends Section { .then(() => this.$state.go('client.card.sample.index')); } - getWorkerEmail() { + setClientSample(client) { const userId = window.localStorage.currentUserWorkerId; const params = {filter: {where: {userFk: userId}}}; this.$http.get('EmailUsers', params).then(res => { const [worker] = res && res.data; - this.clientSample.replyTo = worker.email; + this.clientSample = { + clientFk: this.$params.id, + companyId: this.vnConfig.companyFk, + recipient: client.email, + replyTo: worker.email + }; }); } } diff --git a/modules/client/front/sample/create/index.spec.js b/modules/client/front/sample/create/index.spec.js index 8e33a1075..ecaf038fa 100644 --- a/modules/client/front/sample/create/index.spec.js +++ b/modules/client/front/sample/create/index.spec.js @@ -191,15 +191,19 @@ describe('Client', () => { }); }); - describe('getWorkerEmail()', () => { + describe('setClientSample()', () => { it(`should perform a query and then set the replyTo property to the clientSample object`, () => { + const client = {email: 'test@example.com'}; const expectedEmail = 'batman@arkhamcity.com'; const serializedParams = $httpParamSerializer({filter: {where: {}}}); $httpBackend.expect('GET', `EmailUsers?${serializedParams}`).respond([{email: expectedEmail}]); - controller.getWorkerEmail(); + controller.setClientSample(client); $httpBackend.flush(); expect(controller.clientSample.replyTo).toEqual(expectedEmail); + expect(controller.clientSample.clientFk).toEqual(controller.$params.id); + expect(controller.clientSample.recipient).toEqual(client.email); + expect(controller.clientSample.companyId).toEqual(controller.vnConfig.companyFk); }); }); }); diff --git a/modules/item/back/methods/item-image-queue/downloadImages.js b/modules/item/back/methods/item-image-queue/downloadImages.js index 0f57856c7..08e5df050 100644 --- a/modules/item/back/methods/item-image-queue/downloadImages.js +++ b/modules/item/back/methods/item-image-queue/downloadImages.js @@ -1,6 +1,7 @@ const https = require('https'); const fs = require('fs-extra'); const path = require('path'); +const uuid = require('uuid'); module.exports = Self => { Self.remoteMethod('downloadImages', { @@ -46,10 +47,8 @@ module.exports = Self => { if (!image) return; - const srcFile = image.url; - const fileName = srcFile.replace(/\.|\/|:|\?|\\|=|%/g, ''); - const file = `${fileName}.png`; - const filePath = path.join(tempPath, file); + const fileName = `${uuid.v4()}.png`; + const filePath = path.join(tempPath, fileName); const imageUrl = image.url.replace('http://', 'https://'); https.get(imageUrl, async response => { diff --git a/modules/item/back/models/item-config.json b/modules/item/back/models/item-config.json index c7a0b2644..7ad1d8785 100644 --- a/modules/item/back/models/item-config.json +++ b/modules/item/back/models/item-config.json @@ -21,13 +21,13 @@ "type": "array" }, "defaultPriority": { - "type": "int" + "type": "number" }, "defaultTag": { - "type": "int" + "type": "number" }, "warehouseFk": { - "type": "int" + "type": "number" } }, "relations": { diff --git a/modules/item/front/card/index.js b/modules/item/front/card/index.js index 8b32e030b..2fe42fd04 100644 --- a/modules/item/front/card/index.js +++ b/modules/item/front/card/index.js @@ -5,6 +5,25 @@ class Controller extends ModuleCard { reload() { this.$http.get(`Items/${this.$params.id}/getCard`) .then(res => this.item = res.data); + + this.$http.get('ItemConfigs/findOne') + .then(res => { + if (this.$state.getCurrentPath()[4].state.name === 'item.card.diary') return; + this.warehouseFk = res.data.warehouseFk; + this.getWarehouseName(res.data.warehouseFk); + }); + } + + getWarehouseName(warehouseFk) { + const filter = { + where: {id: warehouseFk} + }; + this.$http.get('Warehouses/findOne', {filter}) + .then(res => { + this.warehouseText = this.$t('WarehouseFk', { + warehouseName: res.data.name + }); + }); } } diff --git a/modules/item/front/card/index.spec.js b/modules/item/front/card/index.spec.js index 2c97f5935..6ebce3d36 100644 --- a/modules/item/front/card/index.spec.js +++ b/modules/item/front/card/index.spec.js @@ -4,12 +4,15 @@ describe('Item', () => { describe('Component vnItemCard', () => { let controller; let $httpBackend; + let $state; let data = {id: 1, name: 'fooName'}; beforeEach(ngModule('item')); - beforeEach(inject(($componentController, _$httpBackend_, $stateParams) => { + beforeEach(inject(($componentController, _$httpBackend_, $stateParams, _$state_) => { $httpBackend = _$httpBackend_; + $state = _$state_; + $state.getCurrentPath = () => [null, null, null, null, {state: {name: 'item.card.diary'}}]; let $element = angular.element('

'); controller = $componentController('vnItemCard', {$element}); @@ -19,6 +22,7 @@ describe('Item', () => { })); it('should request data and set it on the controller', () => { + $httpBackend.expect('GET', `ItemConfigs/findOne`).respond({}); controller.reload(); $httpBackend.flush(); diff --git a/modules/item/front/diary/index.js b/modules/item/front/diary/index.js index 945e1fd31..9e104c8e6 100644 --- a/modules/item/front/diary/index.js +++ b/modules/item/front/diary/index.js @@ -68,6 +68,10 @@ class Controller extends Section { this.$[descriptor].show(event.target, sale.origin); } + + $onDestroy() { + this.card.reload(); + } } Controller.$inject = ['$element', '$scope', '$anchorScroll', '$location']; diff --git a/modules/supplier/back/methods/supplier/newSupplier.js b/modules/supplier/back/methods/supplier/newSupplier.js index f4059a259..ae71380f3 100644 --- a/modules/supplier/back/methods/supplier/newSupplier.js +++ b/modules/supplier/back/methods/supplier/newSupplier.js @@ -39,7 +39,7 @@ module.exports = Self => { return supplier; } catch (e) { if (tx) await tx.rollback(); - return params; + throw e; } }; }; diff --git a/modules/supplier/back/methods/supplier/specs/newSupplier.spec.js b/modules/supplier/back/methods/supplier/specs/newSupplier.spec.js index 8f22a4f20..44252e71b 100644 --- a/modules/supplier/back/methods/supplier/specs/newSupplier.spec.js +++ b/modules/supplier/back/methods/supplier/specs/newSupplier.spec.js @@ -8,6 +8,7 @@ describe('Supplier newSupplier()', () => { const administrativeId = 5; it('should create a new supplier containing only the name', async() => { + pending('https://redmine.verdnatura.es/issues/5203'); const activeCtx = { accessToken: {userId: administrativeId}, }; diff --git a/modules/ticket/back/methods/sale/specs/canEdit.spec.js b/modules/ticket/back/methods/sale/specs/canEdit.spec.js index 58d8f0635..a6c299321 100644 --- a/modules/ticket/back/methods/sale/specs/canEdit.spec.js +++ b/modules/ticket/back/methods/sale/specs/canEdit.spec.js @@ -47,51 +47,10 @@ describe('sale canEdit()', () => { throw e; } }); - - it('should return false if any of the sales has a saleTracking record', async() => { - const tx = await models.Sale.beginTransaction({}); - let error; - try { - const options = {transaction: tx}; - - const buyerId = 35; - const ctx = {req: {accessToken: {userId: buyerId}}}; - - const sales = [31]; - - await models.Sale.canEdit(ctx, sales, options); - await tx.rollback(); - } catch (e) { - await tx.rollback(); - error = e; - } - - expect(error).toEqual( - new Error('It is not possible to modify tracked sales')); - }); }); describe('sale editCloned', () => { const saleCloned = [29]; - it('should return false if any of the sales is cloned', async() => { - const tx = await models.Sale.beginTransaction({}); - let error; - try { - const options = {transaction: tx}; - - const buyerId = 35; - const ctx = {req: {accessToken: {userId: buyerId}}}; - - await models.Sale.canEdit(ctx, saleCloned, options); - await tx.rollback(); - } catch (e) { - await tx.rollback(); - error = e; - } - - expect(error).toEqual( - new Error('It is not possible to modify cloned sales')); - }); it('should return true if any of the sales is cloned and has the correct role', async() => { const tx = await models.Sale.beginTransaction({}); @@ -135,8 +94,6 @@ describe('sale canEdit()', () => { const options = {transaction: tx}; const ctx = {req: {accessToken: {userId: employeeId}}}; - - // For test const saleToEdit = await models.Sale.findById(sales[0], null, options); await saleToEdit.updateAttribute('itemFk', 9, options); diff --git a/modules/ticket/back/methods/ticket/getSales.js b/modules/ticket/back/methods/ticket/getSales.js index 3e45b3fb5..321e8e24e 100644 --- a/modules/ticket/back/methods/ticket/getSales.js +++ b/modules/ticket/back/methods/ticket/getSales.js @@ -87,6 +87,14 @@ module.exports = Self => { for (let problem of problems) saleProblems.set(problem.saleFk, problem); + const ticketLog = await Self.rawSql(`SELECT DISTINCT changedModelId + FROM ticketLog tl + WHERE changedModel = 'Sale' + AND originFk = ?`, [id], myOptions); + const salesWithLogs = ticketLog.map(sale => { + return sale.changedModelId; + }); + for (let sale of sales) { const problems = saleProblems.get(sale.id); const itemStock = itemAvailable.get(sale.itemFk); @@ -98,6 +106,8 @@ module.exports = Self => { sale.hasTicketRequest = problems.hasTicketRequest; sale.hasComponentLack = problems.hasComponentLack; } + if (salesWithLogs.includes(sale.id)) + sale.$hasLogs = true; } return sales; diff --git a/modules/ticket/front/sale/index.html b/modules/ticket/front/sale/index.html index fd259e120..8764417a8 100644 --- a/modules/ticket/front/sale/index.html +++ b/modules/ticket/front/sale/index.html @@ -211,7 +211,8 @@ vn-none vn-tooltip="History" icon="history" - ng-click="log.open()"> + ng-click="log.open()" + ng-show="sale.$hasLogs">