Page 6624 Blanket Purch. Order Arch.Sub.

Base Application, Microsoft.Purchases.Archive

src/Layers/W1/BaseApp/Purchases/Archive/BlanketPurchOrderArchSub.Page.al434 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.Purchases.Archive;using Microsoft.Finance.Dimension;using Microsoft.Foundation.Navigate;using Microsoft.Inventory.Item.Catalog;#pragma warning disable AS0106 // Protected variable ItemReferenceVisible was removed before AS0106 was introduced.page 6624 "Blanket Purch. Order Arch.Sub."#pragma warning restore AS0106{    Caption = 'Lines';    Editable = false;    PageType = ListPart;    SourceTable = "Purchase Line Archive";    SourceTableView = where("Document Type" = const("Blanket Order"));    layout    {        area(content)        {            repeater(Control47)            {                ShowCaption = false;                field(Type; Rec.Type)                {                    ApplicationArea = Suite;                    ToolTip = 'Specifies the entry type.';                }                field("No."; Rec."No.")                {                    ApplicationArea = Suite;                    ToolTip = 'Specifies the number of the archived purchase order.';                }                field("Item Reference No."; Rec."Item Reference No.")                {                    AccessByPermission = tabledata "Item Reference" = R;                    ApplicationArea = Suite, ItemReferences;                }                field("Variant Code"; Rec."Variant Code")                {                    ApplicationArea = Planning;                    Visible = false;                }                field(Nonstock; Rec.Nonstock)                {                    ApplicationArea = Suite;                    ToolTip = 'Specifies that the item on the sales line is a catalog item, which means it is not normally kept in inventory.';                    Visible = false;                }                field("VAT Prod. Posting Group"; Rec."VAT Prod. Posting Group")                {                    ApplicationArea = Basic, Suite;                    ToolTip = 'Specifies the VAT product posting group. Links business transactions made for the item, resource, or G/L account with the general ledger, to account for VAT amounts resulting from trade with that record.';                    Visible = false;                }                field(Description; Rec.Description)                {                    ApplicationArea = Suite;                }                field("Description 2"; Rec."Description 2")                {                    ApplicationArea = Suite;                    Importance = Additional;                    Visible = false;                }                field("Drop Shipment"; Rec."Drop Shipment")                {                    ApplicationArea = Suite;                    Visible = false;                }                field("Return Reason Code"; Rec."Return Reason Code")                {                    ApplicationArea = Suite;                    ToolTip = 'Specifies the code of the responsibility center that is associated with the user, company, or vendor.';                    Visible = false;                }                field("Location Code"; Rec."Location Code")                {                    ApplicationArea = Location;                }                field(Quantity; Rec.Quantity)                {                    ApplicationArea = Suite;                    BlankZero = true;                }                field("Unit of Measure Code"; Rec."Unit of Measure Code")                {                    ApplicationArea = Suite;                }                field("Unit of Measure"; Rec."Unit of Measure")                {                    ApplicationArea = Suite;                    ToolTip = 'Specifies the unit of measure used for the item, for example bottle or piece.';                    Visible = false;                }                field("Direct Unit Cost"; Rec."Direct Unit Cost")                {                    ApplicationArea = Suite;                    BlankZero = true;                }                field("Indirect Cost %"; Rec."Indirect Cost %")                {                    ApplicationArea = Suite;                    Visible = false;                }                field("Unit Cost (LCY)"; Rec."Unit Cost (LCY)")                {                    ApplicationArea = Suite;                    ToolTip = 'Specifies the cost, in LCY, of one unit of the item on the line.';                    Visible = false;                }                field("Unit Price (LCY)"; Rec."Unit Price (LCY)")                {                    ApplicationArea = Suite;                    ToolTip = 'Specifies the price for one unit of the item, in LCY.';                    Visible = false;                }                field("Line Amount"; Rec."Line Amount")                {                    ApplicationArea = Suite;                    BlankZero = true;                }                field("Line Discount %"; Rec."Line Discount %")                {                    ApplicationArea = Suite;                    BlankZero = true;                }                field("Line Discount Amount"; Rec."Line Discount Amount")                {                    ApplicationArea = Suite;                    Visible = false;                }                field("Allow Invoice Disc."; Rec."Allow Invoice Disc.")                {                    ApplicationArea = Suite;                    ToolTip = 'Specifies if invoice discounts can be calculated on the archived order.';                    Visible = false;                }                field("Inv. Discount Amount"; Rec."Inv. Discount Amount")                {                    ApplicationArea = Suite;                    ToolTip = 'Specifies the invoice discount amount for the line.';                    Visible = false;                }                field("Qty. to Receive"; Rec."Qty. to Receive")                {                    ApplicationArea = Suite;                    BlankZero = true;                }                field("Quantity Received"; Rec."Quantity Received")                {                    ApplicationArea = Suite;                    BlankZero = true;                }                field("Qty. to Invoice"; Rec."Qty. to Invoice")                {                    ApplicationArea = Suite;                    BlankZero = true;                }                field("Quantity Invoiced"; Rec."Quantity Invoiced")                {                    ApplicationArea = Suite;                    BlankZero = true;                }                field("Allow Item Charge Assignment"; Rec."Allow Item Charge Assignment")                {                    ApplicationArea = Suite;                    ToolTip = 'Specifies if item charges can be assigned to the archived order.';                    Visible = false;                }                field("Requested Receipt Date"; Rec."Requested Receipt Date")                {                    ApplicationArea = Suite;                    ToolTip = 'Specifies the date that you want the vendor to deliver your order. The field is used to calculate the latest date you can order, as follows: requested receipt date - lead time calculation = order date. If you do not need delivery on a specific date, you can leave the field blank.';                    Visible = false;                }                field("Promised Receipt Date"; Rec."Promised Receipt Date")                {                    ApplicationArea = Suite;                    Visible = false;                }                field("Planned Receipt Date"; Rec."Planned Receipt Date")                {                    ApplicationArea = Suite;                }                field("Expected Receipt Date"; Rec."Expected Receipt Date")                {                    ApplicationArea = Suite;                }                field("Order Date"; Rec."Order Date")                {                    ApplicationArea = Suite;                }                field("Lead Time Calculation"; Rec."Lead Time Calculation")                {                    ApplicationArea = Suite;                    Visible = false;                }                field("Job No."; Rec."Job No.")                {                    ApplicationArea = Jobs;                    ToolTip = 'Specifies the number of the related project.';                    Visible = false;                }                field("Planning Flexibility"; Rec."Planning Flexibility")                {                    ApplicationArea = Planning;                    Visible = false;                }                field("Inbound Whse. Handling Time"; Rec."Inbound Whse. Handling Time")                {                    ApplicationArea = Warehouse;                    Visible = false;                }                field("Blanket Order No."; Rec."Blanket Order No.")                {                    ApplicationArea = Suite;                    ToolTip = 'Specifies the number of the blanket order. ';                    Visible = false;                }                field("Blanket Order Line No."; Rec."Blanket Order Line No.")                {                    ApplicationArea = Suite;                    ToolTip = 'Specifies the number of the blanket order line. ';                    Visible = false;                }                field("Appl.-to Item Entry"; Rec."Appl.-to Item Entry")                {                    ApplicationArea = Suite;                    ToolTip = 'Specifies the number of the item ledger entry that the document or journal line is applied -to.';                    Visible = false;                }                field("Shortcut Dimension 1 Code"; Rec."Shortcut Dimension 1 Code")                {                    ApplicationArea = Dimensions;                    Visible = DimVisible1;                }                field("Shortcut Dimension 2 Code"; Rec."Shortcut Dimension 2 Code")                {                    ApplicationArea = Dimensions;                    Visible = DimVisible2;                }                field(ShortcutDimCode3; ShortcutDimCode[3])                {                    ApplicationArea = Dimensions;                    ToolTip = 'Specifies the dimension value code that is linked to the purchase line archive';                    CaptionClass = '1,2,3';                    TableRelation = "Dimension Value".Code where("Global Dimension No." = const(3),                                                                  "Dimension Value Type" = const(Standard),                                                                  Blocked = const(false));                    Visible = DimVisible3;                }                field(ShortcutDimCode4; ShortcutDimCode[4])                {                    ApplicationArea = Dimensions;                    ToolTip = 'Specifies the dimension value code that is linked to the purchase line archive';                    CaptionClass = '1,2,4';                    TableRelation = "Dimension Value".Code where("Global Dimension No." = const(4),                                                                  "Dimension Value Type" = const(Standard),                                                                  Blocked = const(false));                    Visible = DimVisible4;                }                field(ShortcutDimCode5; ShortcutDimCode[5])                {                    ApplicationArea = Dimensions;                    ToolTip = 'Specifies the dimension value code that is linked to the purchase line archive';                    CaptionClass = '1,2,5';                    TableRelation = "Dimension Value".Code where("Global Dimension No." = const(5),                                                                  "Dimension Value Type" = const(Standard),                                                                  Blocked = const(false));                    Visible = DimVisible5;                }                field(ShortcutDimCode6; ShortcutDimCode[6])                {                    ApplicationArea = Dimensions;                    ToolTip = 'Specifies the dimension value code that is linked to the purchase line archive';                    CaptionClass = '1,2,6';                    TableRelation = "Dimension Value".Code where("Global Dimension No." = const(6),                                                                  "Dimension Value Type" = const(Standard),                                                                  Blocked = const(false));                    Visible = DimVisible6;                }                field(ShortcutDimCode7; ShortcutDimCode[7])                {                    ApplicationArea = Dimensions;                    ToolTip = 'Specifies the dimension value code that is linked to the purchase line archive';                    CaptionClass = '1,2,7';                    TableRelation = "Dimension Value".Code where("Global Dimension No." = const(7),                                                                  "Dimension Value Type" = const(Standard),                                                                  Blocked = const(false));                    Visible = DimVisible7;                }                field(ShortcutDimCode8; ShortcutDimCode[8])                {                    ApplicationArea = Dimensions;                    ToolTip = 'Specifies the dimension value code that is linked to the purchase line archive';                    CaptionClass = '1,2,8';                    TableRelation = "Dimension Value".Code where("Global Dimension No." = const(8),                                                                  "Dimension Value Type" = const(Standard),                                                                  Blocked = const(false));                    Visible = DimVisible8;                }                field("Gross Weight"; Rec."Gross Weight")                {                    Caption = 'Unit Gross Weight';                    ApplicationArea = Basic, Suite;                    Visible = false;                }                field("Net Weight"; Rec."Net Weight")                {                    Caption = 'Unit Net Weight';                    ApplicationArea = Basic, Suite;                    Visible = false;                }                field("Unit Volume"; Rec."Unit Volume")                {                    ApplicationArea = Basic, Suite;                    Visible = false;                }                field("Units per Parcel"; Rec."Units per Parcel")                {                    ApplicationArea = Basic, Suite;                    Visible = false;                }            }        }    }    actions    {        area(processing)        {            group("&Line")            {                Caption = '&Line';                Image = Line;                action(Dimensions)                {                    ApplicationArea = Dimensions;                    Caption = 'Dimensions';                    Image = Dimensions;                    ShortCutKey = 'Alt+D';                    ToolTip = 'View or edit dimensions, such as area, project, or department, that you can assign to sales and purchase documents to distribute costs and analyze transaction history.';                    trigger OnAction()                    begin                        Rec.ShowDimensions();                    end;                }                action("Co&mments")                {                    ApplicationArea = Comments;                    Caption = 'Co&mments';                    Image = ViewComments;                    ToolTip = 'View or add comments for the record.';                    trigger OnAction()                    begin                        Rec.ShowLineComments();                    end;                }                action(DocumentLineTracking)                {                    ApplicationArea = Suite;                    Caption = 'Document &Line Tracking';                    ToolTip = 'View related open, posted, or archived documents or document lines.';                    trigger OnAction()                    begin                        ShowDocumentLineTracking();                    end;                }            }        }    }    trigger OnOpenPage()    begin        SetDimensionsVisibility();    end;    trigger OnAfterGetRecord()    var        DimMgt: Codeunit DimensionManagement;    begin        DimMgt.GetShortcutDimensions(Rec."Dimension Set ID", ShortcutDimCode);    end;    protected var        ShortcutDimCode: array[8] of Code[20];        DimVisible1: Boolean;        DimVisible2: Boolean;        DimVisible3: Boolean;        DimVisible4: Boolean;        DimVisible5: Boolean;        DimVisible6: Boolean;        DimVisible7: Boolean;        DimVisible8: Boolean;    procedure ShowDocumentLineTracking()    var        DocumentLineTrackingPage: Page "Document Line Tracking";    begin        Clear(DocumentLineTrackingPage);        DocumentLineTrackingPage.SetSourceDoc(            "Document Line Source Type"::"Blanket Purchase Order", Rec."Document No.", Rec."Line No.", Rec."Blanket Order No.", Rec."Blanket Order Line No.", '', 0);        DocumentLineTrackingPage.RunModal();    end;    local procedure SetDimensionsVisibility()    var        DimMgt: Codeunit DimensionManagement;    begin        DimVisible1 := false;        DimVisible2 := false;        DimVisible3 := false;        DimVisible4 := false;        DimVisible5 := false;        DimVisible6 := false;        DimVisible7 := false;        DimVisible8 := false;        DimMgt.UseShortcutDims(          DimVisible1, DimVisible2, DimVisible3, DimVisible4, DimVisible5, DimVisible6, DimVisible7, DimVisible8);        Clear(DimMgt);    end;}