page 54 "Purchase Order Subform" - OnBeforeOnOpenPage - Event Request

page 54 "Purchase Order Subform"
{
AutoSplitKey = true;
Caption = 'Lines';
DelayedInsert = true;
LinksAllowed = false;
MultipleNewLines = true;
PageType = ListPart;
SourceTable = "Purchase Line";
SourceTableView = WHERE("Document Type" = FILTER(Order));
layout
{
    area(content)
    {
        repeater(Control1)
        {
            ShowCaption = false;
            field(Type; Type)
            {
                ApplicationArea = Advanced;
                ToolTip = 'Specifies the line type.';

                trigger OnValidate()
                begin
                    NoOnAfterValidate();

                    UpdateEditableOnRow();
                    UpdateTypeText();
                    DeltaUpdateTotals();
                end;
            }
            field(FilteredTypeField; TypeAsText)
            {
                ApplicationArea = Basic, Suite;
                Caption = 'Type';
                Editable = CurrPageIsEditable;
                LookupPageID = "Option Lookup List";
                TableRelation = "Option Lookup Buffer"."Option Caption" WHERE("Lookup Type" = CONST(Purchases));
                ToolTip = 'Specifies the type of transaction that will be posted with the document line. If you select Comment, then you can enter any text in the Description field, such as a message to a customer. ';
                Visible = IsFoundation;

                trigger OnValidate()
                begin
                    TempOptionLookupBuffer.SetCurrentType(Type.AsInteger());
                    if TempOptionLookupBuffer.AutoCompleteLookup(TypeAsText, TempOptionLookupBuffer."Lookup Type"::Purchases) then
                        Validate(Type, TempOptionLookupBuffer.ID);
                    TempOptionLookupBuffer.ValidateOption(TypeAsText);
                    UpdateEditableOnRow();
                    UpdateTypeText();
                    DeltaUpdateTotals();
                end;
            }
            field("No."; "No.")
            {
                ApplicationArea = Suite;
                ShowMandatory = NOT IsCommentLine;
                ToolTip = 'Specifies the number of a general ledger account, item, additional cost, or fixed asset, depending on what you selected in the Type field.';

                trigger OnValidate()
                begin
                    ShowShortcutDimCode(ShortcutDimCode);
                    NoOnAfterValidate();

                    UpdateTypeText();
                    DeltaUpdateTotals();

                    CurrPage.Update();
                end;
            }

#if not CLEAN17
field("Cross-Reference No."; "Cross-Reference No.")
{
ApplicationArea = Suite;
ToolTip = 'Specifies the cross-referenced item number. If you enter a cross reference between yours and your vendor''s or customer''s item number, then this number will override the standard item number when you enter the cross-reference number on a sales or purchase document.';
Visible = false;
ObsoleteReason = 'Cross-Reference replaced by Item Reference feature.';
ObsoleteState = Pending;
ObsoleteTag = '17.0';
                trigger OnLookup(var Text: Text): Boolean
                begin
                    CrossReferenceNoLookUp;
                    InsertExtendedText(false);
                    NoOnAfterValidate();
                    OnCrossReferenceNoOnLookup(Rec);
                end;

                trigger OnValidate()
                begin
                    InsertExtendedText(false);
                    NoOnAfterValidate();
                    DeltaUpdateTotals();
                end;
            }

#endif
field("Item Reference No."; "Item Reference No.")
{
ApplicationArea = Suite;
ToolTip = 'Specifies the referenced item number.';
Visible = ItemReferenceVisible;
                trigger OnLookup(var Text: Text): Boolean
                var
                    ItemReferenceMgt: Codeunit "Item Reference Management";
                begin
                    PurchaseHeader.Get("Document Type", "Document No.");
                    ItemReferenceMgt.PurchaseReferenceNoLookUp(Rec, PurchaseHeader);
                    InsertExtendedText(false);
                    NoOnAfterValidate();
                    OnItemReferenceNoOnLookup(Rec);
                end;

                trigger OnValidate()
                begin
                    InsertExtendedText(false);
                    NoOnAfterValidate();
                    DeltaUpdateTotals();
                end;
            }
            field("IC Partner Code"; "IC Partner Code")
            {
                ApplicationArea = Intercompany;
                ToolTip = 'Specifies the code of the intercompany partner that the transaction is related to if the entry was created from an intercompany transaction.';
                Visible = false;
            }
            field("IC Partner Ref. Type"; "IC Partner Ref. Type")
            {
                ApplicationArea = Intercompany;
                ToolTip = 'Specifies the item or account in your IC partner''s company that corresponds to the item or account on the line.';
                Visible = false;
            }
            field("IC Partner Reference"; "IC Partner Reference")
            {
                ApplicationArea = Intercompany;
                ToolTip = 'Specifies the IC partner. If the line is being sent to one of your intercompany partners, this field is used together with the IC Partner Ref. Type field to indicate the item or account in your partner''s company that corresponds to the line.';
                Visible = false;
            }
            field("Variant Code"; "Variant Code")
            {
                ApplicationArea = Planning;
                ToolTip = 'Specifies the variant of the item on the line.';
                Visible = false;

                trigger OnValidate()
                begin
                    DeltaUpdateTotals();
                end;
            }
            field(Nonstock; Nonstock)
            {
                ApplicationArea = Suite;
                ToolTip = 'Specifies that this item is a catalog item.';
                Visible = false;
            }
            field("GST/HST"; "GST/HST")
            {
                ApplicationArea = BasicCA;
                ToolTip = 'Specifies the type of goods and services tax (GST) for the purchase line. You can select Acquisition, Self-Assessment, Rebate, New Housing Rebates, or Pension Rebate for the GST tax.';
            }
            field("VAT Prod. Posting Group"; "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;

                trigger OnValidate()
                begin
                    DeltaUpdateTotals();
                end;
            }
            field(Description; Description)
            {
                ApplicationArea = Suite;
                ToolTip = 'Specifies a description of the entry of the product to be purchased. To add a non-transactional text line, fill in the Description field only.';

                trigger OnValidate()
                begin
                    DeltaUpdateTotals();
                    NoOnAfterValidate();
                end;
            }
            field("Drop Shipment"; "Drop Shipment")
            {
                ApplicationArea = Suite;
                ToolTip = 'Specifies if your vendor ships the items directly to your customer.';
                Visible = false;
            }
            field("Return Reason Code"; "Return Reason Code")
            {
                ApplicationArea = Suite;
                ToolTip = 'Specifies the code explaining why the item was returned.';
                Visible = false;
            }
            field("Location Code"; "Location Code")
            {
                ApplicationArea = Location;
                Editable = NOT IsBlankNumber;
                Enabled = NOT IsBlankNumber;
                ToolTip = 'Specifies a code for the location where you want the items to be placed when they are received.';

                trigger OnValidate()
                begin
                    DeltaUpdateTotals();
                end;
            }
            field("Bin Code"; "Bin Code")
            {
                ApplicationArea = Warehouse;
                ToolTip = 'Specifies the bin where the items are picked or put away.';
                Visible = true;
            }
            field(Quantity; Quantity)
            {
                ApplicationArea = Suite;
                BlankZero = true;
                Editable = NOT IsBlankNumber;
                Enabled = NOT IsBlankNumber;
                ShowMandatory = (NOT IsCommentLine) AND ("No." <> '');
                ToolTip = 'Specifies the number of units of the item specified on the line.';

                trigger OnValidate()
                begin
                    DeltaUpdateTotals();
                end;
            }
            field("Reserved Quantity"; "Reserved Quantity")
            {
                ApplicationArea = Reservation;
                BlankZero = true;
                ToolTip = 'Specifies how many item units on this line have been reserved.';
            }
            field("Job Remaining Qty."; "Job Remaining Qty.")
            {
                ApplicationArea = Jobs;
                BlankZero = true;
                ToolTip = 'Specifies the quantity that remains to complete a job.';
                Visible = false;
            }
            field("Unit of Measure Code"; "Unit of Measure Code")
            {
                ApplicationArea = Suite;
                ToolTip = 'Specifies how each unit of the item or resource is measured, such as in pieces or hours. By default, the value in the Base Unit of Measure field on the item or resource card is inserted.';

                trigger OnValidate()
                begin
                    DeltaUpdateTotals();
                end;
            }
            field("Unit of Measure"; "Unit of Measure")
            {
                ApplicationArea = Suite;
                ToolTip = 'Specifies the unit of measure.';
                Visible = false;
            }
            field("Direct Unit Cost"; "Direct Unit Cost")
            {
                ApplicationArea = Suite;
                BlankZero = true;
                Editable = NOT IsBlankNumber;
                Enabled = NOT IsBlankNumber;
                ShowMandatory = (NOT IsCommentLine) AND ("No." <> '');
                ToolTip = 'Specifies the cost of one unit of the selected item or resource.';

                trigger OnValidate()
                begin
                    DeltaUpdateTotals();
                end;
            }
            field("Indirect Cost %"; "Indirect Cost %")
            {
                ApplicationArea = Suite;
                ToolTip = 'Specifies the percentage of the item''s last purchase cost that includes indirect costs, such as freight that is associated with the purchase of the item.';
                Visible = false;
            }
            field("Unit Cost (LCY)"; "Unit Cost (LCY)")
            {
                ApplicationArea = Suite;
                ToolTip = 'Specifies the unit cost of the item on the line.';
                Visible = false;
            }
            field("Unit Price (LCY)"; "Unit Price (LCY)")
            {
                ApplicationArea = Suite;
                BlankZero = true;
                ToolTip = 'Specifies the price, in LCY, for one unit of the item.';
                Visible = false;
            }
            field("Tax Liable"; "Tax Liable")
            {
                ApplicationArea = SalesTax;
                Editable = false;
                ToolTip = 'Specifies if this vendor charges you sales tax for purchases.';
                Visible = false;
            }
            field("Tax Area Code"; "Tax Area Code")
            {
                ApplicationArea = SalesTax;
                ToolTip = 'Specifies the tax area that is used to calculate and post sales tax.';

                trigger OnValidate()
                begin
                    DeltaUpdateTotals();
                end;
            }
            field("Provincial Tax Area Code"; "Provincial Tax Area Code")
            {
                ApplicationArea = BasicCA;
                ToolTip = 'Specifies the tax area code for self assessed Provincial Sales Tax for the company.';
                Visible = false;
            }
            field("Tax Group Code"; "Tax Group Code")
            {
                ApplicationArea = SalesTax;
                ShowMandatory = true;
                ToolTip = 'Specifies the tax group that is used to calculate and post sales tax.';

                trigger OnValidate()
                begin
                    DeltaUpdateTotals();
                end;
            }
            field("Use Tax"; "Use Tax")
            {
                ApplicationArea = SalesTax;
                ToolTip = 'Specifies a U.S. sales tax that is paid on items purchased by a company that are used by the company, instead of being sold to a customer.';
                Visible = false;
            }
            field("Line Discount %"; "Line Discount %")
            {
                ApplicationArea = Suite;
                BlankZero = true;
                Editable = NOT IsBlankNumber;
                Enabled = NOT IsBlankNumber;
                ToolTip = 'Specifies the discount percentage that is granted for the item on the line.';
                Visible = false;

                trigger OnValidate()
                begin
                    DeltaUpdateTotals();
                end;
            }
            field("Line Amount"; "Line Amount")
            {
                ApplicationArea = Suite;
                BlankZero = true;
                Editable = NOT IsBlankNumber;
                Enabled = NOT IsBlankNumber;
                ToolTip = 'Specifies the net amount, excluding any invoice discount amount, that must be paid for products on the line.';

                trigger OnValidate()
                begin
                    DeltaUpdateTotals();
                end;
            }
            field("Line Discount Amount"; "Line Discount Amount")
            {
                ApplicationArea = Suite;
                ToolTip = 'Specifies the discount amount that is granted for the item on the line.';
                Visible = false;

                trigger OnValidate()
                begin
                    DeltaUpdateTotals();
                end;
            }
            field("Prepayment %"; "Prepayment %")
            {
                ApplicationArea = Prepayments;
                ToolTip = 'Specifies the prepayment percentage to use to calculate the prepayment for purchases.';
                Visible = false;
            }
            field("Prepmt. Line Amount"; "Prepmt. Line Amount")
            {
                ApplicationArea = Prepayments;
                ToolTip = 'Specifies the prepayment amount of the line in the currency of the purchase document if a prepayment percentage is specified for the purchase line.';
                Visible = false;
            }
            field("Prepmt. Amt. Inv."; "Prepmt. Amt. Inv.")
            {
                ApplicationArea = Prepayments;
                ToolTip = 'Specifies the prepayment amount that has already been invoiced to the customer for this purchase line.';
                Visible = false;
            }
            field("Allow Invoice Disc."; "Allow Invoice Disc.")
            {
                ApplicationArea = Suite;
                ToolTip = 'Specifies if the invoice line is included when the invoice discount is calculated.';
                Visible = false;

                trigger OnValidate()
                begin
                    DeltaUpdateTotals();
                end;
            }
            field("Inv. Discount Amount"; "Inv. Discount Amount")
            {
                ApplicationArea = Suite;
                ToolTip = 'Specifies the total calculated invoice discount amount for the line.';
                Visible = false;

                trigger OnValidate()
                begin
                    DeltaUpdateTotals();
                end;
            }
            field("Inv. Disc. Amount to Invoice"; "Inv. Disc. Amount to Invoice")
            {
                ApplicationArea = Suite;
                ToolTip = 'Specifies the actual invoice discount amount that will be posted for the line on the invoice.';
                Visible = false;
            }
            field("Qty. to Receive"; "Qty. to Receive")
            {
                ApplicationArea = Suite;
                BlankZero = true;
                ToolTip = 'Specifies the quantity of items that remains to be received.';
            }
            field("Quantity Received"; "Quantity Received")
            {
                ApplicationArea = Suite;
                BlankZero = true;
                ToolTip = 'Specifies how many units of the item on the line have been posted as received.';
            }
            field("Qty. to Invoice"; "Qty. to Invoice")
            {
                ApplicationArea = Suite;
                BlankZero = true;
                ToolTip = 'Specifies the quantity that remains to be invoiced. It is calculated as Quantity - Qty. Invoiced.';
            }
            field("Quantity Invoiced"; "Quantity Invoiced")
            {
                ApplicationArea = Suite;
                BlankZero = true;
                ToolTip = 'Specifies how many units of the item on the line have been posted as invoiced.';
            }
            field("Prepmt Amt to Deduct"; "Prepmt Amt to Deduct")
            {
                ApplicationArea = Prepayments;
                ToolTip = 'Specifies the prepayment amount that has already been deducted from ordinary invoices posted for this purchase order line.';
                Visible = false;
            }
            field("Prepmt Amt Deducted"; "Prepmt Amt Deducted")
            {
                ApplicationArea = Prepayments;
                ToolTip = 'Specifies the prepayment amount that has already been deducted from ordinary invoices posted for this purchase order line.';
                Visible = false;
            }
            field("Allow Item Charge Assignment"; "Allow Item Charge Assignment")
            {
                ApplicationArea = ItemCharges;
                ToolTip = 'Specifies that you can assign item charges to this line.';
                Visible = false;
            }
            field("Qty. to Assign"; "Qty. to Assign")
            {
                ApplicationArea = ItemCharges;
                StyleExpr = ItemChargeStyleExpression;
                ToolTip = 'Specifies how many units of the item charge will be assigned to the line.';

                trigger OnDrillDown()
                begin
                    CurrPage.SaveRecord;
                    ShowItemChargeAssgnt();
                    UpdateForm(false);
                end;
            }
            field("Qty. Assigned"; "Qty. Assigned")
            {
                ApplicationArea = ItemCharges;
                BlankZero = true;
                ToolTip = 'Specifies how much of the item charge that has been assigned.';

                trigger OnDrillDown()
                begin
                    CurrPage.SaveRecord;
                    ShowItemChargeAssgnt();
                    UpdateForm(false);
                end;
            }
            field("Job No."; "Job No.")
            {
                ApplicationArea = Jobs;
                ToolTip = 'Specifies the number of the related job. If you fill in this field and the Job Task No. field, then a job ledger entry will be posted together with the purchase line.';
                Visible = false;

                trigger OnValidate()
                begin
                    ShowShortcutDimCode(ShortcutDimCode);
                end;
            }
            field("Job Task No."; "Job Task No.")
            {
                ApplicationArea = Jobs;
                ToolTip = 'Specifies the number of the related job task.';
                Visible = false;

                trigger OnValidate()
                begin
                    ShowShortcutDimCode(ShortcutDimCode);
                end;
            }
            field("Job Planning Line No."; "Job Planning Line No.")
            {
                ApplicationArea = Jobs;
                ToolTip = 'Specifies the job planning line number that the usage should be linked to when the job journal is posted. You can only link to job planning lines that have the Apply Usage Link option enabled.';
                Visible = false;
            }
            field("Job Line Type"; "Job Line Type")
            {
                ApplicationArea = Jobs;
                ToolTip = 'Specifies the type of planning line that was created when the job ledger entry is posted from the purchase line. If the field is empty, no planning lines were created for this entry.';
                Visible = false;
            }
            field("Job Unit Price"; "Job Unit Price")
            {
                ApplicationArea = Jobs;
                ToolTip = 'Specifies the sales price per unit that applies to the item or general ledger expense that will be posted.';
                Visible = false;
            }
            field("Job Line Amount"; "Job Line Amount")
            {
                ApplicationArea = Jobs;
                ToolTip = 'Specifies the line amount of the job ledger entry that is related to the purchase line.';
                Visible = false;
            }
            field("Job Line Discount Amount"; "Job Line Discount Amount")
            {
                ApplicationArea = Jobs;
                ToolTip = 'Specifies the line discount amount of the job ledger entry that is related to the purchase line.';
                Visible = false;
            }
            field("Job Line Discount %"; "Job Line Discount %")
            {
                ApplicationArea = Jobs;
                ToolTip = 'Specifies the line discount percentage of the job ledger entry that is related to the purchase line.';
                Visible = false;
            }
            field("Job Total Price"; "Job Total Price")
            {
                ApplicationArea = Jobs;
                ToolTip = 'Specifies the gross amount of the line that the purchase line applies to.';
                Visible = false;
            }
            field("Job Unit Price (LCY)"; "Job Unit Price (LCY)")
            {
                ApplicationArea = Jobs;
                ToolTip = 'Specifies the sales price per unit that applies to the item or general ledger expense that will be posted.';
                Visible = false;
            }
            field("Job Total Price (LCY)"; "Job Total Price (LCY)")
            {
                ApplicationArea = Jobs;
                ToolTip = 'Specifies the gross amount of the line, in the local currency.';
                Visible = false;
            }
            field("Job Line Amount (LCY)"; "Job Line Amount (LCY)")
            {
                ApplicationArea = Jobs;
                ToolTip = 'Specifies the line amount of the job ledger entry that is related to the purchase line.';
                Visible = false;
            }
            field("Job Line Disc. Amount (LCY)"; "Job Line Disc. Amount (LCY)")
            {
                ApplicationArea = Jobs;
                ToolTip = 'Specifies the line discount amount of the job ledger entry that is related to the purchase line.';
                Visible = false;
            }
            field("Requested Receipt Date"; "Requested Receipt Date")
            {
                ApplicationArea = Suite;
                ToolTip = 'Specifies the date that you want the vendor to deliver to the ship-to address. The value in the field is used to calculate the latest date you can order the items to have them delivered on the requested receipt date. If you do not need delivery on a specific date, you can leave the field blank.';
                Visible = false;
            }
            field("Promised Receipt Date"; "Promised Receipt Date")
            {
                ApplicationArea = OrderPromising;
                ToolTip = 'Specifies the date that the vendor has promised to deliver the order.';
                Visible = true;
            }
            field("Planned Receipt Date"; "Planned Receipt Date")
            {
                ApplicationArea = Suite;
                ToolTip = 'Specifies the date when the item is planned to arrive in inventory. Forward calculation: planned receipt date = order date + vendor lead time (per the vendor calendar and rounded to the next working day in first the vendor calendar and then the location calendar). If no vendor calendar exists, then: planned receipt date = order date + vendor lead time (per the location calendar). Backward calculation: order date = planned receipt date - vendor lead time (per the vendor calendar and rounded to the previous working day in first the vendor calendar and then the location calendar). If no vendor calendar exists, then: order date = planned receipt date - vendor lead time (per the location calendar).';
            }
            field("Expected Receipt Date"; "Expected Receipt Date")
            {
                ApplicationArea = Suite;
                ToolTip = 'Specifies the date you expect the items to be available in your warehouse. If you leave the field blank, it will be calculated as follows: Planned Receipt Date + Safety Lead Time + Inbound Warehouse Handling Time = Expected Receipt Date.';
            }
            field("Order Date"; "Order Date")
            {
                ApplicationArea = Suite;
                ToolTip = 'Specifies the date when the order was created.';
                Visible = false;
            }
            field("Lead Time Calculation"; "Lead Time Calculation")
            {
                ApplicationArea = Suite;
                ToolTip = 'Specifies a date formula for the amount of time it takes to replenish the item.';
                Visible = false;
            }
            field("Planning Flexibility"; "Planning Flexibility")
            {
                ApplicationArea = Manufacturing;
                ToolTip = 'Specifies whether the supply represented by this line is considered by the planning system when calculating action messages.';
                Visible = false;
            }
            field("Prod. Order No."; "Prod. Order No.")
            {
                ApplicationArea = Manufacturing;
                ToolTip = 'Specifies the number of the related production order.';
                Visible = false;
            }
            field("Prod. Order Line No."; "Prod. Order Line No.")
            {
                ApplicationArea = Manufacturing;
                ToolTip = 'Specifies the number of the related production order line.';
                Visible = false;
            }
            field("Operation No."; "Operation No.")
            {
                ApplicationArea = Manufacturing;
                ToolTip = 'Specifies the number of the related production operation.';
                Visible = false;
            }
            field("Work Center No."; "Work Center No.")
            {
                ApplicationArea = Manufacturing;
                ToolTip = 'Specifies the work center number of the journal line.';
                Visible = false;
            }
            field(Finished; Finished)
            {
                ApplicationArea = Manufacturing;
                ToolTip = 'Specifies that any related service or operation is finished.';
                Visible = false;
            }
            field("Whse. Outstanding Qty. (Base)"; "Whse. Outstanding Qty. (Base)")
            {
                ApplicationArea = Warehouse;
                ToolTip = 'Specifies how many units on the purchase order line remain to be handled in warehouse documents.';
                Visible = false;
            }
            field("Inbound Whse. Handling Time"; "Inbound Whse. Handling Time")
            {
                ApplicationArea = Warehouse;
                ToolTip = 'Specifies the time it takes to make items part of available inventory, after the items have been posted as received.';
                Visible = false;
            }
            field("Blanket Order No."; "Blanket Order No.")
            {
                ApplicationArea = Suite;
                ToolTip = 'Specifies the number of the blanket order that the record originates from.';
                Visible = false;
            }
            field("Blanket Order Line No."; "Blanket Order Line No.")
            {
                ApplicationArea = Suite;
                ToolTip = 'Specifies the number of the blanket order line that the record originates from.';
                Visible = false;
            }
            field("Appl.-to Item Entry"; "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("Deferral Code"; "Deferral Code")
            {
                ApplicationArea = Suite;
                Enabled = (Type <> Type::"Fixed Asset") AND (Type <> Type::" ");
                TableRelation = "Deferral Template"."Deferral Code";
                ToolTip = 'Specifies the deferral template that governs how expenses paid with this purchase document are deferred to the different accounting periods when the expenses were incurred.';
                Visible = false;

                trigger OnAssistEdit()
                begin
                    CurrPage.SaveRecord;
                    Commit;
                    ShowDeferralSchedule();
                end;
            }
            field("Shortcut Dimension 1 Code"; "Shortcut Dimension 1 Code")
            {
                ApplicationArea = Dimensions;
                ToolTip = 'Specifies the code for Shortcut Dimension 1, which is one of two global dimension codes that you set up in the General Ledger Setup window.';
                Visible = DimVisible1;
            }
            field("Shortcut Dimension 2 Code"; "Shortcut Dimension 2 Code")
            {
                ApplicationArea = Dimensions;
                ToolTip = 'Specifies the code for Shortcut Dimension 2, which is one of two global dimension codes that you set up in the General Ledger Setup window.';
                Visible = DimVisible2;
            }
            field(ShortcutDimCode3; 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;

                trigger OnValidate()
                begin
                    ValidateShortcutDimCode(3, ShortcutDimCode[3]);

                    OnAfterValidateShortcutDimCode(Rec, ShortcutDimCode, 3);
                end;
            }
            field(ShortcutDimCode4; 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;

                trigger OnValidate()
                begin
                    ValidateShortcutDimCode(4, ShortcutDimCode[4]);

                    OnAfterValidateShortcutDimCode(Rec, ShortcutDimCode, 4);
                end;
            }
            field(ShortcutDimCode5; 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;

                trigger OnValidate()
                begin
                    ValidateShortcutDimCode(5, ShortcutDimCode[5]);

                    OnAfterValidateShortcutDimCode(Rec, ShortcutDimCode, 5);
                end;
            }
            field(ShortcutDimCode6; 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;

                trigger OnValidate()
                begin
                    ValidateShortcutDimCode(6, ShortcutDimCode[6]);

                    OnAfterValidateShortcutDimCode(Rec, ShortcutDimCode, 6);
                end;
            }
            field(ShortcutDimCode7; 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;

                trigger OnValidate()
                begin
                    ValidateShortcutDimCode(7, ShortcutDimCode[7]);

                    OnAfterValidateShortcutDimCode(Rec, ShortcutDimCode, 7);
                end;
            }
            field(ShortcutDimCode8; 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;

                trigger OnValidate()
                begin
                    ValidateShortcutDimCode(8, ShortcutDimCode[8]);

                    OnAfterValidateShortcutDimCode(Rec, ShortcutDimCode, 8);
                end;
            }
            field("IRS 1099 Liable"; "IRS 1099 Liable")
            {
                ApplicationArea = BasicUS;
                ToolTip = 'Specifies if the amount is to be a 1099 amount.';
                Visible = false;
            }
            field("Document No."; "Document No.")
            {
                ApplicationArea = Suite;
                Editable = false;
                ToolTip = 'Specifies the document number.';
                Visible = false;
            }
            field("Line No."; "Line No.")
            {
                ApplicationArea = Suite;
                Editable = false;
                ToolTip = 'Specifies the number of this line.';
                Visible = false;
            }
            field("Over-Receipt Quantity"; "Over-Receipt Quantity")
            {
                ApplicationArea = All;
                Visible = OverReceiptAllowed;
                ToolTip = 'Specifies over-receipt quantity.';

                trigger OnValidate()
                begin
                    CurrPage.Update(true);
                end;
            }
            field("Over-Receipt Code"; "Over-Receipt Code")
            {
                ApplicationArea = All;
                Visible = OverReceiptAllowed;
                ToolTip = 'Specifies over-receipt code.';
            }
        }
        group(Control43)
        {
            ShowCaption = false;
            group(Control37)
            {
                ShowCaption = false;
                field(AmountBeforeDiscount; TotalPurchaseLine."Line Amount")
                {
                    ApplicationArea = Suite;
                    AutoFormatExpression = Currency.Code;
                    AutoFormatType = 1;
                    CaptionClass = DocumentTotals.GetTotalLineAmountWithVATAndCurrencyCaption(Currency.Code, TotalPurchaseHeader."Prices Including VAT");
                    Caption = 'Subtotal Excl. VAT';
                    Editable = false;
                    ToolTip = 'Specifies the sum of the value in the Line Amount Excl. VAT field on all lines in the document.';

                    trigger OnValidate()
                    begin
                        DocumentTotals.PurchaseDocTotalsNotUpToDate;
                    end;
                }
                field("Invoice Discount Amount"; InvoiceDiscountAmount)
                {
                    ApplicationArea = Suite;
                    AutoFormatExpression = Currency.Code;
                    AutoFormatType = 1;
                    CaptionClass = DocumentTotals.GetInvoiceDiscAmountWithVATAndCurrencyCaption(FieldCaption("Inv. Discount Amount"), Currency.Code);
                    Caption = 'Invoice Discount Amount';
                    Editable = InvDiscAmountEditable;
                    ToolTip = 'Specifies a discount amount that is deducted from the value of the Total Incl. VAT field, based on purchase lines where the Allow Invoice Disc. field is selected. You can enter or change the amount manually.';

                    trigger OnValidate()
                    begin
                        ValidateInvoiceDiscountAmount();
                        DocumentTotals.PurchaseDocTotalsNotUpToDate;
                    end;
                }
                field("Invoice Disc. Pct."; InvoiceDiscountPct)
                {
                    ApplicationArea = Suite;
                    Caption = 'Invoice Discount %';
                    DecimalPlaces = 0 : 3;
                    Editable = InvDiscAmountEditable;
                    ToolTip = 'Specifies a discount percentage that is applied to the invoice, based on purchase lines where the Allow Invoice Disc. field is selected. The percentage and criteria are defined in the Vendor Invoice Discounts page, but you can enter or change the percentage manually.';

                    trigger OnValidate()
                    begin
                        AmountWithDiscountAllowed := DocumentTotals.CalcTotalPurchAmountOnlyDiscountAllowed(Rec);
                        InvoiceDiscountAmount := Round(AmountWithDiscountAllowed * InvoiceDiscountPct / 100, Currency."Amount Rounding Precision");
                        ValidateInvoiceDiscountAmount();
                        DocumentTotals.PurchaseDocTotalsNotUpToDate;
                    end;
                }
            }
            group(Control19)
            {
                ShowCaption = false;
                field("Total Amount Excl. VAT"; TotalPurchaseLine.Amount)
                {
                    ApplicationArea = Suite;
                    AutoFormatExpression = Currency.Code;
                    AutoFormatType = 1;
                    CaptionClass = DocumentTotals.GetTotalExclVATCaption(Currency.Code);
                    Caption = 'Total Amount Excl. VAT';
                    DrillDown = false;
                    Editable = false;
                    ToolTip = 'Specifies the sum of the value in the Line Amount Excl. VAT field on all lines in the document minus any discount amount in the Invoice Discount Amount field.';
                }
                field("Total VAT Amount"; VATAmount)
                {
                    ApplicationArea = Suite;
                    AutoFormatExpression = Currency.Code;
                    AutoFormatType = 1;
                    CaptionClass = DocumentTotals.GetTotalVATCaption(Currency.Code);
                    Caption = 'Total VAT';
                    Editable = false;
                    ToolTip = 'Specifies the sum of VAT amounts on all lines in the document.';
                }
                field("Total Amount Incl. VAT"; TotalPurchaseLine."Amount Including VAT")
                {
                    ApplicationArea = Suite;
                    AutoFormatExpression = Currency.Code;
                    AutoFormatType = 1;
                    CaptionClass = DocumentTotals.GetTotalInclVATCaption(Currency.Code);
                    Caption = 'Total Amount Incl. VAT';
                    Editable = false;
                    ToolTip = 'Specifies the sum of the value in the Line Amount Incl. VAT field on all lines in the document minus any discount amount in the Invoice Discount Amount field.';
                }
            }
        }
    }
}

actions
{
    area(processing)
    {
        action(SelectMultiItems)
        {
            AccessByPermission = TableData Item = R;
            ApplicationArea = Basic, Suite;
            Caption = 'Select items';
            Ellipsis = true;
            Image = NewItem;
            ToolTip = 'Add two or more items from the full list of your inventory items.';

            trigger OnAction()
            begin
                SelectMultipleItems;
            end;
        }
        group("&Line")
        {
            Caption = '&Line';
            Image = Line;
            group("Item Availability by")
            {
                Caption = 'Item Availability by';
                Image = ItemAvailability;
                Enabled = Type = Type::Item;
                action("Event")
                {
                    ApplicationArea = Basic, Suite;
                    Caption = 'Event';
                    Image = "Event";
                    ToolTip = 'View how the actual and the projected available balance of an item will develop over time according to supply and demand events.';

                    trigger OnAction()
                    begin
                        ItemAvailFormsMgt.ShowItemAvailFromPurchLine(Rec, ItemAvailFormsMgt.ByEvent)
                    end;
                }
                action(Period)
                {
                    ApplicationArea = Basic, Suite;
                    Caption = 'Period';
                    Image = Period;
                    ToolTip = 'Show the projected quantity of the item over time according to time periods, such as day, week, or month.';

                    trigger OnAction()
                    begin
                        ItemAvailFormsMgt.ShowItemAvailFromPurchLine(Rec, ItemAvailFormsMgt.ByPeriod)
                    end;
                }
                action(Variant)
                {
                    ApplicationArea = Planning;
                    Caption = 'Variant';
                    Image = ItemVariant;
                    ToolTip = 'View or edit the item''s variants. Instead of setting up each color of an item as a separate item, you can set up the various colors as variants of the item.';

                    trigger OnAction()
                    begin
                        ItemAvailFormsMgt.ShowItemAvailFromPurchLine(Rec, ItemAvailFormsMgt.ByVariant)
                    end;
                }
                action(Location)
                {
                    AccessByPermission = TableData Location = R;
                    ApplicationArea = Location;
                    Caption = 'Location';
                    Image = Warehouse;
                    ToolTip = 'View the actual and projected quantity of the item per location.';

                    trigger OnAction()
                    begin
                        ItemAvailFormsMgt.ShowItemAvailFromPurchLine(Rec, ItemAvailFormsMgt.ByLocation)
                    end;
                }
                action(Lot)
                {
                    ApplicationArea = ItemTracking;
                    Caption = 'Lot';
                    Image = LotInfo;
                    RunObject = Page "Item Availability by Lot No.";
                    RunPageLink = "No." = field("No."),
                        "Location Filter" = field("Location Code"),
                        "Variant Filter" = field("Variant Code");
                    ToolTip = 'View the current and projected quantity of the item in each lot.';
                }
                action("BOM Level")
                {
                    AccessByPermission = TableData "BOM Buffer" = R;
                    ApplicationArea = Assembly;
                    Caption = 'BOM Level';
                    Image = BOMLevel;
                    ToolTip = 'View availability figures for items on bills of materials that show how many units of a parent item you can make based on the availability of child items.';

                    trigger OnAction()
                    begin
                        ItemAvailFormsMgt.ShowItemAvailFromPurchLine(Rec, ItemAvailFormsMgt.ByBOM)
                    end;
                }
            }
            action("Reservation Entries")
            {
                AccessByPermission = TableData Item = R;
                ApplicationArea = Reservation;
                Caption = 'Reservation Entries';
                Image = ReservationLedger;
                Enabled = Type = Type::Item;
                ToolTip = 'View all reservation entries for the selected item. This action is available only for lines that contain an item.';

                trigger OnAction()
                begin
                    ShowReservationEntries(true);
                end;
            }
            action("Item Tracking Lines")
            {
                ApplicationArea = ItemTracking;
                Caption = 'Item &Tracking Lines';
                Image = ItemTrackingLines;
                ShortCutKey = 'Shift+Ctrl+I';
                Enabled = Type = Type::Item;
                ToolTip = 'View or edit serial and lot numbers for the selected item. This action is available only for lines that contain an item.';

                trigger OnAction()
                begin
                    OpenItemTrackingLines();
                end;
            }
            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
                    ShowDimensions();
                end;
            }
            action("Co&mments")
            {
                ApplicationArea = Comments;
                Caption = 'Co&mments';
                Image = ViewComments;
                ToolTip = 'View or add comments for the record.';

                trigger OnAction()
                begin
                    ShowLineComments();
                end;
            }
            action(ItemChargeAssignment)
            {
                AccessByPermission = TableData "Item Charge" = R;
                ApplicationArea = ItemCharges;
                Caption = 'Item Charge &Assignment';
                Image = ItemCosts;
                Enabled = Type = Type::"Charge (Item)";
                ToolTip = 'Record additional direct costs, for example for freight. This action is available only for Charge (Item) line types.';

                trigger OnAction()
                begin
                    ShowItemChargeAssgnt();
                    SetItemChargeFieldsStyle();
                end;
            }
            action(DocumentLineTracking)
            {
                ApplicationArea = Basic, Suite;
                Caption = 'Document &Line Tracking';
                ToolTip = 'View related open, posted, or archived documents or document lines.';

                trigger OnAction()
                begin
                    ShowDocumentLineTracking();
                end;
            }
            action(DeferralSchedule)
            {
                ApplicationArea = Suite;
                Caption = 'Deferral Schedule';
                Enabled = "Deferral Code" <> '';
                Image = PaymentPeriod;
                ToolTip = 'View or edit the deferral schedule that governs how revenue made with this sales document is deferred to different accounting periods when the document is posted.';

                trigger OnAction()
                begin
                    ShowDeferralSchedule();
                end;
            }
            action(DocAttach)
            {
                ApplicationArea = All;
                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;
            }
        }
        group("F&unctions")
        {
            Caption = 'F&unctions';
            Image = "Action";
            action("E&xplode BOM")
            {
                AccessByPermission = TableData "BOM Component" = R;
                ApplicationArea = Suite;
                Caption = 'E&xplode BOM';
                Image = ExplodeBOM;
                Enabled = Type = Type::Item;
                ToolTip = 'Add a line for each component on the bill of materials for the selected item. For example, this is useful for selling the parent item as a kit. CAUTION: The line for the parent item will be deleted and only its description will display. To undo this action, delete the component lines and add a line for the parent item again. This action is available only for lines that contain an item.';

                trigger OnAction()
                begin
                    ExplodeBOM;
                end;
            }
            action("Insert Ext. Texts")
            {
                AccessByPermission = TableData "Extended Text Header" = R;
                ApplicationArea = Suite;
                Caption = 'Insert &Ext. Texts';
                Image = Text;
                ToolTip = 'Insert the extended item description that is set up for the item that is being processed on the line.';

                trigger OnAction()
                begin
                    InsertExtendedText(true);
                end;
            }
            action(Reserve)
            {
                ApplicationArea = Reservation;
                Caption = '&Reserve';
                Ellipsis = true;
                Image = Reserve;
                Enabled = Type = Type::Item;
                ToolTip = 'Reserve the quantity of the selected item that is required on the document line from which you opened this page. This action is available only for lines that contain an item.';

                trigger OnAction()
                begin
                    Find;
                    ShowReservation();
                end;
            }
            action(OrderTracking)
            {
                ApplicationArea = Suite;
                Caption = 'Order &Tracking';
                Image = OrderTracking;
                Enabled = Type = Type::Item;
                ToolTip = 'Track the connection of a supply to its corresponding demand for the selected item. This can help you find the original demand that created a specific production order or purchase order. This action is available only for lines that contain an item.';

                trigger OnAction()
                begin
                    ShowTracking();
                end;
            }
        }
        group("O&rder")
        {
            Caption = 'O&rder';
            Image = "Order";
            group("Dr&op Shipment")
            {
                Caption = 'Dr&op Shipment';
                Image = Delivery;
                action("Sales &Order")
                {
                    AccessByPermission = TableData "Sales Shipment Header" = R;
                    ApplicationArea = Suite;
                    Caption = 'Sales &Order';
                    Image = Document;
                    ToolTip = 'View the sales order that is the source of the line. This applies only to drop shipments and special orders.';

                    trigger OnAction()
                    begin
                        OpenSalesOrderForm;
                    end;
                }
            }
            group("Speci&al Order")
            {
                Caption = 'Speci&al Order';
                Image = SpecialOrder;
                action(Action1901038504)
                {
                    AccessByPermission = TableData "Sales Shipment Header" = R;
                    ApplicationArea = Suite;
                    Caption = 'Sales &Order';
                    Image = Document;
                    ToolTip = 'View the sales order that is the source of the line. This applies only to drop shipments and special orders.';

                    trigger OnAction()
                    begin
                        OpenSpecOrderSalesOrderForm;
                    end;
                }
            }
            action(BlanketOrder)
            {
                ApplicationArea = Suite;
                Caption = 'Blanket Order';
                Image = BlanketOrder;
                ToolTip = 'View the blanket purchase order.';

                trigger OnAction()
                var
                    PurchaseHeader: Record "Purchase Header";
                    BlanketPurchaseOrder: Page "Blanket Purchase Order";
                begin
                    TestField("Blanket Order No.");
                    PurchaseHeader.SetRange("No.", "Blanket Order No.");
                    if not PurchaseHeader.IsEmpty() then begin
                        BlanketPurchaseOrder.SetTableView(PurchaseHeader);
                        BlanketPurchaseOrder.Editable := false;
                        BlanketPurchaseOrder.Run;
                    end;
                end;
            }
        }
        group("Page")
        {
            Caption = 'Page';

            action(EditInExcel)
            {
                ApplicationArea = Basic, Suite;
                Caption = 'Edit in Excel';
                Image = Excel;
                Promoted = true;
                PromotedCategory = Category8;
                PromotedIsBig = true;
                PromotedOnly = true;
                Visible = IsSaaSExcelAddinEnabled;
                ToolTip = 'Send the data in the sub page to an Excel file for analysis or editing';
                AccessByPermission = System "Allow Action Export To Excel" = X;

                trigger OnAction()
                var
                    ODataUtility: Codeunit ODataUtility;
                begin
                    ODataUtility.EditWorksheetInExcel('Purchase_Order_Line', CurrPage.ObjectId(false), StrSubstNo('Document_No eq ''%1''', Rec."Document No."));
                end;

            }
        }
    }
}

trigger OnAfterGetCurrRecord()
begin
    GetTotalsPurchaseHeader;
    CalculateTotals;
    UpdateEditableOnRow();
    UpdateTypeText();
    SetItemChargeFieldsStyle();
end;

trigger OnAfterGetRecord()
begin
    ShowShortcutDimCode(ShortcutDimCode);
    UpdateTypeText();
    SetItemChargeFieldsStyle();
end;

trigger OnDeleteRecord(): Boolean
var
    PurchLineReserve: Codeunit "Purch. Line-Reserve";
begin
    if (Quantity <> 0) and ItemExists("No.") then begin
        Commit();
        if not PurchLineReserve.DeleteLineConfirm(Rec) then
            exit(false);
        PurchLineReserve.DeleteLine(Rec);
    end;
    DocumentTotals.PurchaseDocTotalsNotUpToDate;
end;

trigger OnFindRecord(Which: Text): Boolean
begin
    DocumentTotals.PurchaseCheckAndClearTotals(Rec, xRec, TotalPurchaseLine, VATAmount, InvoiceDiscountAmount, InvoiceDiscountPct);
    exit(Find(Which));
end;

trigger OnInit()
var
    ApplicationAreaMgmtFacade: Codeunit "Application Area Mgmt. Facade";
begin
    PurchasesPayablesSetup.Get();
    InventorySetup.Get();
    TempOptionLookupBuffer.FillLookupBuffer(TempOptionLookupBuffer."Lookup Type"::Purchases);
    IsFoundation := ApplicationAreaMgmtFacade.IsFoundationEnabled();
    Currency.InitRoundingPrecision();
end;

trigger OnModifyRecord(): Boolean
begin
    DocumentTotals.PurchaseCheckIfDocumentChanged(Rec, xRec);
end;

trigger OnNewRecord(BelowxRec: Boolean)
begin
    InitType;
    SetDefaultType();

    Clear(ShortcutDimCode);
    UpdateTypeText();
end;

trigger OnOpenPage()
var
    ServerSetting: Codeunit "Server Setting";
begin
    //NPO begin
    OnBeforeOnOpenPage();
    //NPO end
    IsSaaSExcelAddinEnabled := ServerSetting.GetIsSaasExcelAddinEnabled();
    SuppressTotals := CurrentClientType() = ClientType::ODataV4;

    SetDimensionsVisibility();
    SetOverReceiptControlsVisibility();
    SetItemReferenceVisibility();
end;

var
    PurchaseHeader: Record "Purchase Header";
    Currency: Record Currency;
    PurchasesPayablesSetup: Record "Purchases & Payables Setup";
    InventorySetup: Record "Inventory Setup";
    TempOptionLookupBuffer: Record "Option Lookup Buffer" temporary;
    ApplicationAreaMgmtFacade: Codeunit "Application Area Mgmt. Facade";
    TransferExtendedText: Codeunit "Transfer Extended Text";
    ItemAvailFormsMgt: Codeunit "Item Availability Forms Mgt";
    Text001: Label 'You cannot use the Explode BOM function because a prepayment of the purchase order has been invoiced.';
    PurchCalcDiscByType: Codeunit "Purch - Calc Disc. By Type";
    DocumentTotals: Codeunit "Document Totals";
    AmountWithDiscountAllowed: Decimal;
    TypeAsText: Text[30];
    ItemChargeStyleExpression: Text;
    InvDiscAmountEditable: Boolean;
    IsFoundation: Boolean;
    IsSaaSExcelAddinEnabled: Boolean;
    UpdateInvDiscountQst: Label 'One or more lines have been invoiced. The discount distributed to invoiced lines will not be taken into account.\\Do you want to update the invoice discount?';
    CurrPageIsEditable: Boolean;
    OverReceiptAllowed: Boolean;
    SuppressTotals: Boolean;
    [InDataSet]
    ItemReferenceVisible: Boolean;

protected var
    TotalPurchaseHeader: Record "Purchase Header";
    TotalPurchaseLine: Record "Purchase Line";
    ShortcutDimCode: array[8] of Code[20];
    InvoiceDiscountAmount: Decimal;
    InvoiceDiscountPct: Decimal;
    VATAmount: Decimal;
    DimVisible1: Boolean;
    DimVisible2: Boolean;
    DimVisible3: Boolean;
    DimVisible4: Boolean;
    DimVisible5: Boolean;
    DimVisible6: Boolean;
    DimVisible7: Boolean;
    DimVisible8: Boolean;
    IsBlankNumber: Boolean;
    IsCommentLine: Boolean;

procedure ApproveCalcInvDisc()
begin
    CODEUNIT.Run(CODEUNIT::"Purch.-Disc. (Yes/No)", Rec);
    DocumentTotals.PurchaseDocTotalsNotUpToDate;
end;

local procedure ValidateInvoiceDiscountAmount()
var
    ConfirmManagement: Codeunit "Confirm Management";
begin
    if SuppressTotals then
        exit;

    PurchaseHeader.Get("Document Type", "Document No.");
    if PurchaseHeader.InvoicedLineExists then
        if not ConfirmManagement.GetResponseOrDefault(UpdateInvDiscountQst, true) then
            exit;

    DocumentTotals.PurchaseDocTotalsNotUpToDate;
    PurchCalcDiscByType.ApplyInvDiscBasedOnAmt(InvoiceDiscountAmount, PurchaseHeader);
    CurrPage.Update(false);
end;

local procedure ExplodeBOM()
begin
    if "Prepmt. Amt. Inv." <> 0 then
        Error(Text001);
    CODEUNIT.Run(CODEUNIT::"Purch.-Explode BOM", Rec);
    DocumentTotals.PurchaseDocTotalsNotUpToDate;
end;

local procedure OpenSalesOrderForm()
var
    SalesHeader: Record "Sales Header";
    SalesOrder: Page "Sales Order";
    IsHandled: Boolean;
begin
    IsHandled := false;
    OnBeforeOpenSalesOrderForm(Rec, SalesHeader, SalesOrder, IsHandled);
    if IsHandled then
        exit;

    TestField("Sales Order No.");
    SalesHeader.SetRange("No.", "Sales Order No.");
    SalesOrder.SetTableView(SalesHeader);
    SalesOrder.Editable := false;
    SalesOrder.Run;
end;

procedure InsertExtendedText(Unconditionally: Boolean)
var
    IsHandled: Boolean;
begin
    IsHandled := false;
    OnBeforeInsertExtendedText(Rec, IsHandled);
    if IsHandled then
        exit;

    if TransferExtendedText.PurchCheckIfAnyExtText(Rec, Unconditionally) then begin
        CurrPage.SaveRecord;
        TransferExtendedText.InsertPurchExtText(Rec);
    end;
    if TransferExtendedText.MakeUpdate then
        UpdateForm(true);
end;

procedure ShowTracking()
var
    TrackingForm: Page "Order Tracking";
begin
    TrackingForm.SetPurchLine(Rec);
    TrackingForm.RunModal;
end;

local procedure OpenSpecOrderSalesOrderForm()
var
    SalesHeader: Record "Sales Header";
    SalesOrder: Page "Sales Order";
    IsHandled: Boolean;
begin
    IsHandled := false;
    OnBeforeOpenSpecOrderSalesOrderForm(Rec, SalesHeader, SalesOrder, IsHandled);
    if IsHandled then
        exit;

    TestField("Special Order Sales No.");
    SalesHeader.SetRange("No.", "Special Order Sales No.");
    SalesOrder.SetTableView(SalesHeader);
    SalesOrder.Editable := false;
    SalesOrder.Run;
end;

procedure UpdateForm(SetSaveRecord: Boolean)
begin
    CurrPage.Update(SetSaveRecord);
end;

procedure NoOnAfterValidate()
begin
    UpdateEditableOnRow();
    InsertExtendedText(false);
    if (Type = Type::"Charge (Item)") and ("No." <> xRec."No.") and
       (xRec."No." <> '')
    then
        CurrPage.SaveRecord;

    OnAfterNoOnAfterValidate(Rec, xRec);
end;

procedure ShowDocumentLineTracking()
var
    DocumentLineTracking: Page "Document Line Tracking";
begin
    Clear(DocumentLineTracking);
    DocumentLineTracking.SetDoc(1, "Document No.", "Line No.", "Blanket Order No.", "Blanket Order Line No.", '', 0);
    DocumentLineTracking.RunModal;
end;

procedure RedistributeTotalsOnAfterValidate()
begin
    if SuppressTotals then
        exit;

    CurrPage.SaveRecord;

    DocumentTotals.PurchaseRedistributeInvoiceDiscountAmounts(Rec, VATAmount, TotalPurchaseLine);
    CurrPage.Update(false);
end;

local procedure GetTotalsPurchaseHeader()
begin
    DocumentTotals.GetTotalPurchaseHeaderAndCurrency(Rec, TotalPurchaseHeader, Currency);
end;

procedure CalculateTotals()
begin
    if SuppressTotals then
        exit;

    DocumentTotals.PurchaseCheckIfDocumentChanged(Rec, xRec);
    DocumentTotals.CalculatePurchaseSubPageTotals(
      TotalPurchaseHeader, TotalPurchaseLine, VATAmount, InvoiceDiscountAmount, InvoiceDiscountPct);
    DocumentTotals.RefreshPurchaseLine(Rec);
end;

procedure DeltaUpdateTotals()
begin
    if SuppressTotals then
        exit;

    DocumentTotals.PurchaseDeltaUpdateTotals(Rec, xRec, TotalPurchaseLine, VATAmount, InvoiceDiscountAmount, InvoiceDiscountPct);
    CheckSendLineInvoiceDiscountResetNotification();
end;

local procedure CheckSendLineInvoiceDiscountResetNotification()
var
    IsHandled: Boolean;
begin
    IsHandled := false;
    OnBeforeCheckSendLineInvoiceDiscountResetNotification(Rec, IsHandled);
    if IsHandled then
        exit;

    if "Line Amount" <> xRec."Line Amount" then
        SendLineInvoiceDiscountResetNotification();
end;

procedure UpdateEditableOnRow()
begin
    IsCommentLine := Type = Type::" ";
    IsBlankNumber := IsCommentLine;

    CurrPageIsEditable := CurrPage.Editable;
    InvDiscAmountEditable := CurrPageIsEditable and not PurchasesPayablesSetup."Calc. Inv. Discount";

    OnAfterUpdateEditableOnRow(Rec, IsCommentLine, IsBlankNumber);
end;

procedure UpdateTypeText()
var
    RecRef: RecordRef;
begin
    if not IsFoundation then
        exit;

    OnBeforeUpdateTypeText(Rec);

    RecRef.GetTable(Rec);
    TypeAsText := TempOptionLookupBuffer.FormatOption(RecRef.Field(FieldNo(Type)));
end;

local procedure SetItemChargeFieldsStyle()
begin
    ItemChargeStyleExpression := '';
    if AssignedItemCharge and ("Qty. Assigned" <> Quantity) then
        ItemChargeStyleExpression := 'Unfavorable';
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;

local procedure SetItemReferenceVisibility()
var
    ItemReferenceMgt: Codeunit "Item Reference Management";
begin
    ItemReferenceVisible := ItemReferenceMgt.IsEnabled();
end;

local procedure SetDefaultType()
var
    IsHandled: Boolean;
begin
    IsHandled := false;
    OnBeforeSetDefaultType(Rec, xRec, IsHandled);
    if not IsHandled then // Set default type Item
        if ApplicationAreaMgmtFacade.IsFoundationEnabled then
            if xRec."Document No." = '' then
                Type := Type::Item;
end;

local procedure SetOverReceiptControlsVisibility()
var
    OverReceiptMgt: Codeunit "Over-Receipt Mgt.";
begin
    OverReceiptAllowed := OverReceiptMgt.IsOverReceiptAllowed();
end;

[IntegrationEvent(TRUE, false)]
local procedure OnAfterNoOnAfterValidate(var PurchaseLine: Record "Purchase Line"; var xPurchaseLine: Record "Purchase Line")
begin
end;

[IntegrationEvent(false, false)]
local procedure OnAfterUpdateEditableOnRow(PurchaseLine: Record "Purchase Line"; var IsCommentLine: Boolean; var IsBlankNumber: Boolean);
begin
end;

[IntegrationEvent(false, false)]
local procedure OnAfterValidateShortcutDimCode(var PurchaseLine: Record "Purchase Line"; var ShortcutDimCode: array[8] of Code[20]; DimIndex: Integer)
begin
end;

[IntegrationEvent(false, false)]
local procedure OnBeforeCheckSendLineInvoiceDiscountResetNotification(var PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)
begin
end;

[IntegrationEvent(false, false)]
local procedure OnBeforeInsertExtendedText(var PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)
begin
end;

[IntegrationEvent(false, false)]
local procedure OnBeforeOpenSpecOrderSalesOrderForm(var PurchaseLine: Record "Purchase Line"; var SalesHeader: Record "Sales Header"; var SalesOrder: Page "Sales Order"; var IsHandled: Boolean)
begin
end;

[IntegrationEvent(false, false)]
local procedure OnBeforeSetDefaultType(var PurchaseLine: Record "Purchase Line"; var xPurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)
begin
end;

[IntegrationEvent(false, false)]
local procedure OnBeforeUpdateTypeText(var PurchaseLine: Record "Purchase Line")
begin
end;

#if not CLEAN17
[IntegrationEvent(false, false)]
local procedure OnCrossReferenceNoOnLookup(var PurchaseLine: Record "Purchase Line")
begin
end;
#endif
[IntegrationEvent(false, false)]
local procedure OnItemReferenceNoOnLookup(var PurchaseLine: Record "Purchase Line")
begin
end;

[IntegrationEvent(false, false)]
local procedure OnBeforeOpenSalesOrderForm(var PurchaseLine: Record "Purchase Line"; var SalesHeader: Record "Sales Header"; var SalesOrder: Page "Sales Order"; var IsHandled: Boolean)
begin
end;

//NPO begin
[IntegrationEvent(true, false)]
local procedure OnBeforeOnOpenPage()
begin
end;
//NPO end

}

