Merge branch 'dev' into 7195_roadmap2
gitea/salix/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Sergio De la torre 2024-07-03 06:46:10 +00:00
commit 7677ada925
19 changed files with 73 additions and 92 deletions

View File

@ -3232,7 +3232,6 @@ INSERT IGNORE INTO vn.itemType
workerFk = 103, workerFk = 103,
isInventory = TRUE, isInventory = TRUE,
life = 10, life = 10,
density = 250,
itemPackingTypeFk = NULL, itemPackingTypeFk = NULL,
temperatureFk = 'warm'; temperatureFk = 'warm';

View File

@ -59,7 +59,7 @@ BEGIN
JOIN vn.saleComponent sc ON sc.saleFk = s.id JOIN vn.saleComponent sc ON sc.saleFk = s.id
JOIN vn.component c ON c.id = sc.componentFk JOIN vn.component c ON c.id = sc.componentFk
JOIN vn.componentType ct ON ct.id = c.typeFk JOIN vn.componentType ct ON ct.id = c.typeFk
WHERE ct.code = 'FREIGHT' WHERE ct.code = 'freight'
AND r.created BETWEEN vDatedFrom AND vDatedTo AND r.created BETWEEN vDatedFrom AND vDatedTo
GROUP BY r.id GROUP BY r.id
) sub ON sub.routeFk = r.Id_Ruta ) sub ON sub.routeFk = r.Id_Ruta

View File

@ -2,7 +2,7 @@ CREATE OR REPLACE DEFINER=`root`@`localhost`
SQL SECURITY DEFINER SQL SECURITY DEFINER
VIEW `bi`.`tarifa_componentes_series` VIEW `bi`.`tarifa_componentes_series`
AS SELECT `ct`.`id` AS `tarifa_componentes_series_id`, AS SELECT `ct`.`id` AS `tarifa_componentes_series_id`,
`ct`.`type` AS `Serie`, `ct`.`name` AS `Serie`,
`ct`.`isBase` AS `base`, `ct`.`isBase` AS `base`,
`ct`.`isMargin` AS `margen` `ct`.`isMargin` AS `margen`
FROM `vn`.`componentType` `ct` FROM `vn`.`componentType` `ct`

View File

@ -7,7 +7,6 @@ BEGIN
*/ */
DECLARE vRewriteKop INT DEFAULT NULL; DECLARE vRewriteKop INT DEFAULT NULL;
DECLARE vTruncatePutOrder INT DEFAULT NULL; DECLARE vTruncatePutOrder INT DEFAULT NULL;
DECLARE vBarcode CHAR(15) DEFAULT NULL;
DECLARE vKop INT; DECLARE vKop INT;
DECLARE vPutOrderFk BIGINT; DECLARE vPutOrderFk BIGINT;
@ -16,17 +15,6 @@ BEGIN
FROM ekt FROM ekt
WHERE id = vSelf; WHERE id = vSelf;
-- Generates the barcode
SELECT CONCAT(
LPAD(IFNULL(auction,0), 3, 0),
LPAD(IFNULL(klo, 99), 2, 0),
LPAD(DAYOFYEAR(fec), 3, 0),
COALESCE(agj, RIGHT(batchNumber,7), id))
INTO vBarcode
FROM ekt
WHERE id = vSelf;
-- Rewrites the kop parameter -- Rewrites the kop parameter
IF vKop IS NULL THEN IF vKop IS NULL THEN
@ -46,10 +34,9 @@ BEGIN
-- Refresh EKT -- Refresh EKT
UPDATE ekt SET UPDATE ekt
barcode = vBarcode SET kop = vKop,
,kop = vKop putOrderFk = vTruncatePutOrder
,putOrderFk = vTruncatePutOrder
WHERE id = vSelf; WHERE id = vSelf;
END$$ END$$
DELIMITER ; DELIMITER ;

View File

