Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ codeunit 20442 "Qlty. Disp. Move Auto Choose" implements "Qlty. Disposition"
if (TempQuantityToActQltyDispositionBuffer."New Location Code" <> '') and (TempQuantityToActQltyDispositionBuffer."New Location Code" <> TempQuantityToActQltyDispositionBuffer."Location Filter") then
Error(UnableToChangeBinsBetweenLocationsBecauseDirectedPickAndPutErr, QltyInspectionHeader."No.", TempQuantityToActQltyDispositionBuffer."Location Filter", TempQuantityToActQltyDispositionBuffer."New Location Code");

QltyInventoryAvailability.ErrorIfFromBinIsReceiveBin(QltyInspectionHeader, TempQuantityToActQltyDispositionBuffer.GetFromLocationCode(), TempQuantityToActQltyDispositionBuffer.GetFromBinCode());

if BackwardsCompatibleFlagCallMoveInventoryFirstUseWorksheet then
DidSomething := QltyDispMoveWorksheet.PerformDisposition(QltyInspectionHeader, TempQuantityToActQltyDispositionBuffer)
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ codeunit 20451 "Qlty. Disp. Move Worksheet" implements "Qlty. Disposition"
if (TempQuantityToActQltyDispositionBuffer."New Location Code" <> '') and (TempQuantityToActQltyDispositionBuffer."New Location Code" <> TempQuantityToActQltyDispositionBuffer."Location Filter") then
Error(UnableToChangeBinsBetweenLocationsBecauseDirectedPickAndPutErr, QltyInspectionHeader."No.", TempQuantityToActQltyDispositionBuffer."Location Filter", TempQuantityToActQltyDispositionBuffer."New Location Code");

QltyInventoryAvailability.ErrorIfFromBinIsReceiveBin(QltyInspectionHeader, TempQuantityToActQltyDispositionBuffer.GetFromLocationCode(), TempQuantityToActQltyDispositionBuffer.GetFromBinCode());

MovementLineCreated := false;

CreateWarehouseWorksheetLine(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ report 20404 "Qlty. Move Inventory"
Caption = 'Location';
ToolTip = 'Specifies the destination location to move the inventory to.';
ShowMandatory = true;
Editable = IsDestinationLocationEditable;

trigger OnValidate()
var
Expand All @@ -258,17 +259,47 @@ report 20404 "Qlty. Move Inventory"
ShowBinCode := true;
if DestinationLocation.Get(DestinationLocationCode) then
ShowBinCode := DestinationLocation."Bin Mandatory";
DestinationBinCode := '';
end;
}

field(ChooseDestinationBin; DestinationBinCode)
{
ApplicationArea = All;
TableRelation = Bin.Code;
Caption = 'Bin';
ToolTip = 'Specifies the destination bin to move the inventory to.';
ShowMandatory = true;
Enabled = ShowBinCode;

trigger OnLookup(var Text: Text): Boolean
var
DestinationBin: Record Bin;
BinList: Page "Bin List";
begin
if DestinationLocationCode = '' then
exit(false);

DestinationBin.SetRange("Location Code", DestinationLocationCode);
BinList.SetTableView(DestinationBin);
BinList.LookupMode(true);
if BinList.RunModal() = Action::LookupOK then begin
BinList.GetRecord(DestinationBin);
Text := DestinationBin.Code;
exit(true);
end;
exit(false);
end;

trigger OnValidate()
var
DestinationBin: Record Bin;
begin
if DestinationBinCode = '' then
exit;
Comment thread
6CRIPT marked this conversation as resolved.
if DestinationLocationCode = '' then
exit;
DestinationBin.Get(DestinationLocationCode, DestinationBinCode);
end;
}
}
group(PostImmediately)
Expand Down Expand Up @@ -300,6 +331,28 @@ report 20404 "Qlty. Move Inventory"
}
}
}

