This commit is contained in:
parent
3e45334149
commit
b07858fddb
|
@ -74,7 +74,7 @@ BEGIN
|
||||||
clientFk,
|
clientFk,
|
||||||
dued,
|
dued,
|
||||||
companyFk,
|
companyFk,
|
||||||
cplusInvoiceType477Fk
|
siiTypeInvoiceOutFk
|
||||||
)
|
)
|
||||||
SELECT
|
SELECT
|
||||||
1,
|
1,
|
||||||
|
|
|
@ -96,7 +96,7 @@ BEGIN
|
||||||
clientFk,
|
clientFk,
|
||||||
dued,
|
dued,
|
||||||
companyFk,
|
companyFk,
|
||||||
cplusInvoiceType477Fk
|
siiTypeInvoiceOutFk
|
||||||
)
|
)
|
||||||
SELECT
|
SELECT
|
||||||
1,
|
1,
|
||||||
|
|
|
@ -96,7 +96,7 @@ BEGIN
|
||||||
clientFk,
|
clientFk,
|
||||||
dued,
|
dued,
|
||||||
companyFk,
|
companyFk,
|
||||||
cplusInvoiceType477Fk
|
siiTypeInvoiceOutFk
|
||||||
)
|
)
|
||||||
SELECT
|
SELECT
|
||||||
1,
|
1,
|
||||||
|
|
|
@ -275,13 +275,13 @@ INSERT INTO `cplusInvoiceType472` VALUES (1,'F1 - Factura'),(2,'F2 - Factura sim
|
||||||
UNLOCK TABLES;
|
UNLOCK TABLES;
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Dumping data for table `cplusInvoiceType477`
|
-- Dumping data for table `siiTypeInvoiceOut`
|
||||||
--
|
--
|
||||||
|
|
||||||
LOCK TABLES `cplusInvoiceType477` WRITE;
|
LOCK TABLES `siiTypeInvoiceOut` WRITE;
|
||||||
/*!40000 ALTER TABLE `cplusInvoiceType477` DISABLE KEYS */;
|
/*!40000 ALTER TABLE `siiTypeInvoiceOut` 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 `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 `cplusInvoiceType477` ENABLE KEYS */;
|
/*!40000 ALTER TABLE `siiTypeInvoiceOut` ENABLE KEYS */;
|
||||||
UNLOCK TABLES;
|
UNLOCK TABLES;
|
||||||
|
|
||||||
--
|
--
|
||||||
|
|
|
@ -25993,13 +25993,12 @@ CREATE TABLE `cplusInvoiceType472` (
|
||||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Table structure for table `cplusInvoiceType477`
|
-- Table structure for table `siiTypeInvoiceOut`
|
||||||
--
|
--
|
||||||
|
DROP TABLE IF EXISTS `siiTypeInvoiceOut`;
|
||||||
DROP TABLE IF EXISTS `cplusInvoiceType477`;
|
|
||||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
/*!40101 SET character_set_client = utf8 */;
|
/*!40101 SET character_set_client = utf8 */;
|
||||||
CREATE TABLE `cplusInvoiceType477` (
|
CREATE TABLE `siiTypeInvoiceOut` (
|
||||||
`id` int(10) unsigned NOT NULL,
|
`id` int(10) unsigned NOT NULL,
|
||||||
`description` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
|
`description` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
|
||||||
PRIMARY KEY (`id`)
|
PRIMARY KEY (`id`)
|
||||||
|
@ -29450,16 +29449,16 @@ CREATE TABLE `invoiceCorrection` (
|
||||||
`correctingFk` int(10) unsigned NOT NULL COMMENT 'Factura rectificativa',
|
`correctingFk` int(10) unsigned NOT NULL COMMENT 'Factura rectificativa',
|
||||||
`correctedFk` int(10) unsigned NOT NULL COMMENT 'Factura rectificada',
|
`correctedFk` int(10) unsigned NOT NULL COMMENT 'Factura rectificada',
|
||||||
`cplusRectificationTypeFk` int(10) unsigned NOT NULL,
|
`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,
|
`invoiceCorrectionTypeFk` int(11) NOT NULL DEFAULT 3,
|
||||||
PRIMARY KEY (`correctingFk`),
|
PRIMARY KEY (`correctingFk`),
|
||||||
KEY `correctedFk_idx` (`correctedFk`),
|
KEY `correctedFk_idx` (`correctedFk`),
|
||||||
KEY `invoiceCorrection_ibfk_1_idx` (`cplusRectificationTypeFk`),
|
KEY `invoiceCorrection_ibfk_1_idx` (`cplusRectificationTypeFk`),
|
||||||
KEY `cplusInvoiceTyoeFk_idx` (`cplusInvoiceType477Fk`),
|
KEY `cplusInvoiceTyoeFk_idx` (`siiTypeInvoiceOutFk`),
|
||||||
KEY `invoiceCorrectionTypeFk_idx` (`invoiceCorrectionTypeFk`),
|
KEY `invoiceCorrectionTypeFk_idx` (`invoiceCorrectionTypeFk`),
|
||||||
CONSTRAINT `corrected_fk` FOREIGN KEY (`correctedFk`) REFERENCES `invoiceOut` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
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 `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 `invoiceCorrectionType_Fk33` FOREIGN KEY (`invoiceCorrectionTypeFk`) REFERENCES `invoiceCorrectionType` (`id`) ON UPDATE CASCADE,
|
||||||
CONSTRAINT `invoiceCorrection_ibfk_1` FOREIGN KEY (`cplusRectificationTypeFk`) REFERENCES `cplusRectificationType` (`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.';
|
) 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,
|
`companyFk` int(10) unsigned NOT NULL DEFAULT 442,
|
||||||
`hasPdf` tinyint(3) unsigned NOT NULL DEFAULT 0,
|
`hasPdf` tinyint(3) unsigned NOT NULL DEFAULT 0,
|
||||||
`booked` date DEFAULT NULL,
|
`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,
|
`cplusTaxBreakFk` int(10) unsigned NOT NULL DEFAULT 1,
|
||||||
`cplusSubjectOpFk` int(10) unsigned NOT NULL DEFAULT 1,
|
`cplusSubjectOpFk` int(10) unsigned NOT NULL DEFAULT 1,
|
||||||
`cplusTrascendency477Fk` 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 `Id_Cliente` (`clientFk`),
|
||||||
KEY `empresa_id` (`companyFk`),
|
KEY `empresa_id` (`companyFk`),
|
||||||
KEY `Fecha` (`issued`),
|
KEY `Fecha` (`issued`),
|
||||||
KEY `Facturas_ibfk_2_idx` (`cplusInvoiceType477Fk`),
|
KEY `Facturas_ibfk_2_idx` (`siiTypeInvoiceOutFk`),
|
||||||
KEY `Facturas_ibfk_3_idx` (`cplusSubjectOpFk`),
|
KEY `Facturas_ibfk_3_idx` (`cplusSubjectOpFk`),
|
||||||
KEY `Facturas_ibfk_4_idx` (`cplusTaxBreakFk`),
|
KEY `Facturas_ibfk_4_idx` (`cplusTaxBreakFk`),
|
||||||
KEY `Facturas_ibfk_5_idx` (`cplusTrascendency477Fk`),
|
KEY `Facturas_ibfk_5_idx` (`cplusTrascendency477Fk`),
|
||||||
KEY `Facturas_idx_Vencimiento` (`dued`),
|
KEY `Facturas_idx_Vencimiento` (`dued`),
|
||||||
KEY `invoiceOut_serial` (`serial`),
|
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_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_ibfk_4` FOREIGN KEY (`cplusTaxBreakFk`) REFERENCES `cplusTaxBreak` (`id`) ON UPDATE CASCADE,
|
||||||
CONSTRAINT `invoiceOut_serial` FOREIGN KEY (`serial`) REFERENCES `invoiceOutSerial` (`code`),
|
CONSTRAINT `invoiceOut_serial` FOREIGN KEY (`serial`) REFERENCES `invoiceOutSerial` (`code`),
|
||||||
|
@ -30308,7 +30307,7 @@ CREATE TABLE `invoiceOutSerial` (
|
||||||
`isTaxed` tinyint(1) NOT NULL DEFAULT 1,
|
`isTaxed` tinyint(1) NOT NULL DEFAULT 1,
|
||||||
`taxAreaFk` varchar(15) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci 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,
|
`isCEE` tinyint(1) NOT NULL DEFAULT 0,
|
||||||
`cplusInvoiceType477Fk` int(10) unsigned DEFAULT 1,
|
`siiTypeInvoiceOutFk` int(10) unsigned DEFAULT 1,
|
||||||
`footNotes` longtext DEFAULT NULL,
|
`footNotes` longtext DEFAULT NULL,
|
||||||
`isRefEditable` tinyint(4) NOT NULL DEFAULT 0,
|
`isRefEditable` tinyint(4) NOT NULL DEFAULT 0,
|
||||||
`type` enum('global','quick') DEFAULT NULL,
|
`type` enum('global','quick') DEFAULT NULL,
|
||||||
|
@ -58288,7 +58287,7 @@ BEGIN
|
||||||
io.cplusTrascendency477Fk AS TIPOCLAVE,
|
io.cplusTrascendency477Fk AS TIPOCLAVE,
|
||||||
io.cplusTaxBreakFk AS TIPOEXENCI,
|
io.cplusTaxBreakFk AS TIPOEXENCI,
|
||||||
io.cplusSubjectOpFk AS TIPONOSUJE,
|
io.cplusSubjectOpFk AS TIPONOSUJE,
|
||||||
io.cplusInvoiceType477Fk AS TIPOFACT,
|
io.siiTypeInvoiceOutFk AS TIPOFACT,
|
||||||
ic.cplusRectificationTypeFk AS TIPORECTIF,
|
ic.cplusRectificationTypeFk AS TIPORECTIF,
|
||||||
io.companyFk,
|
io.companyFk,
|
||||||
RIGHT(io.ref, LENGTH(io.ref) - 1) AS invoiceNum,
|
RIGHT(io.ref, LENGTH(io.ref) - 1) AS invoiceNum,
|
||||||
|
@ -58868,7 +58867,7 @@ BEGIN
|
||||||
clientFk,
|
clientFk,
|
||||||
dued,
|
dued,
|
||||||
companyFk,
|
companyFk,
|
||||||
cplusInvoiceType477Fk
|
siiTypeInvoiceOutFk
|
||||||
)
|
)
|
||||||
SELECT
|
SELECT
|
||||||
1,
|
1,
|
||||||
|
|
|
@ -46,7 +46,7 @@ TABLES=(
|
||||||
bookingPlanner
|
bookingPlanner
|
||||||
businessType
|
businessType
|
||||||
cplusInvoiceType472
|
cplusInvoiceType472
|
||||||
cplusInvoiceType477
|
siiTypeInvoiceOut
|
||||||
cplusRectificationType
|
cplusRectificationType
|
||||||
cplusSubjectOp
|
cplusSubjectOp
|
||||||
cplusTaxBreak
|
cplusTaxBreak
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
const models = require('vn-loopback/server/server').models;
|
const models = require('vn-loopback/server/server').models;
|
||||||
const LoopBackContext = require('loopback-context');
|
const LoopBackContext = require('loopback-context');
|
||||||
|
|
||||||
describe('InvoiceOut tranferInvoice()', () => {
|
fdescribe('InvoiceOut tranferInvoice()', () => {
|
||||||
const activeCtx = {
|
const activeCtx = {
|
||||||
accessToken: {userId: 5},
|
accessToken: {userId: 5},
|
||||||
http: {
|
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 tx = await models.InvoiceOut.beginTransaction({});
|
||||||
const options = {transaction: tx};
|
const options = {transaction: tx};
|
||||||
const args = {
|
const args = {
|
||||||
|
@ -27,7 +27,7 @@ describe('InvoiceOut tranferInvoice()', () => {
|
||||||
ref: 'T4444444',
|
ref: 'T4444444',
|
||||||
newClientFk: 1,
|
newClientFk: 1,
|
||||||
cplusRectificationId: 1,
|
cplusRectificationId: 1,
|
||||||
cplusInvoiceType477Id: 1,
|
siiTypeInvoiceOutId: 1,
|
||||||
invoiceCorrectionTypeId: 1
|
invoiceCorrectionTypeId: 1
|
||||||
};
|
};
|
||||||
ctx.args = args;
|
ctx.args = args;
|
||||||
|
@ -52,7 +52,7 @@ describe('InvoiceOut tranferInvoice()', () => {
|
||||||
ref: 'T1111111',
|
ref: 'T1111111',
|
||||||
newClientFk: 1101,
|
newClientFk: 1101,
|
||||||
cplusRectificationId: 1,
|
cplusRectificationId: 1,
|
||||||
cplusInvoiceType477Id: 1,
|
siiTypeInvoiceOutId: 1,
|
||||||
invoiceCorrectionTypeId: 1
|
invoiceCorrectionTypeId: 1
|
||||||
};
|
};
|
||||||
ctx.args = args;
|
ctx.args = args;
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
"cplusRectificationTypeFk": {
|
"cplusRectificationTypeFk": {
|
||||||
"type": "number"
|
"type": "number"
|
||||||
},
|
},
|
||||||
"cplusInvoiceType477Fk": {
|
"siiTypeInvoiceOutFk": {
|
||||||
"type": "number"
|
"type": "number"
|
||||||
},
|
},
|
||||||
"invoiceCorrectionTypeFk": {
|
"invoiceCorrectionTypeFk": {
|
||||||
|
|
|
@ -12,9 +12,6 @@
|
||||||
"type": "number",
|
"type": "number",
|
||||||
"description": "Identifier"
|
"description": "Identifier"
|
||||||
},
|
},
|
||||||
"code": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"description": {
|
"description": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue