Skip to content
Merged
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 @@ -138,6 +138,9 @@ report 790 "Calculate Inventory"

trigger OnPreDataItem()
begin
if WarehouseEntryTableIsCompletelyEmpty then
CurrReport.Break(); // Skip if Warehouse Entry table has no records at all (checked once in Item.OnPreDataItem).
Comment thread
JakovljevicDusan marked this conversation as resolved.

if not "Item Ledger Entry".IsEmpty() then
CurrReport.Break(); // Skip if item has any record in Item Ledger Entry.
end;
Expand Down Expand Up @@ -206,6 +209,7 @@ report 790 "Calculate Inventory"
var
ItemJnlTemplate: Record "Item Journal Template";
ItemJnlBatch: Record "Item Journal Batch";
WarehouseEntryToCheck: Record "Warehouse Entry";
begin
if PostingDate = 0D then
Error(Text000);
Expand Down Expand Up @@ -235,6 +239,8 @@ report 790 "Calculate Inventory"
if not SkipDim then
SelectedDim.GetSelectedDim(UserId, 3, REPORT::"Calculate Inventory", '', TempSelectedDim);

WarehouseEntryTableIsCompletelyEmpty := WarehouseEntryToCheck.IsEmpty();

TempQuantityOnHandBuffer.Reset();
TempQuantityOnHandBuffer.DeleteAll();

Expand Down Expand Up @@ -362,6 +368,7 @@ report 790 "Calculate Inventory"
ZeroQtySave: Boolean;
AdjustPosQty: Boolean;
DocumentNoInputMandatory: Boolean;
WarehouseEntryTableIsCompletelyEmpty: Boolean;
PosQty: Decimal;
NegQty: Decimal;
ItemNotOnInventoryErr: Label 'Items Not on Inventory.';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ report 790 "Calculate Inventory"

trigger OnPreDataItem()
begin
if WarehouseEntryTableIsCompletelyEmpty then
CurrReport.Break(); // Skip if Warehouse Entry table has no records at all (checked once in Item.OnPreDataItem).

if not "Item Ledger Entry".IsEmpty() then
CurrReport.Break(); // Skip if item has any record in Item Ledger Entry.
end;
Expand Down Expand Up @@ -206,6 +209,7 @@ report 790 "Calculate Inventory"
var
ItemJnlTemplate: Record "Item Journal Template";
ItemJnlBatch: Record "Item Journal Batch";
WarehouseEntryToCheck: Record "Warehouse Entry";
begin
if PostingDate = 0D then
Error(Text000);
Expand Down Expand Up @@ -235,6 +239,8 @@ report 790 "Calculate Inventory"
if not SkipDim then
SelectedDim.GetSelectedDim(UserId, 3, REPORT::"Calculate Inventory", '', TempSelectedDim);

WarehouseEntryTableIsCompletelyEmpty := WarehouseEntryToCheck.IsEmpty();

TempQuantityOnHandBuffer.Reset();
TempQuantityOnHandBuffer.DeleteAll();

Expand Down Expand Up @@ -362,6 +368,7 @@ report 790 "Calculate Inventory"
ZeroQtySave: Boolean;
AdjustPosQty: Boolean;
DocumentNoInputMandatory: Boolean;
WarehouseEntryTableIsCompletelyEmpty: Boolean;
PosQty: Decimal;
NegQty: Decimal;
ItemNotOnInventoryErr: Label 'Items Not on Inventory.';
Expand Down
Loading