Thanks for reporting this. We agree, and we’ll publish a fix asap, either in an update for the current version or in the next major release. Please do not reply to this, as we do not monitor closed issues. If you have follow-up questions or requests, please create a new issue where you reference this one.


2024-12-06_01-36-32_master-next_python3-botocore

Automatically created.

Successfully created backport PR for kirkstone-next:

#10653

Successfully created backport PR for scarthgap-next:

#10654

Successfully created backport PR for styhead-next:

#10655


Support Python 3.11

Python 3.11.0 is now released: https://www.python.org/downloads/release/python-3110/

Waiting for PyTorch to support Python 3.11.
https://github.com/pytorch/pytorch/issues/86566


doc: improve guidance for gitian lxc building

This addition to the gitian doc explains some common troubleshooting when running gitian builder with LXC and how to adapt configuration to make the LXC container talk to the host.

Concept ACK. I tried these instructions and see:
--- Building for bionic amd64 ---
Stopping target if it is up
Making a new image copy
cp: cannot stat 'base-bionic-amd64': No such file or directory
Traceback (most recent call last):
	6: from ./bin/gbuild:348:in `<main>'
	5: from ./bin/gbuild:348:in `each'
	4: from ./bin/gbuild:350:in `block in <main>'
	3: from ./bin/gbuild:350:in `each'
	2: from ./bin/gbuild:355:in `block (2 levels) in <main>'
	1: from ./bin/gbuild:60:in `build_one_configuration'
