Page 99000827 Recurring Output 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/RecurringOutputJournal.Page.al747 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 99000827 "Recurring Output Journal"
{
ApplicationArea = Manufacturing;
AutoSplitKey = true;
Caption = 'Recurring Output 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.GetOutput(Rec, ProdOrderDescription, OperationName);
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("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 OnLookup(var Text: Text): Boolean
begin
Rec.LookupItemNo();
Rec.ShowShortcutDimCode(ShortcutDimCode);
end;
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("Operation No."; Rec."Operation No.")
{
ApplicationArea = Manufacturing;
ToolTip = 'Specifies the number of the production operation on the item journal line when the journal functions as an output journal.';
trigger OnValidate()
begin
MfgItemJournalMgt.GetOutput(Rec, ProdOrderDescription, OperationName);
end;
}
field(Type; Rec.Type)
{
ApplicationArea = Manufacturing;
ToolTip = 'Specifies the journal type, which is either Work Center or Machine Center.';
}
field("No."; Rec."No.")
{
ApplicationArea = Manufacturing;
ToolTip = 'Specifies the number of the involved entry or record, according to the specified number series.';
}
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("Work Shift Code"; Rec."Work Shift Code")
{
ApplicationArea = Manufacturing;
ToolTip = 'Specifies the work shift code for this Journal line.';
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("Starting Time"; Rec."Starting Time")
{
ApplicationArea = Manufacturing;
ToolTip = 'Specifies the starting time of the operation on the item journal line.';
Visible = false;
}
field("Ending Time"; Rec."Ending Time")
{
ApplicationArea = Manufacturing;
ToolTip = 'Specifies the ending time of the operation on the item journal line.';
Visible = false;
}
field("Concurrent Capacity"; Rec."Concurrent Capacity")
{
ApplicationArea = Manufacturing;
ToolTip = 'Specifies the concurrent capacity.';
Visible = false;
}
field("Setup Time"; Rec."Setup Time")
{
ApplicationArea = Manufacturing;
ToolTip = 'Specifies the time required to set up the machines for this journal line.';
Visible = false;
}
field("Run Time"; Rec."Run Time")
{
ApplicationArea = Manufacturing;
ToolTip = 'Specifies the run time of the operations represented by this journal line.';
}
field("Cap. Unit of Measure Code"; Rec."Cap. Unit of Measure Code")
{
ApplicationArea = Manufacturing;
ToolTip = 'Specifies the unit of measure code for the capacity usage.';
}
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(Amount; Rec.Amount)
{
ApplicationArea = Manufacturing;
ToolTip = 'Specifies the line''s net amount.';
Visible = false;
}
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("Scrap Code"; Rec."Scrap Code")
{
ApplicationArea = Manufacturing;
ToolTip = 'Specifies the scrap code.';
Visible = false;
}
field("Output Quantity"; Rec."Output Quantity")
{
ApplicationArea = Manufacturing;
ToolTip = 'Specifies the quantity of the produced item that can be posted as output on the journal line.';
}
field("Scrap Quantity"; Rec."Scrap Quantity")
{
ApplicationArea = Manufacturing;
ToolTip = 'Specifies the number of units produced incorrectly, and therefore cannot be used.';
}
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(Finished; Rec.Finished)
{
ApplicationArea = Manufacturing;
ToolTip = 'Specifies that the operation represented by the output journal line is finished.';
}
field("Document Date"; Rec."Document Date")
{
ApplicationArea = Manufacturing;
ToolTip = 'Specifies the date when the related document was created.';
Visible = false;
}
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("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("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;
}
}
group(Operation)
{
Caption = 'Operation';
field(OperationName; OperationName)
{
ApplicationArea = Manufacturing;
Caption = 'Operation';
Editable = false;
ToolTip = 'Specifies the abbreviated task description.';
}
}
}
}
}
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.");
RunPageView = sorting(Status, "No.")
where(Status = const(Released));
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).';
}
action("Value Entries")
{
ApplicationArea = Manufacturing;
Caption = 'Value Entries';
Image = ValueLedger;
RunObject = Page "Value Entries";
RunPageLink = "Order Type" = const(Production),
"Order No." = field("Order No.");
RunPageView = sorting("Order Type", "Order No.");
ToolTip = 'View the value entries of the item on the document or journal line.';
}
}
}
}
area(processing)
{
group("F&unctions")
{
Caption = 'F&unctions';
Image = "Action";
action("Explode &Routing")
{
ApplicationArea = Manufacturing;
Caption = 'Explode &Routing';
Image = ExplodeRouting;
RunObject = Codeunit "Output Jnl.-Expl. Route";
ToolTip = 'Insert prefilled journal lines according to the production order routing.';
}
}
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("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("&Print_Promoted"; "&Print")
{
}
}
group(Category_Line)
{
Caption = 'Line';
actionref(Dimensions_Promoted; Dimensions)
{
}
actionref("Item &Tracking Lines_Promoted"; "Item &Tracking Lines")
{
}
actionref("Bin Contents_Promoted"; "Bin Contents")
{
}
}
}
}
trigger OnAfterGetCurrRecord()
begin
MfgItemJournalMgt.GetOutput(Rec, ProdOrderDescription, OperationName);
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"::Output);
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 Output Journal", 5, true, Rec, JnlSelected);
if not JnlSelected then
Error('');
ItemJnlMgt.OpenJnl(CurrentJnlBatchName, Rec);
end;
var
ItemJnlMgt: Codeunit ItemJnlManagement;
MfgItemJournalMgt: Codeunit "Mfg. Item Journal Mgt.";
ReportPrint: Codeunit "Test Report-Print";
ProdOrderDescription: Text[50];
OperationName: Text[50];
protected var
ShortcutDimCode: array[8] of Code[20];
CurrentJnlBatchName: Code[10];
DimVisible1: Boolean;
DimVisible2: Boolean;
DimVisible3: Boolean;
DimVisible4: Boolean;
DimVisible5: Boolean;
DimVisible6: Boolean;
DimVisible7: Boolean;
DimVisible8: Boolean;
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;
[IntegrationEvent(false, false)]
local procedure OnReferenceNoOnAfterLookup(var ItemJournalLine: Record "Item Journal Line")
begin
end;
}