Merge branch '7929-createTableMaterial' of https://gitea.verdnatura.es/verdnatura/salix into 7929-createTableMaterial
gitea/salix/pipeline/pr-master This commit looks good
Details
gitea/salix/pipeline/pr-master This commit looks good
Details
This commit is contained in:
commit
0cdf2af807
|
@ -138,9 +138,9 @@ module.exports = Self => {
|
||||||
? {'ii.id': value}
|
? {'ii.id': value}
|
||||||
: {'s.name': {like: `%${value}%`}};
|
: {'s.name': {like: `%${value}%`}};
|
||||||
case 'from':
|
case 'from':
|
||||||
return {'ii.created': {gte: value}};
|
return {'ii.issued': {gte: value}};
|
||||||
case 'to':
|
case 'to':
|
||||||
return {'ii.created': {lte: value}};
|
return {'ii.issued': {lte: value}};
|
||||||
case 'fi':
|
case 'fi':
|
||||||
return {'s.nif': value};
|
return {'s.nif': value};
|
||||||
case 'account':
|
case 'account':
|
||||||
|
@ -173,7 +173,6 @@ module.exports = Self => {
|
||||||
const stmt = new ParameterizedSQL(
|
const stmt = new ParameterizedSQL(
|
||||||
`SELECT
|
`SELECT
|
||||||
ii.id,
|
ii.id,
|
||||||
ii.serialNumber,
|
|
||||||
ii.serial,
|
ii.serial,
|
||||||
ii.issued,
|
ii.issued,
|
||||||
ii.isBooked,
|
ii.isBooked,
|
||||||
|
|
|
@ -27,10 +27,12 @@ module.exports = Self => {
|
||||||
|
|
||||||
const [result] = await Self.rawSql(`
|
const [result] = await Self.rawSql(`
|
||||||
SELECT iit.*,
|
SELECT iit.*,
|
||||||
SUM(iidd.amount) totalDueDay
|
SUM(iidd.amount) totalDueDay,
|
||||||
|
SUM(iidd.foreignValue) totalDueDayForeignValue
|
||||||
FROM vn.invoiceIn ii
|
FROM vn.invoiceIn ii
|
||||||
LEFT JOIN (
|
LEFT JOIN (
|
||||||
SELECT SUM(iit.taxableBase) totalTaxableBase,
|
SELECT SUM(iit.taxableBase) totalTaxableBase,
|
||||||
|
SUM(iit.foreignValue) totalTaxableBaseForeignValue,
|
||||||
CAST(
|
CAST(
|
||||||
SUM(IFNULL(iit.taxableBase * (1 + (ti.PorcentajeIva / 100)), iit.taxableBase))
|
SUM(IFNULL(iit.taxableBase * (1 + (ti.PorcentajeIva / 100)), iit.taxableBase))
|
||||||
AS DECIMAL(10, 2)
|
AS DECIMAL(10, 2)
|
||||||
|
|
|
@ -47,29 +47,6 @@ describe('InvoiceIn filter()', () => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should return the invoice in matching the serial number', async() => {
|
|
||||||
const tx = await models.InvoiceIn.beginTransaction({});
|
|
||||||
const options = {transaction: tx};
|
|
||||||
|
|
||||||
try {
|
|
||||||
const ctx = {
|
|
||||||
args: {
|
|
||||||
serialNumber: '1002',
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const result = await models.InvoiceIn.filter(ctx, {}, options);
|
|
||||||
|
|
||||||
expect(result.length).toEqual(1);
|
|
||||||
expect(result[0].serialNumber).toEqual(1002);
|
|
||||||
|
|
||||||
await tx.rollback();
|
|
||||||
} catch (e) {
|
|
||||||
await tx.rollback();
|
|
||||||
throw e;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should return the invoice in matching the account', async() => {
|
it('should return the invoice in matching the account', async() => {
|
||||||
const tx = await models.InvoiceIn.beginTransaction({});
|
const tx = await models.InvoiceIn.beginTransaction({});
|
||||||
const options = {transaction: tx};
|
const options = {transaction: tx};
|
||||||
|
@ -158,7 +135,7 @@ describe('InvoiceIn filter()', () => {
|
||||||
|
|
||||||
const result = await models.InvoiceIn.filter(ctx, {}, options);
|
const result = await models.InvoiceIn.filter(ctx, {}, options);
|
||||||
|
|
||||||
expect(result.length).toEqual(5);
|
expect(result.length).toEqual(6);
|
||||||
|
|
||||||
await tx.rollback();
|
await tx.rollback();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
Loading…
Reference in New Issue