./bin/gbuild:23:in `system!': failed to run make-clean-vm --suite bionic --arch amd64 (RuntimeError)

... though I think that's irrelevant to the new environment variables recommended here. If you can confirm my suspicions, I can approve this.

I think it's because you need to run with --lxc --setup first? It should create base-bionic-amd64 (an image file) in the working directory you're calling the script from.

Yes, that helped. I still have errors, but comparing with and without these environment variables, with is better.

what kind of errors do you get? Would be good to cover them in the doc.

I set the LXC bridge and gateway environment variables appropriately.
$ ./gitian-build.sh --build --lxc -u https://github.com/patricklodder/dogecoin -c 1.14.4-libevent-2.1.12
From https://github.com/patricklodder/dogecoin
 * branch                1.14.4-libevent-2.1.12 -> FETCH_HEAD
--- Building for bionic amd64 ---
Stopping target if it is up
Making a new image copy
lxc-execute: gitian: conf.c: turn_into_dependent_mounts: 3915 No such file or directory - Failed to recursively turn old root mount tree into dependent mount. Continuing...
lxc-execute: gitian: sync.c: sync_wait: 34 An error occurred in another process (expected sequence number 4)
lxc-execute: gitian: start.c: __lxc_start: 2074 Failed to spawn container "gitian"
lxc-execute: gitian: tools/lxc_execute.c: main: 224 Failed run an application inside container
Traceback (most recent call last):
	6: from ./bin/gbuild:347:in `<main>'
	5: from ./bin/gbuild:347:in `each'
	4: from ./bin/gbuild:349:in `block in <main>'
	3: from ./bin/gbuild:349:in `each'
	2: from ./bin/gbuild:354:in `block (2 levels) in <main>'
	1: from ./bin/gbuild:60:in `build_one_configuration'
./bin/gbuild:23:in `system!': failed to run make-clean-vm --suite bionic --arch amd64 (RuntimeError)

