From 405bc8765a275552e2d83cd9c221ed93bd899f97 Mon Sep 17 00:00:00 2001 From: alexandre Date: Wed, 26 Oct 2022 12:48:48 +0200 Subject: [PATCH 1/2] refs #4645 valores ref cambiados --- e2e/helpers/selectors.js | 3 +- e2e/paths/12-entry/05_basicData.spec.js | 8 ++++ modules/entry/back/methods/entry/filter.js | 3 +- .../entry/back/methods/entry/importBuys.js | 10 ++++- .../methods/entry/specs/importBuys.spec.js | 9 +++-- modules/entry/back/models/entry.json | 13 ++++++- modules/entry/front/basic-data/index.html | 39 ++++++++++++------- modules/entry/front/index/index.html | 4 +- modules/entry/front/index/locale/es.yml | 3 +- modules/entry/front/search-panel/index.html | 9 ++++- .../entry/front/search-panel/locale/es.yml | 3 +- modules/entry/front/summary/index.html | 5 ++- modules/entry/front/summary/locale/es.yml | 2 +- 13 files changed, 81 insertions(+), 30 deletions(-) diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js index cd6d39795..bf918c74a 100644 --- a/e2e/helpers/selectors.js +++ b/e2e/helpers/selectors.js @@ -1100,7 +1100,8 @@ export default { anyBuyLine: 'vn-entry-summary tr.dark-row' }, entryBasicData: { - reference: 'vn-entry-basic-data vn-textfield[ng-model="$ctrl.entry.ref"]', + reference: 'vn-entry-basic-data vn-textfield[ng-model="$ctrl.entry.reference"]', + invoiceNumber: 'vn-entry-basic-data vn-textfield[ng-model="$ctrl.entry.invoiceNumber"]', notes: 'vn-entry-basic-data vn-textfield[ng-model="$ctrl.entry.notes"]', observations: 'vn-entry-basic-data vn-textarea[ng-model="$ctrl.entry.observation"]', supplier: 'vn-entry-basic-data vn-autocomplete[ng-model="$ctrl.entry.supplierFk"]', diff --git a/e2e/paths/12-entry/05_basicData.spec.js b/e2e/paths/12-entry/05_basicData.spec.js index c1aa14019..3b5f40c35 100644 --- a/e2e/paths/12-entry/05_basicData.spec.js +++ b/e2e/paths/12-entry/05_basicData.spec.js @@ -19,6 +19,7 @@ describe('Entry basic data path', () => { it('should edit the basic data', async() => { await page.write(selectors.entryBasicData.reference, 'new movement 8'); + await page.write(selectors.entryBasicData.invoiceNumber, 'new movement 8'); await page.write(selectors.entryBasicData.notes, 'new notes'); await page.write(selectors.entryBasicData.observations, ' edited'); await page.autocompleteSearch(selectors.entryBasicData.supplier, 'Plants nick'); @@ -45,6 +46,13 @@ describe('Entry basic data path', () => { expect(result).toEqual('new movement 8'); }); + it('should confirm the invoiceNumber was edited', async() => { + await page.reloadSection('entry.card.basicData'); + const result = await page.waitToGetProperty(selectors.entryBasicData.invoiceNumber, 'value'); + + expect(result).toEqual('new movement 8'); + }); + it('should confirm the note was edited', async() => { const result = await page.waitToGetProperty(selectors.entryBasicData.notes, 'value'); diff --git a/modules/entry/back/methods/entry/filter.js b/modules/entry/back/methods/entry/filter.js index 1ba4166dc..3a08bffff 100644 --- a/modules/entry/back/methods/entry/filter.js +++ b/modules/entry/back/methods/entry/filter.js @@ -154,7 +154,8 @@ module.exports = Self => { e.id, e.supplierFk, e.dated, - e.ref, + e.ref reference, + e.ref invoiceNumber, e.isBooked, e.isExcludedFromAvailable, e.notes, diff --git a/modules/entry/back/methods/entry/importBuys.js b/modules/entry/back/methods/entry/importBuys.js index fb2f5f452..fdc6b058e 100644 --- a/modules/entry/back/methods/entry/importBuys.js +++ b/modules/entry/back/methods/entry/importBuys.js @@ -12,10 +12,15 @@ module.exports = Self => { http: {source: 'path'} }, { - arg: 'ref', + arg: 'reference', type: 'string', description: 'The buyed boxes ids', }, + { + arg: 'invoiceNumber', + type: 'string', + description: 'The registered invoice number', + }, { arg: 'observation', type: 'string', @@ -63,7 +68,8 @@ module.exports = Self => { await entry.updateAttributes({ observation: args.observation, - ref: args.ref + reference: args.reference, + invoiceNumber: args.invoiceNumber }, myOptions); const travel = entry.travel(); diff --git a/modules/entry/back/methods/entry/specs/importBuys.spec.js b/modules/entry/back/methods/entry/specs/importBuys.spec.js index 9cf6f4300..4f9204c6a 100644 --- a/modules/entry/back/methods/entry/specs/importBuys.spec.js +++ b/modules/entry/back/methods/entry/specs/importBuys.spec.js @@ -15,13 +15,15 @@ describe('entry import()', () => { }); it('should import the buy rows', async() => { - const expectedRef = '1, 2'; + const expectedReference = '1, 2'; + const expectedInvoiceNumber = '1, 2'; const expectedObservation = '123456'; const ctx = { req: activeCtx, args: { observation: expectedObservation, - ref: expectedRef, + reference: expectedReference, + invoiceNumber: expectedInvoiceNumber, buys: [ { itemFk: 1, @@ -58,7 +60,8 @@ describe('entry import()', () => { }, options); expect(updatedEntry.observation).toEqual(expectedObservation); - expect(updatedEntry.ref).toEqual(expectedRef); + expect(updatedEntry.reference).toEqual(expectedReference); + expect(updatedEntry.invoiceNumber).toEqual(expectedInvoiceNumber); expect(entryBuys.length).toEqual(4); await tx.rollback(); diff --git a/modules/entry/back/models/entry.json b/modules/entry/back/models/entry.json index c456859a5..d3c802ad2 100644 --- a/modules/entry/back/models/entry.json +++ b/modules/entry/back/models/entry.json @@ -18,8 +18,17 @@ "dated": { "type": "date" }, - "ref": { - "type": "string" + "reference": { + "type": "string", + "mysql": { + "columnName": "ref" + } + }, + "invoiceNumber": { + "type": "string", + "mysql": { + "columnName": "ref" + } }, "isBooked": { "type": "boolean" diff --git a/modules/entry/front/basic-data/index.html b/modules/entry/front/basic-data/index.html index 423e9d70d..68a65e890 100644 --- a/modules/entry/front/basic-data/index.html +++ b/modules/entry/front/basic-data/index.html @@ -48,7 +48,7 @@ @@ -61,17 +61,25 @@ - - + label="Invoice number" + ng-model="$ctrl.entry.invoiceNumber" + rule + vn-focus> + + + - - + + + + Id Landed Reference + Invoice number Supplier Booked Confirmed @@ -45,7 +46,8 @@ {{::entry.landed | date:'dd/MM/yyyy'}} - {{::entry.ref}} + {{::entry.reference}} + {{::entry.invoiceNumber}} {{::entry.supplierName}} diff --git a/modules/entry/front/index/locale/es.yml b/modules/entry/front/index/locale/es.yml index 519f8e39a..4f12fc7bb 100644 --- a/modules/entry/front/index/locale/es.yml +++ b/modules/entry/front/index/locale/es.yml @@ -14,4 +14,5 @@ Booked: Contabilizada Is inventory: Inventario Notes: Notas Status: Estado -Selection: Selección \ No newline at end of file +Selection: Selección +Invoice number: Núm. factura \ No newline at end of file diff --git a/modules/entry/front/search-panel/index.html b/modules/entry/front/search-panel/index.html index 38acdf77d..adcb9d6d4 100644 --- a/modules/entry/front/search-panel/index.html +++ b/modules/entry/front/search-panel/index.html @@ -13,9 +13,16 @@ + ng-model="filter.reference"> + + + + diff --git a/modules/entry/front/search-panel/locale/es.yml b/modules/entry/front/search-panel/locale/es.yml index 88f164145..05b71da99 100644 --- a/modules/entry/front/search-panel/locale/es.yml +++ b/modules/entry/front/search-panel/locale/es.yml @@ -5,4 +5,5 @@ From: Desde To: Hasta Agency: Agencia Warehouse: Almacén -Search entry by id or a suppliers by name or alias: Buscar entrada por id o proveedores por nombre y alias \ No newline at end of file +Search entry by id or a suppliers by name or alias: Buscar entrada por id o proveedores por nombre y alias +Invoice number: Núm. factura \ No newline at end of file diff --git a/modules/entry/front/summary/index.html b/modules/entry/front/summary/index.html index ffd8aafab..04844ab99 100644 --- a/modules/entry/front/summary/index.html +++ b/modules/entry/front/summary/index.html @@ -27,7 +27,10 @@ value="{{$ctrl.entryData.company.code}}"> + value="{{$ctrl.entryData.reference}}"> + + diff --git a/modules/entry/front/summary/locale/es.yml b/modules/entry/front/summary/locale/es.yml index a141ce56c..1761561ed 100644 --- a/modules/entry/front/summary/locale/es.yml +++ b/modules/entry/front/summary/locale/es.yml @@ -8,4 +8,4 @@ Minimum price: Precio mínimo Buys: Compras Travel: Envio Go to the entry: Ir a la entrada - +Invoice number: Núm. factura From b5889d2f404bbca837e666e1a0e6098d56c48ff2 Mon Sep 17 00:00:00 2001 From: alexandre Date: Mon, 31 Oct 2022 10:35:43 +0100 Subject: [PATCH 2/2] =?UTF-8?q?refs=20#4497=20servicios=20a=C3=B1adidos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- print/templates/reports/invoice/invoice.html | 2 +- print/templates/reports/invoice/invoice.js | 2 +- print/templates/reports/invoice/locale/en.yml | 3 ++- print/templates/reports/invoice/locale/es.yml | 3 ++- print/templates/reports/invoice/sql/intrastat.sql | 14 ++++++++++++-- 5 files changed, 18 insertions(+), 6 deletions(-) diff --git a/print/templates/reports/invoice/invoice.html b/print/templates/reports/invoice/invoice.html index 1d646a0db..aed4b38f3 100644 --- a/print/templates/reports/invoice/invoice.html +++ b/print/templates/reports/invoice/invoice.html @@ -264,7 +264,7 @@ {{row.code}} - {{row.description}} + {{row.description || $t('services') }} {{row.stems | number($i18n.locale)}} {{row.netKg | number($i18n.locale)}} {{row.subtotal | currency('EUR', $i18n.locale)}} diff --git a/print/templates/reports/invoice/invoice.js b/print/templates/reports/invoice/invoice.js index db94a7a12..31df7f7f5 100755 --- a/print/templates/reports/invoice/invoice.js +++ b/print/templates/reports/invoice/invoice.js @@ -81,7 +81,7 @@ module.exports = { return this.rawSqlFromDef(`taxes`, [reference]); }, fetchIntrastat(reference) { - return this.rawSqlFromDef(`intrastat`, [reference, reference, reference]); + return this.rawSqlFromDef(`intrastat`, [reference, reference, reference, reference]); }, fetchRectified(reference) { return this.rawSqlFromDef(`rectified`, [reference]); diff --git a/print/templates/reports/invoice/locale/en.yml b/print/templates/reports/invoice/locale/en.yml index 4e4688b55..336592f0c 100644 --- a/print/templates/reports/invoice/locale/en.yml +++ b/print/templates/reports/invoice/locale/en.yml @@ -33,4 +33,5 @@ issued: Issued plantPassport: Plant passport observations: Observations wireTransfer: "Pay method: Transferencia" -accountNumber: "Account number: {0}" \ No newline at end of file +accountNumber: "Account number: {0}" +services: Services \ No newline at end of file diff --git a/print/templates/reports/invoice/locale/es.yml b/print/templates/reports/invoice/locale/es.yml index d37e77943..32f6fc708 100644 --- a/print/templates/reports/invoice/locale/es.yml +++ b/print/templates/reports/invoice/locale/es.yml @@ -33,4 +33,5 @@ issued: F. emisión plantPassport: Pasaporte fitosanitario observations: Observaciones wireTransfer: "Forma de pago: Transferencia" -accountNumber: "Número de cuenta: {0}" \ No newline at end of file +accountNumber: "Número de cuenta: {0}" +services: Servicios \ No newline at end of file diff --git a/print/templates/reports/invoice/sql/intrastat.sql b/print/templates/reports/invoice/sql/intrastat.sql index e2ee47667..5cc3ebd7f 100644 --- a/print/templates/reports/invoice/sql/intrastat.sql +++ b/print/templates/reports/invoice/sql/intrastat.sql @@ -1,4 +1,4 @@ -SELECT +(SELECT ir.id code, ir.description description, CAST(SUM(IFNULL(i.stems, 1) * s.quantity) AS DECIMAL(10,2)) stems, @@ -19,4 +19,14 @@ SELECT WHERE t.refFk = ? AND i.intrastatFk GROUP BY i.intrastatFk - ORDER BY i.intrastatFk; \ No newline at end of file + ORDER BY i.intrastatFk) +UNION ALL +(SELECT + NULL AS code, + NULL AS description, + 0 AS stems, + 0 AS netKg, + CAST(SUM((ts.quantity * ts.price)) AS DECIMAL(10,2)) AS subtotal + FROM vn.ticketService ts + JOIN vn.ticket t ON ts.ticketFk = t.id + WHERE t.refFk = ?); \ No newline at end of file