From 24c934ca8be2f7771f97c4262f0f9a0b951d9f3e Mon Sep 17 00:00:00 2001 From: jgallego Date: Fri, 20 Oct 2023 11:53:48 +0200 Subject: [PATCH] refs #6287 clean changes --- db/{changes => .archive}/231201/00-ACL.sql | 0 .../231201/00-chatRefactor.sql | 0 .../231201/00-invoiceInSerial.sql | 0 .../231201/00-itemType_isFragile.sql | 0 .../231201/00-mailACL.sql | 0 .../231201/00-operator.sql | 0 .../00-supplierAccount_deleteTriggers.sql | 0 .../231201/00-ticket_getWarnings.sql | 0 db/{changes => .archive}/231201/00-wagon.sql | 0 .../231202/00-delivery.sql | 0 .../231203/00-delivery.sql | 0 .../231204/00-rollbackDelivery.sql | 0 .../231205/00-printQueueArgs.sql | 0 .../231401/00-claimBeginningAfterInsert.sql | 0 .../231401/00-clientBeforeUpdate.sql | 0 .../231401/00-hotfixDelivery.sql | 0 .../231401/00-invoiceOutAfterInsert.sql | 0 .../231401/00-negativeBases.sql | 0 .../231401/00-workerNotes.sql | 0 .../231402/00-negativeBases.sql | 0 .../231801/00-aclClientInforma.sql | 0 .../231801/00-acl_receiptEmail.sql | 0 .../231801/00-clientInforma.sql | 0 .../231801/00-client_setRatingAcl.sql | 0 .../231801/00-deleteProcs_refund.sql | 0 .../231801/00-deviceProduction.sql | 0 .../231801/00-kkearEntryNotes.sql | 0 .../231801/00-newCompanyI18n.sql | 0 .../231801/00-newTableWeb.sql | 0 .../231801/00-observationEmailACL.sql | 0 .../00-optimiceZoneEstimatedDelivery.sql | 0 .../231801/00-saleTracking.sql | 0 .../231801/00-ticketConfig.sql | 0 .../231801/00-updateIsVies.sql | 0 .../231801/00-updateisViesClient.sql | 0 .../231801/00-userAcl.sql | 0 .../231801/00-userRoleLog.sql | 0 .../231801/01-viewCompany10L.sql | 0 .../232001/00-clientWorkerName.sql | 0 .../232001/00-createWorker.sql | 0 .../232001/00-invoiceOut_new.sql | 0 db/{changes => .archive}/232001/00-wagon.sql | 0 .../232201/00-defaulterView.sql | 0 .../232201/00-procedurecanAdvance.sql | 0 .../232201/00-procedurecanbePostponed.sql | 0 .../232201/00-workerConfigPayMethod.sql | 0 .../232202/00-procedurecanAdvance.sql | 0 .../232202/00-procedurecanbePostponed.sql | 0 db/{changes => .archive}/232401/.gitkeep | 0 .../232401/00-buyConfig_travelConfig.sql | 0 .../232401/00-printer.sql | 0 .../232401/00-ticket_warehouse.sql | 0 .../232401/00-userPassExpired.sql | 0 .../232402/00-hotFix_travelConfig.sql | 0 .../232601/00-aclAccount.sql | 0 .../232601/00-aclInvoiceTickets.sql | 0 .../232601/00-aclMailAliasAccount.sql | 0 .../232601/00-aclMailForward.sql | 0 .../232601/00-aclRole.sql | 0 .../232601/00-aclVnUser.sql | 0 .../232601/00-aclVnUser_renewToken.sql | 0 .../232601/00-entry_updateComission.sql | 0 .../232601/00-packingSiteAdvanced.sql | 0 db/{changes => .archive}/232601/00-salix.sql | 0 .../232601/00-useSpecificsAcls.sql | 0 .../232601/01-invoiceOutPdf.sql | 0 .../232602/01-aclAddAlias.sql | 0 .../232801/00-authCode.sql | 0 .../232801/00-client_create.sql | 0 .../232801/00-client_create2.sql | 0 .../232801/00-department.sql | 0 .../232801/00-fix_editCredit.sql | 0 db/{changes => .archive}/232801/00-user.sql | 0 .../232802/01-aclWorkerDisable.sql | 0 db/{changes => .archive}/233001/.gitkeep | 0 .../233001/00-aclSaleTracking.sql | 0 .../233001/00-clientSms.sql | 0 .../233001/00-company.sql | 0 .../233001/00-fixACLVehicle.sql | 0 .../233001/00-itemRecycle.sql | 0 .../233001/00-itemShelving_inventory.sql | 0 .../233001/00-noUniqueSocialName.sql | 0 .../233001/00-roadmap.sql | 0 .../233001/00-roadmapACL.sql | 0 .../233001/00-ticketWeight.sql | 0 db/{changes => .archive}/233201/.gitkeep | 0 .../233201/00-acl_viaexpressConfig.sql | 0 .../233201/00-transferClient.sql | 0 .../233201/00-updatePrice.sql | 0 .../233201/00-viaexpress.sql | 0 .../233201/00-workerDocuware.sql | 0 db/changes/234201/01-ticket_add.sql | 135 ++++++++++++++++++ modules/ticket/back/methods/ticket/new.js | 3 +- 93 files changed, 136 insertions(+), 2 deletions(-) rename db/{changes => .archive}/231201/00-ACL.sql (100%) rename db/{changes => .archive}/231201/00-chatRefactor.sql (100%) rename db/{changes => .archive}/231201/00-invoiceInSerial.sql (100%) rename db/{changes => .archive}/231201/00-itemType_isFragile.sql (100%) rename db/{changes => .archive}/231201/00-mailACL.sql (100%) rename db/{changes => .archive}/231201/00-operator.sql (100%) rename db/{changes => .archive}/231201/00-supplierAccount_deleteTriggers.sql (100%) rename db/{changes => .archive}/231201/00-ticket_getWarnings.sql (100%) rename db/{changes => .archive}/231201/00-wagon.sql (100%) rename db/{changes => .archive}/231202/00-delivery.sql (100%) rename db/{changes => .archive}/231203/00-delivery.sql (100%) rename db/{changes => .archive}/231204/00-rollbackDelivery.sql (100%) rename db/{changes => .archive}/231205/00-printQueueArgs.sql (100%) rename db/{changes => .archive}/231401/00-claimBeginningAfterInsert.sql (100%) rename db/{changes => .archive}/231401/00-clientBeforeUpdate.sql (100%) rename db/{changes => .archive}/231401/00-hotfixDelivery.sql (100%) rename db/{changes => .archive}/231401/00-invoiceOutAfterInsert.sql (100%) rename db/{changes => .archive}/231401/00-negativeBases.sql (100%) rename db/{changes => .archive}/231401/00-workerNotes.sql (100%) rename db/{changes => .archive}/231402/00-negativeBases.sql (100%) rename db/{changes => .archive}/231801/00-aclClientInforma.sql (100%) rename db/{changes => .archive}/231801/00-acl_receiptEmail.sql (100%) rename db/{changes => .archive}/231801/00-clientInforma.sql (100%) rename db/{changes => .archive}/231801/00-client_setRatingAcl.sql (100%) rename db/{changes => .archive}/231801/00-deleteProcs_refund.sql (100%) rename db/{changes => .archive}/231801/00-deviceProduction.sql (100%) rename db/{changes => .archive}/231801/00-kkearEntryNotes.sql (100%) rename db/{changes => .archive}/231801/00-newCompanyI18n.sql (100%) rename db/{changes => .archive}/231801/00-newTableWeb.sql (100%) rename db/{changes => .archive}/231801/00-observationEmailACL.sql (100%) rename db/{changes => .archive}/231801/00-optimiceZoneEstimatedDelivery.sql (100%) rename db/{changes => .archive}/231801/00-saleTracking.sql (100%) rename db/{changes => .archive}/231801/00-ticketConfig.sql (100%) rename db/{changes => .archive}/231801/00-updateIsVies.sql (100%) rename db/{changes => .archive}/231801/00-updateisViesClient.sql (100%) rename db/{changes => .archive}/231801/00-userAcl.sql (100%) rename db/{changes => .archive}/231801/00-userRoleLog.sql (100%) rename db/{changes => .archive}/231801/01-viewCompany10L.sql (100%) rename db/{changes => .archive}/232001/00-clientWorkerName.sql (100%) rename db/{changes => .archive}/232001/00-createWorker.sql (100%) rename db/{changes => .archive}/232001/00-invoiceOut_new.sql (100%) rename db/{changes => .archive}/232001/00-wagon.sql (100%) rename db/{changes => .archive}/232201/00-defaulterView.sql (100%) rename db/{changes => .archive}/232201/00-procedurecanAdvance.sql (100%) rename db/{changes => .archive}/232201/00-procedurecanbePostponed.sql (100%) rename db/{changes => .archive}/232201/00-workerConfigPayMethod.sql (100%) rename db/{changes => .archive}/232202/00-procedurecanAdvance.sql (100%) rename db/{changes => .archive}/232202/00-procedurecanbePostponed.sql (100%) rename db/{changes => .archive}/232401/.gitkeep (100%) rename db/{changes => .archive}/232401/00-buyConfig_travelConfig.sql (100%) rename db/{changes => .archive}/232401/00-printer.sql (100%) rename db/{changes => .archive}/232401/00-ticket_warehouse.sql (100%) rename db/{changes => .archive}/232401/00-userPassExpired.sql (100%) rename db/{changes => .archive}/232402/00-hotFix_travelConfig.sql (100%) rename db/{changes => .archive}/232601/00-aclAccount.sql (100%) rename db/{changes => .archive}/232601/00-aclInvoiceTickets.sql (100%) rename db/{changes => .archive}/232601/00-aclMailAliasAccount.sql (100%) rename db/{changes => .archive}/232601/00-aclMailForward.sql (100%) rename db/{changes => .archive}/232601/00-aclRole.sql (100%) rename db/{changes => .archive}/232601/00-aclVnUser.sql (100%) rename db/{changes => .archive}/232601/00-aclVnUser_renewToken.sql (100%) rename db/{changes => .archive}/232601/00-entry_updateComission.sql (100%) rename db/{changes => .archive}/232601/00-packingSiteAdvanced.sql (100%) rename db/{changes => .archive}/232601/00-salix.sql (100%) rename db/{changes => .archive}/232601/00-useSpecificsAcls.sql (100%) rename db/{changes => .archive}/232601/01-invoiceOutPdf.sql (100%) rename db/{changes => .archive}/232602/01-aclAddAlias.sql (100%) rename db/{changes => .archive}/232801/00-authCode.sql (100%) rename db/{changes => .archive}/232801/00-client_create.sql (100%) rename db/{changes => .archive}/232801/00-client_create2.sql (100%) rename db/{changes => .archive}/232801/00-department.sql (100%) rename db/{changes => .archive}/232801/00-fix_editCredit.sql (100%) rename db/{changes => .archive}/232801/00-user.sql (100%) rename db/{changes => .archive}/232802/01-aclWorkerDisable.sql (100%) rename db/{changes => .archive}/233001/.gitkeep (100%) rename db/{changes => .archive}/233001/00-aclSaleTracking.sql (100%) rename db/{changes => .archive}/233001/00-clientSms.sql (100%) rename db/{changes => .archive}/233001/00-company.sql (100%) rename db/{changes => .archive}/233001/00-fixACLVehicle.sql (100%) rename db/{changes => .archive}/233001/00-itemRecycle.sql (100%) rename db/{changes => .archive}/233001/00-itemShelving_inventory.sql (100%) rename db/{changes => .archive}/233001/00-noUniqueSocialName.sql (100%) rename db/{changes => .archive}/233001/00-roadmap.sql (100%) rename db/{changes => .archive}/233001/00-roadmapACL.sql (100%) rename db/{changes => .archive}/233001/00-ticketWeight.sql (100%) rename db/{changes => .archive}/233201/.gitkeep (100%) rename db/{changes => .archive}/233201/00-acl_viaexpressConfig.sql (100%) rename db/{changes => .archive}/233201/00-transferClient.sql (100%) rename db/{changes => .archive}/233201/00-updatePrice.sql (100%) rename db/{changes => .archive}/233201/00-viaexpress.sql (100%) rename db/{changes => .archive}/233201/00-workerDocuware.sql (100%) create mode 100644 db/changes/234201/01-ticket_add.sql diff --git a/db/changes/231201/00-ACL.sql b/db/.archive/231201/00-ACL.sql similarity index 100% rename from db/changes/231201/00-ACL.sql rename to db/.archive/231201/00-ACL.sql diff --git a/db/changes/231201/00-chatRefactor.sql b/db/.archive/231201/00-chatRefactor.sql similarity index 100% rename from db/changes/231201/00-chatRefactor.sql rename to db/.archive/231201/00-chatRefactor.sql diff --git a/db/changes/231201/00-invoiceInSerial.sql b/db/.archive/231201/00-invoiceInSerial.sql similarity index 100% rename from db/changes/231201/00-invoiceInSerial.sql rename to db/.archive/231201/00-invoiceInSerial.sql diff --git a/db/changes/231201/00-itemType_isFragile.sql b/db/.archive/231201/00-itemType_isFragile.sql similarity index 100% rename from db/changes/231201/00-itemType_isFragile.sql rename to db/.archive/231201/00-itemType_isFragile.sql diff --git a/db/changes/231201/00-mailACL.sql b/db/.archive/231201/00-mailACL.sql similarity index 100% rename from db/changes/231201/00-mailACL.sql rename to db/.archive/231201/00-mailACL.sql diff --git a/db/changes/231201/00-operator.sql b/db/.archive/231201/00-operator.sql similarity index 100% rename from db/changes/231201/00-operator.sql rename to db/.archive/231201/00-operator.sql diff --git a/db/changes/231201/00-supplierAccount_deleteTriggers.sql b/db/.archive/231201/00-supplierAccount_deleteTriggers.sql similarity index 100% rename from db/changes/231201/00-supplierAccount_deleteTriggers.sql rename to db/.archive/231201/00-supplierAccount_deleteTriggers.sql diff --git a/db/changes/231201/00-ticket_getWarnings.sql b/db/.archive/231201/00-ticket_getWarnings.sql similarity index 100% rename from db/changes/231201/00-ticket_getWarnings.sql rename to db/.archive/231201/00-ticket_getWarnings.sql diff --git a/db/changes/231201/00-wagon.sql b/db/.archive/231201/00-wagon.sql similarity index 100% rename from db/changes/231201/00-wagon.sql rename to db/.archive/231201/00-wagon.sql diff --git a/db/changes/231202/00-delivery.sql b/db/.archive/231202/00-delivery.sql similarity index 100% rename from db/changes/231202/00-delivery.sql rename to db/.archive/231202/00-delivery.sql diff --git a/db/changes/231203/00-delivery.sql b/db/.archive/231203/00-delivery.sql similarity index 100% rename from db/changes/231203/00-delivery.sql rename to db/.archive/231203/00-delivery.sql diff --git a/db/changes/231204/00-rollbackDelivery.sql b/db/.archive/231204/00-rollbackDelivery.sql similarity index 100% rename from db/changes/231204/00-rollbackDelivery.sql rename to db/.archive/231204/00-rollbackDelivery.sql diff --git a/db/changes/231205/00-printQueueArgs.sql b/db/.archive/231205/00-printQueueArgs.sql similarity index 100% rename from db/changes/231205/00-printQueueArgs.sql rename to db/.archive/231205/00-printQueueArgs.sql diff --git a/db/changes/231401/00-claimBeginningAfterInsert.sql b/db/.archive/231401/00-claimBeginningAfterInsert.sql similarity index 100% rename from db/changes/231401/00-claimBeginningAfterInsert.sql rename to db/.archive/231401/00-claimBeginningAfterInsert.sql diff --git a/db/changes/231401/00-clientBeforeUpdate.sql b/db/.archive/231401/00-clientBeforeUpdate.sql similarity index 100% rename from db/changes/231401/00-clientBeforeUpdate.sql rename to db/.archive/231401/00-clientBeforeUpdate.sql diff --git a/db/changes/231401/00-hotfixDelivery.sql b/db/.archive/231401/00-hotfixDelivery.sql similarity index 100% rename from db/changes/231401/00-hotfixDelivery.sql rename to db/.archive/231401/00-hotfixDelivery.sql diff --git a/db/changes/231401/00-invoiceOutAfterInsert.sql b/db/.archive/231401/00-invoiceOutAfterInsert.sql similarity index 100% rename from db/changes/231401/00-invoiceOutAfterInsert.sql rename to db/.archive/231401/00-invoiceOutAfterInsert.sql diff --git a/db/changes/231401/00-negativeBases.sql b/db/.archive/231401/00-negativeBases.sql similarity index 100% rename from db/changes/231401/00-negativeBases.sql rename to db/.archive/231401/00-negativeBases.sql diff --git a/db/changes/231401/00-workerNotes.sql b/db/.archive/231401/00-workerNotes.sql similarity index 100% rename from db/changes/231401/00-workerNotes.sql rename to db/.archive/231401/00-workerNotes.sql diff --git a/db/changes/231402/00-negativeBases.sql b/db/.archive/231402/00-negativeBases.sql similarity index 100% rename from db/changes/231402/00-negativeBases.sql rename to db/.archive/231402/00-negativeBases.sql diff --git a/db/changes/231801/00-aclClientInforma.sql b/db/.archive/231801/00-aclClientInforma.sql similarity index 100% rename from db/changes/231801/00-aclClientInforma.sql rename to db/.archive/231801/00-aclClientInforma.sql diff --git a/db/changes/231801/00-acl_receiptEmail.sql b/db/.archive/231801/00-acl_receiptEmail.sql similarity index 100% rename from db/changes/231801/00-acl_receiptEmail.sql rename to db/.archive/231801/00-acl_receiptEmail.sql diff --git a/db/changes/231801/00-clientInforma.sql b/db/.archive/231801/00-clientInforma.sql similarity index 100% rename from db/changes/231801/00-clientInforma.sql rename to db/.archive/231801/00-clientInforma.sql diff --git a/db/changes/231801/00-client_setRatingAcl.sql b/db/.archive/231801/00-client_setRatingAcl.sql similarity index 100% rename from db/changes/231801/00-client_setRatingAcl.sql rename to db/.archive/231801/00-client_setRatingAcl.sql diff --git a/db/changes/231801/00-deleteProcs_refund.sql b/db/.archive/231801/00-deleteProcs_refund.sql similarity index 100% rename from db/changes/231801/00-deleteProcs_refund.sql rename to db/.archive/231801/00-deleteProcs_refund.sql diff --git a/db/changes/231801/00-deviceProduction.sql b/db/.archive/231801/00-deviceProduction.sql similarity index 100% rename from db/changes/231801/00-deviceProduction.sql rename to db/.archive/231801/00-deviceProduction.sql diff --git a/db/changes/231801/00-kkearEntryNotes.sql b/db/.archive/231801/00-kkearEntryNotes.sql similarity index 100% rename from db/changes/231801/00-kkearEntryNotes.sql rename to db/.archive/231801/00-kkearEntryNotes.sql diff --git a/db/changes/231801/00-newCompanyI18n.sql b/db/.archive/231801/00-newCompanyI18n.sql similarity index 100% rename from db/changes/231801/00-newCompanyI18n.sql rename to db/.archive/231801/00-newCompanyI18n.sql diff --git a/db/changes/231801/00-newTableWeb.sql b/db/.archive/231801/00-newTableWeb.sql similarity index 100% rename from db/changes/231801/00-newTableWeb.sql rename to db/.archive/231801/00-newTableWeb.sql diff --git a/db/changes/231801/00-observationEmailACL.sql b/db/.archive/231801/00-observationEmailACL.sql similarity index 100% rename from db/changes/231801/00-observationEmailACL.sql rename to db/.archive/231801/00-observationEmailACL.sql diff --git a/db/changes/231801/00-optimiceZoneEstimatedDelivery.sql b/db/.archive/231801/00-optimiceZoneEstimatedDelivery.sql similarity index 100% rename from db/changes/231801/00-optimiceZoneEstimatedDelivery.sql rename to db/.archive/231801/00-optimiceZoneEstimatedDelivery.sql diff --git a/db/changes/231801/00-saleTracking.sql b/db/.archive/231801/00-saleTracking.sql similarity index 100% rename from db/changes/231801/00-saleTracking.sql rename to db/.archive/231801/00-saleTracking.sql diff --git a/db/changes/231801/00-ticketConfig.sql b/db/.archive/231801/00-ticketConfig.sql similarity index 100% rename from db/changes/231801/00-ticketConfig.sql rename to db/.archive/231801/00-ticketConfig.sql diff --git a/db/changes/231801/00-updateIsVies.sql b/db/.archive/231801/00-updateIsVies.sql similarity index 100% rename from db/changes/231801/00-updateIsVies.sql rename to db/.archive/231801/00-updateIsVies.sql diff --git a/db/changes/231801/00-updateisViesClient.sql b/db/.archive/231801/00-updateisViesClient.sql similarity index 100% rename from db/changes/231801/00-updateisViesClient.sql rename to db/.archive/231801/00-updateisViesClient.sql diff --git a/db/changes/231801/00-userAcl.sql b/db/.archive/231801/00-userAcl.sql similarity index 100% rename from db/changes/231801/00-userAcl.sql rename to db/.archive/231801/00-userAcl.sql diff --git a/db/changes/231801/00-userRoleLog.sql b/db/.archive/231801/00-userRoleLog.sql similarity index 100% rename from db/changes/231801/00-userRoleLog.sql rename to db/.archive/231801/00-userRoleLog.sql diff --git a/db/changes/231801/01-viewCompany10L.sql b/db/.archive/231801/01-viewCompany10L.sql similarity index 100% rename from db/changes/231801/01-viewCompany10L.sql rename to db/.archive/231801/01-viewCompany10L.sql diff --git a/db/changes/232001/00-clientWorkerName.sql b/db/.archive/232001/00-clientWorkerName.sql similarity index 100% rename from db/changes/232001/00-clientWorkerName.sql rename to db/.archive/232001/00-clientWorkerName.sql diff --git a/db/changes/232001/00-createWorker.sql b/db/.archive/232001/00-createWorker.sql similarity index 100% rename from db/changes/232001/00-createWorker.sql rename to db/.archive/232001/00-createWorker.sql diff --git a/db/changes/232001/00-invoiceOut_new.sql b/db/.archive/232001/00-invoiceOut_new.sql similarity index 100% rename from db/changes/232001/00-invoiceOut_new.sql rename to db/.archive/232001/00-invoiceOut_new.sql diff --git a/db/changes/232001/00-wagon.sql b/db/.archive/232001/00-wagon.sql similarity index 100% rename from db/changes/232001/00-wagon.sql rename to db/.archive/232001/00-wagon.sql diff --git a/db/changes/232201/00-defaulterView.sql b/db/.archive/232201/00-defaulterView.sql similarity index 100% rename from db/changes/232201/00-defaulterView.sql rename to db/.archive/232201/00-defaulterView.sql diff --git a/db/changes/232201/00-procedurecanAdvance.sql b/db/.archive/232201/00-procedurecanAdvance.sql similarity index 100% rename from db/changes/232201/00-procedurecanAdvance.sql rename to db/.archive/232201/00-procedurecanAdvance.sql diff --git a/db/changes/232201/00-procedurecanbePostponed.sql b/db/.archive/232201/00-procedurecanbePostponed.sql similarity index 100% rename from db/changes/232201/00-procedurecanbePostponed.sql rename to db/.archive/232201/00-procedurecanbePostponed.sql diff --git a/db/changes/232201/00-workerConfigPayMethod.sql b/db/.archive/232201/00-workerConfigPayMethod.sql similarity index 100% rename from db/changes/232201/00-workerConfigPayMethod.sql rename to db/.archive/232201/00-workerConfigPayMethod.sql diff --git a/db/changes/232202/00-procedurecanAdvance.sql b/db/.archive/232202/00-procedurecanAdvance.sql similarity index 100% rename from db/changes/232202/00-procedurecanAdvance.sql rename to db/.archive/232202/00-procedurecanAdvance.sql diff --git a/db/changes/232202/00-procedurecanbePostponed.sql b/db/.archive/232202/00-procedurecanbePostponed.sql similarity index 100% rename from db/changes/232202/00-procedurecanbePostponed.sql rename to db/.archive/232202/00-procedurecanbePostponed.sql diff --git a/db/changes/232401/.gitkeep b/db/.archive/232401/.gitkeep similarity index 100% rename from db/changes/232401/.gitkeep rename to db/.archive/232401/.gitkeep diff --git a/db/changes/232401/00-buyConfig_travelConfig.sql b/db/.archive/232401/00-buyConfig_travelConfig.sql similarity index 100% rename from db/changes/232401/00-buyConfig_travelConfig.sql rename to db/.archive/232401/00-buyConfig_travelConfig.sql diff --git a/db/changes/232401/00-printer.sql b/db/.archive/232401/00-printer.sql similarity index 100% rename from db/changes/232401/00-printer.sql rename to db/.archive/232401/00-printer.sql diff --git a/db/changes/232401/00-ticket_warehouse.sql b/db/.archive/232401/00-ticket_warehouse.sql similarity index 100% rename from db/changes/232401/00-ticket_warehouse.sql rename to db/.archive/232401/00-ticket_warehouse.sql diff --git a/db/changes/232401/00-userPassExpired.sql b/db/.archive/232401/00-userPassExpired.sql similarity index 100% rename from db/changes/232401/00-userPassExpired.sql rename to db/.archive/232401/00-userPassExpired.sql diff --git a/db/changes/232402/00-hotFix_travelConfig.sql b/db/.archive/232402/00-hotFix_travelConfig.sql similarity index 100% rename from db/changes/232402/00-hotFix_travelConfig.sql rename to db/.archive/232402/00-hotFix_travelConfig.sql diff --git a/db/changes/232601/00-aclAccount.sql b/db/.archive/232601/00-aclAccount.sql similarity index 100% rename from db/changes/232601/00-aclAccount.sql rename to db/.archive/232601/00-aclAccount.sql diff --git a/db/changes/232601/00-aclInvoiceTickets.sql b/db/.archive/232601/00-aclInvoiceTickets.sql similarity index 100% rename from db/changes/232601/00-aclInvoiceTickets.sql rename to db/.archive/232601/00-aclInvoiceTickets.sql diff --git a/db/changes/232601/00-aclMailAliasAccount.sql b/db/.archive/232601/00-aclMailAliasAccount.sql similarity index 100% rename from db/changes/232601/00-aclMailAliasAccount.sql rename to db/.archive/232601/00-aclMailAliasAccount.sql diff --git a/db/changes/232601/00-aclMailForward.sql b/db/.archive/232601/00-aclMailForward.sql similarity index 100% rename from db/changes/232601/00-aclMailForward.sql rename to db/.archive/232601/00-aclMailForward.sql diff --git a/db/changes/232601/00-aclRole.sql b/db/.archive/232601/00-aclRole.sql similarity index 100% rename from db/changes/232601/00-aclRole.sql rename to db/.archive/232601/00-aclRole.sql diff --git a/db/changes/232601/00-aclVnUser.sql b/db/.archive/232601/00-aclVnUser.sql similarity index 100% rename from db/changes/232601/00-aclVnUser.sql rename to db/.archive/232601/00-aclVnUser.sql diff --git a/db/changes/232601/00-aclVnUser_renewToken.sql b/db/.archive/232601/00-aclVnUser_renewToken.sql similarity index 100% rename from db/changes/232601/00-aclVnUser_renewToken.sql rename to db/.archive/232601/00-aclVnUser_renewToken.sql diff --git a/db/changes/232601/00-entry_updateComission.sql b/db/.archive/232601/00-entry_updateComission.sql similarity index 100% rename from db/changes/232601/00-entry_updateComission.sql rename to db/.archive/232601/00-entry_updateComission.sql diff --git a/db/changes/232601/00-packingSiteAdvanced.sql b/db/.archive/232601/00-packingSiteAdvanced.sql similarity index 100% rename from db/changes/232601/00-packingSiteAdvanced.sql rename to db/.archive/232601/00-packingSiteAdvanced.sql diff --git a/db/changes/232601/00-salix.sql b/db/.archive/232601/00-salix.sql similarity index 100% rename from db/changes/232601/00-salix.sql rename to db/.archive/232601/00-salix.sql diff --git a/db/changes/232601/00-useSpecificsAcls.sql b/db/.archive/232601/00-useSpecificsAcls.sql similarity index 100% rename from db/changes/232601/00-useSpecificsAcls.sql rename to db/.archive/232601/00-useSpecificsAcls.sql diff --git a/db/changes/232601/01-invoiceOutPdf.sql b/db/.archive/232601/01-invoiceOutPdf.sql similarity index 100% rename from db/changes/232601/01-invoiceOutPdf.sql rename to db/.archive/232601/01-invoiceOutPdf.sql diff --git a/db/changes/232602/01-aclAddAlias.sql b/db/.archive/232602/01-aclAddAlias.sql similarity index 100% rename from db/changes/232602/01-aclAddAlias.sql rename to db/.archive/232602/01-aclAddAlias.sql diff --git a/db/changes/232801/00-authCode.sql b/db/.archive/232801/00-authCode.sql similarity index 100% rename from db/changes/232801/00-authCode.sql rename to db/.archive/232801/00-authCode.sql diff --git a/db/changes/232801/00-client_create.sql b/db/.archive/232801/00-client_create.sql similarity index 100% rename from db/changes/232801/00-client_create.sql rename to db/.archive/232801/00-client_create.sql diff --git a/db/changes/232801/00-client_create2.sql b/db/.archive/232801/00-client_create2.sql similarity index 100% rename from db/changes/232801/00-client_create2.sql rename to db/.archive/232801/00-client_create2.sql diff --git a/db/changes/232801/00-department.sql b/db/.archive/232801/00-department.sql similarity index 100% rename from db/changes/232801/00-department.sql rename to db/.archive/232801/00-department.sql diff --git a/db/changes/232801/00-fix_editCredit.sql b/db/.archive/232801/00-fix_editCredit.sql similarity index 100% rename from db/changes/232801/00-fix_editCredit.sql rename to db/.archive/232801/00-fix_editCredit.sql diff --git a/db/changes/232801/00-user.sql b/db/.archive/232801/00-user.sql similarity index 100% rename from db/changes/232801/00-user.sql rename to db/.archive/232801/00-user.sql diff --git a/db/changes/232802/01-aclWorkerDisable.sql b/db/.archive/232802/01-aclWorkerDisable.sql similarity index 100% rename from db/changes/232802/01-aclWorkerDisable.sql rename to db/.archive/232802/01-aclWorkerDisable.sql diff --git a/db/changes/233001/.gitkeep b/db/.archive/233001/.gitkeep similarity index 100% rename from db/changes/233001/.gitkeep rename to db/.archive/233001/.gitkeep diff --git a/db/changes/233001/00-aclSaleTracking.sql b/db/.archive/233001/00-aclSaleTracking.sql similarity index 100% rename from db/changes/233001/00-aclSaleTracking.sql rename to db/.archive/233001/00-aclSaleTracking.sql diff --git a/db/changes/233001/00-clientSms.sql b/db/.archive/233001/00-clientSms.sql similarity index 100% rename from db/changes/233001/00-clientSms.sql rename to db/.archive/233001/00-clientSms.sql diff --git a/db/changes/233001/00-company.sql b/db/.archive/233001/00-company.sql similarity index 100% rename from db/changes/233001/00-company.sql rename to db/.archive/233001/00-company.sql diff --git a/db/changes/233001/00-fixACLVehicle.sql b/db/.archive/233001/00-fixACLVehicle.sql similarity index 100% rename from db/changes/233001/00-fixACLVehicle.sql rename to db/.archive/233001/00-fixACLVehicle.sql diff --git a/db/changes/233001/00-itemRecycle.sql b/db/.archive/233001/00-itemRecycle.sql similarity index 100% rename from db/changes/233001/00-itemRecycle.sql rename to db/.archive/233001/00-itemRecycle.sql diff --git a/db/changes/233001/00-itemShelving_inventory.sql b/db/.archive/233001/00-itemShelving_inventory.sql similarity index 100% rename from db/changes/233001/00-itemShelving_inventory.sql rename to db/.archive/233001/00-itemShelving_inventory.sql diff --git a/db/changes/233001/00-noUniqueSocialName.sql b/db/.archive/233001/00-noUniqueSocialName.sql similarity index 100% rename from db/changes/233001/00-noUniqueSocialName.sql rename to db/.archive/233001/00-noUniqueSocialName.sql diff --git a/db/changes/233001/00-roadmap.sql b/db/.archive/233001/00-roadmap.sql similarity index 100% rename from db/changes/233001/00-roadmap.sql rename to db/.archive/233001/00-roadmap.sql diff --git a/db/changes/233001/00-roadmapACL.sql b/db/.archive/233001/00-roadmapACL.sql similarity index 100% rename from db/changes/233001/00-roadmapACL.sql rename to db/.archive/233001/00-roadmapACL.sql diff --git a/db/changes/233001/00-ticketWeight.sql b/db/.archive/233001/00-ticketWeight.sql similarity index 100% rename from db/changes/233001/00-ticketWeight.sql rename to db/.archive/233001/00-ticketWeight.sql diff --git a/db/changes/233201/.gitkeep b/db/.archive/233201/.gitkeep similarity index 100% rename from db/changes/233201/.gitkeep rename to db/.archive/233201/.gitkeep diff --git a/db/changes/233201/00-acl_viaexpressConfig.sql b/db/.archive/233201/00-acl_viaexpressConfig.sql similarity index 100% rename from db/changes/233201/00-acl_viaexpressConfig.sql rename to db/.archive/233201/00-acl_viaexpressConfig.sql diff --git a/db/changes/233201/00-transferClient.sql b/db/.archive/233201/00-transferClient.sql similarity index 100% rename from db/changes/233201/00-transferClient.sql rename to db/.archive/233201/00-transferClient.sql diff --git a/db/changes/233201/00-updatePrice.sql b/db/.archive/233201/00-updatePrice.sql similarity index 100% rename from db/changes/233201/00-updatePrice.sql rename to db/.archive/233201/00-updatePrice.sql diff --git a/db/changes/233201/00-viaexpress.sql b/db/.archive/233201/00-viaexpress.sql similarity index 100% rename from db/changes/233201/00-viaexpress.sql rename to db/.archive/233201/00-viaexpress.sql diff --git a/db/changes/233201/00-workerDocuware.sql b/db/.archive/233201/00-workerDocuware.sql similarity index 100% rename from db/changes/233201/00-workerDocuware.sql rename to db/.archive/233201/00-workerDocuware.sql diff --git a/db/changes/234201/01-ticket_add.sql b/db/changes/234201/01-ticket_add.sql new file mode 100644 index 000000000..4281ab993 --- /dev/null +++ b/db/changes/234201/01-ticket_add.sql @@ -0,0 +1,135 @@ +REVOKE EXECUTE ON PROCEDURE `vn`.`ticket_add` TO `employee`; +REVOKE EXECUTE ON PROCEDURE `vn`.`ticket_add` TO `administrative`; +GRANT EXECUTE ON PROCEDURE `vn`.`ticket_add` FROM `developer`; + +DROP PROCEDURE IF EXISTS `vn`.`ticket_add`; + +DELIMITER $$ +$$ +CREATE DEFINER=`root`@`localhost` PROCEDURE `vn`.`ticket_add`( + vClientId INT + ,vShipped DATE + ,vWarehouseFk INT + ,vCompanyFk INT + ,vAddressFk INT + ,vAgencyModeFk INT + ,vRouteFk INT + ,vlanded DATE + ,vUserId INT + ,vIsRequiredZone INT + ,OUT vNewTicket INT) +BEGIN +/** +* Crea un ticket, +* ¡¡NO se debe llamar directamente, llamar a salix que hace comprobaciones previas!! +* +* @param vClientId id del cliente +* @param vShipped dia preparacion +* @param vWarehouseFk id del warehouse +* @param vCompanyFk id la empresa +* @param vAddressFk id del consignatario +* @param vAgencyModeFk id de la agencia +* @param vRouteFk id de la ruta | NULL +* @param vlanded dia llegada +* @param vUserId que crea el ticket +* @param vIsRequiredZone Indica si tiene que tener zona valida para ser creado +* @return vNewTicket id del ticket creado +*/ + DECLARE vZoneFk INT; + DECLARE vPrice DECIMAL(10,2); + DECLARE vBonus DECIMAL(10,2); + DECLARE vIsActive BOOL; + DECLARE vNickname VARCHAR(100); + + IF vClientId IS NULL THEN + CALL util.throw ('CLIENT_NOT_ESPECIFIED'); + END IF; + + SELECT isActive INTO vIsActive + FROM vn.client + WHERE id = vClientId; + + IF NOT vIsActive THEN + CALL util.throw ('CLIENT_NOT_ACTIVE'); + END IF; + + IF NOT vAddressFk OR vAddressFk IS NULL THEN + SELECT id INTO vAddressFk + FROM address + WHERE clientFk = vClientId + AND isDefaultAddress; + END IF; + + IF vAgencyModeFk IS NOT NULL THEN + CALL vn.zone_getShipped (vlanded, vAddressFk, vAgencyModeFk, TRUE); + + SELECT zoneFk, price, bonus + INTO vZoneFk, vPrice, vBonus + FROM tmp.zoneGetShipped + WHERE shipped = vShipped + AND warehouseFk = vWarehouseFk + LIMIT 1; + + IF (vZoneFk IS NULL OR vZoneFk = 0) AND vIsRequiredZone THEN + CALL util.throw ('NOT_ZONE_WITH_THIS_PARAMETERS'); + END IF; + END IF; + + INSERT INTO ticket ( + clientFk, + shipped, + addressFk, + agencyModeFk, + nickname, + warehouseFk, + routeFk, + companyFk, + landed, + zoneFk, + zonePrice, + zoneBonus + ) + SELECT vClientId, + vShipped, + a.id, + vAgencyModeFk, + a.nickname, + vWarehouseFk, + IF(vRouteFk,vRouteFk,NULL), + vCompanyFk, + vlanded, + vZoneFk, + vPrice, + vBonus + FROM address a + 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(); + + INSERT INTO ticketObservation(ticketFk, observationTypeFk, description) + SELECT vNewTicket, ao.observationTypeFk, ao.description + FROM addressObservation ao + JOIN address a ON a.id = ao.addressFk + WHERE a.id = vAddressFk; + + IF (SELECT COUNT(*) + FROM bs.clientNewBorn cnb + WHERE cnb.clientFk = vClientId + AND NOT cnb.isRookie) = 0 THEN + + CALL vn.ticketObservation_addNewBorn(vNewTicket); + END IF; + + 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 ticketTracking(stateFk, ticketFk, workerFk) + SELECT id, vNewTicket, account.myUser_getId() + FROM state + WHERE `code` = 'DELIVERED'; + END IF; +END$$ +DELIMITER ; diff --git a/modules/ticket/back/methods/ticket/new.js b/modules/ticket/back/methods/ticket/new.js index b461fb26d..f41a65c0c 100644 --- a/modules/ticket/back/methods/ticket/new.js +++ b/modules/ticket/back/methods/ticket/new.js @@ -48,7 +48,7 @@ module.exports = Self => { description: `The route id filter` }], returns: { - type: 'number', + type: 'object', root: true }, http: { @@ -125,7 +125,6 @@ module.exports = Self => { true, userId ], myOptions); - const ticket = await models.Ticket.findById(result[1][0].newTicketId, null, myOptions); if (tx) await tx.commit();