Thanks @xanimo. I also have spun up a Ubuntu Jammy box to be able to test there and I run into similar issues as you there, your script works for me on my Hirsute box too, but not on my Focal box after updating to the latest lxc (dumb move on my part)

Ubuntu
lxc
debootstrap
apt-cacher-ng
works?

18.04 Bionic
3.0.3-0ubuntu1
1.0.95ubuntu0.11
3.1-1build1
✅

20.04 Focal
4.0.12-0ubuntu1
1.0.118ubuntu1.7
3.3.1-2build1
❌

21.04 Hirsute
4.0.6-0ubuntu1
1.0.123ubuntu6.2
3.6.3-1
✅

21.10 Impish
4.0.12-0ubuntu1
1.0.124ubuntu0.2
3.6.4-1
❌

22.04 Jammy
5.0.0~git2209-g5a7b9ce67-0ubuntu1
1.0.126+nmu1ubuntu0.1
3.7.4-1build1
❌

Looking at this, there seems to be a regression between the gitian-builder script and lxc 4.0.6 and 4.0.12. @chromatic can you confirm that your lxc version is > 4.0.6? (dpkg -s lxc | grep Version)
I propose to add a note that LXC only works on a bionic host (as Hirsute is unmaintained) and then we look into this further next release cycle. Thoughts?