@ -2,7 +2,6 @@ CREATE OR REPLACE DEFINER=`root`@`localhost`
SQL SECURITY DEFINER SQL SECURITY DEFINER
VIEW `edi`.`ektRecent` VIEW `edi`.`ektRecent`
AS SELECT `e`.`id` AS `id`, AS SELECT `e`.`id` AS `id`,
`e`.`barcode` AS `barcode`,
`e`.`entryYear` AS `entryYear`, `e`.`entryYear` AS `entryYear`,
`e`.`batchNumber` AS `batchNumber`, `e`.`batchNumber` AS `batchNumber`,
`e`.`deliveryNumber` AS `deliveryNumber`, `e`.`deliveryNumber` AS `deliveryNumber`,

View File

@ -6,19 +6,6 @@ BEGIN
* identificando y notificando los asientos descuadrados * identificando y notificando los asientos descuadrados
* y ajustando los saldos en caso necesario. * y ajustando los saldos en caso necesario.
*/ */
INSERT INTO mail (receiver, subject, body)
SELECT 'cau@verdnatura.es',
'Asientos descuadrados',
GROUP_CONCAT(CONCAT(' Asiento: ', ASIEN, ' - Importe:', recon) SEPARATOR ' | \n')
FROM (
SELECT ASIEN,
SUM(IFNULL(ROUND(Eurodebe, 2), 0)) - SUM(IFNULL(ROUND(EUROHABER, 2), 0)) recon
FROM XDiario
WHERE NOT enlazado
GROUP BY ASIEN
HAVING ABS(SUM(IFNULL(ROUND(Eurodebe, 2), 0)) - SUM(IFNULL(ROUND(EUROHABER, 2), 0))) > 0.01
) sub
HAVING COUNT(*);
UPDATE XDiario xd UPDATE XDiario xd
JOIN ( JOIN (

View File

@ -8,7 +8,7 @@ BEGIN
JOIN vn.component c ON c.id = sc.componentFk JOIN vn.component c ON c.id = sc.componentFk
JOIN vn.componentType ct ON ct.id = c.typeFk JOIN vn.componentType ct ON ct.id = c.typeFk
WHERE s.ticketFk = vTicketFk WHERE s.ticketFk = vTicketFk
AND ct.`type` = 'otros'; AND ct.code = 'other';
UPDATE vn.sale s UPDATE vn.sale s
JOIN ( JOIN (

View File

@ -20,7 +20,8 @@ BEGIN
JOIN itemCategory ic ON ic.id = tp.categoryFk JOIN itemCategory ic ON ic.id = tp.categoryFk
JOIN saleComponent sc ON sc.saleFk = s.id JOIN saleComponent sc ON sc.saleFk = s.id
JOIN component c ON c.id = sc.componentFk 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 WHERE t.shipped BETWEEN vShippedFrom AND vShippedTo
AND ic.merchandise; AND ic.merchandise;

View File

@ -66,7 +66,7 @@ BEGIN
JOIN vn.componentType ct ON ct.id = c.typeFk JOIN vn.componentType ct ON ct.id = c.typeFk
JOIN vn.sale s ON s.id = sc.saleFk JOIN vn.sale s ON s.id = sc.saleFk
JOIN tmp.ticket t ON t.ticketFk = s.ticketFk 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 GROUP BY t.ticketFk) sb ON sb.ticketFk = tf.ticketFk
SET tf.freight = sb.freight; SET tf.freight = sb.freight;
@ -88,7 +88,7 @@ BEGIN
-- Margin -- Margin
UPDATE tmp.ticketFloramondo tf 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, SUM(IF(ct.isMargin, sc.value, 0)) margin,
t.ticketFk t.ticketFk
FROM vn.saleComponent sc FROM vn.saleComponent sc

View File

@ -19,4 +19,4 @@ FROM (
) )
JOIN `vn`.`componentType` `ct` ON(`ct`.`id` = `c`.`typeFk`) JOIN `vn`.`componentType` `ct` ON(`ct`.`id` = `c`.`typeFk`)
) )
WHERE `ct`.`type` = 'coste' WHERE `ct`.`code` = 'cost'

View File

@ -16,6 +16,6 @@ FROM (
) )
JOIN `vn`.`componentType` `ct` ON( JOIN `vn`.`componentType` `ct` ON(
`ct`.`id` = `c`.`typeFk` `ct`.`id` = `c`.`typeFk`
AND `ct`.`type` = 'agencia' AND `ct`.`code` = 'freight'
) )
) )

View File

