diff --git a/db/routines/vn/procedures/entry_getTransfer.sql b/db/routines/vn/procedures/entry_getTransfer.sql index 151bebd4d..b82f273ae 100644 --- a/db/routines/vn/procedures/entry_getTransfer.sql +++ b/db/routines/vn/procedures/entry_getTransfer.sql @@ -13,15 +13,15 @@ BEGIN DECLARE vWarehouseIn INT; DECLARE vWarehouseOut INT; DECLARE vCalcVisible INT; - DECLARE vInventoryDate DATE DEFAULT vn.getInventoryDate(); + DECLARE vInventoryDate DATE DEFAULT getInventoryDate(); SELECT shipped, landed, warehouseInFk, warehouseOutFk INTO vDateShipped, vDateLanded, vWarehouseIn, vWarehouseOut - FROM vn.travel t - JOIN vn.entry e ON e.travelFk = t.id + FROM travel t + JOIN entry e ON e.travelFk = t.id WHERE e.id = vSelf; - CALL vn.rate_getPrices(vDateShipped, vWarehouseIn); + CALL rate_getPrices(vDateShipped, vWarehouseIn); -- Traslado en almacen origen CREATE OR REPLACE TEMPORARY TABLE tBuy @@ -84,7 +84,7 @@ BEGIN WHERE a.available ON DUPLICATE KEY UPDATE availableLanding = a.available; ELSE - CALL vn.item_getStock(vWarehouseOut, vDateShipped, NULL); + CALL item_getStock(vWarehouseOut, vDateShipped, NULL); CREATE OR REPLACE TEMPORARY TABLE tItem (UNIQUE INDEX i USING HASH (itemFk)) @@ -97,7 +97,7 @@ BEGIN FROM tmp.itemList; END IF; - CALL vn.buyUltimateFromInterval(vWarehouseIn,vInventoryDate, vDateLanded); + CALL buyUltimateFromInterval(vWarehouseIn,vInventoryDate, vDateLanded); CREATE OR REPLACE TEMPORARY TABLE tTransfer ENGINE = MEMORY @@ -145,26 +145,26 @@ BEGIN b.id buyFkOrigin, pa.returnCost, b.weight - FROM vn.item i + FROM item i JOIN tItem ti ON ti.itemFk = i.id - LEFT JOIN vn.producer p ON p.id = i.producerFk - LEFT JOIN vn.itemType it ON it.id = i.typeFk - JOIN vn.itemCategory ic ON ic.id = it.categoryFk - LEFT JOIN vn.origin o ON o.id = i.originFk + LEFT JOIN producer p ON p.id = i.producerFk + LEFT JOIN itemType it ON it.id = i.typeFk + JOIN itemCategory ic ON ic.id = it.categoryFk + LEFT JOIN origin o ON o.id = i.originFk LEFT JOIN tBuy lb ON lb.itemFk = i.id - LEFT JOIN vn.buy b ON b.id = lb.buyFk - LEFT JOIN vn.packaging pa ON pa.id = b.packagingFk - LEFT JOIN vn.entry e2 ON e2.id = b.entryFk - LEFT JOIN vn.supplier s ON s.id = e2.supplierFk - LEFT JOIN vn.entry e ON e.id = vSelf - LEFT JOIN vn.travel tr ON tr.id = e.travelFk - LEFT JOIN vn.agencyMode am ON am.id = tr.agencyModeFk - LEFT JOIN vn.buy b2 ON b2.itemFk = i.id + LEFT JOIN buy b ON b.id = lb.buyFk + LEFT JOIN packaging pa ON pa.id = b.packagingFk + LEFT JOIN entry e2 ON e2.id = b.entryFk + LEFT JOIN supplier s ON s.id = e2.supplierFk + LEFT JOIN entry e ON e.id = vSelf + LEFT JOIN travel tr ON tr.id = e.travelFk + LEFT JOIN agencyMode am ON am.id = tr.agencyModeFk + LEFT JOIN buy b2 ON b2.itemFk = i.id AND b2.entryFk = vSelf - LEFT JOIN vn.packaging pa2 ON pa2.id = b.packagingFk + LEFT JOIN packaging pa2 ON pa2.id = b.packagingFk LEFT JOIN tmp.rate r ON TRUE LEFT JOIN tmp.buyUltimateFromInterval bufi ON bufi.itemFk = i.id - LEFT JOIN vn.buy b3 ON b3.id = bufi.buyFk + LEFT JOIN buy b3 ON b3.id = bufi.buyFk WHERE ic.display AND NOT e.isRaid AND (ti.visible OR ti.available) @@ -172,11 +172,6 @@ BEGIN CREATE INDEX tIndex USING HASH ON tTransfer (itemFk); - SET @carriage := 0; - SET @comission := 0; - SET @packaging := 0; - SET @rate3 := 0; - SET @cost := 0; SELECT *, quantity - MOD(quantity , `grouping`) subQuantity, MOD(quantity, `grouping`) soll, diff --git a/db/routines/vn/procedures/ticket_closeByTicket.sql b/db/routines/vn/procedures/ticket_closeByTicket.sql index 93772225b..6e32a3e76 100644 --- a/db/routines/vn/procedures/ticket_closeByTicket.sql +++ b/db/routines/vn/procedures/ticket_closeByTicket.sql @@ -15,7 +15,7 @@ BEGIN JOIN agencyMode am ON am.id = t.agencyModeFk LEFT JOIN ticketState ts ON ts.ticketFk = t.id JOIN alertLevel al ON al.id = ts.alertLevel - WHERE al.code = 'PACKED' OR (am.code = 'refund' AND al.code != 'delivered') + WHERE (al.code = 'PACKED' OR (am.code = 'refund' AND al.code != 'delivered')) AND t.id = vTicketFk AND t.refFk IS NULL GROUP BY t.id); diff --git a/db/versions/10914-aquaBirch/00-firstScript.sql b/db/versions/10914-aquaBirch/00-firstScript.sql new file mode 100644 index 000000000..a182d5407 --- /dev/null +++ b/db/versions/10914-aquaBirch/00-firstScript.sql @@ -0,0 +1,6 @@ +-- Place your SQL code here +ALTER TABLE IF EXISTS vn2008.dock__ RENAME vn2008.dock; +ALTER TABLE IF EXISTS vn2008.dock COMMENT=''; + +ALTER TABLE IF EXISTS vn2008.Tramos__ RENAME vn2008.Tramos; +ALTER TABLE IF EXISTS vn2008.Tramos COMMENT=''; \ No newline at end of file diff --git a/db/versions/10922-salmonCordyline/00-firstScript.sql b/db/versions/10922-salmonCordyline/00-firstScript.sql new file mode 100644 index 000000000..37557d326 --- /dev/null +++ b/db/versions/10922-salmonCordyline/00-firstScript.sql @@ -0,0 +1 @@ +ALTER TABLE vn.warehouse AUTO_INCREMENT=92; diff --git a/loopback/locale/es.json b/loopback/locale/es.json index cf5fb4af4..4079fa1ca 100644 --- a/loopback/locale/es.json +++ b/loopback/locale/es.json @@ -346,5 +346,6 @@ "You cannot update these fields": "No puedes actualizar estos campos", "CountryFK cannot be empty": "El país no puede estar vacío", "Cmr file does not exist": "El archivo del cmr no existe", - "You are not allowed to modify the alias": "No estás autorizado a modificar el alias" + "You are not allowed to modify the alias": "No estás autorizado a modificar el alias", + "The address of the customer must have information about Incoterms and Customs Agent": "El consignatario del cliente debe tener informado Incoterms y Agente de aduanas" } diff --git a/modules/invoiceOut/back/methods/invoiceOut/invoiceCsv.js b/modules/invoiceOut/back/methods/invoiceOut/invoiceCsv.js index d33df74a2..c734b588c 100644 --- a/modules/invoiceOut/back/methods/invoiceOut/invoiceCsv.js +++ b/modules/invoiceOut/back/methods/invoiceOut/invoiceCsv.js @@ -80,6 +80,6 @@ module.exports = Self => { const content = toCSV(sales); - return [content, 'text/csv', `inline; filename="doc-${reference}.pdf"`]; + return [content, 'text/csv', `inline; filename="doc-${reference}.csv"`]; }; }; diff --git a/modules/ticket/back/methods/ticket/deliveryNoteCsv.js b/modules/ticket/back/methods/ticket/deliveryNoteCsv.js index 55ec4089d..40526ac16 100644 --- a/modules/ticket/back/methods/ticket/deliveryNoteCsv.js +++ b/modules/ticket/back/methods/ticket/deliveryNoteCsv.js @@ -79,6 +79,6 @@ module.exports = Self => { ORDER BY s.ticketFk, s.created`, [id]); const content = toCSV(sales); - return [content, 'text/csv', `inline; filename="doc-${id}.pdf"`]; + return [content, 'text/csv', `inline; filename="doc-${id}.csv"`]; }; }; diff --git a/print/templates/reports/driver-route/assets/css/style.css b/print/templates/reports/driver-route/assets/css/style.css index 101ef7b3f..a3bcae789 100644 --- a/print/templates/reports/driver-route/assets/css/style.css +++ b/print/templates/reports/driver-route/assets/css/style.css @@ -40,17 +40,6 @@ table.repeatable > tbody > tr > td { padding-top: 0.5em; } -section.text-area { - margin-top: 1em; - padding: 0.19em; - padding-left: 1em; - padding-right: 1em; - background-color: #e5e5e5; - & > p { - word-break: break-all; - } -} - .route-block { margin-bottom: 100px; page-break-after: always; diff --git a/print/templates/reports/driver-route/driver-route.html b/print/templates/reports/driver-route/driver-route.html index 1475b8e77..109afd2f5 100644 --- a/print/templates/reports/driver-route/driver-route.html +++ b/print/templates/reports/driver-route/driver-route.html @@ -128,8 +128,8 @@ -
-

{{ticket.description}}

+
+

{{ticket.description}}

diff --git a/print/templates/reports/invoice-incoterms/invoice-incoterms.js b/print/templates/reports/invoice-incoterms/invoice-incoterms.js index 9cc2600af..cfe29169b 100755 --- a/print/templates/reports/invoice-incoterms/invoice-incoterms.js +++ b/print/templates/reports/invoice-incoterms/invoice-incoterms.js @@ -1,4 +1,5 @@ const vnReport = require('../../../core/mixins/vn-report.js'); +const UserError = require('vn-loopback/util/user-error'); module.exports = { name: 'invoice-incoterms', @@ -7,7 +8,10 @@ module.exports = { this.invoice = await this.findOneFromDef('invoice', [this.reference]); this.checkMainEntity(this.invoice); this.client = await this.findOneFromDef('client', [this.reference]); - this.incoterms = await this.findOneFromDef('incoterms', [this.reference, this.reference, this.reference, this.reference]); + this.incoterms = + await this.findOneFromDef('incoterms', [this.reference, this.reference, this.reference, this.reference]); + if (!this.incoterms) + throw new UserError(`The address of the customer must have information about Incoterms and Customs Agent`); }, props: { reference: {