Page 99000850 Recurring Consumption Journal
- App
- Base Application
- Namespace
- Microsoft.Manufacturing.Journal
- Versions
- 17-28
- Source table
- 83
Versions171819202122232425262728
Source29
Source in 29
src/Layers/W1/BaseApp/Manufacturing/Journal/RecurringConsumptionJournal.Page.al684 lines, Copyright (c) Microsoft Corporation. MIT
// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------
namespace Microsoft.Manufacturing.Journal;
using Microsoft.Finance.Dimension;
using Microsoft.Foundation.Reporting;
using Microsoft.Inventory.Item.Catalog;
using Microsoft.Inventory.Journal;
using Microsoft.Inventory.Ledger;
using Microsoft.Manufacturing.Capacity;
using Microsoft.Manufacturing.Document;
using Microsoft.Warehouse.Structure;
page 99000850 "Recurring Consumption Journal"
{
ApplicationArea = Manufacturing;
AutoSplitKey = true;
Caption = 'Recurring Consumption Journals';
DataCaptionFields = "Journal Batch Name";
DelayedInsert = true;
PageType = Worksheet;
SaveValues = true;
SourceTable = "Item Journal Line";
UsageCategory = Tasks;
layout
{
area(content)
{
field(CurrentJnlBatchName; CurrentJnlBatchName)
{
ApplicationArea = Manufacturing;
Caption = 'Batch Name';
Lookup = true;
ToolTip = 'Specifies the name of the journal batch, a personalized journal layout, that the journal is based on.';
trigger OnLookup(var Text: Text): Boolean
begin
CurrPage.SaveRecord();
ItemJnlMgt.LookupName(CurrentJnlBatchName, Rec);
CurrPage.Update(false);
ItemJnlMgt.CheckName(CurrentJnlBatchName, Rec);
end;
trigger OnValidate()
begin
ItemJnlMgt.CheckName(CurrentJnlBatchName, Rec);
CurrentJnlBatchNameOnAfterVali();
end;
}
repeater(Control1)
{
ShowCaption = false;
field("Recurring Method"; Rec."Recurring Method")
{
ApplicationArea = Manufacturing;
ToolTip = 'Specifies a recurring method, if you have indicated that the journal is recurring.';
}
field("Recurring Frequency"; Rec."Recurring Frequency")
{
ApplicationArea = Manufacturing;
ToolTip = 'Specifies a recurring frequency if it is indicated that the journal is recurring.';
}
field("Posting Date"; Rec."Posting Date")
{
ApplicationArea = Manufacturing;
ToolTip = 'Specifies the posting date for the entry.';
}
field("Order No."; Rec."Order No.")
{
ApplicationArea = Manufacturing;
ToolTip = 'Specifies the number of the order that created the entry.';
trigger OnValidate()
begin
MfgItemJournalMgt.GetConsump(Rec, ProdOrderDescription);
end;
}
field("Order Line No."; Rec."Order Line No.")
{
ApplicationArea = Manufacturing;
ToolTip = 'Specifies the line number of the order that created the entry.';
Visible = false;
}
field("Prod. Order Comp. Line No."; Rec."Prod. Order Comp. Line No.")
{
ApplicationArea = Manufacturing;
ToolTip = 'Specifies the production order component line number.';
Visible = false;
}
field("Document Date"; Rec."Document Date")
{
ApplicationArea = Manufacturing;
ToolTip = 'Specifies the date when the related document was created.';
Visible = false;
}
field("External Document No."; Rec."External Document No.")
{
ApplicationArea = Manufacturing;
ToolTip = 'Specifies a document number that refers to the customer''s or vendor''s numbering system.';
Visible = false;
}
field("Document No."; Rec."Document No.")
{
ApplicationArea = Manufacturing;
ToolTip = 'Specifies a document number for the journal line.';
}
field("Item No."; Rec."Item No.")
{
ApplicationArea = Manufacturing;
ToolTip = 'Specifies the number of the item on the journal line.';
trigger OnValidate()
begin
ItemNoOnAfterValidate();
end;
}
field("Item Reference No."; Rec."Item Reference No.")
{
AccessByPermission = tabledata "Item Reference" = R;
ApplicationArea = Manufacturing, ItemReferences;
QuickEntry = false;
ToolTip = 'Specifies a reference to the item number as defined by the item''s barcode.';
Visible = false;
trigger OnLookup(var Text: Text): Boolean
var
ItemReferenceManagement: Codeunit "Item Reference Management";
begin
ItemReferenceManagement.ItemJournalReferenceNoLookup(Rec);
ItemNoOnAfterValidate();
OnReferenceNoOnAfterLookup(Rec);
end;
trigger OnValidate()
begin
ItemNoOnAfterValidate();
end;
}
field("Variant Code"; Rec."Variant Code")
{
ApplicationArea = Planning;
ToolTip = 'Specifies the variant of the item on the line.';
Visible = false;
}
field(Description; Rec.Description)
{
ApplicationArea = Manufacturing;
ToolTip = 'Specifies a description of the item on the journal line.';
}
field("Location Code"; Rec."Location Code")
{
ApplicationArea = Location;
ToolTip = 'Specifies the code for the inventory location where the item on the journal line will be registered.';
Visible = false;
}
field("Bin Code"; Rec."Bin Code")
{
ApplicationArea = Warehouse;
ToolTip = 'Specifies a bin code for the item.';
Visible = false;
}
field("Gen. Bus. Posting Group"; Rec."Gen. Bus. Posting Group")
{
ApplicationArea = Manufacturing;
ToolTip = 'Specifies the vendor''s or customer''s trade type to link transactions made for this business partner with the appropriate general ledger account according to the general posting setup.';
Visible = false;
}
field("Gen. Prod. Posting Group"; Rec."Gen. Prod. Posting Group")
{
ApplicationArea = Manufacturing;
ToolTip = 'Specifies the item''s product type to link transactions made for this item with the appropriate general ledger account according to the general posting setup.';
Visible = false;
}
field(Quantity; Rec.Quantity)
{
ApplicationArea = Manufacturing;
ToolTip = 'Specifies the number of units of the item or resource specified on the line.';
}
field("Unit of Measure Code"; Rec."Unit of Measure Code")
{
ApplicationArea = Manufacturing;
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.';
}
field("Unit Cost"; Rec."Unit Cost")
{
ApplicationArea = Manufacturing;
ToolTip = 'Specifies the cost of one unit of the item or resource on the line.';
Visible = false;
}
field("Unit Amount"; Rec."Unit Amount")
{
ApplicationArea = Manufacturing;
ToolTip = 'Specifies the price of one unit of the item on the journal line.';
}
field("Applies-to Entry"; Rec."Applies-to Entry")
{
ApplicationArea = Manufacturing;
ToolTip = 'Specifies if the quantity on the journal line must be applied to an already-posted entry. In that case, enter the entry number that the quantity will be applied to.';
}
field("Expiration Date"; Rec."Expiration Date")
{
ApplicationArea = Manufacturing;
ToolTip = 'Specifies the last date on which the recurring journal will be posted, if you have indicated that the journal is recurring.';
}
field("Shortcut Dimension 1 Code"; Rec."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"; Rec."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
Rec.ValidateShortcutDimCode(3, 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
Rec.ValidateShortcutDimCode(4, 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
Rec.ValidateShortcutDimCode(5, 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
Rec.ValidateShortcutDimCode(6, 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
Rec.ValidateShortcutDimCode(7, 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
Rec.ValidateShortcutDimCode(8, ShortcutDimCode[8]);
end;
}
}
group(Control73)
{
ShowCaption = false;
fixed(Control1902114901)
{
ShowCaption = false;
group("Prod. Order Name")
{
Caption = 'Prod. Order Name';
field(ProdOrderDescription; ProdOrderDescription)
{
ApplicationArea = Manufacturing;
Editable = false;
ShowCaption = false;
}
}
}
}
}
area(factboxes)
{
systempart(Control1900383207; Links)
{
ApplicationArea = RecordLinks;
Visible = false;
}
systempart(Control1905767507; Notes)
{
ApplicationArea = Notes;
Visible = false;
}
}
}
actions
{
area(navigation)
{
group("&Line")
{
Caption = '&Line';
Image = Line;
action(Dimensions)
{
AccessByPermission = TableData Dimension = R;
ApplicationArea = Dimensions;
Caption = 'Dimensions';
Image = Dimensions;
ShortCutKey = 'Alt+D';
ToolTip = 'View or edit dimensions, such as area, project, or department, that you can assign to sales and purchase documents to distribute costs and analyze transaction history.';
trigger OnAction()
begin
Rec.ShowDimensions();
CurrPage.SaveRecord();
end;
}
action("Item &Tracking Lines")
{
ApplicationArea = ItemTracking;
Caption = 'Item &Tracking Lines';
Image = ItemTrackingLines;
ShortCutKey = 'Ctrl+Alt+I';
ToolTip = 'View or edit serial, lot and package numbers that are assigned to the item on the document or journal line.';
trigger OnAction()
begin
Rec.OpenItemTrackingLines(false);
end;
}
action("Bin Contents")
{
ApplicationArea = Warehouse;
Caption = 'Bin Contents';
Image = BinContent;
RunObject = Page "Bin Contents List";
RunPageLink = "Location Code" = field("Location Code"),
"Item No." = field("Item No."),
"Variant Code" = field("Variant Code");
RunPageView = sorting("Location Code", "Bin Code", "Item No.", "Variant Code");
ToolTip = 'View items in the bin if the selected line contains a bin code.';
}
}
group("Pro&d. Order")
{
Caption = 'Pro&d. Order';
Image = "Order";
action(Card)
{
ApplicationArea = Manufacturing;
Caption = 'Card';
Image = EditLines;
RunObject = Page "Released Production Order";
RunPageLink = "No." = field("Order No.");
ShortCutKey = 'Shift+F7';
ToolTip = 'View or change detailed information about the record on the document or journal line.';
}
group("Ledger E&ntries")
{
Caption = 'Ledger E&ntries';
Image = Entries;
action("Item Ledger E&ntries")
{
ApplicationArea = Manufacturing;
Caption = 'Item Ledger E&ntries';
Image = ItemLedger;
RunObject = Page "Item Ledger Entries";
RunPageLink = "Order Type" = const(Production),
"Order No." = field("Order No.");
RunPageView = sorting("Order Type", "Order No.");
ShortCutKey = 'Ctrl+F7';
ToolTip = 'View the item ledger entries of the item on the document or journal line.';
}
action("Capacity Ledger Entries")
{
ApplicationArea = Manufacturing;
Caption = 'Capacity Ledger Entries';
Image = CapacityLedger;
RunObject = Page "Capacity Ledger Entries";
RunPageLink = "Order Type" = const(Production),
"Order No." = field("Order No.");
RunPageView = sorting("Order Type", "Order No.");
ToolTip = 'View the capacity ledger entries of the involved production order. Capacity is recorded either as time (run time, stop time, or setup time) or as quantity (scrap quantity or output quantity).';
}
}
}
}
area(processing)
{
group("F&unctions")
{
Caption = 'F&unctions';
Image = "Action";
action("Calc. Co&nsumption")
{
ApplicationArea = Manufacturing;
Caption = 'Calc. Co&nsumption';
Ellipsis = true;
Image = CalculateConsumption;
ToolTip = 'Use a batch job to help you fill the consumption journal with actual or expected consumption figures.';
trigger OnAction()
var
CalcConsumption: Report "Calc. Consumption";
begin
CalcConsumption.SetTemplateAndBatchName(Rec."Journal Template Name", Rec."Journal Batch Name");
CalcConsumption.RunModal();
end;
}
}
group("P&osting")
{
Caption = 'P&osting';
Image = Post;
action("Test Report")
{
ApplicationArea = Manufacturing;
Caption = 'Test Report';
Ellipsis = true;
Image = TestReport;
ToolTip = 'View a test report so that you can find and correct any errors before you perform the actual posting of the journal or document.';
trigger OnAction()
begin
ReportPrint.PrintItemJnlLine(Rec);
end;
}
action("P&ost")
{
ApplicationArea = Manufacturing;
Caption = 'P&ost';
Image = PostOrder;
ShortCutKey = 'F9';
ToolTip = 'Finalize the document or journal by posting the amounts and quantities to the related accounts in your company books.';
trigger OnAction()
begin
Rec.PostingItemJnlFromProduction(false);
CurrentJnlBatchName := Rec.GetRangeMax("Journal Batch Name");
CurrPage.Update(false);
end;
}
action(PreviewPosting)
{
ApplicationArea = Manufacturing;
Caption = 'Preview Posting';
Image = ViewPostedOrder;
ShortCutKey = 'Ctrl+Alt+F9';
ToolTip = 'Review the different types of entries that will be created when you post the document or journal.';
trigger OnAction()
begin
ShowPreview();
CurrPage.Update(false);
end;
}
action("Post and &Print")
{
ApplicationArea = Manufacturing;
Caption = 'Post and &Print';
Image = PostPrint;
ShortCutKey = 'Shift+F9';
ToolTip = 'Finalize and prepare to print the document or journal. The values and quantities are posted to the related accounts. A report request window where you can specify what to include on the print-out.';
trigger OnAction()
begin
Rec.PostingItemJnlFromProduction(true);
CurrentJnlBatchName := Rec.GetRangeMax("Journal Batch Name");
CurrPage.Update(false);
end;
}
}
action("&Print")
{
ApplicationArea = Manufacturing;
Caption = '&Print';
Ellipsis = true;
Image = Print;
ToolTip = 'Prepare to print the document. A report request window for the document opens where you can specify what to include on the print-out.';
trigger OnAction()
var
ItemJnlLine: Record "Item Journal Line";
begin
ItemJnlLine.Copy(Rec);
ItemJnlLine.PrintInventoryMovement();
end;
}
}
area(Promoted)
{
group(Category_Process)
{
Caption = 'Process';
group(Category_Posting)
{
Caption = 'Posting';
ShowAs = SplitButton;
actionref("P&ost_Promoted"; "P&ost")
{
}
actionref("Post and &Print_Promoted"; "Post and &Print")
{
}
actionref(PreviewPosting_Promoted; PreviewPosting)
{
}
}
actionref("Calc. Co&nsumption_Promoted"; "Calc. Co&nsumption")
{
}
actionref("&Print_Promoted"; "&Print")
{
}
}
group(Category_Line)
{
Caption = 'Line';
actionref("Item &Tracking Lines_Promoted"; "Item &Tracking Lines")
{
}
actionref(Dimensions_Promoted; Dimensions)
{
}
actionref("Bin Contents_Promoted"; "Bin Contents")
{
}
}
}
}
trigger OnAfterGetCurrRecord()
begin
MfgItemJournalMgt.GetConsump(Rec, ProdOrderDescription);
end;
trigger OnAfterGetRecord()
begin
Rec.ShowShortcutDimCode(ShortcutDimCode);
end;
trigger OnDeleteRecord(): Boolean
var
ItemJnlLineReserve: Codeunit "Item Jnl. Line-Reserve";
begin
Commit();
if not ItemJnlLineReserve.DeleteLineConfirm(Rec) then
exit(false);
ItemJnlLineReserve.DeleteLine(Rec);
end;
trigger OnNewRecord(BelowxRec: Boolean)
begin
Rec.SetUpNewLine(xRec);
Rec.Validate("Entry Type", Rec."Entry Type"::Consumption);
Clear(ShortcutDimCode);
end;
trigger OnOpenPage()
var
JnlSelected: Boolean;
begin
SetDimensionsVisibility();
if Rec.IsOpenedFromBatch() then begin
CurrentJnlBatchName := Rec."Journal Batch Name";
ItemJnlMgt.OpenJnl(CurrentJnlBatchName, Rec);
exit;
end;
ItemJnlMgt.TemplateSelection(PAGE::"Recurring Consumption Journal", 4, true, Rec, JnlSelected);
if not JnlSelected then
Error('');
ItemJnlMgt.OpenJnl(CurrentJnlBatchName, Rec);
end;
protected var
CurrentJnlBatchName: Code[10];
ShortcutDimCode: array[8] of Code[20];
DimVisible1: Boolean;
DimVisible2: Boolean;
DimVisible3: Boolean;
DimVisible4: Boolean;
DimVisible5: Boolean;
DimVisible6: Boolean;
DimVisible7: Boolean;
DimVisible8: Boolean;
var
ItemJnlMgt: Codeunit ItemJnlManagement;
MfgItemJournalMgt: Codeunit "Mfg. Item Journal Mgt.";
ReportPrint: Codeunit "Test Report-Print";
ProdOrderDescription: Text[100];
local procedure CurrentJnlBatchNameOnAfterVali()
begin
CurrPage.SaveRecord();
ItemJnlMgt.SetName(CurrentJnlBatchName, Rec);
CurrPage.Update(false);
end;
procedure ItemNoOnAfterValidate()
begin
Rec.ShowShortcutDimCode(ShortcutDimCode);
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 ShowPreview()
begin
Rec.PreviewPostItemJnlFromProduction();
end;
[IntegrationEvent(false, false)]
local procedure OnReferenceNoOnAfterLookup(var ItemJournalLine: Record "Item Journal Line")
begin
end;
}