I've added debootstrap, added the steps @xanimo and I took last night to get past a package install issue, and added the note that lxc only works on bionic.

Confirmed; I have lxc version 4.0.12 on the box where I see the errors.

Unfortunately I'm still having issues. Going to try again on a fresh VPS with 18.04. Currently getting:
--- Building for bionic amd64 ---
Stopping target if it is up
Making a new image copy
sudo: unable to resolve host gitian: Resource temporarily unavailable
Reading package lists... Done
Building dependency tree... Done
The following packages will be REMOVED:
  rsyslog*
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 1466 kB disk space will be freed.
(Reading database ... 18583 files and directories currently installed.)
Removing rsyslog (8.32.0-1ubuntu4) ...
invoke-rc.d: could not determine current runlevel
 * Stopping enhanced syslogd rsyslogd
   ...done.
(Reading database ... 18525 files and directories currently installed.)
Purging configuration files for rsyslog (8.32.0-1ubuntu4) ...
dpkg: warning: while removing rsyslog, directory '/etc/apparmor.d/local' not empty so not removed
Processing triggers for systemd (237-3ubuntu10) ...
Adding 'local diversion of /sbin/initctl to /sbin/initctl.distrib'
Adding 'local diversion of /usr/bin/ischroot to /usr/bin/ischroot.distrib'
Adding 'local diversion of /usr/sbin/policy-rc.d to /usr/sbin/policy-rc.d.distrib'
Starting target
Checking if target is up
Preparing build environment
Updating apt-get repository (log in var/install.log)
Installing additional packages (log in var/install.log)
Traceback (most recent call last):
	6: from ./bin/gbuild:347:in `<main>'
	5: from ./bin/gbuild:347:in `each'
	4: from ./bin/gbuild:349:in `block in <main>'
	3: from ./bin/gbuild:349:in `each'
	2: from ./bin/gbuild:354:in `block (2 levels) in <main>'
	1: from ./bin/gbuild:120:in `build_one_configuration'
