Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Incident Reports » Incident Reports Reported for Version 2.12 » View Incident Report |
Minor |
Reported By: Mario Enriquez Reported On: 4/30/2013 For: Version 2.12 Build 2 |
CREATE FUNCTION "fnInvExistenciaSucursal" (IN pIdProductoEmpresa GUID, IN pIdSucursal GUID, IN pFechaMov DATE) RETURNS DECIMAL(19,4) BEGIN DECLARE Result DECIMAL(19,4); EXECUTE IMMEDIATE 'SELECT sum((pe.cantidad_inicial + pe.ingresos) - pe.salidas) INTO ? FROM inv_producto_existencia pe INNER JOIN ( SELECT a.id_producto_empresa, a.id_ubicacion, MAX(a.fecha) fecha FROM inv_producto_existencia a WHERE a.id_producto_empresa = ? AND a.id_ubicacion IN (SELECT id_ubicacion FROM inv_bodega_ubicacion WHERE id_bodega IN (SELECT id_bodega FROM inv_bodega WHERE id_sucursal = ?)) AND a.fecha <= ? GROUP BY id_producto_empresa, id_ubicacion ) AS uf ON pe.id_producto_empresa = uf.id_producto_empresa AND pe.id_ubicacion = uf.id_ubicacion AND pe.fecha = uf.fecha GROUP BY pe.id_producto_empresa' USING Result, pIdProductoEmpresa, pIdSucursal, pFechaMov; RETURN COALESCE(Result, 0.0); END
This web page was last updated on Wednesday, October 30, 2024 at 11:41 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |