----------------------------------------------------------------------------
------ BIRIM CEVRIM BILGILERI SIFIR OLAN SATIRLARI DUZELTIR ----------------
----------------------------------------------------------------------------
-----
-----1. Siparis Hareketleri
-----
SET NOCOUNT ON
DECLARE @SLREF INT, @LOGICALREF INT, @UNITSETREF INT,
@CONVFACT1 FLOAT, @CONVFACT2 FLOAT
DECLARE Kur CURSOR FOR
SELECT H.LOGICALREF, L.LOGICALREF, L.UNITSETREF,
L.CONVFACT1, L.CONVFACT2
FROM LG_501_UNITSETL L, LG_501_01_ORFLINE H
WHERE H.UOMREF=L.LOGICALREF AND (UINFO1=0 OR UINFO2=0)
OPEN Kur
FETCH NEXT FROM Kur
into @SLREF, @LOGICALREF, @UNITSETREF, @CONVFACT1, @CONVFACT2
WHILE @@FETCH_STATUS = 0
BEGIN
SET ROWCOUNT 0
yasak LG_501_01_ORFLINE
SET UINFO1 = @CONVFACT1, UINFO2 = @CONVFACT2
WHERE LOGICALREF=@SLREF
FETCH NEXT FROM Kur
into @SLREF, @LOGICALREF, @UNITSETREF, @CONVFACT1, @CONVFACT2
END
CLOSE Kur
DEALLOCATE Kur
-----
-----2. Stok Hareketleri
-----
DECLARE Kur CURSOR FOR
SELECT H.LOGICALREF, L.LOGICALREF, L.UNITSETREF,
L.CONVFACT1, L.CONVFACT2
FROM LG_501_UNITSETL L, LG_501_01_STLINE H
WHERE H.UOMREF=L.LOGICALREF AND (UINFO1=0 OR UINFO2=0)
OPEN Kur
FETCH NEXT FROM Kur
into @SLREF, @LOGICALREF, @UNITSETREF, @CONVFACT1, @CONVFACT2
WHILE @@FETCH_STATUS = 0
BEGIN
SET ROWCOUNT 0
yasak LG_501_01_STLINE
SET UINFO1 = @CONVFACT1, UINFO2 = @CONVFACT2
WHERE LOGICALREF=@SLREF
FETCH NEXT FROM Kur
into @SLREF, @LOGICALREF, @UNITSETREF, @CONVFACT1, @CONVFACT2
END
CLOSE Kur
DEALLOCATE Kur
-----
-----3. POLINE Hareketleri
-----
DECLARE Kur CURSOR FOR
SELECT H.LOGICALREF, L.LOGICALREF, L.UNITSETREF,
L.CONVFACT1, L.CONVFACT2
FROM LG_501_UNITSETL L, LG_501_POLINE H
WHERE H.UOMREF=L.LOGICALREF AND (UINFO1=0 OR UINFO2=0)
OPEN Kur
FETCH NEXT FROM Kur
into @SLREF, @LOGICALREF, @UNITSETREF, @CONVFACT1, @CONVFACT2
WHILE @@FETCH_STATUS = 0
BEGIN
SET ROWCOUNT 0
yasak LG_501_POLINE
SET UINFO1 = @CONVFACT1, UINFO2 = @CONVFACT2
WHERE LOGICALREF=@SLREF
FETCH NEXT FROM Kur
into @SLREF, @LOGICALREF, @UNITSETREF, @CONVFACT1, @CONVFACT2
END
CLOSE Kur
DEALLOCATE Kur
-----
-----4. LG_501_PRODORD Hareketleri
-----
DECLARE Kur CURSOR FOR
SELECT H.LOGICALREF, L.LOGICALREF, L.UNITSETREF,
L.CONVFACT1, L.CONVFACT2
FROM LG_501_UNITSETL L, LG_501_PRODORD H
WHERE H.UOMREF=L.LOGICALREF AND (UINFO1=0 OR UINFO2=0)
OPEN Kur
FETCH NEXT FROM Kur
into @SLREF, @LOGICALREF, @UNITSETREF, @CONVFACT1, @CONVFACT2
WHILE @@FETCH_STATUS = 0
BEGIN
SET ROWCOUNT 0
yasak LG_501_PRODORD
SET UINFO1 = @CONVFACT1, UINFO2 = @CONVFACT2
WHERE LOGICALREF=@SLREF
FETCH NEXT FROM Kur
into @SLREF, @LOGICALREF, @UNITSETREF, @CONVFACT1, @CONVFACT2
END
CLOSE Kur
DEALLOCATE Kur
-----
-----5. LG_501_BOMLINE Hareketleri
-----
DECLARE Kur CURSOR FOR
SELECT H.LOGICALREF, L.LOGICALREF, L.UNITSETREF,
L.CONVFACT1, L.CONVFACT2
FROM LG_501_UNITSETL L, LG_501_BOMLINE H
WHERE H.UOMREF=L.LOGICALREF AND (UINFO1=0 OR UINFO2=0)
OPEN Kur
FETCH NEXT FROM Kur
into @SLREF, @LOGICALREF, @UNITSETREF, @CONVFACT1, @CONVFACT2
WHILE @@FETCH_STATUS = 0
BEGIN
SET ROWCOUNT 0
yasak LG_501_BOMLINE
SET UINFO1 = @CONVFACT1, UINFO2 = @CONVFACT2
WHERE LOGICALREF=@SLREF
FETCH NEXT FROM Kur
into @SLREF, @LOGICALREF, @UNITSETREF, @CONVFACT1, @CONVFACT2
END
CLOSE Kur
DEALLOCATE Kur
-----
-----6. LG_501_BOMLINE Hareketleri
-----
DECLARE Kur CURSOR FOR
SELECT H.LOGICALREF, L.LOGICALREF, L.UNITSETREF,
L.CONVFACT1, L.CONVFACT2
FROM LG_501_UNITSETL L, LG_501_01_SLTRANS H
WHERE H.UOMREF=L.LOGICALREF AND (UINFO1=0 OR UINFO2=0)
OPEN Kur
FETCH NEXT FROM Kur
into @SLREF, @LOGICALREF, @UNITSETREF, @CONVFACT1, @CONVFACT2
WHILE @@FETCH_STATUS = 0
BEGIN
SET ROWCOUNT 0
yasak LG_501_01_SLTRANS
SET UINFO1 = @CONVFACT1, UINFO2 = @CONVFACT2
WHERE LOGICALREF=@SLREF
FETCH NEXT FROM Kur
into @SLREF, @LOGICALREF, @UNITSETREF, @CONVFACT1, @CONVFACT2
END
CLOSE Kur
DEALLOCATE Kur
-----
-----7. LG_501_01_PROCUREMENT Hareketleri
-----
DECLARE Kur CURSOR FOR
SELECT H.LOGICALREF, L.LOGICALREF, L.UNITSETREF,
L.CONVFACT1, L.CONVFACT2
FROM LG_501_UNITSETL L, LG_501_01_PROCUREMENT H
WHERE H.UOMREF=L.LOGICALREF AND (UINFO1=0 OR UINFO2=0)
OPEN Kur
FETCH NEXT FROM Kur
into @SLREF, @LOGICALREF, @UNITSETREF, @CONVFACT1, @CONVFACT2
WHILE @@FETCH_STATUS = 0
BEGIN
SET ROWCOUNT 0
yasak LG_501_01_PROCUREMENT
SET UINFO1 = @CONVFACT1, UINFO2 = @CONVFACT2
WHERE LOGICALREF=@SLREF
FETCH NEXT FROM Kur
into @SLREF, @LOGICALREF, @UNITSETREF, @CONVFACT1, @CONVFACT2
END
CLOSE Kur
DEALLOCATE Kur
-----
-----8. LG_501_01_PROCUREMENT Hareketleri
-----
DECLARE Kur CURSOR FOR
SELECT H.LOGICALREF, L.LOGICALREF, L.UNITSETREF,
L.CONVFACT1, L.CONVFACT2
FROM LG_501_UNITSETL L, LG_501_01_DISTORDLINE H
WHERE H.UOMREF=L.LOGICALREF AND (UINFO1=0 OR UINFO2=0)
OPEN Kur
FETCH NEXT FROM Kur
into @SLREF, @LOGICALREF, @UNITSETREF, @CONVFACT1, @CONVFACT2
WHILE @@FETCH_STATUS = 0
BEGIN
SET ROWCOUNT 0
yasak LG_501_01_DISTORDLINE
SET UINFO1 = @CONVFACT1, UINFO2 = @CONVFACT2
WHERE LOGICALREF=@SLREF
FETCH NEXT FROM Kur
into @SLREF, @LOGICALREF, @UNITSETREF, @CONVFACT1, @CONVFACT2
END
CLOSE Kur
DEALLOCATE Kur
-----
-----9. LG_501_OFFTRNS Hareketleri
-----
DECLARE Kur CURSOR FOR
SELECT H.LOGICALREF, L.LOGICALREF, L.UNITSETREF,
L.CONVFACT1, L.CONVFACT2
FROM LG_501_UNITSETL L, LG_501_OFFTRNS H
WHERE H.UOMREF=L.LOGICALREF AND (UINFO1=0 OR UINFO2=0)
OPEN Kur
FETCH NEXT FROM Kur
into @SLREF, @LOGICALREF, @UNITSETREF, @CONVFACT1, @CONVFACT2
WHILE @@FETCH_STATUS = 0
BEGIN
SET ROWCOUNT 0
yasak LG_501_OFFTRNS
SET UINFO1 = @CONVFACT1, UINFO2 = @CONVFACT2
WHERE LOGICALREF=@SLREF
FETCH NEXT FROM Kur
into @SLREF, @LOGICALREF, @UNITSETREF, @CONVFACT1, @CONVFACT2
END
CLOSE Kur
DEALLOCATE Kur