This commit is contained in:
parent
1cd495df06
commit
d0067c8096
|
@ -23,7 +23,7 @@ BEGIN
|
|||
ENGINE = MEMORY
|
||||
SELECT Id_Ticket
|
||||
FROM vn2008.Tickets t
|
||||
JOIN vn.invoiceOut io ON io.id = t.Factura
|
||||
JOIN vn.invoiceOut io ON io.`ref` = t.Factura
|
||||
WHERE year(io.issued) = vYear
|
||||
AND month(io.issued) = vMonth;
|
||||
|
||||
|
@ -47,12 +47,7 @@ BEGIN
|
|||
, tp.reino_id
|
||||
, a.tipo_id
|
||||
, t.empresa_id
|
||||
, a.expenseFk
|
||||
+ IF(e.empresa_grupo = e2.empresa_grupo
|
||||
,1
|
||||
,IF(e2.empresa_grupo,2,0)
|
||||
) * 100000
|
||||
+ tp.reino_id * 1000 as Gasto
|
||||
, a.expenseFk gasto
|
||||
FROM vn2008.Movimientos m
|
||||
JOIN vn2008.Tickets t on t.Id_Ticket = m.Id_Ticket
|
||||
JOIN vn2008.Consignatarios cs on cs.Id_Consigna = t.Id_Consigna
|
||||
|
|
Loading…
Reference in New Issue