28. November 2008 11:17
28. November 2008 16:26
3. Dezember 2008 10:23
3. Dezember 2008 11:29
3. Dezember 2008 12:47
IF SKU.FIND('-') THEN BEGIN
QuantityOnHandBuffer.RESET;
QuantityOnHandBuffer.SETRANGE("Item No.",Item."No.");
REPEAT
QuantityOnHandBuffer.SETRANGE("Variant Code",SKU."Variant Code");
QuantityOnHandBuffer.SETRANGE("Location Code",SKU."Location Code");
IF NOT QuantityOnHandBuffer.FIND('-') THEN BEGIN
CLEAR(QuantityOnHandBuffer);
QuantityOnHandBuffer."Item No." := SKU."Item No.";
QuantityOnHandBuffer."Variant Code" := SKU."Variant Code";
QuantityOnHandBuffer."Location Code" := SKU."Location Code";
QuantityOnHandBuffer.INSERT;
END;
UNTIL SKU.NEXT = 0;
END ELSE BEGIN // - START wenn keine Lagerhaltungsdaten vorhanden sind
ItemLedgEntry2.SETCURRENTKEY("Item No.");
ItemLedgEntry2.SETRANGE("Item No.",Item."No.");
IF NOT ItemLedgEntry2.FIND('-') THEN BEGIN
Location2.SETFILTER(Code,Item.GETFILTER("Location Filter"));
IF Location2.FIND('-') THEN REPEAT
QuantityOnHandBuffer.RESET;
QuantityOnHandBuffer.SETRANGE("Item No.",Item."No.");
QuantityOnHandBuffer.SETRANGE("Location Code",Location2.Code);
IF NOT QuantityOnHandBuffer.FIND('-') THEN BEGIN
CLEAR(QuantityOnHandBuffer);
QuantityOnHandBuffer."Item No." := Item."No.";
QuantityOnHandBuffer."Location Code" := Location2.Code;
QuantityOnHandBuffer.INSERT;
END;
UNTIL Location2.NEXT = 0;
END;
END;
// + ENDE
4. Dezember 2008 16:18
5. Dezember 2008 12:32
IF SKU.FIND('-') THEN BEGIN
QuantityOnHandBuffer.RESET;
QuantityOnHandBuffer.SETRANGE("Item No.",Item."No.");
REPEAT
QuantityOnHandBuffer.SETRANGE("Variant Code",SKU."Variant Code");
QuantityOnHandBuffer.SETRANGE("Location Code",SKU."Location Code");
IF NOT QuantityOnHandBuffer.FIND('-') THEN BEGIN
CLEAR(QuantityOnHandBuffer);
QuantityOnHandBuffer."Item No." := SKU."Item No.";
QuantityOnHandBuffer."Variant Code" := SKU."Variant Code";
QuantityOnHandBuffer."Location Code" := SKU."Location Code";
QuantityOnHandBuffer.INSERT;
END;
UNTIL SKU.NEXT = 0;
END ELSE BEGIN // - GENERAL wenn keine Lagerhaltungsdaten vorhanden sind
ItemLedgEntry2.SETCURRENTKEY(
"Item No.","Entry Type","Variant Code","Drop Shipment","Location Code","Posting Date");
Location2.SETFILTER(Code,Item.GETFILTER("Location Filter"));
IF Location2.FINDSET THEN REPEAT
ItemVariant2.SETRANGE("Item No.",Item."No.");
ItemVariant2.SETFILTER(Code,Item.GETFILTER("Variant Filter"));
IF ItemVariant2.FINDSET THEN BEGIN // Artikel hat Varianten
REPEAT
ItemLedgEntry2.SETRANGE("Item No.",Item."No.");
ItemLedgEntry2.SETRANGE("Location Code",Location2.Code);
ItemLedgEntry2.SETRANGE("Drop Shipment",FALSE);
ItemLedgEntry2.SETRANGE("Variant Code",ItemVariant2.Code);
IF NOT ItemLedgEntry2.FIND('-') THEN BEGIN
QuantityOnHandBuffer.RESET;
QuantityOnHandBuffer.SETRANGE("Item No.",Item."No.");
QuantityOnHandBuffer.SETRANGE("Variant Code",ItemVariant2.Code); // neu
QuantityOnHandBuffer.SETRANGE("Location Code",Location2.Code);
IF NOT QuantityOnHandBuffer.FIND('-') THEN BEGIN
CLEAR(QuantityOnHandBuffer);
QuantityOnHandBuffer."Item No." := Item."No.";
QuantityOnHandBuffer."Location Code" := Location2.Code;
QuantityOnHandBuffer."Variant Code" := ItemVariant2.Code; // neu
QuantityOnHandBuffer.INSERT;
END;
END;
UNTIL ItemVariant2.NEXT = 0;
// Artikel hat Varianten, zusätzlich noch einen Zeile ohne Variantencode
ItemLedgEntry2.SETRANGE("Item No.",Item."No.");
ItemLedgEntry2.SETRANGE("Location Code",Location2.Code);
ItemLedgEntry2.SETRANGE("Drop Shipment",FALSE);
ItemLedgEntry2.SETRANGE("Variant Code",'');
IF NOT ItemLedgEntry2.FIND('-') THEN BEGIN
QuantityOnHandBuffer.RESET;
QuantityOnHandBuffer.SETRANGE("Item No.",Item."No.");
QuantityOnHandBuffer.SETRANGE("Location Code",Location2.Code);
IF NOT QuantityOnHandBuffer.FIND('-') THEN BEGIN
CLEAR(QuantityOnHandBuffer);
QuantityOnHandBuffer."Item No." := Item."No.";
QuantityOnHandBuffer."Location Code" := Location2.Code;
QuantityOnHandBuffer.INSERT;
END;
END;
END ELSE BEGIN // Artikel hat keine Varianten, allg. Variantenfilter liegt ggf. auf Artikeltabelle
ItemLedgEntry2.SETRANGE("Item No.",Item."No.");
ItemLedgEntry2.SETRANGE("Location Code",Location2.Code);
ItemLedgEntry2.SETRANGE("Drop Shipment",FALSE);
ItemLedgEntry2.SETFILTER("Variant Code",Item.GETFILTER("Variant Filter"));
IF NOT ItemLedgEntry2.FIND('-') THEN BEGIN
QuantityOnHandBuffer.RESET;
QuantityOnHandBuffer.SETRANGE("Item No.",Item."No.");
QuantityOnHandBuffer.SETRANGE("Variant Code",'');
QuantityOnHandBuffer.SETRANGE("Location Code",Location2.Code);
IF NOT QuantityOnHandBuffer.FIND('-') THEN BEGIN
CLEAR(QuantityOnHandBuffer);
QuantityOnHandBuffer."Item No." := Item."No.";
QuantityOnHandBuffer."Location Code" := Location2.Code;
QuantityOnHandBuffer.INSERT;
END;
END;
END;
UNTIL Location2.NEXT = 0;
END;