Comment thread
6CRIPT marked this conversation as resolved.
trigger OnOpenPage()
var
QltyInspectionHeader: Record "Qlty. Inspection Header";
DestinationLocation: Record Location;
begin
QltyInspectionHeader.CopyFilters(CurrentInspection);
if not QltyInspectionHeader.FindSet() then
exit;
if QltyInspectionHeader.Next() <> 0 then
exit;

if QltyInspectionHeader."Location Code" = '' then
exit;

DestinationLocationCode := QltyInspectionHeader."Location Code";
IsDestinationLocationEditable := false;

ShowBinCode := false;
if DestinationLocation.Get(DestinationLocationCode) then
ShowBinCode := DestinationLocation."Bin Mandatory";
end;
}

var
Expand All @@ -313,6 +366,7 @@ report 20404 "Qlty. Move Inventory"
ShouldPostImmediately: Boolean;
ShouldPostLater: Boolean;
ShowBinCode: Boolean;
IsDestinationLocationEditable: Boolean;
UseMovement: Boolean;
UseReclass: Boolean;
IsMoveSpecific: Boolean;
Expand All @@ -327,5 +381,6 @@ report 20404 "Qlty. Move Inventory"
ShouldPostLater := not ShouldPostImmediately;
UseReclass := not UseMovement;
IsMoveSpecific := true;
IsDestinationLocationEditable := true;
end;
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ codeunit 20445 "Qlty. Inventory Availability"
QtyToReceiveNameLbl: Label 'Qty. to Receive', Locked = true;
QtyToHandleBaseNameLbl: Label 'Qty. to Handle (Base)', Locked = true;
QuantityToHandleNameLbl: Label 'Quantity to Handle', Locked = true;
CannotMoveFromReceiveBinErr: Label 'The items for inspection %1 are still in the receiving bin %2 at location %3 and cannot be moved yet. Put the items away first by using a Put-Away, and then move the inventory.', Comment = '%1=the inspection, %2=from bin code, %3=from location code';

/// <summary>
/// GetCurrentLocationOfTrackedInventory gets the current location of the Item+Item tracking defined on the inspection.
Expand Down Expand Up @@ -456,6 +457,27 @@ codeunit 20445 "Qlty. Inventory Availability"
OnAfterPopulateBinContentBuffer(QltyInspectionHeader, TempInstructionQltyDispositionBuffer, TempQuantityQltyDispositionBuffer, TempExistingInventoryBinContent);
end;

/// <summary>
/// Raises an error if the inventory would be moved from a receiving bin, which is not allowed in directed put-away and pick locations until the items have been put away.
/// </summary>
/// <param name="QltyInspectionHeader">The inspection the inventory move relates to.</param>
/// <param name="FromLocationCode">The location code the inventory is being moved from.</param>
Comment thread
6CRIPT marked this conversation as resolved.
/// <param name="FromBinCode">The bin code the inventory is being moved from.</param>
internal procedure ErrorIfFromBinIsReceiveBin(QltyInspectionHeader: Record "Qlty. Inspection Header"; FromLocationCode: Code[10]; FromBinCode: Code[20])
var
FromBin: Record Bin;
BinType: Record "Bin Type";
begin
if (FromLocationCode = '') or (FromBinCode = '') then
exit;
if not FromBin.Get(FromLocationCode, FromBinCode) then
exit;
if not BinType.Get(FromBin."Bin Type Code") then
exit;
if BinType.Receive then
Error(CannotMoveFromReceiveBinErr, QltyInspectionHeader.GetFriendlyIdentifier(), FromBinCode, FromLocationCode);
end;

[IntegrationEvent(false, false)]
procedure OnBeforePopulateBinContentBuffer(var QltyInspectionHeader: Record "Qlty. Inspection Header"; var TempInstructionQltyDispositionBuffer: Record "Qlty. Disposition Buffer" temporary; var TempQuantityQltyDispositionBuffer: Record "Qlty. Disposition Buffer" temporary; var TempExistingInventoryBinContent: Record "Bin Content" temporary; var IsHandled: Boolean)
begin
Expand Down