diff --git a/db/changes/10090-iberflora/00-component.sql b/db/changes/10090-iberflora/00-component.sql new file mode 100644 index 000000000..fe5de47fc --- /dev/null +++ b/db/changes/10090-iberflora/00-component.sql @@ -0,0 +1,15 @@ +CREATE + OR REPLACE ALGORITHM = UNDEFINED + DEFINER = `root`@`%` + SQL SECURITY DEFINER +VIEW `vn`.`component` AS + SELECT + `t`.`Id_Componente` AS `id`, + `t`.`Componente` AS `name`, + `t`.`tarifa_componentes_series_id` AS `typeFk`, + `t`.`tarifa_class` AS `classRate`, + `t`.`tax` AS `tax`, + `t`.`is_renewable` AS `isRenewable`, + `t`.`code` AS `code` + FROM + `bi`.`tarifa_componentes` `t`; diff --git a/modules/ticket/back/models/component-rate.json b/modules/ticket/back/models/component-rate.json index 3a69c6eb6..535b6086f 100644 --- a/modules/ticket/back/models/component-rate.json +++ b/modules/ticket/back/models/component-rate.json @@ -3,7 +3,7 @@ "base": "VnModel", "options": { "mysql": { - "table": "componentRate" + "table": "component" } }, "properties": { @@ -24,7 +24,7 @@ "isRenewable": { "type": "Number" }, - "componentTypeRate": { + "typeFk": { "type": "Number" }, "code": { @@ -35,7 +35,7 @@ "componentType": { "type": "belongsTo", "model": "ComponentTypeRate", - "foreignKey": "componentTypeRate" + "foreignKey": "typeFk" } }, "acls": [ diff --git a/modules/ticket/back/models/component-type-rate.json b/modules/ticket/back/models/component-type-rate.json index 39160ac47..c9b80f45c 100644 --- a/modules/ticket/back/models/component-type-rate.json +++ b/modules/ticket/back/models/component-type-rate.json @@ -3,7 +3,7 @@ "base": "VnModel", "options": { "mysql": { - "table": "componentTypeRate" + "table": "componentType" } }, "properties": { diff --git a/modules/ticket/front/component/index.js b/modules/ticket/front/component/index.js index daca668f1..9854305f6 100644 --- a/modules/ticket/front/component/index.js +++ b/modules/ticket/front/component/index.js @@ -17,7 +17,7 @@ class Controller { include: { relation: 'componentRate', scope: { - fields: ['componentTypeRate', 'name'], + fields: ['typeFk', 'name'], include: { relation: 'componentType', scope: { diff --git a/print/report/rpt-delivery-note/index.js b/print/report/rpt-delivery-note/index.js index 1a18bb180..08e2e8827 100755 --- a/print/report/rpt-delivery-note/index.js +++ b/print/report/rpt-delivery-note/index.js @@ -133,8 +133,8 @@ module.exports = { i.tag6, i.value6, i.tag7, i.value7 FROM vn.sale s LEFT JOIN saleComponent sc ON sc.saleFk = s.id - LEFT JOIN componentRate cr ON cr.id = sc.componentFk - LEFT JOIN componentTypeRate ctr ON ctr.id = cr.componentTypeRate + LEFT JOIN component cr ON cr.id = sc.componentFk + LEFT JOIN componentType ctr ON ctr.id = cr.typeFk LEFT JOIN item i ON i.id = s.itemFk LEFT JOIN ticket t ON t.id = s.ticketFk LEFT JOIN origin o ON o.id = i.originFk