refactor: refs #7424 Component type refactor
gitea/salix/pipeline/pr-dev This commit looks good
Details
gitea/salix/pipeline/pr-dev This commit looks good
Details
This commit is contained in:
parent
ac54994760
commit
a23f485296
|
@ -59,7 +59,7 @@ BEGIN
|
|||
JOIN vn.saleComponent sc ON sc.saleFk = s.id
|
||||
JOIN vn.component c ON c.id = sc.componentFk
|
||||
JOIN vn.componentType ct ON ct.id = c.typeFk
|
||||
WHERE ct.code = 'FREIGHT'
|
||||
WHERE ct.code = 'freight'
|
||||
AND r.created BETWEEN vDatedFrom AND vDatedTo
|
||||
GROUP BY r.id
|
||||
) sub ON sub.routeFk = r.Id_Ruta
|
||||
|
|
|
@ -2,7 +2,7 @@ CREATE OR REPLACE DEFINER=`root`@`localhost`
|
|||
SQL SECURITY DEFINER
|
||||
VIEW `bi`.`tarifa_componentes_series`
|
||||
AS SELECT `ct`.`id` AS `tarifa_componentes_series_id`,
|
||||
`ct`.`type` AS `Serie`,
|
||||
`ct`.`name` AS `Serie`,
|
||||
`ct`.`isBase` AS `base`,
|
||||
`ct`.`isMargin` AS `margen`
|
||||
FROM `vn`.`componentType` `ct`
|
||||
|
|
|
@ -8,7 +8,7 @@ BEGIN
|
|||
JOIN vn.component c ON c.id = sc.componentFk
|
||||
JOIN vn.componentType ct ON ct.id = c.typeFk
|
||||
WHERE s.ticketFk = vTicketFk
|
||||
AND ct.`type` = 'otros';
|
||||
AND ct.code = 'other';
|
||||
|
||||
UPDATE vn.sale s
|
||||
JOIN (
|
||||
|
|
|
@ -20,7 +20,8 @@ BEGIN
|
|||
JOIN itemCategory ic ON ic.id = tp.categoryFk
|
||||
JOIN saleComponent sc ON sc.saleFk = s.id
|
||||
JOIN component c ON c.id = sc.componentFk
|
||||
JOIN componentType ct ON ct.id = c.typeFk AND ct.id = 1
|
||||
JOIN componentType ct ON ct.id = c.typeFk
|
||||
AND ct.code = 'cost'
|
||||
WHERE t.shipped BETWEEN vShippedFrom AND vShippedTo
|
||||
AND ic.merchandise;
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ BEGIN
|
|||
JOIN vn.componentType ct ON ct.id = c.typeFk
|
||||
JOIN vn.sale s ON s.id = sc.saleFk
|
||||
JOIN tmp.ticket t ON t.ticketFk = s.ticketFk
|
||||
WHERE ct.code = 'FREIGHT'
|
||||
WHERE ct.code = 'freight'
|
||||
GROUP BY t.ticketFk) sb ON sb.ticketFk = tf.ticketFk
|
||||
SET tf.freight = sb.freight;
|
||||
|
||||
|
@ -88,7 +88,7 @@ BEGIN
|
|||
|
||||
-- Margin
|
||||
UPDATE tmp.ticketFloramondo tf
|
||||
JOIN (SELECT SUM(IF(ct.code = 'COST',sc.value, 0)) cost,
|
||||
JOIN (SELECT SUM(IF(ct.code = 'cost',sc.value, 0)) cost,
|
||||
SUM(IF(ct.isMargin, sc.value, 0)) margin,
|
||||
t.ticketFk
|
||||
FROM vn.saleComponent sc
|
||||
|
|
|
@ -19,4 +19,4 @@ FROM (
|
|||
)
|
||||
JOIN `vn`.`componentType` `ct` ON(`ct`.`id` = `c`.`typeFk`)
|
||||
)
|
||||
WHERE `ct`.`type` = 'coste'
|
||||
WHERE `ct`.`code` = 'cost'
|
||||
|
|
|
@ -16,6 +16,6 @@ FROM (
|
|||
)
|
||||
JOIN `vn`.`componentType` `ct` ON(
|
||||
`ct`.`id` = `c`.`typeFk`
|
||||
AND `ct`.`type` = 'agencia'
|
||||
AND `ct`.`code` = 'freight'
|
||||
)
|
||||
)
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
ALTER TABLE vn.componentType
|
||||
CHANGE code code varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL NULL AFTER id;
|
||||
ALTER TABLE vn.componentType
|
||||
CHANGE `type` name varchar(45) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL;
|
||||
UPDATE IGNORE vn.componentType
|
||||
SET code = LOWER(code);
|
||||
UPDATE IGNORE vn.componentType
|
||||
SET code = 'other'
|
||||
WHERE id = 12;
|
|
@ -12,7 +12,7 @@
|
|||
"type": "number",
|
||||
"description": "Identifier"
|
||||
},
|
||||
"type": {
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"isBase":{
|
||||
|
|
|
@ -51,7 +51,7 @@
|
|||
ng-repeat="saleComponent in sale.components track by saleComponent.componentFk"
|
||||
class="components">
|
||||
<td>
|
||||
{{::saleComponent.component.componentType.type}}
|
||||
{{::saleComponent.component.componentType.name}}
|
||||
</td>
|
||||
<td>
|
||||
{{::saleComponent.component.name}}
|
||||
|
|
|
@ -20,7 +20,7 @@ class Controller extends Section {
|
|||
include: {
|
||||
relation: 'componentType',
|
||||
scope: {
|
||||
fields: ['type', 'isBase']
|
||||
fields: ['name', 'isBase']
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,16 +1,15 @@
|
|||
SELECT
|
||||
s.id,
|
||||
SELECT s.id,
|
||||
s.itemFk,
|
||||
s.concept,
|
||||
s.quantity,
|
||||
s.price,
|
||||
s.price - SUM(IF(ctr.id = 6, sc.value, 0)) netPrice,
|
||||
s.price - SUM(IF(ctr.code = 'freight', sc.value, 0)) netPrice,
|
||||
s.discount,
|
||||
i.size,
|
||||
i.stems,
|
||||
i.category,
|
||||
it.id itemTypeId,
|
||||
o.code AS origin,
|
||||
o.code origin,
|
||||
i.inkFk,
|
||||
s.ticketFk,
|
||||
tcl.code vatType,
|
||||
|
|
Loading…
Reference in New Issue