1

**1. Describe the bug**

codeunit 7311 "Whse. Worksheet-Create" procedure AdjustQtyToHandle() variable AvailQtyToPick .

Variable must be converted to AvailQtyToPickBase and only then transferred to procedure CalcReservedNotFromILEQty() to variable QtyBaseAvailToPick


``` AL

//******error source code

local procedure AdjustQtyToHandle(var WhseWkshLine: Record "Whse. Worksheet Line")

  var

    TypeHelper: Codeunit "Type Helper";

    AvailQtyToPick, AvailQtyToPickBase : Decimal;

  begin

    AvailQtyToPick := WhseWkshLine.AvailableQtyToPickExcludingQCBins();

    WhseWkshLine."Qty. to Handle" := TypeHelper.Minimum(AvailQtyToPick, WhseWkshLine."Qty. Outstanding");

    WhseWkshLine."Qty. to Handle (Base)" := WhseWkshLine.CalcBaseQty(WhseWkshLine."Qty. to Handle");

    AvailQtyToPickBase := WhseWkshLine.CalcBaseQty(AvailQtyToPick);

    WhseWkshLine.CalcReservedNotFromILEQty(AvailQtyToPickBase, WhseWkshLine."Qty. to Handle", WhseWkshLine."Qty. to Handle (Base)");

  end;


//******bug-fixed code to replace

local procedure AdjustQtyToHandle(var WhseWkshLine: Record "Whse. Worksheet Line")

  var

    TypeHelper: Codeunit "Type Helper";

    AvailQtyToPick, AvailQtyToPickBase : Decimal;

  begin

    AvailQtyToPick := WhseWkshLine.AvailableQtyToPickExcludingQCBins();

    WhseWkshLine."Qty. to Handle" := TypeHelper.Minimum(AvailQtyToPick, WhseWkshLine."Qty. Outstanding");

    WhseWkshLine."Qty. to Handle (Base)" := WhseWkshLine.CalcBaseQty(WhseWkshLine."Qty. to Handle");

// >>

// comment to fix bug

    // WhseWkshLine.CalcReservedNotFromILEQty(AvailQtyToPick, WhseWkshLine."Qty. to Handle", WhseWkshLine."Qty. to Handle (Base)");

// added to fix bug

    AvailQtyToPickBase := WhseWkshLine.CalcBaseQty(AvailQtyToPick);

    WhseWkshLine.CalcReservedNotFromILEQty(AvailQtyToPickBase, WhseWkshLine."Qty. to Handle", WhseWkshLine."Qty. to Handle (Base)");

//>>

  end;

```


**3. Expected behavior**

when creating lines in the selection sheet, the quantity for selection must be an integer with the available quantity for selection, and it is decimal (with numbers after the decimal point)


**4. Actual behavior**

when creating lines in the selection sheet, the quantity to pick with the available quantity to pick is decimal (with numbers after the decimal point)


**5. Versions:**

- AL Language: v10.4.747197

- Visual Studio Code: 1.75.1 (user setup)

- Business Central: 21.4.52563.52602

Category: Warehousing
STATUS DETAILS
Needs Votes
Ideas Administrator

Thank you for this suggestion! Currently this is not on our roadmap. We are tracking this idea and if it gathers more votes and comments we will consider it in the future. Best regards, Business Central Team