@ -9,14 +9,9 @@ AS SELECT `it`.`id` AS `tipo_id`,
`it`.`workerFk` AS `Id_Trabajador`, `it`.`workerFk` AS `Id_Trabajador`,
`it`.`life` AS `life`, `it`.`life` AS `life`,
`it`.`isPackaging` AS `isPackaging`, `it`.`isPackaging` AS `isPackaging`,
`it`.`density` AS `density`,
`it`.`isInventory` AS `inventory`, `it`.`isInventory` AS `inventory`,
`it`.`created` AS `odbc_date`, `it`.`created` AS `odbc_date`,
`it`.`making` AS `confeccion`, `it`.`making` AS `confeccion`,
`it`.`temperatureFk` AS `Temperatura`, `it`.`temperatureFk` AS `Temperatura`,
`it`.`promo` AS `promo`, `it`.`promo` AS `promo`
`it`.`maneuver` AS `maneuver`,
`it`.`target` AS `target`,
`it`.`topMargin` AS `top_margin`,
`it`.`profit` AS `profit`
FROM `vn`.`itemType` `it` FROM `vn`.`itemType` `it`

View File

@ -2,7 +2,6 @@ CREATE OR REPLACE DEFINER=`root`@`localhost`
SQL SECURITY DEFINER SQL SECURITY DEFINER
VIEW `vn2008`.`buy_edi` VIEW `vn2008`.`buy_edi`
AS SELECT `t`.`id` AS `id`, AS SELECT `t`.`id` AS `id`,
`t`.`barcode` AS `barcode`,
`t`.`entryYear` AS `entry_year`, `t`.`entryYear` AS `entry_year`,
`t`.`deliveryNumber` AS `delivery_number`, `t`.`deliveryNumber` AS `delivery_number`,
`t`.`fec` AS `fec`, `t`.`fec` AS `fec`,

View File

@ -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;

View File

@ -0,0 +1,6 @@
ALTER TABLE vn.itemType
CHANGE maneuver maneuver__ double DEFAULT 0.21 NOT NULL COMMENT '@deprecated 2024-07-01 refs #7418',
CHANGE target target__ double DEFAULT 0.15 NOT NULL COMMENT '@deprecated 2024-07-01 refs #7418',
CHANGE topMargin topMargin__ double DEFAULT 0.3 NOT NULL COMMENT '@deprecated 2024-07-01 refs #7418',
CHANGE profit profit__ double DEFAULT 0.02 NOT NULL COMMENT '@deprecated 2024-07-01 refs #7418',
CHANGE density density__ double DEFAULT 167 NOT NULL COMMENT '@deprecated 2024-07-01 refs #7418 Almacena el valor por defecto de la densidad en kg/m3 para el calculo de los portes aereos, en articulos se guarda la correcta';

View File

@ -12,7 +12,7 @@
"type": "number", "type": "number",
"description": "Identifier" "description": "Identifier"
}, },
"type": { "name": {
"type": "string" "type": "string"
}, },
"isBase":{ "isBase":{

View File

@ -51,7 +51,7 @@
ng-repeat="saleComponent in sale.components track by saleComponent.componentFk" ng-repeat="saleComponent in sale.components track by saleComponent.componentFk"
class="components"> class="components">
<td> <td>
{{::saleComponent.component.componentType.type}} {{::saleComponent.component.componentType.name}}
</td> </td>
<td> <td>
{{::saleComponent.component.name}} {{::saleComponent.component.name}}

View File

@ -20,7 +20,7 @@ class Controller extends Section {
include: { include: {
relation: 'componentType', relation: 'componentType',
scope: { scope: {
fields: ['type', 'isBase'] fields: ['name', 'isBase']
} }
} }
} }

View File

@ -1,16 +1,15 @@
SELECT SELECT s.id,
s.id,
s.itemFk, s.itemFk,
s.concept, s.concept,
s.quantity, s.quantity,
s.price, 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, s.discount,
i.size, i.size,
i.stems, i.stems,
i.category, i.category,
it.id itemTypeId, it.id itemTypeId,
o.code AS origin, o.code origin,
i.inkFk, i.inkFk,
s.ticketFk, s.ticketFk,
tcl.code vatType, tcl.code vatType,