Page 5979 Posted Service Invoice Subform

Base Application, Microsoft.Service.History

src/Layers/W1/BaseApp/Service/History/PostedServiceInvoiceSubform.Page.al336 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.Service.History;using Microsoft.Finance.Dimension;using Microsoft.Foundation.Attachment;using Microsoft.Inventory.Item.Catalog;page 5979 "Posted Service Invoice Subform"{    AutoSplitKey = true;    Caption = 'Lines';    Editable = false;    LinksAllowed = false;    PageType = ListPart;    SourceTable = "Service Invoice Line";    SourceTableView = sorting("Document No.", "Service Item Line No.") order(ascending);    layout    {        area(content)        {            repeater(Control1)            {                ShowCaption = false;                field(Type; Rec.Type)                {                    ApplicationArea = Service;                }                field("No."; Rec."No.")                {                    ApplicationArea = Service;                }                field("Item Reference No."; Rec."Item Reference No.")                {                    AccessByPermission = tabledata "Item Reference" = R;                    ApplicationArea = Service, ItemReferences;                }                field("Variant Code"; Rec."Variant Code")                {                    ApplicationArea = Planning;                    Visible = false;                }                field("Gen. Bus. Posting Group"; Rec."Gen. Bus. Posting Group")                {                    ApplicationArea = Service;                    Visible = false;                }                field("Gen. Prod. Posting Group"; Rec."Gen. Prod. Posting Group")                {                    ApplicationArea = Service;                    Visible = false;                }                field("VAT Bus. Posting Group"; Rec."VAT Bus. Posting Group")                {                    ApplicationArea = Service;                    Visible = false;                }                field("VAT Prod. Posting Group"; Rec."VAT Prod. Posting Group")                {                    ApplicationArea = Service;                    Visible = false;                }                field(Description; Rec.Description)                {                    ApplicationArea = Service;                }                field("Description 2"; Rec."Description 2")                {                    ApplicationArea = Service;                    Importance = Additional;                    Visible = false;                }                field("Return Reason Code"; Rec."Return Reason Code")                {                    ApplicationArea = Service;                    Visible = false;                }                field(Quantity; Rec.Quantity)                {                    ApplicationArea = Service;                    BlankZero = true;                }                field("Unit of Measure Code"; Rec."Unit of Measure Code")                {                    ApplicationArea = Service;                }                field("Unit of Measure"; Rec."Unit of Measure")                {                    ApplicationArea = Service;                    Visible = false;                }                field("Unit Cost (LCY)"; Rec."Unit Cost (LCY)")                {                    ApplicationArea = Service;                    ToolTip = 'Specifies the cost, in LCY, of one unit of the item or resource on the line.';                    Visible = false;                }                field("Unit Price"; Rec."Unit Price")                {                    ApplicationArea = Service;                    BlankZero = true;                }                field("Tax Liable"; Rec."Tax Liable")                {                    ApplicationArea = SalesTax;                    Visible = false;                }                field("Tax Area Code"; Rec."Tax Area Code")                {                    ApplicationArea = SalesTax;                    Visible = false;                }                field("Tax Group Code"; Rec."Tax Group Code")                {                    ApplicationArea = SalesTax;                }                field("Line Discount %"; Rec."Line Discount %")                {                    ApplicationArea = Service;                    BlankZero = true;                }                field("Line Amount"; Rec."Line Amount")                {                    ApplicationArea = Service;                    BlankZero = true;                }                field("Line Discount Amount"; Rec."Line Discount Amount")                {                    ApplicationArea = Service;                    Visible = false;                }                field("Appl.-to Item Entry"; Rec."Appl.-to Item Entry")                {                    ApplicationArea = Service;                    Visible = false;                }                field("Service Item No."; Rec."Service Item No.")                {                    ApplicationArea = Service;                }                field("Service Item Serial No."; Rec."Service Item Serial No.")                {                    ApplicationArea = Service;                    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("ShortcutDimCode[3]"; ShortcutDimCode[3])                {                    ApplicationArea = Dimensions;                    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("ShortcutDimCode[4]"; ShortcutDimCode[4])                {                    ApplicationArea = Dimensions;                    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("ShortcutDimCode[5]"; ShortcutDimCode[5])                {                    ApplicationArea = Dimensions;                    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("ShortcutDimCode[6]"; ShortcutDimCode[6])                {                    ApplicationArea = Dimensions;                    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("ShortcutDimCode[7]"; ShortcutDimCode[7])                {                    ApplicationArea = Dimensions;                    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("ShortcutDimCode[8]"; ShortcutDimCode[8])                {                    ApplicationArea = Dimensions;                    CaptionClass = '1,2,8';                    TableRelation = "Dimension Value".Code where("Global Dimension No." = const(8),                                                                  "Dimension Value Type" = const(Standard),                                                                  Blocked = const(false));                    Visible = DimVisible8;                }            }        }    }    actions    {        area(processing)        {            group("&Line")            {                Caption = '&Line';                Image = Line;                action(Dimenions)                {                    AccessByPermission = TableData Dimension = R;                    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(ItemTrackingEntries)                {                    ApplicationArea = ItemTracking;                    Caption = 'Item &Tracking Entries';                    Image = ItemTrackingLedger;                    ToolTip = 'View serial, lot or package numbers that are assigned to items.';                    trigger OnAction()                    begin                        Rec.ShowItemTrackingLines();                    end;                }                action(ItemShipmentLines)                {                    ApplicationArea = Service;                    Caption = 'Item Shipment &Lines';                    Image = ShipmentLines;                    ToolTip = 'View posted sales shipments for the item.';                    trigger OnAction()                    begin                        PageShowItemShipmentLines();                    end;                }                action(DocAttach)                {                    ApplicationArea = Service;                    Caption = 'Attachments';                    Image = Attach;                    ToolTip = 'Add a file as an attachment. You can attach images as well as documents.';                    trigger OnAction()                    var                        DocumentAttachmentDetails: Page "Document Attachment Details";                        RecRef: RecordRef;                    begin                        RecRef.GetTable(Rec);                        DocumentAttachmentDetails.OpenForRecRef(RecRef);                        DocumentAttachmentDetails.RunModal();                    end;                }            }        }    }    trigger OnAfterGetRecord()    begin        Rec.ShowShortcutDimCode(ShortcutDimCode);    end;    trigger OnNewRecord(BelowxRec: Boolean)    begin        Clear(ShortcutDimCode);    end;    trigger OnOpenPage()    begin        SetDimensionsVisibility();    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;    local procedure PageShowItemShipmentLines()    begin        Rec.TestField(Type, Rec.Type::Item);        Rec.ShowItemShipmentLines();    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;}