Page 9301 Sales Invoice List
- App
- Base Application
- Namespace
- Microsoft.Sales.Document
- Versions
- 17-28
- Source table
- 36
Versions171819202122232425262728
Source29
Source in 29
src/Layers/W1/BaseApp/Sales/Document/SalesInvoiceList.Page.al889 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.Sales.Document;
using Microsoft.EServices.EDocument;
using Microsoft.Finance.Dimension;
using Microsoft.Foundation.Attachment;
using Microsoft.Foundation.Reporting;
using Microsoft.Sales.Comment;
using Microsoft.Sales.Customer;
using Microsoft.Sales.History;
using Microsoft.Sales.Posting;
using Microsoft.Sales.Reports;
using Microsoft.Sales.Setup;
using Microsoft.Utilities;
using System.Automation;
using System.Environment.Configuration;
using System.Text;
using System.Threading;
/// <summary>
/// Displays a list of sales invoices for managing customer billing documents.
/// </summary>
page 9301 "Sales Invoice List"
{
ApplicationArea = Basic, Suite;
Caption = 'Sales Invoices';
CardPageID = "Sales Invoice";
DataCaptionFields = "Sell-to Customer No.";
Editable = false;
PageType = List;
QueryCategory = 'Sales Invoice List';
RefreshOnActivate = true;
SourceTable = "Sales Header";
SourceTableView = where("Document Type" = const(Invoice));
UsageCategory = Lists;
AdditionalSearchTerms = 'Sales Bills, Sales Invoice Overview, Sales Bill List, Sales Receipts, Commerce Invoices, Client Invoices, Sales Slips, Sales Invoice Log, Sales Transaction Invoices';
AboutTitle = 'About sales invoices';
AboutText = 'Sales invoices appear in this list until they are finalized and posted. After an invoice is posted, find it again in the [Posted Sales Invoices](?page=143 "Open the Posted Sales Invoices page") list.';
layout
{
area(content)
{
repeater(Control1)
{
ShowCaption = false;
field("No."; Rec."No.")
{
ApplicationArea = Basic, Suite;
AboutTitle = 'Number (No.) is set automatically';
AboutText = 'This invoice number is only used until posting. At that time, the posted sales invoice gets the final number that your customer will see.';
ToolTip = 'Specifies the number of the involved entry or record, according to the specified number series.';
}
field("Sell-to Customer No."; Rec."Sell-to Customer No.")
{
ApplicationArea = Basic, Suite;
ToolTip = 'Specifies the number of the customer.';
}
field("Sell-to Customer Name"; Rec."Sell-to Customer Name")
{
ApplicationArea = Basic, Suite;
ToolTip = 'Specifies the name of the customer.';
}
field("External Document No."; Rec."External Document No.")
{
ApplicationArea = Basic, Suite;
}
field("Sell-to Post Code"; Rec."Sell-to Post Code")
{
ApplicationArea = Basic, Suite;
Visible = false;
}
field("Sell-to Country/Region Code"; Rec."Sell-to Country/Region Code")
{
ApplicationArea = Basic, Suite;
Visible = false;
}
field("Sell-to Contact"; Rec."Sell-to Contact")
{
ApplicationArea = Basic, Suite;
}
field("Bill-to Customer No."; Rec."Bill-to Customer No.")
{
ApplicationArea = Basic, Suite;
Visible = false;
}
field("Bill-to Name"; Rec."Bill-to Name")
{
ApplicationArea = Basic, Suite;
Visible = false;
}
field("Bill-to Post Code"; Rec."Bill-to Post Code")
{
ApplicationArea = Basic, Suite;
Visible = false;
}
field("Bill-to Country/Region Code"; Rec."Bill-to Country/Region Code")
{
ApplicationArea = Basic, Suite;
Visible = false;
}
field("Bill-to Contact"; Rec."Bill-to Contact")
{
ApplicationArea = Basic, Suite;
Visible = false;
}
field("Ship-to Code"; Rec."Ship-to Code")
{
ApplicationArea = Basic, Suite;
Visible = false;
}
field("Ship-to Name"; Rec."Ship-to Name")
{
ApplicationArea = Basic, Suite;
Visible = false;
}
field("Ship-to Post Code"; Rec."Ship-to Post Code")
{
ApplicationArea = Basic, Suite;
Visible = false;
}
field("Ship-to Country/Region Code"; Rec."Ship-to Country/Region Code")
{
ApplicationArea = Basic, Suite;
Visible = false;
}
field("Ship-to Contact"; Rec."Ship-to Contact")
{
ApplicationArea = Basic, Suite;
Visible = false;
}
field("Posting Date"; Rec."Posting Date")
{
ApplicationArea = Basic, Suite;
}
field("Shortcut Dimension 1 Code"; Rec."Shortcut Dimension 1 Code")
{
ApplicationArea = Dimensions;
Visible = false;
}
field("Shortcut Dimension 2 Code"; Rec."Shortcut Dimension 2 Code")
{
ApplicationArea = Dimensions;
Visible = false;
}
field("Location Code"; Rec."Location Code")
{
ApplicationArea = Location;
}
field("Quote No."; Rec."Quote No.")
{
ApplicationArea = Basic, Suite;
ToolTip = 'Specifies the number of the sales quote that the sales invoice was created from. You can track the number to sales quote documents that you have printed, saved, or emailed.';
Visible = false;
}
field("Salesperson Code"; Rec."Salesperson Code")
{
ApplicationArea = Suite;
ToolTip = 'Specifies the name of the sales person who is assigned to the customer.';
Visible = false;
}
field("Assigned User ID"; Rec."Assigned User ID")
{
ApplicationArea = Basic, Suite;
}
field("Currency Code"; Rec."Currency Code")
{
ApplicationArea = Suite;
Visible = false;
}
field("Document Date"; Rec."Document Date")
{
ApplicationArea = Basic, Suite;
Visible = false;
}
field("Campaign No."; Rec."Campaign No.")
{
ApplicationArea = RelationshipMgmt;
ToolTip = 'Specifies the number of the campaign that the document is linked to.';
Visible = false;
}
field(Status; Rec.Status)
{
ApplicationArea = Basic, Suite;
Visible = false;
StyleExpr = StatusStyleTxt;
}
field("Payment Terms Code"; Rec."Payment Terms Code")
{
ApplicationArea = Basic, Suite;
Visible = false;
}
field("Due Date"; Rec."Due Date")
{
ApplicationArea = Basic, Suite;
}
field("Payment Discount %"; Rec."Payment Discount %")
{
ApplicationArea = Basic, Suite;
ToolTip = 'Specifies the payment discount percentage granted if the customer pays on or before the date entered in the Pmt. Discount Date field.';
Visible = false;
}
field("Shipment Method Code"; Rec."Shipment Method Code")
{
ApplicationArea = Suite;
Visible = false;
}
field("Shipping Agent Code"; Rec."Shipping Agent Code")
{
ApplicationArea = Suite;
Visible = false;
}
field("Shipping Agent Service Code"; Rec."Shipping Agent Service Code")
{
ApplicationArea = Suite;
Visible = false;
}
field("Package Tracking No."; Rec."Package Tracking No.")
{
ApplicationArea = Suite;
Visible = false;
}
field("Shipment Date"; Rec."Shipment Date")
{
ApplicationArea = Basic, Suite;
Visible = false;
}
field("Job Queue Status"; Rec."Job Queue Status")
{
ApplicationArea = All;
Style = Unfavorable;
StyleExpr = Rec."Job Queue Status" = Rec."Job Queue Status"::ERROR;
ToolTip = 'Specifies the status of a job queue entry or task that handles the posting of sales invoices.';
Visible = JobQueueActive;
trigger OnDrillDown()
var
JobQueueEntry: Record "Job Queue Entry";
begin
if Rec."Job Queue Status" = Rec."Job Queue Status"::" " then
exit;
JobQueueEntry.ShowStatusMsg(Rec."Job Queue Entry ID");
end;
}
field(Amount; Rec.Amount)
{
ApplicationArea = Basic, Suite;
}
field("Amount Including VAT"; Rec."Amount Including VAT")
{
ApplicationArea = Basic, Suite;
Visible = false;
}
field("Posting Description"; Rec."Posting Description")
{
ApplicationArea = Suite;
Visible = false;
}
field("Your Reference"; Rec."Your Reference")
{
ApplicationArea = Basic, Suite;
Visible = false;
}
}
}
area(factboxes)
{
part("Attached Documents List"; "Doc. Attachment List Factbox")
{
ApplicationArea = All;
Caption = 'Documents';
UpdatePropagation = Both;
SubPageLink = "Table ID" = const(Database::"Sales Header"),
"No." = field("No."),
"Document Type" = field("Document Type");
}
part(Control1902018507; "Customer Statistics FactBox")
{
ApplicationArea = Basic, Suite;
SubPageLink = "No." = field("Bill-to Customer No."),
"Date Filter" = field("Date Filter");
}
part(Control1900316107; "Customer Details FactBox")
{
ApplicationArea = Basic, Suite;
SubPageLink = "No." = field("Bill-to Customer No."),
"Date Filter" = field("Date Filter");
}
part(IncomingDocAttachFactBox; "Incoming Doc. Attach. FactBox")
{
ApplicationArea = Basic, Suite;
ShowFilter = false;
Visible = false;
}
systempart(Control1900383207; Links)
{
ApplicationArea = RecordLinks;
Visible = false;
}
systempart(Control1905767507; Notes)
{
ApplicationArea = Notes;
}
}
}
actions
{
area(navigation)
{
group("&Invoice")
{
Caption = '&Invoice';
Image = Invoice;
action(SalesStatistics)
{
ApplicationArea = Basic, Suite;
Caption = 'Statistics';
Enabled = Rec."No." <> '';
Image = Statistics;
ShortCutKey = 'F7';
Visible = true;
ToolTip = 'View statistical information, such as the value of posted entries, for the record.';
RunObject = Page "Sales Statistics";
RunPageOnRec = true;
}
action(CustomerStatistics)
{
ApplicationArea = Basic, Suite;
Caption = 'Customer Statistics';
Image = Statistics;
RunObject = Page "Customer Statistics";
RunPageLink = "No." = field("Sell-to Customer No."),
"Date Filter" = field("Date Filter");
ToolTip = 'View statistical information, such as the value of posted entries, for the sell-to customer on the sales document.';
}
action("Co&mments")
{
ApplicationArea = Comments;
Caption = 'Co&mments';
Image = ViewComments;
RunObject = Page "Sales Comment Sheet";
RunPageLink = "Document Type" = field("Document Type"),
"No." = field("No."),
"Document Line No." = const(0);
ToolTip = 'View or add comments for the record.';
}
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.ShowDocDim();
end;
}
action(Approvals)
{
AccessByPermission = TableData "Approval Entry" = R;
ApplicationArea = Suite;
Caption = 'Approvals';
Image = Approvals;
ToolTip = 'View a list of the records that are waiting to be approved. For example, you can see who requested the record to be approved, when it was sent, and when it is due to be approved.';
trigger OnAction()
var
ApprovalsMgmt: Codeunit "Approvals Mgmt.";
begin
ApprovalsMgmt.OpenApprovalsSales(Rec);
end;
}
action(CustomerAction)
{
ApplicationArea = Basic, Suite;
Caption = 'Customer';
Enabled = CustomerSelected;
Image = Customer;
RunObject = Page "Customer Card";
RunPageLink = "No." = field("Sell-to Customer No."),
"Date Filter" = field("Date Filter");
Scope = Repeater;
ShortCutKey = 'Shift+F7';
ToolTip = 'View or edit detailed information about the customer.';
}
}
action("Posted Sales Invoices")
{
ApplicationArea = Basic, Suite;
Caption = 'Posted Sales Invoices';
Image = Documents;
RunObject = Page "Posted Sales Invoices";
AboutTitle = 'Get to the posted sales invoices';
AboutText = 'From the list of posted sales invoices, you can overview all invoices that were finalized, and also see which of them are paid or canceled.';
ToolTip = 'Open the list of posted sales invoices to view details or make adjustments.';
}
}
area(processing)
{
group(Invoice)
{
Caption = '&Invoice';
Image = Invoice;
}
group(Release)
{
Caption = 'Release';
Image = ReleaseDoc;
action("Re&lease")
{
ApplicationArea = Basic, Suite;
Caption = 'Re&lease';
Image = ReleaseDoc;
ShortCutKey = 'Ctrl+F9';
ToolTip = 'Release the document to the next stage of processing. You must reopen the document before you can make changes to it.';
trigger OnAction()
var
SalesHeader: Record "Sales Header";
begin
CurrPage.SetSelectionFilter(SalesHeader);
Rec.PerformManualRelease(SalesHeader);
end;
}
action("Re&open")
{
ApplicationArea = Basic, Suite;
Caption = 'Re&open';
Image = ReOpen;
ToolTip = 'Reopen the document to change it after it has been approved. Approved documents have the Released status and must be opened before they can be changed.';
trigger OnAction()
var
SalesHeader: Record "Sales Header";
begin
CurrPage.SetSelectionFilter(SalesHeader);
Rec.PerformManualReopen(SalesHeader);
end;
}
}
group("Request Approval")
{
Caption = 'Request Approval';
Image = "Action";
action(SendApprovalRequest)
{
ApplicationArea = Basic, Suite;
Caption = 'Send A&pproval Request';
Enabled = not OpenApprovalEntriesExist and CanRequestApprovalForFlow;
Image = SendApprovalRequest;
ToolTip = 'Request approval of the document.';
trigger OnAction()
var
ApprovalsMgmt: Codeunit "Approvals Mgmt.";
begin
if ApprovalsMgmt.CheckSalesApprovalPossible(Rec) then
ApprovalsMgmt.OnSendSalesDocForApproval(Rec);
end;
}
action(CancelApprovalRequest)
{
ApplicationArea = Basic, Suite;
Caption = 'Cancel Approval Re&quest';
Enabled = CanCancelApprovalForRecord or CanCancelApprovalForFlow;
Image = CancelApprovalRequest;
ToolTip = 'Cancel the approval request.';
trigger OnAction()
var
ApprovalsMgmt: Codeunit "Approvals Mgmt.";
WorkflowWebhookManagement: Codeunit "Workflow Webhook Management";
begin
ApprovalsMgmt.OnCancelSalesApprovalRequest(Rec);
WorkflowWebhookManagement.FindAndCancel(Rec.RecordId);
end;
}
}
group("P&osting")
{
Caption = 'P&osting';
Image = Post;
action("Test Report")
{
ApplicationArea = Basic, Suite;
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.PrintSalesHeader(Rec);
end;
}
action(Post)
{
ApplicationArea = Basic, Suite;
Caption = 'P&ost';
Image = PostOrder;
ShortCutKey = 'F9';
AboutTitle = 'Post an invoice';
AboutText = 'You post an invoice when you''ve completed all its details. This action posts the selected invoice, and you can later send it to the customer if needed.';
ToolTip = 'Finalize the document or journal by posting the amounts and quantities to the related accounts in your company books.';
trigger OnAction()
var
SalesHeader: Record "Sales Header";
SalesBatchPostMgt: Codeunit "Sales Batch Post Mgt.";
begin
CurrPage.SetSelectionFilter(SalesHeader);
if SalesHeader.Count > 1 then
SalesBatchPostMgt.RunWithUI(SalesHeader, Rec.Count, ReadyToPostQst)
else
PostDocument(CODEUNIT::"Sales-Post (Yes/No)");
end;
}
action("Post &Batch")
{
ApplicationArea = Basic, Suite;
Caption = 'Post &Batch';
Ellipsis = true;
Image = PostBatch;
ToolTip = 'Post several documents at once. A report request window opens where you can specify which documents to post.';
trigger OnAction()
var
SalesHeader: Record "Sales Header";
SelectionFilterManagement: Codeunit SelectionFilterManagement;
begin
CurrPage.SetSelectionFilter(SalesHeader);
SalesHeader.SetFilter("No.", SelectionFilterManagement.GetSelectionFilterForSalesHeader(SalesHeader));
REPORT.RunModal(REPORT::"Batch Post Sales Invoices", true, true, SalesHeader);
CurrPage.Update(false);
end;
}
action(PostAndSend)
{
ApplicationArea = Basic, Suite;
Caption = 'Post and &Send';
Ellipsis = true;
Image = PostSendTo;
ToolTip = 'Finalize and prepare to send the document according to the customer''s sending profile, such as attached to an email. The Send document to window opens first so you can confirm or select a sending profile.';
trigger OnAction()
begin
LinesInstructionMgt.SalesCheckAllLinesHaveQuantityAssigned(Rec);
PostDocument(CODEUNIT::"Sales-Post and Send");
end;
}
action("Remove From Job Queue")
{
ApplicationArea = All;
Caption = 'Remove From Job Queue';
Image = RemoveLine;
//The property 'PromotedCategory' can only be set if the property 'Promoted' is set to 'true'
//PromotedCategory = Category5;
ToolTip = 'Remove the scheduled processing of this record from the job queue.';
Visible = JobQueueActive;
trigger OnAction()
begin
Rec.CancelBackgroundPosting();
end;
}
action(Preview)
{
ApplicationArea = Basic, Suite;
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();
end;
}
}
}
area(reporting)
{
group(Reports)
{
Caption = 'Reports';
Image = "Report";
group(FinanceReports)
{
Caption = 'Finance Reports';
Image = "Report";
action("Report Statement")
{
ApplicationArea = Basic, Suite;
Caption = 'Statement';
Image = "Report";
RunObject = Report "Customer Statement";
}
action("Customer - Balance to Date")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer - Balance to Date';
Image = "Report";
RunObject = Report "Customer - Balance to Date";
}
action("Customer - Trial Balance")
{
ApplicationArea = Suite;
Caption = 'Customer - Trial Balance';
Image = "Report";
RunObject = Report "Customer - Trial Balance";
}
action("Customer - Detail Trial Bal.")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer - Detail Trial Bal.';
Image = "Report";
RunObject = Report "Customer - Detail Trial Bal.";
}
action("Customer - Summary Aging")
{
ApplicationArea = Suite;
Caption = 'Customer - Summary Aging';
Image = "Report";
RunObject = Report "Customer - Summary Aging";
}
action("Customer - Detailed Aging")
{
ApplicationArea = Suite;
Caption = 'Customer - Detailed Aging';
Image = "Report";
RunObject = Report "Customer Detailed Aging";
}
#if not CLEAN28
action("Aged Accounts Receivable")
{
ApplicationArea = Basic, Suite;
Caption = 'Aged Accounts Receivable (Obsolete)';
Image = "Report";
RunObject = Report "Aged Accounts Receivable";
ToolTip = 'View an overview of when customer payments are due or overdue, divided into four periods. You must specify the date you want aging calculated from and the length of the period that each column will contain data for.';
ObsoleteState = Pending;
ObsoleteReason = 'This report has been replaced by the report Aged Accounts Receivable (Excel). This report will be removed in a future release.';
ObsoleteTag = '28.0';
}
#endif
action("Customer - Payment Receipt")
{
ApplicationArea = Suite;
Caption = 'Customer - Payment Receipt';
Image = "Report";
RunObject = Report "Customer - Payment Receipt";
}
}
group(SalesReports)
{
Caption = 'Sales Reports';
Image = "Report";
#if not CLEAN28
action("Customer - Top 10 List")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer - Top 10 List (Obsolete)';
Image = "Report";
RunObject = Report "Customer - Top 10 List";
ToolTip = 'View which customers purchase the most or owe the most in a selected period. Only customers that have either purchases during the period or a balance at the end of the period will be included.';
ObsoleteState = Pending;
ObsoleteReason = 'This report has been replaced by the report Customer - Top List (Excel). This report will be removed in a future release.';
ObsoleteTag = '28.0';
}
#endif
#if not CLEAN28
action("Customer - Sales List")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer - Sales List';
Image = "Report";
RunObject = Report "Customer - Sales List";
ToolTip = 'View customer sales for a period, for example, to report sales activity to customs and tax authorities. You can choose to include only customers with total sales that exceed a minimum amount. You can also specify whether you want the report to show address details for each customer.';
ObsoleteState = Pending;
ObsoleteReason = 'This report is obsolete and will be removed in a future version.';
ObsoleteTag = '28.0';
}
#endif
#if not CLEAN28
action("Sales Statistics")
{
ApplicationArea = Basic, Suite;
Caption = 'Sales Statistics';
Image = "Report";
RunObject = Report "Sales Statistics";
ToolTip = 'View the customer''s total cost, sale, and profit over time, for example, to analyze earnings trends. The report shows amounts for original and adjusted cost, sales, profit, invoice discount, payment discount, and profit percentage in three adjustable periods.';
ObsoleteState = Pending;
ObsoleteReason = 'This report is obsolete and will be removed in a future version.';
ObsoleteTag = '28.0';
}
#endif
}
}
}
area(Promoted)
{
group(Category_Category4)
{
Caption = 'Release', Comment = 'Generated from the PromotedActionCategories property index 3.';
ShowAs = SplitButton;
actionref("Re&lease_Promoted"; "Re&lease")
{
}
actionref("Re&open_Promoted"; "Re&open")
{
}
}
group(Category_Category5)
{
Caption = 'Posting', Comment = 'Generated from the PromotedActionCategories property index 4.';
ShowAs = SplitButton;
actionref(Post_Promoted; Post)
{
}
actionref("Post &Batch_Promoted"; "Post &Batch")
{
}
actionref(PostAndSend_Promoted; PostAndSend)
{
}
actionref(Preview_Promoted; Preview)
{
}
}
group(Category_Category7)
{
Caption = 'Request Approval', Comment = 'Generated from the PromotedActionCategories property index 6.';
}
group(Category_Category6)
{
Caption = 'Invoice', Comment = 'Generated from the PromotedActionCategories property index 5.';
actionref(Dimensions_Promoted; Dimensions)
{
}
actionref(SalesStatistics_Promoted; SalesStatistics)
{
}
actionref("Co&mments_Promoted"; "Co&mments")
{
}
actionref(Approvals_Promoted; Approvals)
{
}
separator(Navigate_Separator)
{
}
actionref(CustomerAction_Promoted; CustomerAction)
{
}
actionref("Posted Sales Invoices_Promoted"; "Posted Sales Invoices")
{
}
}
group(Category_Category8)
{
Caption = 'Navigate', Comment = 'Generated from the PromotedActionCategories property index 7.';
}
group(Category_Report)
{
Caption = 'Report', Comment = 'Generated from the PromotedActionCategories property index 2.';
}
}
}
trigger OnAfterGetCurrRecord()
begin
SetControlAppearance();
CurrPage.IncomingDocAttachFactBox.PAGE.LoadDataFromRecord(Rec);
end;
trigger OnAfterGetRecord()
begin
StatusStyleTxt := Rec.GetStatusStyleText();
end;
trigger OnOpenPage()
var
SalesSetup: Record "Sales & Receivables Setup";
begin
Rec.SetSecurityFilterOnRespCenter();
JobQueueActive := SalesSetup.JobQueueActive();
Rec.CopySellToCustomerFilter();
end;
var
ApplicationAreaMgmtFacade: Codeunit "Application Area Mgmt. Facade";
ReportPrint: Codeunit "Test Report-Print";
LinesInstructionMgt: Codeunit "Lines Instruction Mgt.";
OpenApprovalEntriesExist: Boolean;
CanCancelApprovalForRecord: Boolean;
CanRequestApprovalForFlow: Boolean;
CanCancelApprovalForFlow: Boolean;
CustomerSelected: Boolean;
StatusStyleTxt: Text;
OpenPostedSalesInvQst: Label 'The invoice is posted as number %1 and moved to the Posted Sales Invoice window.\\Do you want to open the posted invoice?', Comment = '%1 = posted document number';
ReadyToPostQst: Label 'The number of invoices that will be posted is %1. \Do you want to continue?', Comment = '%1 - selected count';
protected var
JobQueueActive: Boolean;
/// <summary>
/// Shows a preview of the posting result for the selected invoice.
/// </summary>
procedure ShowPreview()
var
SelectedSalesHeader: Record "Sales Header";
SalesPostYesNo: Codeunit "Sales-Post (Yes/No)";
begin
CurrPage.SetSelectionFilter(SelectedSalesHeader);
SalesPostYesNo.MessageIfPostingPreviewMultipleDocuments(SelectedSalesHeader, Rec."No.");
SalesPostYesNo.Preview(Rec);
end;
local procedure SetControlAppearance()
var
ApprovalsMgmt: Codeunit "Approvals Mgmt.";
WorkflowWebhookManagement: Codeunit "Workflow Webhook Management";
begin
OpenApprovalEntriesExist := ApprovalsMgmt.HasOpenApprovalEntries(Rec.RecordId);
CanCancelApprovalForRecord := ApprovalsMgmt.CanCancelApprovalForRecord(Rec.RecordId);
WorkflowWebhookManagement.GetCanRequestAndCanCancel(Rec.RecordId, CanRequestApprovalForFlow, CanCancelApprovalForFlow);
CustomerSelected := Rec."Sell-to Customer No." <> '';
end;
protected procedure PostDocument(PostingCodeunitID: Integer)
var
PreAssignedNo: Code[20];
xLastPostingNo: Code[20];
IsHandled: Boolean;
begin
LinesInstructionMgt.SalesCheckAllLinesHaveQuantityAssigned(Rec);
PreAssignedNo := Rec."No.";
xLastPostingNo := Rec."Last Posting No.";
Rec.SendToPosting(PostingCodeunitID);
IsHandled := false;
OnPostDocumentBeforeNavigateAfterPosting(Rec, PostingCodeunitID, IsHandled);
if IsHandled then
exit;
if ApplicationAreaMgmtFacade.IsFoundationEnabled() then
ShowPostedConfirmationMessage(PreAssignedNo, xLastPostingNo);
end;
local procedure ShowPostedConfirmationMessage(PreAssignedNo: Code[20]; xLastPostingNo: Code[20])
var
SalesInvoiceHeader: Record "Sales Invoice Header";
InstructionMgt: Codeunit "Instruction Mgt.";
begin
if (Rec."Last Posting No." <> '') and (Rec."Last Posting No." <> xLastPostingNo) then
SalesInvoiceHeader.SetRange("No.", Rec."Last Posting No.")
else begin
SalesInvoiceHeader.SetCurrentKey("Pre-Assigned No.");
SalesInvoiceHeader.SetRange("Pre-Assigned No.", PreAssignedNo);
end;
if SalesInvoiceHeader.FindFirst() then
if InstructionMgt.ShowConfirm(StrSubstNo(OpenPostedSalesInvQst, SalesInvoiceHeader."No."),
InstructionMgt.ShowPostedConfirmationMessageCode())
then
InstructionMgt.ShowPostedDocument(SalesInvoiceHeader, Page::"Sales Invoice List");
end;
[IntegrationEvent(true, false)]
local procedure OnPostDocumentBeforeNavigateAfterPosting(var SalesHeader: Record "Sales Header"; var PostingCodeunitID: Integer; var IsHandled: Boolean)
begin
end;
}