26. Oktober 2012 10:04
PROCEDURE CalcAvailableQty@1() AvailableQty@1000 : Decimal;
VAR
Item@1002 : Record 27;
AvailableQtyBase@1001 : Decimal;
AvailableWMSQtyBase@1004 : Decimal;
BEGIN
IF NOT Item.GET("Item No.") THEN
EXIT;
WITH Item DO BEGIN
SETRANGE("Location Filter","Location Code"); // <== !!!
SETRANGE("Variant Filter","Variant Code");
SETRANGE("Wksh.-Template Name Filter","Worksheet Template Name");
CALCFIELDS(
Inventory,
"Qty. Received not available",
"Qty. Assigned",
"Qty. Assigned to pick",
"Reserved Qty. on Inventory",
"Qty. Picked");
GetLocation("Location Code"); // <== !!!
IF Location."Use Zones and Bins" THEN BEGIN
AvailableWMSQtyBase :=
CalcAvailWhseQtyBase("Location Code","Item No.","Variant Code","Unit of Measure Code"); // <== !!!
AvailableQtyBase :=
AvailableWMSQtyBase - "Qty. Assigned";
END ELSE BEGIN
AvailableQtyBase :=
Inventory - "Qty. Received not available" - "Qty. Assigned" -
"Qty. Assigned to pick" - ABS("Reserved Qty. on Inventory") + AssignedQtyOnReservedLines - "Qty. Picked";
END;
SETRANGE("Location Filter");
END;
AvailableQty := CalcQty(AvailableQtyBase);
END;
26. Oktober 2012 13:50
26. Oktober 2012 14:37
26. Oktober 2012 19:57
28. Oktober 2012 07:49
28. Oktober 2012 15:31
Freestyler hat geschrieben:Aber nun verstehe ich, warum manchmal vor dem Verwenden von WITH im eigen programmierten Code gewarnt wird.
29. Oktober 2012 10:50
29. Oktober 2012 13:17
JanGD hat geschrieben:Der Code wird bei langen WITH Bereichen ja doch etwas unleserlich.
12. November 2012 09:50