./bin/gbuild:23:in `system!': failed to run on-target -u root -e DEBIAN_FRONTEND=noninteractive apt-get --no-install-recommends -y install curl g++-aarch64-linux-gnu g++-7-aarch64-linux-gnu gcc-7-aarch64-linux-gnu binutils-aarch64-linux-gnu g++-arm-linux-gnueabihf g++-7-arm-linux-gnueabihf gcc-7-arm-linux-gnueabihf binutils-arm-linux-gnueabihf g++-7-multilib gcc-7-multilib binutils-gold git-core pkg-config autoconf libtool automake faketime bison bsdmainutils ca-certificates python >> var/install.log 2>&1 (RuntimeError)

Can you share your var/install.log?

Can you share your var/install.log?

var/install.log
var/build.log

Can you share your var/install.log?

var/install.log var/build.log

I'm going to try building a commit from yesterday prior to merging #2409 because after more digging, it appears to be failing on libevent when building depends:
Fetching libevent-2.1.12-stable.tar.gz from https://github.com/libevent/libevent/releases/download/release-2.1.12-stable/
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0Warning: Transient problem: timeout Will retry in 1 seconds. 3 retries left.
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0Warning: Transient problem: timeout Will retry in 2 seconds. 2 retries left.
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0Warning: Transient problem: timeout Will retry in 4 seconds. 1 retries left.
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0curl: (6) Could not resolve host: github.com
Fetching libevent-2.1.12-stable.tar.gz from https://depends.dogecoincore.org
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0Warning: Transient problem: timeout Will retry in 1 seconds. 3 retries left.
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0Warning: Transient problem: timeout Will retry in 2 seconds. 2 retries left.
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0Warning: Transient problem: timeout Will retry in 4 seconds. 1 retries left.
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0curl: (6) Could not resolve host: depends.dogecoincore.org
funcs.mk:244: recipe for target '/home/ubuntu/cache/common/download-stamps/.stamp_fetched-libevent-libevent-2.1.12-stable.tar.gz.hash' failed
make: *** [/home/ubuntu/cache/common/download-stamps/.stamp_fetched-libevent-libevent-2.1.12-stable.tar.gz.hash] Error 6
make: Leaving directory '/home/ubuntu/build/dogecoin/depends'

Will post an update shortly.

Am in the middle of my first actually running gitian build of dogecoin/1.14.6-dev with lxc. Attaching my notes for the evening: https://gist.github.com/xanimo/d8f3651ff583d75b4d4361b2169f3d39
@chromatic unaware if you were able to build using lxc but if not and you happen to have time I wonder if you or anyone that hasn't successfully built with lxc might be able to try building this commit before zlib was updated 3 months ago?
./bin/gbuild --memory 14000 --commit dogecoin=c6a285828ea2c4d4ebcce5125c1077340be409cd ../dogecoin/contrib/gitian-descriptors/gitian-linux.yml
I'm building manually from the gitian-builder directory but perhaps it'd work with the gitian-build.sh script. And sorry all for the essay.

I used gbuild manually.

What exact command line and env did you use?

Update: I ran into the dns problem on the lxc guest machine too (on a completely fresh box+install with lxc 4.0.6) - so we'll have to put the lxc side of this back back to the drawing board.

@patricklodder You had an lxc build succeed in #3141 ; can we bring this PR in now?

I had to fall back to using a bionic host because I still don't have a working environment on a recent Ubuntu.

I'm not going to finish this, as gitian-builder is EOL. Will instead focus on guix for 1.15


add examples to methoed responeses?

Is there any option to add examples to method Response in documentation?

I will close this in favour of #45.


TypeError: type object argument after ** must be a mapping, not ForecastingParameters

I am tryin the following, just as the document shows:

from azureml.automl.core.forecasting_parameters import ForecastingParameters

forecasting_parameters = ForecastingParameters(time_column_name='EventEnqueuedUtcTime',
                                               forecast_horizon=50,
                                               time_series_id_column_names=["eui"],
                                               freq='H',
                                               target_lags='auto',
                                               target_rolling_window_size=10)

from azureml.core.workspace import Workspace
from azureml.core.experiment import Experiment
from azureml.train.automl import AutoMLConfig
import logging

automl_config = AutoMLConfig(task='forecasting',
                             primary_metric='normalized_root_mean_squared_error',
                             experiment_timeout_minutes=3600,
                             enable_early_stopping=True,
                             training_data=df,
                             label_column_name='TempC_DS',
                             n_cross_validations=5,
                             enable_ensembling=False,
                             verbosity=logging.INFO,
                             **forecasting_parameters)

However I get this error:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-45-f98e38048abe> in <module>
     13                              enable_ensembling=False,
     14                              verbosity=logging.INFO,
---> 15                              **forecasting_parameters)

TypeError: type object argument after ** must be a mapping, not ForecastingParameters

What am I missing?
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

ID: bf6e8bb8-9f33-6315-dec3-915c82152f4f
Version Independent ID: 0d184dff-a615-49e4-089a-8c41a8ff801c
Content: Auto-train a time-series forecast model - Azure Machine Learning
Content Source: articles/machine-learning/how-to-auto-train-forecast.md
Service: machine-learning
Sub-service: core
GitHub Login: @nibaccam
Microsoft Alias: nibaccam

@levalencia Thanks for the question. We are investigating the issue and will update you shortly.

@levalencia Thanks, Can you please add more details about the automl version that you are using. Here is the notebook to Create the configuration and train a forecaster .

According to this:
print(azureml.core.VERSION)
1.19.0

@levalencia Thanks, Please follow the notebook  for AutoMLConfig. Please pass the forecasting_parameters as shown below in the screenshot for standard AutoMLConfig object.

@levalencia We will now proceed to close this thread. If there are further questions regarding this matter, please tag me in your reply. We will gladly continue the discussion and we will reopen the issue.

Thanks @ram-msft , that seems to do the trick.


Update PipelineSpec Task validation to prevents errors at runtime

Changes
Currently, if step names are omitted, a duplicate empty value collides in the Pipeline validation. Also, if a Task name uses forbidden characters, pods will fail to be created since it is appended to the name. If the name is omitted (in a single step, which would pass validation) we would get <PipelineRunName>--<Rand>-<ConditionalRefName>-<Rand> for a condition pod and <PipelineRunName>--<Rand> otherwise, where the double hyphen imply the name should be specified. Further, in the catalog and elsewhere it seems to be a well documented practice to include the name.
This PR adds validation to PipelineSpec Task name and TaskRef name validation to ensure that the name are valid Kubernetes names (revokes empty values).
Submitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them:

[x] Includes tests (if functionality changed/added)
[x] Includes docs (if user facing)
[x] Commit messages follow commit message best practices

See the contribution guide for more details.
Double check this list of stuff that's easy to miss:

If you are adding a new binary/image to the cmd dir, please update
the release Task to build and release this image.

Reviewer Notes
If API changes are included, additive changes must be approved by at least two OWNERS and backwards incompatible changes must be approved by more than 50% of the OWNERS, and they must first be added in a backwards compatible way.
Release Notes
Names of Task instances within Pipelines are now validated: they must not be empty, and they must only contain valid characters (https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names).

Not sure where within https://github.com/tektoncd/pipeline/blob/master/docs/pipelines.md to update or if it is necessary?

Maybe docs can link to https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names

Just realized that the TaskRef names weren't being checked either so I just added this as well.

Thanks @vtereso !!
/lgtm

It was an easy change so I returned all the errors

/test pull-tekton-pipeline-integration-tests

/hold remove

/hold cancel

/lgtm cancel
@bobcatfish @vtereso needs cla/google to be fixed for this to be mergeable :sweat:

The cla is 🆗


move issuer address computation to separate function

Towards https://github.com/giantswarm/roadmap/issues/2197
Used in opsctl create dexconfig https://github.com/giantswarm/opsctl/pull/1656
This just moves the function we use to compute the issuer URL for a cluster in a separate function so that it can be exported and logic stays the same in opsctl.

Also, the CI fails due to reported vulnerabilities


A test pull request

The program takes a character from stdin and shift it by 13. It takes an option -k to specify shifts other than 13. Only alphabets are shifted. ASCII value of characters are taken and offset to between 0 and 25 before applying shift and mod. Characters outside a-z and A-Z stays the same.

@steven-chien You're supposed to push this to the repo created by your reviewer, not to me :)
Check on Moodle for the list of who is reviewing who :)
However, your PR is good - this is what we're looking for :)


Add Testcontainers section

Testcontainers has released a new module for Milvus in Java and Go.

FYI I also added a Milvus testcontainer module for .NET (link) - can this be added to this PR as well?


html generated for mj-image title attribute applies to only img tag and not to the anchor tag

When using title attribute on mj-image, it gets applied only to the  tag and not to the  tag
We have an issue for T-online-de, while using src or msrc as a query param in the url image is not visible. We need to have a title attribute for the anchor tag to resolve that issue. However when we apply title attribute to mj-image generated html shows title attribute being applied to  tag only and not to the  tag which holds the href(i.e the url).
To Reproduce
Steps to reproduce the behavior:

Create a file with this MJML code:

<mjml>
  <mj-body>
    <mj-section>
      <mj-column>
        <mj-image href="https://test.com/tracking?msrc=123" title= "test" width="300px" src="https://www.online-image-editor.com//styles/2014/images/example_image.png" />
      </mj-column>
    </mj-section>
  </mj-body>
</mjml>

Generated html for mj-image is:

EOA link - when title is there for img tag only: https://app.emailonacid.com/app/acidtest/hQriROd1lbtSWCNZrbsQxM4iC4yGRcoTfoCgGkVekK8lh/list
It can be seen that image is missing for both Chrome & Firefox for T-online-de
but to resolve our issue we would need html to have title attribute applied to both  &  tag like below:

EOA link - when title is there for img & a tag both: https://app.emailonacid.com/app/acidtest/NrdxM0L8E10tntfzEpwsXvC7BfJUGFgf4xoOOuhiv5JPu/list
It works when title attribute is present at both  and  tags
Email sending environment(for rendering issues):

Platform used to check the email EmailOnAcid

Affected email clients (for rendering issues):
-T-Online-de
Is it possible we can get title attribute for  tag for mj-image.

That's really a weird bug, I don't think this would cause any issue, feel free to open a PR for that 👍

@iRyusa Will you be able to merge the PR for this fix?

@iRyusa Can we have a new release for these fixes. Latest release doesn’t include these fixes.


Ability to pass in instance of Aggregate when applying events for a Stream

We need to supply some external information to the Aggregate we are building to support Applying certain events, as such we need to be able to pass in an instantiated instance of the Aggregate type, instead of just relying on new T() every time we call AggregateStream<T>...

Closed by https://github.com/JasperFx/marten/commit/502793528001c9144e3c6c4ac2d3c56c9c0aa936


Updated React version in peerDependencies

As React 0.14 RC1 was released, and delicate-error-reporter had beta3 as a peerDependency, I was unable to test it out in an existing project. This pull request should fix NPM errors coming from that.

Thank you.


Add feature auto scale_color

Please add this feature auto scale color when map type change, like from satellite or road view.
Thank you

Didn't get you

I mean, color for scale_color can detect automatically after Google Map style.
Can we do it now?

I've deleted play services as dependency, so we can do it by explicitly call method of MapScaleView.
Like mapTypeChanged with MAP_TYPE_NORMAL, MAP_TYPE_NORMAL, ... params.
Not automatically.

I don't get it to using that, can you write some example to do that for clue?
thank in advance

Idea is it will be not automatically, you need to call method of ScaleView to tell that map type was changed and need to update color

thank you, I will try it


Resesearch a possible support for Bluemix

{
"name":"BlueMix",
"build":"210011",ç
"support":"http://ibm.com","version":2,"description":"IBM BlueMix",
"authorization_endpoint":"https://login.eu-gb.bluemix.net/UAALoginServerWAR",
"token_endpoint":"https://uaa.eu-gb.bluemix.net","min_cli_version":null,
"min_recommended_cli_version":null,"api_version":"2.27.0",
"app_ssh_endpoint":"ssh.eu-gb.bluemix.net:2222","app_ssh_host_key_fingerprint":null,
"logging_endpoint":"wss://loggregator.eu-gb.bluemix.net:443"
}

It is possible.
It is necessary to change the way to authenticate from token_endpoint to authorization_endpoint
The idea runs with Yudai, Pivotal & Bluemix


refactor(auth)!: convert to sessions and http-cookies

Works wonders with the new rewrite of something new..... and will be much better than managing jwts.

failing ci? check ✔
merge conflicts? check ✔
PR status? LGTM. check ✔
patience? 0. check ✔


Brilliant work！

I'm sure I'll see a journal version of this work in IEEE TPAMI.

agree with you @I-Hope-Peace


Added missing space

Thanks! Congrats on being the first contributor :)

A pleasure. Glad I could help with this baby step :-)


enable SSL/TLS

Does pbis-open use ssl  to communicate with a domain controller? Unfortunately I did not find in the documentation how to enable this option.

We currently do not support ldaps. There is a config option to enable sign and seal.
See Lsassd: Enable signing and sealing for LDAP traffic

is it sufficient to set the variable on true? Or do I need to configure anything on my domain controller?

pbis-open will longer receive updates and will be archived. Closing all outstanding issues. Please consider BeyondTrust Active Directory Bridge for continued support.
https://www.beyondtrust.com/privilege-management/active-directory-bridge


strategy parameters not available after converting the file via shifter

I`m  facing an issue at the time of converting template to helm .
Issue: shifter is not taking care the "strategy" .
I`m sharing the strategy parameters from source-file and output-file
strategy parameters from source file:
strategy:
activeDeadlineSeconds:
resources: {}
rollingParams:
intervalSeconds:
maxSurge: %
maxUnavailable: %
timeoutSeconds:
updatePeriodSeconds:
type:
strategy parameters from output file:
strategy: {}
Please help to fix this issue or suggest for taking care it.
--
Regards,
Himanshu Gaur

I`m facing an issue at the time converting template to helm.
Issue: shifter is not taking care the "strategy" .
I`m sharing the strategy parameters from source-file and output-file
strategy parameters from source file:
strategy:
activeDeadlineSeconds:
resources: {}
rollingParams:
intervalSeconds:
maxSurge: %
maxUnavailable: %
timeoutSeconds:
updatePeriodSeconds:
type:
strategy parameters from output file:
strategy: {}
Please help to fix this issue or suggest for taking care it.
--
Regards,
Himanshu Gaur


lxd/patches: Fix LVM VG name

Closes #5643
Signed-off-by: Stéphane Graber<EMAIL_ADDRESS>

jenkins: test this please


pull request for e2e test at 12/24/2016 17:26:08

:white_check_mark: Validation status: passed
For more details, please refer to the build report.
Note: If you changed an existing file name or deleted a file, broken links in other files to the deleted or renamed file are listed only in the full build report.


Support indexing into bit-arrays for multiplexor synthesis

Add a new component to the netlist data-structure which corresponds to an array lookup (of an array of bits) which models a multiplexor. A different bug will track the more general requirementof multiplexing between inputs of buses rather than single wires.

Closed via #109


Responsiveness

The current website lacks proper responsiveness, leading to a suboptimal user experience on various devices (mobile, tablet, desktop). Ensuring that the website is fully responsive is essential for delivering a consistent, seamless experience across all screen sizes and devices, especially for users who may access the platform on mobile devices.
Expected Behavior:
Responsive Layout: The website should automatically adjust its layout to fit different screen sizes, including mobile phones, tablets, and desktops, ensuring that content remains accessible and visually appealing.
Mobile Optimization: Elements like navigation menus, buttons, forms, and text should resize and reposition appropriately for smaller screens without cutting off content or affecting functionality.
Flexible Images and Media: All images, videos, and other media should scale fluidly, maintaining their aspect ratio and ensuring they do not overflow their containers on smaller screens.
Breakpoints: The website should utilize CSS media queries to define breakpoints for various screen sizes (e.g., 320px for mobile, 768px for tablets, 1024px+ for desktops).
Test Across Devices: The design should be tested on various devices to ensure consistency in appearance and usability, avoiding issues like overlapping text, cropped images, or broken layouts.
Use CSS Flexbox or Grid layouts along with media queries to create a responsive design. Implement mobile-first development practices, ensuring that smaller screens are prioritized and progressively enhanced for larger screens. Make use of CSS frameworks like Bootstrap or Tailwind CSS to help manage responsiveness more efficiently, or customize your own responsive CSS styles for maximum control. Additionally, use browser dev tools for testing and debugging across different device viewports.

please assign it to me I want to do it @MUDITJAINN :)

@MUDITJAINN I would be happy to work on this.

hey can i help u..? pls assign me

Hey @MUDITJAINN  I would like to work on it

Hi @MUDITJAINN can you please assign this issue to me , I would love to work on it

Hi @MUDITJAINN , Could you please assign this issue to me? I would love to work on it and will ensure to provide the best solution.

@mohit-1710 bkl

😂😂😂 bhai vo mayank ko sikha rha tha tab likha hai ... Roo mat
On Fri, Oct 4, 2024, 1:14 AM Vansh Chitransh @.***>
wrote:

@mohit-1710 https://github.com/mohit-1710 bkl
—
Reply to this email directly, view it on GitHub
https://github.com/MUDITJAINN/Ayurveda-GPT/issues/3#issuecomment-2392197857,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/BKMSBDXHN2Z53LSGST27ZWDZZWNBLAVCNFSM6AAAAABPJSZYBOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGOJSGE4TOOBVG4
.
You are receiving this because you were mentioned.Message ID:
@.***>

@lightning-sagar You can start working on this.

@mayank-0789 @mohit-1710 you go through the website and propose new issues and features.

@MUDITJAINN are these ok?? added responsive....


Can't install with pnpm

Describe the bug
I'm trying to install a couple of fonts with pnpm but it can seem to finish the install process.
Steps to Reproduce

initialize a project with pnpm
try to install a font

Expected behavior
No response
Version
No response
OS
No response
Browser
No response
Additional context
No response

What errors are you getting in the console when you try to install?

Nothing it just hangs there without completing the process

Try installing with pnpm install --reporter and see if anything useful shows up. I'm guessing this is ultimately an issue on your computer because fontsource seems to work with pnpm just fine for me. You could also try clearing the pnpm store cache incase anything is causing issues there.

Mmm it just started working again...really strange.


Fixes

Not sure looping is working correctly, nor end of track detection. Will need further investigation.


Remove initial state variables from soil and lake parameter files

This is just a suggestion - not urgent.
The initial soil layer moistures and lake depth in the soil_param and lake_param files are really state variables (yet by themselves they do not completely specify the model state).  When an initial state file is specified, they are overridden by the corresponding values in the initial state file, in which case they are redundant and misleading.  If we wish to continue supporting the ability to start VIC without an initial state file, then we could easily initialize these storages to their maximum values as a default.  Regardless of the initial values used in the "no statefile" case, some spinup would be necessary to achieve believable results, particularly in full energy mode.

I'm a fan of this.  Never quite understood why these were in there.  :+1:

They were in the soil files for historic reasons. There was a time when restarts were not considered a major feature and it allowed an easy way to initialize a run without having to create a state file (which was more difficult to construct than adding a column to the soil parameter file). We should pull this out as suggested and have states initialized through the state file. Note that that will require a state file for any run (even if it has all zeros).
I would also consider this of reasonably high priority.

I also support the removal of initial state information from the soil and lake parameter files.
Still, given the effort still involved in creating an initial state file, I'd vote for either (a) continuing to allow VIC to start from a default "cold" state so that it can create an initial state file after a spinup, or (b) modify tonic to create a default "cold" state file from the soil, veg, lake, etc parameter files...
Option (a) is easy since VIC already does this - all we'd need to do is have VIC initialize soil moistures and lake depths to maximum values in the absence of an initial state file.  VIC already initializes the other variables (e.g. temperatures) to default "cold" values in that case.

To me b) would be preferred, but I understand that this may be more work

What if we implement (a) to start with, since it's easy and then we have a more stable version of the parameter file formats, and then implement (b) later?  Or is this kicking the can down the road?

That is fine with me for now. Maybe open a separate issue for tonic to describe this (and reference this discussion).

Just a suggestion - this probably should be labeled as cleanup instead of enhancement.  I'm opening another very similar cleanup issue now (#749) and the two issues could be handled in a single PR...