on 05-09-2014 3:50 PM
Saludos a todos.
Llevo poco tiempo viendo SAP Business One y estoy en la tarea de realizar un Informe de Auditoria que me permita obtener datos de los documentos (Serie, Correlativo, Comentario). Y pude notar que los documentos que giran entorno a los documentos son (NE, TR, RC, EP, TT, DV, DI, RI, SM, EM, AC). La consulta es saber de que forma esta construido este Informe, los criterios de selección son: Fecha de Contabilización (Fecha Inicio y Fecha Fin), Almacén y visualizar (Artículo).
1. De que forma obtengo los saldos iniciales que se dan entre la fecha de inicio y fecha fin para los artículos de un almacén determinado.
2. Como puedo hacer que ese saldo inicial calcule la operación que se muestra con el campo Cantidad de tal forma que muestre la variante en la Cantidad Acumulada.
Muchas Gracias.
Agradezco el aporte. En realidad tengo esto:
DECLARE @TipoFecha AS INT -- 1=Fecha del Sistema 2=Fecha de Contabilidad
DECLARE @FechaIni AS DATETIME
DECLARE @FechaFin AS DATETIME
DECLARE @Almacen AS NVARCHAR(20)
--VALORES DE PRUEBA
SET @FechaIni = '20140101'
SET @FechaFin = '20140430'
SET @Almacen = '03'
SELECT T0.ItemCode AS [ItemCode], T0.Dscription AS [Descripcion], T0.CreateDate AS [FechaCreacion], T0.DocDate AS [FechaConta], 'NE',T1.DocNum AS [DocNum],
T0.Warehouse AS [Almacen], T3.Quantity AS [Cantidad], T0.CalcPrice AS [PrecioCal], T0.TransValue AS [ValorTrans], T1.U_BPP_MDTD AS [TipoDoc],
T1.U_BPP_MDSD AS [Serie], T1.U_BPP_MDCD AS [Correlativo], -1 AS [Factor], 'Entrega de Mercancías' AS [Objecto]
FROM OINM T0 INNER JOIN ODLN T1 ON(T0.TransType = T1.ObjType AND T0.BASE_REF = T1.DocNum)
INNER JOIN OITM T2 ON(T0.ItemCode = T2.ItemCode)
INNER JOIN DLN1 T3 ON(T1.DocEntry = T3.DocEntry AND T0.ItemCode = T3.ItemCode)
WHERE T0.Warehouse=@Almacen and T0.CreateDate >= @FechaIni AND T0.CreateDate <= @FechaFin
ORDER BY T0.ItemCode, T0.DocDate
Lo que estoy pensando es como acoplar el Saldo Inicial por Artículo para luego generar una operación con la Cantidad y generar Cantidad Acumulada.
Gracias
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.