8713-testToMaster #3523

Merged
alexm merged 383 commits from 8713-testToMaster into master 2025-03-04 06:52:15 +00:00
14 changed files with 124 additions and 112 deletions
Showing only changes of commit a874b96c5e - Show all commits

View File

@ -23,7 +23,6 @@ BEGIN
DECLARE vInvoiceTypeReceived VARCHAR(1);
DECLARE vInvoiceTypeInformative VARCHAR(1);
DECLARE vIsInformativeExportation BOOL DEFAULT FALSE;
DECLARE vIsDeductible BOOL;
DECLARE vCursor CURSOR FOR
SELECT SUM(it.taxableBase),
@ -32,8 +31,7 @@ BEGIN
it.transactionTypeSageFk,
it.taxTypeSageFk,
tty.isIntracommunity,
tt.ClaveOperacionDefecto,
it.isDeductible
tt.ClaveOperacionDefecto
FROM vn.invoiceIn i
JOIN vn.invoiceInTax it ON it.InvoiceInFk = i.id
JOIN TiposIva t ON t.CodigoIva = it.taxTypeSageFk
@ -67,8 +65,7 @@ BEGIN
vTransactionCode,
vTaxCode,
vIsIntracommunity,
vOperationCode,
vIsDeductible;
vOperationCode;
IF vDone THEN
LEAVE l;
@ -91,8 +88,7 @@ BEGIN
PorIva1 = vRate,
CuotaIva1 = vVat,
CodigoTransaccion1 = vTransactionCode,
CodigoIva1 = vTaxCode,
IvaDeducible1 = vIsDeductible
CodigoIva1 = vTaxCode
WHERE id = vXDiarioFk;
WHEN 2 THEN
@ -101,8 +97,7 @@ BEGIN
PorIva2 = vRate,
CuotaIva2 = vVat,
CodigoTransaccion2 = vTransactionCode,
CodigoIva2 = vTaxCode,
IvaDeducible2 = vIsDeductible
CodigoIva2 = vTaxCode
WHERE id = vXDiarioFk;
WHEN 3 THEN
UPDATE movContaIVA
@ -110,8 +105,7 @@ BEGIN
PorIva3 = vRate,
CuotaIva3 = vVat,
CodigoTransaccion3 = vTransactionCode,
CodigoIva3 = vTaxCode,
IvaDeducible3 = vIsDeductible
CodigoIva3 = vTaxCode
WHERE id = vXDiarioFk;
WHEN 4 THEN
UPDATE movContaIVA
@ -119,8 +113,7 @@ BEGIN
PorIva4 = vRate,
CuotaIva4 = vVat,
CodigoTransaccion4 = vTransactionCode,
CodigoIva4 = vTaxCode,
IvaDeducible4 = vIsDeductible
CodigoIva4 = vTaxCode
WHERE id = vXDiarioFk;
ELSE
SELECT vXDiarioFk INTO vXDiarioFk;
@ -175,6 +168,10 @@ BEGIN
mci.FechaOperacion = ii.issued,
mci.MantenerAsiento = TRUE,
mci.SuFacturaNo = ii.supplierRef,
mci.IvaDeducible1 = IF(id.id, FALSE, IF(IFNULL(mci.BaseIva1, FALSE) = FALSE, FALSE, ii.isVatDeductible)),
mci.IvaDeducible2 = IF(id.id, FALSE, IF(IFNULL(mci.BaseIva2, FALSE) = FALSE, FALSE, ii.isVatDeductible)),
mci.IvaDeducible3 = IF(id.id, FALSE, IF(IFNULL(mci.BaseIva3, FALSE) = FALSE, FALSE, ii.isVatDeductible)),
mci.IvaDeducible4 = IF(id.id, FALSE, IF(IFNULL(mci.BaseIva4, FALSE) = FALSE, FALSE, ii.isVatDeductible)),
mci.FechaFacturaOriginal = x.FECHA_EX
WHERE mci.id = vXDiarioFk;

View File

@ -67,6 +67,7 @@ BEGIN
i.serial COLLATE utf8mb3_unicode_ci serial,
i.supplierFk,
i.issued,
IF(expenseFkDeductible, FALSE, i.isVatDeductible) isVatDeductible,
IF(c.code = 'EUR', '',c.`code`) currencyFk
FROM vn.invoiceIn i
JOIN vn.currency c ON c.id = i.currencyFk
@ -77,6 +78,7 @@ BEGIN
vSerialDua COLLATE utf8mb3_unicode_ci,
d.companyFk ,
d.issued,
FALSE,
'' -- EUROS
FROM vn.dua d
WHERE d.issued IS NOT NULL

View File

@ -32,7 +32,7 @@ BEGIN
SELECT ii.bookEntried,
iit.foreignValue,
ii.companyFk,
iit.isDeductible,
ii.expenseFkDeductible,
iit.taxableBase,
iit.transactionTypeSageFk,
ii.serial,
@ -184,7 +184,7 @@ BEGIN
empresa_id)
SELECT vBookNumber ASIEN,
tii.bookEntried FECHA,
IF(tii.isDeductible, tii.expenseFk, tii.CuentaIvaSoportado) SUBCTA,
IF(tii.expenseFkDeductible>0, tii.expenseFkDeductible, tii.CuentaIvaSoportado) SUBCTA,
tii.supplierAccount CONTRA,
SUM(ROUND(tii.PorcentajeIva * tii.taxableBase / 100, 2)) EURODEBE,
SUM(tii.taxableBase) BASEEURO,

View File

