Query 36986 Item Ledger Entries - Prod.

PowerBI Reports, Microsoft.Manufacturing.PowerBIReports

src/Apps/W1/PowerBIReports/App/Manufacturing/APIs/ItemLedgerEntriesProd.Query.al91 lines, Copyright (c) Microsoft Corporation. MIT

// ------------------------------------------------------------------------------------------------// Copyright (c) Microsoft Corporation. All rights reserved.// Licensed under the MIT License. See License.txt in the project root for license information.// ------------------------------------------------------------------------------------------------namespace Microsoft.Manufacturing.PowerBIReports;using Microsoft.Inventory.Ledger;using Microsoft.Inventory.Location;#if not CLEAN28#pragma warning disable AL0801#endifquery 36986 "Item Ledger Entries - Prod."{    Access = Internal;    Caption = 'Power BI Prod. Item Ledger Entries';    QueryType = API;    AboutText = 'Provides access to item ledger entries for production orders including consumption and output entries, quantities, costs, and locations. Enables Power BI reports to analyze production material consumption, output tracking, and manufacturing inventory movements.';    APIPublisher = 'microsoft';    APIGroup = 'analytics';    ApiVersion = 'v0.5', 'v1.0';    EntityName = 'prodItemLedgerEntry';    EntitySetName = 'prodItemLedgerEntries';    DataAccessIntent = ReadOnly;    elements    {        dataitem(ItemLedgerEntry; "Item Ledger Entry")        {            DataItemTableFilter = "Order Type" = filter(Production);            column(entryType; "Entry Type")            {            }            column(orderType; "Order Type")            {            }            column(orderNo; "Order No.")            {            }            column(orderLineNo; "Order Line No.")            {            }            column(postingDate; "Posting Date")            {            }            column(itemNo; "Item No.")            {            }            column(locationCode; "Location Code")            {            }            column(serialNo; "Serial No.")            {            }            column(lotNo; "Lot No.")            {            }            column(quantity; Quantity)            {                Method = Sum;            }            column(costAmountActual; "Cost Amount (Actual)")            {                Method = Sum;            }            column(dimensionSetID; "Dimension Set ID")            {            }            column(positive; Positive)            {            }            dataitem(Location; Location)            {                DataItemLink = Code = ItemLedgerEntry."Location Code";                column(Location_Name; Name)                {                }            }        }    }    trigger OnBeforeOpen()    var        PBIMgt: Codeunit "Manuf. Filter Helper";        DateFilterText: Text;    begin        DateFilterText := PBIMgt.GenerateManufacturingReportDateFilter();        if DateFilterText <> '' then            CurrQuery.SetFilter(postingDate, DateFilterText);    end;}