From b07858fddbaf04dc79f96799468cff2e528a2c6c Mon Sep 17 00:00:00 2001 From: jorgep Date: Thu, 9 Nov 2023 14:33:46 +0100 Subject: [PATCH] ref #5914 replace name --- db/.archive/225201/00-invoiceOut_new.sql | 2 +- db/.archive/231001/02-invoiceOut_new.sql | 2 +- db/.archive/232001/00-invoiceOut_new.sql | 2 +- db/dump/dumpedFixtures.sql | 10 ++++---- db/dump/structure.sql | 25 +++++++++---------- db/export-data.sh | 2 +- .../invoiceOut/specs/transferinvoice.spec.js | 8 +++--- .../back/models/invoice-correction.json | 2 +- .../back/models/sii-type-invoice-out.json | 3 --- 9 files changed, 26 insertions(+), 30 deletions(-) diff --git a/db/.archive/225201/00-invoiceOut_new.sql b/db/.archive/225201/00-invoiceOut_new.sql index 4c60b50bc..8e23fb43b 100644 --- a/db/.archive/225201/00-invoiceOut_new.sql +++ b/db/.archive/225201/00-invoiceOut_new.sql @@ -74,7 +74,7 @@ BEGIN clientFk, dued, companyFk, - cplusInvoiceType477Fk + siiTypeInvoiceOutFk ) SELECT 1, diff --git a/db/.archive/231001/02-invoiceOut_new.sql b/db/.archive/231001/02-invoiceOut_new.sql index d2b96eff7..d570dfb72 100644 --- a/db/.archive/231001/02-invoiceOut_new.sql +++ b/db/.archive/231001/02-invoiceOut_new.sql @@ -96,7 +96,7 @@ BEGIN clientFk, dued, companyFk, - cplusInvoiceType477Fk + siiTypeInvoiceOutFk ) SELECT 1, diff --git a/db/.archive/232001/00-invoiceOut_new.sql b/db/.archive/232001/00-invoiceOut_new.sql index b4fc5c824..b497dffda 100644 --- a/db/.archive/232001/00-invoiceOut_new.sql +++ b/db/.archive/232001/00-invoiceOut_new.sql @@ -96,7 +96,7 @@ BEGIN clientFk, dued, companyFk, - cplusInvoiceType477Fk + siiTypeInvoiceOutFk ) SELECT 1, diff --git a/db/dump/dumpedFixtures.sql b/db/dump/dumpedFixtures.sql index 2e1511b59..43eba7f24 100644 --- a/db/dump/dumpedFixtures.sql +++ b/db/dump/dumpedFixtures.sql @@ -275,13 +275,13 @@ INSERT INTO `cplusInvoiceType472` VALUES (1,'F1 - Factura'),(2,'F2 - Factura sim UNLOCK TABLES; -- --- Dumping data for table `cplusInvoiceType477` +-- Dumping data for table `siiTypeInvoiceOut` -- -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'); -/*!40000 ALTER TABLE `cplusInvoiceType477` ENABLE KEYS */; +LOCK TABLES `siiTypeInvoiceOut` WRITE; +/*!40000 ALTER TABLE `siiTypeInvoiceOut` DISABLE KEYS */; +INSERT INTO `siiTypeInvoiceOut` 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 `siiTypeInvoiceOut` ENABLE KEYS */; UNLOCK TABLES; -- diff --git a/db/dump/structure.sql b/db/dump/structure.sql index b242821fc..f50868b19 100644 --- a/db/dump/structure.sql +++ b/db/dump/structure.sql @@ -25993,13 +25993,12 @@ CREATE TABLE `cplusInvoiceType472` ( /*!40101 SET character_set_client = @saved_cs_client */; -- --- Table structure for table `cplusInvoiceType477` +-- Table structure for table `siiTypeInvoiceOut` -- - -DROP TABLE IF EXISTS `cplusInvoiceType477`; +DROP TABLE IF EXISTS `siiTypeInvoiceOut`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; -CREATE TABLE `cplusInvoiceType477` ( +CREATE TABLE `siiTypeInvoiceOut` ( `id` int(10) unsigned NOT NULL, `description` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL, PRIMARY KEY (`id`) @@ -29450,16 +29449,16 @@ CREATE TABLE `invoiceCorrection` ( `correctingFk` int(10) unsigned NOT NULL COMMENT 'Factura rectificativa', `correctedFk` int(10) unsigned NOT NULL COMMENT 'Factura rectificada', `cplusRectificationTypeFk` int(10) unsigned NOT NULL, - `cplusInvoiceType477Fk` int(10) unsigned NOT NULL, + `siiTypeInvoiceOutFk` int(10) unsigned NOT NULL, `invoiceCorrectionTypeFk` int(11) NOT NULL DEFAULT 3, PRIMARY KEY (`correctingFk`), KEY `correctedFk_idx` (`correctedFk`), KEY `invoiceCorrection_ibfk_1_idx` (`cplusRectificationTypeFk`), - KEY `cplusInvoiceTyoeFk_idx` (`cplusInvoiceType477Fk`), + KEY `cplusInvoiceTyoeFk_idx` (`siiTypeInvoiceOutFk`), KEY `invoiceCorrectionTypeFk_idx` (`invoiceCorrectionTypeFk`), CONSTRAINT `corrected_fk` FOREIGN KEY (`correctedFk`) REFERENCES `invoiceOut` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `correcting_fk` FOREIGN KEY (`correctingFk`) REFERENCES `invoiceOut` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `cplusInvoiceTyoeFk` FOREIGN KEY (`cplusInvoiceType477Fk`) REFERENCES `cplusInvoiceType477` (`id`) ON UPDATE CASCADE, + CONSTRAINT `cplusInvoiceTyoeFk` FOREIGN KEY (`siiTypeInvoiceOutFk`) REFERENCES `siiTypeInvoiceOut` (`id`) ON UPDATE CASCADE, CONSTRAINT `invoiceCorrectionType_Fk33` FOREIGN KEY (`invoiceCorrectionTypeFk`) REFERENCES `invoiceCorrectionType` (`id`) ON UPDATE CASCADE, CONSTRAINT `invoiceCorrection_ibfk_1` FOREIGN KEY (`cplusRectificationTypeFk`) REFERENCES `cplusRectificationType` (`id`) ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='Relacion entre las facturas rectificativas y las rectificadas.'; @@ -30130,7 +30129,7 @@ CREATE TABLE `invoiceOut` ( `companyFk` int(10) unsigned NOT NULL DEFAULT 442, `hasPdf` tinyint(3) unsigned NOT NULL DEFAULT 0, `booked` date DEFAULT NULL, - `cplusInvoiceType477Fk` int(10) unsigned NOT NULL DEFAULT 1, + `siiTypeInvoiceOutFk` int(10) unsigned NOT NULL DEFAULT 1, `cplusTaxBreakFk` int(10) unsigned NOT NULL DEFAULT 1, `cplusSubjectOpFk` int(10) unsigned NOT NULL DEFAULT 1, `cplusTrascendency477Fk` int(10) unsigned NOT NULL DEFAULT 1, @@ -30140,13 +30139,13 @@ CREATE TABLE `invoiceOut` ( KEY `Id_Cliente` (`clientFk`), KEY `empresa_id` (`companyFk`), KEY `Fecha` (`issued`), - KEY `Facturas_ibfk_2_idx` (`cplusInvoiceType477Fk`), + KEY `Facturas_ibfk_2_idx` (`siiTypeInvoiceOutFk`), KEY `Facturas_ibfk_3_idx` (`cplusSubjectOpFk`), KEY `Facturas_ibfk_4_idx` (`cplusTaxBreakFk`), KEY `Facturas_ibfk_5_idx` (`cplusTrascendency477Fk`), KEY `Facturas_idx_Vencimiento` (`dued`), KEY `invoiceOut_serial` (`serial`), - CONSTRAINT `invoiceOut_ibfk_2` FOREIGN KEY (`cplusInvoiceType477Fk`) REFERENCES `cplusInvoiceType477` (`id`) ON UPDATE CASCADE, + CONSTRAINT `invoiceOut_ibfk_2` FOREIGN KEY (`siiTypeInvoiceOutFk`) REFERENCES `siiTypeInvoiceOut` (`id`) ON UPDATE CASCADE, CONSTRAINT `invoiceOut_ibfk_3` FOREIGN KEY (`cplusSubjectOpFk`) REFERENCES `cplusSubjectOp` (`id`) ON UPDATE CASCADE, CONSTRAINT `invoiceOut_ibfk_4` FOREIGN KEY (`cplusTaxBreakFk`) REFERENCES `cplusTaxBreak` (`id`) ON UPDATE CASCADE, CONSTRAINT `invoiceOut_serial` FOREIGN KEY (`serial`) REFERENCES `invoiceOutSerial` (`code`), @@ -30308,7 +30307,7 @@ CREATE TABLE `invoiceOutSerial` ( `isTaxed` tinyint(1) NOT NULL DEFAULT 1, `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, + `siiTypeInvoiceOutFk` int(10) unsigned DEFAULT 1, `footNotes` longtext DEFAULT NULL, `isRefEditable` tinyint(4) NOT NULL DEFAULT 0, `type` enum('global','quick') DEFAULT NULL, @@ -58288,7 +58287,7 @@ BEGIN io.cplusTrascendency477Fk AS TIPOCLAVE, io.cplusTaxBreakFk AS TIPOEXENCI, io.cplusSubjectOpFk AS TIPONOSUJE, - io.cplusInvoiceType477Fk AS TIPOFACT, + io.siiTypeInvoiceOutFk AS TIPOFACT, ic.cplusRectificationTypeFk AS TIPORECTIF, io.companyFk, RIGHT(io.ref, LENGTH(io.ref) - 1) AS invoiceNum, @@ -58868,7 +58867,7 @@ BEGIN clientFk, dued, companyFk, - cplusInvoiceType477Fk + siiTypeInvoiceOutFk ) SELECT 1, diff --git a/db/export-data.sh b/db/export-data.sh index 7d346b235..a516992d3 100755 --- a/db/export-data.sh +++ b/db/export-data.sh @@ -46,7 +46,7 @@ TABLES=( bookingPlanner businessType cplusInvoiceType472 - cplusInvoiceType477 + siiTypeInvoiceOut cplusRectificationType cplusSubjectOp cplusTaxBreak diff --git a/modules/invoiceOut/back/methods/invoiceOut/specs/transferinvoice.spec.js b/modules/invoiceOut/back/methods/invoiceOut/specs/transferinvoice.spec.js index 04f6df299..876948419 100644 --- a/modules/invoiceOut/back/methods/invoiceOut/specs/transferinvoice.spec.js +++ b/modules/invoiceOut/back/methods/invoiceOut/specs/transferinvoice.spec.js @@ -2,7 +2,7 @@ const models = require('vn-loopback/server/server').models; const LoopBackContext = require('loopback-context'); -describe('InvoiceOut tranferInvoice()', () => { +fdescribe('InvoiceOut tranferInvoice()', () => { const activeCtx = { accessToken: {userId: 5}, http: { @@ -19,7 +19,7 @@ describe('InvoiceOut tranferInvoice()', () => { }); }); - it('should return the id of the created issued invoice', async() => { + fit('should return the id of the created issued invoice', async() => { const tx = await models.InvoiceOut.beginTransaction({}); const options = {transaction: tx}; const args = { @@ -27,7 +27,7 @@ describe('InvoiceOut tranferInvoice()', () => { ref: 'T4444444', newClientFk: 1, cplusRectificationId: 1, - cplusInvoiceType477Id: 1, + siiTypeInvoiceOutId: 1, invoiceCorrectionTypeId: 1 }; ctx.args = args; @@ -52,7 +52,7 @@ describe('InvoiceOut tranferInvoice()', () => { ref: 'T1111111', newClientFk: 1101, cplusRectificationId: 1, - cplusInvoiceType477Id: 1, + siiTypeInvoiceOutId: 1, invoiceCorrectionTypeId: 1 }; ctx.args = args; diff --git a/modules/invoiceOut/back/models/invoice-correction.json b/modules/invoiceOut/back/models/invoice-correction.json index 48bd172a6..7c6f01571 100644 --- a/modules/invoiceOut/back/models/invoice-correction.json +++ b/modules/invoiceOut/back/models/invoice-correction.json @@ -18,7 +18,7 @@ "cplusRectificationTypeFk": { "type": "number" }, - "cplusInvoiceType477Fk": { + "siiTypeInvoiceOutFk": { "type": "number" }, "invoiceCorrectionTypeFk": { diff --git a/modules/invoiceOut/back/models/sii-type-invoice-out.json b/modules/invoiceOut/back/models/sii-type-invoice-out.json index 89f01bd74..06934b1cc 100644 --- a/modules/invoiceOut/back/models/sii-type-invoice-out.json +++ b/modules/invoiceOut/back/models/sii-type-invoice-out.json @@ -12,9 +12,6 @@ "type": "number", "description": "Identifier" }, - "code": { - "type": "string" - }, "description": { "type": "string" }