Page 6644 Purchase Return Order Archive

Base Application, Microsoft.Purchases.Archive

src/Layers/W1/BaseApp/Purchases/Archive/PurchaseReturnOrderArchive.Page.al643 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.CRM.Contact;using Microsoft.EServices.EDocument;using Microsoft.Finance.Dimension;using Microsoft.Foundation.Address;using Microsoft.Foundation.Reporting;using Microsoft.Purchases.Vendor;using System.Security.User;page 6644 "Purchase Return Order Archive"{    Caption = 'Purchase Return Order Archive';    DeleteAllowed = false;    Editable = false;    PageType = Document;    SourceTable = "Purchase Header Archive";    SourceTableView = where("Document Type" = const("Return Order"));    layout    {        area(content)        {            group(General)            {                Caption = 'General';                field("No."; Rec."No.")                {                    ApplicationArea = All;                }                field("Buy-from Vendor No."; Rec."Buy-from Vendor No.")                {                    ApplicationArea = Suite;                    Caption = 'Vendor No.';                    ToolTip = 'Specifies the number of the vendor who returns the products.';                }                field("Buy-from Vendor Name"; Rec."Buy-from Vendor Name")                {                    ApplicationArea = Suite;                    Caption = 'Vendor';                    ToolTip = 'Specifies the name of the vendor to whom you will send the purchase return order.';                }                field("Buy-from Vendor Name 2"; Rec."Buy-from Vendor Name 2")                {                    ApplicationArea = Suite;                    Caption = 'Vendor Name 2';                    Importance = Additional;                    Visible = false;                }                group("Buy-from")                {                    Caption = 'Buy-from';                    field("Buy-from Address"; Rec."Buy-from Address")                    {                        ApplicationArea = Suite;                        Caption = 'Address';                        Importance = Additional;                        ToolTip = 'Specifies the vendor''s buy-from address.';                    }                    field("Buy-from Address 2"; Rec."Buy-from Address 2")                    {                        ApplicationArea = Suite;                        Caption = 'Address 2';                        Importance = Additional;                        ToolTip = 'Specifies an additional part of the vendor''s buy-from address.';                    }                    field("Buy-from City"; Rec."Buy-from City")                    {                        ApplicationArea = Suite;                        Caption = 'City';                        Importance = Additional;                        ToolTip = 'Specifies the city of the vendor on the purchase document.';                    }                    group(BuyFromCounty)                    {                        ShowCaption = false;                        Visible = IsBuyFromCountyVisible;                        field("Buy-from County"; Rec."Buy-from County")                        {                            ApplicationArea = Advanced;                            CaptionClass = '5,1,' + Rec."Buy-from Country/Region Code";                            Importance = Additional;                        }                    }                    field("Buy-from Post Code"; Rec."Buy-from Post Code")                    {                        ApplicationArea = Suite;                        Caption = 'Post Code';                        Importance = Additional;                        ToolTip = 'Specifies the postal code.';                    }                    field("Buy-from Country/Region Code"; Rec."Buy-from Country/Region Code")                    {                        ApplicationArea = Advanced;                        Caption = 'Country/Region Code';                        Importance = Additional;                    }                    field("Buy-from Contact No."; Rec."Buy-from Contact No.")                    {                        ApplicationArea = RelationshipMgmt;                        Caption = 'Contact No.';                        Importance = Additional;                        ToolTip = 'Specifies the number of the contact who sends the invoice.';                    }                    field(BuyFromContactPhoneNo; BuyFromContact."Phone No.")                    {                        ApplicationArea = Suite;                        Caption = 'Phone No.';                        Importance = Additional;                        Editable = false;                        ExtendedDatatype = PhoneNo;                        ToolTip = 'Specifies the telephone number of the vendor contact person.';                    }                    field(BuyFromContactMobilePhoneNo; BuyFromContact."Mobile Phone No.")                    {                        ApplicationArea = Suite;                        Caption = 'Mobile Phone No.';                        Importance = Additional;                        Editable = false;                        ExtendedDatatype = PhoneNo;                        ToolTip = 'Specifies the mobile telephone number of the vendor contact person.';                    }                    field(BuyFromContactEmail; BuyFromContact."E-Mail")                    {                        ApplicationArea = Suite;                        Caption = 'Email';                        Importance = Additional;                        Editable = false;                        ExtendedDatatype = EMail;                        ToolTip = 'Specifies the email address of the vendor contact person.';                    }                }                field("Buy-from Contact"; Rec."Buy-from Contact")                {                    ApplicationArea = Suite;                    Caption = 'Contact';                    ToolTip = 'Specifies the name of the person to contact about an order from this vendor.';                }                field("Document Date"; Rec."Document Date")                {                    ApplicationArea = Suite;                }                field("Posting Date"; Rec."Posting Date")                {                    ApplicationArea = Suite;                }                field("Order Date"; Rec."Order Date")                {                    ApplicationArea = Suite;                }                field("Vendor Authorization No."; Rec."Vendor Authorization No.")                {                    ApplicationArea = Suite;                    ToolTip = 'Specifies the identification number of a compensation agreement. This number is sometimes referred to as the RMA No.(Returns Materials Authorization).';                }                field("Vendor Cr. Memo No."; Rec."Vendor Cr. Memo No.")                {                    ApplicationArea = Suite;                }                field("Order Address Code"; Rec."Order Address Code")                {                    ApplicationArea = Suite;                }                field("Purchaser Code"; Rec."Purchaser Code")                {                    ApplicationArea = Suite;                }                field("Responsibility Center"; Rec."Responsibility Center")                {                    ApplicationArea = Suite;                }                field("Assigned User ID"; Rec."Assigned User ID")                {                    ApplicationArea = Suite;                }                field(Status; Rec.Status)                {                    ApplicationArea = Suite;                    ToolTip = 'Specifies whether the document is open, released, pending approval, or pending prepayment.';                }            }            part(PurchLinesArchive; "Purch Return Order Arc Subform")            {                ApplicationArea = Suite;                SubPageLink = "Document No." = field("No."),                              "Doc. No. Occurrence" = field("Doc. No. Occurrence"),                              "Version No." = field("Version No.");            }            group("Invoice Details")            {                Caption = 'Invoice Details';                field("Currency Code"; Rec."Currency Code")                {                    ApplicationArea = Suite;                }                field("Prices Including VAT"; Rec."Prices Including VAT")                {                    ApplicationArea = VAT;                    trigger OnValidate()                    begin                        PricesIncludingVATOnAfterValid();                    end;                }                field("VAT Bus. Posting Group"; Rec."VAT Bus. Posting Group")                {                    ApplicationArea = Basic, Suite;                }                field("Transaction Type"; Rec."Transaction Type")                {                    ApplicationArea = Suite;                }                field("Shortcut Dimension 1 Code"; Rec."Shortcut Dimension 1 Code")                {                    ApplicationArea = Dimensions;                }                field("Shortcut Dimension 2 Code"; Rec."Shortcut Dimension 2 Code")                {                    ApplicationArea = Dimensions;                }                field("Applies-to Doc. Type"; Rec."Applies-to Doc. Type")                {                    ApplicationArea = Suite;                }                field("Applies-to Doc. No."; Rec."Applies-to Doc. No.")                {                    ApplicationArea = Suite;                }                field("Applies-to ID"; Rec."Applies-to ID")                {                    ApplicationArea = Suite;                }                field("Location Code"; Rec."Location Code")                {                    ApplicationArea = Location;                    ToolTip = 'Specifies the location where the items are to be shipped. This field acts as the default location for new lines. Location code for individual lines can differ from it.';                }                field("Expected Receipt Date"; Rec."Expected Receipt Date")                {                    ApplicationArea = Suite;                    ToolTip = 'Specifies the date on which the received items were expected.';                }            }            group("Shipping and Payment")            {                Caption = 'Shipping and Payment';                group("Ship-to")                {                    Caption = 'Ship-to';                    field("Ship-to Name"; Rec."Ship-to Name")                    {                        ApplicationArea = Suite;                        Caption = 'Name';                        Importance = Additional;                        ToolTip = 'Specifies the name of the vendor sending the order.';                    }                    field("Ship-to Name 2"; Rec."Ship-to Name 2")                    {                        ApplicationArea = Suite;                        Caption = 'Name 2';                        Importance = Additional;                        ToolTip = 'Specifies an additional part of the name for the order address of the vendor.';                        Visible = false;                    }                    field("Ship-to Address"; Rec."Ship-to Address")                    {                        ApplicationArea = Suite;                        Caption = 'Address';                        Importance = Additional;                        ToolTip = 'Specifies the vendor''s buy-from address.';                    }                    field("Ship-to Address 2"; Rec."Ship-to Address 2")                    {                        ApplicationArea = Suite;                        Caption = 'Address 2';                        Importance = Additional;                        ToolTip = 'Specifies an additional part of the vendor''s buy-from address.';                    }                    field("Ship-to City"; Rec."Ship-to City")                    {                        ApplicationArea = Suite;                        Caption = 'City';                        Importance = Additional;                        ToolTip = 'Specifies the city of the vendor on the purchase document.';                    }                    group(ShipToCounty)                    {                        ShowCaption = false;                        Visible = IsShipToCountyVisible;                        field("Ship-to County"; Rec."Ship-to County")                        {                            ApplicationArea = Advanced;                            CaptionClass = '5,1,' + Rec."Ship-to Country/Region Code";                            Importance = Additional;                        }                    }                    field("Ship-to Post Code"; Rec."Ship-to Post Code")                    {                        ApplicationArea = Suite;                        Caption = 'Post Code';                        Importance = Additional;                        ToolTip = 'Specifies the postal code.';                    }                    field("Ship-to Country/Region Code"; Rec."Ship-to Country/Region Code")                    {                        ApplicationArea = Advanced;                        Caption = 'Country/Region Code';                        Importance = Additional;                    }                    field("Ship-to Phone No."; Rec."Ship-to Phone No.")                    {                        ApplicationArea = Suite;                        Caption = 'Phone No.';                        Importance = Additional;                    }                    field("Ship-to Contact"; Rec."Ship-to Contact")                    {                        ApplicationArea = Suite;                        Caption = 'Contact';                        Importance = Additional;                        ToolTip = 'Specifies the name of the person to contact about an order from this vendor.';                    }                }                group("Pay-to")                {                    Caption = 'Pay-to';                    field("Pay-to Name"; Rec."Pay-to Name")                    {                        ApplicationArea = Suite;                        Caption = 'Name';                        Importance = Promoted;                        ToolTip = 'Specifies the name of the vendor sending the order.';                    }                    field("Pay-to Name 2"; Rec."Pay-to Name 2")                    {                        ApplicationArea = Suite;                        Caption = 'Name 2';                        Importance = Additional;                        Visible = false;                    }                    field("Pay-to Address"; Rec."Pay-to Address")                    {                        ApplicationArea = Suite;                        Caption = 'Address';                        Importance = Additional;                        ToolTip = 'Specifies the vendor''s buy-from address.';                    }                    field("Pay-to Address 2"; Rec."Pay-to Address 2")                    {                        ApplicationArea = Suite;                        Caption = 'Address 2';                        Importance = Additional;                        ToolTip = 'Specifies an additional part of the vendor''s buy-from address.';                    }                    field("Pay-to City"; Rec."Pay-to City")                    {                        ApplicationArea = Suite;                        Caption = 'City';                        Importance = Additional;                        ToolTip = 'Specifies the city of the vendor on the purchase document.';                    }                    group(PayToCounty)                    {                        ShowCaption = false;                        Visible = IsPayToCountyVisible;                        field("Pay-to County"; Rec."Pay-to County")                        {                            ApplicationArea = Advanced;                            CaptionClass = '5,1,' + Rec."Pay-to Country/Region Code";                            Importance = Additional;                        }                    }                    field("Pay-to Post Code"; Rec."Pay-to Post Code")                    {                        ApplicationArea = Suite;                        Caption = 'Post Code';                        Importance = Additional;                        ToolTip = 'Specifies the postal code.';                    }                    field("Pay-to Country/Region Code"; Rec."Pay-to Country/Region Code")                    {                        ApplicationArea = Advanced;                        Caption = 'Country/Region Code';                        Importance = Additional;                    }                    field("Pay-to Contact No."; Rec."Pay-to Contact No.")                    {                        ApplicationArea = RelationshipMgmt;                        Caption = 'Contact No.';                        Importance = Additional;                        ToolTip = 'Specifies the number of the contact who sends the invoice.';                    }                    field("Pay-to Contact"; Rec."Pay-to Contact")                    {                        ApplicationArea = Suite;                        Caption = 'Contact';                        Importance = Additional;                        ToolTip = 'Specifies the name of the person to contact about an order from this vendor.';                    }                    field(PayToContactPhoneNo; PayToContact."Phone No.")                    {                        ApplicationArea = Suite;                        Caption = 'Phone No.';                        Editable = false;                        Importance = Additional;                        ExtendedDatatype = PhoneNo;                        ToolTip = 'Specifies the telephone number of the vendor contact person.';                    }                    field(PayToContactMobilePhoneNo; PayToContact."Mobile Phone No.")                    {                        ApplicationArea = Suite;                        Caption = 'Mobile Phone No.';                        Editable = false;                        Importance = Additional;                        ExtendedDatatype = PhoneNo;                        ToolTip = 'Specifies the mobile telephone number of the vendor contact person.';                    }                    field(PayToContactEmail; PayToContact."E-Mail")                    {                        ApplicationArea = Suite;                        Caption = 'Email';                        Editable = false;                        Importance = Additional;                        ExtendedDatatype = Email;                        ToolTip = 'Specifies the email address of the vendor contact person.';                    }                }            }            group("Foreign Trade")            {                Caption = 'Foreign Trade';                field("Transaction Specification"; Rec."Transaction Specification")                {                    ApplicationArea = BasicEU, BasicNO;                }                field("Transport Method"; Rec."Transport Method")                {                    ApplicationArea = BasicEU, BasicNO;                }                field("Entry Point"; Rec."Entry Point")                {                    ApplicationArea = BasicEU, BasicNO;                }                field("Area"; Rec.Area)                {                    ApplicationArea = BasicEU, BasicNO;                }            }            group(Version)            {                Caption = 'Version';                field("Version No."; Rec."Version No.")                {                    ApplicationArea = Suite;                }                field("Archived By"; Rec."Archived By")                {                    ApplicationArea = Suite;                    trigger OnDrillDown()                    var                        UserMgt: Codeunit "User Management";                    begin                        UserMgt.DisplayUserInformation(Rec."Archived By");                    end;                }                field("Date Archived"; Rec."Date Archived")                {                    ApplicationArea = Suite;                }                field("Time Archived"; Rec."Time Archived")                {                    ApplicationArea = Suite;                }                field("Interaction Exist"; Rec."Interaction Exist")                {                    ApplicationArea = RelationshipMgmt;                }            }        }        area(factboxes)        {            systempart(Control22; Links)            {                ApplicationArea = RecordLinks;                Visible = false;            }            systempart(Control21; Notes)            {                ApplicationArea = Notes;            }        }    }    actions    {        area(Processing)        {            group(Functions)            {                Caption = 'Functions';                Image = "Action";                group(IncomingDocument)                {                    Caption = 'Incoming Document';                    Image = Documents;                    action(IncomingDocCard)                    {                        ApplicationArea = Suite;                        Caption = 'View Incoming Document';                        Enabled = HasIncomingDocument;                        Image = ViewOrder;                        ToolTip = 'View any incoming document records and file attachments that exist for the entry or document, for example for auditing purposes';                        trigger OnAction()                        var                            IncomingDocument: Record "Incoming Document";                        begin                            IncomingDocument.ShowCardFromEntryNo(Rec."Incoming Document Entry No.");                        end;                    }                }            }        }        area(navigation)        {            group("Ver&sion")            {                Caption = 'Ver&sion';                Image = Versions;                action(Card)                {                    ApplicationArea = Suite;                    Caption = 'Card';                    Image = EditLines;                    RunObject = Page "Vendor Card";                    RunPageLink = "No." = field("Buy-from Vendor No.");                    ShortCutKey = 'Shift+F7';                    ToolTip = 'View or change detailed information about the record on the document or journal line.';                }                action(Dimensions)                {                    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("Co&mments")                {                    ApplicationArea = Comments;                    Caption = 'Co&mments';                    Image = ViewComments;                    RunObject = Page "Purch. Archive Comment Sheet";                    RunPageLink = "Document Type" = field("Document Type"),                                  "No." = field("No."),                                  "Document Line No." = const(0),                                  "Doc. No. Occurrence" = field("Doc. No. Occurrence"),                                  "Version No." = field("Version No.");                    ToolTip = 'View or add comments for the record.';                }                action(Print)                {                    ApplicationArea = Suite;                    Caption = 'Print';                    Image = Print;                    ToolTip = 'Print the information in the window. A print request window opens where you can specify what to include on the print-out.';                    trigger OnAction()                    begin                        DocPrint.PrintPurchHeaderArch(Rec);                    end;                }            }        }        area(Promoted)        {            group(Category_Order)            {                Caption = 'Order';                actionref(IncomingDocCard_Promoted; IncomingDocCard)                {                }            }        }    }    trigger OnAfterGetCurrRecord()    begin        SetControlAppearance();        ActivateFields();    end;    trigger OnAfterGetRecord()    begin        BuyFromContact.GetOrClear(Rec."Buy-from Contact No.");        PayToContact.GetOrClear(Rec."Pay-to Contact No.");    end;    trigger OnOpenPage()    begin        ActivateFields();    end;    var        BuyFromContact: Record Contact;        PayToContact: Record Contact;        DocPrint: Codeunit "Document-Print";        FormatAddress: Codeunit "Format Address";        HasIncomingDocument: Boolean;        IsBuyFromCountyVisible, IsPayToCountyVisible, IsShipToCountyVisible : Boolean;    local procedure PricesIncludingVATOnAfterValid()    begin        CurrPage.Update();    end;    local procedure SetControlAppearance()    begin        HasIncomingDocument := Rec."Incoming Document Entry No." <> 0;    end;    local procedure ActivateFields()    begin        IsBuyFromCountyVisible := FormatAddress.UseCounty(Rec."Buy-from Country/Region Code");        IsPayToCountyVisible := FormatAddress.UseCounty(Rec."Pay-to Country/Region Code");        IsShipToCountyVisible := FormatAddress.UseCounty(Rec."Ship-to Country/Region Code");    end;}