@ -20,5 +20,7 @@ AS SELECT `r`.`id` AS `id`,
`r`.`cplusTaxBreakFk` AS `cplusTaxBreakFk`,
`r`.`siiTrascendencyInvoiceInFk` AS `siiTrascendencyInvoiceInFk`,
`r`.`bookEntried` AS `bookEntried`,
`r`.`withholdingSageFk` AS `withholdingSageFk`
`r`.`isVatDeductible` AS `isVatDeductible`,
`r`.`withholdingSageFk` AS `withholdingSageFk`,
`r`.`expenseFkDeductible` AS `expenseFkDeductible`
FROM `vn`.`invoiceIn` `r`

View File

@ -1,8 +0,0 @@
ALTER TABLE vn.invoiceInTax ADD isDeductible TINYINT(1) DEFAULT FALSE NOT NULL;
ALTER TABLE vn.invoiceIn CHANGE expenseFkDeductible expenseFkDeductible__ varchar(10)
CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL NULL COMMENT '@deprecated 2025-02-15';
ALTER TABLE vn.invoiceIn CHANGE isVatDeductible isVatDeductible__ tinyint(1)
DEFAULT 1 NOT NULL COMMENT '@deprecated 2025-02-15';

View File

@ -255,12 +255,7 @@
"Holidays to past days not available": "Holidays to past days not available",
"Incorrect delivery order alert on route": "Incorrect delivery order alert on route: {{ route }} zone: {{ zone }}",
"Ticket has been delivered out of order": "The ticket {{ticket}} of route {{{fullUrl}}} has been delivered out of order.",
"clonedFromTicketWeekly": ", that is a cloned sale from ticket {{ ticketWeekly }}",
"clonedFromTicketWeekly": ", that is a cloned sale from ticket {{ ticketWeekly }}",
"negativeReplaced": "Replaced item [#{{oldItemId}}]({{{oldItemUrl}}}) {{oldItem}} with [#{{newItemId}}]({{{newItemUrl}}}) {{newItem}} from ticket [{{ticketId}}]({{{ticketUrl}}})",
"The tag and priority can't be repeated": "The tag and priority can't be repeated",
"workerSocialName": "workerSocialName",
"workerName": "workerName",
"The tag or priority can't be repeated for an item": "The tag or priority can't be repeated for an item",
"An item type with the same code already exists": "An item type with the same code already exists",
"null": "null"
"The tag and priority can't be repeated": "The tag and priority can't be repeated"
}

View File

@ -16,6 +16,7 @@ columns:
bookEntried: book entried
isVatDeductible: is VAT deductible
withholdingSageFk: withholding
expenseFkDeductible: expense deductible
editorFk: editor
siiTrasCendencyInvoiceInFk: SII tax regime
siiTypeInvoiceInFk: SII Type

View File

@ -16,6 +16,7 @@ columns:
bookEntried: fecha asiento
isVatDeductible: impuesto deducible
withholdingSageFk: código de retención
expenseFkDeductible: gasto deducible
editorFk: editor
siiTrasCendencyInvoiceInFk: régimen fiscal SII
siiTypeInvoiceInFk: tipo SII

View File

@ -46,6 +46,7 @@ module.exports = Self => {
'issued',
'currencyFk',
'companyFk',
'isVatDeductible',
'withholdingSageFk',
'deductibleExpenseFk',
],
@ -78,6 +79,7 @@ module.exports = Self => {
issued: issued,
currencyFk: sourceInvoiceIn.currencyFk,
companyFk: sourceInvoiceIn.companyFk,
isVatDeductible: sourceInvoiceIn.isVatDeductible,
withholdingSageFk: sourceInvoiceIn.withholdingSageFk,
deductibleExpenseFk: sourceInvoiceIn.deductibleExpenseFk,
}, myOptions);

View File

@ -184,6 +184,7 @@ module.exports = Self => {
ii.docFk dmsFk,
dm.file,
ii.supplierFk,
ii.expenseFkDeductible deductibleExpenseFk,
s.name supplierName,
s.account,
SUM(iid.amount) amount,

View File

@ -123,6 +123,12 @@ module.exports = Self => {
}]
}
},
{
relation: 'expenseDeductible',
scope: {
fields: ['id', 'name', 'taxTypeFk']
}
},
{
relation: 'currency',
scope: {

View File

@ -24,9 +24,6 @@
"expenseFk": {
"type": "string"
},
"isDeductible": {
"type": "boolean"
},
"created": {
"type": "date"
}

View File

@ -36,6 +36,9 @@
"booked": {
"type": "date"
},
"isVatDeductible": {
"type": "boolean"
},
"operated": {
"type": "date"
},
@ -47,6 +50,12 @@
"mysql": {
"columnName": "docFk"
}
},
"deductibleExpenseFk": {
"type": "number",
"mysql": {
"columnName": "expenseFkDeductible"
}
}
},
"relations": {
@ -70,6 +79,11 @@
"model": "SageWithholding",
"foreignKey": "withholdingSageFk"
},
"expenseDeductible": {
"type": "belongsTo",
"model": "Expense",
"foreignKey": "deductibleExpenseFk"
},
"company": {
"type": "belongsTo",
"model": "Company",

View File

@ -36,6 +36,8 @@
<vn-one>
<vn-label-value label="Sage withholding" value="{{$ctrl.summary.sageWithholding.withholding}}">
</vn-label-value>
<vn-label-value label="Undeductible VAT" value="{{$ctrl.summary.expenseDeductible.name}}">
</vn-label-value>
<vn-label-value label="Company" value="{{$ctrl.summary.company.code}}">
</vn-label-value>
<vn-vertical>