diff --git a/db/routines/bs/procedures/ventas_contables_add.sql b/db/routines/bs/procedures/ventas_contables_add.sql index 12b2738f3..66c012a19 100644 --- a/db/routines/bs/procedures/ventas_contables_add.sql +++ b/db/routines/bs/procedures/ventas_contables_add.sql @@ -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;