feat: refs #7039 country #2361
|
@ -9,7 +9,7 @@ BEGIN
|
|||
DECLARE vEnded DATETIME DEFAULT util.dayEnd(util.VN_CURDATE());
|
||||
|
||||
SELECT ag.id agency_id,
|
||||
CONCAT(RPAD(c.country, 16,' _') ,' ',ag.name) Agencia,
|
||||
CONCAT(RPAD(c.name, 16,' _') ,' ',ag.name) Agencia,
|
||||
COUNT(*) expediciones,
|
||||
SUM(t.packages) Bultos,
|
||||
SUM(tpe.boxes) Faltan
|
||||
|
|
|
@ -22,7 +22,7 @@ BEGIN
|
|||
c.credit,
|
||||
CAST(r.risk AS DECIMAL (10,2)) risk,
|
||||
CAST(c.credit - r.risk AS DECIMAL (10,2)) difference,
|
||||
co.country
|
||||
co.name country
|
||||
FROM client c
|
||||
JOIN tmp.risk r ON r.clientFk = c.id
|
||||
JOIN country co ON co.id = c.countryFk
|
||||
|
|
|
@ -27,7 +27,7 @@ BEGIN
|
|||
cac.invoiced billedAnnually,
|
||||
c.dueDay,
|
||||
cgd.grade,
|
||||
c2.country
|
||||
c2.name country
|
||||
FROM tmp.clientGetDebt cgd
|
||||
LEFT JOIN tmp.risk r ON r.clientFk = cgd.clientFk
|
||||
JOIN client c ON c.id = cgd.clientFk
|
||||
|
|
|
@ -43,7 +43,7 @@ BEGIN
|
|||
INSERT INTO stockBuyed(buyed, dated, description)
|
||||
SELECT SUM(ic.cm3 * ito.quantity / vc.palletM3 / 1000000),
|
||||
vDated,
|
||||
IF(c.code = 'ES', p.name, c.country) destiny
|
||||
IF(c.code = 'ES', p.name, c.name) destiny
|
||||
FROM itemTicketOut ito
|
||||
JOIN ticket t ON t.id = ito.ticketFk
|
||||
JOIN `address` a ON a.id = t.addressFk
|
||||
|
|
|
@ -3,7 +3,7 @@ CREATE OR REPLACE DEFINER=`root`@`localhost`
|
|||
VIEW `vn`.`saleVolume_Today_VNH`
|
||||
AS SELECT `t`.`nickname` AS `Cliente`,
|
||||
`p`.`name` AS `Provincia`,
|
||||
`c`.`country` AS `Pais`,
|
||||
`c`.`name` AS `Pais`,
|
||||
cast(sum(`sv`.`volume`) AS decimal(5, 1)) AS `volume`
|
||||
FROM (
|
||||
(
|
||||
|
|
|
@ -2,7 +2,7 @@ CREATE OR REPLACE DEFINER=`root`@`localhost`
|
|||
SQL SECURITY DEFINER
|
||||
VIEW `vn2008`.`Paises`
|
||||
AS SELECT `c`.`id` AS `Id`,
|
||||
`c`.`country` AS `Pais`,
|
||||
`c`.`name` AS `Pais`,
|
||||
`c`.`CEE` AS `CEE`,
|
||||
`c`.`isUeeMember` AS `isUeeMember`,
|
||||
`c`.`code` AS `Codigo`,
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
-- Place your SQL code here
|
Loading…
Reference in New Issue